-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 | |||
@@ -275,24 +275,30 @@ DrawPad::DrawPad(QWidget* parent, const char* name) | |||
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 | ||
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 | |||
@@ -37,12 +37,13 @@ public: | |||
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 | ||
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 | |||
@@ -179,25 +179,31 @@ void DrawPadCanvas::load(QIODevice* ioDevice) | |||
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(); |
@@ -346,13 +352,16 @@ void DrawPadCanvas::selectPage(uint pagePosition) | |||
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(); |
@@ -379,13 +388,16 @@ void DrawPadCanvas::clearPage() | |||
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 | ||
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 | |||
@@ -10,13 +10,13 @@ | |||
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> |
@@ -63,15 +63,18 @@ ExportDialog::ExportDialog(uint pageAt, uint pageCount, QWidget* parent, const c | |||
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(); |
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 | |||
@@ -11,29 +11,33 @@ | |||
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); |
@@ -65,13 +69,13 @@ 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()) { |
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 | |||
@@ -14,13 +14,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 | { |
@@ -34,12 +34,12 @@ public: | |||
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 | |||
@@ -18,10 +18,10 @@ | |||
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 | |||
@@ -19,12 +19,13 @@ | |||
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 | ||