-rw-r--r-- | noncore/graphics/drawpad/drawpad.cpp | 6 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpad.h | 1 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.cpp | 20 | ||||
-rw-r--r-- | noncore/graphics/drawpad/exportdialog.cpp | 11 | ||||
-rw-r--r-- | noncore/graphics/drawpad/importdialog.cpp | 14 | ||||
-rw-r--r-- | noncore/graphics/drawpad/importdialog.h | 4 | ||||
-rw-r--r-- | noncore/graphics/drawpad/main.cpp | 2 | ||||
-rw-r--r-- | noncore/graphics/drawpad/opie-drawpad.control | 2 | ||||
-rw-r--r-- | noncore/graphics/drawpad/texttool.h | 1 |
9 files changed, 44 insertions, 17 deletions
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp index 4db6208..aac6bc1 100644 --- a/noncore/graphics/drawpad/drawpad.cpp +++ b/noncore/graphics/drawpad/drawpad.cpp | |||
@@ -269,36 +269,42 @@ DrawPad::DrawPad(QWidget* parent, const char* name) | |||
269 | m_pBrushColorToolButton->setPixmap(Resource::loadPixmap("drawpad/brushcolor")); | 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." ) ); | 270 | QWhatsThis::add( m_pBrushColorToolButton, tr( "Click here to select the color used when filling in areas." ) ); |
271 | 271 | ||
272 | OColorPopupMenu* brushColorPopupMenu = new OColorPopupMenu(Qt::white, m_pBrushColorToolButton); | 272 | OColorPopupMenu* brushColorPopupMenu = new OColorPopupMenu(Qt::white, m_pBrushColorToolButton); |
273 | connect(brushColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, SLOT(changeBrushColor(const QColor&))); | 273 | connect(brushColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, SLOT(changeBrushColor(const QColor&))); |
274 | 274 | ||
275 | QToolTip::add(m_pBrushColorToolButton, tr("Fill Color")); | 275 | QToolTip::add(m_pBrushColorToolButton, tr("Fill Color")); |
276 | m_pBrushColorToolButton->setPopup(brushColorPopupMenu); | 276 | m_pBrushColorToolButton->setPopup(brushColorPopupMenu); |
277 | m_pBrushColorToolButton->setPopupDelay(0); | 277 | m_pBrushColorToolButton->setPopupDelay(0); |
278 | 278 | ||
279 | changeBrushColor(Qt::white); | 279 | changeBrushColor(Qt::white); |
280 | 280 | ||
281 | } | ||
282 | |||
283 | |||
284 | void DrawPad::finishStartup() | ||
285 | { | ||
281 | // init pages | 286 | // init pages |
282 | 287 | ||
283 | QFile file(Global::applicationFileName("drawpad", "drawpad.xml")); | 288 | QFile file(Global::applicationFileName("drawpad", "drawpad.xml")); |
284 | 289 | ||
285 | if (file.open(IO_ReadOnly)) { | 290 | if (file.open(IO_ReadOnly)) { |
286 | m_pDrawPadCanvas->load(&file); | 291 | m_pDrawPadCanvas->load(&file); |
287 | file.close(); | 292 | file.close(); |
288 | } else { | 293 | } else { |
289 | m_pDrawPadCanvas->initialPage(); | 294 | m_pDrawPadCanvas->initialPage(); |
290 | } | 295 | } |
291 | 296 | ||
292 | loadConfig(); | 297 | loadConfig(); |
298 | |||
293 | } | 299 | } |
294 | 300 | ||
295 | DrawPad::~DrawPad() | 301 | DrawPad::~DrawPad() |
296 | { | 302 | { |
297 | saveConfig(); | 303 | saveConfig(); |
298 | 304 | ||
299 | QFile file(Global::applicationFileName("drawpad", "drawpad.xml")); | 305 | QFile file(Global::applicationFileName("drawpad", "drawpad.xml")); |
300 | 306 | ||
301 | if (file.open(IO_WriteOnly)) { | 307 | if (file.open(IO_WriteOnly)) { |
302 | m_pDrawPadCanvas->save(&file); | 308 | m_pDrawPadCanvas->save(&file); |
303 | file.close(); | 309 | file.close(); |
304 | } | 310 | } |
diff --git a/noncore/graphics/drawpad/drawpad.h b/noncore/graphics/drawpad/drawpad.h index 7306228..2cae700 100644 --- a/noncore/graphics/drawpad/drawpad.h +++ b/noncore/graphics/drawpad/drawpad.h | |||
@@ -31,24 +31,25 @@ class DrawPad : public QMainWindow | |||
31 | { | 31 | { |
32 | Q_OBJECT | 32 | Q_OBJECT |
33 | 33 | ||
34 | public: | 34 | public: |
35 | DrawPad(QWidget* parent = 0, const char* name = 0); | 35 | DrawPad(QWidget* parent = 0, const char* name = 0); |
36 | ~DrawPad(); | 36 | ~DrawPad(); |
37 | 37 | ||
38 | Tool* tool() { return m_pTool; } | 38 | Tool* tool() { return m_pTool; } |
39 | QPen pen() { return m_pen; } | 39 | QPen pen() { return m_pen; } |
40 | QBrush brush() { return m_brush; } | 40 | QBrush brush() { return m_brush; } |
41 | 41 | ||
42 | bool antiAliasing(); | 42 | bool antiAliasing(); |
43 | void finishStartup(); | ||
43 | 44 | ||
44 | private slots: | 45 | private slots: |
45 | void newPage(); | 46 | void newPage(); |
46 | void clearPage(); | 47 | void clearPage(); |
47 | void deletePage(); | 48 | void deletePage(); |
48 | 49 | ||
49 | void setPointTool(); | 50 | void setPointTool(); |
50 | void setLineTool(); | 51 | void setLineTool(); |
51 | void setRectangleTool(); | 52 | void setRectangleTool(); |
52 | void setFilledRectangleTool(); | 53 | void setFilledRectangleTool(); |
53 | void setEllipseTool(); | 54 | void setEllipseTool(); |
54 | void setFilledEllipseTool(); | 55 | void setFilledEllipseTool(); |
diff --git a/noncore/graphics/drawpad/drawpadcanvas.cpp b/noncore/graphics/drawpad/drawpadcanvas.cpp index 025bebb..dec498b 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.cpp +++ b/noncore/graphics/drawpad/drawpadcanvas.cpp | |||
@@ -173,37 +173,43 @@ void DrawPadCanvas::load(QIODevice* ioDevice) | |||
173 | textStream.setCodec(QTextCodec::codecForName("UTF-8")); | 173 | textStream.setCodec(QTextCodec::codecForName("UTF-8")); |
174 | 174 | ||
175 | QXmlInputSource xmlInputSource(textStream); | 175 | QXmlInputSource xmlInputSource(textStream); |
176 | QXmlSimpleReader xmlSimpleReader; | 176 | QXmlSimpleReader xmlSimpleReader; |
177 | DrawPadCanvasXmlHandler drawPadCanvasXmlHandler; | 177 | DrawPadCanvasXmlHandler drawPadCanvasXmlHandler; |
178 | 178 | ||
179 | xmlSimpleReader.setContentHandler(&drawPadCanvasXmlHandler); | 179 | xmlSimpleReader.setContentHandler(&drawPadCanvasXmlHandler); |
180 | xmlSimpleReader.parse(xmlInputSource); | 180 | xmlSimpleReader.parse(xmlInputSource); |
181 | 181 | ||
182 | m_pages = drawPadCanvasXmlHandler.pages(); | 182 | m_pages = drawPadCanvasXmlHandler.pages(); |
183 | 183 | ||
184 | if (m_pages.isEmpty()) { | 184 | if (m_pages.isEmpty()) { |
185 | m_pages.append(new Page("", contentsRect().size())); | 185 | m_pages.append(new Page("", |
186 | clipper()->width()+(verticalScrollBar()->isVisible()?verticalScrollBar()->width():0), | ||
187 | clipper()->height()+(horizontalScrollBar()->isVisible()?horizontalScrollBar()->height():0))); | ||
186 | m_pages.current()->pixmap()->fill(Qt::white); | 188 | m_pages.current()->pixmap()->fill(Qt::white); |
187 | } | 189 | } |
188 | 190 | ||
189 | resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); | 191 | resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); |
190 | viewport()->update(); | 192 | viewport()->update(); |
191 | 193 | ||
192 | emit pagesChanged(); | 194 | emit pagesChanged(); |
193 | } | 195 | } |
194 | 196 | ||
195 | void DrawPadCanvas::initialPage() | 197 | void DrawPadCanvas::initialPage() |
196 | { | 198 | { |
197 | m_pages.append(new Page("", 236, 232)); | 199 | m_pages.append(new Page("", |
200 | clipper()->width()+(verticalScrollBar()->isVisible()?verticalScrollBar()->width():0), | ||
201 | clipper()->height()+(horizontalScrollBar()->isVisible()?horizontalScrollBar()->height():0))); | ||
202 | //236, 232)); no more fixed sizes | ||
203 | |||
198 | m_pages.current()->pixmap()->fill(Qt::white); | 204 | m_pages.current()->pixmap()->fill(Qt::white); |
199 | 205 | ||
200 | resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); | 206 | resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); |
201 | viewport()->update(); | 207 | viewport()->update(); |
202 | 208 | ||
203 | emit pagesChanged(); | 209 | emit pagesChanged(); |
204 | } | 210 | } |
205 | 211 | ||
206 | void DrawPadCanvas::save(QIODevice* ioDevice) | 212 | void DrawPadCanvas::save(QIODevice* ioDevice) |
207 | { | 213 | { |
208 | QTextStream textStream(ioDevice); | 214 | QTextStream textStream(ioDevice); |
209 | textStream.setCodec(QTextCodec::codecForName("UTF-8")); | 215 | textStream.setCodec(QTextCodec::codecForName("UTF-8")); |
@@ -340,25 +346,28 @@ void DrawPadCanvas::selectPage(uint pagePosition) | |||
340 | m_pages.at(pagePosition - 1); | 346 | m_pages.at(pagePosition - 1); |
341 | 347 | ||
342 | resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); | 348 | resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); |
343 | viewport()->update(); | 349 | viewport()->update(); |
344 | 350 | ||
345 | emit pagesChanged(); | 351 | emit pagesChanged(); |
346 | } | 352 | } |
347 | 353 | ||
348 | void DrawPadCanvas::deleteAll() | 354 | void DrawPadCanvas::deleteAll() |
349 | { | 355 | { |
350 | m_pages.clear(); | 356 | m_pages.clear(); |
351 | 357 | ||
352 | m_pages.append(new Page("", contentsRect().size())); | 358 | m_pages.append(new Page("", |
359 | clipper()->width()+(verticalScrollBar()->isVisible()?verticalScrollBar()->width():0), | ||
360 | clipper()->height()+(horizontalScrollBar()->isVisible()?horizontalScrollBar()->height():0))); | ||
361 | |||
353 | m_pages.current()->pixmap()->fill(Qt::white); | 362 | m_pages.current()->pixmap()->fill(Qt::white); |
354 | 363 | ||
355 | resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); | 364 | resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); |
356 | viewport()->update(); | 365 | viewport()->update(); |
357 | 366 | ||
358 | emit pagesChanged(); | 367 | emit pagesChanged(); |
359 | } | 368 | } |
360 | 369 | ||
361 | void DrawPadCanvas::newPage(QString title, uint width, uint height, const QColor& color) | 370 | void DrawPadCanvas::newPage(QString title, uint width, uint height, const QColor& color) |
362 | { | 371 | { |
363 | m_pages.insert(m_pages.at() + 1, new Page(title, width, height)); | 372 | m_pages.insert(m_pages.at() + 1, new Page(title, width, height)); |
364 | m_pages.current()->pixmap()->fill(color); | 373 | m_pages.current()->pixmap()->fill(color); |
@@ -373,25 +382,28 @@ void DrawPadCanvas::clearPage() | |||
373 | { | 382 | { |
374 | m_pages.current()->pixmap()->fill(Qt::white); | 383 | m_pages.current()->pixmap()->fill(Qt::white); |
375 | 384 | ||
376 | resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); | 385 | resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); |
377 | viewport()->update(); | 386 | viewport()->update(); |
378 | } | 387 | } |
379 | 388 | ||
380 | void DrawPadCanvas::deletePage() | 389 | void DrawPadCanvas::deletePage() |
381 | { | 390 | { |
382 | m_pages.remove(m_pages.current()); | 391 | m_pages.remove(m_pages.current()); |
383 | 392 | ||
384 | if (m_pages.isEmpty()) { | 393 | if (m_pages.isEmpty()) { |
385 | m_pages.append(new Page("", contentsRect().size())); | 394 | m_pages.append(new Page("", |
395 | clipper()->width()+(verticalScrollBar()->isVisible()?verticalScrollBar()->width():0), | ||
396 | clipper()->height()+(horizontalScrollBar()->isVisible()?horizontalScrollBar()->height():0))); | ||
397 | |||
386 | m_pages.current()->pixmap()->fill(Qt::white); | 398 | m_pages.current()->pixmap()->fill(Qt::white); |
387 | } | 399 | } |
388 | 400 | ||
389 | resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); | 401 | resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); |
390 | viewport()->update(); | 402 | viewport()->update(); |
391 | 403 | ||
392 | emit pagesChanged(); | 404 | emit pagesChanged(); |
393 | } | 405 | } |
394 | 406 | ||
395 | void DrawPadCanvas::movePageUp() | 407 | void DrawPadCanvas::movePageUp() |
396 | { | 408 | { |
397 | int index = m_pages.at(); | 409 | int index = m_pages.at(); |
diff --git a/noncore/graphics/drawpad/exportdialog.cpp b/noncore/graphics/drawpad/exportdialog.cpp index 5b11c0e..adbd612 100644 --- a/noncore/graphics/drawpad/exportdialog.cpp +++ b/noncore/graphics/drawpad/exportdialog.cpp | |||
@@ -4,25 +4,25 @@ | |||
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 <qpe/fileselector.h> | 16 | #include <opie/ofileselector.h> |
17 | 17 | ||
18 | #include <qbuttongroup.h> | 18 | #include <qbuttongroup.h> |
19 | #include <qcombobox.h> | 19 | #include <qcombobox.h> |
20 | #include <qgroupbox.h> | 20 | #include <qgroupbox.h> |
21 | #include <qimage.h> | 21 | #include <qimage.h> |
22 | #include <qlabel.h> | 22 | #include <qlabel.h> |
23 | #include <qlayout.h> | 23 | #include <qlayout.h> |
24 | #include <qlineedit.h> | 24 | #include <qlineedit.h> |
25 | #include <qradiobutton.h> | 25 | #include <qradiobutton.h> |
26 | #include <qspinbox.h> | 26 | #include <qspinbox.h> |
27 | 27 | ||
28 | #include <stdlib.h> | 28 | #include <stdlib.h> |
@@ -57,27 +57,30 @@ ExportDialog::ExportDialog(uint pageAt, uint pageCount, QWidget* parent, const c | |||
57 | m_pToPageSpinBox->setValue(pageAt); | 57 | m_pToPageSpinBox->setValue(pageAt); |
58 | 58 | ||
59 | QGroupBox* exportGroupBox = new QGroupBox(0, Qt::Vertical, tr("Export As"), this); | 59 | QGroupBox* exportGroupBox = new QGroupBox(0, Qt::Vertical, tr("Export As"), this); |
60 | 60 | ||
61 | QLabel* nameLabel = new QLabel(tr("Name:"), exportGroupBox); | 61 | QLabel* nameLabel = new QLabel(tr("Name:"), exportGroupBox); |
62 | QLabel* formatLabel = new QLabel(tr("Format:"), exportGroupBox); | 62 | QLabel* formatLabel = new QLabel(tr("Format:"), exportGroupBox); |
63 | 63 | ||
64 | m_pNameLineEdit = new QLineEdit(exportGroupBox); | 64 | m_pNameLineEdit = new QLineEdit(exportGroupBox); |
65 | 65 | ||
66 | m_pFormatComboBox = new QComboBox(exportGroupBox); | 66 | m_pFormatComboBox = new QComboBox(exportGroupBox); |
67 | m_pFormatComboBox->insertStrList(QImageIO::outputFormats()); | 67 | m_pFormatComboBox->insertStrList(QImageIO::outputFormats()); |
68 | 68 | ||
69 | FileSelector* fileSelector = new FileSelector("image/*", this, "fileselector"); | 69 | MimeTypes types; types.insert( tr("All Images"), "image/*" ); |
70 | fileSelector->setNewVisible(false); | 70 | OFileSelector* fileSelector = new OFileSelector(this, OFileSelector::FileSelector, |
71 | fileSelector->setCloseVisible(false); | 71 | OFileSelector::Normal, |
72 | QString::null, QString::null, | ||
73 | types ); | ||
74 | fileSelector->setNameVisible( false ); | ||
72 | 75 | ||
73 | QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); | 76 | QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); |
74 | selectionButtonGroup->layout()->setSpacing(4); | 77 | selectionButtonGroup->layout()->setSpacing(4); |
75 | exportGroupBox->layout()->setSpacing(4); | 78 | exportGroupBox->layout()->setSpacing(4); |
76 | QGridLayout* selectionLayout = new QGridLayout(selectionButtonGroup->layout(), 2, 2); | 79 | QGridLayout* selectionLayout = new QGridLayout(selectionButtonGroup->layout(), 2, 2); |
77 | QHBoxLayout* rangeLayout = new QHBoxLayout(); | 80 | QHBoxLayout* rangeLayout = new QHBoxLayout(); |
78 | QGridLayout* exportLayout = new QGridLayout(exportGroupBox->layout(), 2, 2); | 81 | QGridLayout* exportLayout = new QGridLayout(exportGroupBox->layout(), 2, 2); |
79 | 82 | ||
80 | selectionLayout->addWidget(selectAllRadioButton, 0, 0); | 83 | selectionLayout->addWidget(selectAllRadioButton, 0, 0); |
81 | selectionLayout->addWidget(selectCurrentRadioButton, 1, 0); | 84 | selectionLayout->addWidget(selectCurrentRadioButton, 1, 0); |
82 | selectionLayout->addWidget(selectRangeRadioButton, 0, 1); | 85 | selectionLayout->addWidget(selectRangeRadioButton, 0, 1); |
83 | selectionLayout->addLayout(rangeLayout, 1, 1); | 86 | selectionLayout->addLayout(rangeLayout, 1, 1); |
diff --git a/noncore/graphics/drawpad/importdialog.cpp b/noncore/graphics/drawpad/importdialog.cpp index 1c447cb..9a59a20 100644 --- a/noncore/graphics/drawpad/importdialog.cpp +++ b/noncore/graphics/drawpad/importdialog.cpp | |||
@@ -5,41 +5,45 @@ | |||
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/applnk.h> | 16 | #include <qpe/applnk.h> |
17 | #include <qpe/fileselector.h> | 17 | #include <opie/ofileselector.h> |
18 | 18 | ||
19 | #include <qcheckbox.h> | 19 | #include <qcheckbox.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 <qpushbutton.h> | 23 | #include <qpushbutton.h> |
24 | 24 | ||
25 | ImportDialog::ImportDialog(QWidget* parent, const char* name) | 25 | ImportDialog::ImportDialog(QWidget* parent, const char* name) |
26 | : QDialog(parent, name, true) | 26 | : QDialog(parent, name, true) |
27 | { | 27 | { |
28 | setCaption(tr("DrawPad - Import")); | 28 | setCaption(tr("DrawPad - Import")); |
29 | 29 | ||
30 | m_pFileSelector = new FileSelector("image/*", this, "fileselector"); | 30 | MimeTypes types; types.insert( tr("All images"),"image/*" ); |
31 | m_pFileSelector = new OFileSelector(this, | ||
32 | OFileSelector::FileSelector, | ||
33 | OFileSelector::Normal, | ||
34 | QString::null, | ||
35 | QString::null, types ); | ||
36 | m_pFileSelector->setNameVisible( false ); | ||
31 | connect(m_pFileSelector, SIGNAL(fileSelected(const DocLnk&)), this, SLOT(fileChanged())); | 37 | connect(m_pFileSelector, SIGNAL(fileSelected(const DocLnk&)), this, SLOT(fileChanged())); |
32 | m_pFileSelector->setNewVisible(false); | ||
33 | m_pFileSelector->setCloseVisible(false); | ||
34 | 38 | ||
35 | m_pPreviewLabel = new QLabel(this); | 39 | m_pPreviewLabel = new QLabel(this); |
36 | m_pPreviewLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken); | 40 | m_pPreviewLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken); |
37 | m_pPreviewLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); | 41 | m_pPreviewLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); |
38 | m_pPreviewLabel->setFixedSize(114, 114); | 42 | m_pPreviewLabel->setFixedSize(114, 114); |
39 | m_pPreviewLabel->setBackgroundMode(QWidget::PaletteMid); | 43 | m_pPreviewLabel->setBackgroundMode(QWidget::PaletteMid); |
40 | 44 | ||
41 | m_pAutomaticPreviewCheckBox = new QCheckBox(tr("Automatic preview"), this); | 45 | m_pAutomaticPreviewCheckBox = new QCheckBox(tr("Automatic preview"), this); |
42 | m_pAutomaticPreviewCheckBox->setChecked(true); | 46 | m_pAutomaticPreviewCheckBox->setChecked(true); |
43 | 47 | ||
44 | QPushButton* previewPushButton = new QPushButton(tr("Preview"), this); | 48 | QPushButton* previewPushButton = new QPushButton(tr("Preview"), this); |
45 | connect(previewPushButton, SIGNAL(clicked()), this, SLOT(preview())); | 49 | connect(previewPushButton, SIGNAL(clicked()), this, SLOT(preview())); |
@@ -59,25 +63,25 @@ ImportDialog::ImportDialog(QWidget* parent, const char* name) | |||
59 | mainLayout->addLayout(previewLayout); | 63 | mainLayout->addLayout(previewLayout); |
60 | 64 | ||
61 | preview(); | 65 | preview(); |
62 | } | 66 | } |
63 | 67 | ||
64 | ImportDialog::~ImportDialog() | 68 | ImportDialog::~ImportDialog() |
65 | { | 69 | { |
66 | } | 70 | } |
67 | 71 | ||
68 | const DocLnk* ImportDialog::selected() | 72 | const DocLnk* ImportDialog::selected() |
69 | { | 73 | { |
70 | // FIXME change from pointer to reference -zecke | 74 | // FIXME change from pointer to reference -zecke |
71 | DocLnk *lnk = new DocLnk( m_pFileSelector->selectedDocument() ); | 75 | DocLnk *lnk = new DocLnk( m_pFileSelector->selectedDocument() ); |
72 | return lnk; | 76 | return lnk; |
73 | } | 77 | } |
74 | 78 | ||
75 | void ImportDialog::fileChanged() | 79 | void ImportDialog::fileChanged() |
76 | { | 80 | { |
77 | if (m_pAutomaticPreviewCheckBox->isChecked()) { | 81 | if (m_pAutomaticPreviewCheckBox->isChecked()) { |
78 | preview(); | 82 | preview(); |
79 | } | 83 | } |
80 | } | 84 | } |
81 | 85 | ||
82 | void ImportDialog::preview() | 86 | void ImportDialog::preview() |
83 | { | 87 | { |
diff --git a/noncore/graphics/drawpad/importdialog.h b/noncore/graphics/drawpad/importdialog.h index ef51d7c..ed655a5 100644 --- a/noncore/graphics/drawpad/importdialog.h +++ b/noncore/graphics/drawpad/importdialog.h | |||
@@ -8,38 +8,38 @@ | |||
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 <qdialog.h> | 17 | #include <qdialog.h> |
18 | 18 | ||
19 | class DocLnk; | 19 | class DocLnk; |
20 | class FileSelector; | 20 | class OFileSelector; |
21 | 21 | ||
22 | class QCheckBox; | 22 | class QCheckBox; |
23 | class QLabel; | 23 | class QLabel; |
24 | 24 | ||
25 | class ImportDialog : public QDialog | 25 | class ImportDialog : public QDialog |
26 | { | 26 | { |
27 | Q_OBJECT | 27 | Q_OBJECT |
28 | 28 | ||
29 | public: | 29 | public: |
30 | ImportDialog(QWidget* parent = 0, const char* name = 0); | 30 | ImportDialog(QWidget* parent = 0, const char* name = 0); |
31 | ~ImportDialog(); | 31 | ~ImportDialog(); |
32 | 32 | ||
33 | const DocLnk* selected(); | 33 | const DocLnk* selected(); |
34 | 34 | ||
35 | private slots: | 35 | private slots: |
36 | void fileChanged(); | 36 | void fileChanged(); |
37 | void preview(); | 37 | void preview(); |
38 | 38 | ||
39 | private: | 39 | private: |
40 | FileSelector* m_pFileSelector; | 40 | OFileSelector* m_pFileSelector; |
41 | QLabel* m_pPreviewLabel; | 41 | QLabel* m_pPreviewLabel; |
42 | QCheckBox* m_pAutomaticPreviewCheckBox; | 42 | QCheckBox* m_pAutomaticPreviewCheckBox; |
43 | }; | 43 | }; |
44 | 44 | ||
45 | #endif // IMPORTDIALOG_H | 45 | #endif // IMPORTDIALOG_H |
diff --git a/noncore/graphics/drawpad/main.cpp b/noncore/graphics/drawpad/main.cpp index ec628cc..12f8084 100644 --- a/noncore/graphics/drawpad/main.cpp +++ b/noncore/graphics/drawpad/main.cpp | |||
@@ -12,16 +12,16 @@ | |||
12 | ***************************************************************************/ | 12 | ***************************************************************************/ |
13 | 13 | ||
14 | #include "drawpad.h" | 14 | #include "drawpad.h" |
15 | 15 | ||
16 | #include <qpe/qpeapplication.h> | 16 | #include <qpe/qpeapplication.h> |
17 | 17 | ||
18 | int main(int argc, char **argv) | 18 | int main(int argc, char **argv) |
19 | { | 19 | { |
20 | QPEApplication a(argc, argv); | 20 | QPEApplication a(argc, argv); |
21 | 21 | ||
22 | DrawPad mw; // = new DrawPad();; | 22 | DrawPad mw; // = new DrawPad();; |
23 | a.showMainWidget(&mw ); | 23 | a.showMainWidget(&mw ); |
24 | 24 | mw.finishStartup(); | |
25 | 25 | ||
26 | return a.exec(); | 26 | return a.exec(); |
27 | } | 27 | } |
diff --git a/noncore/graphics/drawpad/opie-drawpad.control b/noncore/graphics/drawpad/opie-drawpad.control index 1c22186..5095b52 100644 --- a/noncore/graphics/drawpad/opie-drawpad.control +++ b/noncore/graphics/drawpad/opie-drawpad.control | |||
@@ -1,12 +1,12 @@ | |||
1 | Package: opie-drawpad | 1 | Package: opie-drawpad |
2 | Files: bin/drawpad apps/1Pim/drawpad.desktop pics/drawpad | 2 | Files: bin/drawpad apps/1Pim/drawpad.desktop pics/drawpad |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: Sébastien Prud'homme <prudhomme@laposte.net> | 5 | Maintainer: Sébastien Prud'homme <prudhomme@laposte.net> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal, libopie1 | 7 | Depends: task-opie-minimal, libopie1 |
9 | Description: A note taking program with basic draw tools | 8 | Description: A note taking program with basic draw tools |
10 | DrawPad is an easy note taking program for Zaurus. It can also | 9 | DrawPad is an easy note taking program for Zaurus. It can also |
11 | be used to draw simple images. DrawPad was developed for the Opie | 10 | be used to draw simple images. DrawPad was developed for the Opie |
12 | project, an alternative to the standard Zaurus environment. | 11 | project, an alternative to the standard Zaurus environment. |
12 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/graphics/drawpad/texttool.h b/noncore/graphics/drawpad/texttool.h index 3187675..17556a1 100644 --- a/noncore/graphics/drawpad/texttool.h +++ b/noncore/graphics/drawpad/texttool.h | |||
@@ -13,24 +13,25 @@ | |||
13 | 13 | ||
14 | #ifndef TEXTTOOL_H | 14 | #ifndef TEXTTOOL_H |
15 | #define TEXTTOOL_H | 15 | #define TEXTTOOL_H |
16 | 16 | ||
17 | #include "tool.h" | 17 | #include "tool.h" |
18 | 18 | ||
19 | #include <qdialog.h> | 19 | #include <qdialog.h> |
20 | 20 | ||
21 | class QLineEdit; | 21 | class QLineEdit; |
22 | 22 | ||
23 | class TextToolDialog : public QDialog | 23 | class TextToolDialog : public QDialog |
24 | { | 24 | { |
25 | Q_OBJECT | ||
25 | public: | 26 | public: |
26 | TextToolDialog(QWidget* parent = 0, const char* name = 0); | 27 | TextToolDialog(QWidget* parent = 0, const char* name = 0); |
27 | ~TextToolDialog(); | 28 | ~TextToolDialog(); |
28 | 29 | ||
29 | QString text(); | 30 | QString text(); |
30 | 31 | ||
31 | private: | 32 | private: |
32 | QLineEdit* m_pLineEdit; | 33 | QLineEdit* m_pLineEdit; |
33 | }; | 34 | }; |
34 | 35 | ||
35 | class TextTool : public Tool | 36 | class TextTool : public Tool |
36 | { | 37 | { |