Diffstat (limited to 'noncore/graphics/drawpad/importdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/drawpad/importdialog.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/graphics/drawpad/importdialog.cpp b/noncore/graphics/drawpad/importdialog.cpp index ce2e7ee..4fc0a0e 100644 --- a/noncore/graphics/drawpad/importdialog.cpp +++ b/noncore/graphics/drawpad/importdialog.cpp | |||
@@ -1,80 +1,80 @@ | |||
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 "importdialog.h" | 14 | #include "importdialog.h" |
15 | 15 | ||
16 | #include <opie/ofileselector.h> | 16 | #include <qpe/mimetype.h> |
17 | 17 | ||
18 | #include <qcheckbox.h> | 18 | #include <qcheckbox.h> |
19 | #include <qimage.h> | 19 | #include <qimage.h> |
20 | #include <qlabel.h> | 20 | #include <qlabel.h> |
21 | #include <qlayout.h> | 21 | #include <qlayout.h> |
22 | #include <qpushbutton.h> | 22 | #include <qpushbutton.h> |
23 | 23 | ||
24 | ImportDialog::ImportDialog(QWidget* parent, const char* name) | 24 | ImportDialog::ImportDialog(QWidget* parent, const char* name) |
25 | : QDialog(parent, name, true) | 25 | : QDialog(parent, name, true) |
26 | { | 26 | { |
27 | setCaption(tr("DrawPad - Import")); | 27 | setCaption(tr("DrawPad - Import")); |
28 | 28 | ||
29 | MimeTypes types; types.insert( tr("All images"),"image/*" ); | 29 | MimeTypes types; types.insert( tr("All images"),"image/*" ); |
30 | m_pFileSelector = new OFileSelector(this, | 30 | m_pFileSelector = new Opie::OFileSelector(this, |
31 | OFileSelector::FileSelector, | 31 | Opie::OFileSelector::FileSelector, |
32 | OFileSelector::Normal, | 32 | Opie::OFileSelector::Normal, |
33 | QString::null, | 33 | QString::null, |
34 | QString::null, types ); | 34 | QString::null, types ); |
35 | m_pFileSelector->setNameVisible( false ); | 35 | m_pFileSelector->setNameVisible( false ); |
36 | connect(m_pFileSelector, SIGNAL(fileSelected(const DocLnk&)), this, SLOT(fileChanged())); | 36 | connect(m_pFileSelector, SIGNAL(fileSelected(const DocLnk&)), this, SLOT(fileChanged())); |
37 | 37 | ||
38 | m_pPreviewLabel = new QLabel(this); | 38 | m_pPreviewLabel = new QLabel(this); |
39 | m_pPreviewLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken); | 39 | m_pPreviewLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken); |
40 | m_pPreviewLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); | 40 | m_pPreviewLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); |
41 | m_pPreviewLabel->setFixedSize(114, 114); | 41 | m_pPreviewLabel->setFixedSize(114, 114); |
42 | m_pPreviewLabel->setBackgroundMode(QWidget::PaletteMid); | 42 | m_pPreviewLabel->setBackgroundMode(QWidget::PaletteMid); |
43 | 43 | ||
44 | m_pAutomaticPreviewCheckBox = new QCheckBox(tr("Automatic preview"), this); | 44 | m_pAutomaticPreviewCheckBox = new QCheckBox(tr("Automatic preview"), this); |
45 | m_pAutomaticPreviewCheckBox->setChecked(true); | 45 | m_pAutomaticPreviewCheckBox->setChecked(true); |
46 | 46 | ||
47 | QPushButton* previewPushButton = new QPushButton(tr("Preview"), this); | 47 | QPushButton* previewPushButton = new QPushButton(tr("Preview"), this); |
48 | connect(previewPushButton, SIGNAL(clicked()), this, SLOT(preview())); | 48 | connect(previewPushButton, SIGNAL(clicked()), this, SLOT(preview())); |
49 | 49 | ||
50 | QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); | 50 | QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); |
51 | QHBoxLayout* previewLayout = new QHBoxLayout(4); | 51 | QHBoxLayout* previewLayout = new QHBoxLayout(4); |
52 | QVBoxLayout* previewSecondLayout = new QVBoxLayout(4); | 52 | QVBoxLayout* previewSecondLayout = new QVBoxLayout(4); |
53 | 53 | ||
54 | previewSecondLayout->addWidget(m_pAutomaticPreviewCheckBox); | 54 | previewSecondLayout->addWidget(m_pAutomaticPreviewCheckBox); |
55 | previewSecondLayout->addWidget(previewPushButton); | 55 | previewSecondLayout->addWidget(previewPushButton); |
56 | previewSecondLayout->addStretch(); | 56 | previewSecondLayout->addStretch(); |
57 | 57 | ||
58 | previewLayout->addWidget(m_pPreviewLabel); | 58 | previewLayout->addWidget(m_pPreviewLabel); |
59 | previewLayout->addLayout(previewSecondLayout); | 59 | previewLayout->addLayout(previewSecondLayout); |
60 | 60 | ||
61 | mainLayout->addWidget(m_pFileSelector); | 61 | mainLayout->addWidget(m_pFileSelector); |
62 | mainLayout->addLayout(previewLayout); | 62 | mainLayout->addLayout(previewLayout); |
63 | 63 | ||
64 | preview(); | 64 | preview(); |
65 | } | 65 | } |
66 | 66 | ||
67 | ImportDialog::~ImportDialog() | 67 | ImportDialog::~ImportDialog() |
68 | { | 68 | { |
69 | } | 69 | } |
70 | 70 | ||
71 | const DocLnk* ImportDialog::selected() | 71 | const DocLnk* ImportDialog::selected() |
72 | { | 72 | { |
73 | // FIXME change from pointer to reference -zecke | 73 | // FIXME change from pointer to reference -zecke |
74 | DocLnk *lnk = new DocLnk( m_pFileSelector->selectedDocument() ); | 74 | DocLnk *lnk = new DocLnk( m_pFileSelector->selectedDocument() ); |
75 | return lnk; | 75 | return lnk; |
76 | } | 76 | } |
77 | 77 | ||
78 | void ImportDialog::fileChanged() | 78 | void ImportDialog::fileChanged() |
79 | { | 79 | { |
80 | if (m_pAutomaticPreviewCheckBox->isChecked()) { | 80 | if (m_pAutomaticPreviewCheckBox->isChecked()) { |