summaryrefslogtreecommitdiff
path: root/noncore/graphics/drawpad/drawpad.cpp
authorleseb <leseb>2002-06-13 16:43:16 (UTC)
committer leseb <leseb>2002-06-13 16:43:16 (UTC)
commit54de91b66a2f0f985ff89503e919f85713d1f22c (patch) (unidiff)
tree55df26ca5f08584beb4e033a1fee4510a8e2d45c /noncore/graphics/drawpad/drawpad.cpp
parent6a178f4ad2c3a9b92224c3506165cf03df41202e (diff)
downloadopie-54de91b66a2f0f985ff89503e919f85713d1f22c.zip
opie-54de91b66a2f0f985ff89503e919f85713d1f22c.tar.gz
opie-54de91b66a2f0f985ff89503e919f85713d1f22c.tar.bz2
Starting to implement page attributes
Diffstat (limited to 'noncore/graphics/drawpad/drawpad.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/drawpad/drawpad.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp
index ef55268..369e7f0 100644
--- a/noncore/graphics/drawpad/drawpad.cpp
+++ b/noncore/graphics/drawpad/drawpad.cpp
@@ -2,48 +2,49 @@
2 * * 2 * *
3 * DrawPad - a drawing program for Opie Environment * 3 * DrawPad - a drawing program for Opie Environment *
4 * * 4 * *
5 * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * 5 * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> *
6 * * 6 * *
7 * This program is free software; you can redistribute it and/or modify * 7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by * 8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or * 9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. * 10 * (at your option) any later version. *
11 * * 11 * *
12 ***************************************************************************/ 12 ***************************************************************************/
13 13
14#include "drawpad.h" 14#include "drawpad.h"
15 15
16#include "drawpadcanvas.h" 16#include "drawpadcanvas.h"
17#include "ellipsetool.h" 17#include "ellipsetool.h"
18#include "erasetool.h" 18#include "erasetool.h"
19#include "exportdialog.h" 19#include "exportdialog.h"
20#include "filledellipsetool.h" 20#include "filledellipsetool.h"
21#include "filledrectangletool.h" 21#include "filledrectangletool.h"
22#include "filltool.h" 22#include "filltool.h"
23#include "importdialog.h" 23#include "importdialog.h"
24#include "linetool.h" 24#include "linetool.h"
25#include "newpagedialog.h" 25#include "newpagedialog.h"
26#include "pageinformationdialog.h"
26#include "pointtool.h" 27#include "pointtool.h"
27#include "rectangletool.h" 28#include "rectangletool.h"
28#include "texttool.h" 29#include "texttool.h"
29#include "thumbnailview.h" 30#include "thumbnailview.h"
30 31
31#include <opie/colordialog.h> 32#include <opie/colordialog.h>
32#include <opie/colorpopupmenu.h> 33#include <opie/colorpopupmenu.h>
33 34
34#include <qpe/applnk.h> 35#include <qpe/applnk.h>
35#include <qpe/global.h> 36#include <qpe/global.h>
36#include <qpe/qpemenubar.h> 37#include <qpe/qpemenubar.h>
37#include <qpe/qpetoolbar.h> 38#include <qpe/qpetoolbar.h>
38#include <qpe/resource.h> 39#include <qpe/resource.h>
39 40
40#include <qaction.h> 41#include <qaction.h>
41#include <qfile.h> 42#include <qfile.h>
42#include <qmessagebox.h> 43#include <qmessagebox.h>
43#include <qpainter.h> 44#include <qpainter.h>
44#include <qspinbox.h> 45#include <qspinbox.h>
45#include <qtoolbutton.h> 46#include <qtoolbutton.h>
46#include <qtooltip.h> 47#include <qtooltip.h>
47 48
48DrawPad::DrawPad(QWidget* parent, const char* name) 49DrawPad::DrawPad(QWidget* parent, const char* name)
49 : QMainWindow(parent, name) 50 : QMainWindow(parent, name)
@@ -65,48 +66,52 @@ DrawPad::DrawPad(QWidget* parent, const char* name)
65 QPEToolBar* menuToolBar = new QPEToolBar(this); 66 QPEToolBar* menuToolBar = new QPEToolBar(this);
66 QPEMenuBar* menuBar = new QPEMenuBar(menuToolBar); 67 QPEMenuBar* menuBar = new QPEMenuBar(menuToolBar);
67 68
68 QPopupMenu *toolsPopupMenu = new QPopupMenu(menuBar); 69 QPopupMenu *toolsPopupMenu = new QPopupMenu(menuBar);
69 70
70 QAction* deleteAllAction = new QAction(tr("Delete All"), QString::null, 0, this); 71 QAction* deleteAllAction = new QAction(tr("Delete All"), QString::null, 0, this);
71 connect(deleteAllAction, SIGNAL(activated()), this, SLOT(deleteAll())); 72 connect(deleteAllAction, SIGNAL(activated()), this, SLOT(deleteAll()));
72 deleteAllAction->addTo(toolsPopupMenu); 73 deleteAllAction->addTo(toolsPopupMenu);
73 74
74 toolsPopupMenu->insertSeparator(); 75 toolsPopupMenu->insertSeparator();
75 76
76 QAction* importPageAction = new QAction(tr("Import"), tr("Import..."), 0, this); 77 QAction* importPageAction = new QAction(tr("Import"), tr("Import..."), 0, this);
77 connect(importPageAction, SIGNAL(activated()), this, SLOT(importPage())); 78 connect(importPageAction, SIGNAL(activated()), this, SLOT(importPage()));
78 importPageAction->addTo(toolsPopupMenu); 79 importPageAction->addTo(toolsPopupMenu);
79 80
80 QAction* exportPageAction = new QAction(tr("Export"), tr("Export..."), 0, this); 81 QAction* exportPageAction = new QAction(tr("Export"), tr("Export..."), 0, this);
81 connect(exportPageAction, SIGNAL(activated()), this, SLOT(exportPage())); 82 connect(exportPageAction, SIGNAL(activated()), this, SLOT(exportPage()));
82 exportPageAction->addTo(toolsPopupMenu); 83 exportPageAction->addTo(toolsPopupMenu);
83 84
84 toolsPopupMenu->insertSeparator(); 85 toolsPopupMenu->insertSeparator();
85 86
86 QAction* thumbnailViewAction = new QAction(tr("Thumbnail View"), tr("Thumbnail View..."), 0, this); 87 QAction* thumbnailViewAction = new QAction(tr("Thumbnail View"), tr("Thumbnail View..."), 0, this);
87 connect(thumbnailViewAction, SIGNAL(activated()), this, SLOT(thumbnailView())); 88 connect(thumbnailViewAction, SIGNAL(activated()), this, SLOT(thumbnailView()));
88 thumbnailViewAction->addTo(toolsPopupMenu); 89 thumbnailViewAction->addTo(toolsPopupMenu);
90
91 QAction* pageInformationAction = new QAction(tr("Page Information"), tr("Page Information..."), 0, this);
92 connect(pageInformationAction, SIGNAL(activated()), this, SLOT(pageInformation()));
93 pageInformationAction->addTo(toolsPopupMenu);
89 94
90 menuBar->insertItem(tr("Tools"), toolsPopupMenu); 95 menuBar->insertItem(tr("Tools"), toolsPopupMenu);
91 96
92 // init page toolbar 97 // init page toolbar
93 98
94 QPEToolBar* pageToolBar = new QPEToolBar(this); 99 QPEToolBar* pageToolBar = new QPEToolBar(this);
95 100
96 QAction* newPageAction = new QAction(tr("New Page"), Resource::loadIconSet("new"), QString::null, 0, this); 101 QAction* newPageAction = new QAction(tr("New Page"), Resource::loadIconSet("new"), QString::null, 0, this);
97 connect(newPageAction, SIGNAL(activated()), this, SLOT(newPage())); 102 connect(newPageAction, SIGNAL(activated()), this, SLOT(newPage()));
98 newPageAction->addTo(pageToolBar); 103 newPageAction->addTo(pageToolBar);
99 104
100 QAction* clearPageAction = new QAction(tr("Clear Page"), Resource::loadIconSet("drawpad/clear"), QString::null, 0, this); 105 QAction* clearPageAction = new QAction(tr("Clear Page"), Resource::loadIconSet("drawpad/clear"), QString::null, 0, this);
101 connect(clearPageAction, SIGNAL(activated()), this, SLOT(clearPage())); 106 connect(clearPageAction, SIGNAL(activated()), this, SLOT(clearPage()));
102 clearPageAction->addTo(pageToolBar); 107 clearPageAction->addTo(pageToolBar);
103 108
104 QAction* deletePageAction = new QAction(tr("Delete Page"), Resource::loadIconSet("trash"), QString::null, 0, this); 109 QAction* deletePageAction = new QAction(tr("Delete Page"), Resource::loadIconSet("trash"), QString::null, 0, this);
105 connect(deletePageAction, SIGNAL(activated()), this, SLOT(deletePage())); 110 connect(deletePageAction, SIGNAL(activated()), this, SLOT(deletePage()));
106 deletePageAction->addTo(pageToolBar); 111 deletePageAction->addTo(pageToolBar);
107 112
108 QPEToolBar* emptyToolBar = new QPEToolBar(this); 113 QPEToolBar* emptyToolBar = new QPEToolBar(this);
109 emptyToolBar->setHorizontalStretchable(true); 114 emptyToolBar->setHorizontalStretchable(true);
110 115
111 // init navigation toolbar 116 // init navigation toolbar
112 117
@@ -572,24 +577,32 @@ void DrawPad::importPage()
572 delete docLnk; 577 delete docLnk;
573 } 578 }
574 } 579 }
575} 580}
576 581
577void DrawPad::exportPage() 582void DrawPad::exportPage()
578{ 583{
579 ExportDialog exportDialog(m_pDrawPadCanvas->pagePosition(), m_pDrawPadCanvas->pageCount(), this); 584 ExportDialog exportDialog(m_pDrawPadCanvas->pagePosition(), m_pDrawPadCanvas->pageCount(), this);
580 585
581 exportDialog.showMaximized(); 586 exportDialog.showMaximized();
582 587
583 if (exportDialog.exec() == QDialog::Accepted) { 588 if (exportDialog.exec() == QDialog::Accepted) {
584 m_pDrawPadCanvas->exportPage(exportDialog.selectedFromPage(), exportDialog.selectedToPage(), 589 m_pDrawPadCanvas->exportPage(exportDialog.selectedFromPage(), exportDialog.selectedToPage(),
585 exportDialog.selectedName(), exportDialog.selectedFormat()); 590 exportDialog.selectedName(), exportDialog.selectedFormat());
586 } 591 }
587} 592}
588 593
589void DrawPad::thumbnailView() 594void DrawPad::thumbnailView()
590{ 595{
591 ThumbnailView thumbnailView(this, m_pDrawPadCanvas, this); 596 ThumbnailView thumbnailView(this, m_pDrawPadCanvas, this);
592 597
593 thumbnailView.showMaximized(); 598 thumbnailView.showMaximized();
594 thumbnailView.exec(); 599 thumbnailView.exec();
595} 600}
601
602void DrawPad::pageInformation()
603{
604 PageInformationDialog pageInformationDialog(m_pDrawPadCanvas->currentPage());
605
606 if (pageInformationDialog.exec() == QDialog::Accepted) {
607 }
608}