author | drw <drw> | 2004-03-02 21:03:59 (UTC) |
---|---|---|
committer | drw <drw> | 2004-03-02 21:03:59 (UTC) |
commit | 0a67659dce57ac1475841838369e924f2441e991 (patch) (unidiff) | |
tree | 394d6b89ba3262033e481020953196123399492a /noncore/graphics/drawpad/exportdialog.cpp | |
parent | 9631067183b4cafa2ea07d2202bf88f4d42c35e2 (diff) | |
download | opie-0a67659dce57ac1475841838369e924f2441e991.zip opie-0a67659dce57ac1475841838369e924f2441e991.tar.gz opie-0a67659dce57ac1475841838369e924f2441e991.tar.bz2 |
DrawPad: libopie -> libopie2
Diffstat (limited to 'noncore/graphics/drawpad/exportdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/drawpad/exportdialog.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/noncore/graphics/drawpad/exportdialog.cpp b/noncore/graphics/drawpad/exportdialog.cpp index d63f428..169acef 100644 --- a/noncore/graphics/drawpad/exportdialog.cpp +++ b/noncore/graphics/drawpad/exportdialog.cpp | |||
@@ -1,118 +1,118 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
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 "exportdialog.h" | 14 | #include "exportdialog.h" |
15 | 15 | ||
16 | #include <opie/ofileselector.h> | 16 | #include <opie2/ofileselector.h> |
17 | 17 | ||
18 | #include <qbuttongroup.h> | 18 | #include <qbuttongroup.h> |
19 | #include <qcombobox.h> | 19 | #include <qcombobox.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 <qlineedit.h> | 23 | #include <qlineedit.h> |
24 | #include <qradiobutton.h> | 24 | #include <qradiobutton.h> |
25 | #include <qspinbox.h> | 25 | #include <qspinbox.h> |
26 | 26 | ||
27 | #include <stdlib.h> | 27 | #include <stdlib.h> |
28 | 28 | ||
29 | ExportDialog::ExportDialog(uint pageAt, uint pageCount, QWidget* parent, const char* name) | 29 | ExportDialog::ExportDialog(uint pageAt, uint pageCount, QWidget* parent, const char* name) |
30 | : QDialog(parent, name, true) | 30 | : QDialog(parent, name, true) |
31 | { | 31 | { |
32 | setCaption(tr("DrawPad - Export")); | 32 | setCaption(tr("DrawPad - Export")); |
33 | 33 | ||
34 | m_pageAt = pageAt; | 34 | m_pageAt = pageAt; |
35 | m_pageCount = pageCount; | 35 | m_pageCount = pageCount; |
36 | 36 | ||
37 | QButtonGroup* selectionButtonGroup = new QButtonGroup(0, Qt::Vertical, tr("Page Selection"), this); | 37 | QButtonGroup* selectionButtonGroup = new QButtonGroup(0, Qt::Vertical, tr("Page Selection"), this); |
38 | connect(selectionButtonGroup, SIGNAL(pressed(int)), this, SLOT(selectionChanged(int))); | 38 | connect(selectionButtonGroup, SIGNAL(pressed(int)), this, SLOT(selectionChanged(int))); |
39 | 39 | ||
40 | QRadioButton* selectAllRadioButton = new QRadioButton(tr("All"), selectionButtonGroup); | 40 | QRadioButton* selectAllRadioButton = new QRadioButton(tr("All"), selectionButtonGroup); |
41 | QRadioButton* selectCurrentRadioButton = new QRadioButton(tr("Current"), selectionButtonGroup); | 41 | QRadioButton* selectCurrentRadioButton = new QRadioButton(tr("Current"), selectionButtonGroup); |
42 | QRadioButton* selectRangeRadioButton = new QRadioButton(tr("Range"), selectionButtonGroup); | 42 | QRadioButton* selectRangeRadioButton = new QRadioButton(tr("Range"), selectionButtonGroup); |
43 | 43 | ||
44 | QLabel* toLabel = new QLabel(tr("To:"), selectionButtonGroup); | 44 | QLabel* toLabel = new QLabel(tr("To:"), selectionButtonGroup); |
45 | 45 | ||
46 | m_pFromPageSpinBox = new QSpinBox(1, m_pageCount, 1, selectionButtonGroup); | 46 | m_pFromPageSpinBox = new QSpinBox(1, m_pageCount, 1, selectionButtonGroup); |
47 | connect(m_pFromPageSpinBox, SIGNAL(valueChanged(int)), this, SLOT(fromPageChanged(int))); | 47 | connect(m_pFromPageSpinBox, SIGNAL(valueChanged(int)), this, SLOT(fromPageChanged(int))); |
48 | 48 | ||
49 | m_pToPageSpinBox = new QSpinBox(1, m_pageCount, 1, selectionButtonGroup); | 49 | m_pToPageSpinBox = new QSpinBox(1, m_pageCount, 1, selectionButtonGroup); |
50 | connect(m_pToPageSpinBox, SIGNAL(valueChanged(int)), this, SLOT(toPageChanged(int))); | 50 | connect(m_pToPageSpinBox, SIGNAL(valueChanged(int)), this, SLOT(toPageChanged(int))); |
51 | 51 | ||
52 | selectionButtonGroup->setButton(1); | 52 | selectionButtonGroup->setButton(1); |
53 | selectionChanged(1); | 53 | selectionChanged(1); |
54 | 54 | ||
55 | m_pFromPageSpinBox->setValue(pageAt); | 55 | m_pFromPageSpinBox->setValue(pageAt); |
56 | m_pToPageSpinBox->setValue(pageAt); | 56 | m_pToPageSpinBox->setValue(pageAt); |
57 | 57 | ||
58 | QGroupBox* exportGroupBox = new QGroupBox(0, Qt::Vertical, tr("Export As"), this); | 58 | QGroupBox* exportGroupBox = new QGroupBox(0, Qt::Vertical, tr("Export As"), this); |
59 | 59 | ||
60 | QLabel* nameLabel = new QLabel(tr("Name:"), exportGroupBox); | 60 | QLabel* nameLabel = new QLabel(tr("Name:"), exportGroupBox); |
61 | QLabel* formatLabel = new QLabel(tr("Format:"), exportGroupBox); | 61 | QLabel* formatLabel = new QLabel(tr("Format:"), exportGroupBox); |
62 | 62 | ||
63 | m_pNameLineEdit = new QLineEdit(exportGroupBox); | 63 | m_pNameLineEdit = new QLineEdit(exportGroupBox); |
64 | 64 | ||
65 | m_pFormatComboBox = new QComboBox(exportGroupBox); | 65 | m_pFormatComboBox = new QComboBox(exportGroupBox); |
66 | m_pFormatComboBox->insertStrList(QImageIO::outputFormats()); | 66 | m_pFormatComboBox->insertStrList(QImageIO::outputFormats()); |
67 | 67 | ||
68 | MimeTypes types; types.insert( tr("All Images"), "image/*" ); | 68 | MimeTypes types; types.insert( tr("All Images"), "image/*" ); |
69 | OFileSelector* fileSelector = new OFileSelector(this, OFileSelector::FileSelector, | 69 | Opie::OFileSelector* fileSelector = new Opie::OFileSelector(this, Opie::OFileSelector::FileSelector, |
70 | OFileSelector::Normal, | 70 | Opie::OFileSelector::Normal, |
71 | QString::null, QString::null, | 71 | QString::null, QString::null, |
72 | types ); | 72 | types ); |
73 | fileSelector->setNameVisible( false ); | 73 | fileSelector->setNameVisible( false ); |
74 | 74 | ||
75 | QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); | 75 | QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); |
76 | selectionButtonGroup->layout()->setSpacing(4); | 76 | selectionButtonGroup->layout()->setSpacing(4); |
77 | exportGroupBox->layout()->setSpacing(4); | 77 | exportGroupBox->layout()->setSpacing(4); |
78 | QGridLayout* selectionLayout = new QGridLayout(selectionButtonGroup->layout(), 2, 2); | 78 | QGridLayout* selectionLayout = new QGridLayout(selectionButtonGroup->layout(), 2, 2); |
79 | QHBoxLayout* rangeLayout = new QHBoxLayout(); | 79 | QHBoxLayout* rangeLayout = new QHBoxLayout(); |
80 | QGridLayout* exportLayout = new QGridLayout(exportGroupBox->layout(), 2, 2); | 80 | QGridLayout* exportLayout = new QGridLayout(exportGroupBox->layout(), 2, 2); |
81 | 81 | ||
82 | selectionLayout->addWidget(selectAllRadioButton, 0, 0); | 82 | selectionLayout->addWidget(selectAllRadioButton, 0, 0); |
83 | selectionLayout->addWidget(selectCurrentRadioButton, 1, 0); | 83 | selectionLayout->addWidget(selectCurrentRadioButton, 1, 0); |
84 | selectionLayout->addWidget(selectRangeRadioButton, 0, 1); | 84 | selectionLayout->addWidget(selectRangeRadioButton, 0, 1); |
85 | selectionLayout->addLayout(rangeLayout, 1, 1); | 85 | selectionLayout->addLayout(rangeLayout, 1, 1); |
86 | 86 | ||
87 | rangeLayout->addWidget(m_pFromPageSpinBox); | 87 | rangeLayout->addWidget(m_pFromPageSpinBox); |
88 | rangeLayout->addWidget(toLabel); | 88 | rangeLayout->addWidget(toLabel); |
89 | rangeLayout->addWidget(m_pToPageSpinBox); | 89 | rangeLayout->addWidget(m_pToPageSpinBox); |
90 | 90 | ||
91 | exportLayout->addWidget(nameLabel, 0, 0); | 91 | exportLayout->addWidget(nameLabel, 0, 0); |
92 | exportLayout->addWidget(formatLabel, 1, 0); | 92 | exportLayout->addWidget(formatLabel, 1, 0); |
93 | 93 | ||
94 | exportLayout->addWidget(m_pNameLineEdit, 0, 1); | 94 | exportLayout->addWidget(m_pNameLineEdit, 0, 1); |
95 | exportLayout->addWidget(m_pFormatComboBox, 1, 1); | 95 | exportLayout->addWidget(m_pFormatComboBox, 1, 1); |
96 | 96 | ||
97 | exportLayout->setColStretch(1, 1); | 97 | exportLayout->setColStretch(1, 1); |
98 | 98 | ||
99 | mainLayout->addWidget(selectionButtonGroup); | 99 | mainLayout->addWidget(selectionButtonGroup); |
100 | mainLayout->addWidget(exportGroupBox); | 100 | mainLayout->addWidget(exportGroupBox); |
101 | mainLayout->addWidget(fileSelector); | 101 | mainLayout->addWidget(fileSelector); |
102 | 102 | ||
103 | m_pNameLineEdit->setFocus(); | 103 | m_pNameLineEdit->setFocus(); |
104 | } | 104 | } |
105 | 105 | ||
106 | ExportDialog::~ExportDialog() | 106 | ExportDialog::~ExportDialog() |
107 | { | 107 | { |
108 | } | 108 | } |
109 | 109 | ||
110 | uint ExportDialog::selectedFromPage() | 110 | uint ExportDialog::selectedFromPage() |
111 | { | 111 | { |
112 | return (m_pFromPageSpinBox->value()); | 112 | return (m_pFromPageSpinBox->value()); |
113 | } | 113 | } |
114 | 114 | ||
115 | uint ExportDialog::selectedToPage() | 115 | uint ExportDialog::selectedToPage() |
116 | { | 116 | { |
117 | return (m_pToPageSpinBox->value()); | 117 | return (m_pToPageSpinBox->value()); |
118 | } | 118 | } |