summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mail2/attachdiag.cpp
Unidiff
Diffstat (limited to 'noncore/unsupported/mail2/attachdiag.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/mail2/attachdiag.cpp68
1 files changed, 0 insertions, 68 deletions
diff --git a/noncore/unsupported/mail2/attachdiag.cpp b/noncore/unsupported/mail2/attachdiag.cpp
deleted file mode 100644
index 446cfe5..0000000
--- a/noncore/unsupported/mail2/attachdiag.cpp
+++ b/dev/null
@@ -1,68 +0,0 @@
1#include <qmessagebox.h>
2#include <qpushbutton.h>
3#include <qlistbox.h>
4#include <qlayout.h>
5
6#include <qpe/applnk.h>
7#include <qpe/fileselector.h>
8#include <qpe/resource.h>
9
10#include <stdlib.h>
11
12#include "attachdiag.h"
13
14AttachDiag::AttachDiag(QWidget* parent = 0, const char* name = 0, bool modal, WFlags fl = 0)
15 : QDialog(parent, name, modal, fl)
16{
17 setCaption(tr("Attach File"));
18
19 QGridLayout *layout = new QGridLayout(this);
20 layout->setSpacing(3);
21 layout->setMargin(4);
22
23 _fileSelector = new FileSelector("*", this, "FileSelector");
24 _fileSelector->setCloseVisible(false);
25 _fileSelector->setNewVisible(false);
26
27 layout->addMultiCellWidget(_fileSelector, 0, 0, 0, 1);
28
29 QPushButton *attachButton = new QPushButton(this);
30 attachButton->setText(tr("Ok"));
31 attachButton->setIconSet(Resource::loadPixmap("enter"));
32
33 layout->addWidget(attachButton, 1, 0);
34
35 QPushButton *cancelButton = new QPushButton(this);
36 cancelButton->setText(tr("Cancel"));
37 cancelButton->setIconSet(Resource::loadPixmap("editdelete"));
38
39 layout->addWidget(cancelButton, 1, 1);
40
41 connect(attachButton, SIGNAL(clicked()), SLOT(accept()));
42 connect(cancelButton, SIGNAL(clicked()), SLOT(close()));
43
44 if (_fileSelector->fileCount() == 0) {
45 attachButton->setEnabled(false);
46 _fileSelector->setEnabled(false);
47 }
48}
49
50DocLnk AttachDiag::selectedFile()
51{
52 return *_fileSelector->selected();
53}
54
55DocLnk AttachDiag::getFile(QWidget *parent)
56{
57 AttachDiag attach(parent, 0, true);
58 attach.showMaximized();
59 attach.show();
60
61 if (QDialog::Accepted == attach.exec()) {
62 return attach.selectedFile();
63 }
64
65 return DocLnk();
66 }
67
68