author | conber <conber> | 2002-08-06 16:32:49 (UTC) |
---|---|---|
committer | conber <conber> | 2002-08-06 16:32:49 (UTC) |
commit | 8084d002de5e310491eec7fac0713ef29d0cf30f (patch) (unidiff) | |
tree | fe74e3cf2ee2f7d87e74910fbf4bfa34b9a439a0 /noncore/unsupported/mail2/composerbase.cpp | |
parent | e6a512dc2e0602298f8a745036d25eb171ced977 (diff) | |
download | opie-8084d002de5e310491eec7fac0713ef29d0cf30f.zip opie-8084d002de5e310491eec7fac0713ef29d0cf30f.tar.gz opie-8084d002de5e310491eec7fac0713ef29d0cf30f.tar.bz2 |
ui improvements
Diffstat (limited to 'noncore/unsupported/mail2/composerbase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/mail2/composerbase.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/noncore/unsupported/mail2/composerbase.cpp b/noncore/unsupported/mail2/composerbase.cpp index c456ae5..6f6ab8e 100644 --- a/noncore/unsupported/mail2/composerbase.cpp +++ b/noncore/unsupported/mail2/composerbase.cpp | |||
@@ -1,78 +1,75 @@ | |||
1 | #include <qmultilineedit.h> | 1 | #include <qmultilineedit.h> |
2 | #include <qpopupmenu.h> | 2 | #include <qpopupmenu.h> |
3 | #include <qcombobox.h> | 3 | #include <qcombobox.h> |
4 | #include <qlineedit.h> | 4 | #include <qlineedit.h> |
5 | #include <qlayout.h> | 5 | #include <qlayout.h> |
6 | #include <qaction.h> | 6 | #include <qaction.h> |
7 | #include <qlabel.h> | 7 | #include <qlabel.h> |
8 | #include <qvbox.h> | 8 | #include <qvbox.h> |
9 | 9 | ||
10 | #include <qpe/qpetoolbar.h> | 10 | #include <qpe/qpetoolbar.h> |
11 | #include <qpe/qpemenubar.h> | 11 | #include <qpe/qpemenubar.h> |
12 | #include <qpe/resource.h> | 12 | #include <qpe/resource.h> |
13 | 13 | ||
14 | #include "mailstatusbar.h" | ||
14 | #include "listviewplus.h" | 15 | #include "listviewplus.h" |
15 | #include "composerbase.h" | 16 | #include "composerbase.h" |
16 | 17 | ||
17 | ComposerBase::ComposerBase(QWidget *parent, const char *name, WFlags fl) | 18 | ComposerBase::ComposerBase(QWidget *parent, const char *name, WFlags fl) |
18 | : QMainWindow(parent, name, fl) | 19 | : QMainWindow(parent, name, fl) |
19 | { | 20 | { |
20 | setCaption(tr("Compose Message")); | 21 | setCaption(tr("Compose Message")); |
21 | setToolBarsMovable(false); | 22 | setToolBarsMovable(false); |
22 | 23 | ||
23 | toolbar = new QPEToolBar(this); | 24 | toolbar = new QPEToolBar(this); |
24 | menubar = new QPEMenuBar( toolbar ); | 25 | menubar = new QPEMenuBar( toolbar ); |
25 | mailmenu = new QPopupMenu( menubar ); | 26 | mailmenu = new QPopupMenu( menubar ); |
26 | menubar->insertItem( tr( "Mail" ), mailmenu ); | 27 | menubar->insertItem( tr( "Mail" ), mailmenu ); |
27 | addToolBar(toolbar); | 28 | addToolBar(toolbar); |
28 | toolbar->setHorizontalStretchable(true); | 29 | toolbar->setHorizontalStretchable(true); |
29 | 30 | ||
30 | QLabel *spacer = new QLabel(toolbar); | 31 | QLabel *spacer = new QLabel(toolbar); |
31 | spacer->setBackgroundMode(QWidget::PaletteButton); | 32 | spacer->setBackgroundMode(QWidget::PaletteButton); |
32 | toolbar->setStretchableWidget(spacer); | 33 | toolbar->setStretchableWidget(spacer); |
33 | 34 | ||
34 | sendmail = new QAction(tr("Send the mail"), QIconSet(Resource::loadPixmap("mail/sendmail")), 0, 0, this); | 35 | sendmail = new QAction(tr("Send the mail"), QIconSet(Resource::loadPixmap("mail/sendmail")), 0, 0, this); |
35 | sendmail->addTo(toolbar); | 36 | sendmail->addTo(toolbar); |
36 | sendmail->addTo(mailmenu); | 37 | sendmail->addTo(mailmenu); |
37 | 38 | ||
38 | queuemail = new QAction(tr("Queue the mail"), QIconSet(Resource::loadPixmap("mail/sendall")), 0, 0, this); | 39 | queuemail = new QAction(tr("Queue the mail"), QIconSet(Resource::loadPixmap("mail/sendall")), 0, 0, this); |
39 | queuemail->addTo(toolbar); | 40 | queuemail->addTo(toolbar); |
40 | queuemail->addTo(mailmenu); | 41 | queuemail->addTo(mailmenu); |
41 | 42 | ||
42 | attachfile = new QAction(tr("Attach a file"), QIconSet(Resource::loadPixmap("mail/attach")), 0, 0, this, 0, true); | 43 | attachfile = new QAction(tr("Attach a file"), QIconSet(Resource::loadPixmap("mail/attach")), 0, 0, this, 0, true); |
43 | attachfile->addTo(toolbar); | 44 | attachfile->addTo(toolbar); |
44 | attachfile->addTo(mailmenu); | 45 | attachfile->addTo(mailmenu); |
45 | connect(attachfile, SIGNAL(toggled(bool)), SLOT(slotAttachfileChanged(bool))); | 46 | connect(attachfile, SIGNAL(toggled(bool)), SLOT(slotAttachfileChanged(bool))); |
46 | 47 | ||
47 | addressbook = new QAction(tr("Addressbook"), QIconSet(Resource::loadPixmap("mail/addbook")), 0, 0, this); | 48 | addressbook = new QAction(tr("Addressbook"), QIconSet(Resource::loadPixmap("mail/addbook")), 0, 0, this); |
48 | addressbook->addTo(toolbar); | 49 | addressbook->addTo(toolbar); |
49 | addressbook->addTo(mailmenu); | 50 | addressbook->addTo(mailmenu); |
50 | 51 | ||
51 | abort = new QAction(tr("Abort sending"), QIconSet(Resource::loadPixmap("mail/abort")), 0, 0, this); | ||
52 | abort->addTo(toolbar); | ||
53 | abort->addTo(mailmenu); | ||
54 | |||
55 | QWidget *main = new QWidget(this); | 52 | QWidget *main = new QWidget(this); |
56 | setCentralWidget(main); | 53 | setCentralWidget(main); |
57 | 54 | ||
58 | QGridLayout *layout = new QGridLayout(main); | 55 | QGridLayout *layout = new QGridLayout(main); |
59 | 56 | ||
60 | fromBox = new QComboBox(main); | 57 | fromBox = new QComboBox(main); |
61 | fromBox->insertItem(tr("From"), POPUP_FROM_FROM); | 58 | fromBox->insertItem(tr("From"), POPUP_FROM_FROM); |
62 | fromBox->insertItem(tr("Reply"), POPUP_FROM_REPLYTO); | 59 | fromBox->insertItem(tr("Reply"), POPUP_FROM_REPLYTO); |
63 | layout->addWidget(fromBox, 0, 0); | 60 | layout->addWidget(fromBox, 0, 0); |
64 | 61 | ||
65 | connect(fromBox, SIGNAL(activated(int)), SLOT(slotFromMenuChanged(int))); | 62 | connect(fromBox, SIGNAL(activated(int)), SLOT(slotFromMenuChanged(int))); |
66 | 63 | ||
67 | QHBoxLayout *fromLayout = new QHBoxLayout(); | 64 | QHBoxLayout *fromLayout = new QHBoxLayout(); |
68 | layout->addLayout(fromLayout, 0, 1); | 65 | layout->addLayout(fromLayout, 0, 1); |
69 | 66 | ||
70 | from = new QComboBox(main); | 67 | from = new QComboBox(main); |
71 | fromLayout->addWidget(from); | 68 | fromLayout->addWidget(from); |
72 | 69 | ||
73 | replyto = new QLineEdit(main); | 70 | replyto = new QLineEdit(main); |
74 | replyto->hide(); | 71 | replyto->hide(); |
75 | fromLayout->addWidget(replyto); | 72 | fromLayout->addWidget(replyto); |
76 | 73 | ||
77 | receiversBox = new QComboBox(main); | 74 | receiversBox = new QComboBox(main); |
78 | receiversBox->insertItem(tr("To"), POPUP_RECV_TO); | 75 | receiversBox->insertItem(tr("To"), POPUP_RECV_TO); |
@@ -102,85 +99,82 @@ ComposerBase::ComposerBase(QWidget *parent, const char *name, WFlags fl) | |||
102 | layout->addWidget(subjectBox, 2, 0); | 99 | layout->addWidget(subjectBox, 2, 0); |
103 | connect(subjectBox, SIGNAL(activated(int)), SLOT(slotSubjectMenuChanged(int))); | 100 | connect(subjectBox, SIGNAL(activated(int)), SLOT(slotSubjectMenuChanged(int))); |
104 | 101 | ||
105 | QHBoxLayout *subjectLayout = new QHBoxLayout(); | 102 | QHBoxLayout *subjectLayout = new QHBoxLayout(); |
106 | layout->addLayout(subjectLayout, 2, 1); | 103 | layout->addLayout(subjectLayout, 2, 1); |
107 | 104 | ||
108 | subject = new QLineEdit(main); | 105 | subject = new QLineEdit(main); |
109 | subjectLayout->addWidget(subject); | 106 | subjectLayout->addWidget(subject); |
110 | 107 | ||
111 | priority = new QComboBox(main); | 108 | priority = new QComboBox(main); |
112 | priority->insertItem(tr("Low"), POPUP_PRIO_LOW); | 109 | priority->insertItem(tr("Low"), POPUP_PRIO_LOW); |
113 | priority->insertItem(tr("Normal"), POPUP_PRIO_NORMAL); | 110 | priority->insertItem(tr("Normal"), POPUP_PRIO_NORMAL); |
114 | priority->insertItem(tr("High"), POPUP_PRIO_HIGH); | 111 | priority->insertItem(tr("High"), POPUP_PRIO_HIGH); |
115 | priority->setCurrentItem(POPUP_PRIO_NORMAL); | 112 | priority->setCurrentItem(POPUP_PRIO_NORMAL); |
116 | priority->hide(); | 113 | priority->hide(); |
117 | subjectLayout->addWidget(priority); | 114 | subjectLayout->addWidget(priority); |
118 | 115 | ||
119 | QVBox *view = new QVBox(main); | 116 | QVBox *view = new QVBox(main); |
120 | layout->addMultiCellWidget(view, 3, 3, 0, 1); | 117 | layout->addMultiCellWidget(view, 3, 3, 0, 1); |
121 | 118 | ||
122 | message = new QMultiLineEdit(view); | 119 | message = new QMultiLineEdit(view); |
123 | message->setMinimumHeight(30); | 120 | message->setMinimumHeight(30); |
124 | 121 | ||
125 | attachWindow = new QMainWindow(view, 0, 0); | 122 | attachWindow = new QMainWindow(view, 0, 0); |
126 | attachWindow->setMinimumHeight(100); | 123 | attachWindow->setMinimumHeight(80); |
127 | attachWindow->setMaximumHeight(100); | 124 | attachWindow->setMaximumHeight(80); |
128 | attachWindow->setToolBarsMovable(false); | 125 | attachWindow->setToolBarsMovable(false); |
129 | attachWindow->hide(); | 126 | attachWindow->hide(); |
130 | 127 | ||
131 | attachToolbar = new QPEToolBar(attachWindow); | 128 | attachToolbar = new QPEToolBar(attachWindow); |
132 | attachToolbar->setVerticalStretchable(true); | 129 | attachToolbar->setVerticalStretchable(true); |
133 | 130 | ||
134 | addattach = new QAction(tr("Add an Attachement"), QIconSet(Resource::loadPixmap("mail/newmail")), 0, 0, this); | 131 | addattach = new QAction(tr("Add an Attachement"), QIconSet(Resource::loadPixmap("mail/newmail")), 0, 0, this); |
135 | addattach->addTo(attachToolbar); | 132 | addattach->addTo(attachToolbar); |
136 | 133 | ||
137 | delattach = new QAction(tr("Remove Attachement"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this); | 134 | delattach = new QAction(tr("Remove Attachement"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this); |
138 | delattach->addTo(attachToolbar); | 135 | delattach->addTo(attachToolbar); |
139 | 136 | ||
140 | QLabel *attachSpacer = new QLabel(attachToolbar); | 137 | QLabel *attachSpacer = new QLabel(attachToolbar); |
141 | attachSpacer->setBackgroundMode(QWidget::PaletteButton); | 138 | attachSpacer->setBackgroundMode(QWidget::PaletteButton); |
142 | attachToolbar->setStretchableWidget(attachSpacer); | 139 | attachToolbar->setStretchableWidget(attachSpacer); |
143 | 140 | ||
144 | attachWindow->addToolBar(attachToolbar, QMainWindow::Left); | 141 | attachWindow->addToolBar(attachToolbar, QMainWindow::Left); |
145 | 142 | ||
146 | attachView = new ListViewPlus(attachWindow); | 143 | attachView = new ListViewPlus(attachWindow); |
147 | attachView->addColumn(tr("Name"), 80); | 144 | attachView->addColumn(tr("Name"), 80); |
148 | attachView->addColumn(tr("Description"), 110); | 145 | attachView->addColumn(tr("Description"), 110); |
149 | attachView->setAllColumnsShowFocus(true); | 146 | attachView->setAllColumnsShowFocus(true); |
150 | attachWindow->setCentralWidget(attachView); | 147 | attachWindow->setCentralWidget(attachView); |
151 | 148 | ||
152 | attachPopup = new QPopupMenu(attachView); | 149 | attachPopup = new QPopupMenu(attachView); |
153 | attachPopup->insertItem(tr("Rename"), POPUP_ATTACH_RENAME); | 150 | attachPopup->insertItem(tr("Rename"), POPUP_ATTACH_RENAME); |
154 | attachPopup->insertItem(tr("Change Description"), POPUP_ATTACH_DESC); | 151 | attachPopup->insertItem(tr("Change Description"), POPUP_ATTACH_DESC); |
155 | attachPopup->insertSeparator(); | 152 | attachPopup->insertSeparator(); |
156 | attachPopup->insertItem(tr("Remove"), POPUP_ATTACH_REMOVE); | 153 | attachPopup->insertItem(tr("Remove"), POPUP_ATTACH_REMOVE); |
157 | attachView->setPopup(attachPopup); | 154 | attachView->setPopup(attachPopup); |
158 | 155 | ||
159 | status = new QLabel(view); | 156 | status = new MailStatusBar(view); |
160 | QFont tmpFont = status->font(); | ||
161 | tmpFont.setPixelSize(8); | ||
162 | status->setFont(tmpFont); | ||
163 | } | 157 | } |
164 | 158 | ||
165 | void ComposerBase::slotAttachfileChanged(bool toggled) | 159 | void ComposerBase::slotAttachfileChanged(bool toggled) |
166 | { | 160 | { |
167 | if (toggled) { | 161 | if (toggled) { |
168 | if (attachWindow->isHidden()) attachWindow->show(); | 162 | if (attachWindow->isHidden()) attachWindow->show(); |
169 | } else { | 163 | } else { |
170 | if (!attachWindow->isHidden()) attachWindow->hide(); | 164 | if (!attachWindow->isHidden()) attachWindow->hide(); |
171 | } | 165 | } |
172 | } | 166 | } |
173 | 167 | ||
174 | void ComposerBase::slotFromMenuChanged(int id) | 168 | void ComposerBase::slotFromMenuChanged(int id) |
175 | { | 169 | { |
176 | if (POPUP_FROM_FROM == id) { | 170 | if (POPUP_FROM_FROM == id) { |
177 | if (from->isHidden()) from->show(); | 171 | if (from->isHidden()) from->show(); |
178 | if (!replyto->isHidden()) replyto->hide(); | 172 | if (!replyto->isHidden()) replyto->hide(); |
179 | } else if (POPUP_FROM_REPLYTO == id) { | 173 | } else if (POPUP_FROM_REPLYTO == id) { |
180 | if (!from->isHidden()) from->hide(); | 174 | if (!from->isHidden()) from->hide(); |
181 | if (replyto->isHidden()) replyto->show(); | 175 | if (replyto->isHidden()) replyto->show(); |
182 | } | 176 | } |
183 | } | 177 | } |
184 | 178 | ||
185 | void ComposerBase::slotReceiverMenuChanged(int id) | 179 | void ComposerBase::slotReceiverMenuChanged(int id) |
186 | { | 180 | { |