author | kergoth <kergoth> | 2003-08-09 16:24:58 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-08-09 16:24:58 (UTC) |
commit | e16d333ec2e8509fc665921ca106c25325bae9e0 (patch) (unidiff) | |
tree | 9e9068190a15bc9b2a52ab33b40881128f732c0e /noncore/graphics/drawpad | |
parent | 1c58d1407f9584fedcdae390a04e2b37e5853361 (diff) | |
download | opie-e16d333ec2e8509fc665921ca106c25325bae9e0.zip opie-e16d333ec2e8509fc665921ca106c25325bae9e0.tar.gz opie-e16d333ec2e8509fc665921ca106c25325bae9e0.tar.bz2 |
Merge from BRANCH_1_0
-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 | |||
@@ -278,6 +278,11 @@ DrawPad::DrawPad(QWidget* parent, const char* name) | |||
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")); |
@@ -290,6 +295,7 @@ DrawPad::DrawPad(QWidget* parent, const char* name) | |||
290 | } | 295 | } |
291 | 296 | ||
292 | loadConfig(); | 297 | loadConfig(); |
298 | |||
293 | } | 299 | } |
294 | 300 | ||
295 | DrawPad::~DrawPad() | 301 | DrawPad::~DrawPad() |
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 | |||
@@ -40,6 +40,7 @@ public: | |||
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(); |
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 | |||
@@ -182,7 +182,9 @@ void DrawPadCanvas::load(QIODevice* ioDevice) | |||
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 | ||
@@ -194,7 +196,11 @@ void DrawPadCanvas::load(QIODevice* ioDevice) | |||
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()); |
@@ -349,7 +355,10 @@ 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()); |
@@ -382,7 +391,10 @@ void DrawPadCanvas::deletePage() | |||
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 | ||
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 | |||
@@ -13,7 +13,7 @@ | |||
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> |
@@ -66,9 +66,12 @@ ExportDialog::ExportDialog(uint pageAt, uint pageCount, QWidget* parent, const c | |||
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); |
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 | |||
@@ -14,7 +14,7 @@ | |||
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> |
@@ -27,10 +27,14 @@ ImportDialog::ImportDialog(QWidget* parent, const char* name) | |||
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); |
@@ -68,7 +72,7 @@ ImportDialog::~ImportDialog() | |||
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 | ||
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 | |||
@@ -17,7 +17,7 @@ | |||
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; |
@@ -37,7 +37,7 @@ private slots: | |||
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 | }; |
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 | |||
@@ -21,7 +21,7 @@ int main(int argc, char **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 | |||
@@ -4,9 +4,9 @@ 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 | |||
@@ -22,6 +22,7 @@ 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(); |