author | drw <drw> | 2004-03-02 21:03:59 (UTC) |
---|---|---|
committer | drw <drw> | 2004-03-02 21:03:59 (UTC) |
commit | 0a67659dce57ac1475841838369e924f2441e991 (patch) (unidiff) | |
tree | 394d6b89ba3262033e481020953196123399492a | |
parent | 9631067183b4cafa2ea07d2202bf88f4d42c35e2 (diff) | |
download | opie-0a67659dce57ac1475841838369e924f2441e991.zip opie-0a67659dce57ac1475841838369e924f2441e991.tar.gz opie-0a67659dce57ac1475841838369e924f2441e991.tar.bz2 |
DrawPad: libopie -> libopie2
-rw-r--r-- | noncore/graphics/drawpad/config.in | 2 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpad.cpp | 10 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpad.h | 3 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpad.pro | 2 | ||||
-rw-r--r-- | noncore/graphics/drawpad/exportdialog.cpp | 6 | ||||
-rw-r--r-- | noncore/graphics/drawpad/importdialog.cpp | 8 | ||||
-rw-r--r-- | noncore/graphics/drawpad/importdialog.h | 7 | ||||
-rw-r--r-- | noncore/graphics/drawpad/main.cpp | 2 | ||||
-rw-r--r-- | noncore/graphics/drawpad/opie-drawpad.control | 2 |
9 files changed, 21 insertions, 21 deletions
diff --git a/noncore/graphics/drawpad/config.in b/noncore/graphics/drawpad/config.in index 290a642..3ed03a4 100644 --- a/noncore/graphics/drawpad/config.in +++ b/noncore/graphics/drawpad/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config DRAWPAD | 1 | config DRAWPAD |
2 | boolean "opie-drawpad (take simple notes or draw images)" | 2 | boolean "opie-drawpad (take simple notes or draw images)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI && LIBQTAUX |
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp index 9f0e27f..55b23cc 100644 --- a/noncore/graphics/drawpad/drawpad.cpp +++ b/noncore/graphics/drawpad/drawpad.cpp | |||
@@ -1,99 +1,99 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * DrawPad - a drawing program for Opie Environment * | 3 | * DrawPad - a drawing program for Opie Environment * |
4 | * * | 4 | * * |
5 | * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * | 5 | * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * |
6 | * * | 6 | * * |
7 | * This program is free software; you can redistribute it and/or modify * | 7 | * This program is free software; you can redistribute it and/or modify * |
8 | * it under the terms of the GNU General Public License as published by * | 8 | * it under the terms of the GNU General Public License as published by * |
9 | * the Free Software Foundation; either version 2 of the License, or * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | * * | 11 | * * |
12 | ***************************************************************************/ | 12 | ***************************************************************************/ |
13 | 13 | ||
14 | #include "drawpad.h" | 14 | #include "drawpad.h" |
15 | 15 | ||
16 | #include "drawpadcanvas.h" | 16 | #include "drawpadcanvas.h" |
17 | #include "ellipsetool.h" | 17 | #include "ellipsetool.h" |
18 | #include "erasetool.h" | 18 | #include "erasetool.h" |
19 | #include "exportdialog.h" | 19 | #include "exportdialog.h" |
20 | #include "filledellipsetool.h" | 20 | #include "filledellipsetool.h" |
21 | #include "filledrectangletool.h" | 21 | #include "filledrectangletool.h" |
22 | #include "filltool.h" | 22 | #include "filltool.h" |
23 | #include "importdialog.h" | 23 | #include "importdialog.h" |
24 | #include "linetool.h" | 24 | #include "linetool.h" |
25 | #include "newpagedialog.h" | 25 | #include "newpagedialog.h" |
26 | #include "page.h" | 26 | #include "page.h" |
27 | #include "pageinformationdialog.h" | 27 | #include "pageinformationdialog.h" |
28 | #include "pointtool.h" | 28 | #include "pointtool.h" |
29 | #include "rectangletool.h" | 29 | #include "rectangletool.h" |
30 | #include "texttool.h" | 30 | #include "texttool.h" |
31 | #include "thumbnailview.h" | 31 | #include "thumbnailview.h" |
32 | 32 | ||
33 | #include <opie/colordialog.h> | 33 | #include <opie2/qcolordialog.h> |
34 | #include <opie/colorpopupmenu.h> | 34 | #include <opie2/ocolorpopupmenu.h> |
35 | 35 | ||
36 | #include <qpe/applnk.h> | 36 | #include <qpe/applnk.h> |
37 | #include <qpe/config.h> | 37 | #include <qpe/config.h> |
38 | #include <qpe/qpetoolbar.h> | 38 | #include <qpe/qpetoolbar.h> |
39 | #include <qpe/resource.h> | 39 | #include <qpe/resource.h> |
40 | #include <qpe/qpeapplication.h> | 40 | #include <qpe/qpeapplication.h> |
41 | 41 | ||
42 | #include <qmenubar.h> | 42 | #include <qmenubar.h> |
43 | #include <qaction.h> | 43 | #include <qaction.h> |
44 | #include <qfile.h> | 44 | #include <qfile.h> |
45 | #include <qmessagebox.h> | 45 | #include <qmessagebox.h> |
46 | #include <qspinbox.h> | 46 | #include <qspinbox.h> |
47 | #include <qtoolbutton.h> | 47 | #include <qtoolbutton.h> |
48 | #include <qtooltip.h> | 48 | #include <qtooltip.h> |
49 | #include <qwhatsthis.h> | 49 | #include <qwhatsthis.h> |
50 | 50 | ||
51 | DrawPad::DrawPad(QWidget* parent, const char* name, WFlags fl ) | 51 | DrawPad::DrawPad(QWidget* parent, const char* name, WFlags /*fl*/ ) |
52 | : QMainWindow(parent, name, WStyle_ContextHelp) | 52 | : QMainWindow(parent, name, WStyle_ContextHelp) |
53 | { | 53 | { |
54 | // init members | 54 | // init members |
55 | 55 | ||
56 | m_pDrawPadCanvas = new DrawPadCanvas(this, this); | 56 | m_pDrawPadCanvas = new DrawPadCanvas(this, this); |
57 | 57 | ||
58 | connect(m_pDrawPadCanvas, SIGNAL(pagesChanged()), this, SLOT(updateView())); | 58 | connect(m_pDrawPadCanvas, SIGNAL(pagesChanged()), this, SLOT(updateView())); |
59 | 59 | ||
60 | setCentralWidget(m_pDrawPadCanvas); | 60 | setCentralWidget(m_pDrawPadCanvas); |
61 | 61 | ||
62 | // init menu | 62 | // init menu |
63 | 63 | ||
64 | setToolBarsMovable(false); | 64 | setToolBarsMovable(false); |
65 | 65 | ||
66 | QToolBar* menuToolBar = new QToolBar(this); | 66 | QToolBar* menuToolBar = new QToolBar(this); |
67 | QMenuBar* menuBar = new QMenuBar(menuToolBar); | 67 | QMenuBar* menuBar = new QMenuBar(menuToolBar); |
68 | 68 | ||
69 | QPopupMenu* toolsPopupMenu = new QPopupMenu(menuBar); | 69 | QPopupMenu* toolsPopupMenu = new QPopupMenu(menuBar); |
70 | 70 | ||
71 | QAction* deleteAllAction = new QAction(tr("Delete All"), QString::null, 0, this); | 71 | QAction* deleteAllAction = new QAction(tr("Delete All"), QString::null, 0, this); |
72 | connect(deleteAllAction, SIGNAL(activated()), this, SLOT(deleteAll())); | 72 | connect(deleteAllAction, SIGNAL(activated()), this, SLOT(deleteAll())); |
73 | deleteAllAction->addTo(toolsPopupMenu); | 73 | deleteAllAction->addTo(toolsPopupMenu); |
74 | 74 | ||
75 | toolsPopupMenu->insertSeparator(); | 75 | toolsPopupMenu->insertSeparator(); |
76 | 76 | ||
77 | QAction* importPageAction = new QAction(tr("Import"), tr("Import..."), 0, this); | 77 | QAction* importPageAction = new QAction(tr("Import"), tr("Import..."), 0, this); |
78 | connect(importPageAction, SIGNAL(activated()), this, SLOT(importPage())); | 78 | connect(importPageAction, SIGNAL(activated()), this, SLOT(importPage())); |
79 | importPageAction->addTo(toolsPopupMenu); | 79 | importPageAction->addTo(toolsPopupMenu); |
80 | 80 | ||
81 | QAction* exportPageAction = new QAction(tr("Export"), tr("Export..."), 0, this); | 81 | QAction* exportPageAction = new QAction(tr("Export"), tr("Export..."), 0, this); |
82 | connect(exportPageAction, SIGNAL(activated()), this, SLOT(exportPage())); | 82 | connect(exportPageAction, SIGNAL(activated()), this, SLOT(exportPage())); |
83 | exportPageAction->addTo(toolsPopupMenu); | 83 | exportPageAction->addTo(toolsPopupMenu); |
84 | 84 | ||
85 | toolsPopupMenu->insertSeparator(); | 85 | toolsPopupMenu->insertSeparator(); |
86 | 86 | ||
87 | QAction* thumbnailViewAction = new QAction(tr("Thumbnail View"), tr("Thumbnail View..."), 0, this); | 87 | QAction* thumbnailViewAction = new QAction(tr("Thumbnail View"), tr("Thumbnail View..."), 0, this); |
88 | connect(thumbnailViewAction, SIGNAL(activated()), this, SLOT(thumbnailView())); | 88 | connect(thumbnailViewAction, SIGNAL(activated()), this, SLOT(thumbnailView())); |
89 | thumbnailViewAction->addTo(toolsPopupMenu); | 89 | thumbnailViewAction->addTo(toolsPopupMenu); |
90 | 90 | ||
91 | QAction* pageInformationAction = new QAction(tr("Page Information"), tr("Page Information..."), 0, this); | 91 | QAction* pageInformationAction = new QAction(tr("Page Information"), tr("Page Information..."), 0, this); |
92 | connect(pageInformationAction, SIGNAL(activated()), this, SLOT(pageInformation())); | 92 | connect(pageInformationAction, SIGNAL(activated()), this, SLOT(pageInformation())); |
93 | pageInformationAction->addTo(toolsPopupMenu); | 93 | pageInformationAction->addTo(toolsPopupMenu); |
94 | 94 | ||
95 | toolsPopupMenu->insertSeparator(); | 95 | toolsPopupMenu->insertSeparator(); |
96 | 96 | ||
97 | m_pAntiAliasingAction = new QAction(tr("Anti-Aliasing"), QString::null, 0, this); | 97 | m_pAntiAliasingAction = new QAction(tr("Anti-Aliasing"), QString::null, 0, this); |
98 | m_pAntiAliasingAction->setToggleAction(true); | 98 | m_pAntiAliasingAction->setToggleAction(true); |
99 | m_pAntiAliasingAction->addTo(toolsPopupMenu); | 99 | m_pAntiAliasingAction->addTo(toolsPopupMenu); |
@@ -210,110 +210,110 @@ DrawPad::DrawPad(QWidget* parent, const char* name, WFlags fl ) | |||
210 | m_pFilledEllipseToolAction->addTo(ellipsePopupMenu); | 210 | m_pFilledEllipseToolAction->addTo(ellipsePopupMenu); |
211 | 211 | ||
212 | m_pEllipseToolButton->setPopup(ellipsePopupMenu); | 212 | m_pEllipseToolButton->setPopup(ellipsePopupMenu); |
213 | m_pEllipseToolButton->setPopupDelay(0); | 213 | m_pEllipseToolButton->setPopupDelay(0); |
214 | 214 | ||
215 | m_pTextToolAction = new QAction(tr("Insert Text"), Resource::loadPixmap("drawpad/text"), QString::null, 0, this); | 215 | m_pTextToolAction = new QAction(tr("Insert Text"), Resource::loadPixmap("drawpad/text"), QString::null, 0, this); |
216 | m_pTextToolAction->setToggleAction(true); | 216 | m_pTextToolAction->setToggleAction(true); |
217 | connect(m_pTextToolAction, SIGNAL(activated()), this, SLOT(setTextTool())); | 217 | connect(m_pTextToolAction, SIGNAL(activated()), this, SLOT(setTextTool())); |
218 | m_pTextToolAction->addTo(drawModeToolBar); | 218 | m_pTextToolAction->addTo(drawModeToolBar); |
219 | m_pTextToolAction->setWhatsThis( tr( "Click here to select the text drawing tool." ) ); | 219 | m_pTextToolAction->setWhatsThis( tr( "Click here to select the text drawing tool." ) ); |
220 | 220 | ||
221 | m_pFillToolAction = new QAction(tr("Fill Region"), Resource::loadPixmap("drawpad/fill"), QString::null, 0, this); | 221 | m_pFillToolAction = new QAction(tr("Fill Region"), Resource::loadPixmap("drawpad/fill"), QString::null, 0, this); |
222 | m_pFillToolAction->setToggleAction(true); | 222 | m_pFillToolAction->setToggleAction(true); |
223 | connect(m_pFillToolAction, SIGNAL(activated()), this, SLOT(setFillTool())); | 223 | connect(m_pFillToolAction, SIGNAL(activated()), this, SLOT(setFillTool())); |
224 | m_pFillToolAction->addTo(drawModeToolBar); | 224 | m_pFillToolAction->addTo(drawModeToolBar); |
225 | m_pFillToolAction->setWhatsThis( tr( "Click here to select the fill tool." ) ); | 225 | m_pFillToolAction->setWhatsThis( tr( "Click here to select the fill tool." ) ); |
226 | 226 | ||
227 | m_pEraseToolAction = new QAction(tr("Erase Point"), Resource::loadPixmap("drawpad/erase"), QString::null, 0, this); | 227 | m_pEraseToolAction = new QAction(tr("Erase Point"), Resource::loadPixmap("drawpad/erase"), QString::null, 0, this); |
228 | m_pEraseToolAction->setToggleAction(true); | 228 | m_pEraseToolAction->setToggleAction(true); |
229 | connect(m_pEraseToolAction, SIGNAL(activated()), this, SLOT(setEraseTool())); | 229 | connect(m_pEraseToolAction, SIGNAL(activated()), this, SLOT(setEraseTool())); |
230 | m_pEraseToolAction->addTo(drawModeToolBar); | 230 | m_pEraseToolAction->addTo(drawModeToolBar); |
231 | m_pEraseToolAction->setWhatsThis( tr( "Click here to select the eraser tool." ) ); | 231 | m_pEraseToolAction->setWhatsThis( tr( "Click here to select the eraser tool." ) ); |
232 | 232 | ||
233 | m_pTool = 0; | 233 | m_pTool = 0; |
234 | setRectangleTool(); | 234 | setRectangleTool(); |
235 | setEllipseTool(); | 235 | setEllipseTool(); |
236 | setPointTool(); | 236 | setPointTool(); |
237 | 237 | ||
238 | emptyToolBar = new QToolBar(this); | 238 | emptyToolBar = new QToolBar(this); |
239 | emptyToolBar->setHorizontalStretchable(true); | 239 | emptyToolBar->setHorizontalStretchable(true); |
240 | emptyToolBar->addSeparator(); | 240 | emptyToolBar->addSeparator(); |
241 | 241 | ||
242 | // init draw parameters toolbar | 242 | // init draw parameters toolbar |
243 | 243 | ||
244 | QToolBar* drawParametersToolBar = new QToolBar(this); | 244 | QToolBar* drawParametersToolBar = new QToolBar(this); |
245 | 245 | ||
246 | m_pPenWidthSpinBox = new QSpinBox(1, 9, 1, drawParametersToolBar); | 246 | m_pPenWidthSpinBox = new QSpinBox(1, 9, 1, drawParametersToolBar); |
247 | connect(m_pPenWidthSpinBox, SIGNAL(valueChanged(int)), this, SLOT(changePenWidth(int))); | 247 | connect(m_pPenWidthSpinBox, SIGNAL(valueChanged(int)), this, SLOT(changePenWidth(int))); |
248 | 248 | ||
249 | QToolTip::add(m_pPenWidthSpinBox, tr("Pen Width")); | 249 | QToolTip::add(m_pPenWidthSpinBox, tr("Pen Width")); |
250 | m_pPenWidthSpinBox->setValue(1); | 250 | m_pPenWidthSpinBox->setValue(1); |
251 | m_pPenWidthSpinBox->setFocusPolicy(QWidget::NoFocus); | 251 | m_pPenWidthSpinBox->setFocusPolicy(QWidget::NoFocus); |
252 | QWhatsThis::add( m_pPenWidthSpinBox, tr( "Click here to select the width of the drawing pen." ) ); | 252 | QWhatsThis::add( m_pPenWidthSpinBox, tr( "Click here to select the width of the drawing pen." ) ); |
253 | 253 | ||
254 | m_pPenColorToolButton = new QToolButton(drawParametersToolBar); | 254 | m_pPenColorToolButton = new QToolButton(drawParametersToolBar); |
255 | m_pPenColorToolButton->setPixmap(Resource::loadPixmap("drawpad/pencolor")); | 255 | m_pPenColorToolButton->setPixmap(Resource::loadPixmap("drawpad/pencolor")); |
256 | QWhatsThis::add( m_pPenColorToolButton, tr( "Click here to select the color used when drawing." ) ); | 256 | QWhatsThis::add( m_pPenColorToolButton, tr( "Click here to select the color used when drawing." ) ); |
257 | 257 | ||
258 | OColorPopupMenu* penColorPopupMenu = new OColorPopupMenu(Qt::black, m_pPenColorToolButton); | 258 | Opie::OColorPopupMenu* penColorPopupMenu = new Opie::OColorPopupMenu(Qt::black, m_pPenColorToolButton); |
259 | connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, SLOT(changePenColor(const QColor&))); | 259 | connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, SLOT(changePenColor(const QColor&))); |
260 | 260 | ||
261 | QToolTip::add(m_pPenColorToolButton, tr("Pen Color")); | 261 | QToolTip::add(m_pPenColorToolButton, tr("Pen Color")); |
262 | m_pPenColorToolButton->setPopup(penColorPopupMenu); | 262 | m_pPenColorToolButton->setPopup(penColorPopupMenu); |
263 | m_pPenColorToolButton->setPopupDelay(0); | 263 | m_pPenColorToolButton->setPopupDelay(0); |
264 | 264 | ||
265 | changePenColor(Qt::black); | 265 | changePenColor(Qt::black); |
266 | 266 | ||
267 | m_pBrushColorToolButton = new QToolButton(drawParametersToolBar); | 267 | m_pBrushColorToolButton = new QToolButton(drawParametersToolBar); |
268 | m_pBrushColorToolButton->setPixmap(Resource::loadPixmap("drawpad/brushcolor")); | 268 | m_pBrushColorToolButton->setPixmap(Resource::loadPixmap("drawpad/brushcolor")); |
269 | QWhatsThis::add( m_pBrushColorToolButton, tr( "Click here to select the color used when filling in areas." ) ); | 269 | QWhatsThis::add( m_pBrushColorToolButton, tr( "Click here to select the color used when filling in areas." ) ); |
270 | 270 | ||
271 | OColorPopupMenu* brushColorPopupMenu = new OColorPopupMenu(Qt::white, m_pBrushColorToolButton); | 271 | Opie::OColorPopupMenu* brushColorPopupMenu = new Opie::OColorPopupMenu(Qt::white, m_pBrushColorToolButton); |
272 | connect(brushColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, SLOT(changeBrushColor(const QColor&))); | 272 | connect(brushColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, SLOT(changeBrushColor(const QColor&))); |
273 | 273 | ||
274 | QToolTip::add(m_pBrushColorToolButton, tr("Fill Color")); | 274 | QToolTip::add(m_pBrushColorToolButton, tr("Fill Color")); |
275 | m_pBrushColorToolButton->setPopup(brushColorPopupMenu); | 275 | m_pBrushColorToolButton->setPopup(brushColorPopupMenu); |
276 | m_pBrushColorToolButton->setPopupDelay(0); | 276 | m_pBrushColorToolButton->setPopupDelay(0); |
277 | 277 | ||
278 | changeBrushColor(Qt::white); | 278 | changeBrushColor(Qt::white); |
279 | 279 | ||
280 | finishStartup(); | 280 | finishStartup(); |
281 | } | 281 | } |
282 | 282 | ||
283 | 283 | ||
284 | void DrawPad::finishStartup() | 284 | void DrawPad::finishStartup() |
285 | { | 285 | { |
286 | // init pages | 286 | // init pages |
287 | 287 | ||
288 | QFile file(Global::applicationFileName("drawpad", "drawpad.xml")); | 288 | QFile file(Global::applicationFileName("drawpad", "drawpad.xml")); |
289 | 289 | ||
290 | if (file.open(IO_ReadOnly)) { | 290 | if (file.open(IO_ReadOnly)) { |
291 | m_pDrawPadCanvas->load(&file); | 291 | m_pDrawPadCanvas->load(&file); |
292 | file.close(); | 292 | file.close(); |
293 | } else { | 293 | } else { |
294 | m_pDrawPadCanvas->initialPage(); | 294 | m_pDrawPadCanvas->initialPage(); |
295 | } | 295 | } |
296 | 296 | ||
297 | loadConfig(); | 297 | loadConfig(); |
298 | 298 | ||
299 | } | 299 | } |
300 | 300 | ||
301 | DrawPad::~DrawPad() | 301 | DrawPad::~DrawPad() |
302 | { | 302 | { |
303 | saveConfig(); | 303 | saveConfig(); |
304 | 304 | ||
305 | QFile file(Global::applicationFileName("drawpad", "drawpad.xml")); | 305 | QFile file(Global::applicationFileName("drawpad", "drawpad.xml")); |
306 | 306 | ||
307 | if (file.open(IO_WriteOnly)) { | 307 | if (file.open(IO_WriteOnly)) { |
308 | m_pDrawPadCanvas->save(&file); | 308 | m_pDrawPadCanvas->save(&file); |
309 | file.close(); | 309 | file.close(); |
310 | } | 310 | } |
311 | } | 311 | } |
312 | 312 | ||
313 | bool DrawPad::antiAliasing() | 313 | bool DrawPad::antiAliasing() |
314 | { | 314 | { |
315 | return (m_pAntiAliasingAction->isOn()); | 315 | return (m_pAntiAliasingAction->isOn()); |
316 | } | 316 | } |
317 | 317 | ||
318 | void DrawPad::newPage() | 318 | void DrawPad::newPage() |
319 | { | 319 | { |
diff --git a/noncore/graphics/drawpad/drawpad.h b/noncore/graphics/drawpad/drawpad.h index 48d5225..8ba6e58 100644 --- a/noncore/graphics/drawpad/drawpad.h +++ b/noncore/graphics/drawpad/drawpad.h | |||
@@ -1,113 +1,112 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * DrawPad - a drawing program for Opie Environment * | 3 | * DrawPad - a drawing program for Opie Environment * |
4 | * * | 4 | * * |
5 | * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * | 5 | * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * |
6 | * * | 6 | * * |
7 | * This program is free software; you can redistribute it and/or modify * | 7 | * This program is free software; you can redistribute it and/or modify * |
8 | * it under the terms of the GNU General Public License as published by * | 8 | * it under the terms of the GNU General Public License as published by * |
9 | * the Free Software Foundation; either version 2 of the License, or * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | * * | 11 | * * |
12 | ***************************************************************************/ | 12 | ***************************************************************************/ |
13 | 13 | ||
14 | #ifndef DRAWPAD_H | 14 | #ifndef DRAWPAD_H |
15 | #define DRAWPAD_H | 15 | #define DRAWPAD_H |
16 | 16 | ||
17 | #include <qmainwindow.h> | 17 | #include <qmainwindow.h> |
18 | |||
19 | #include <qpen.h> | 18 | #include <qpen.h> |
20 | 19 | ||
21 | class DrawPadCanvas; | 20 | class DrawPadCanvas; |
22 | class Tool; | 21 | class Tool; |
23 | 22 | ||
24 | class QAction; | 23 | class QAction; |
25 | class QColor; | 24 | class QColor; |
26 | class QSpinBox; | 25 | class QSpinBox; |
27 | class QToolButton; | 26 | class QToolButton; |
28 | class QWidgetStack; | 27 | class QWidgetStack; |
29 | 28 | ||
30 | class DrawPad : public QMainWindow | 29 | class DrawPad : public QMainWindow |
31 | { | 30 | { |
32 | Q_OBJECT | 31 | Q_OBJECT |
33 | 32 | ||
34 | public: | 33 | public: |
35 | DrawPad(QWidget* parent = 0, const char* name = 0, WFlags fl = 0); | 34 | DrawPad(QWidget* parent = 0, const char* name = 0, WFlags fl = 0); |
36 | ~DrawPad(); | 35 | ~DrawPad(); |
37 | 36 | ||
38 | static QString appName() { return QString::fromLatin1("drawpad"); } | 37 | static QString appName() { return QString::fromLatin1("drawpad"); } |
39 | 38 | ||
40 | Tool* tool() { return m_pTool; } | 39 | Tool* tool() { return m_pTool; } |
41 | QPen pen() { return m_pen; } | 40 | QPen pen() { return m_pen; } |
42 | QBrush brush() { return m_brush; } | 41 | QBrush brush() { return m_brush; } |
43 | 42 | ||
44 | bool antiAliasing(); | 43 | bool antiAliasing(); |
45 | void finishStartup(); | 44 | void finishStartup(); |
46 | 45 | ||
47 | private slots: | 46 | private slots: |
48 | void newPage(); | 47 | void newPage(); |
49 | void clearPage(); | 48 | void clearPage(); |
50 | void deletePage(); | 49 | void deletePage(); |
51 | 50 | ||
52 | void setPointTool(); | 51 | void setPointTool(); |
53 | void setLineTool(); | 52 | void setLineTool(); |
54 | void setRectangleTool(); | 53 | void setRectangleTool(); |
55 | void setFilledRectangleTool(); | 54 | void setFilledRectangleTool(); |
56 | void setEllipseTool(); | 55 | void setEllipseTool(); |
57 | void setFilledEllipseTool(); | 56 | void setFilledEllipseTool(); |
58 | void setTextTool(); | 57 | void setTextTool(); |
59 | void setFillTool(); | 58 | void setFillTool(); |
60 | void setEraseTool(); | 59 | void setEraseTool(); |
61 | 60 | ||
62 | void changePenWidth(int value); | 61 | void changePenWidth(int value); |
63 | void changePenColor(const QColor& color); | 62 | void changePenColor(const QColor& color); |
64 | void changeBrushColor(const QColor& color); | 63 | void changeBrushColor(const QColor& color); |
65 | 64 | ||
66 | void updateView(); | 65 | void updateView(); |
67 | 66 | ||
68 | void deleteAll(); | 67 | void deleteAll(); |
69 | void importPage(); | 68 | void importPage(); |
70 | void exportPage(); | 69 | void exportPage(); |
71 | void thumbnailView(); | 70 | void thumbnailView(); |
72 | void pageInformation(); | 71 | void pageInformation(); |
73 | 72 | ||
74 | private: | 73 | private: |
75 | void loadConfig(); | 74 | void loadConfig(); |
76 | void saveConfig(); | 75 | void saveConfig(); |
77 | 76 | ||
78 | DrawPadCanvas* m_pDrawPadCanvas; | 77 | DrawPadCanvas* m_pDrawPadCanvas; |
79 | 78 | ||
80 | Tool* m_pTool; | 79 | Tool* m_pTool; |
81 | QPen m_pen; | 80 | QPen m_pen; |
82 | QBrush m_brush; | 81 | QBrush m_brush; |
83 | 82 | ||
84 | QAction* m_pAntiAliasingAction; | 83 | QAction* m_pAntiAliasingAction; |
85 | 84 | ||
86 | QAction* m_pUndoAction; | 85 | QAction* m_pUndoAction; |
87 | QAction* m_pRedoAction; | 86 | QAction* m_pRedoAction; |
88 | 87 | ||
89 | QAction* m_pFirstPageAction; | 88 | QAction* m_pFirstPageAction; |
90 | QAction* m_pPreviousPageAction; | 89 | QAction* m_pPreviousPageAction; |
91 | QAction* m_pNextPageAction; | 90 | QAction* m_pNextPageAction; |
92 | QAction* m_pLastPageAction; | 91 | QAction* m_pLastPageAction; |
93 | 92 | ||
94 | QAction* m_pPointToolAction; | 93 | QAction* m_pPointToolAction; |
95 | QAction* m_pLineToolAction; | 94 | QAction* m_pLineToolAction; |
96 | QAction* m_pRectangleToolAction; | 95 | QAction* m_pRectangleToolAction; |
97 | QAction* m_pFilledRectangleToolAction; | 96 | QAction* m_pFilledRectangleToolAction; |
98 | QAction* m_pEllipseToolAction; | 97 | QAction* m_pEllipseToolAction; |
99 | QAction* m_pFilledEllipseToolAction; | 98 | QAction* m_pFilledEllipseToolAction; |
100 | QAction* m_pTextToolAction; | 99 | QAction* m_pTextToolAction; |
101 | QAction* m_pFillToolAction; | 100 | QAction* m_pFillToolAction; |
102 | QAction* m_pEraseToolAction; | 101 | QAction* m_pEraseToolAction; |
103 | 102 | ||
104 | QToolButton* m_pLineToolButton; | 103 | QToolButton* m_pLineToolButton; |
105 | QToolButton* m_pRectangleToolButton; | 104 | QToolButton* m_pRectangleToolButton; |
106 | QToolButton* m_pEllipseToolButton; | 105 | QToolButton* m_pEllipseToolButton; |
107 | QToolButton* m_pPenColorToolButton; | 106 | QToolButton* m_pPenColorToolButton; |
108 | QToolButton* m_pBrushColorToolButton; | 107 | QToolButton* m_pBrushColorToolButton; |
109 | 108 | ||
110 | QSpinBox* m_pPenWidthSpinBox; | 109 | QSpinBox* m_pPenWidthSpinBox; |
111 | }; | 110 | }; |
112 | 111 | ||
113 | #endif // DRAWPAD_H | 112 | #endif // DRAWPAD_H |
diff --git a/noncore/graphics/drawpad/drawpad.pro b/noncore/graphics/drawpad/drawpad.pro index 30b2199..5e6ca6b 100644 --- a/noncore/graphics/drawpad/drawpad.pro +++ b/noncore/graphics/drawpad/drawpad.pro | |||
@@ -1,47 +1,47 @@ | |||
1 | CONFIG = qt warn_on release quick-app | 1 | CONFIG = qt warn_on release quick-app |
2 | HEADERS = drawpad.h \ | 2 | HEADERS = drawpad.h \ |
3 | drawpadcanvas.h \ | 3 | drawpadcanvas.h \ |
4 | ellipsetool.h \ | 4 | ellipsetool.h \ |
5 | erasetool.h \ | 5 | erasetool.h \ |
6 | exportdialog.h \ | 6 | exportdialog.h \ |
7 | filltool.h \ | 7 | filltool.h \ |
8 | filledellipsetool.h \ | 8 | filledellipsetool.h \ |
9 | filledrectangletool.h \ | 9 | filledrectangletool.h \ |
10 | importdialog.h \ | 10 | importdialog.h \ |
11 | linetool.h \ | 11 | linetool.h \ |
12 | newpagedialog.h \ | 12 | newpagedialog.h \ |
13 | page.h \ | 13 | page.h \ |
14 | pageinformationdialog.h \ | 14 | pageinformationdialog.h \ |
15 | pointtool.h \ | 15 | pointtool.h \ |
16 | rectangletool.h \ | 16 | rectangletool.h \ |
17 | shapetool.h \ | 17 | shapetool.h \ |
18 | texttool.h \ | 18 | texttool.h \ |
19 | thumbnailview.h \ | 19 | thumbnailview.h \ |
20 | tool.h | 20 | tool.h |
21 | SOURCES = drawpad.cpp \ | 21 | SOURCES = drawpad.cpp \ |
22 | drawpadcanvas.cpp \ | 22 | drawpadcanvas.cpp \ |
23 | ellipsetool.cpp \ | 23 | ellipsetool.cpp \ |
24 | erasetool.cpp \ | 24 | erasetool.cpp \ |
25 | exportdialog.cpp \ | 25 | exportdialog.cpp \ |
26 | filltool.cpp \ | 26 | filltool.cpp \ |
27 | filledellipsetool.cpp \ | 27 | filledellipsetool.cpp \ |
28 | filledrectangletool.cpp \ | 28 | filledrectangletool.cpp \ |
29 | importdialog.cpp \ | 29 | importdialog.cpp \ |
30 | linetool.cpp \ | 30 | linetool.cpp \ |
31 | main.cpp \ | 31 | main.cpp \ |
32 | newpagedialog.cpp \ | 32 | newpagedialog.cpp \ |
33 | page.cpp \ | 33 | page.cpp \ |
34 | pageinformationdialog.cpp \ | 34 | pageinformationdialog.cpp \ |
35 | pointtool.cpp \ | 35 | pointtool.cpp \ |
36 | rectangletool.cpp \ | 36 | rectangletool.cpp \ |
37 | shapetool.cpp \ | 37 | shapetool.cpp \ |
38 | texttool.cpp \ | 38 | texttool.cpp \ |
39 | thumbnailview.cpp \ | 39 | thumbnailview.cpp \ |
40 | tool.cpp | 40 | tool.cpp |
41 | INCLUDEPATH+= $(OPIEDIR)/include | 41 | INCLUDEPATH+= $(OPIEDIR)/include |
42 | DEPENDPATH+= $(OPIEDIR)/include | 42 | DEPENDPATH+= $(OPIEDIR)/include |
43 | LIBS += -lqpe -lopie | 43 | LIBS += -lqpe -lopiecore2 -lopieui2 -lqtaux2 |
44 | 44 | ||
45 | TARGET = drawpad | 45 | TARGET = drawpad |
46 | 46 | ||
47 | include ( $(OPIEDIR)/include.pro ) | 47 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/graphics/drawpad/exportdialog.cpp b/noncore/graphics/drawpad/exportdialog.cpp index d63f428..169acef 100644 --- a/noncore/graphics/drawpad/exportdialog.cpp +++ b/noncore/graphics/drawpad/exportdialog.cpp | |||
@@ -1,118 +1,118 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * DrawPad - a drawing program for Opie Environment * | 3 | * DrawPad - a drawing program for Opie Environment * |
4 | * * | 4 | * * |
5 | * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * | 5 | * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * |
6 | * * | 6 | * * |
7 | * This program is free software; you can redistribute it and/or modify * | 7 | * This program is free software; you can redistribute it and/or modify * |
8 | * it under the terms of the GNU General Public License as published by * | 8 | * it under the terms of the GNU General Public License as published by * |
9 | * the Free Software Foundation; either version 2 of the License, or * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | * * | 11 | * * |
12 | ***************************************************************************/ | 12 | ***************************************************************************/ |
13 | 13 | ||
14 | #include "exportdialog.h" | 14 | #include "exportdialog.h" |
15 | 15 | ||
16 | #include <opie/ofileselector.h> | 16 | #include <opie2/ofileselector.h> |
17 | 17 | ||
18 | #include <qbuttongroup.h> | 18 | #include <qbuttongroup.h> |
19 | #include <qcombobox.h> | 19 | #include <qcombobox.h> |
20 | #include <qimage.h> | 20 | #include <qimage.h> |
21 | #include <qlabel.h> | 21 | #include <qlabel.h> |
22 | #include <qlayout.h> | 22 | #include <qlayout.h> |
23 | #include <qlineedit.h> | 23 | #include <qlineedit.h> |
24 | #include <qradiobutton.h> | 24 | #include <qradiobutton.h> |
25 | #include <qspinbox.h> | 25 | #include <qspinbox.h> |
26 | 26 | ||
27 | #include <stdlib.h> | 27 | #include <stdlib.h> |
28 | 28 | ||
29 | ExportDialog::ExportDialog(uint pageAt, uint pageCount, QWidget* parent, const char* name) | 29 | ExportDialog::ExportDialog(uint pageAt, uint pageCount, QWidget* parent, const char* name) |
30 | : QDialog(parent, name, true) | 30 | : QDialog(parent, name, true) |
31 | { | 31 | { |
32 | setCaption(tr("DrawPad - Export")); | 32 | setCaption(tr("DrawPad - Export")); |
33 | 33 | ||
34 | m_pageAt = pageAt; | 34 | m_pageAt = pageAt; |
35 | m_pageCount = pageCount; | 35 | m_pageCount = pageCount; |
36 | 36 | ||
37 | QButtonGroup* selectionButtonGroup = new QButtonGroup(0, Qt::Vertical, tr("Page Selection"), this); | 37 | QButtonGroup* selectionButtonGroup = new QButtonGroup(0, Qt::Vertical, tr("Page Selection"), this); |
38 | connect(selectionButtonGroup, SIGNAL(pressed(int)), this, SLOT(selectionChanged(int))); | 38 | connect(selectionButtonGroup, SIGNAL(pressed(int)), this, SLOT(selectionChanged(int))); |
39 | 39 | ||
40 | QRadioButton* selectAllRadioButton = new QRadioButton(tr("All"), selectionButtonGroup); | 40 | QRadioButton* selectAllRadioButton = new QRadioButton(tr("All"), selectionButtonGroup); |
41 | QRadioButton* selectCurrentRadioButton = new QRadioButton(tr("Current"), selectionButtonGroup); | 41 | QRadioButton* selectCurrentRadioButton = new QRadioButton(tr("Current"), selectionButtonGroup); |
42 | QRadioButton* selectRangeRadioButton = new QRadioButton(tr("Range"), selectionButtonGroup); | 42 | QRadioButton* selectRangeRadioButton = new QRadioButton(tr("Range"), selectionButtonGroup); |
43 | 43 | ||
44 | QLabel* toLabel = new QLabel(tr("To:"), selectionButtonGroup); | 44 | QLabel* toLabel = new QLabel(tr("To:"), selectionButtonGroup); |
45 | 45 | ||
46 | m_pFromPageSpinBox = new QSpinBox(1, m_pageCount, 1, selectionButtonGroup); | 46 | m_pFromPageSpinBox = new QSpinBox(1, m_pageCount, 1, selectionButtonGroup); |
47 | connect(m_pFromPageSpinBox, SIGNAL(valueChanged(int)), this, SLOT(fromPageChanged(int))); | 47 | connect(m_pFromPageSpinBox, SIGNAL(valueChanged(int)), this, SLOT(fromPageChanged(int))); |
48 | 48 | ||
49 | m_pToPageSpinBox = new QSpinBox(1, m_pageCount, 1, selectionButtonGroup); | 49 | m_pToPageSpinBox = new QSpinBox(1, m_pageCount, 1, selectionButtonGroup); |
50 | connect(m_pToPageSpinBox, SIGNAL(valueChanged(int)), this, SLOT(toPageChanged(int))); | 50 | connect(m_pToPageSpinBox, SIGNAL(valueChanged(int)), this, SLOT(toPageChanged(int))); |
51 | 51 | ||
52 | selectionButtonGroup->setButton(1); | 52 | selectionButtonGroup->setButton(1); |
53 | selectionChanged(1); | 53 | selectionChanged(1); |
54 | 54 | ||
55 | m_pFromPageSpinBox->setValue(pageAt); | 55 | m_pFromPageSpinBox->setValue(pageAt); |
56 | m_pToPageSpinBox->setValue(pageAt); | 56 | m_pToPageSpinBox->setValue(pageAt); |
57 | 57 | ||
58 | QGroupBox* exportGroupBox = new QGroupBox(0, Qt::Vertical, tr("Export As"), this); | 58 | QGroupBox* exportGroupBox = new QGroupBox(0, Qt::Vertical, tr("Export As"), this); |
59 | 59 | ||
60 | QLabel* nameLabel = new QLabel(tr("Name:"), exportGroupBox); | 60 | QLabel* nameLabel = new QLabel(tr("Name:"), exportGroupBox); |
61 | QLabel* formatLabel = new QLabel(tr("Format:"), exportGroupBox); | 61 | QLabel* formatLabel = new QLabel(tr("Format:"), exportGroupBox); |
62 | 62 | ||
63 | m_pNameLineEdit = new QLineEdit(exportGroupBox); | 63 | m_pNameLineEdit = new QLineEdit(exportGroupBox); |
64 | 64 | ||
65 | m_pFormatComboBox = new QComboBox(exportGroupBox); | 65 | m_pFormatComboBox = new QComboBox(exportGroupBox); |
66 | m_pFormatComboBox->insertStrList(QImageIO::outputFormats()); | 66 | m_pFormatComboBox->insertStrList(QImageIO::outputFormats()); |
67 | 67 | ||
68 | MimeTypes types; types.insert( tr("All Images"), "image/*" ); | 68 | MimeTypes types; types.insert( tr("All Images"), "image/*" ); |
69 | OFileSelector* fileSelector = new OFileSelector(this, OFileSelector::FileSelector, | 69 | Opie::OFileSelector* fileSelector = new Opie::OFileSelector(this, Opie::OFileSelector::FileSelector, |
70 | OFileSelector::Normal, | 70 | Opie::OFileSelector::Normal, |
71 | QString::null, QString::null, | 71 | QString::null, QString::null, |
72 | types ); | 72 | types ); |
73 | fileSelector->setNameVisible( false ); | 73 | fileSelector->setNameVisible( false ); |
74 | 74 | ||
75 | QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); | 75 | QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); |
76 | selectionButtonGroup->layout()->setSpacing(4); | 76 | selectionButtonGroup->layout()->setSpacing(4); |
77 | exportGroupBox->layout()->setSpacing(4); | 77 | exportGroupBox->layout()->setSpacing(4); |
78 | QGridLayout* selectionLayout = new QGridLayout(selectionButtonGroup->layout(), 2, 2); | 78 | QGridLayout* selectionLayout = new QGridLayout(selectionButtonGroup->layout(), 2, 2); |
79 | QHBoxLayout* rangeLayout = new QHBoxLayout(); | 79 | QHBoxLayout* rangeLayout = new QHBoxLayout(); |
80 | QGridLayout* exportLayout = new QGridLayout(exportGroupBox->layout(), 2, 2); | 80 | QGridLayout* exportLayout = new QGridLayout(exportGroupBox->layout(), 2, 2); |
81 | 81 | ||
82 | selectionLayout->addWidget(selectAllRadioButton, 0, 0); | 82 | selectionLayout->addWidget(selectAllRadioButton, 0, 0); |
83 | selectionLayout->addWidget(selectCurrentRadioButton, 1, 0); | 83 | selectionLayout->addWidget(selectCurrentRadioButton, 1, 0); |
84 | selectionLayout->addWidget(selectRangeRadioButton, 0, 1); | 84 | selectionLayout->addWidget(selectRangeRadioButton, 0, 1); |
85 | selectionLayout->addLayout(rangeLayout, 1, 1); | 85 | selectionLayout->addLayout(rangeLayout, 1, 1); |
86 | 86 | ||
87 | rangeLayout->addWidget(m_pFromPageSpinBox); | 87 | rangeLayout->addWidget(m_pFromPageSpinBox); |
88 | rangeLayout->addWidget(toLabel); | 88 | rangeLayout->addWidget(toLabel); |
89 | rangeLayout->addWidget(m_pToPageSpinBox); | 89 | rangeLayout->addWidget(m_pToPageSpinBox); |
90 | 90 | ||
91 | exportLayout->addWidget(nameLabel, 0, 0); | 91 | exportLayout->addWidget(nameLabel, 0, 0); |
92 | exportLayout->addWidget(formatLabel, 1, 0); | 92 | exportLayout->addWidget(formatLabel, 1, 0); |
93 | 93 | ||
94 | exportLayout->addWidget(m_pNameLineEdit, 0, 1); | 94 | exportLayout->addWidget(m_pNameLineEdit, 0, 1); |
95 | exportLayout->addWidget(m_pFormatComboBox, 1, 1); | 95 | exportLayout->addWidget(m_pFormatComboBox, 1, 1); |
96 | 96 | ||
97 | exportLayout->setColStretch(1, 1); | 97 | exportLayout->setColStretch(1, 1); |
98 | 98 | ||
99 | mainLayout->addWidget(selectionButtonGroup); | 99 | mainLayout->addWidget(selectionButtonGroup); |
100 | mainLayout->addWidget(exportGroupBox); | 100 | mainLayout->addWidget(exportGroupBox); |
101 | mainLayout->addWidget(fileSelector); | 101 | mainLayout->addWidget(fileSelector); |
102 | 102 | ||
103 | m_pNameLineEdit->setFocus(); | 103 | m_pNameLineEdit->setFocus(); |
104 | } | 104 | } |
105 | 105 | ||
106 | ExportDialog::~ExportDialog() | 106 | ExportDialog::~ExportDialog() |
107 | { | 107 | { |
108 | } | 108 | } |
109 | 109 | ||
110 | uint ExportDialog::selectedFromPage() | 110 | uint ExportDialog::selectedFromPage() |
111 | { | 111 | { |
112 | return (m_pFromPageSpinBox->value()); | 112 | return (m_pFromPageSpinBox->value()); |
113 | } | 113 | } |
114 | 114 | ||
115 | uint ExportDialog::selectedToPage() | 115 | uint ExportDialog::selectedToPage() |
116 | { | 116 | { |
117 | return (m_pToPageSpinBox->value()); | 117 | return (m_pToPageSpinBox->value()); |
118 | } | 118 | } |
diff --git a/noncore/graphics/drawpad/importdialog.cpp b/noncore/graphics/drawpad/importdialog.cpp index ce2e7ee..4fc0a0e 100644 --- a/noncore/graphics/drawpad/importdialog.cpp +++ b/noncore/graphics/drawpad/importdialog.cpp | |||
@@ -1,80 +1,80 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * DrawPad - a drawing program for Opie Environment * | 3 | * DrawPad - a drawing program for Opie Environment * |
4 | * * | 4 | * * |
5 | * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * | 5 | * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * |
6 | * * | 6 | * * |
7 | * This program is free software; you can redistribute it and/or modify * | 7 | * This program is free software; you can redistribute it and/or modify * |
8 | * it under the terms of the GNU General Public License as published by * | 8 | * it under the terms of the GNU General Public License as published by * |
9 | * the Free Software Foundation; either version 2 of the License, or * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | * * | 11 | * * |
12 | ***************************************************************************/ | 12 | ***************************************************************************/ |
13 | 13 | ||
14 | #include "importdialog.h" | 14 | #include "importdialog.h" |
15 | 15 | ||
16 | #include <opie/ofileselector.h> | 16 | #include <qpe/mimetype.h> |
17 | 17 | ||
18 | #include <qcheckbox.h> | 18 | #include <qcheckbox.h> |
19 | #include <qimage.h> | 19 | #include <qimage.h> |
20 | #include <qlabel.h> | 20 | #include <qlabel.h> |
21 | #include <qlayout.h> | 21 | #include <qlayout.h> |
22 | #include <qpushbutton.h> | 22 | #include <qpushbutton.h> |
23 | 23 | ||
24 | ImportDialog::ImportDialog(QWidget* parent, const char* name) | 24 | ImportDialog::ImportDialog(QWidget* parent, const char* name) |
25 | : QDialog(parent, name, true) | 25 | : QDialog(parent, name, true) |
26 | { | 26 | { |
27 | setCaption(tr("DrawPad - Import")); | 27 | setCaption(tr("DrawPad - Import")); |
28 | 28 | ||
29 | MimeTypes types; types.insert( tr("All images"),"image/*" ); | 29 | MimeTypes types; types.insert( tr("All images"),"image/*" ); |
30 | m_pFileSelector = new OFileSelector(this, | 30 | m_pFileSelector = new Opie::OFileSelector(this, |
31 | OFileSelector::FileSelector, | 31 | Opie::OFileSelector::FileSelector, |
32 | OFileSelector::Normal, | 32 | Opie::OFileSelector::Normal, |
33 | QString::null, | 33 | QString::null, |
34 | QString::null, types ); | 34 | QString::null, types ); |
35 | m_pFileSelector->setNameVisible( false ); | 35 | m_pFileSelector->setNameVisible( false ); |
36 | connect(m_pFileSelector, SIGNAL(fileSelected(const DocLnk&)), this, SLOT(fileChanged())); | 36 | connect(m_pFileSelector, SIGNAL(fileSelected(const DocLnk&)), this, SLOT(fileChanged())); |
37 | 37 | ||
38 | m_pPreviewLabel = new QLabel(this); | 38 | m_pPreviewLabel = new QLabel(this); |
39 | m_pPreviewLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken); | 39 | m_pPreviewLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken); |
40 | m_pPreviewLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); | 40 | m_pPreviewLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); |
41 | m_pPreviewLabel->setFixedSize(114, 114); | 41 | m_pPreviewLabel->setFixedSize(114, 114); |
42 | m_pPreviewLabel->setBackgroundMode(QWidget::PaletteMid); | 42 | m_pPreviewLabel->setBackgroundMode(QWidget::PaletteMid); |
43 | 43 | ||
44 | m_pAutomaticPreviewCheckBox = new QCheckBox(tr("Automatic preview"), this); | 44 | m_pAutomaticPreviewCheckBox = new QCheckBox(tr("Automatic preview"), this); |
45 | m_pAutomaticPreviewCheckBox->setChecked(true); | 45 | m_pAutomaticPreviewCheckBox->setChecked(true); |
46 | 46 | ||
47 | QPushButton* previewPushButton = new QPushButton(tr("Preview"), this); | 47 | QPushButton* previewPushButton = new QPushButton(tr("Preview"), this); |
48 | connect(previewPushButton, SIGNAL(clicked()), this, SLOT(preview())); | 48 | connect(previewPushButton, SIGNAL(clicked()), this, SLOT(preview())); |
49 | 49 | ||
50 | QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); | 50 | QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); |
51 | QHBoxLayout* previewLayout = new QHBoxLayout(4); | 51 | QHBoxLayout* previewLayout = new QHBoxLayout(4); |
52 | QVBoxLayout* previewSecondLayout = new QVBoxLayout(4); | 52 | QVBoxLayout* previewSecondLayout = new QVBoxLayout(4); |
53 | 53 | ||
54 | previewSecondLayout->addWidget(m_pAutomaticPreviewCheckBox); | 54 | previewSecondLayout->addWidget(m_pAutomaticPreviewCheckBox); |
55 | previewSecondLayout->addWidget(previewPushButton); | 55 | previewSecondLayout->addWidget(previewPushButton); |
56 | previewSecondLayout->addStretch(); | 56 | previewSecondLayout->addStretch(); |
57 | 57 | ||
58 | previewLayout->addWidget(m_pPreviewLabel); | 58 | previewLayout->addWidget(m_pPreviewLabel); |
59 | previewLayout->addLayout(previewSecondLayout); | 59 | previewLayout->addLayout(previewSecondLayout); |
60 | 60 | ||
61 | mainLayout->addWidget(m_pFileSelector); | 61 | mainLayout->addWidget(m_pFileSelector); |
62 | mainLayout->addLayout(previewLayout); | 62 | mainLayout->addLayout(previewLayout); |
63 | 63 | ||
64 | preview(); | 64 | preview(); |
65 | } | 65 | } |
66 | 66 | ||
67 | ImportDialog::~ImportDialog() | 67 | ImportDialog::~ImportDialog() |
68 | { | 68 | { |
69 | } | 69 | } |
70 | 70 | ||
71 | const DocLnk* ImportDialog::selected() | 71 | const DocLnk* ImportDialog::selected() |
72 | { | 72 | { |
73 | // FIXME change from pointer to reference -zecke | 73 | // FIXME change from pointer to reference -zecke |
74 | DocLnk *lnk = new DocLnk( m_pFileSelector->selectedDocument() ); | 74 | DocLnk *lnk = new DocLnk( m_pFileSelector->selectedDocument() ); |
75 | return lnk; | 75 | return lnk; |
76 | } | 76 | } |
77 | 77 | ||
78 | void ImportDialog::fileChanged() | 78 | void ImportDialog::fileChanged() |
79 | { | 79 | { |
80 | if (m_pAutomaticPreviewCheckBox->isChecked()) { | 80 | if (m_pAutomaticPreviewCheckBox->isChecked()) { |
diff --git a/noncore/graphics/drawpad/importdialog.h b/noncore/graphics/drawpad/importdialog.h index ed655a5..16227d2 100644 --- a/noncore/graphics/drawpad/importdialog.h +++ b/noncore/graphics/drawpad/importdialog.h | |||
@@ -1,45 +1,46 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * DrawPad - a drawing program for Opie Environment * | 3 | * DrawPad - a drawing program for Opie Environment * |
4 | * * | 4 | * * |
5 | * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * | 5 | * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * |
6 | * * | 6 | * * |
7 | * This program is free software; you can redistribute it and/or modify * | 7 | * This program is free software; you can redistribute it and/or modify * |
8 | * it under the terms of the GNU General Public License as published by * | 8 | * it under the terms of the GNU General Public License as published by * |
9 | * the Free Software Foundation; either version 2 of the License, or * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | * * | 11 | * * |
12 | ***************************************************************************/ | 12 | ***************************************************************************/ |
13 | 13 | ||
14 | #ifndef IMPORTDIALOG_H | 14 | #ifndef IMPORTDIALOG_H |
15 | #define IMPORTDIALOG_H | 15 | #define IMPORTDIALOG_H |
16 | 16 | ||
17 | #include <opie2/ofileselector.h> | ||
18 | |||
17 | #include <qdialog.h> | 19 | #include <qdialog.h> |
18 | 20 | ||
19 | class DocLnk; | 21 | class DocLnk; |
20 | class OFileSelector; | ||
21 | 22 | ||
22 | class QCheckBox; | 23 | class QCheckBox; |
23 | class QLabel; | 24 | class QLabel; |
24 | 25 | ||
25 | class ImportDialog : public QDialog | 26 | class ImportDialog : public QDialog |
26 | { | 27 | { |
27 | Q_OBJECT | 28 | Q_OBJECT |
28 | 29 | ||
29 | public: | 30 | public: |
30 | ImportDialog(QWidget* parent = 0, const char* name = 0); | 31 | ImportDialog(QWidget* parent = 0, const char* name = 0); |
31 | ~ImportDialog(); | 32 | ~ImportDialog(); |
32 | 33 | ||
33 | const DocLnk* selected(); | 34 | const DocLnk* selected(); |
34 | 35 | ||
35 | private slots: | 36 | private slots: |
36 | void fileChanged(); | 37 | void fileChanged(); |
37 | void preview(); | 38 | void preview(); |
38 | 39 | ||
39 | private: | 40 | private: |
40 | OFileSelector* m_pFileSelector; | 41 | Opie::OFileSelector* m_pFileSelector; |
41 | QLabel* m_pPreviewLabel; | 42 | QLabel* m_pPreviewLabel; |
42 | QCheckBox* m_pAutomaticPreviewCheckBox; | 43 | QCheckBox* m_pAutomaticPreviewCheckBox; |
43 | }; | 44 | }; |
44 | 45 | ||
45 | #endif // IMPORTDIALOG_H | 46 | #endif // IMPORTDIALOG_H |
diff --git a/noncore/graphics/drawpad/main.cpp b/noncore/graphics/drawpad/main.cpp index c87cc0f..a6c666b 100644 --- a/noncore/graphics/drawpad/main.cpp +++ b/noncore/graphics/drawpad/main.cpp | |||
@@ -1,18 +1,18 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * DrawPad - a drawing program for Opie Environment * | 3 | * DrawPad - a drawing program for Opie Environment * |
4 | * * | 4 | * * |
5 | * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * | 5 | * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * |
6 | * * | 6 | * * |
7 | * This program is free software; you can redistribute it and/or modify * | 7 | * This program is free software; you can redistribute it and/or modify * |
8 | * it under the terms of the GNU General Public License as published by * | 8 | * it under the terms of the GNU General Public License as published by * |
9 | * the Free Software Foundation; either version 2 of the License, or * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | * * | 11 | * * |
12 | ***************************************************************************/ | 12 | ***************************************************************************/ |
13 | 13 | ||
14 | #include "drawpad.h" | 14 | #include "drawpad.h" |
15 | 15 | ||
16 | #include <opie/oapplicationfactory.h> | 16 | #include <opie2/oapplicationfactory.h> |
17 | 17 | ||
18 | OPIE_EXPORT_APP( OApplicationFactory<DrawPad> ) | 18 | OPIE_EXPORT_APP( OApplicationFactory<DrawPad> ) |
diff --git a/noncore/graphics/drawpad/opie-drawpad.control b/noncore/graphics/drawpad/opie-drawpad.control index f0aa0b4..2a403f9 100644 --- a/noncore/graphics/drawpad/opie-drawpad.control +++ b/noncore/graphics/drawpad/opie-drawpad.control | |||
@@ -1,12 +1,12 @@ | |||
1 | Package: opie-drawpad | 1 | Package: opie-drawpad |
2 | Files: plugins/application/libdrawpad.so* bin/drawpad apps/1Pim/drawpad.desktop pics/drawpad | 2 | Files: plugins/application/libdrawpad.so* bin/drawpad apps/1Pim/drawpad.desktop pics/drawpad |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/pim | 4 | Section: opie/pim |
5 | Maintainer: Sébastien Prud'homme <prudhomme@laposte.net> | 5 | Maintainer: Sébastien Prud'homme <prudhomme@laposte.net> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Depends: task-opie-minimal, libopie1 | 7 | Depends: task-opie-minimal, libopiecore2, libopieui2, libqtaux2 |
8 | Description: A note taking program with basic draw tools | 8 | Description: A note taking program with basic draw tools |
9 | DrawPad is an easy note taking program for Zaurus. It can also | 9 | DrawPad is an easy note taking program for Zaurus. It can also |
10 | be used to draw simple images. DrawPad was developed for the Opie | 10 | be used to draw simple images. DrawPad was developed for the Opie |
11 | project, an alternative to the standard Zaurus environment. | 11 | project, an alternative to the standard Zaurus environment. |
12 | Version: $QPE_VERSION$EXTRAVERSION | 12 | Version: $QPE_VERSION$EXTRAVERSION |