Diffstat (limited to 'noncore/unsupported/mailit/addatt.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/mailit/addatt.cpp | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/noncore/unsupported/mailit/addatt.cpp b/noncore/unsupported/mailit/addatt.cpp index f279f52..c8be865 100644 --- a/noncore/unsupported/mailit/addatt.cpp +++ b/noncore/unsupported/mailit/addatt.cpp | |||
@@ -15,12 +15,13 @@ | |||
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qlayout.h> | 20 | #include <qlayout.h> |
21 | #include <qhbox.h> | ||
21 | #include <qdir.h> | 22 | #include <qdir.h> |
22 | #include <qstringlist.h> | 23 | #include <qstringlist.h> |
23 | #include "resource.h" | 24 | #include "resource.h" |
24 | #include "addatt.h" | 25 | #include "addatt.h" |
25 | 26 | ||
26 | FileItem::FileItem(QListView *parent, DocLnk* dl) | 27 | FileItem::FileItem(QListView *parent, DocLnk* dl) |
@@ -54,38 +55,37 @@ FileItem::~FileItem() | |||
54 | 55 | ||
55 | AddAtt::AddAtt(QWidget *parent, const char *name, WFlags f) | 56 | AddAtt::AddAtt(QWidget *parent, const char *name, WFlags f) |
56 | : QDialog(parent, name, f) | 57 | : QDialog(parent, name, f) |
57 | { | 58 | { |
58 | setCaption("Adding attatchments"); | 59 | setCaption("Adding attatchments"); |
59 | 60 | ||
60 | QGridLayout *top = new QGridLayout(this, 3,1 ); | 61 | QGridLayout *top = new QGridLayout(this, 1,1 ); |
61 | 62 | ||
62 | 63 | QHBox *buttons=new QHBox(this); | |
63 | /*fileCategoryButton = new QPushButton(this);*/ | 64 | /*fileCategoryButton = new QPushButton(this);*/ |
64 | attatchButton = new QPushButton("Attatch ->", this); | 65 | attatchButton = new QPushButton("Attatch ->", buttons); |
65 | removeButton = new QPushButton("Remove", this); | 66 | removeButton = new QPushButton("Remove", buttons); |
66 | 67 | ||
67 | /*fileCategories = new QPopupMenu(fileCategoryButton); | 68 | /*fileCategories = new QPopupMenu(fileCategoryButton); |
68 | fileCategoryButton->setPopup(fileCategories); | 69 | fileCategoryButton->setPopup(fileCategories); |
69 | fileCategories->insertItem("Document"); | 70 | fileCategories->insertItem("Document"); |
70 | fileCategories->insertItem("Picture"); | 71 | fileCategories->insertItem("Picture"); |
71 | fileCategories->insertItem("Sound"); | 72 | fileCategories->insertItem("Sound"); |
72 | fileCategories->insertItem("Movie"); | 73 | fileCategories->insertItem("Movie"); |
73 | fileCategories->insertItem("File"); | 74 | fileCategories->insertItem("File"); |
74 | 75 | ||
75 | fileCategoryButton->setText("Document"); | 76 | fileCategoryButton->setText("Document"); |
76 | top->addWidget(fileCategoryButton, 0, 0);*/ | 77 | top->addWidget(fileCategoryButton, 0, 0);*/ |
77 | 78 | ||
78 | //ofs=new OFileSelector(this,2,0,"/root/Documents"); | ||
79 | |||
80 | |||
81 | top->addWidget(attatchButton,1,0); | ||
82 | top->addWidget(removeButton,2,0); | ||
83 | 79 | ||
84 | /*connect(fileCategories, SIGNAL(activated(int)), this, | 80 | top->addWidget(buttons,1,0); |
85 | SLOT(fileCategorySelected(int)) );*/ | 81 | //buttons->addWidget(attatchButton,0,0); |
82 | //buttons->addWidget(removeButton,0,1); | ||
83 | |||
84 | //connect(fileCategories, SIGNAL(activated(int)), this, | ||
85 | //SLOT(fileCategorySelected(int)) );*/ | ||
86 | connect(attatchButton, SIGNAL(clicked()), this, | 86 | connect(attatchButton, SIGNAL(clicked()), this, |
87 | SLOT(addAttatchment()) ); | 87 | SLOT(addAttatchment()) ); |
88 | connect(removeButton, SIGNAL(clicked()), this, | 88 | connect(removeButton, SIGNAL(clicked()), this, |
89 | SLOT(removeAttatchment()) ); | 89 | SLOT(removeAttatchment()) ); |
90 | 90 | ||
91 | /*listView = new QListView(this, "AttView"); | 91 | /*listView = new QListView(this, "AttView"); |
@@ -120,23 +120,17 @@ void AddAtt::clear() | |||
120 | fileCategoryButton->setText(fileCategories->text(id)); | 120 | fileCategoryButton->setText(fileCategories->text(id)); |
121 | getFiles(); | 121 | getFiles(); |
122 | }*/ | 122 | }*/ |
123 | 123 | ||
124 | void AddAtt::addAttatchment() | 124 | void AddAtt::addAttatchment() |
125 | { | 125 | { |
126 | QDialog qd(this,tr("Select attachment"),true); | 126 | OFileDialog ofs("Attachments",this,0,0,"/root/Documents"); |
127 | |||
128 | QGridLayout top(&qd,1,1); | ||
129 | |||
130 | OFileSelector ofs(&qd,1,0,"/root/Documents"); | ||
131 | |||
132 | top.addWidget(&ofs,0,0); | ||
133 | 127 | ||
134 | qd.showMaximized(); | 128 | ofs.showMaximized(); |
135 | 129 | ||
136 | if (qd.exec()==QDialog::Accepted) | 130 | if (ofs.exec()==QDialog::Accepted) |
137 | { | 131 | { |
138 | DocLnk* dl=new DocLnk(ofs.selectedDocument()); | 132 | DocLnk* dl=new DocLnk(ofs.selectedDocument()); |
139 | FileItem* fi=new FileItem(attView,dl); | 133 | FileItem* fi=new FileItem(attView,dl); |
140 | fi->setPixmap(0,dl->pixmap()); | 134 | fi->setPixmap(0,dl->pixmap()); |
141 | fi->setText(1,dl->type()); | 135 | fi->setText(1,dl->type()); |
142 | attView->insertItem(fi); | 136 | attView->insertItem(fi); |