-rw-r--r-- | noncore/graphics/drawpad/drawpad.cpp | 53 | ||||
-rw-r--r-- | noncore/graphics/drawpad/pageinformationdialog.cpp | 10 | ||||
-rw-r--r-- | noncore/graphics/drawpad/thumbnailview.cpp | 27 |
3 files changed, 58 insertions, 32 deletions
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp index b0a414e..53db993 100644 --- a/noncore/graphics/drawpad/drawpad.cpp +++ b/noncore/graphics/drawpad/drawpad.cpp | |||
@@ -42,19 +42,20 @@ | |||
42 | 42 | ||
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 <qpainter.h> | 46 | #include <qpainter.h> |
47 | #include <qspinbox.h> | 47 | #include <qspinbox.h> |
48 | #include <qtoolbutton.h> | 48 | #include <qtoolbutton.h> |
49 | #include <qtooltip.h> | 49 | #include <qtooltip.h> |
50 | #include <qwhatsthis.h> | ||
50 | 51 | ||
51 | DrawPad::DrawPad(QWidget* parent, const char* name) | 52 | DrawPad::DrawPad(QWidget* parent, const char* name) |
52 | : QMainWindow(parent, name) | 53 | : QMainWindow(parent, name, WStyle_ContextHelp) |
53 | { | 54 | { |
54 | // init members | 55 | // init members |
55 | 56 | ||
56 | m_pDrawPadCanvas = new DrawPadCanvas(this, this); | 57 | m_pDrawPadCanvas = new DrawPadCanvas(this, this); |
57 | 58 | ||
58 | connect(m_pDrawPadCanvas, SIGNAL(pagesChanged()), this, SLOT(updateView())); | 59 | connect(m_pDrawPadCanvas, SIGNAL(pagesChanged()), this, SLOT(updateView())); |
59 | 60 | ||
60 | setCentralWidget(m_pDrawPadCanvas); | 61 | setCentralWidget(m_pDrawPadCanvas); |
@@ -99,125 +100,141 @@ DrawPad::DrawPad(QWidget* parent, const char* name) | |||
99 | m_pAntiAliasingAction->addTo(toolsPopupMenu); | 100 | m_pAntiAliasingAction->addTo(toolsPopupMenu); |
100 | 101 | ||
101 | menuBar->insertItem(tr("Tools"), toolsPopupMenu); | 102 | menuBar->insertItem(tr("Tools"), toolsPopupMenu); |
102 | 103 | ||
103 | // init page toolbar | 104 | // init page toolbar |
104 | 105 | ||
105 | QPEToolBar* pageToolBar = new QPEToolBar(this); | 106 | QPEToolBar* pageToolBar = new QPEToolBar(this); |
106 | 107 | ||
107 | QAction* newPageAction = new QAction(tr("New Page"), Resource::loadIconSet("new"), QString::null, 0, this); | 108 | QAction* newPageAction = new QAction(tr("New Page"), Resource::loadPixmap("new"), QString::null, 0, this); |
108 | connect(newPageAction, SIGNAL(activated()), this, SLOT(newPage())); | 109 | connect(newPageAction, SIGNAL(activated()), this, SLOT(newPage())); |
109 | newPageAction->addTo(pageToolBar); | 110 | newPageAction->addTo(pageToolBar); |
111 | newPageAction->setWhatsThis( tr( "Click here to add a new sheet." ) ); | ||
110 | 112 | ||
111 | QAction* clearPageAction = new QAction(tr("Clear Page"), Resource::loadIconSet("drawpad/clear"), QString::null, 0, this); | 113 | QAction* clearPageAction = new QAction(tr("Clear Page"), Resource::loadPixmap("drawpad/clear"), QString::null, 0, this); |
112 | connect(clearPageAction, SIGNAL(activated()), this, SLOT(clearPage())); | 114 | connect(clearPageAction, SIGNAL(activated()), this, SLOT(clearPage())); |
113 | clearPageAction->addTo(pageToolBar); | 115 | clearPageAction->addTo(pageToolBar); |
116 | clearPageAction->setWhatsThis( tr( "Click here to erase the current sheet." ) ); | ||
114 | 117 | ||
115 | QAction* deletePageAction = new QAction(tr("Delete Page"), Resource::loadIconSet("trash"), QString::null, 0, this); | 118 | QAction* deletePageAction = new QAction(tr("Delete Page"), Resource::loadPixmap("trash"), QString::null, 0, this); |
116 | connect(deletePageAction, SIGNAL(activated()), this, SLOT(deletePage())); | 119 | connect(deletePageAction, SIGNAL(activated()), this, SLOT(deletePage())); |
117 | deletePageAction->addTo(pageToolBar); | 120 | deletePageAction->addTo(pageToolBar); |
121 | deletePageAction->setWhatsThis( tr( "Click here to remove the current sheet." ) ); | ||
118 | 122 | ||
119 | QPEToolBar* emptyToolBar = new QPEToolBar(this); | 123 | QPEToolBar* emptyToolBar = new QPEToolBar(this); |
120 | emptyToolBar->setHorizontalStretchable(true); | 124 | emptyToolBar->setHorizontalStretchable(true); |
121 | 125 | ||
122 | // init navigation toolbar | 126 | // init navigation toolbar |
123 | 127 | ||
124 | QPEToolBar* navigationToolBar = new QPEToolBar(this); | 128 | QPEToolBar* navigationToolBar = new QPEToolBar(this); |
125 | 129 | ||
126 | m_pUndoAction = new QAction(tr("Undo"), Resource::loadIconSet("drawpad/undo"), QString::null, 0, this); | 130 | m_pUndoAction = new QAction(tr("Undo"), Resource::loadIconSet("drawpad/undo"), QString::null, 0, this); |
127 | connect(m_pUndoAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(undo())); | 131 | connect(m_pUndoAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(undo())); |
128 | m_pUndoAction->addTo(navigationToolBar); | 132 | m_pUndoAction->addTo(navigationToolBar); |
133 | m_pUndoAction->setWhatsThis( tr( "Click here to undo the last action." ) ); | ||
129 | 134 | ||
130 | m_pRedoAction = new QAction(tr("Redo"), Resource::loadIconSet("drawpad/redo"), QString::null, 0, this); | 135 | m_pRedoAction = new QAction(tr("Redo"), Resource::loadIconSet("drawpad/redo"), QString::null, 0, this); |
131 | connect(m_pRedoAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(redo())); | 136 | connect(m_pRedoAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(redo())); |
132 | m_pRedoAction->addTo(navigationToolBar); | 137 | m_pRedoAction->addTo(navigationToolBar); |
138 | m_pRedoAction->setWhatsThis( tr( "Click here to re-perform the last action." ) ); | ||
133 | 139 | ||
134 | m_pFirstPageAction = new QAction(tr("First Page"), Resource::loadIconSet("fastback"), QString::null, 0, this); | 140 | m_pFirstPageAction = new QAction(tr("First Page"), Resource::loadIconSet("fastback"), QString::null, 0, this); |
135 | connect(m_pFirstPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(goFirstPage())); | 141 | connect(m_pFirstPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(goFirstPage())); |
136 | m_pFirstPageAction->addTo(navigationToolBar); | 142 | m_pFirstPageAction->addTo(navigationToolBar); |
143 | m_pFirstPageAction->setWhatsThis( tr( "Click here to view the first page." ) ); | ||
137 | 144 | ||
138 | m_pPreviousPageAction = new QAction(tr("Previous Page"), Resource::loadIconSet("back"), QString::null, 0, this); | 145 | m_pPreviousPageAction = new QAction(tr("Previous Page"), Resource::loadIconSet("back"), QString::null, 0, this); |
139 | connect(m_pPreviousPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(goPreviousPage())); | 146 | connect(m_pPreviousPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(goPreviousPage())); |
140 | m_pPreviousPageAction->addTo(navigationToolBar); | 147 | m_pPreviousPageAction->addTo(navigationToolBar); |
148 | m_pPreviousPageAction->setWhatsThis( tr( "Click here to view the previous page." ) ); | ||
141 | 149 | ||
142 | m_pNextPageAction = new QAction(tr("Next Page"), Resource::loadIconSet("forward"), QString::null, 0, this); | 150 | m_pNextPageAction = new QAction(tr("Next Page"), Resource::loadIconSet("forward"), QString::null, 0, this); |
143 | connect(m_pNextPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(goNextPage())); | 151 | connect(m_pNextPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(goNextPage())); |
144 | m_pNextPageAction->addTo(navigationToolBar); | 152 | m_pNextPageAction->addTo(navigationToolBar); |
153 | m_pNextPageAction->setWhatsThis( tr( "Click here to view the next page." ) ); | ||
145 | 154 | ||
146 | m_pLastPageAction = new QAction(tr("Last Page"), Resource::loadIconSet("fastforward"), QString::null, 0, this); | 155 | m_pLastPageAction = new QAction(tr("Last Page"), Resource::loadIconSet("fastforward"), QString::null, 0, this); |
147 | connect(m_pLastPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(goLastPage())); | 156 | connect(m_pLastPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(goLastPage())); |
148 | m_pLastPageAction->addTo(navigationToolBar); | 157 | m_pLastPageAction->addTo(navigationToolBar); |
158 | m_pLastPageAction->setWhatsThis( tr( "Click here to view the last page." ) ); | ||
149 | 159 | ||
150 | // init draw mode toolbar | 160 | // init draw mode toolbar |
151 | 161 | ||
152 | QPEToolBar* drawModeToolBar = new QPEToolBar(this); | 162 | QPEToolBar* drawModeToolBar = new QPEToolBar(this); |
153 | 163 | ||
154 | m_pLineToolButton = new QToolButton(drawModeToolBar); | 164 | m_pLineToolButton = new QToolButton(drawModeToolBar); |
155 | m_pLineToolButton->setToggleButton(true); | 165 | m_pLineToolButton->setToggleButton(true); |
166 | QWhatsThis::add( m_pLineToolButton, tr( "Click here to select one of the available tools to draw lines." ) ); | ||
167 | |||
156 | 168 | ||
157 | QPopupMenu* linePopupMenu = new QPopupMenu(m_pLineToolButton); | 169 | QPopupMenu* linePopupMenu = new QPopupMenu(m_pLineToolButton); |
158 | 170 | ||
159 | m_pPointToolAction = new QAction(tr("Draw Point"), Resource::loadIconSet("drawpad/point.png"), "", 0, this); | 171 | m_pPointToolAction = new QAction(tr("Draw Point"), Resource::loadPixmap("drawpad/point"), "", 0, this); |
160 | connect(m_pPointToolAction, SIGNAL(activated()), this, SLOT(setPointTool())); | 172 | connect(m_pPointToolAction, SIGNAL(activated()), this, SLOT(setPointTool())); |
161 | m_pPointToolAction->addTo(linePopupMenu); | 173 | m_pPointToolAction->addTo(linePopupMenu); |
162 | 174 | ||
163 | m_pLineToolAction = new QAction(tr("Draw Line"), Resource::loadIconSet("drawpad/line.png"), "", 0, this); | 175 | m_pLineToolAction = new QAction(tr("Draw Line"), Resource::loadPixmap("drawpad/line"), "", 0, this); |
164 | connect(m_pLineToolAction, SIGNAL(activated()), this, SLOT(setLineTool())); | 176 | connect(m_pLineToolAction, SIGNAL(activated()), this, SLOT(setLineTool())); |
165 | m_pLineToolAction->addTo(linePopupMenu); | 177 | m_pLineToolAction->addTo(linePopupMenu); |
166 | 178 | ||
167 | m_pLineToolButton->setPopup(linePopupMenu); | 179 | m_pLineToolButton->setPopup(linePopupMenu); |
168 | m_pLineToolButton->setPopupDelay(0); | 180 | m_pLineToolButton->setPopupDelay(0); |
169 | 181 | ||
170 | m_pRectangleToolButton = new QToolButton(drawModeToolBar); | 182 | m_pRectangleToolButton = new QToolButton(drawModeToolBar); |
171 | m_pRectangleToolButton->setToggleButton(true); | 183 | m_pRectangleToolButton->setToggleButton(true); |
184 | QWhatsThis::add( m_pRectangleToolButton, tr( "Click here to select one of the available tools to draw rectangles." ) ); | ||
172 | 185 | ||
173 | QPopupMenu* rectanglePopupMenu = new QPopupMenu(m_pRectangleToolButton); | 186 | QPopupMenu* rectanglePopupMenu = new QPopupMenu(m_pRectangleToolButton); |
174 | 187 | ||
175 | m_pRectangleToolAction = new QAction(tr("Draw Rectangle"), Resource::loadIconSet("drawpad/rectangle.png"), "", 0, this); | 188 | m_pRectangleToolAction = new QAction(tr("Draw Rectangle"), Resource::loadPixmap("drawpad/rectangle"), "", 0, this); |
176 | connect(m_pRectangleToolAction, SIGNAL(activated()), this, SLOT(setRectangleTool())); | 189 | connect(m_pRectangleToolAction, SIGNAL(activated()), this, SLOT(setRectangleTool())); |
177 | m_pRectangleToolAction->addTo(rectanglePopupMenu); | 190 | m_pRectangleToolAction->addTo(rectanglePopupMenu); |
178 | 191 | ||
179 | m_pFilledRectangleToolAction = new QAction(tr("Draw Filled Rectangle"), Resource::loadIconSet("drawpad/filledrectangle.png"), "", 0, this); | 192 | m_pFilledRectangleToolAction = new QAction(tr("Draw Filled Rectangle"), Resource::loadPixmap("drawpad/filledrectangle"), "", 0, this); |
180 | connect(m_pFilledRectangleToolAction, SIGNAL(activated()), this, SLOT(setFilledRectangleTool())); | 193 | connect(m_pFilledRectangleToolAction, SIGNAL(activated()), this, SLOT(setFilledRectangleTool())); |
181 | m_pFilledRectangleToolAction->addTo(rectanglePopupMenu); | 194 | m_pFilledRectangleToolAction->addTo(rectanglePopupMenu); |
182 | 195 | ||
183 | m_pRectangleToolButton->setPopup(rectanglePopupMenu); | 196 | m_pRectangleToolButton->setPopup(rectanglePopupMenu); |
184 | m_pRectangleToolButton->setPopupDelay(0); | 197 | m_pRectangleToolButton->setPopupDelay(0); |
185 | 198 | ||
186 | m_pEllipseToolButton = new QToolButton(drawModeToolBar); | 199 | m_pEllipseToolButton = new QToolButton(drawModeToolBar); |
187 | m_pEllipseToolButton->setToggleButton(true); | 200 | m_pEllipseToolButton->setToggleButton(true); |
201 | QWhatsThis::add( m_pEllipseToolButton, tr( "Click here to select one of the available tools to draw ellipses." ) ); | ||
188 | 202 | ||
189 | QPopupMenu* ellipsePopupMenu = new QPopupMenu(m_pEllipseToolButton); | 203 | QPopupMenu* ellipsePopupMenu = new QPopupMenu(m_pEllipseToolButton); |
190 | 204 | ||
191 | m_pEllipseToolAction = new QAction(tr("Draw Ellipse"), Resource::loadIconSet("drawpad/ellipse.png"), "", 0, this); | 205 | m_pEllipseToolAction = new QAction(tr("Draw Ellipse"), Resource::loadPixmap("drawpad/ellipse"), "", 0, this); |
192 | connect(m_pEllipseToolAction, SIGNAL(activated()), this, SLOT(setEllipseTool())); | 206 | connect(m_pEllipseToolAction, SIGNAL(activated()), this, SLOT(setEllipseTool())); |
193 | m_pEllipseToolAction->addTo(ellipsePopupMenu); | 207 | m_pEllipseToolAction->addTo(ellipsePopupMenu); |
194 | 208 | ||
195 | m_pFilledEllipseToolAction = new QAction(tr("Draw Filled Ellipse"), Resource::loadIconSet("drawpad/filledellipse.png"), "", 0, this); | 209 | m_pFilledEllipseToolAction = new QAction(tr("Draw Filled Ellipse"), Resource::loadPixmap("drawpad/filledellipse"), "", 0, this); |
196 | connect(m_pFilledEllipseToolAction, SIGNAL(activated()), this, SLOT(setFilledEllipseTool())); | 210 | connect(m_pFilledEllipseToolAction, SIGNAL(activated()), this, SLOT(setFilledEllipseTool())); |
197 | m_pFilledEllipseToolAction->addTo(ellipsePopupMenu); | 211 | m_pFilledEllipseToolAction->addTo(ellipsePopupMenu); |
198 | 212 | ||
199 | m_pEllipseToolButton->setPopup(ellipsePopupMenu); | 213 | m_pEllipseToolButton->setPopup(ellipsePopupMenu); |
200 | m_pEllipseToolButton->setPopupDelay(0); | 214 | m_pEllipseToolButton->setPopupDelay(0); |
201 | 215 | ||
202 | m_pTextToolAction = new QAction(tr("Insert Text"), Resource::loadIconSet("drawpad/text.png"), QString::null, 0, this); | 216 | m_pTextToolAction = new QAction(tr("Insert Text"), Resource::loadPixmap("drawpad/text"), QString::null, 0, this); |
203 | m_pTextToolAction->setToggleAction(true); | 217 | m_pTextToolAction->setToggleAction(true); |
204 | connect(m_pTextToolAction, SIGNAL(activated()), this, SLOT(setTextTool())); | 218 | connect(m_pTextToolAction, SIGNAL(activated()), this, SLOT(setTextTool())); |
205 | m_pTextToolAction->addTo(drawModeToolBar); | 219 | m_pTextToolAction->addTo(drawModeToolBar); |
220 | m_pTextToolAction->setWhatsThis( tr( "Click here to select the text drawing tool." ) ); | ||
206 | 221 | ||
207 | m_pFillToolAction = new QAction(tr("Fill Region"), Resource::loadIconSet("drawpad/fill.png"), QString::null, 0, this); | 222 | m_pFillToolAction = new QAction(tr("Fill Region"), Resource::loadPixmap("drawpad/fill"), QString::null, 0, this); |
208 | m_pFillToolAction->setToggleAction(true); | 223 | m_pFillToolAction->setToggleAction(true); |
209 | connect(m_pFillToolAction, SIGNAL(activated()), this, SLOT(setFillTool())); | 224 | connect(m_pFillToolAction, SIGNAL(activated()), this, SLOT(setFillTool())); |
210 | m_pFillToolAction->addTo(drawModeToolBar); | 225 | m_pFillToolAction->addTo(drawModeToolBar); |
226 | m_pFillToolAction->setWhatsThis( tr( "Click here to select the fill tool." ) ); | ||
211 | 227 | ||
212 | m_pEraseToolAction = new QAction(tr("Erase Point"), Resource::loadIconSet("drawpad/erase.png"), QString::null, 0, this); | 228 | m_pEraseToolAction = new QAction(tr("Erase Point"), Resource::loadPixmap("drawpad/erase"), QString::null, 0, this); |
213 | m_pEraseToolAction->setToggleAction(true); | 229 | m_pEraseToolAction->setToggleAction(true); |
214 | connect(m_pEraseToolAction, SIGNAL(activated()), this, SLOT(setEraseTool())); | 230 | connect(m_pEraseToolAction, SIGNAL(activated()), this, SLOT(setEraseTool())); |
215 | m_pEraseToolAction->addTo(drawModeToolBar); | 231 | m_pEraseToolAction->addTo(drawModeToolBar); |
232 | m_pEraseToolAction->setWhatsThis( tr( "Click here to select the eraser tool." ) ); | ||
216 | 233 | ||
217 | m_pTool = 0; | 234 | m_pTool = 0; |
218 | setRectangleTool(); | 235 | setRectangleTool(); |
219 | setEllipseTool(); | 236 | setEllipseTool(); |
220 | setPointTool(); | 237 | setPointTool(); |
221 | 238 | ||
222 | emptyToolBar = new QPEToolBar(this); | 239 | emptyToolBar = new QPEToolBar(this); |
223 | emptyToolBar->setHorizontalStretchable(true); | 240 | emptyToolBar->setHorizontalStretchable(true); |
@@ -228,31 +245,34 @@ DrawPad::DrawPad(QWidget* parent, const char* name) | |||
228 | QPEToolBar* drawParametersToolBar = new QPEToolBar(this); | 245 | QPEToolBar* drawParametersToolBar = new QPEToolBar(this); |
229 | 246 | ||
230 | m_pPenWidthSpinBox = new QSpinBox(1, 9, 1, drawParametersToolBar); | 247 | m_pPenWidthSpinBox = new QSpinBox(1, 9, 1, drawParametersToolBar); |
231 | connect(m_pPenWidthSpinBox, SIGNAL(valueChanged(int)), this, SLOT(changePenWidth(int))); | 248 | connect(m_pPenWidthSpinBox, SIGNAL(valueChanged(int)), this, SLOT(changePenWidth(int))); |
232 | 249 | ||
233 | QToolTip::add(m_pPenWidthSpinBox, tr("Pen Width")); | 250 | QToolTip::add(m_pPenWidthSpinBox, tr("Pen Width")); |
234 | m_pPenWidthSpinBox->setValue(1); | 251 | m_pPenWidthSpinBox->setValue(1); |
235 | m_pPenWidthSpinBox->setFocusPolicy(QWidget::NoFocus); | 252 | m_pPenWidthSpinBox->setFocusPolicy(QWidget::NoFocus); |
253 | QWhatsThis::add( m_pPenWidthSpinBox, tr( "Click here to select the width of the drawing pen." ) ); | ||
236 | 254 | ||
237 | m_pPenColorToolButton = new QToolButton(drawParametersToolBar); | 255 | m_pPenColorToolButton = new QToolButton(drawParametersToolBar); |
238 | m_pPenColorToolButton->setPixmap(Resource::loadPixmap("drawpad/pencolor.png")); | 256 | m_pPenColorToolButton->setPixmap(Resource::loadPixmap("drawpad/pencolor")); |
257 | QWhatsThis::add( m_pPenColorToolButton, tr( "Click here to select the color used when drawing." ) ); | ||
239 | 258 | ||
240 | ColorPopupMenu* penColorPopupMenu = new ColorPopupMenu(Qt::black, m_pPenColorToolButton); | 259 | ColorPopupMenu* penColorPopupMenu = new ColorPopupMenu(Qt::black, m_pPenColorToolButton); |
241 | connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, SLOT(changePenColor(const QColor&))); | 260 | connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, SLOT(changePenColor(const QColor&))); |
242 | 261 | ||
243 | QToolTip::add(m_pPenColorToolButton, tr("Pen Color")); | 262 | QToolTip::add(m_pPenColorToolButton, tr("Pen Color")); |
244 | m_pPenColorToolButton->setPopup(penColorPopupMenu); | 263 | m_pPenColorToolButton->setPopup(penColorPopupMenu); |
245 | m_pPenColorToolButton->setPopupDelay(0); | 264 | m_pPenColorToolButton->setPopupDelay(0); |
246 | 265 | ||
247 | changePenColor(Qt::black); | 266 | changePenColor(Qt::black); |
248 | 267 | ||
249 | m_pBrushColorToolButton = new QToolButton(drawParametersToolBar); | 268 | m_pBrushColorToolButton = new QToolButton(drawParametersToolBar); |
250 | m_pBrushColorToolButton->setPixmap(Resource::loadPixmap("drawpad/brushcolor.png")); | 269 | m_pBrushColorToolButton->setPixmap(Resource::loadPixmap("drawpad/brushcolor")); |
270 | QWhatsThis::add( m_pBrushColorToolButton, tr( "Click here to select the color used when filling in areas." ) ); | ||
251 | 271 | ||
252 | ColorPopupMenu* brushColorPopupMenu = new ColorPopupMenu(Qt::white, m_pBrushColorToolButton); | 272 | ColorPopupMenu* brushColorPopupMenu = new ColorPopupMenu(Qt::white, m_pBrushColorToolButton); |
253 | connect(brushColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, SLOT(changeBrushColor(const QColor&))); | 273 | connect(brushColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, SLOT(changeBrushColor(const QColor&))); |
254 | 274 | ||
255 | QToolTip::add(m_pBrushColorToolButton, tr("Fill Color")); | 275 | QToolTip::add(m_pBrushColorToolButton, tr("Fill Color")); |
256 | m_pBrushColorToolButton->setPopup(brushColorPopupMenu); | 276 | m_pBrushColorToolButton->setPopup(brushColorPopupMenu); |
257 | m_pBrushColorToolButton->setPopupDelay(0); | 277 | m_pBrushColorToolButton->setPopupDelay(0); |
258 | 278 | ||
@@ -540,18 +560,17 @@ void DrawPad::changeBrushColor(const QColor& color) | |||
540 | m_pBrushColorToolButton->popup()->hide(); | 560 | m_pBrushColorToolButton->popup()->hide(); |
541 | } | 561 | } |
542 | 562 | ||
543 | void DrawPad::updateView() | 563 | void DrawPad::updateView() |
544 | { | 564 | { |
545 | uint pagePosition = m_pDrawPadCanvas->pagePosition(); | 565 | uint pagePosition = m_pDrawPadCanvas->pagePosition(); |
546 | uint pageCount = m_pDrawPadCanvas->pageCount(); | 566 | uint pageCount = m_pDrawPadCanvas->pageCount(); |
547 | 567 | ||
548 | setCaption(tr("DrawPad") + " - " + tr("Page") + " " | 568 | setCaption( tr( "DrawPad - Page %1/%2" ).arg( pagePosition ).arg( pageCount ) ); |
549 | + QString::number(pagePosition) + "/" + QString::number(pageCount)); | ||
550 | 569 | ||
551 | m_pUndoAction->setEnabled(m_pDrawPadCanvas->currentPage()->undoEnabled()); | 570 | m_pUndoAction->setEnabled(m_pDrawPadCanvas->currentPage()->undoEnabled()); |
552 | m_pRedoAction->setEnabled(m_pDrawPadCanvas->currentPage()->redoEnabled()); | 571 | m_pRedoAction->setEnabled(m_pDrawPadCanvas->currentPage()->redoEnabled()); |
553 | 572 | ||
554 | m_pFirstPageAction->setEnabled(m_pDrawPadCanvas->goPreviousPageEnabled()); | 573 | m_pFirstPageAction->setEnabled(m_pDrawPadCanvas->goPreviousPageEnabled()); |
555 | m_pPreviousPageAction->setEnabled(m_pDrawPadCanvas->goPreviousPageEnabled()); | 574 | m_pPreviousPageAction->setEnabled(m_pDrawPadCanvas->goPreviousPageEnabled()); |
556 | m_pNextPageAction->setEnabled(m_pDrawPadCanvas->goNextPageEnabled()); | 575 | m_pNextPageAction->setEnabled(m_pDrawPadCanvas->goNextPageEnabled()); |
557 | m_pLastPageAction->setEnabled(m_pDrawPadCanvas->goNextPageEnabled()); | 576 | m_pLastPageAction->setEnabled(m_pDrawPadCanvas->goNextPageEnabled()); |
diff --git a/noncore/graphics/drawpad/pageinformationdialog.cpp b/noncore/graphics/drawpad/pageinformationdialog.cpp index cb14d73..d769668 100644 --- a/noncore/graphics/drawpad/pageinformationdialog.cpp +++ b/noncore/graphics/drawpad/pageinformationdialog.cpp | |||
@@ -89,29 +89,29 @@ QString PageInformationDialog::dateTimeString(QDateTime dateTime) | |||
89 | config.setGroup("Date"); | 89 | config.setGroup("Date"); |
90 | 90 | ||
91 | QChar separator = config.readEntry("Separator", "/")[0]; | 91 | QChar separator = config.readEntry("Separator", "/")[0]; |
92 | DateFormat::Order shortOrder = (DateFormat::Order)config .readNumEntry("ShortOrder", DateFormat::DayMonthYear); | 92 | DateFormat::Order shortOrder = (DateFormat::Order)config .readNumEntry("ShortOrder", DateFormat::DayMonthYear); |
93 | 93 | ||
94 | for (int i = 0; i < 3; i++) { | 94 | for (int i = 0; i < 3; i++) { |
95 | switch((shortOrder >> (i * 3)) & 0x0007) { | 95 | switch((shortOrder >> (i * 3)) & 0x0007) { |
96 | case 0x0001: | 96 | case 0x0001: |
97 | result += QString().sprintf("%02d", dateTime.date().day()); | 97 | result.append( QString().sprintf("%02d", dateTime.date().day()) ); |
98 | break; | 98 | break; |
99 | case 0x0002: | 99 | case 0x0002: |
100 | result += QString().sprintf("%02d", dateTime.date().month()); | 100 | result.append( QString().sprintf("%02d", dateTime.date().month()) ); |
101 | break; | 101 | break; |
102 | case 0x0004: | 102 | case 0x0004: |
103 | result += QString().sprintf("%04d", dateTime.date().year()); | 103 | result.append( QString().sprintf("%04d", dateTime.date().year()) ); |
104 | break; | 104 | break; |
105 | default: | 105 | default: |
106 | break; | 106 | break; |
107 | } | 107 | } |
108 | 108 | ||
109 | if (i < 2) { | 109 | if (i < 2) { |
110 | result += separator; | 110 | result.append( separator ); |
111 | } | 111 | } |
112 | } | 112 | } |
113 | 113 | ||
114 | result += QString().sprintf(" %02d:%02d", dateTime.time().hour(), dateTime.time().minute()); | 114 | result.append( QString().sprintf(" %02d:%02d", dateTime.time().hour(), dateTime.time().minute()) ); |
115 | 115 | ||
116 | return result; | 116 | return result; |
117 | } | 117 | } |
diff --git a/noncore/graphics/drawpad/thumbnailview.cpp b/noncore/graphics/drawpad/thumbnailview.cpp index 9b08ca2..90ba39c 100644 --- a/noncore/graphics/drawpad/thumbnailview.cpp +++ b/noncore/graphics/drawpad/thumbnailview.cpp | |||
@@ -22,16 +22,17 @@ | |||
22 | #include <qpe/resource.h> | 22 | #include <qpe/resource.h> |
23 | #include <qpe/timestring.h> | 23 | #include <qpe/timestring.h> |
24 | 24 | ||
25 | #include <qapplication.h> | 25 | #include <qapplication.h> |
26 | #include <qimage.h> | 26 | #include <qimage.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qmessagebox.h> | 28 | #include <qmessagebox.h> |
29 | #include <qtoolbutton.h> | 29 | #include <qtoolbutton.h> |
30 | #include <qwhatsthis.h> | ||
30 | 31 | ||
31 | #define THUMBNAIL_SIZE 48 | 32 | #define THUMBNAIL_SIZE 48 |
32 | 33 | ||
33 | PageListBoxItem::PageListBoxItem(Page* page, QListBox* parent) | 34 | PageListBoxItem::PageListBoxItem(Page* page, QListBox* parent) |
34 | : QListBoxItem(parent) | 35 | : QListBoxItem(parent) |
35 | { | 36 | { |
36 | m_pPage = page; | 37 | m_pPage = page; |
37 | 38 | ||
@@ -51,20 +52,21 @@ PageListBoxItem::PageListBoxItem(Page* page, QListBox* parent) | |||
51 | heightScale = (float)previewHeight / float(image.height()); | 52 | heightScale = (float)previewHeight / float(image.height()); |
52 | } | 53 | } |
53 | 54 | ||
54 | float scale = (widthScale < heightScale ? widthScale : heightScale); | 55 | float scale = (widthScale < heightScale ? widthScale : heightScale); |
55 | QImage thumbnailImage = image.smoothScale((int)(image.width() * scale) , (int)(image.height() * scale)); | 56 | QImage thumbnailImage = image.smoothScale((int)(image.width() * scale) , (int)(image.height() * scale)); |
56 | 57 | ||
57 | m_thumbnail.convertFromImage(thumbnailImage); | 58 | m_thumbnail.convertFromImage(thumbnailImage); |
58 | 59 | ||
59 | m_titleText = QObject::tr("Title:") + " " + m_pPage->title(); | 60 | m_titleText = QObject::tr( "Title: %1" ).arg( m_pPage->title() ); |
60 | m_dimensionText = QObject::tr("Dimension:") + " " + QString::number(m_pPage->pixmap()->width()) | 61 | m_dimensionText = QObject::tr( "Dimension: %1x%2" ). |
61 | + "x" + QString::number(m_pPage->pixmap()->height()); | 62 | arg( m_pPage->pixmap()->width() ). |
62 | m_dateText = QObject::tr("Date:") + " " + dateTimeString(m_pPage->lastModified()); | 63 | arg( m_pPage->pixmap()->height() ); |
64 | m_dateText = QObject::tr( "Date: %1" ).arg( dateTimeString(m_pPage->lastModified()) ); | ||
63 | 65 | ||
64 | QColor baseColor = parent->colorGroup().base(); | 66 | QColor baseColor = parent->colorGroup().base(); |
65 | int h, s, v; | 67 | int h, s, v; |
66 | baseColor.hsv(&h, &s, &v); | 68 | baseColor.hsv(&h, &s, &v); |
67 | 69 | ||
68 | if (v > 128) { | 70 | if (v > 128) { |
69 | m_alternateColor = baseColor.dark(115); | 71 | m_alternateColor = baseColor.dark(115); |
70 | } else if (baseColor != Qt::black) { | 72 | } else if (baseColor != Qt::black) { |
@@ -139,34 +141,34 @@ QString PageListBoxItem::dateTimeString(QDateTime dateTime) | |||
139 | config.setGroup("Date"); | 141 | config.setGroup("Date"); |
140 | 142 | ||
141 | QChar separator = config.readEntry("Separator", "/")[0]; | 143 | QChar separator = config.readEntry("Separator", "/")[0]; |
142 | DateFormat::Order shortOrder = (DateFormat::Order)config .readNumEntry("ShortOrder", DateFormat::DayMonthYear); | 144 | DateFormat::Order shortOrder = (DateFormat::Order)config .readNumEntry("ShortOrder", DateFormat::DayMonthYear); |
143 | 145 | ||
144 | for (int i = 0; i < 3; i++) { | 146 | for (int i = 0; i < 3; i++) { |
145 | switch((shortOrder >> (i * 3)) & 0x0007) { | 147 | switch((shortOrder >> (i * 3)) & 0x0007) { |
146 | case 0x0001: | 148 | case 0x0001: |
147 | result += QString().sprintf("%02d", dateTime.date().day()); | 149 | result.append( QString().sprintf("%02d", dateTime.date().day()) ); |
148 | break; | 150 | break; |
149 | case 0x0002: | 151 | case 0x0002: |
150 | result += QString().sprintf("%02d", dateTime.date().month()); | 152 | result.append( QString().sprintf("%02d", dateTime.date().month()) ); |
151 | break; | 153 | break; |
152 | case 0x0004: | 154 | case 0x0004: |
153 | result += QString().sprintf("%04d", dateTime.date().year()); | 155 | result.append( QString().sprintf("%04d", dateTime.date().year()) ); |
154 | break; | 156 | break; |
155 | default: | 157 | default: |
156 | break; | 158 | break; |
157 | } | 159 | } |
158 | 160 | ||
159 | if (i < 2) { | 161 | if (i < 2) { |
160 | result += separator; | 162 | result.append( separator ); |
161 | } | 163 | } |
162 | } | 164 | } |
163 | 165 | ||
164 | result += QString().sprintf(" %02d:%02d", dateTime.time().hour(), dateTime.time().minute()); | 166 | result.append( QString().sprintf(" %02d:%02d", dateTime.time().hour(), dateTime.time().minute()) ); |
165 | 167 | ||
166 | return result; | 168 | return result; |
167 | } | 169 | } |
168 | 170 | ||
169 | PageListBox::PageListBox(DrawPadCanvas* drawPadCanvas, QWidget* parent, const char* name) | 171 | PageListBox::PageListBox(DrawPadCanvas* drawPadCanvas, QWidget* parent, const char* name) |
170 | : QListBox(parent, name) | 172 | : QListBox(parent, name) |
171 | { | 173 | { |
172 | m_pDrawPadCanvas = drawPadCanvas; | 174 | m_pDrawPadCanvas = drawPadCanvas; |
@@ -224,49 +226,54 @@ Page* PageListBox::selected() const | |||
224 | } else { | 226 | } else { |
225 | page = NULL; | 227 | page = NULL; |
226 | } | 228 | } |
227 | 229 | ||
228 | return page; | 230 | return page; |
229 | } | 231 | } |
230 | 232 | ||
231 | ThumbnailView::ThumbnailView(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas, QWidget* parent, const char* name) | 233 | ThumbnailView::ThumbnailView(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas, QWidget* parent, const char* name) |
232 | : QWidget(parent, name, Qt::WType_Modal | Qt::WType_TopLevel) | 234 | : QWidget(parent, name, Qt::WType_Modal | Qt::WType_TopLevel | Qt::WStyle_ContextHelp) |
233 | { | 235 | { |
234 | inLoop = false; | 236 | inLoop = false; |
235 | 237 | ||
236 | m_pDrawPad = drawPad; | 238 | m_pDrawPad = drawPad; |
237 | m_pDrawPadCanvas = drawPadCanvas; | 239 | m_pDrawPadCanvas = drawPadCanvas; |
238 | 240 | ||
239 | setCaption(tr("DrawPad - Thumbnail View")); | 241 | setCaption(tr("DrawPad - Thumbnail View")); |
240 | 242 | ||
241 | QToolButton* newPageButton = new QToolButton(this); | 243 | QToolButton* newPageButton = new QToolButton(this); |
242 | newPageButton->setIconSet(Resource::loadIconSet("new")); | 244 | newPageButton->setIconSet(Resource::loadIconSet("new")); |
243 | newPageButton->setAutoRaise(true); | 245 | newPageButton->setAutoRaise(true); |
244 | connect(newPageButton, SIGNAL(clicked()), this, SLOT(newPage())); | 246 | connect(newPageButton, SIGNAL(clicked()), this, SLOT(newPage())); |
247 | QWhatsThis::add( newPageButton, tr( "Click here to add a new sheet." ) ); | ||
245 | 248 | ||
246 | QToolButton* clearPageButton = new QToolButton(this); | 249 | QToolButton* clearPageButton = new QToolButton(this); |
247 | clearPageButton->setIconSet(Resource::loadIconSet("drawpad/clear")); | 250 | clearPageButton->setIconSet(Resource::loadIconSet("drawpad/clear")); |
248 | clearPageButton->setAutoRaise(true); | 251 | clearPageButton->setAutoRaise(true); |
249 | connect(clearPageButton, SIGNAL(clicked()), this, SLOT(clearPage())); | 252 | connect(clearPageButton, SIGNAL(clicked()), this, SLOT(clearPage())); |
253 | QWhatsThis::add( clearPageButton, tr( "Click here to erase the current sheet." ) ); | ||
250 | 254 | ||
251 | QToolButton* deletePageButton = new QToolButton(this); | 255 | QToolButton* deletePageButton = new QToolButton(this); |
252 | deletePageButton->setIconSet(Resource::loadIconSet("trash")); | 256 | deletePageButton->setIconSet(Resource::loadIconSet("trash")); |
253 | deletePageButton->setAutoRaise(true); | 257 | deletePageButton->setAutoRaise(true); |
254 | connect(deletePageButton, SIGNAL(clicked()), this, SLOT(deletePage())); | 258 | connect(deletePageButton, SIGNAL(clicked()), this, SLOT(deletePage())); |
259 | QWhatsThis::add( deletePageButton, tr( "Click here to remove the current sheet." ) ); | ||
255 | 260 | ||
256 | m_pMovePageUpButton = new QToolButton(this); | 261 | m_pMovePageUpButton = new QToolButton(this); |
257 | m_pMovePageUpButton->setIconSet(Resource::loadIconSet("up")); | 262 | m_pMovePageUpButton->setIconSet(Resource::loadIconSet("up")); |
258 | m_pMovePageUpButton->setAutoRaise(true); | 263 | m_pMovePageUpButton->setAutoRaise(true); |
259 | connect(m_pMovePageUpButton, SIGNAL(clicked()), this, SLOT(movePageUp())); | 264 | connect(m_pMovePageUpButton, SIGNAL(clicked()), this, SLOT(movePageUp())); |
265 | QWhatsThis::add( m_pMovePageUpButton, tr( "Click here to move the current sheet up one position in the list." ) ); | ||
260 | 266 | ||
261 | m_pMovePageDownButton = new QToolButton(this); | 267 | m_pMovePageDownButton = new QToolButton(this); |
262 | m_pMovePageDownButton->setIconSet(Resource::loadIconSet("down")); | 268 | m_pMovePageDownButton->setIconSet(Resource::loadIconSet("down")); |
263 | m_pMovePageDownButton->setAutoRaise(true); | 269 | m_pMovePageDownButton->setAutoRaise(true); |
264 | connect(m_pMovePageDownButton, SIGNAL(clicked()), this, SLOT(movePageDown())); | 270 | connect(m_pMovePageDownButton, SIGNAL(clicked()), this, SLOT(movePageDown())); |
271 | QWhatsThis::add( m_pMovePageDownButton, tr( "Click here to move the current sheet down one position in the list." ) ); | ||
265 | 272 | ||
266 | m_pPageListBox = new PageListBox(m_pDrawPadCanvas, this); | 273 | m_pPageListBox = new PageListBox(m_pDrawPadCanvas, this); |
267 | connect(m_pPageListBox, SIGNAL(selectionChanged()), this, SLOT(changePage())); | 274 | connect(m_pPageListBox, SIGNAL(selectionChanged()), this, SLOT(changePage())); |
268 | 275 | ||
269 | QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); | 276 | QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); |
270 | QHBoxLayout* buttonLayout = new QHBoxLayout(0); | 277 | QHBoxLayout* buttonLayout = new QHBoxLayout(0); |
271 | 278 | ||
272 | buttonLayout->addWidget(newPageButton); | 279 | buttonLayout->addWidget(newPageButton); |