summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/drawpad/drawpad.cpp13
-rw-r--r--noncore/graphics/drawpad/drawpad.h1
-rw-r--r--noncore/graphics/drawpad/drawpad.pro2
-rw-r--r--noncore/graphics/drawpad/newpagedialog.cpp14
-rw-r--r--noncore/graphics/drawpad/newpagedialog.h3
-rw-r--r--noncore/graphics/drawpad/pageinformationdialog.cpp70
-rw-r--r--noncore/graphics/drawpad/pageinformationdialog.h39
7 files changed, 141 insertions, 1 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
@@ -22,8 +22,9 @@
#include "filltool.h"
#include "importdialog.h"
#include "linetool.h"
#include "newpagedialog.h"
+#include "pageinformationdialog.h"
#include "pointtool.h"
#include "rectangletool.h"
#include "texttool.h"
#include "thumbnailview.h"
@@ -85,8 +86,12 @@ DrawPad::DrawPad(QWidget* parent, const char* name)
QAction* thumbnailViewAction = new QAction(tr("Thumbnail View"), tr("Thumbnail View..."), 0, this);
connect(thumbnailViewAction, SIGNAL(activated()), this, SLOT(thumbnailView()));
thumbnailViewAction->addTo(toolsPopupMenu);
+
+ QAction* pageInformationAction = new QAction(tr("Page Information"), tr("Page Information..."), 0, this);
+ connect(pageInformationAction, SIGNAL(activated()), this, SLOT(pageInformation()));
+ pageInformationAction->addTo(toolsPopupMenu);
menuBar->insertItem(tr("Tools"), toolsPopupMenu);
// init page toolbar
@@ -592,4 +597,12 @@ void DrawPad::thumbnailView()
thumbnailView.showMaximized();
thumbnailView.exec();
}
+
+void DrawPad::pageInformation()
+{
+ PageInformationDialog pageInformationDialog(m_pDrawPadCanvas->currentPage());
+
+ if (pageInformationDialog.exec() == QDialog::Accepted) {
+ }
+}
diff --git a/noncore/graphics/drawpad/drawpad.h b/noncore/graphics/drawpad/drawpad.h
index 9a821f6..ce62802 100644
--- a/noncore/graphics/drawpad/drawpad.h
+++ b/noncore/graphics/drawpad/drawpad.h
@@ -64,8 +64,9 @@ private slots:
void deleteAll();
void importPage();
void exportPage();
void thumbnailView();
+ void pageInformation();
private:
DrawPadCanvas* m_pDrawPadCanvas;
diff --git a/noncore/graphics/drawpad/drawpad.pro b/noncore/graphics/drawpad/drawpad.pro
index 9a640d2..8dc89a2 100644
--- a/noncore/graphics/drawpad/drawpad.pro
+++ b/noncore/graphics/drawpad/drawpad.pro
@@ -11,8 +11,9 @@ HEADERS = drawpad.h \
importdialog.h \
linetool.h \
newpagedialog.h \
page.h \
+ pageinformationdialog.h \
pointtool.h \
rectangletool.h \
shapetool.h \
texttool.h \
@@ -30,8 +31,9 @@ SOURCES = drawpad.cpp \
linetool.cpp \
main.cpp \
newpagedialog.cpp \
page.cpp \
+ pageinformationdialog.cpp \
pointtool.cpp \
rectangletool.cpp \
shapetool.cpp \
texttool.cpp \
diff --git a/noncore/graphics/drawpad/newpagedialog.cpp b/noncore/graphics/drawpad/newpagedialog.cpp
index 0592af2..ff31aad 100644
--- a/noncore/graphics/drawpad/newpagedialog.cpp
+++ b/noncore/graphics/drawpad/newpagedialog.cpp
@@ -16,8 +16,9 @@
#include <qbuttongroup.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qlayout.h>
+#include <qlineedit.h>
#include <qradiobutton.h>
#include <qspinbox.h>
NewPageDialog::NewPageDialog(uint width, uint height, const QColor& penColor,
@@ -28,9 +29,14 @@ NewPageDialog::NewPageDialog(uint width, uint height, const QColor& penColor,
m_penColor = penColor;
m_brushColor = brushColor;
- QGroupBox* sizeGroupBox = new QGroupBox(0, Qt::Vertical, tr("Page Size"), this);
+ QGroupBox* generalGroupBox = new QGroupBox(0, Qt::Vertical, tr("General"), this);
+
+ QLabel* titleLabel = new QLabel(tr("Title:"), generalGroupBox);
+ m_pTitleLineEdit = new QLineEdit(generalGroupBox);
+
+ QGroupBox* sizeGroupBox = new QGroupBox(0, Qt::Vertical, tr("Size"), this);
QLabel* widthLabel = new QLabel(tr("Width:"), sizeGroupBox);
QLabel* heightLabel = new QLabel(tr("Height:"), sizeGroupBox);
@@ -48,13 +54,18 @@ NewPageDialog::NewPageDialog(uint width, uint height, const QColor& penColor,
m_pContentButtonGroup->setButton(0);
QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4);
+ generalGroupBox->layout()->setSpacing(4);
sizeGroupBox->layout()->setSpacing(4);
m_pContentButtonGroup->layout()->setSpacing(4);
+ QGridLayout* generalLayout = new QGridLayout(generalGroupBox->layout(), 1, 1);
QGridLayout* sizeLayout = new QGridLayout(sizeGroupBox->layout(), 2, 2);
QVBoxLayout* contentLayout = new QVBoxLayout(m_pContentButtonGroup->layout());
+ generalLayout->addWidget(titleLabel, 0, 0);
+ generalLayout->addWidget(m_pTitleLineEdit, 0, 1);
+
sizeLayout->addWidget(widthLabel, 0, 0);
sizeLayout->addWidget(heightLabel, 1, 0);
sizeLayout->addWidget(m_pWidthSpinBox, 0, 1);
sizeLayout->addWidget(m_pHeightSpinBox, 1, 1);
@@ -64,8 +75,9 @@ NewPageDialog::NewPageDialog(uint width, uint height, const QColor& penColor,
contentLayout->addWidget(whiteColorRadioButton);
contentLayout->addWidget(penColorRadioButton);
contentLayout->addWidget(brushColorRadioButton);
+ mainLayout->addWidget(generalGroupBox);
mainLayout->addWidget(sizeGroupBox);
mainLayout->addWidget(m_pContentButtonGroup);
}
diff --git a/noncore/graphics/drawpad/newpagedialog.h b/noncore/graphics/drawpad/newpagedialog.h
index d680394..fe8f562 100644
--- a/noncore/graphics/drawpad/newpagedialog.h
+++ b/noncore/graphics/drawpad/newpagedialog.h
@@ -16,8 +16,9 @@
#include <qdialog.h>
class QButtonGroup;
+class QLineEdit;
class QSpinBox;
class NewPageDialog : public QDialog
{
@@ -32,8 +33,10 @@ public:
uint selectedHeight();
const QColor& selectedColor();
private:
+ QLineEdit* m_pTitleLineEdit;
+
QSpinBox* m_pWidthSpinBox;
QSpinBox* m_pHeightSpinBox;
QColor m_penColor;
diff --git a/noncore/graphics/drawpad/pageinformationdialog.cpp b/noncore/graphics/drawpad/pageinformationdialog.cpp
new file mode 100644
index 0000000..54cf89d
--- a/dev/null
+++ b/noncore/graphics/drawpad/pageinformationdialog.cpp
@@ -0,0 +1,70 @@
+/***************************************************************************
+ * *
+ * 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 "pageinformationdialog.h"
+
+#include "page.h"
+
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qlineedit.h>
+
+PageInformationDialog::PageInformationDialog(Page* page, QWidget* parent, const char* name)
+ : QDialog(parent, name, true)
+{
+ m_pPage = page;
+
+ setCaption(tr("Page Information"));
+
+ QGroupBox* generalGroupBox = new QGroupBox(0, Qt::Vertical, tr("General"), this);
+
+ QLabel* titleLabel = new QLabel(tr("Title:"), generalGroupBox);
+ m_pTitleLineEdit = new QLineEdit(generalGroupBox);
+
+ QGroupBox* sizeGroupBox = new QGroupBox(0, Qt::Vertical, tr("Size"), this);
+
+ QLabel* widthLabel = new QLabel(tr("Width:"), sizeGroupBox);
+ QLabel* widthValueLabel = new QLabel(QString::number(m_pPage->width()), sizeGroupBox);
+
+ QLabel* heightLabel = new QLabel(tr("Height:"), sizeGroupBox);
+ QLabel* heightValueLabel = new QLabel(QString::number(m_pPage->height()), sizeGroupBox);
+
+ QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4);
+ generalGroupBox->layout()->setSpacing(4);
+ sizeGroupBox->layout()->setSpacing(4);
+ QGridLayout* generalLayout = new QGridLayout(generalGroupBox->layout(), 1, 1);
+ QGridLayout* sizeLayout = new QGridLayout(sizeGroupBox->layout(), 2, 2);
+
+ generalLayout->addWidget(titleLabel, 0, 0);
+ generalLayout->addWidget(m_pTitleLineEdit, 0, 1);
+
+ sizeLayout->addWidget(widthLabel, 0, 0);
+ sizeLayout->addWidget(widthValueLabel, 0, 1);
+ sizeLayout->addWidget(heightLabel, 1, 0);
+ sizeLayout->addWidget(heightValueLabel, 1, 1);
+
+ sizeLayout->setColStretch(1, 1);
+
+ mainLayout->addWidget(generalGroupBox);
+ mainLayout->addWidget(sizeGroupBox);
+}
+
+PageInformationDialog::~PageInformationDialog()
+{
+}
+
+QString PageInformationDialog::selectedTitle()
+{
+ return (m_pTitleLineEdit->text());
+}
diff --git a/noncore/graphics/drawpad/pageinformationdialog.h b/noncore/graphics/drawpad/pageinformationdialog.h
new file mode 100644
index 0000000..cce74ec
--- a/dev/null
+++ b/noncore/graphics/drawpad/pageinformationdialog.h
@@ -0,0 +1,39 @@
+/***************************************************************************
+ * *
+ * 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. *
+ * *
+ ***************************************************************************/
+
+#ifndef PAGEINFORMATIONDIALOG_H
+#define PAGEINFORMATIONDIALOG_H
+
+#include <qdialog.h>
+
+class Page;
+
+class QLineEdit;
+
+class PageInformationDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ PageInformationDialog(Page* page, QWidget* parent = 0, const char* name = 0);
+ ~PageInformationDialog();
+
+ QString selectedTitle();
+
+private:
+ Page* m_pPage;
+
+ QLineEdit* m_pTitleLineEdit;
+};
+
+#endif // PAGEINFORMATIONDIALOG_H