-rw-r--r-- | noncore/graphics/drawpad/drawpad.cpp | 4 | ||||
-rw-r--r-- | noncore/graphics/drawpad/exportdialog.cpp | 5 | ||||
-rw-r--r-- | noncore/graphics/drawpad/importdialog.cpp | 7 | ||||
-rw-r--r-- | noncore/graphics/drawpad/importdialog.h | 2 | ||||
-rw-r--r-- | noncore/graphics/drawpad/main.cpp | 2 |
5 files changed, 13 insertions, 7 deletions
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp index 55b23cc..3331193 100644 --- a/noncore/graphics/drawpad/drawpad.cpp +++ b/noncore/graphics/drawpad/drawpad.cpp | |||
@@ -1,663 +1,665 @@ | |||
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 <opie2/qcolordialog.h> | 33 | #include <opie2/qcolordialog.h> |
34 | #include <opie2/ocolorpopupmenu.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 <qtoolbar.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 | using namespace Opie::Ui; | ||
52 | using namespace Opie::Ui; | ||
51 | DrawPad::DrawPad(QWidget* parent, const char* name, WFlags /*fl*/ ) | 53 | DrawPad::DrawPad(QWidget* parent, const char* name, WFlags /*fl*/ ) |
52 | : QMainWindow(parent, name, WStyle_ContextHelp) | 54 | : QMainWindow(parent, name, WStyle_ContextHelp) |
53 | { | 55 | { |
54 | // init members | 56 | // init members |
55 | 57 | ||
56 | m_pDrawPadCanvas = new DrawPadCanvas(this, this); | 58 | m_pDrawPadCanvas = new DrawPadCanvas(this, this); |
57 | 59 | ||
58 | connect(m_pDrawPadCanvas, SIGNAL(pagesChanged()), this, SLOT(updateView())); | 60 | connect(m_pDrawPadCanvas, SIGNAL(pagesChanged()), this, SLOT(updateView())); |
59 | 61 | ||
60 | setCentralWidget(m_pDrawPadCanvas); | 62 | setCentralWidget(m_pDrawPadCanvas); |
61 | 63 | ||
62 | // init menu | 64 | // init menu |
63 | 65 | ||
64 | setToolBarsMovable(false); | 66 | setToolBarsMovable(false); |
65 | 67 | ||
66 | QToolBar* menuToolBar = new QToolBar(this); | 68 | QToolBar* menuToolBar = new QToolBar(this); |
67 | QMenuBar* menuBar = new QMenuBar(menuToolBar); | 69 | QMenuBar* menuBar = new QMenuBar(menuToolBar); |
68 | 70 | ||
69 | QPopupMenu* toolsPopupMenu = new QPopupMenu(menuBar); | 71 | QPopupMenu* toolsPopupMenu = new QPopupMenu(menuBar); |
70 | 72 | ||
71 | QAction* deleteAllAction = new QAction(tr("Delete All"), QString::null, 0, this); | 73 | QAction* deleteAllAction = new QAction(tr("Delete All"), QString::null, 0, this); |
72 | connect(deleteAllAction, SIGNAL(activated()), this, SLOT(deleteAll())); | 74 | connect(deleteAllAction, SIGNAL(activated()), this, SLOT(deleteAll())); |
73 | deleteAllAction->addTo(toolsPopupMenu); | 75 | deleteAllAction->addTo(toolsPopupMenu); |
74 | 76 | ||
75 | toolsPopupMenu->insertSeparator(); | 77 | toolsPopupMenu->insertSeparator(); |
76 | 78 | ||
77 | QAction* importPageAction = new QAction(tr("Import"), tr("Import..."), 0, this); | 79 | QAction* importPageAction = new QAction(tr("Import"), tr("Import..."), 0, this); |
78 | connect(importPageAction, SIGNAL(activated()), this, SLOT(importPage())); | 80 | connect(importPageAction, SIGNAL(activated()), this, SLOT(importPage())); |
79 | importPageAction->addTo(toolsPopupMenu); | 81 | importPageAction->addTo(toolsPopupMenu); |
80 | 82 | ||
81 | QAction* exportPageAction = new QAction(tr("Export"), tr("Export..."), 0, this); | 83 | QAction* exportPageAction = new QAction(tr("Export"), tr("Export..."), 0, this); |
82 | connect(exportPageAction, SIGNAL(activated()), this, SLOT(exportPage())); | 84 | connect(exportPageAction, SIGNAL(activated()), this, SLOT(exportPage())); |
83 | exportPageAction->addTo(toolsPopupMenu); | 85 | exportPageAction->addTo(toolsPopupMenu); |
84 | 86 | ||
85 | toolsPopupMenu->insertSeparator(); | 87 | toolsPopupMenu->insertSeparator(); |
86 | 88 | ||
87 | QAction* thumbnailViewAction = new QAction(tr("Thumbnail View"), tr("Thumbnail View..."), 0, this); | 89 | QAction* thumbnailViewAction = new QAction(tr("Thumbnail View"), tr("Thumbnail View..."), 0, this); |
88 | connect(thumbnailViewAction, SIGNAL(activated()), this, SLOT(thumbnailView())); | 90 | connect(thumbnailViewAction, SIGNAL(activated()), this, SLOT(thumbnailView())); |
89 | thumbnailViewAction->addTo(toolsPopupMenu); | 91 | thumbnailViewAction->addTo(toolsPopupMenu); |
90 | 92 | ||
91 | QAction* pageInformationAction = new QAction(tr("Page Information"), tr("Page Information..."), 0, this); | 93 | QAction* pageInformationAction = new QAction(tr("Page Information"), tr("Page Information..."), 0, this); |
92 | connect(pageInformationAction, SIGNAL(activated()), this, SLOT(pageInformation())); | 94 | connect(pageInformationAction, SIGNAL(activated()), this, SLOT(pageInformation())); |
93 | pageInformationAction->addTo(toolsPopupMenu); | 95 | pageInformationAction->addTo(toolsPopupMenu); |
94 | 96 | ||
95 | toolsPopupMenu->insertSeparator(); | 97 | toolsPopupMenu->insertSeparator(); |
96 | 98 | ||
97 | m_pAntiAliasingAction = new QAction(tr("Anti-Aliasing"), QString::null, 0, this); | 99 | m_pAntiAliasingAction = new QAction(tr("Anti-Aliasing"), QString::null, 0, this); |
98 | m_pAntiAliasingAction->setToggleAction(true); | 100 | m_pAntiAliasingAction->setToggleAction(true); |
99 | m_pAntiAliasingAction->addTo(toolsPopupMenu); | 101 | m_pAntiAliasingAction->addTo(toolsPopupMenu); |
100 | 102 | ||
101 | menuBar->insertItem(tr("Tools"), toolsPopupMenu); | 103 | menuBar->insertItem(tr("Tools"), toolsPopupMenu); |
102 | 104 | ||
103 | // init page toolbar | 105 | // init page toolbar |
104 | 106 | ||
105 | QToolBar* pageToolBar = new QToolBar(this); | 107 | QToolBar* pageToolBar = new QToolBar(this); |
106 | 108 | ||
107 | QAction* newPageAction = new QAction(tr("New Page"), Resource::loadPixmap("new"), QString::null, 0, this); | 109 | QAction* newPageAction = new QAction(tr("New Page"), Resource::loadPixmap("new"), QString::null, 0, this); |
108 | connect(newPageAction, SIGNAL(activated()), this, SLOT(newPage())); | 110 | connect(newPageAction, SIGNAL(activated()), this, SLOT(newPage())); |
109 | newPageAction->addTo(pageToolBar); | 111 | newPageAction->addTo(pageToolBar); |
110 | newPageAction->setWhatsThis( tr( "Click here to add a new sheet." ) ); | 112 | newPageAction->setWhatsThis( tr( "Click here to add a new sheet." ) ); |
111 | 113 | ||
112 | QAction* clearPageAction = new QAction(tr("Clear Page"), Resource::loadPixmap("drawpad/clear"), QString::null, 0, this); | 114 | QAction* clearPageAction = new QAction(tr("Clear Page"), Resource::loadPixmap("drawpad/clear"), QString::null, 0, this); |
113 | connect(clearPageAction, SIGNAL(activated()), this, SLOT(clearPage())); | 115 | connect(clearPageAction, SIGNAL(activated()), this, SLOT(clearPage())); |
114 | clearPageAction->addTo(pageToolBar); | 116 | clearPageAction->addTo(pageToolBar); |
115 | clearPageAction->setWhatsThis( tr( "Click here to erase the current sheet." ) ); | 117 | clearPageAction->setWhatsThis( tr( "Click here to erase the current sheet." ) ); |
116 | 118 | ||
117 | QAction* deletePageAction = new QAction(tr("Delete Page"), Resource::loadPixmap("trash"), QString::null, 0, this); | 119 | QAction* deletePageAction = new QAction(tr("Delete Page"), Resource::loadPixmap("trash"), QString::null, 0, this); |
118 | connect(deletePageAction, SIGNAL(activated()), this, SLOT(deletePage())); | 120 | connect(deletePageAction, SIGNAL(activated()), this, SLOT(deletePage())); |
119 | deletePageAction->addTo(pageToolBar); | 121 | deletePageAction->addTo(pageToolBar); |
120 | deletePageAction->setWhatsThis( tr( "Click here to remove the current sheet." ) ); | 122 | deletePageAction->setWhatsThis( tr( "Click here to remove the current sheet." ) ); |
121 | 123 | ||
122 | QToolBar* emptyToolBar = new QToolBar(this); | 124 | QToolBar* emptyToolBar = new QToolBar(this); |
123 | emptyToolBar->setHorizontalStretchable(true); | 125 | emptyToolBar->setHorizontalStretchable(true); |
124 | 126 | ||
125 | // init navigation toolbar | 127 | // init navigation toolbar |
126 | 128 | ||
127 | QToolBar* navigationToolBar = new QToolBar(this); | 129 | QToolBar* navigationToolBar = new QToolBar(this); |
128 | 130 | ||
129 | m_pUndoAction = new QAction(tr("Undo"), Resource::loadIconSet("undo"), QString::null, 0, this); | 131 | m_pUndoAction = new QAction(tr("Undo"), Resource::loadIconSet("undo"), QString::null, 0, this); |
130 | connect(m_pUndoAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(undo())); | 132 | connect(m_pUndoAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(undo())); |
131 | m_pUndoAction->addTo(navigationToolBar); | 133 | m_pUndoAction->addTo(navigationToolBar); |
132 | m_pUndoAction->setWhatsThis( tr( "Click here to undo the last action." ) ); | 134 | m_pUndoAction->setWhatsThis( tr( "Click here to undo the last action." ) ); |
133 | 135 | ||
134 | m_pRedoAction = new QAction(tr("Redo"), Resource::loadIconSet("redo"), QString::null, 0, this); | 136 | m_pRedoAction = new QAction(tr("Redo"), Resource::loadIconSet("redo"), QString::null, 0, this); |
135 | connect(m_pRedoAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(redo())); | 137 | connect(m_pRedoAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(redo())); |
136 | m_pRedoAction->addTo(navigationToolBar); | 138 | m_pRedoAction->addTo(navigationToolBar); |
137 | m_pRedoAction->setWhatsThis( tr( "Click here to re-perform the last action." ) ); | 139 | m_pRedoAction->setWhatsThis( tr( "Click here to re-perform the last action." ) ); |
138 | 140 | ||
139 | m_pFirstPageAction = new QAction(tr("First Page"), Resource::loadIconSet("fastback"), QString::null, 0, this); | 141 | m_pFirstPageAction = new QAction(tr("First Page"), Resource::loadIconSet("fastback"), QString::null, 0, this); |
140 | connect(m_pFirstPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(goFirstPage())); | 142 | connect(m_pFirstPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(goFirstPage())); |
141 | m_pFirstPageAction->addTo(navigationToolBar); | 143 | m_pFirstPageAction->addTo(navigationToolBar); |
142 | m_pFirstPageAction->setWhatsThis( tr( "Click here to view the first page." ) ); | 144 | m_pFirstPageAction->setWhatsThis( tr( "Click here to view the first page." ) ); |
143 | 145 | ||
144 | m_pPreviousPageAction = new QAction(tr("Previous Page"), Resource::loadIconSet("back"), QString::null, 0, this); | 146 | m_pPreviousPageAction = new QAction(tr("Previous Page"), Resource::loadIconSet("back"), QString::null, 0, this); |
145 | connect(m_pPreviousPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(goPreviousPage())); | 147 | connect(m_pPreviousPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(goPreviousPage())); |
146 | m_pPreviousPageAction->addTo(navigationToolBar); | 148 | m_pPreviousPageAction->addTo(navigationToolBar); |
147 | m_pPreviousPageAction->setWhatsThis( tr( "Click here to view the previous page." ) ); | 149 | m_pPreviousPageAction->setWhatsThis( tr( "Click here to view the previous page." ) ); |
148 | 150 | ||
149 | m_pNextPageAction = new QAction(tr("Next Page"), Resource::loadIconSet("forward"), QString::null, 0, this); | 151 | m_pNextPageAction = new QAction(tr("Next Page"), Resource::loadIconSet("forward"), QString::null, 0, this); |
150 | connect(m_pNextPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(goNextPage())); | 152 | connect(m_pNextPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(goNextPage())); |
151 | m_pNextPageAction->addTo(navigationToolBar); | 153 | m_pNextPageAction->addTo(navigationToolBar); |
152 | m_pNextPageAction->setWhatsThis( tr( "Click here to view the next page." ) ); | 154 | m_pNextPageAction->setWhatsThis( tr( "Click here to view the next page." ) ); |
153 | 155 | ||
154 | m_pLastPageAction = new QAction(tr("Last Page"), Resource::loadIconSet("fastforward"), QString::null, 0, this); | 156 | m_pLastPageAction = new QAction(tr("Last Page"), Resource::loadIconSet("fastforward"), QString::null, 0, this); |
155 | connect(m_pLastPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(goLastPage())); | 157 | connect(m_pLastPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(goLastPage())); |
156 | m_pLastPageAction->addTo(navigationToolBar); | 158 | m_pLastPageAction->addTo(navigationToolBar); |
157 | m_pLastPageAction->setWhatsThis( tr( "Click here to view the last page." ) ); | 159 | m_pLastPageAction->setWhatsThis( tr( "Click here to view the last page." ) ); |
158 | 160 | ||
159 | // init draw mode toolbar | 161 | // init draw mode toolbar |
160 | 162 | ||
161 | QToolBar* drawModeToolBar = new QToolBar(this); | 163 | QToolBar* drawModeToolBar = new QToolBar(this); |
162 | 164 | ||
163 | m_pLineToolButton = new QToolButton(drawModeToolBar); | 165 | m_pLineToolButton = new QToolButton(drawModeToolBar); |
164 | m_pLineToolButton->setToggleButton(true); | 166 | m_pLineToolButton->setToggleButton(true); |
165 | QWhatsThis::add( m_pLineToolButton, tr( "Click here to select one of the available tools to draw lines." ) ); | 167 | QWhatsThis::add( m_pLineToolButton, tr( "Click here to select one of the available tools to draw lines." ) ); |
166 | 168 | ||
167 | 169 | ||
168 | QPopupMenu* linePopupMenu = new QPopupMenu(m_pLineToolButton); | 170 | QPopupMenu* linePopupMenu = new QPopupMenu(m_pLineToolButton); |
169 | 171 | ||
170 | m_pPointToolAction = new QAction(tr("Draw Point"), Resource::loadPixmap("drawpad/point"), "", 0, this); | 172 | m_pPointToolAction = new QAction(tr("Draw Point"), Resource::loadPixmap("drawpad/point"), "", 0, this); |
171 | connect(m_pPointToolAction, SIGNAL(activated()), this, SLOT(setPointTool())); | 173 | connect(m_pPointToolAction, SIGNAL(activated()), this, SLOT(setPointTool())); |
172 | m_pPointToolAction->addTo(linePopupMenu); | 174 | m_pPointToolAction->addTo(linePopupMenu); |
173 | 175 | ||
174 | m_pLineToolAction = new QAction(tr("Draw Line"), Resource::loadPixmap("drawpad/line"), "", 0, this); | 176 | m_pLineToolAction = new QAction(tr("Draw Line"), Resource::loadPixmap("drawpad/line"), "", 0, this); |
175 | connect(m_pLineToolAction, SIGNAL(activated()), this, SLOT(setLineTool())); | 177 | connect(m_pLineToolAction, SIGNAL(activated()), this, SLOT(setLineTool())); |
176 | m_pLineToolAction->addTo(linePopupMenu); | 178 | m_pLineToolAction->addTo(linePopupMenu); |
177 | 179 | ||
178 | m_pLineToolButton->setPopup(linePopupMenu); | 180 | m_pLineToolButton->setPopup(linePopupMenu); |
179 | m_pLineToolButton->setPopupDelay(0); | 181 | m_pLineToolButton->setPopupDelay(0); |
180 | 182 | ||
181 | m_pRectangleToolButton = new QToolButton(drawModeToolBar); | 183 | m_pRectangleToolButton = new QToolButton(drawModeToolBar); |
182 | m_pRectangleToolButton->setToggleButton(true); | 184 | m_pRectangleToolButton->setToggleButton(true); |
183 | QWhatsThis::add( m_pRectangleToolButton, tr( "Click here to select one of the available tools to draw rectangles." ) ); | 185 | QWhatsThis::add( m_pRectangleToolButton, tr( "Click here to select one of the available tools to draw rectangles." ) ); |
184 | 186 | ||
185 | QPopupMenu* rectanglePopupMenu = new QPopupMenu(m_pRectangleToolButton); | 187 | QPopupMenu* rectanglePopupMenu = new QPopupMenu(m_pRectangleToolButton); |
186 | 188 | ||
187 | m_pRectangleToolAction = new QAction(tr("Draw Rectangle"), Resource::loadPixmap("drawpad/rectangle"), "", 0, this); | 189 | m_pRectangleToolAction = new QAction(tr("Draw Rectangle"), Resource::loadPixmap("drawpad/rectangle"), "", 0, this); |
188 | connect(m_pRectangleToolAction, SIGNAL(activated()), this, SLOT(setRectangleTool())); | 190 | connect(m_pRectangleToolAction, SIGNAL(activated()), this, SLOT(setRectangleTool())); |
189 | m_pRectangleToolAction->addTo(rectanglePopupMenu); | 191 | m_pRectangleToolAction->addTo(rectanglePopupMenu); |
190 | 192 | ||
191 | m_pFilledRectangleToolAction = new QAction(tr("Draw Filled Rectangle"), Resource::loadPixmap("drawpad/filledrectangle"), "", 0, this); | 193 | m_pFilledRectangleToolAction = new QAction(tr("Draw Filled Rectangle"), Resource::loadPixmap("drawpad/filledrectangle"), "", 0, this); |
192 | connect(m_pFilledRectangleToolAction, SIGNAL(activated()), this, SLOT(setFilledRectangleTool())); | 194 | connect(m_pFilledRectangleToolAction, SIGNAL(activated()), this, SLOT(setFilledRectangleTool())); |
193 | m_pFilledRectangleToolAction->addTo(rectanglePopupMenu); | 195 | m_pFilledRectangleToolAction->addTo(rectanglePopupMenu); |
194 | 196 | ||
195 | m_pRectangleToolButton->setPopup(rectanglePopupMenu); | 197 | m_pRectangleToolButton->setPopup(rectanglePopupMenu); |
196 | m_pRectangleToolButton->setPopupDelay(0); | 198 | m_pRectangleToolButton->setPopupDelay(0); |
197 | 199 | ||
198 | m_pEllipseToolButton = new QToolButton(drawModeToolBar); | 200 | m_pEllipseToolButton = new QToolButton(drawModeToolBar); |
199 | m_pEllipseToolButton->setToggleButton(true); | 201 | m_pEllipseToolButton->setToggleButton(true); |
200 | QWhatsThis::add( m_pEllipseToolButton, tr( "Click here to select one of the available tools to draw ellipses." ) ); | 202 | QWhatsThis::add( m_pEllipseToolButton, tr( "Click here to select one of the available tools to draw ellipses." ) ); |
201 | 203 | ||
202 | QPopupMenu* ellipsePopupMenu = new QPopupMenu(m_pEllipseToolButton); | 204 | QPopupMenu* ellipsePopupMenu = new QPopupMenu(m_pEllipseToolButton); |
203 | 205 | ||
204 | m_pEllipseToolAction = new QAction(tr("Draw Ellipse"), Resource::loadPixmap("drawpad/ellipse"), "", 0, this); | 206 | m_pEllipseToolAction = new QAction(tr("Draw Ellipse"), Resource::loadPixmap("drawpad/ellipse"), "", 0, this); |
205 | connect(m_pEllipseToolAction, SIGNAL(activated()), this, SLOT(setEllipseTool())); | 207 | connect(m_pEllipseToolAction, SIGNAL(activated()), this, SLOT(setEllipseTool())); |
206 | m_pEllipseToolAction->addTo(ellipsePopupMenu); | 208 | m_pEllipseToolAction->addTo(ellipsePopupMenu); |
207 | 209 | ||
208 | m_pFilledEllipseToolAction = new QAction(tr("Draw Filled Ellipse"), Resource::loadPixmap("drawpad/filledellipse"), "", 0, this); | 210 | m_pFilledEllipseToolAction = new QAction(tr("Draw Filled Ellipse"), Resource::loadPixmap("drawpad/filledellipse"), "", 0, this); |
209 | connect(m_pFilledEllipseToolAction, SIGNAL(activated()), this, SLOT(setFilledEllipseTool())); | 211 | connect(m_pFilledEllipseToolAction, SIGNAL(activated()), this, SLOT(setFilledEllipseTool())); |
210 | m_pFilledEllipseToolAction->addTo(ellipsePopupMenu); | 212 | m_pFilledEllipseToolAction->addTo(ellipsePopupMenu); |
211 | 213 | ||
212 | m_pEllipseToolButton->setPopup(ellipsePopupMenu); | 214 | m_pEllipseToolButton->setPopup(ellipsePopupMenu); |
213 | m_pEllipseToolButton->setPopupDelay(0); | 215 | m_pEllipseToolButton->setPopupDelay(0); |
214 | 216 | ||
215 | m_pTextToolAction = new QAction(tr("Insert Text"), Resource::loadPixmap("drawpad/text"), QString::null, 0, this); | 217 | m_pTextToolAction = new QAction(tr("Insert Text"), Resource::loadPixmap("drawpad/text"), QString::null, 0, this); |
216 | m_pTextToolAction->setToggleAction(true); | 218 | m_pTextToolAction->setToggleAction(true); |
217 | connect(m_pTextToolAction, SIGNAL(activated()), this, SLOT(setTextTool())); | 219 | connect(m_pTextToolAction, SIGNAL(activated()), this, SLOT(setTextTool())); |
218 | m_pTextToolAction->addTo(drawModeToolBar); | 220 | m_pTextToolAction->addTo(drawModeToolBar); |
219 | m_pTextToolAction->setWhatsThis( tr( "Click here to select the text drawing tool." ) ); | 221 | m_pTextToolAction->setWhatsThis( tr( "Click here to select the text drawing tool." ) ); |
220 | 222 | ||
221 | m_pFillToolAction = new QAction(tr("Fill Region"), Resource::loadPixmap("drawpad/fill"), QString::null, 0, this); | 223 | m_pFillToolAction = new QAction(tr("Fill Region"), Resource::loadPixmap("drawpad/fill"), QString::null, 0, this); |
222 | m_pFillToolAction->setToggleAction(true); | 224 | m_pFillToolAction->setToggleAction(true); |
223 | connect(m_pFillToolAction, SIGNAL(activated()), this, SLOT(setFillTool())); | 225 | connect(m_pFillToolAction, SIGNAL(activated()), this, SLOT(setFillTool())); |
224 | m_pFillToolAction->addTo(drawModeToolBar); | 226 | m_pFillToolAction->addTo(drawModeToolBar); |
225 | m_pFillToolAction->setWhatsThis( tr( "Click here to select the fill tool." ) ); | 227 | m_pFillToolAction->setWhatsThis( tr( "Click here to select the fill tool." ) ); |
226 | 228 | ||
227 | m_pEraseToolAction = new QAction(tr("Erase Point"), Resource::loadPixmap("drawpad/erase"), QString::null, 0, this); | 229 | m_pEraseToolAction = new QAction(tr("Erase Point"), Resource::loadPixmap("drawpad/erase"), QString::null, 0, this); |
228 | m_pEraseToolAction->setToggleAction(true); | 230 | m_pEraseToolAction->setToggleAction(true); |
229 | connect(m_pEraseToolAction, SIGNAL(activated()), this, SLOT(setEraseTool())); | 231 | connect(m_pEraseToolAction, SIGNAL(activated()), this, SLOT(setEraseTool())); |
230 | m_pEraseToolAction->addTo(drawModeToolBar); | 232 | m_pEraseToolAction->addTo(drawModeToolBar); |
231 | m_pEraseToolAction->setWhatsThis( tr( "Click here to select the eraser tool." ) ); | 233 | m_pEraseToolAction->setWhatsThis( tr( "Click here to select the eraser tool." ) ); |
232 | 234 | ||
233 | m_pTool = 0; | 235 | m_pTool = 0; |
234 | setRectangleTool(); | 236 | setRectangleTool(); |
235 | setEllipseTool(); | 237 | setEllipseTool(); |
236 | setPointTool(); | 238 | setPointTool(); |
237 | 239 | ||
238 | emptyToolBar = new QToolBar(this); | 240 | emptyToolBar = new QToolBar(this); |
239 | emptyToolBar->setHorizontalStretchable(true); | 241 | emptyToolBar->setHorizontalStretchable(true); |
240 | emptyToolBar->addSeparator(); | 242 | emptyToolBar->addSeparator(); |
241 | 243 | ||
242 | // init draw parameters toolbar | 244 | // init draw parameters toolbar |
243 | 245 | ||
244 | QToolBar* drawParametersToolBar = new QToolBar(this); | 246 | QToolBar* drawParametersToolBar = new QToolBar(this); |
245 | 247 | ||
246 | m_pPenWidthSpinBox = new QSpinBox(1, 9, 1, drawParametersToolBar); | 248 | m_pPenWidthSpinBox = new QSpinBox(1, 9, 1, drawParametersToolBar); |
247 | connect(m_pPenWidthSpinBox, SIGNAL(valueChanged(int)), this, SLOT(changePenWidth(int))); | 249 | connect(m_pPenWidthSpinBox, SIGNAL(valueChanged(int)), this, SLOT(changePenWidth(int))); |
248 | 250 | ||
249 | QToolTip::add(m_pPenWidthSpinBox, tr("Pen Width")); | 251 | QToolTip::add(m_pPenWidthSpinBox, tr("Pen Width")); |
250 | m_pPenWidthSpinBox->setValue(1); | 252 | m_pPenWidthSpinBox->setValue(1); |
251 | m_pPenWidthSpinBox->setFocusPolicy(QWidget::NoFocus); | 253 | m_pPenWidthSpinBox->setFocusPolicy(QWidget::NoFocus); |
252 | QWhatsThis::add( m_pPenWidthSpinBox, tr( "Click here to select the width of the drawing pen." ) ); | 254 | QWhatsThis::add( m_pPenWidthSpinBox, tr( "Click here to select the width of the drawing pen." ) ); |
253 | 255 | ||
254 | m_pPenColorToolButton = new QToolButton(drawParametersToolBar); | 256 | m_pPenColorToolButton = new QToolButton(drawParametersToolBar); |
255 | m_pPenColorToolButton->setPixmap(Resource::loadPixmap("drawpad/pencolor")); | 257 | m_pPenColorToolButton->setPixmap(Resource::loadPixmap("drawpad/pencolor")); |
256 | QWhatsThis::add( m_pPenColorToolButton, tr( "Click here to select the color used when drawing." ) ); | 258 | QWhatsThis::add( m_pPenColorToolButton, tr( "Click here to select the color used when drawing." ) ); |
257 | 259 | ||
258 | Opie::OColorPopupMenu* penColorPopupMenu = new Opie::OColorPopupMenu(Qt::black, m_pPenColorToolButton); | 260 | Opie::OColorPopupMenu* penColorPopupMenu = new Opie::OColorPopupMenu(Qt::black, m_pPenColorToolButton); |
259 | connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, SLOT(changePenColor(const QColor&))); | 261 | connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, SLOT(changePenColor(const QColor&))); |
260 | 262 | ||
261 | QToolTip::add(m_pPenColorToolButton, tr("Pen Color")); | 263 | QToolTip::add(m_pPenColorToolButton, tr("Pen Color")); |
262 | m_pPenColorToolButton->setPopup(penColorPopupMenu); | 264 | m_pPenColorToolButton->setPopup(penColorPopupMenu); |
263 | m_pPenColorToolButton->setPopupDelay(0); | 265 | m_pPenColorToolButton->setPopupDelay(0); |
264 | 266 | ||
265 | changePenColor(Qt::black); | 267 | changePenColor(Qt::black); |
266 | 268 | ||
267 | m_pBrushColorToolButton = new QToolButton(drawParametersToolBar); | 269 | m_pBrushColorToolButton = new QToolButton(drawParametersToolBar); |
268 | m_pBrushColorToolButton->setPixmap(Resource::loadPixmap("drawpad/brushcolor")); | 270 | m_pBrushColorToolButton->setPixmap(Resource::loadPixmap("drawpad/brushcolor")); |
269 | QWhatsThis::add( m_pBrushColorToolButton, tr( "Click here to select the color used when filling in areas." ) ); | 271 | QWhatsThis::add( m_pBrushColorToolButton, tr( "Click here to select the color used when filling in areas." ) ); |
270 | 272 | ||
271 | Opie::OColorPopupMenu* brushColorPopupMenu = new Opie::OColorPopupMenu(Qt::white, m_pBrushColorToolButton); | 273 | Opie::OColorPopupMenu* brushColorPopupMenu = new Opie::OColorPopupMenu(Qt::white, m_pBrushColorToolButton); |
272 | connect(brushColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, SLOT(changeBrushColor(const QColor&))); | 274 | connect(brushColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, SLOT(changeBrushColor(const QColor&))); |
273 | 275 | ||
274 | QToolTip::add(m_pBrushColorToolButton, tr("Fill Color")); | 276 | QToolTip::add(m_pBrushColorToolButton, tr("Fill Color")); |
275 | m_pBrushColorToolButton->setPopup(brushColorPopupMenu); | 277 | m_pBrushColorToolButton->setPopup(brushColorPopupMenu); |
276 | m_pBrushColorToolButton->setPopupDelay(0); | 278 | m_pBrushColorToolButton->setPopupDelay(0); |
277 | 279 | ||
278 | changeBrushColor(Qt::white); | 280 | changeBrushColor(Qt::white); |
279 | 281 | ||
280 | finishStartup(); | 282 | finishStartup(); |
281 | } | 283 | } |
282 | 284 | ||
283 | 285 | ||
284 | void DrawPad::finishStartup() | 286 | void DrawPad::finishStartup() |
285 | { | 287 | { |
286 | // init pages | 288 | // init pages |
287 | 289 | ||
288 | QFile file(Global::applicationFileName("drawpad", "drawpad.xml")); | 290 | QFile file(Global::applicationFileName("drawpad", "drawpad.xml")); |
289 | 291 | ||
290 | if (file.open(IO_ReadOnly)) { | 292 | if (file.open(IO_ReadOnly)) { |
291 | m_pDrawPadCanvas->load(&file); | 293 | m_pDrawPadCanvas->load(&file); |
292 | file.close(); | 294 | file.close(); |
293 | } else { | 295 | } else { |
294 | m_pDrawPadCanvas->initialPage(); | 296 | m_pDrawPadCanvas->initialPage(); |
295 | } | 297 | } |
296 | 298 | ||
297 | loadConfig(); | 299 | loadConfig(); |
298 | 300 | ||
299 | } | 301 | } |
300 | 302 | ||
301 | DrawPad::~DrawPad() | 303 | DrawPad::~DrawPad() |
302 | { | 304 | { |
303 | saveConfig(); | 305 | saveConfig(); |
304 | 306 | ||
305 | QFile file(Global::applicationFileName("drawpad", "drawpad.xml")); | 307 | QFile file(Global::applicationFileName("drawpad", "drawpad.xml")); |
306 | 308 | ||
307 | if (file.open(IO_WriteOnly)) { | 309 | if (file.open(IO_WriteOnly)) { |
308 | m_pDrawPadCanvas->save(&file); | 310 | m_pDrawPadCanvas->save(&file); |
309 | file.close(); | 311 | file.close(); |
310 | } | 312 | } |
311 | } | 313 | } |
312 | 314 | ||
313 | bool DrawPad::antiAliasing() | 315 | bool DrawPad::antiAliasing() |
314 | { | 316 | { |
315 | return (m_pAntiAliasingAction->isOn()); | 317 | return (m_pAntiAliasingAction->isOn()); |
316 | } | 318 | } |
317 | 319 | ||
318 | void DrawPad::newPage() | 320 | void DrawPad::newPage() |
319 | { | 321 | { |
320 | QRect rect = m_pDrawPadCanvas->contentsRect(); | 322 | QRect rect = m_pDrawPadCanvas->contentsRect(); |
321 | 323 | ||
322 | NewPageDialog newPageDialog(rect.width(), rect.height(), m_pen.color(), m_brush.color(), this); | 324 | NewPageDialog newPageDialog(rect.width(), rect.height(), m_pen.color(), m_brush.color(), this); |
323 | 325 | ||
324 | if (newPageDialog.exec() == QDialog::Accepted) { | 326 | if (newPageDialog.exec() == QDialog::Accepted) { |
325 | m_pDrawPadCanvas->newPage(newPageDialog.selectedTitle(), newPageDialog.selectedWidth(), | 327 | m_pDrawPadCanvas->newPage(newPageDialog.selectedTitle(), newPageDialog.selectedWidth(), |
326 | newPageDialog.selectedHeight(), newPageDialog.selectedColor()); | 328 | newPageDialog.selectedHeight(), newPageDialog.selectedColor()); |
327 | } | 329 | } |
328 | } | 330 | } |
329 | 331 | ||
330 | void DrawPad::clearPage() | 332 | void DrawPad::clearPage() |
331 | { | 333 | { |
332 | QMessageBox messageBox(tr("Clear Page"), tr("Do you want to clear\nthe current page?"), | 334 | QMessageBox messageBox(tr("Clear Page"), tr("Do you want to clear\nthe current page?"), |
333 | QMessageBox::Information, QMessageBox::Yes, | 335 | QMessageBox::Information, QMessageBox::Yes, |
334 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, | 336 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, |
335 | QMessageBox::NoButton, this); | 337 | QMessageBox::NoButton, this); |
336 | 338 | ||
337 | messageBox.setButtonText(QMessageBox::Yes, tr("Yes")); | 339 | messageBox.setButtonText(QMessageBox::Yes, tr("Yes")); |
338 | messageBox.setButtonText(QMessageBox::No, tr("No")); | 340 | messageBox.setButtonText(QMessageBox::No, tr("No")); |
339 | 341 | ||
340 | if (messageBox.exec() == QMessageBox::Yes) { | 342 | if (messageBox.exec() == QMessageBox::Yes) { |
341 | m_pDrawPadCanvas->clearPage(); | 343 | m_pDrawPadCanvas->clearPage(); |
342 | } | 344 | } |
343 | } | 345 | } |
344 | 346 | ||
345 | void DrawPad::deletePage() | 347 | void DrawPad::deletePage() |
346 | { | 348 | { |
347 | QMessageBox messageBox(tr("Delete Page"), tr("Do you want to delete\nthe current page?"), | 349 | QMessageBox messageBox(tr("Delete Page"), tr("Do you want to delete\nthe current page?"), |
348 | QMessageBox::Information, QMessageBox::Yes, | 350 | QMessageBox::Information, QMessageBox::Yes, |
349 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, | 351 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, |
350 | QMessageBox::NoButton, this); | 352 | QMessageBox::NoButton, this); |
351 | 353 | ||
352 | messageBox.setButtonText(QMessageBox::Yes, tr("Yes")); | 354 | messageBox.setButtonText(QMessageBox::Yes, tr("Yes")); |
353 | messageBox.setButtonText(QMessageBox::No, tr("No")); | 355 | messageBox.setButtonText(QMessageBox::No, tr("No")); |
354 | 356 | ||
355 | if (messageBox.exec() == QMessageBox::Yes) { | 357 | if (messageBox.exec() == QMessageBox::Yes) { |
356 | m_pDrawPadCanvas->deletePage(); | 358 | m_pDrawPadCanvas->deletePage(); |
357 | } | 359 | } |
358 | } | 360 | } |
359 | 361 | ||
360 | void DrawPad::setPointTool() | 362 | void DrawPad::setPointTool() |
361 | { | 363 | { |
362 | if (m_pTool) { | 364 | if (m_pTool) { |
363 | delete m_pTool; | 365 | delete m_pTool; |
364 | } | 366 | } |
365 | 367 | ||
366 | m_pTool = new PointTool(this, m_pDrawPadCanvas); | 368 | m_pTool = new PointTool(this, m_pDrawPadCanvas); |
367 | 369 | ||
368 | m_pLineToolButton->setIconSet(m_pPointToolAction->iconSet()); | 370 | m_pLineToolButton->setIconSet(m_pPointToolAction->iconSet()); |
369 | QToolTip::add(m_pLineToolButton, m_pPointToolAction->text()); | 371 | QToolTip::add(m_pLineToolButton, m_pPointToolAction->text()); |
370 | 372 | ||
371 | disconnect(m_pLineToolButton, SIGNAL(clicked()), 0, 0); | 373 | disconnect(m_pLineToolButton, SIGNAL(clicked()), 0, 0); |
372 | connect(m_pLineToolButton, SIGNAL(clicked()), m_pPointToolAction, SIGNAL(activated())); | 374 | connect(m_pLineToolButton, SIGNAL(clicked()), m_pPointToolAction, SIGNAL(activated())); |
373 | 375 | ||
374 | m_pLineToolButton->setOn(true); | 376 | m_pLineToolButton->setOn(true); |
375 | m_pRectangleToolButton->setOn(false); | 377 | m_pRectangleToolButton->setOn(false); |
376 | m_pEllipseToolButton->setOn(false); | 378 | m_pEllipseToolButton->setOn(false); |
377 | m_pTextToolAction->setOn(false); | 379 | m_pTextToolAction->setOn(false); |
378 | m_pFillToolAction->setOn(false); | 380 | m_pFillToolAction->setOn(false); |
379 | m_pEraseToolAction->setOn(false); | 381 | m_pEraseToolAction->setOn(false); |
380 | } | 382 | } |
381 | 383 | ||
382 | void DrawPad::setLineTool() | 384 | void DrawPad::setLineTool() |
383 | { | 385 | { |
384 | if (m_pTool) { | 386 | if (m_pTool) { |
385 | delete m_pTool; | 387 | delete m_pTool; |
386 | } | 388 | } |
387 | 389 | ||
388 | m_pTool = new LineTool(this, m_pDrawPadCanvas); | 390 | m_pTool = new LineTool(this, m_pDrawPadCanvas); |
389 | 391 | ||
390 | m_pLineToolButton->setIconSet(m_pLineToolAction->iconSet()); | 392 | m_pLineToolButton->setIconSet(m_pLineToolAction->iconSet()); |
391 | QToolTip::add(m_pLineToolButton, m_pLineToolAction->text()); | 393 | QToolTip::add(m_pLineToolButton, m_pLineToolAction->text()); |
392 | 394 | ||
393 | disconnect(m_pLineToolButton, SIGNAL(clicked()), 0, 0); | 395 | disconnect(m_pLineToolButton, SIGNAL(clicked()), 0, 0); |
394 | connect(m_pLineToolButton, SIGNAL(clicked()), m_pLineToolAction, SIGNAL(activated())); | 396 | connect(m_pLineToolButton, SIGNAL(clicked()), m_pLineToolAction, SIGNAL(activated())); |
395 | 397 | ||
396 | m_pLineToolButton->setOn(true); | 398 | m_pLineToolButton->setOn(true); |
397 | m_pRectangleToolButton->setOn(false); | 399 | m_pRectangleToolButton->setOn(false); |
398 | m_pEllipseToolButton->setOn(false); | 400 | m_pEllipseToolButton->setOn(false); |
399 | m_pTextToolAction->setOn(false); | 401 | m_pTextToolAction->setOn(false); |
400 | m_pFillToolAction->setOn(false); | 402 | m_pFillToolAction->setOn(false); |
401 | m_pEraseToolAction->setOn(false); | 403 | m_pEraseToolAction->setOn(false); |
402 | } | 404 | } |
403 | 405 | ||
404 | void DrawPad::setRectangleTool() | 406 | void DrawPad::setRectangleTool() |
405 | { | 407 | { |
406 | if (m_pTool) { | 408 | if (m_pTool) { |
407 | delete m_pTool; | 409 | delete m_pTool; |
408 | } | 410 | } |
409 | 411 | ||
410 | m_pTool = new RectangleTool(this, m_pDrawPadCanvas); | 412 | m_pTool = new RectangleTool(this, m_pDrawPadCanvas); |
411 | 413 | ||
412 | m_pRectangleToolButton->setIconSet(m_pRectangleToolAction->iconSet()); | 414 | m_pRectangleToolButton->setIconSet(m_pRectangleToolAction->iconSet()); |
413 | QToolTip::add(m_pRectangleToolButton, m_pRectangleToolAction->text()); | 415 | QToolTip::add(m_pRectangleToolButton, m_pRectangleToolAction->text()); |
414 | 416 | ||
415 | disconnect(m_pRectangleToolButton, SIGNAL(clicked()), 0, 0); | 417 | disconnect(m_pRectangleToolButton, SIGNAL(clicked()), 0, 0); |
416 | connect(m_pRectangleToolButton, SIGNAL(clicked()), m_pRectangleToolAction, SIGNAL(activated())); | 418 | connect(m_pRectangleToolButton, SIGNAL(clicked()), m_pRectangleToolAction, SIGNAL(activated())); |
417 | 419 | ||
418 | m_pLineToolButton->setOn(false); | 420 | m_pLineToolButton->setOn(false); |
419 | m_pRectangleToolButton->setOn(true); | 421 | m_pRectangleToolButton->setOn(true); |
420 | m_pEllipseToolButton->setOn(false); | 422 | m_pEllipseToolButton->setOn(false); |
421 | m_pTextToolAction->setOn(false); | 423 | m_pTextToolAction->setOn(false); |
422 | m_pFillToolAction->setOn(false); | 424 | m_pFillToolAction->setOn(false); |
423 | m_pEraseToolAction->setOn(false); | 425 | m_pEraseToolAction->setOn(false); |
424 | } | 426 | } |
425 | 427 | ||
426 | void DrawPad::setFilledRectangleTool() | 428 | void DrawPad::setFilledRectangleTool() |
427 | { | 429 | { |
428 | if (m_pTool) { | 430 | if (m_pTool) { |
429 | delete m_pTool; | 431 | delete m_pTool; |
430 | } | 432 | } |
431 | 433 | ||
432 | m_pTool = new FilledRectangleTool(this, m_pDrawPadCanvas); | 434 | m_pTool = new FilledRectangleTool(this, m_pDrawPadCanvas); |
433 | 435 | ||
434 | m_pRectangleToolButton->setIconSet(m_pFilledRectangleToolAction->iconSet()); | 436 | m_pRectangleToolButton->setIconSet(m_pFilledRectangleToolAction->iconSet()); |
435 | QToolTip::add(m_pRectangleToolButton, m_pFilledRectangleToolAction->text()); | 437 | QToolTip::add(m_pRectangleToolButton, m_pFilledRectangleToolAction->text()); |
436 | 438 | ||
437 | disconnect(m_pRectangleToolButton, SIGNAL(clicked()), 0, 0); | 439 | disconnect(m_pRectangleToolButton, SIGNAL(clicked()), 0, 0); |
438 | connect(m_pRectangleToolButton, SIGNAL(clicked()), m_pFilledRectangleToolAction, SIGNAL(activated())); | 440 | connect(m_pRectangleToolButton, SIGNAL(clicked()), m_pFilledRectangleToolAction, SIGNAL(activated())); |
439 | 441 | ||
440 | m_pLineToolButton->setOn(false); | 442 | m_pLineToolButton->setOn(false); |
441 | m_pRectangleToolButton->setOn(true); | 443 | m_pRectangleToolButton->setOn(true); |
442 | m_pEllipseToolButton->setOn(false); | 444 | m_pEllipseToolButton->setOn(false); |
443 | m_pTextToolAction->setOn(false); | 445 | m_pTextToolAction->setOn(false); |
444 | m_pFillToolAction->setOn(false); | 446 | m_pFillToolAction->setOn(false); |
445 | m_pEraseToolAction->setOn(false); | 447 | m_pEraseToolAction->setOn(false); |
446 | } | 448 | } |
447 | 449 | ||
448 | void DrawPad::setEllipseTool() | 450 | void DrawPad::setEllipseTool() |
449 | { | 451 | { |
450 | if (m_pTool) { | 452 | if (m_pTool) { |
451 | delete m_pTool; | 453 | delete m_pTool; |
452 | } | 454 | } |
453 | 455 | ||
454 | m_pTool = new EllipseTool(this, m_pDrawPadCanvas); | 456 | m_pTool = new EllipseTool(this, m_pDrawPadCanvas); |
455 | 457 | ||
456 | m_pEllipseToolButton->setIconSet(m_pEllipseToolAction->iconSet()); | 458 | m_pEllipseToolButton->setIconSet(m_pEllipseToolAction->iconSet()); |
457 | QToolTip::add(m_pEllipseToolButton, m_pEllipseToolAction->text()); | 459 | QToolTip::add(m_pEllipseToolButton, m_pEllipseToolAction->text()); |
458 | 460 | ||
459 | disconnect(m_pEllipseToolButton, SIGNAL(clicked()), 0, 0); | 461 | disconnect(m_pEllipseToolButton, SIGNAL(clicked()), 0, 0); |
460 | connect(m_pEllipseToolButton, SIGNAL(clicked()), m_pEllipseToolAction, SIGNAL(activated())); | 462 | connect(m_pEllipseToolButton, SIGNAL(clicked()), m_pEllipseToolAction, SIGNAL(activated())); |
461 | 463 | ||
462 | m_pLineToolButton->setOn(false); | 464 | m_pLineToolButton->setOn(false); |
463 | m_pRectangleToolButton->setOn(false); | 465 | m_pRectangleToolButton->setOn(false); |
464 | m_pEllipseToolButton->setOn(true); | 466 | m_pEllipseToolButton->setOn(true); |
465 | m_pTextToolAction->setOn(false); | 467 | m_pTextToolAction->setOn(false); |
466 | m_pFillToolAction->setOn(false); | 468 | m_pFillToolAction->setOn(false); |
467 | m_pEraseToolAction->setOn(false); | 469 | m_pEraseToolAction->setOn(false); |
468 | } | 470 | } |
469 | 471 | ||
470 | void DrawPad::setFilledEllipseTool() | 472 | void DrawPad::setFilledEllipseTool() |
471 | { | 473 | { |
472 | if (m_pTool) { | 474 | if (m_pTool) { |
473 | delete m_pTool; | 475 | delete m_pTool; |
474 | } | 476 | } |
475 | 477 | ||
476 | m_pTool = new FilledEllipseTool(this, m_pDrawPadCanvas); | 478 | m_pTool = new FilledEllipseTool(this, m_pDrawPadCanvas); |
477 | 479 | ||
478 | m_pEllipseToolButton->setIconSet(m_pFilledEllipseToolAction->iconSet()); | 480 | m_pEllipseToolButton->setIconSet(m_pFilledEllipseToolAction->iconSet()); |
479 | QToolTip::add(m_pEllipseToolButton, m_pFilledEllipseToolAction->text()); | 481 | QToolTip::add(m_pEllipseToolButton, m_pFilledEllipseToolAction->text()); |
480 | 482 | ||
481 | disconnect(m_pEllipseToolButton, SIGNAL(clicked()), 0, 0); | 483 | disconnect(m_pEllipseToolButton, SIGNAL(clicked()), 0, 0); |
482 | connect(m_pEllipseToolButton, SIGNAL(clicked()), m_pFilledEllipseToolAction, SIGNAL(activated())); | 484 | connect(m_pEllipseToolButton, SIGNAL(clicked()), m_pFilledEllipseToolAction, SIGNAL(activated())); |
483 | 485 | ||
484 | m_pLineToolButton->setOn(false); | 486 | m_pLineToolButton->setOn(false); |
485 | m_pRectangleToolButton->setOn(false); | 487 | m_pRectangleToolButton->setOn(false); |
486 | m_pEllipseToolButton->setOn(true); | 488 | m_pEllipseToolButton->setOn(true); |
487 | m_pTextToolAction->setOn(false); | 489 | m_pTextToolAction->setOn(false); |
488 | m_pFillToolAction->setOn(false); | 490 | m_pFillToolAction->setOn(false); |
489 | m_pEraseToolAction->setOn(false); | 491 | m_pEraseToolAction->setOn(false); |
490 | } | 492 | } |
491 | 493 | ||
492 | void DrawPad::setTextTool() | 494 | void DrawPad::setTextTool() |
493 | { | 495 | { |
494 | if (m_pTool) { | 496 | if (m_pTool) { |
495 | delete m_pTool; | 497 | delete m_pTool; |
496 | } | 498 | } |
497 | 499 | ||
498 | m_pTool = new TextTool(this, m_pDrawPadCanvas); | 500 | m_pTool = new TextTool(this, m_pDrawPadCanvas); |
499 | 501 | ||
500 | m_pLineToolButton->setOn(false); | 502 | m_pLineToolButton->setOn(false); |
501 | m_pRectangleToolButton->setOn(false); | 503 | m_pRectangleToolButton->setOn(false); |
502 | m_pEllipseToolButton->setOn(false); | 504 | m_pEllipseToolButton->setOn(false); |
503 | m_pTextToolAction->setOn(true); | 505 | m_pTextToolAction->setOn(true); |
504 | m_pFillToolAction->setOn(false); | 506 | m_pFillToolAction->setOn(false); |
505 | m_pEraseToolAction->setOn(false); | 507 | m_pEraseToolAction->setOn(false); |
506 | } | 508 | } |
507 | 509 | ||
508 | void DrawPad::setFillTool() | 510 | void DrawPad::setFillTool() |
509 | { | 511 | { |
510 | if (m_pTool) { | 512 | if (m_pTool) { |
511 | delete m_pTool; | 513 | delete m_pTool; |
512 | } | 514 | } |
513 | 515 | ||
514 | m_pTool = new FillTool(this, m_pDrawPadCanvas); | 516 | m_pTool = new FillTool(this, m_pDrawPadCanvas); |
515 | 517 | ||
516 | m_pLineToolButton->setOn(false); | 518 | m_pLineToolButton->setOn(false); |
517 | m_pRectangleToolButton->setOn(false); | 519 | m_pRectangleToolButton->setOn(false); |
518 | m_pEllipseToolButton->setOn(false); | 520 | m_pEllipseToolButton->setOn(false); |
519 | m_pTextToolAction->setOn(false); | 521 | m_pTextToolAction->setOn(false); |
520 | m_pFillToolAction->setOn(true); | 522 | m_pFillToolAction->setOn(true); |
521 | m_pEraseToolAction->setOn(false); | 523 | m_pEraseToolAction->setOn(false); |
522 | } | 524 | } |
523 | 525 | ||
524 | void DrawPad::setEraseTool() | 526 | void DrawPad::setEraseTool() |
525 | { | 527 | { |
526 | if (m_pTool) { | 528 | if (m_pTool) { |
527 | delete m_pTool; | 529 | delete m_pTool; |
528 | } | 530 | } |
529 | 531 | ||
530 | m_pTool = new EraseTool(this, m_pDrawPadCanvas); | 532 | m_pTool = new EraseTool(this, m_pDrawPadCanvas); |
531 | 533 | ||
532 | m_pLineToolButton->setOn(false); | 534 | m_pLineToolButton->setOn(false); |
533 | m_pRectangleToolButton->setOn(false); | 535 | m_pRectangleToolButton->setOn(false); |
534 | m_pEllipseToolButton->setOn(false); | 536 | m_pEllipseToolButton->setOn(false); |
535 | m_pTextToolAction->setOn(false); | 537 | m_pTextToolAction->setOn(false); |
536 | m_pFillToolAction->setOn(false); | 538 | m_pFillToolAction->setOn(false); |
537 | m_pEraseToolAction->setOn(true); | 539 | m_pEraseToolAction->setOn(true); |
538 | } | 540 | } |
539 | 541 | ||
540 | void DrawPad::changePenWidth(int value) | 542 | void DrawPad::changePenWidth(int value) |
541 | { | 543 | { |
542 | m_pen.setWidth(value); | 544 | m_pen.setWidth(value); |
543 | } | 545 | } |
544 | 546 | ||
545 | void DrawPad::changePenColor(const QColor& color) | 547 | void DrawPad::changePenColor(const QColor& color) |
546 | { | 548 | { |
547 | m_pen.setColor(color); | 549 | m_pen.setColor(color); |
548 | 550 | ||
549 | QPainter painter; | 551 | QPainter painter; |
550 | painter.begin(m_pPenColorToolButton->pixmap()); | 552 | painter.begin(m_pPenColorToolButton->pixmap()); |
551 | painter.fillRect(QRect(0, 12, 14, 2), m_pen.color()); | 553 | painter.fillRect(QRect(0, 12, 14, 2), m_pen.color()); |
552 | painter.end(); | 554 | painter.end(); |
553 | 555 | ||
554 | m_pPenColorToolButton->popup()->hide(); | 556 | m_pPenColorToolButton->popup()->hide(); |
555 | } | 557 | } |
556 | 558 | ||
557 | void DrawPad::changeBrushColor(const QColor& color) | 559 | void DrawPad::changeBrushColor(const QColor& color) |
558 | { | 560 | { |
559 | m_brush = QBrush(color); | 561 | m_brush = QBrush(color); |
560 | 562 | ||
561 | QPainter painter; | 563 | QPainter painter; |
562 | painter.begin(m_pBrushColorToolButton->pixmap()); | 564 | painter.begin(m_pBrushColorToolButton->pixmap()); |
563 | painter.fillRect(QRect(0, 12, 14, 2), m_brush.color()); | 565 | painter.fillRect(QRect(0, 12, 14, 2), m_brush.color()); |
564 | painter.end(); | 566 | painter.end(); |
565 | 567 | ||
566 | m_pBrushColorToolButton->popup()->hide(); | 568 | m_pBrushColorToolButton->popup()->hide(); |
567 | } | 569 | } |
568 | 570 | ||
569 | void DrawPad::updateView() | 571 | void DrawPad::updateView() |
570 | { | 572 | { |
571 | uint pagePosition = m_pDrawPadCanvas->pagePosition(); | 573 | uint pagePosition = m_pDrawPadCanvas->pagePosition(); |
572 | uint pageCount = m_pDrawPadCanvas->pageCount(); | 574 | uint pageCount = m_pDrawPadCanvas->pageCount(); |
573 | 575 | ||
574 | setCaption( tr( "DrawPad - Page %1/%2" ).arg( pagePosition ).arg( pageCount ) ); | 576 | setCaption( tr( "DrawPad - Page %1/%2" ).arg( pagePosition ).arg( pageCount ) ); |
575 | 577 | ||
576 | m_pUndoAction->setEnabled(m_pDrawPadCanvas->currentPage()->undoEnabled()); | 578 | m_pUndoAction->setEnabled(m_pDrawPadCanvas->currentPage()->undoEnabled()); |
577 | m_pRedoAction->setEnabled(m_pDrawPadCanvas->currentPage()->redoEnabled()); | 579 | m_pRedoAction->setEnabled(m_pDrawPadCanvas->currentPage()->redoEnabled()); |
578 | 580 | ||
579 | m_pFirstPageAction->setEnabled(m_pDrawPadCanvas->goPreviousPageEnabled()); | 581 | m_pFirstPageAction->setEnabled(m_pDrawPadCanvas->goPreviousPageEnabled()); |
580 | m_pPreviousPageAction->setEnabled(m_pDrawPadCanvas->goPreviousPageEnabled()); | 582 | m_pPreviousPageAction->setEnabled(m_pDrawPadCanvas->goPreviousPageEnabled()); |
581 | m_pNextPageAction->setEnabled(m_pDrawPadCanvas->goNextPageEnabled()); | 583 | m_pNextPageAction->setEnabled(m_pDrawPadCanvas->goNextPageEnabled()); |
582 | m_pLastPageAction->setEnabled(m_pDrawPadCanvas->goNextPageEnabled()); | 584 | m_pLastPageAction->setEnabled(m_pDrawPadCanvas->goNextPageEnabled()); |
583 | } | 585 | } |
584 | 586 | ||
585 | void DrawPad::deleteAll() | 587 | void DrawPad::deleteAll() |
586 | { | 588 | { |
587 | QMessageBox messageBox(tr("Delete All"), tr("Do you want to delete\nall the pages?"), | 589 | QMessageBox messageBox(tr("Delete All"), tr("Do you want to delete\nall the pages?"), |
588 | QMessageBox::Information, QMessageBox::Yes, | 590 | QMessageBox::Information, QMessageBox::Yes, |
589 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, | 591 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, |
590 | QMessageBox::NoButton, this); | 592 | QMessageBox::NoButton, this); |
591 | 593 | ||
592 | messageBox.setButtonText(QMessageBox::Yes, tr("Yes")); | 594 | messageBox.setButtonText(QMessageBox::Yes, tr("Yes")); |
593 | messageBox.setButtonText(QMessageBox::No, tr("No")); | 595 | messageBox.setButtonText(QMessageBox::No, tr("No")); |
594 | 596 | ||
595 | if (messageBox.exec() == QMessageBox::Yes) { | 597 | if (messageBox.exec() == QMessageBox::Yes) { |
596 | m_pDrawPadCanvas->deleteAll(); | 598 | m_pDrawPadCanvas->deleteAll(); |
597 | } | 599 | } |
598 | } | 600 | } |
599 | 601 | ||
600 | void DrawPad::importPage() | 602 | void DrawPad::importPage() |
601 | { | 603 | { |
602 | ImportDialog importDialog(this); | 604 | ImportDialog importDialog(this); |
603 | 605 | ||
604 | if ( QPEApplication::execDialog( &importDialog ) == QDialog::Accepted ) { | 606 | if ( QPEApplication::execDialog( &importDialog ) == QDialog::Accepted ) { |
605 | const DocLnk* docLnk = importDialog.selected(); | 607 | const DocLnk* docLnk = importDialog.selected(); |
606 | 608 | ||
607 | if (docLnk) { | 609 | if (docLnk) { |
608 | m_pDrawPadCanvas->importPage(docLnk->file()); | 610 | m_pDrawPadCanvas->importPage(docLnk->file()); |
609 | delete docLnk; | 611 | delete docLnk; |
610 | } | 612 | } |
611 | } | 613 | } |
612 | } | 614 | } |
613 | 615 | ||
614 | void DrawPad::exportPage() | 616 | void DrawPad::exportPage() |
615 | { | 617 | { |
616 | ExportDialog exportDialog(m_pDrawPadCanvas->pagePosition(), m_pDrawPadCanvas->pageCount(), this); | 618 | ExportDialog exportDialog(m_pDrawPadCanvas->pagePosition(), m_pDrawPadCanvas->pageCount(), this); |
617 | 619 | ||
618 | if ( QPEApplication::execDialog( &exportDialog ) == QDialog::Accepted ) { | 620 | if ( QPEApplication::execDialog( &exportDialog ) == QDialog::Accepted ) { |
619 | m_pDrawPadCanvas->exportPage(exportDialog.selectedFromPage(), exportDialog.selectedToPage(), | 621 | m_pDrawPadCanvas->exportPage(exportDialog.selectedFromPage(), exportDialog.selectedToPage(), |
620 | exportDialog.selectedName(), exportDialog.selectedFormat()); | 622 | exportDialog.selectedName(), exportDialog.selectedFormat()); |
621 | } | 623 | } |
622 | } | 624 | } |
623 | 625 | ||
624 | void DrawPad::thumbnailView() | 626 | void DrawPad::thumbnailView() |
625 | { | 627 | { |
626 | ThumbnailView thumbnailView(this, m_pDrawPadCanvas, this); | 628 | ThumbnailView thumbnailView(this, m_pDrawPadCanvas, this); |
627 | 629 | ||
628 | QPEApplication::showWidget( &thumbnailView ); | 630 | QPEApplication::showWidget( &thumbnailView ); |
629 | thumbnailView.exec(); | 631 | thumbnailView.exec(); |
630 | } | 632 | } |
631 | 633 | ||
632 | void DrawPad::pageInformation() | 634 | void DrawPad::pageInformation() |
633 | { | 635 | { |
634 | PageInformationDialog pageInformationDialog(m_pDrawPadCanvas->currentPage()); | 636 | PageInformationDialog pageInformationDialog(m_pDrawPadCanvas->currentPage()); |
635 | 637 | ||
636 | if (pageInformationDialog.exec() == QDialog::Accepted) { | 638 | if (pageInformationDialog.exec() == QDialog::Accepted) { |
637 | m_pDrawPadCanvas->currentPage()->setTitle(pageInformationDialog.selectedTitle()); | 639 | m_pDrawPadCanvas->currentPage()->setTitle(pageInformationDialog.selectedTitle()); |
638 | } | 640 | } |
639 | } | 641 | } |
640 | 642 | ||
641 | void DrawPad::loadConfig() | 643 | void DrawPad::loadConfig() |
642 | { | 644 | { |
643 | Config config("drawpad"); | 645 | Config config("drawpad"); |
644 | config.setGroup("General"); | 646 | config.setGroup("General"); |
645 | 647 | ||
646 | m_pAntiAliasingAction->setOn(config.readBoolEntry("AntiAliasing", false)); | 648 | m_pAntiAliasingAction->setOn(config.readBoolEntry("AntiAliasing", false)); |
647 | m_pPenWidthSpinBox->setValue(config.readNumEntry("PenWidth", 1)); | 649 | m_pPenWidthSpinBox->setValue(config.readNumEntry("PenWidth", 1)); |
648 | changePenColor(QColor(config.readEntry("PenColor", Qt::black.name()))); | 650 | changePenColor(QColor(config.readEntry("PenColor", Qt::black.name()))); |
649 | changeBrushColor(QColor(config.readEntry("BrushColor", Qt::white.name()))); | 651 | changeBrushColor(QColor(config.readEntry("BrushColor", Qt::white.name()))); |
650 | m_pDrawPadCanvas->selectPage(config.readNumEntry("PagePosition", 1)); | 652 | m_pDrawPadCanvas->selectPage(config.readNumEntry("PagePosition", 1)); |
651 | } | 653 | } |
652 | 654 | ||
653 | void DrawPad::saveConfig() | 655 | void DrawPad::saveConfig() |
654 | { | 656 | { |
655 | Config config("drawpad"); | 657 | Config config("drawpad"); |
656 | config.setGroup("General"); | 658 | config.setGroup("General"); |
657 | 659 | ||
658 | config.writeEntry("PagePosition", (int)m_pDrawPadCanvas->pagePosition()); | 660 | config.writeEntry("PagePosition", (int)m_pDrawPadCanvas->pagePosition()); |
659 | config.writeEntry("AntiAliasing", antiAliasing()); | 661 | config.writeEntry("AntiAliasing", antiAliasing()); |
660 | config.writeEntry("PenWidth", (int)m_pen.width()); | 662 | config.writeEntry("PenWidth", (int)m_pen.width()); |
661 | config.writeEntry("PenColor", m_pen.color().name()); | 663 | config.writeEntry("PenColor", m_pen.color().name()); |
662 | config.writeEntry("BrushColor", m_brush.color().name()); | 664 | config.writeEntry("BrushColor", m_brush.color().name()); |
663 | } | 665 | } |
diff --git a/noncore/graphics/drawpad/exportdialog.cpp b/noncore/graphics/drawpad/exportdialog.cpp index 169acef..f053bb5 100644 --- a/noncore/graphics/drawpad/exportdialog.cpp +++ b/noncore/graphics/drawpad/exportdialog.cpp | |||
@@ -1,175 +1,176 @@ | |||
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 <opie2/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 | using namespace Opie::Ui; | ||
29 | ExportDialog::ExportDialog(uint pageAt, uint pageCount, QWidget* parent, const char* name) | 30 | ExportDialog::ExportDialog(uint pageAt, uint pageCount, QWidget* parent, const char* name) |
30 | : QDialog(parent, name, true) | 31 | : QDialog(parent, name, true) |
31 | { | 32 | { |
32 | setCaption(tr("DrawPad - Export")); | 33 | setCaption(tr("DrawPad - Export")); |
33 | 34 | ||
34 | m_pageAt = pageAt; | 35 | m_pageAt = pageAt; |
35 | m_pageCount = pageCount; | 36 | m_pageCount = pageCount; |
36 | 37 | ||
37 | QButtonGroup* selectionButtonGroup = new QButtonGroup(0, Qt::Vertical, tr("Page Selection"), this); | 38 | QButtonGroup* selectionButtonGroup = new QButtonGroup(0, Qt::Vertical, tr("Page Selection"), this); |
38 | connect(selectionButtonGroup, SIGNAL(pressed(int)), this, SLOT(selectionChanged(int))); | 39 | connect(selectionButtonGroup, SIGNAL(pressed(int)), this, SLOT(selectionChanged(int))); |
39 | 40 | ||
40 | QRadioButton* selectAllRadioButton = new QRadioButton(tr("All"), selectionButtonGroup); | 41 | QRadioButton* selectAllRadioButton = new QRadioButton(tr("All"), selectionButtonGroup); |
41 | QRadioButton* selectCurrentRadioButton = new QRadioButton(tr("Current"), selectionButtonGroup); | 42 | QRadioButton* selectCurrentRadioButton = new QRadioButton(tr("Current"), selectionButtonGroup); |
42 | QRadioButton* selectRangeRadioButton = new QRadioButton(tr("Range"), selectionButtonGroup); | 43 | QRadioButton* selectRangeRadioButton = new QRadioButton(tr("Range"), selectionButtonGroup); |
43 | 44 | ||
44 | QLabel* toLabel = new QLabel(tr("To:"), selectionButtonGroup); | 45 | QLabel* toLabel = new QLabel(tr("To:"), selectionButtonGroup); |
45 | 46 | ||
46 | m_pFromPageSpinBox = new QSpinBox(1, m_pageCount, 1, selectionButtonGroup); | 47 | m_pFromPageSpinBox = new QSpinBox(1, m_pageCount, 1, selectionButtonGroup); |
47 | connect(m_pFromPageSpinBox, SIGNAL(valueChanged(int)), this, SLOT(fromPageChanged(int))); | 48 | connect(m_pFromPageSpinBox, SIGNAL(valueChanged(int)), this, SLOT(fromPageChanged(int))); |
48 | 49 | ||
49 | m_pToPageSpinBox = new QSpinBox(1, m_pageCount, 1, selectionButtonGroup); | 50 | m_pToPageSpinBox = new QSpinBox(1, m_pageCount, 1, selectionButtonGroup); |
50 | connect(m_pToPageSpinBox, SIGNAL(valueChanged(int)), this, SLOT(toPageChanged(int))); | 51 | connect(m_pToPageSpinBox, SIGNAL(valueChanged(int)), this, SLOT(toPageChanged(int))); |
51 | 52 | ||
52 | selectionButtonGroup->setButton(1); | 53 | selectionButtonGroup->setButton(1); |
53 | selectionChanged(1); | 54 | selectionChanged(1); |
54 | 55 | ||
55 | m_pFromPageSpinBox->setValue(pageAt); | 56 | m_pFromPageSpinBox->setValue(pageAt); |
56 | m_pToPageSpinBox->setValue(pageAt); | 57 | m_pToPageSpinBox->setValue(pageAt); |
57 | 58 | ||
58 | QGroupBox* exportGroupBox = new QGroupBox(0, Qt::Vertical, tr("Export As"), this); | 59 | QGroupBox* exportGroupBox = new QGroupBox(0, Qt::Vertical, tr("Export As"), this); |
59 | 60 | ||
60 | QLabel* nameLabel = new QLabel(tr("Name:"), exportGroupBox); | 61 | QLabel* nameLabel = new QLabel(tr("Name:"), exportGroupBox); |
61 | QLabel* formatLabel = new QLabel(tr("Format:"), exportGroupBox); | 62 | QLabel* formatLabel = new QLabel(tr("Format:"), exportGroupBox); |
62 | 63 | ||
63 | m_pNameLineEdit = new QLineEdit(exportGroupBox); | 64 | m_pNameLineEdit = new QLineEdit(exportGroupBox); |
64 | 65 | ||
65 | m_pFormatComboBox = new QComboBox(exportGroupBox); | 66 | m_pFormatComboBox = new QComboBox(exportGroupBox); |
66 | m_pFormatComboBox->insertStrList(QImageIO::outputFormats()); | 67 | m_pFormatComboBox->insertStrList(QImageIO::outputFormats()); |
67 | 68 | ||
68 | MimeTypes types; types.insert( tr("All Images"), "image/*" ); | 69 | MimeTypes types; types.insert( tr("All Images"), "image/*" ); |
69 | Opie::OFileSelector* fileSelector = new Opie::OFileSelector(this, Opie::OFileSelector::FileSelector, | 70 | OFileSelector* fileSelector = new OFileSelector(this, OFileSelector::FileSelector, |
70 | Opie::OFileSelector::Normal, | 71 | OFileSelector::Normal, |
71 | QString::null, QString::null, | 72 | QString::null, QString::null, |
72 | types ); | 73 | types ); |
73 | fileSelector->setNameVisible( false ); | 74 | fileSelector->setNameVisible( false ); |
74 | 75 | ||
75 | QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); | 76 | QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); |
76 | selectionButtonGroup->layout()->setSpacing(4); | 77 | selectionButtonGroup->layout()->setSpacing(4); |
77 | exportGroupBox->layout()->setSpacing(4); | 78 | exportGroupBox->layout()->setSpacing(4); |
78 | QGridLayout* selectionLayout = new QGridLayout(selectionButtonGroup->layout(), 2, 2); | 79 | QGridLayout* selectionLayout = new QGridLayout(selectionButtonGroup->layout(), 2, 2); |
79 | QHBoxLayout* rangeLayout = new QHBoxLayout(); | 80 | QHBoxLayout* rangeLayout = new QHBoxLayout(); |
80 | QGridLayout* exportLayout = new QGridLayout(exportGroupBox->layout(), 2, 2); | 81 | QGridLayout* exportLayout = new QGridLayout(exportGroupBox->layout(), 2, 2); |
81 | 82 | ||
82 | selectionLayout->addWidget(selectAllRadioButton, 0, 0); | 83 | selectionLayout->addWidget(selectAllRadioButton, 0, 0); |
83 | selectionLayout->addWidget(selectCurrentRadioButton, 1, 0); | 84 | selectionLayout->addWidget(selectCurrentRadioButton, 1, 0); |
84 | selectionLayout->addWidget(selectRangeRadioButton, 0, 1); | 85 | selectionLayout->addWidget(selectRangeRadioButton, 0, 1); |
85 | selectionLayout->addLayout(rangeLayout, 1, 1); | 86 | selectionLayout->addLayout(rangeLayout, 1, 1); |
86 | 87 | ||
87 | rangeLayout->addWidget(m_pFromPageSpinBox); | 88 | rangeLayout->addWidget(m_pFromPageSpinBox); |
88 | rangeLayout->addWidget(toLabel); | 89 | rangeLayout->addWidget(toLabel); |
89 | rangeLayout->addWidget(m_pToPageSpinBox); | 90 | rangeLayout->addWidget(m_pToPageSpinBox); |
90 | 91 | ||
91 | exportLayout->addWidget(nameLabel, 0, 0); | 92 | exportLayout->addWidget(nameLabel, 0, 0); |
92 | exportLayout->addWidget(formatLabel, 1, 0); | 93 | exportLayout->addWidget(formatLabel, 1, 0); |
93 | 94 | ||
94 | exportLayout->addWidget(m_pNameLineEdit, 0, 1); | 95 | exportLayout->addWidget(m_pNameLineEdit, 0, 1); |
95 | exportLayout->addWidget(m_pFormatComboBox, 1, 1); | 96 | exportLayout->addWidget(m_pFormatComboBox, 1, 1); |
96 | 97 | ||
97 | exportLayout->setColStretch(1, 1); | 98 | exportLayout->setColStretch(1, 1); |
98 | 99 | ||
99 | mainLayout->addWidget(selectionButtonGroup); | 100 | mainLayout->addWidget(selectionButtonGroup); |
100 | mainLayout->addWidget(exportGroupBox); | 101 | mainLayout->addWidget(exportGroupBox); |
101 | mainLayout->addWidget(fileSelector); | 102 | mainLayout->addWidget(fileSelector); |
102 | 103 | ||
103 | m_pNameLineEdit->setFocus(); | 104 | m_pNameLineEdit->setFocus(); |
104 | } | 105 | } |
105 | 106 | ||
106 | ExportDialog::~ExportDialog() | 107 | ExportDialog::~ExportDialog() |
107 | { | 108 | { |
108 | } | 109 | } |
109 | 110 | ||
110 | uint ExportDialog::selectedFromPage() | 111 | uint ExportDialog::selectedFromPage() |
111 | { | 112 | { |
112 | return (m_pFromPageSpinBox->value()); | 113 | return (m_pFromPageSpinBox->value()); |
113 | } | 114 | } |
114 | 115 | ||
115 | uint ExportDialog::selectedToPage() | 116 | uint ExportDialog::selectedToPage() |
116 | { | 117 | { |
117 | return (m_pToPageSpinBox->value()); | 118 | return (m_pToPageSpinBox->value()); |
118 | } | 119 | } |
119 | 120 | ||
120 | QString ExportDialog::selectedName() | 121 | QString ExportDialog::selectedName() |
121 | { | 122 | { |
122 | return (m_pNameLineEdit->text()); | 123 | return (m_pNameLineEdit->text()); |
123 | } | 124 | } |
124 | 125 | ||
125 | QString ExportDialog::selectedFormat() | 126 | QString ExportDialog::selectedFormat() |
126 | { | 127 | { |
127 | return (m_pFormatComboBox->currentText()); | 128 | return (m_pFormatComboBox->currentText()); |
128 | } | 129 | } |
129 | 130 | ||
130 | void ExportDialog::accept() | 131 | void ExportDialog::accept() |
131 | { | 132 | { |
132 | if (!(m_pNameLineEdit->text().isEmpty())) { | 133 | if (!(m_pNameLineEdit->text().isEmpty())) { |
133 | QDialog::accept(); | 134 | QDialog::accept(); |
134 | } | 135 | } |
135 | } | 136 | } |
136 | 137 | ||
137 | void ExportDialog::selectionChanged(int id) | 138 | void ExportDialog::selectionChanged(int id) |
138 | { | 139 | { |
139 | switch (id) { | 140 | switch (id) { |
140 | case 0: | 141 | case 0: |
141 | m_pFromPageSpinBox->setValue(1); | 142 | m_pFromPageSpinBox->setValue(1); |
142 | m_pToPageSpinBox->setValue(m_pageCount); | 143 | m_pToPageSpinBox->setValue(m_pageCount); |
143 | 144 | ||
144 | m_pFromPageSpinBox->setEnabled(false); | 145 | m_pFromPageSpinBox->setEnabled(false); |
145 | m_pToPageSpinBox->setEnabled(false); | 146 | m_pToPageSpinBox->setEnabled(false); |
146 | break; | 147 | break; |
147 | case 1: | 148 | case 1: |
148 | m_pFromPageSpinBox->setValue(m_pageAt); | 149 | m_pFromPageSpinBox->setValue(m_pageAt); |
149 | m_pToPageSpinBox->setValue(m_pageAt); | 150 | m_pToPageSpinBox->setValue(m_pageAt); |
150 | 151 | ||
151 | m_pFromPageSpinBox->setEnabled(false); | 152 | m_pFromPageSpinBox->setEnabled(false); |
152 | m_pToPageSpinBox->setEnabled(false); | 153 | m_pToPageSpinBox->setEnabled(false); |
153 | break; | 154 | break; |
154 | case 2: | 155 | case 2: |
155 | m_pFromPageSpinBox->setEnabled(true); | 156 | m_pFromPageSpinBox->setEnabled(true); |
156 | m_pToPageSpinBox->setEnabled(true); | 157 | m_pToPageSpinBox->setEnabled(true); |
157 | break; | 158 | break; |
158 | default: | 159 | default: |
159 | break; | 160 | break; |
160 | } | 161 | } |
161 | } | 162 | } |
162 | 163 | ||
163 | void ExportDialog::fromPageChanged(int value) | 164 | void ExportDialog::fromPageChanged(int value) |
164 | { | 165 | { |
165 | if (m_pToPageSpinBox->value() < value) { | 166 | if (m_pToPageSpinBox->value() < value) { |
166 | m_pToPageSpinBox->setValue(value); | 167 | m_pToPageSpinBox->setValue(value); |
167 | } | 168 | } |
168 | } | 169 | } |
169 | 170 | ||
170 | void ExportDialog::toPageChanged(int value) | 171 | void ExportDialog::toPageChanged(int value) |
171 | { | 172 | { |
172 | if (m_pFromPageSpinBox->value() > value) { | 173 | if (m_pFromPageSpinBox->value() > value) { |
173 | m_pFromPageSpinBox->setValue(value); | 174 | m_pFromPageSpinBox->setValue(value); |
174 | } | 175 | } |
175 | } | 176 | } |
diff --git a/noncore/graphics/drawpad/importdialog.cpp b/noncore/graphics/drawpad/importdialog.cpp index 4fc0a0e..a2f4c40 100644 --- a/noncore/graphics/drawpad/importdialog.cpp +++ b/noncore/graphics/drawpad/importdialog.cpp | |||
@@ -1,116 +1,117 @@ | |||
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 <qpe/mimetype.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 | using namespace Opie::Ui; | ||
24 | ImportDialog::ImportDialog(QWidget* parent, const char* name) | 25 | ImportDialog::ImportDialog(QWidget* parent, const char* name) |
25 | : QDialog(parent, name, true) | 26 | : QDialog(parent, name, true) |
26 | { | 27 | { |
27 | setCaption(tr("DrawPad - Import")); | 28 | setCaption(tr("DrawPad - Import")); |
28 | 29 | ||
29 | MimeTypes types; types.insert( tr("All images"),"image/*" ); | 30 | MimeTypes types; types.insert( tr("All images"),"image/*" ); |
30 | m_pFileSelector = new Opie::OFileSelector(this, | 31 | m_pFileSelector = new OFileSelector(this, |
31 | Opie::OFileSelector::FileSelector, | 32 | OFileSelector::FileSelector, |
32 | Opie::OFileSelector::Normal, | 33 | OFileSelector::Normal, |
33 | QString::null, | 34 | QString::null, |
34 | QString::null, types ); | 35 | QString::null, types ); |
35 | m_pFileSelector->setNameVisible( false ); | 36 | m_pFileSelector->setNameVisible( false ); |
36 | connect(m_pFileSelector, SIGNAL(fileSelected(const DocLnk&)), this, SLOT(fileChanged())); | 37 | connect(m_pFileSelector, SIGNAL(fileSelected(const DocLnk&)), this, SLOT(fileChanged())); |
37 | 38 | ||
38 | m_pPreviewLabel = new QLabel(this); | 39 | m_pPreviewLabel = new QLabel(this); |
39 | m_pPreviewLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken); | 40 | m_pPreviewLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken); |
40 | m_pPreviewLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); | 41 | m_pPreviewLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); |
41 | m_pPreviewLabel->setFixedSize(114, 114); | 42 | m_pPreviewLabel->setFixedSize(114, 114); |
42 | m_pPreviewLabel->setBackgroundMode(QWidget::PaletteMid); | 43 | m_pPreviewLabel->setBackgroundMode(QWidget::PaletteMid); |
43 | 44 | ||
44 | m_pAutomaticPreviewCheckBox = new QCheckBox(tr("Automatic preview"), this); | 45 | m_pAutomaticPreviewCheckBox = new QCheckBox(tr("Automatic preview"), this); |
45 | m_pAutomaticPreviewCheckBox->setChecked(true); | 46 | m_pAutomaticPreviewCheckBox->setChecked(true); |
46 | 47 | ||
47 | QPushButton* previewPushButton = new QPushButton(tr("Preview"), this); | 48 | QPushButton* previewPushButton = new QPushButton(tr("Preview"), this); |
48 | connect(previewPushButton, SIGNAL(clicked()), this, SLOT(preview())); | 49 | connect(previewPushButton, SIGNAL(clicked()), this, SLOT(preview())); |
49 | 50 | ||
50 | QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); | 51 | QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); |
51 | QHBoxLayout* previewLayout = new QHBoxLayout(4); | 52 | QHBoxLayout* previewLayout = new QHBoxLayout(4); |
52 | QVBoxLayout* previewSecondLayout = new QVBoxLayout(4); | 53 | QVBoxLayout* previewSecondLayout = new QVBoxLayout(4); |
53 | 54 | ||
54 | previewSecondLayout->addWidget(m_pAutomaticPreviewCheckBox); | 55 | previewSecondLayout->addWidget(m_pAutomaticPreviewCheckBox); |
55 | previewSecondLayout->addWidget(previewPushButton); | 56 | previewSecondLayout->addWidget(previewPushButton); |
56 | previewSecondLayout->addStretch(); | 57 | previewSecondLayout->addStretch(); |
57 | 58 | ||
58 | previewLayout->addWidget(m_pPreviewLabel); | 59 | previewLayout->addWidget(m_pPreviewLabel); |
59 | previewLayout->addLayout(previewSecondLayout); | 60 | previewLayout->addLayout(previewSecondLayout); |
60 | 61 | ||
61 | mainLayout->addWidget(m_pFileSelector); | 62 | mainLayout->addWidget(m_pFileSelector); |
62 | mainLayout->addLayout(previewLayout); | 63 | mainLayout->addLayout(previewLayout); |
63 | 64 | ||
64 | preview(); | 65 | preview(); |
65 | } | 66 | } |
66 | 67 | ||
67 | ImportDialog::~ImportDialog() | 68 | ImportDialog::~ImportDialog() |
68 | { | 69 | { |
69 | } | 70 | } |
70 | 71 | ||
71 | const DocLnk* ImportDialog::selected() | 72 | const DocLnk* ImportDialog::selected() |
72 | { | 73 | { |
73 | // FIXME change from pointer to reference -zecke | 74 | // FIXME change from pointer to reference -zecke |
74 | DocLnk *lnk = new DocLnk( m_pFileSelector->selectedDocument() ); | 75 | DocLnk *lnk = new DocLnk( m_pFileSelector->selectedDocument() ); |
75 | return lnk; | 76 | return lnk; |
76 | } | 77 | } |
77 | 78 | ||
78 | void ImportDialog::fileChanged() | 79 | void ImportDialog::fileChanged() |
79 | { | 80 | { |
80 | if (m_pAutomaticPreviewCheckBox->isChecked()) { | 81 | if (m_pAutomaticPreviewCheckBox->isChecked()) { |
81 | preview(); | 82 | preview(); |
82 | } | 83 | } |
83 | } | 84 | } |
84 | 85 | ||
85 | void ImportDialog::preview() | 86 | void ImportDialog::preview() |
86 | { | 87 | { |
87 | const DocLnk* docLnk = selected(); | 88 | const DocLnk* docLnk = selected(); |
88 | 89 | ||
89 | if (docLnk) { | 90 | if (docLnk) { |
90 | QImage image(docLnk->file()); | 91 | QImage image(docLnk->file()); |
91 | 92 | ||
92 | int previewWidth = m_pPreviewLabel->contentsRect().width(); | 93 | int previewWidth = m_pPreviewLabel->contentsRect().width(); |
93 | int previewHeight = m_pPreviewLabel->contentsRect().height(); | 94 | int previewHeight = m_pPreviewLabel->contentsRect().height(); |
94 | 95 | ||
95 | float widthScale = 1.0; | 96 | float widthScale = 1.0; |
96 | float heightScale = 1.0; | 97 | float heightScale = 1.0; |
97 | 98 | ||
98 | if (previewWidth < image.width()) { | 99 | if (previewWidth < image.width()) { |
99 | widthScale = (float)previewWidth / float(image.width()); | 100 | widthScale = (float)previewWidth / float(image.width()); |
100 | } | 101 | } |
101 | 102 | ||
102 | if (previewHeight < image.height()) { | 103 | if (previewHeight < image.height()) { |
103 | heightScale = (float)previewHeight / float(image.height()); | 104 | heightScale = (float)previewHeight / float(image.height()); |
104 | } | 105 | } |
105 | 106 | ||
106 | float scale = (widthScale < heightScale ? widthScale : heightScale); | 107 | float scale = (widthScale < heightScale ? widthScale : heightScale); |
107 | QImage previewImage = image.smoothScale((int)(image.width() * scale) , (int)(image.height() * scale)); | 108 | QImage previewImage = image.smoothScale((int)(image.width() * scale) , (int)(image.height() * scale)); |
108 | 109 | ||
109 | QPixmap previewPixmap; | 110 | QPixmap previewPixmap; |
110 | previewPixmap.convertFromImage(previewImage); | 111 | previewPixmap.convertFromImage(previewImage); |
111 | 112 | ||
112 | m_pPreviewLabel->setPixmap(previewPixmap); | 113 | m_pPreviewLabel->setPixmap(previewPixmap); |
113 | 114 | ||
114 | delete docLnk; | 115 | delete docLnk; |
115 | } | 116 | } |
116 | } | 117 | } |
diff --git a/noncore/graphics/drawpad/importdialog.h b/noncore/graphics/drawpad/importdialog.h index 16227d2..0e0727a 100644 --- a/noncore/graphics/drawpad/importdialog.h +++ b/noncore/graphics/drawpad/importdialog.h | |||
@@ -1,46 +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> | 17 | #include <opie2/ofileselector.h> |
18 | 18 | ||
19 | #include <qdialog.h> | 19 | #include <qdialog.h> |
20 | 20 | ||
21 | class DocLnk; | 21 | class DocLnk; |
22 | 22 | ||
23 | class QCheckBox; | 23 | class QCheckBox; |
24 | class QLabel; | 24 | class QLabel; |
25 | 25 | ||
26 | class ImportDialog : public QDialog | 26 | class ImportDialog : public QDialog |
27 | { | 27 | { |
28 | Q_OBJECT | 28 | Q_OBJECT |
29 | 29 | ||
30 | public: | 30 | public: |
31 | ImportDialog(QWidget* parent = 0, const char* name = 0); | 31 | ImportDialog(QWidget* parent = 0, const char* name = 0); |
32 | ~ImportDialog(); | 32 | ~ImportDialog(); |
33 | 33 | ||
34 | const DocLnk* selected(); | 34 | const DocLnk* selected(); |
35 | 35 | ||
36 | private slots: | 36 | private slots: |
37 | void fileChanged(); | 37 | void fileChanged(); |
38 | void preview(); | 38 | void preview(); |
39 | 39 | ||
40 | private: | 40 | private: |
41 | Opie::OFileSelector* m_pFileSelector; | 41 | Opie::Ui::OFileSelector* m_pFileSelector; |
42 | QLabel* m_pPreviewLabel; | 42 | QLabel* m_pPreviewLabel; |
43 | QCheckBox* m_pAutomaticPreviewCheckBox; | 43 | QCheckBox* m_pAutomaticPreviewCheckBox; |
44 | }; | 44 | }; |
45 | 45 | ||
46 | #endif // IMPORTDIALOG_H | 46 | #endif // IMPORTDIALOG_H |
diff --git a/noncore/graphics/drawpad/main.cpp b/noncore/graphics/drawpad/main.cpp index a6c666b..e48bb2e 100644 --- a/noncore/graphics/drawpad/main.cpp +++ b/noncore/graphics/drawpad/main.cpp | |||
@@ -1,18 +1,20 @@ | |||
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 <opie2/oapplicationfactory.h> | 16 | #include <opie2/oapplicationfactory.h> |
17 | 17 | ||
18 | using namespace Opie::Core; | ||
19 | using namespace Opie::Core; | ||
18 | OPIE_EXPORT_APP( OApplicationFactory<DrawPad> ) | 20 | OPIE_EXPORT_APP( OApplicationFactory<DrawPad> ) |