summaryrefslogtreecommitdiff
path: root/noncore/graphics/drawpad/drawpad.cpp
Side-by-side diff
Diffstat (limited to 'noncore/graphics/drawpad/drawpad.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/drawpad/drawpad.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp
index 369e7f0..45fb886 100644
--- a/noncore/graphics/drawpad/drawpad.cpp
+++ b/noncore/graphics/drawpad/drawpad.cpp
@@ -2,48 +2,49 @@
* *
* DrawPad - a drawing program for Opie Environment *
* *
* (C) 2002 by S. Prud'homme <prudhomme@laposte.net> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "drawpad.h"
#include "drawpadcanvas.h"
#include "ellipsetool.h"
#include "erasetool.h"
#include "exportdialog.h"
#include "filledellipsetool.h"
#include "filledrectangletool.h"
#include "filltool.h"
#include "importdialog.h"
#include "linetool.h"
#include "newpagedialog.h"
+#include "page.h"
#include "pageinformationdialog.h"
#include "pointtool.h"
#include "rectangletool.h"
#include "texttool.h"
#include "thumbnailview.h"
#include <opie/colordialog.h>
#include <opie/colorpopupmenu.h>
#include <qpe/applnk.h>
#include <qpe/global.h>
#include <qpe/qpemenubar.h>
#include <qpe/qpetoolbar.h>
#include <qpe/resource.h>
#include <qaction.h>
#include <qfile.h>
#include <qmessagebox.h>
#include <qpainter.h>
#include <qspinbox.h>
#include <qtoolbutton.h>
#include <qtooltip.h>
DrawPad::DrawPad(QWidget* parent, const char* name)
@@ -260,50 +261,50 @@ DrawPad::DrawPad(QWidget* parent, const char* name)
m_pDrawPadCanvas->load(&file);
file.close();
} else {
m_pDrawPadCanvas->initialPage();
}
}
DrawPad::~DrawPad()
{
QFile file(Global::applicationFileName("drawpad", "drawpad.xml"));
if (file.open(IO_WriteOnly)) {
m_pDrawPadCanvas->save(&file);
file.close();
}
}
void DrawPad::newPage()
{
QRect rect = m_pDrawPadCanvas->contentsRect();
NewPageDialog newPageDialog(rect.width(), rect.height(), m_pen.color(), m_brush.color(), this);
if (newPageDialog.exec() == QDialog::Accepted) {
- m_pDrawPadCanvas->newPage(newPageDialog.selectedWidth(), newPageDialog.selectedHeight(),
- newPageDialog.selectedColor());
+ m_pDrawPadCanvas->newPage(newPageDialog.selectedTitle(), newPageDialog.selectedWidth(),
+ newPageDialog.selectedHeight(), newPageDialog.selectedColor());
}
}
void DrawPad::clearPage()
{
QMessageBox messageBox(tr("Clear Page"), tr("Do you want to clear\nthe current page?"),
QMessageBox::Information, QMessageBox::Yes,
QMessageBox::No | QMessageBox::Escape | QMessageBox::Default,
QMessageBox::NoButton, this);
messageBox.setButtonText(QMessageBox::Yes, tr("Yes"));
messageBox.setButtonText(QMessageBox::No, tr("No"));
if (messageBox.exec() == QMessageBox::Yes) {
m_pDrawPadCanvas->clearPage();
}
}
void DrawPad::deletePage()
{
QMessageBox messageBox(tr("Delete Page"), tr("Do you want to delete\nthe current page?"),
QMessageBox::Information, QMessageBox::Yes,
QMessageBox::No | QMessageBox::Escape | QMessageBox::Default,
QMessageBox::NoButton, this);
@@ -583,26 +584,27 @@ void DrawPad::exportPage()
{
ExportDialog exportDialog(m_pDrawPadCanvas->pagePosition(), m_pDrawPadCanvas->pageCount(), this);
exportDialog.showMaximized();
if (exportDialog.exec() == QDialog::Accepted) {
m_pDrawPadCanvas->exportPage(exportDialog.selectedFromPage(), exportDialog.selectedToPage(),
exportDialog.selectedName(), exportDialog.selectedFormat());
}
}
void DrawPad::thumbnailView()
{
ThumbnailView thumbnailView(this, m_pDrawPadCanvas, this);
thumbnailView.showMaximized();
thumbnailView.exec();
}
void DrawPad::pageInformation()
{
PageInformationDialog pageInformationDialog(m_pDrawPadCanvas->currentPage());
if (pageInformationDialog.exec() == QDialog::Accepted) {
+ m_pDrawPadCanvas->currentPage()->setTitle(pageInformationDialog.selectedTitle());
}
}