author | alwin <alwin> | 2005-03-20 00:12:11 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-03-20 00:12:11 (UTC) |
commit | bde8cf28573964aeb78fa9785cf1514cb8aa35a7 (patch) (unidiff) | |
tree | e91895f42ea3f9f5ac3d77128b8715b359ab54bf | |
parent | 9b608c7c967b2a22d4c6a8d8b98a4635d3b21204 (diff) | |
download | opie-bde8cf28573964aeb78fa9785cf1514cb8aa35a7.zip opie-bde8cf28573964aeb78fa9785cf1514cb8aa35a7.tar.gz opie-bde8cf28573964aeb78fa9785cf1514cb8aa35a7.tar.bz2 |
user may switch open folders/mails on single-click
-rw-r--r-- | noncore/net/mail/accountview.cpp | 11 | ||||
-rw-r--r-- | noncore/net/mail/accountview.h | 2 | ||||
-rw-r--r-- | noncore/net/mail/defines.h | 2 | ||||
-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 7 | ||||
-rw-r--r-- | noncore/net/mail/mainwindow.h | 4 | ||||
-rw-r--r-- | noncore/net/mail/opiemail.cpp | 13 | ||||
-rw-r--r-- | noncore/net/mail/opiemail.h | 3 | ||||
-rw-r--r-- | noncore/net/mail/settingsdialog.cpp | 4 | ||||
-rw-r--r-- | noncore/net/mail/settingsdialogui.ui | 30 |
9 files changed, 69 insertions, 7 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp index 1183704..0e739e2 100644 --- a/noncore/net/mail/accountview.cpp +++ b/noncore/net/mail/accountview.cpp | |||
@@ -1,232 +1,241 @@ | |||
1 | 1 | ||
2 | #include "accountview.h" | 2 | #include "accountview.h" |
3 | #include "accountitem.h" | 3 | #include "accountitem.h" |
4 | #include "selectstore.h" | 4 | #include "selectstore.h" |
5 | 5 | ||
6 | #include <libmailwrapper/settings.h> | 6 | #include <libmailwrapper/settings.h> |
7 | #include <libmailwrapper/mailwrapper.h> | 7 | #include <libmailwrapper/mailwrapper.h> |
8 | #include <libmailwrapper/mailtypes.h> | 8 | #include <libmailwrapper/mailtypes.h> |
9 | #include <libmailwrapper/abstractmail.h> | 9 | #include <libmailwrapper/abstractmail.h> |
10 | 10 | ||
11 | /* OPIE */ | 11 | /* OPIE */ |
12 | #include <opie2/odebug.h> | 12 | #include <opie2/odebug.h> |
13 | #include <qpe/qpeapplication.h> | 13 | #include <qpe/qpeapplication.h> |
14 | #include <qpe/config.h> | ||
14 | 15 | ||
15 | /* QT */ | 16 | /* QT */ |
16 | #include <qmessagebox.h> | 17 | #include <qmessagebox.h> |
17 | #include <qpopupmenu.h> | 18 | #include <qpopupmenu.h> |
18 | 19 | ||
19 | using namespace Opie::Core; | 20 | using namespace Opie::Core; |
20 | AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) | 21 | AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) |
21 | : QListView( parent, name, flags ) | 22 | : QListView( parent, name, flags ) |
22 | { | 23 | { |
23 | setSorting(0); | 24 | setSorting(0); |
24 | setSelectionMode(Single); | 25 | setSelectionMode(Single); |
25 | m_rightPressed = false; | 26 | m_rightPressed = false; |
26 | 27 | ||
27 | connect( this, SIGNAL( selectionChanged(QListViewItem*) ), | 28 | connect( this, SIGNAL( selectionChanged(QListViewItem*) ), |
28 | SLOT( slotSelectionChanged(QListViewItem*) ) ); | 29 | SLOT( slotSelectionChanged(QListViewItem*) ) ); |
29 | connect( this, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, | 30 | connect( this, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, |
30 | SLOT( slotMouseButton(int,QListViewItem*,const QPoint&,int) ) ); | 31 | SLOT( slotMouseButton(int,QListViewItem*,const QPoint&,int) ) ); |
31 | connect( this, SIGNAL(clicked(QListViewItem*) ),this, | 32 | connect( this, SIGNAL(clicked(QListViewItem*) ),this, |
32 | SLOT( slotMouseClicked(QListViewItem*) ) ); | 33 | SLOT( slotMouseClicked(QListViewItem*) ) ); |
33 | m_currentItem = 0; | 34 | m_currentItem = 0; |
35 | readSettings(); | ||
34 | } | 36 | } |
35 | 37 | ||
36 | AccountView::~AccountView() | 38 | AccountView::~AccountView() |
37 | { | 39 | { |
38 | imapAccounts.clear(); | 40 | imapAccounts.clear(); |
39 | mhAccounts.clear(); | 41 | mhAccounts.clear(); |
40 | } | 42 | } |
41 | 43 | ||
44 | void AccountView::readSettings() | ||
45 | { | ||
46 | Config cfg("mail"); | ||
47 | cfg.setGroup( "Settings" ); | ||
48 | m_clickopens = cfg.readBoolEntry("clickOpensFolder",true); | ||
49 | } | ||
50 | |||
42 | void AccountView::slotSelectionChanged(QListViewItem*item) | 51 | void AccountView::slotSelectionChanged(QListViewItem*item) |
43 | { | 52 | { |
44 | if (!item) { | 53 | if (!item) { |
45 | emit serverSelected(0); | 54 | emit serverSelected(0); |
46 | return; | 55 | return; |
47 | } | 56 | } |
48 | AccountViewItem *view = static_cast<AccountViewItem *>(item); | 57 | AccountViewItem *view = static_cast<AccountViewItem *>(item); |
49 | emit serverSelected(view->isServer()); | 58 | emit serverSelected(view->isServer()); |
50 | } | 59 | } |
51 | 60 | ||
52 | QMap<int,QString> AccountView::currentServerMenu()const | 61 | QMap<int,QString> AccountView::currentServerMenu()const |
53 | { | 62 | { |
54 | QMap<int,QString> smap; | 63 | QMap<int,QString> smap; |
55 | AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); | 64 | AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); |
56 | if (!view)return smap; | 65 | if (!view)return smap; |
57 | smap = view->serverMenu(); | 66 | smap = view->serverMenu(); |
58 | return smap; | 67 | return smap; |
59 | } | 68 | } |
60 | 69 | ||
61 | QMap<int,QString> AccountView::currentFolderMenu()const | 70 | QMap<int,QString> AccountView::currentFolderMenu()const |
62 | { | 71 | { |
63 | QMap<int,QString> fmap; | 72 | QMap<int,QString> fmap; |
64 | AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); | 73 | AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); |
65 | if (!view)return fmap; | 74 | if (!view)return fmap; |
66 | fmap = view->folderMenu(); | 75 | fmap = view->folderMenu(); |
67 | return fmap; | 76 | return fmap; |
68 | } | 77 | } |
69 | 78 | ||
70 | void AccountView::slotContextMenu(int id) | 79 | void AccountView::slotContextMenu(int id) |
71 | { | 80 | { |
72 | AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); | 81 | AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); |
73 | if (!view) return; | 82 | if (!view) return; |
74 | bool del = view->contextMenuSelected(id); | 83 | bool del = view->contextMenuSelected(id); |
75 | if (!del && view->isServer()!=2) { | 84 | if (!del && view->isServer()!=2) { |
76 | emit refreshMenues(view->isServer()); | 85 | emit refreshMenues(view->isServer()); |
77 | } | 86 | } |
78 | } | 87 | } |
79 | 88 | ||
80 | void AccountView::slotRightButton(int, QListViewItem * item,const QPoint&,int) | 89 | void AccountView::slotRightButton(int, QListViewItem * item,const QPoint&,int) |
81 | { | 90 | { |
82 | m_rightPressed = true; | 91 | m_rightPressed = true; |
83 | if (!item) return; | 92 | if (!item) return; |
84 | AccountViewItem *view = static_cast<AccountViewItem *>(item); | 93 | AccountViewItem *view = static_cast<AccountViewItem *>(item); |
85 | QPopupMenu*m = view->getContextMenu(); | 94 | QPopupMenu*m = view->getContextMenu(); |
86 | if (!m) return; | 95 | if (!m) return; |
87 | connect(m,SIGNAL(activated(int)),this,SLOT(slotContextMenu(int))); | 96 | connect(m,SIGNAL(activated(int)),this,SLOT(slotContextMenu(int))); |
88 | m->setFocus(); | 97 | m->setFocus(); |
89 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); | 98 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); |
90 | delete m; | 99 | delete m; |
91 | } | 100 | } |
92 | 101 | ||
93 | void AccountView::slotLeftButton(int, QListViewItem *,const QPoint&,int) | 102 | void AccountView::slotLeftButton(int, QListViewItem *,const QPoint&,int) |
94 | { | 103 | { |
95 | m_rightPressed = false; | 104 | m_rightPressed = false; |
96 | } | 105 | } |
97 | 106 | ||
98 | void AccountView::slotMouseClicked(QListViewItem*item) | 107 | void AccountView::slotMouseClicked(QListViewItem*item) |
99 | { | 108 | { |
100 | if (m_rightPressed) return; | 109 | if (m_rightPressed) return; |
101 | if (!item || m_currentItem == item) return; | 110 | if (!item || m_currentItem == item||!m_clickopens) return; |
102 | /* ### ToDo check settings if on single tab it should open */ | 111 | /* ### ToDo check settings if on single tab it should open */ |
103 | m_currentItem = item; | 112 | m_currentItem = item; |
104 | refresh(m_currentItem); | 113 | refresh(m_currentItem); |
105 | } | 114 | } |
106 | 115 | ||
107 | void AccountView::slotMouseButton(int button, QListViewItem * item,const QPoint&pos,int column) | 116 | void AccountView::slotMouseButton(int button, QListViewItem * item,const QPoint&pos,int column) |
108 | { | 117 | { |
109 | if (button==1) { | 118 | if (button==1) { |
110 | slotLeftButton(button,item,pos,column); | 119 | slotLeftButton(button,item,pos,column); |
111 | } else if (button==2) { | 120 | } else if (button==2) { |
112 | slotRightButton(button,item,pos,column); | 121 | slotRightButton(button,item,pos,column); |
113 | } | 122 | } |
114 | } | 123 | } |
115 | 124 | ||
116 | void AccountView::populate( QList<Account> list ) | 125 | void AccountView::populate( QList<Account> list ) |
117 | { | 126 | { |
118 | clear(); | 127 | clear(); |
119 | 128 | ||
120 | imapAccounts.clear(); | 129 | imapAccounts.clear(); |
121 | mhAccounts.clear(); | 130 | mhAccounts.clear(); |
122 | mhAccounts.append(new MHviewItem(AbstractMail::defaultLocalfolder(),this)); | 131 | mhAccounts.append(new MHviewItem(AbstractMail::defaultLocalfolder(),this)); |
123 | 132 | ||
124 | Account *it; | 133 | Account *it; |
125 | for ( it = list.first(); it; it = list.next() ) { | 134 | for ( it = list.first(); it; it = list.next() ) { |
126 | if ( it->getType() == MAILLIB::A_IMAP ) { | 135 | if ( it->getType() == MAILLIB::A_IMAP ) { |
127 | IMAPaccount *imap = static_cast<IMAPaccount *>(it); | 136 | IMAPaccount *imap = static_cast<IMAPaccount *>(it); |
128 | odebug << "added IMAP " + imap->getAccountName() << oendl; | 137 | odebug << "added IMAP " + imap->getAccountName() << oendl; |
129 | imapAccounts.append(new IMAPviewItem( imap, this )); | 138 | imapAccounts.append(new IMAPviewItem( imap, this )); |
130 | } else if ( it->getType() == MAILLIB::A_POP3 ) { | 139 | } else if ( it->getType() == MAILLIB::A_POP3 ) { |
131 | POP3account *pop3 = static_cast<POP3account *>(it); | 140 | POP3account *pop3 = static_cast<POP3account *>(it); |
132 | odebug << "added POP3 " + pop3->getAccountName() << oendl; | 141 | odebug << "added POP3 " + pop3->getAccountName() << oendl; |
133 | /* must not be hold 'cause it isn't required */ | 142 | /* must not be hold 'cause it isn't required */ |
134 | (void) new POP3viewItem( pop3, this ); | 143 | (void) new POP3viewItem( pop3, this ); |
135 | } else if ( it->getType() == MAILLIB::A_NNTP ) { | 144 | } else if ( it->getType() == MAILLIB::A_NNTP ) { |
136 | NNTPaccount *nntp = static_cast<NNTPaccount *>(it); | 145 | NNTPaccount *nntp = static_cast<NNTPaccount *>(it); |
137 | odebug << "added NNTP " + nntp->getAccountName() << oendl; | 146 | odebug << "added NNTP " + nntp->getAccountName() << oendl; |
138 | /* must not be hold 'cause it isn't required */ | 147 | /* must not be hold 'cause it isn't required */ |
139 | (void) new NNTPviewItem( nntp, this ); | 148 | (void) new NNTPviewItem( nntp, this ); |
140 | } else if ( it->getType() == MAILLIB::A_MH ) { | 149 | } else if ( it->getType() == MAILLIB::A_MH ) { |
141 | } | 150 | } |
142 | } | 151 | } |
143 | } | 152 | } |
144 | 153 | ||
145 | void AccountView::refresh(QListViewItem *item) | 154 | void AccountView::refresh(QListViewItem *item) |
146 | { | 155 | { |
147 | 156 | ||
148 | odebug << "AccountView refresh..." << oendl; | 157 | odebug << "AccountView refresh..." << oendl; |
149 | if ( item ) | 158 | if ( item ) |
150 | { | 159 | { |
151 | m_currentItem = item; | 160 | m_currentItem = item; |
152 | QValueList<RecMailP> headerlist; | 161 | QValueList<RecMailP> headerlist; |
153 | AccountViewItem *view = static_cast<AccountViewItem *>(item); | 162 | AccountViewItem *view = static_cast<AccountViewItem *>(item); |
154 | view->refresh(headerlist); | 163 | view->refresh(headerlist); |
155 | emit refreshMailview(headerlist); | 164 | emit refreshMailview(headerlist); |
156 | } | 165 | } |
157 | } | 166 | } |
158 | 167 | ||
159 | void AccountView::refreshCurrent() | 168 | void AccountView::refreshCurrent() |
160 | { | 169 | { |
161 | m_currentItem = currentItem(); | 170 | m_currentItem = currentItem(); |
162 | if ( !m_currentItem ) return; | 171 | if ( !m_currentItem ) return; |
163 | QValueList<RecMailP> headerlist; | 172 | QValueList<RecMailP> headerlist; |
164 | AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); | 173 | AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); |
165 | view->refresh(headerlist); | 174 | view->refresh(headerlist); |
166 | emit refreshMailview(headerlist); | 175 | emit refreshMailview(headerlist); |
167 | } | 176 | } |
168 | 177 | ||
169 | void AccountView::refreshAll() | 178 | void AccountView::refreshAll() |
170 | { | 179 | { |
171 | } | 180 | } |
172 | 181 | ||
173 | RecBodyP AccountView::fetchBody(const RecMailP&aMail) | 182 | RecBodyP AccountView::fetchBody(const RecMailP&aMail) |
174 | { | 183 | { |
175 | QListViewItem*item = selectedItem (); | 184 | QListViewItem*item = selectedItem (); |
176 | if (!item) return new RecBody(); | 185 | if (!item) return new RecBody(); |
177 | AccountViewItem *view = static_cast<AccountViewItem *>(item); | 186 | AccountViewItem *view = static_cast<AccountViewItem *>(item); |
178 | return view->fetchBody(aMail); | 187 | return view->fetchBody(aMail); |
179 | } | 188 | } |
180 | 189 | ||
181 | void AccountView::setupFolderselect(Selectstore*sels) | 190 | void AccountView::setupFolderselect(Selectstore*sels) |
182 | { | 191 | { |
183 | QPEApplication::showDialog( sels ); | 192 | QPEApplication::showDialog( sels ); |
184 | QStringList sFolders; | 193 | QStringList sFolders; |
185 | unsigned int i = 0; | 194 | unsigned int i = 0; |
186 | for (i=0; i < mhAccounts.count();++i) | 195 | for (i=0; i < mhAccounts.count();++i) |
187 | { | 196 | { |
188 | mhAccounts[i]->refresh(false); | 197 | mhAccounts[i]->refresh(false); |
189 | sFolders = mhAccounts[i]->subFolders(); | 198 | sFolders = mhAccounts[i]->subFolders(); |
190 | sels->addAccounts(mhAccounts[i]->getWrapper(),sFolders); | 199 | sels->addAccounts(mhAccounts[i]->getWrapper(),sFolders); |
191 | } | 200 | } |
192 | for (i=0; i < imapAccounts.count();++i) | 201 | for (i=0; i < imapAccounts.count();++i) |
193 | { | 202 | { |
194 | if (imapAccounts[i]->offline()) | 203 | if (imapAccounts[i]->offline()) |
195 | continue; | 204 | continue; |
196 | imapAccounts[i]->refreshFolders(false); | 205 | imapAccounts[i]->refreshFolders(false); |
197 | sels->addAccounts(imapAccounts[i]->getWrapper(),imapAccounts[i]->subFolders()); | 206 | sels->addAccounts(imapAccounts[i]->getWrapper(),imapAccounts[i]->subFolders()); |
198 | } | 207 | } |
199 | } | 208 | } |
200 | 209 | ||
201 | void AccountView::downloadMails(const FolderP&fromFolder,AbstractMail*fromWrapper) | 210 | void AccountView::downloadMails(const FolderP&fromFolder,AbstractMail*fromWrapper) |
202 | { | 211 | { |
203 | AbstractMail*targetMail = 0; | 212 | AbstractMail*targetMail = 0; |
204 | QString targetFolder = ""; | 213 | QString targetFolder = ""; |
205 | Selectstore sels; | 214 | Selectstore sels; |
206 | setupFolderselect(&sels); | 215 | setupFolderselect(&sels); |
207 | if (!sels.exec()) return; | 216 | if (!sels.exec()) return; |
208 | targetMail = sels.currentMail(); | 217 | targetMail = sels.currentMail(); |
209 | targetFolder = sels.currentFolder(); | 218 | targetFolder = sels.currentFolder(); |
210 | if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) || | 219 | if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) || |
211 | targetFolder.isEmpty()) | 220 | targetFolder.isEmpty()) |
212 | { | 221 | { |
213 | return; | 222 | return; |
214 | } | 223 | } |
215 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) | 224 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) |
216 | { | 225 | { |
217 | QMessageBox::critical(0,tr("Error creating new Folder"), | 226 | QMessageBox::critical(0,tr("Error creating new Folder"), |
218 | tr("<center>Error while creating<br>new folder - breaking.</center>")); | 227 | tr("<center>Error while creating<br>new folder - breaking.</center>")); |
219 | return; | 228 | return; |
220 | } | 229 | } |
221 | odebug << "Targetfolder: " << targetFolder.latin1() << "" << oendl; | 230 | odebug << "Targetfolder: " << targetFolder.latin1() << "" << oendl; |
222 | odebug << "Fromfolder: " << fromFolder->getName().latin1() << "" << oendl; | 231 | odebug << "Fromfolder: " << fromFolder->getName().latin1() << "" << oendl; |
223 | fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails()); | 232 | fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails()); |
224 | refreshCurrent(); | 233 | refreshCurrent(); |
225 | } | 234 | } |
226 | 235 | ||
227 | bool AccountView::currentisDraft() | 236 | bool AccountView::currentisDraft() |
228 | { | 237 | { |
229 | AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); | 238 | AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); |
230 | if (!view) return false; | 239 | if (!view) return false; |
231 | return view->isDraftfolder(); | 240 | return view->isDraftfolder(); |
232 | } | 241 | } |
diff --git a/noncore/net/mail/accountview.h b/noncore/net/mail/accountview.h index 5c4b559..418f4f3 100644 --- a/noncore/net/mail/accountview.h +++ b/noncore/net/mail/accountview.h | |||
@@ -1,58 +1,60 @@ | |||
1 | #ifndef ACCOUNTVIEW_H | 1 | #ifndef ACCOUNTVIEW_H |
2 | #define ACCOUNTVIEW_H | 2 | #define ACCOUNTVIEW_H |
3 | 3 | ||
4 | #include <libmailwrapper/mailtypes.h> | 4 | #include <libmailwrapper/mailtypes.h> |
5 | #include <opie2/osmartpointer.h> | 5 | #include <opie2/osmartpointer.h> |
6 | #include <qlistview.h> | 6 | #include <qlistview.h> |
7 | #include <qlist.h> | 7 | #include <qlist.h> |
8 | #include <qmap.h> | 8 | #include <qmap.h> |
9 | 9 | ||
10 | class Selectstore; | 10 | class Selectstore; |
11 | class Folder; | 11 | class Folder; |
12 | class AbstractMail; | 12 | class AbstractMail; |
13 | class Account; | 13 | class Account; |
14 | class IMAPviewItem; | 14 | class IMAPviewItem; |
15 | class MHviewItem; | 15 | class MHviewItem; |
16 | 16 | ||
17 | class AccountView : public QListView | 17 | class AccountView : public QListView |
18 | { | 18 | { |
19 | Q_OBJECT | 19 | Q_OBJECT |
20 | 20 | ||
21 | public: | 21 | public: |
22 | AccountView( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); | 22 | AccountView( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); |
23 | virtual ~AccountView(); | 23 | virtual ~AccountView(); |
24 | virtual void populate( QList<Account> list ); | 24 | virtual void populate( QList<Account> list ); |
25 | virtual RecBodyP fetchBody(const Opie::Core::OSmartPointer<RecMail>&aMail); | 25 | virtual RecBodyP fetchBody(const Opie::Core::OSmartPointer<RecMail>&aMail); |
26 | virtual void downloadMails(const Opie::Core::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper); | 26 | virtual void downloadMails(const Opie::Core::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper); |
27 | virtual bool currentisDraft(); | 27 | virtual bool currentisDraft(); |
28 | QMap<int,QString> currentServerMenu()const; | 28 | QMap<int,QString> currentServerMenu()const; |
29 | QMap<int,QString> currentFolderMenu()const; | 29 | QMap<int,QString> currentFolderMenu()const; |
30 | 30 | ||
31 | public slots: | 31 | public slots: |
32 | virtual void refreshAll(); | 32 | virtual void refreshAll(); |
33 | virtual void refresh(QListViewItem *item); | 33 | virtual void refresh(QListViewItem *item); |
34 | virtual void refreshCurrent(); | 34 | virtual void refreshCurrent(); |
35 | virtual void slotContextMenu(int id); | 35 | virtual void slotContextMenu(int id); |
36 | virtual void readSettings(); | ||
36 | 37 | ||
37 | void setupFolderselect(Selectstore*sels); | 38 | void setupFolderselect(Selectstore*sels); |
38 | 39 | ||
39 | signals: | 40 | signals: |
40 | void refreshMailview(const QValueList<RecMailP>& ); | 41 | void refreshMailview(const QValueList<RecMailP>& ); |
41 | void serverSelected(int); | 42 | void serverSelected(int); |
42 | void refreshMenues(int); | 43 | void refreshMenues(int); |
43 | 44 | ||
44 | protected: | 45 | protected: |
45 | QListViewItem* m_currentItem; | 46 | QListViewItem* m_currentItem; |
46 | QValueList<IMAPviewItem*> imapAccounts; | 47 | QValueList<IMAPviewItem*> imapAccounts; |
47 | QValueList<MHviewItem*> mhAccounts; | 48 | QValueList<MHviewItem*> mhAccounts; |
48 | bool m_rightPressed:1; | 49 | bool m_rightPressed:1; |
50 | bool m_clickopens:1; | ||
49 | 51 | ||
50 | protected slots: | 52 | protected slots: |
51 | virtual void slotRightButton(int, QListViewItem *,const QPoint&,int); | 53 | virtual void slotRightButton(int, QListViewItem *,const QPoint&,int); |
52 | virtual void slotLeftButton(int, QListViewItem *,const QPoint&,int); | 54 | virtual void slotLeftButton(int, QListViewItem *,const QPoint&,int); |
53 | virtual void slotMouseButton(int, QListViewItem *,const QPoint&,int); | 55 | virtual void slotMouseButton(int, QListViewItem *,const QPoint&,int); |
54 | virtual void slotMouseClicked(QListViewItem*); | 56 | virtual void slotMouseClicked(QListViewItem*); |
55 | virtual void slotSelectionChanged(QListViewItem*); | 57 | virtual void slotSelectionChanged(QListViewItem*); |
56 | }; | 58 | }; |
57 | 59 | ||
58 | #endif | 60 | #endif |
diff --git a/noncore/net/mail/defines.h b/noncore/net/mail/defines.h index 5fcbf0f..50d63dd 100644 --- a/noncore/net/mail/defines.h +++ b/noncore/net/mail/defines.h | |||
@@ -1,70 +1,72 @@ | |||
1 | #ifndef DEFINE_CONSTANTS_H | 1 | #ifndef DEFINE_CONSTANTS_H |
2 | #define DEFINE_CONSTANTS_H | 2 | #define DEFINE_CONSTANTS_H |
3 | 3 | ||
4 | #include <qpe/resource.h> | 4 | #include <qpe/resource.h> |
5 | 5 | ||
6 | #define USER_AGENT "OpieMail v0.3" | 6 | #define USER_AGENT "OpieMail v0.3" |
7 | 7 | ||
8 | #define PIC_COMPOSEMAIL "mail/composemail" | 8 | #define PIC_COMPOSEMAIL "mail/composemail" |
9 | #define PIC_SENDQUEUED "mail/sendqueued" | 9 | #define PIC_SENDQUEUED "mail/sendqueued" |
10 | #define PIC_SHOWFOLDERS "mail/showfolders" | 10 | #define PIC_SHOWFOLDERS "mail/showfolders" |
11 | #define PIC_SYNC "mail/sync" | 11 | #define PIC_SYNC "mail/sync" |
12 | #define PIC_IMAPFOLDER "mail/imapfolder" | 12 | #define PIC_IMAPFOLDER "mail/imapfolder" |
13 | #define PIC_MBOXFOLDER "mail/mboxfolder" | 13 | #define PIC_MBOXFOLDER "mail/mboxfolder" |
14 | #define PIC_POP3FOLDER "mail/pop3folder" | 14 | #define PIC_POP3FOLDER "mail/pop3folder" |
15 | #define PIC_INBOXFOLDER "mail/inbox" | 15 | #define PIC_INBOXFOLDER "mail/inbox" |
16 | #define PIC_OUTBOXFOLDER "mail/outbox" | 16 | #define PIC_OUTBOXFOLDER "mail/outbox" |
17 | #define PIC_LOCALFOLDER "mail/localfolder" | 17 | #define PIC_LOCALFOLDER "mail/localfolder" |
18 | 18 | ||
19 | #define PIC_OFFLINE "mail/notconnected" | 19 | #define PIC_OFFLINE "mail/notconnected" |
20 | #define PIC_DOCUMENT "DocsIcon" | ||
20 | 21 | ||
21 | #define ICON_COMPOSEMAIL QIconSet( Resource::loadPixmap( PIC_COMPOSEMAIL ) ) | 22 | #define ICON_COMPOSEMAIL QIconSet( Resource::loadPixmap( PIC_COMPOSEMAIL ) ) |
22 | #define ICON_SENDQUEUED QIconSet( Resource::loadPixmap( PIC_SENDQUEUED ) ) | 23 | #define ICON_SENDQUEUED QIconSet( Resource::loadPixmap( PIC_SENDQUEUED ) ) |
23 | #define ICON_SHOWFOLDERS QIconSet( Resource::loadPixmap( PIC_SHOWFOLDERS ) ) | 24 | #define ICON_SHOWFOLDERS QIconSet( Resource::loadPixmap( PIC_SHOWFOLDERS ) ) |
24 | #define ICON_SEARCHMAILS QIconSet( Resource::loadPixmap( PIC_SEARCHMAILS ) ) | 25 | #define ICON_SEARCHMAILS QIconSet( Resource::loadPixmap( PIC_SEARCHMAILS ) ) |
25 | #define ICON_EDITSETTINGS QIconSet( Resource::loadPixmap( PIC_EDITSETTINGS ) ) | 26 | #define ICON_EDITSETTINGS QIconSet( Resource::loadPixmap( PIC_EDITSETTINGS ) ) |
26 | #define ICON_EDITACCOUNTS QIconSet( Resource::loadPixmap( PIC_EDITACCOUNTS ) ) | 27 | #define ICON_EDITACCOUNTS QIconSet( Resource::loadPixmap( PIC_EDITACCOUNTS ) ) |
27 | #define ICON_SYNC QIconSet( Resource::loadPixmap( PIC_SYNC ) ) | 28 | #define ICON_SYNC QIconSet( Resource::loadPixmap( PIC_SYNC ) ) |
29 | #define ICON_READMAIL QIconSet( Resource::loadPixmap( PIC_DOCUMENT)) | ||
28 | 30 | ||
29 | #define PIXMAP_IMAPFOLDER QPixmap( Resource::loadPixmap( PIC_IMAPFOLDER ) ) | 31 | #define PIXMAP_IMAPFOLDER QPixmap( Resource::loadPixmap( PIC_IMAPFOLDER ) ) |
30 | #define PIXMAP_POP3FOLDER QPixmap( Resource::loadPixmap( PIC_POP3FOLDER ) ) | 32 | #define PIXMAP_POP3FOLDER QPixmap( Resource::loadPixmap( PIC_POP3FOLDER ) ) |
31 | #define PIXMAP_INBOXFOLDER QPixmap( Resource::loadPixmap( PIC_INBOXFOLDER) ) | 33 | #define PIXMAP_INBOXFOLDER QPixmap( Resource::loadPixmap( PIC_INBOXFOLDER) ) |
32 | #define PIXMAP_MBOXFOLDER QPixmap( Resource::loadPixmap( PIC_MBOXFOLDER ) ) | 34 | #define PIXMAP_MBOXFOLDER QPixmap( Resource::loadPixmap( PIC_MBOXFOLDER ) ) |
33 | #define PIXMAP_OUTBOXFOLDER QPixmap( Resource::loadPixmap( PIC_OUTBOXFOLDER) ) | 35 | #define PIXMAP_OUTBOXFOLDER QPixmap( Resource::loadPixmap( PIC_OUTBOXFOLDER) ) |
34 | #define PIXMAP_LOCALFOLDER QPixmap( Resource::loadPixmap( PIC_LOCALFOLDER) ) | 36 | #define PIXMAP_LOCALFOLDER QPixmap( Resource::loadPixmap( PIC_LOCALFOLDER) ) |
35 | #define PIXMAP_OFFLINE QPixmap( Resource::loadPixmap( PIC_OFFLINE) ) | 37 | #define PIXMAP_OFFLINE QPixmap( Resource::loadPixmap( PIC_OFFLINE) ) |
36 | 38 | ||
37 | #define IMAP_PORT "143" | 39 | #define IMAP_PORT "143" |
38 | #define IMAP_SSL_PORT "993" | 40 | #define IMAP_SSL_PORT "993" |
39 | #define SMTP_PORT "25" | 41 | #define SMTP_PORT "25" |
40 | #define SMTP_SSL_PORT "465" | 42 | #define SMTP_SSL_PORT "465" |
41 | #define POP3_PORT "110" | 43 | #define POP3_PORT "110" |
42 | #define POP3_SSL_PORT "995" | 44 | #define POP3_SSL_PORT "995" |
43 | #define NNTP_PORT "119" | 45 | #define NNTP_PORT "119" |
44 | #define NNTP_SSL_PORT "563" | 46 | #define NNTP_SSL_PORT "563" |
45 | 47 | ||
46 | /* used for decoding imapfoldername */ | 48 | /* used for decoding imapfoldername */ |
47 | #define UNDEFINED 64 | 49 | #define UNDEFINED 64 |
48 | #define MAXLINE 76 | 50 | #define MAXLINE 76 |
49 | #define UTF16MASK 0x03FFUL | 51 | #define UTF16MASK 0x03FFUL |
50 | #define UTF16SHIFT 10 | 52 | #define UTF16SHIFT 10 |
51 | #define UTF16BASE 0x10000UL | 53 | #define UTF16BASE 0x10000UL |
52 | #define UTF16HIGHSTART 0xD800UL | 54 | #define UTF16HIGHSTART 0xD800UL |
53 | #define UTF16HIGHEND 0xDBFFUL | 55 | #define UTF16HIGHEND 0xDBFFUL |
54 | #define UTF16LOSTART 0xDC00UL | 56 | #define UTF16LOSTART 0xDC00UL |
55 | #define UTF16LOEND 0xDFFFUL | 57 | #define UTF16LOEND 0xDFFFUL |
56 | 58 | ||
57 | /* used for making menuids transparent */ | 59 | /* used for making menuids transparent */ |
58 | #define FOLDER_MENU_REFRESH_HEADER 0 | 60 | #define FOLDER_MENU_REFRESH_HEADER 0 |
59 | #define FOLDER_MENU_DELETE_ALL_MAILS 1 | 61 | #define FOLDER_MENU_DELETE_ALL_MAILS 1 |
60 | #define FOLDER_MENU_NEW_SUBFOLDER 2 | 62 | #define FOLDER_MENU_NEW_SUBFOLDER 2 |
61 | #define FOLDER_MENU_DELETE_FOLDER 3 | 63 | #define FOLDER_MENU_DELETE_FOLDER 3 |
62 | #define FOLDER_MENU_MOVE_MAILS 4 | 64 | #define FOLDER_MENU_MOVE_MAILS 4 |
63 | 65 | ||
64 | #define SERVER_MENU_DISCONNECT 5 | 66 | #define SERVER_MENU_DISCONNECT 5 |
65 | #define SERVER_MENU_OFFLINE 6 | 67 | #define SERVER_MENU_OFFLINE 6 |
66 | #define SERVER_MENU_REFRESH_FOLDER 7 | 68 | #define SERVER_MENU_REFRESH_FOLDER 7 |
67 | #define SERVER_MENU_CREATE_FOLDER 8 | 69 | #define SERVER_MENU_CREATE_FOLDER 8 |
68 | #define SERVER_MENU_SUBSCRIBE 9 | 70 | #define SERVER_MENU_SUBSCRIBE 9 |
69 | 71 | ||
70 | #endif | 72 | #endif |
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp index 3689352..b587424 100644 --- a/noncore/net/mail/mainwindow.cpp +++ b/noncore/net/mail/mainwindow.cpp | |||
@@ -1,273 +1,280 @@ | |||
1 | #include <qlabel.h> | 1 | #include <qlabel.h> |
2 | #include <qvbox.h> | 2 | #include <qvbox.h> |
3 | #include <qheader.h> | 3 | #include <qheader.h> |
4 | #include <qtimer.h> | 4 | #include <qtimer.h> |
5 | #include <qlayout.h> | 5 | #include <qlayout.h> |
6 | 6 | ||
7 | #include <opie2/odebug.h> | 7 | #include <opie2/odebug.h> |
8 | #include <qpe/qpeapplication.h> | 8 | #include <qpe/qpeapplication.h> |
9 | #include <qpe/qcopenvelope_qws.h> | 9 | #include <qpe/qcopenvelope_qws.h> |
10 | 10 | ||
11 | #include "defines.h" | 11 | #include "defines.h" |
12 | #include "mainwindow.h" | 12 | #include "mainwindow.h" |
13 | 13 | ||
14 | using namespace Opie::Core; | 14 | using namespace Opie::Core; |
15 | 15 | ||
16 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | 16 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) |
17 | : QMainWindow( parent, name, flags ) | 17 | : QMainWindow( parent, name, flags ) |
18 | { | 18 | { |
19 | 19 | ||
20 | setCaption( tr( "Mail" ) ); | 20 | setCaption( tr( "Mail" ) ); |
21 | setToolBarsMovable( false ); | 21 | setToolBarsMovable( false ); |
22 | 22 | ||
23 | toolBar = new QToolBar( this ); | 23 | toolBar = new QToolBar( this ); |
24 | menuBar = new QMenuBar( toolBar ); | 24 | menuBar = new QMenuBar( toolBar ); |
25 | 25 | ||
26 | mailMenu = new QPopupMenu( menuBar ); | 26 | mailMenu = new QPopupMenu( menuBar ); |
27 | menuBar->insertItem( tr( "Mail" ), mailMenu ); | 27 | menuBar->insertItem( tr( "Mail" ), mailMenu ); |
28 | 28 | ||
29 | settingsMenu = new QPopupMenu( menuBar ); | 29 | settingsMenu = new QPopupMenu( menuBar ); |
30 | menuBar->insertItem( tr( "Settings" ), settingsMenu ); | 30 | menuBar->insertItem( tr( "Settings" ), settingsMenu ); |
31 | 31 | ||
32 | if (QApplication::desktop()->width()<330) { | 32 | if (QApplication::desktop()->width()<330) { |
33 | serverMenu = new QPopupMenu( mailMenu ); | 33 | serverMenu = new QPopupMenu( mailMenu ); |
34 | folderMenu = new QPopupMenu( mailMenu ); | 34 | folderMenu = new QPopupMenu( mailMenu ); |
35 | m_ServerMenuId = mailMenu->insertItem( tr( "Server" ), serverMenu ); | 35 | m_ServerMenuId = mailMenu->insertItem( tr( "Server" ), serverMenu ); |
36 | m_FolderMenuId = mailMenu->insertItem( tr( "Folder" ), folderMenu ); | 36 | m_FolderMenuId = mailMenu->insertItem( tr( "Folder" ), folderMenu ); |
37 | } else { | 37 | } else { |
38 | serverMenu = new QPopupMenu( menuBar ); | 38 | serverMenu = new QPopupMenu( menuBar ); |
39 | folderMenu = new QPopupMenu( menuBar ); | 39 | folderMenu = new QPopupMenu( menuBar ); |
40 | m_FolderMenuId = menuBar->insertItem( tr( "Folder" ), folderMenu ); | 40 | m_FolderMenuId = menuBar->insertItem( tr( "Folder" ), folderMenu ); |
41 | m_ServerMenuId = menuBar->insertItem( tr( "Server" ), serverMenu ); | 41 | m_ServerMenuId = menuBar->insertItem( tr( "Server" ), serverMenu ); |
42 | } | 42 | } |
43 | serverMenu->insertItem(tr("Disconnect"),SERVER_MENU_DISCONNECT); | 43 | serverMenu->insertItem(tr("Disconnect"),SERVER_MENU_DISCONNECT); |
44 | serverMenu->insertItem(tr("Set on/offline"),SERVER_MENU_OFFLINE); | 44 | serverMenu->insertItem(tr("Set on/offline"),SERVER_MENU_OFFLINE); |
45 | serverMenu->insertSeparator(); | 45 | serverMenu->insertSeparator(); |
46 | serverMenu->insertItem(tr("Refresh folder list"),SERVER_MENU_REFRESH_FOLDER); | 46 | serverMenu->insertItem(tr("Refresh folder list"),SERVER_MENU_REFRESH_FOLDER); |
47 | serverMenu->insertItem(tr("Create new folder"),SERVER_MENU_CREATE_FOLDER); | 47 | serverMenu->insertItem(tr("Create new folder"),SERVER_MENU_CREATE_FOLDER); |
48 | serverMenu->insertSeparator(); | 48 | serverMenu->insertSeparator(); |
49 | serverMenu->insertItem(tr("(Un-)Subscribe groups"),SERVER_MENU_SUBSCRIBE); | 49 | serverMenu->insertItem(tr("(Un-)Subscribe groups"),SERVER_MENU_SUBSCRIBE); |
50 | 50 | ||
51 | folderMenu->insertItem(tr("Refresh headerlist"),FOLDER_MENU_REFRESH_HEADER); | 51 | folderMenu->insertItem(tr("Refresh headerlist"),FOLDER_MENU_REFRESH_HEADER); |
52 | folderMenu->insertItem(tr("Delete all mails"),FOLDER_MENU_DELETE_ALL_MAILS); | 52 | folderMenu->insertItem(tr("Delete all mails"),FOLDER_MENU_DELETE_ALL_MAILS); |
53 | folderMenu->insertItem(tr("New subfolder"),FOLDER_MENU_NEW_SUBFOLDER); | 53 | folderMenu->insertItem(tr("New subfolder"),FOLDER_MENU_NEW_SUBFOLDER); |
54 | folderMenu->insertItem(tr("Delete folder"),FOLDER_MENU_DELETE_FOLDER); | 54 | folderMenu->insertItem(tr("Delete folder"),FOLDER_MENU_DELETE_FOLDER); |
55 | folderMenu->insertItem(tr("Move/Copie all mails"),FOLDER_MENU_MOVE_MAILS); | 55 | folderMenu->insertItem(tr("Move/Copie all mails"),FOLDER_MENU_MOVE_MAILS); |
56 | menuBar->setItemEnabled(m_ServerMenuId,false); | 56 | menuBar->setItemEnabled(m_ServerMenuId,false); |
57 | menuBar->setItemEnabled(m_FolderMenuId,false); | 57 | menuBar->setItemEnabled(m_FolderMenuId,false); |
58 | 58 | ||
59 | addToolBar( toolBar ); | 59 | addToolBar( toolBar ); |
60 | toolBar->setHorizontalStretchable( true ); | 60 | toolBar->setHorizontalStretchable( true ); |
61 | 61 | ||
62 | QLabel *spacer = new QLabel( toolBar ); | 62 | QLabel *spacer = new QLabel( toolBar ); |
63 | spacer->setBackgroundMode( QWidget::PaletteButton ); | 63 | spacer->setBackgroundMode( QWidget::PaletteButton ); |
64 | toolBar->setStretchableWidget( spacer ); | 64 | toolBar->setStretchableWidget( spacer ); |
65 | 65 | ||
66 | readMail = new QAction(tr("Read current mail"),ICON_READMAIL,0,0,this); | ||
67 | readMail->addTo(toolBar); | ||
68 | readMail->addTo(mailMenu); | ||
69 | connect(readMail,SIGNAL(activated()),this,SLOT(displayMail())); | ||
70 | |||
66 | composeMail = new QAction( tr( "Compose new mail" ), ICON_COMPOSEMAIL, | 71 | composeMail = new QAction( tr( "Compose new mail" ), ICON_COMPOSEMAIL, |
67 | 0, 0, this ); | 72 | 0, 0, this ); |
68 | composeMail->addTo( toolBar ); | 73 | composeMail->addTo( toolBar ); |
69 | composeMail->addTo( mailMenu ); | 74 | composeMail->addTo( mailMenu ); |
70 | 75 | ||
76 | |||
71 | sendQueued = new QAction( tr( "Send queued mails" ), ICON_SENDQUEUED, | 77 | sendQueued = new QAction( tr( "Send queued mails" ), ICON_SENDQUEUED, |
72 | 0, 0, this ); | 78 | 0, 0, this ); |
73 | sendQueued->addTo( toolBar ); | 79 | sendQueued->addTo( toolBar ); |
74 | sendQueued->addTo( mailMenu ); | 80 | sendQueued->addTo( mailMenu ); |
75 | 81 | ||
76 | /* | 82 | /* |
77 | syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, | 83 | syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, |
78 | 0, 0, this ); | 84 | 0, 0, this ); |
79 | syncFolders->addTo( toolBar ); | 85 | syncFolders->addTo( toolBar ); |
80 | syncFolders->addTo( mailMenu ); | 86 | syncFolders->addTo( mailMenu ); |
81 | */ | 87 | */ |
82 | 88 | ||
83 | showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS, | 89 | showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS, |
84 | 0, 0, this, 0, true ); | 90 | 0, 0, this, 0, true ); |
85 | showFolders->addTo( toolBar ); | 91 | showFolders->addTo( toolBar ); |
86 | showFolders->addTo( mailMenu ); | 92 | showFolders->addTo( mailMenu ); |
87 | showFolders->setOn( true ); | 93 | showFolders->setOn( true ); |
88 | connect(showFolders, SIGNAL( toggled(bool) ), | 94 | connect(showFolders, SIGNAL( toggled(bool) ), |
89 | SLOT( slotShowFolders(bool) ) ); | 95 | SLOT( slotShowFolders(bool) ) ); |
90 | 96 | ||
91 | /* | 97 | /* |
92 | searchMails = new QAction( tr( "Search mails" ), QIconSet( Resource::loadPixmap("find") ), | 98 | searchMails = new QAction( tr( "Search mails" ), QIconSet( Resource::loadPixmap("find") ), |
93 | 0, 0, this ); | 99 | 0, 0, this ); |
94 | searchMails->addTo( toolBar ); | 100 | searchMails->addTo( toolBar ); |
95 | searchMails->addTo( mailMenu ); | 101 | searchMails->addTo( mailMenu ); |
96 | */ | 102 | */ |
97 | 103 | ||
98 | deleteMails = new QAction(tr("Delete Mail"), QIconSet( Resource::loadPixmap("trash")), 0, 0, this); | 104 | deleteMails = new QAction(tr("Delete Mail"), QIconSet( Resource::loadPixmap("trash")), 0, 0, this); |
99 | deleteMails->addTo( toolBar ); | 105 | deleteMails->addTo( toolBar ); |
100 | deleteMails->addTo( mailMenu ); | 106 | deleteMails->addTo( mailMenu ); |
101 | connect( deleteMails, SIGNAL( activated() ), | 107 | connect( deleteMails, SIGNAL( activated() ), |
102 | SLOT( slotDeleteMail() ) ); | 108 | SLOT( slotDeleteMail() ) ); |
103 | 109 | ||
104 | editSettings = new QAction( tr( "Edit settings" ), QIconSet( Resource::loadPixmap("SettingsIcon") ) , | 110 | editSettings = new QAction( tr( "Edit settings" ), QIconSet( Resource::loadPixmap("SettingsIcon") ) , |
105 | 0, 0, this ); | 111 | 0, 0, this ); |
106 | editSettings->addTo( settingsMenu ); | 112 | editSettings->addTo( settingsMenu ); |
107 | connect( editSettings, SIGNAL( activated() ), | 113 | connect( editSettings, SIGNAL( activated() ), |
108 | SLOT( slotEditSettings() ) ); | 114 | SLOT( slotEditSettings() ) ); |
109 | editAccounts = new QAction( tr( "Configure accounts" ), QIconSet( Resource::loadPixmap("mail/editaccounts") ) , | 115 | editAccounts = new QAction( tr( "Configure accounts" ), QIconSet( Resource::loadPixmap("mail/editaccounts") ) , |
110 | 0, 0, this ); | 116 | 0, 0, this ); |
111 | editAccounts->addTo( settingsMenu ); | 117 | editAccounts->addTo( settingsMenu ); |
112 | 118 | ||
113 | 119 | ||
114 | QWidget *view = new QWidget( this ); | 120 | QWidget *view = new QWidget( this ); |
115 | setCentralWidget( view ); | 121 | setCentralWidget( view ); |
116 | layout = new QBoxLayout ( view, QBoxLayout::LeftToRight ); | 122 | layout = new QBoxLayout ( view, QBoxLayout::LeftToRight ); |
117 | 123 | ||
118 | folderView = new AccountView( view ); | 124 | folderView = new AccountView( view ); |
119 | folderView->header()->hide(); | 125 | folderView->header()->hide(); |
120 | folderView->setRootIsDecorated( true ); | 126 | folderView->setRootIsDecorated( true ); |
121 | folderView->addColumn( tr( "Mailbox" ) ); | 127 | folderView->addColumn( tr( "Mailbox" ) ); |
122 | connect(folderView,SIGNAL(serverSelected(int)),this,SLOT(serverSelected(int))); | 128 | connect(folderView,SIGNAL(serverSelected(int)),this,SLOT(serverSelected(int))); |
123 | connect(serverMenu,SIGNAL(activated(int)),folderView,SLOT(slotContextMenu(int))); | 129 | connect(serverMenu,SIGNAL(activated(int)),folderView,SLOT(slotContextMenu(int))); |
124 | connect(folderMenu,SIGNAL(activated(int)),folderView,SLOT(slotContextMenu(int))); | 130 | connect(folderMenu,SIGNAL(activated(int)),folderView,SLOT(slotContextMenu(int))); |
131 | connect(this,SIGNAL(settingsChanged()),folderView,SLOT(readSettings())); | ||
125 | 132 | ||
126 | 133 | ||
127 | layout->addWidget( folderView ); | 134 | layout->addWidget( folderView ); |
128 | 135 | ||
129 | mailView = new QListView( view ); | 136 | mailView = new QListView( view ); |
130 | mailView->addColumn( "" ); | 137 | mailView->addColumn( "" ); |
131 | mailView->addColumn( tr( "Subject" ),QListView::Manual ); | 138 | mailView->addColumn( tr( "Subject" ),QListView::Manual ); |
132 | mailView->addColumn( tr( "Sender" ),QListView::Manual ); | 139 | mailView->addColumn( tr( "Sender" ),QListView::Manual ); |
133 | mailView->addColumn( tr( "Size" ),QListView::Manual); | 140 | mailView->addColumn( tr( "Size" ),QListView::Manual); |
134 | mailView->addColumn( tr( "Date" )); | 141 | mailView->addColumn( tr( "Date" )); |
135 | mailView->setAllColumnsShowFocus(true); | 142 | mailView->setAllColumnsShowFocus(true); |
136 | mailView->setShowSortIndicator(true); | 143 | mailView->setShowSortIndicator(true); |
137 | mailView->setSorting(4,false); | 144 | mailView->setSorting(4,false); |
138 | 145 | ||
139 | layout->addWidget( mailView ); | 146 | layout->addWidget( mailView ); |
140 | layout->setStretchFactor( folderView, 1 ); | 147 | layout->setStretchFactor( folderView, 1 ); |
141 | layout->setStretchFactor( mailView, 2 ); | 148 | layout->setStretchFactor( mailView, 2 ); |
142 | 149 | ||
143 | m_Rotate = (QApplication::desktop()->width() > QApplication::desktop()->height()?0:90); | 150 | m_Rotate = (QApplication::desktop()->width() > QApplication::desktop()->height()?0:90); |
144 | 151 | ||
145 | slotAdjustLayout(); | 152 | slotAdjustLayout(); |
146 | 153 | ||
147 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); | 154 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); |
148 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); | 155 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); |
149 | 156 | ||
150 | connect( mailView, SIGNAL( mouseButtonClicked(int,QListViewItem*,const QPoint&,int) ),this, | 157 | connect( mailView, SIGNAL( mouseButtonClicked(int,QListViewItem*,const QPoint&,int) ),this, |
151 | SLOT( mailLeftClicked(int,QListViewItem*,const QPoint&,int) ) ); | 158 | SLOT( mailLeftClicked(int,QListViewItem*,const QPoint&,int) ) ); |
152 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, | 159 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, |
153 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); | 160 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); |
154 | 161 | ||
155 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), | 162 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), |
156 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); | 163 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); |
157 | 164 | ||
158 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); | 165 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); |
159 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); | 166 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); |
160 | 167 | ||
161 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); | 168 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); |
162 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); | 169 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); |
163 | // Added by Stefan Eilers to allow starting by addressbook.. | 170 | // Added by Stefan Eilers to allow starting by addressbook.. |
164 | // copied from old mail2 | 171 | // copied from old mail2 |
165 | 172 | ||
166 | #if !defined(QT_NO_COP) | 173 | #if !defined(QT_NO_COP) |
167 | connect( qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ), | 174 | connect( qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ), |
168 | this, SLOT( appMessage(const QCString&,const QByteArray&) ) ); | 175 | this, SLOT( appMessage(const QCString&,const QByteArray&) ) ); |
169 | m_sysChannel = new QCopChannel( "QPE/System", this ); | 176 | m_sysChannel = new QCopChannel( "QPE/System", this ); |
170 | connect( m_sysChannel, SIGNAL( received(const QCString&,const QByteArray&) ), | 177 | connect( m_sysChannel, SIGNAL( received(const QCString&,const QByteArray&) ), |
171 | this, SLOT( systemMessage(const QCString&,const QByteArray&) ) ); | 178 | this, SLOT( systemMessage(const QCString&,const QByteArray&) ) ); |
172 | #endif | 179 | #endif |
173 | 180 | ||
174 | QTimer::singleShot( 10, this, SLOT( slotAdjustColumns() ) ); | 181 | QTimer::singleShot( 10, this, SLOT( slotAdjustColumns() ) ); |
175 | } | 182 | } |
176 | 183 | ||
177 | MainWindow::~MainWindow() | 184 | MainWindow::~MainWindow() |
178 | { | 185 | { |
179 | } | 186 | } |
180 | 187 | ||
181 | void MainWindow::serverSelected(int) | 188 | void MainWindow::serverSelected(int) |
182 | { | 189 | { |
183 | odebug << "slotShowFolders not reached" << oendl; | 190 | odebug << "slotShowFolders not reached" << oendl; |
184 | } | 191 | } |
185 | 192 | ||
186 | void MainWindow::systemMessage( const QCString& msg, const QByteArray& data ) | 193 | void MainWindow::systemMessage( const QCString& msg, const QByteArray& data ) |
187 | { | 194 | { |
188 | int _newrotation; | 195 | int _newrotation; |
189 | QDataStream stream( data, IO_ReadOnly ); | 196 | QDataStream stream( data, IO_ReadOnly ); |
190 | if ( msg == "setCurrentRotation(int)" ) | 197 | if ( msg == "setCurrentRotation(int)" ) |
191 | { | 198 | { |
192 | stream >> _newrotation; | 199 | stream >> _newrotation; |
193 | if (m_Rotate != _newrotation) { | 200 | if (m_Rotate != _newrotation) { |
194 | slotAdjustLayout(); | 201 | slotAdjustLayout(); |
195 | m_Rotate = _newrotation; | 202 | m_Rotate = _newrotation; |
196 | } | 203 | } |
197 | } | 204 | } |
198 | } | 205 | } |
199 | 206 | ||
200 | void MainWindow::appMessage(const QCString &, const QByteArray &) | 207 | void MainWindow::appMessage(const QCString &, const QByteArray &) |
201 | { | 208 | { |
202 | odebug << "appMessage not reached" << oendl; | 209 | odebug << "appMessage not reached" << oendl; |
203 | } | 210 | } |
204 | 211 | ||
205 | void MainWindow::slotAdjustLayout() { | 212 | void MainWindow::slotAdjustLayout() { |
206 | 213 | ||
207 | QWidget *d = QApplication::desktop(); | 214 | QWidget *d = QApplication::desktop(); |
208 | if ( d->width() < d->height() ) { | 215 | if ( d->width() < d->height() ) { |
209 | layout->setDirection( QBoxLayout::TopToBottom ); | 216 | layout->setDirection( QBoxLayout::TopToBottom ); |
210 | } else { | 217 | } else { |
211 | layout->setDirection( QBoxLayout::LeftToRight ); | 218 | layout->setDirection( QBoxLayout::LeftToRight ); |
212 | } | 219 | } |
213 | } | 220 | } |
214 | 221 | ||
215 | void MainWindow::slotAdjustColumns() | 222 | void MainWindow::slotAdjustColumns() |
216 | { | 223 | { |
217 | bool hidden = folderView->isHidden(); | 224 | bool hidden = folderView->isHidden(); |
218 | if ( hidden ) folderView->show(); | 225 | if ( hidden ) folderView->show(); |
219 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); | 226 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); |
220 | if ( hidden ) folderView->hide(); | 227 | if ( hidden ) folderView->hide(); |
221 | 228 | ||
222 | mailView->setColumnWidth( 0, 10 ); | 229 | mailView->setColumnWidth( 0, 10 ); |
223 | mailView->setColumnWidth( 1, mailView->visibleWidth() - 130 ); | 230 | mailView->setColumnWidth( 1, mailView->visibleWidth() - 130 ); |
224 | mailView->setColumnWidth( 2, 80 ); | 231 | mailView->setColumnWidth( 2, 80 ); |
225 | mailView->setColumnWidth( 3, 50 ); | 232 | mailView->setColumnWidth( 3, 50 ); |
226 | mailView->setColumnWidth( 4, 50 ); | 233 | mailView->setColumnWidth( 4, 50 ); |
227 | } | 234 | } |
228 | 235 | ||
229 | void MainWindow::slotEditSettings() | 236 | void MainWindow::slotEditSettings() |
230 | { | 237 | { |
231 | } | 238 | } |
232 | 239 | ||
233 | void MainWindow::slotShowFolders( bool ) | 240 | void MainWindow::slotShowFolders( bool ) |
234 | { | 241 | { |
235 | odebug << "slotShowFolders not reached" << oendl; | 242 | odebug << "slotShowFolders not reached" << oendl; |
236 | } | 243 | } |
237 | 244 | ||
238 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) | 245 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) |
239 | { | 246 | { |
240 | odebug << "refreshMailView not reached" << oendl; | 247 | odebug << "refreshMailView not reached" << oendl; |
241 | } | 248 | } |
242 | 249 | ||
243 | void MainWindow::mailLeftClicked(int, QListViewItem *,const QPoint&,int ) | 250 | void MainWindow::mailLeftClicked(int, QListViewItem *,const QPoint&,int ) |
244 | { | 251 | { |
245 | odebug << "mailLeftClicked not reached" << oendl; | 252 | odebug << "mailLeftClicked not reached" << oendl; |
246 | } | 253 | } |
247 | 254 | ||
248 | void MainWindow::displayMail() | 255 | void MainWindow::displayMail() |
249 | { | 256 | { |
250 | odebug << "displayMail not reached" << oendl; | 257 | odebug << "displayMail not reached" << oendl; |
251 | } | 258 | } |
252 | 259 | ||
253 | void MainWindow::slotDeleteMail() | 260 | void MainWindow::slotDeleteMail() |
254 | { | 261 | { |
255 | odebug << "deleteMail not reached" << oendl; | 262 | odebug << "deleteMail not reached" << oendl; |
256 | } | 263 | } |
257 | 264 | ||
258 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) | 265 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) |
259 | { | 266 | { |
260 | odebug << "mailHold not reached" << oendl; | 267 | odebug << "mailHold not reached" << oendl; |
261 | } | 268 | } |
262 | 269 | ||
263 | void MainWindow::slotSendQueued() | 270 | void MainWindow::slotSendQueued() |
264 | { | 271 | { |
265 | } | 272 | } |
266 | 273 | ||
267 | void MainWindow::slotEditAccounts() | 274 | void MainWindow::slotEditAccounts() |
268 | { | 275 | { |
269 | } | 276 | } |
270 | 277 | ||
271 | void MainWindow::slotComposeMail() | 278 | void MainWindow::slotComposeMail() |
272 | { | 279 | { |
273 | } | 280 | } |
diff --git a/noncore/net/mail/mainwindow.h b/noncore/net/mail/mainwindow.h index b781d62..6449ce8 100644 --- a/noncore/net/mail/mainwindow.h +++ b/noncore/net/mail/mainwindow.h | |||
@@ -1,61 +1,63 @@ | |||
1 | #ifndef MAINWINDOW_H | 1 | #ifndef MAINWINDOW_H |
2 | #define MAINWINDOW_H | 2 | #define MAINWINDOW_H |
3 | 3 | ||
4 | #include "accountview.h" | 4 | #include "accountview.h" |
5 | #include <libmailwrapper/mailtypes.h> | 5 | #include <libmailwrapper/mailtypes.h> |
6 | 6 | ||
7 | #include <opie2/osmartpointer.h> | 7 | #include <opie2/osmartpointer.h> |
8 | 8 | ||
9 | #include <qmainwindow.h> | 9 | #include <qmainwindow.h> |
10 | #include <qlistview.h> | 10 | #include <qlistview.h> |
11 | #include <qaction.h> | 11 | #include <qaction.h> |
12 | #include <qtoolbar.h> | 12 | #include <qtoolbar.h> |
13 | #include <qmenubar.h> | 13 | #include <qmenubar.h> |
14 | #include <qmap.h> | 14 | #include <qmap.h> |
15 | 15 | ||
16 | class RecMail; | 16 | class RecMail; |
17 | class QCopChannel; | 17 | class QCopChannel; |
18 | 18 | ||
19 | class MainWindow : public QMainWindow | 19 | class MainWindow : public QMainWindow |
20 | { | 20 | { |
21 | Q_OBJECT | 21 | Q_OBJECT |
22 | 22 | ||
23 | public: | 23 | public: |
24 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); | 24 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); |
25 | virtual ~MainWindow(); | 25 | virtual ~MainWindow(); |
26 | 26 | ||
27 | public slots: | 27 | public slots: |
28 | virtual void slotAdjustColumns(); | 28 | virtual void slotAdjustColumns(); |
29 | virtual void appMessage(const QCString &msg, const QByteArray &data); | 29 | virtual void appMessage(const QCString &msg, const QByteArray &data); |
30 | virtual void slotComposeMail(); | 30 | virtual void slotComposeMail(); |
31 | virtual void systemMessage( const QCString&, const QByteArray& ); | 31 | virtual void systemMessage( const QCString&, const QByteArray& ); |
32 | 32 | ||
33 | protected slots: | 33 | protected slots: |
34 | virtual void slotSendQueued(); | 34 | virtual void slotSendQueued(); |
35 | virtual void slotEditAccounts(); | 35 | virtual void slotEditAccounts(); |
36 | virtual void slotShowFolders( bool show ); | 36 | virtual void slotShowFolders( bool show ); |
37 | virtual void refreshMailView(const QValueList<RecMailP>&); | 37 | virtual void refreshMailView(const QValueList<RecMailP>&); |
38 | virtual void displayMail(); | 38 | virtual void displayMail(); |
39 | virtual void slotDeleteMail(); | 39 | virtual void slotDeleteMail(); |
40 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); | 40 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); |
41 | virtual void slotAdjustLayout(); | 41 | virtual void slotAdjustLayout(); |
42 | virtual void slotEditSettings(); | 42 | virtual void slotEditSettings(); |
43 | virtual void mailLeftClicked( int, QListViewItem *,const QPoint&,int ); | 43 | virtual void mailLeftClicked( int, QListViewItem *,const QPoint&,int ); |
44 | virtual void serverSelected(int); | 44 | virtual void serverSelected(int); |
45 | 45 | ||
46 | protected: | 46 | protected: |
47 | QToolBar *toolBar; | 47 | QToolBar *toolBar; |
48 | QMenuBar *menuBar; | 48 | QMenuBar *menuBar; |
49 | QPopupMenu *mailMenu, *settingsMenu,*serverMenu,*folderMenu; | 49 | QPopupMenu *mailMenu, *settingsMenu,*serverMenu,*folderMenu; |
50 | 50 | ||
51 | QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails, | 51 | QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails, |
52 | *editSettings, *editAccounts, *syncFolders; | 52 | *editSettings, *editAccounts, *syncFolders,*readMail; |
53 | AccountView *folderView; | 53 | AccountView *folderView; |
54 | QListView *mailView; | 54 | QListView *mailView; |
55 | QBoxLayout *layout; | 55 | QBoxLayout *layout; |
56 | int m_Rotate; | 56 | int m_Rotate; |
57 | QCopChannel* m_sysChannel; | 57 | QCopChannel* m_sysChannel; |
58 | int m_ServerMenuId,m_FolderMenuId; | 58 | int m_ServerMenuId,m_FolderMenuId; |
59 | signals: | ||
60 | void settingsChanged(); | ||
59 | }; | 61 | }; |
60 | 62 | ||
61 | #endif | 63 | #endif |
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp index 1bc81e4..fb8877a 100644 --- a/noncore/net/mail/opiemail.cpp +++ b/noncore/net/mail/opiemail.cpp | |||
@@ -1,429 +1,440 @@ | |||
1 | 1 | ||
2 | #include "settingsdialog.h" | 2 | #include "settingsdialog.h" |
3 | #include "opiemail.h" | 3 | #include "opiemail.h" |
4 | #include "editaccounts.h" | 4 | #include "editaccounts.h" |
5 | #include "composemail.h" | 5 | #include "composemail.h" |
6 | #include "mailistviewitem.h" | 6 | #include "mailistviewitem.h" |
7 | #include "viewmail.h" | 7 | #include "viewmail.h" |
8 | #include "selectstore.h" | 8 | #include "selectstore.h" |
9 | #include "selectsmtp.h" | 9 | #include "selectsmtp.h" |
10 | 10 | ||
11 | #include <libmailwrapper/smtpwrapper.h> | 11 | #include <libmailwrapper/smtpwrapper.h> |
12 | #include <libmailwrapper/mailtypes.h> | 12 | #include <libmailwrapper/mailtypes.h> |
13 | #include <libmailwrapper/abstractmail.h> | 13 | #include <libmailwrapper/abstractmail.h> |
14 | /* OPIE */ | 14 | /* OPIE */ |
15 | #include <opie2/odebug.h> | 15 | #include <opie2/odebug.h> |
16 | #include <qpe/resource.h> | 16 | #include <qpe/resource.h> |
17 | #include <qpe/qpeapplication.h> | 17 | #include <qpe/qpeapplication.h> |
18 | #include <qpe/config.h> | ||
18 | 19 | ||
19 | /* QT */ | 20 | /* QT */ |
20 | #include <qmap.h> | 21 | #include <qmap.h> |
21 | #include <qvaluelist.h> | 22 | #include <qvaluelist.h> |
22 | 23 | ||
23 | /* UNIX */ | 24 | /* UNIX */ |
24 | #include <signal.h> | 25 | #include <signal.h> |
25 | 26 | ||
26 | using namespace Opie::Core; | 27 | using namespace Opie::Core; |
27 | 28 | ||
28 | typedef QMapNode<QString,QString> tkeyvalues; | 29 | typedef QMapNode<QString,QString> tkeyvalues; |
29 | typedef QValueList<tkeyvalues> tvaluelist; | 30 | typedef QValueList<tkeyvalues> tvaluelist; |
30 | 31 | ||
31 | class ValueExplode | 32 | class ValueExplode |
32 | { | 33 | { |
33 | protected: | 34 | protected: |
34 | //! what was parsed last | 35 | //! what was parsed last |
35 | tvaluelist m_LastParsed; | 36 | tvaluelist m_LastParsed; |
36 | //! the delemiter to use | 37 | //! the delemiter to use |
37 | QString mDelemiter; | 38 | QString mDelemiter; |
38 | //! the inner delemiter | 39 | //! the inner delemiter |
39 | QString m2Delemiter; | 40 | QString m2Delemiter; |
40 | //! the real split routine | 41 | //! the real split routine |
41 | void splitit(); | 42 | void splitit(); |
42 | //! the content | 43 | //! the content |
43 | QString m_Command; | 44 | QString m_Command; |
44 | //! constructor | 45 | //! constructor |
45 | ValueExplode(){} | 46 | ValueExplode(){} |
46 | public: | 47 | public: |
47 | //! constructor | 48 | //! constructor |
48 | /*! | 49 | /*! |
49 | * \param aCommand the string to be splitted | 50 | * \param aCommand the string to be splitted |
50 | * \param aDelemiter which sign will be the delemiter character | 51 | * \param aDelemiter which sign will be the delemiter character |
51 | * \param a2Delemiter which sign will delemiter the key-value-pairs between other delemiters | 52 | * \param a2Delemiter which sign will delemiter the key-value-pairs between other delemiters |
52 | */ | 53 | */ |
53 | ValueExplode(const QString&aCommand,const char aDelemiter = '&',const char a2Delemiter='='); | 54 | ValueExplode(const QString&aCommand,const char aDelemiter = '&',const char a2Delemiter='='); |
54 | //! destructor | 55 | //! destructor |
55 | virtual ~ValueExplode(); | 56 | virtual ~ValueExplode(); |
56 | //! assigen operator | 57 | //! assigen operator |
57 | /*! | 58 | /*! |
58 | * \return a list of substrings | 59 | * \return a list of substrings |
59 | */ | 60 | */ |
60 | operator const tvaluelist& (){return m_LastParsed;} | 61 | operator const tvaluelist& (){return m_LastParsed;} |
61 | }; | 62 | }; |
62 | 63 | ||
63 | ValueExplode::~ValueExplode() | 64 | ValueExplode::~ValueExplode() |
64 | { | 65 | { |
65 | } | 66 | } |
66 | 67 | ||
67 | ValueExplode::ValueExplode(const QString&aCommand,const char aDelemiter,const char a2Delemiter) | 68 | ValueExplode::ValueExplode(const QString&aCommand,const char aDelemiter,const char a2Delemiter) |
68 | :m_LastParsed(),m_Command(aCommand) | 69 | :m_LastParsed(),m_Command(aCommand) |
69 | { | 70 | { |
70 | mDelemiter = aDelemiter; | 71 | mDelemiter = aDelemiter; |
71 | m2Delemiter = a2Delemiter; | 72 | m2Delemiter = a2Delemiter; |
72 | splitit(); | 73 | splitit(); |
73 | } | 74 | } |
74 | 75 | ||
75 | void ValueExplode::splitit() | 76 | void ValueExplode::splitit() |
76 | { | 77 | { |
77 | QString iLine; | 78 | QString iLine; |
78 | m_LastParsed.clear(); | 79 | m_LastParsed.clear(); |
79 | if (mDelemiter.isEmpty()||m2Delemiter.isEmpty()) { | 80 | if (mDelemiter.isEmpty()||m2Delemiter.isEmpty()) { |
80 | m_LastParsed.append(tkeyvalues(m_Command,"")); | 81 | m_LastParsed.append(tkeyvalues(m_Command,"")); |
81 | return; | 82 | return; |
82 | } | 83 | } |
83 | int pos,pos2; | 84 | int pos,pos2; |
84 | unsigned startpos = 0; | 85 | unsigned startpos = 0; |
85 | iLine = m_Command; | 86 | iLine = m_Command; |
86 | while ( (pos = iLine.find(mDelemiter,startpos))!=-1) { | 87 | while ( (pos = iLine.find(mDelemiter,startpos))!=-1) { |
87 | pos2 = iLine.find(m2Delemiter,startpos); | 88 | pos2 = iLine.find(m2Delemiter,startpos); |
88 | if (pos2==-1||pos2>pos) { | 89 | if (pos2==-1||pos2>pos) { |
89 | m_LastParsed.append(tkeyvalues(iLine.mid(startpos,pos-startpos),"")); | 90 | m_LastParsed.append(tkeyvalues(iLine.mid(startpos,pos-startpos),"")); |
90 | } else { | 91 | } else { |
91 | m_LastParsed.append(tkeyvalues(iLine.mid(startpos,pos2-startpos),iLine.mid(pos2+1,pos-pos2-1))); | 92 | m_LastParsed.append(tkeyvalues(iLine.mid(startpos,pos2-startpos),iLine.mid(pos2+1,pos-pos2-1))); |
92 | } | 93 | } |
93 | startpos = pos+1; | 94 | startpos = pos+1; |
94 | } | 95 | } |
95 | if (startpos<iLine.length()) { | 96 | if (startpos<iLine.length()) { |
96 | pos2 = iLine.find(m2Delemiter,startpos); | 97 | pos2 = iLine.find(m2Delemiter,startpos); |
97 | if (pos2==-1) { | 98 | if (pos2==-1) { |
98 | m_LastParsed.append(tkeyvalues(iLine.mid(startpos),"")); | 99 | m_LastParsed.append(tkeyvalues(iLine.mid(startpos),"")); |
99 | } else { | 100 | } else { |
100 | m_LastParsed.append(tkeyvalues(iLine.mid(startpos,pos2-startpos),iLine.mid(pos2+1))); | 101 | m_LastParsed.append(tkeyvalues(iLine.mid(startpos,pos2-startpos),iLine.mid(pos2+1))); |
101 | } | 102 | } |
102 | } | 103 | } |
103 | } | 104 | } |
104 | 105 | ||
105 | OpieMail::OpieMail( QWidget *parent, const char *name, WFlags ) | 106 | OpieMail::OpieMail( QWidget *parent, const char *name, WFlags ) |
106 | : MainWindow( parent, name, WStyle_ContextHelp ) | 107 | : MainWindow( parent, name, WStyle_ContextHelp ) |
107 | { | 108 | { |
108 | setup_signalblocking(); | 109 | setup_signalblocking(); |
110 | Config cfg("mail"); | ||
111 | cfg.setGroup( "Settings" ); | ||
112 | m_clickopens = cfg.readBoolEntry("clickOpensMail",true); | ||
113 | |||
109 | settings = new Settings(); | 114 | settings = new Settings(); |
110 | folderView->populate( settings->getAccounts() ); | 115 | folderView->populate( settings->getAccounts() ); |
111 | connect(folderView,SIGNAL(refreshMenues(int)),this,SLOT(refreshMenu(int))); | 116 | connect(folderView,SIGNAL(refreshMenues(int)),this,SLOT(refreshMenu(int))); |
112 | } | 117 | } |
113 | 118 | ||
114 | OpieMail::~OpieMail() | 119 | OpieMail::~OpieMail() |
115 | { | 120 | { |
116 | if (settings) delete settings; | 121 | if (settings) delete settings; |
117 | } | 122 | } |
118 | 123 | ||
119 | void OpieMail::setup_signalblocking() | 124 | void OpieMail::setup_signalblocking() |
120 | { | 125 | { |
121 | /* for networking we must block SIGPIPE and Co. */ | 126 | /* for networking we must block SIGPIPE and Co. */ |
122 | struct sigaction blocking_action,temp_action; | 127 | struct sigaction blocking_action,temp_action; |
123 | blocking_action.sa_handler = SIG_IGN; | 128 | blocking_action.sa_handler = SIG_IGN; |
124 | sigemptyset(&(blocking_action.sa_mask)); | 129 | sigemptyset(&(blocking_action.sa_mask)); |
125 | blocking_action.sa_flags = 0; | 130 | blocking_action.sa_flags = 0; |
126 | sigaction(SIGPIPE,&blocking_action,&temp_action); | 131 | sigaction(SIGPIPE,&blocking_action,&temp_action); |
127 | } | 132 | } |
128 | 133 | ||
129 | void OpieMail::appMessage(const QCString &msg, const QByteArray &data) | 134 | void OpieMail::appMessage(const QCString &msg, const QByteArray &data) |
130 | { | 135 | { |
131 | // copied from old mail2 | 136 | // copied from old mail2 |
132 | if (msg == "writeMail(QString,QString)") | 137 | if (msg == "writeMail(QString,QString)") |
133 | { | 138 | { |
134 | QDataStream stream(data,IO_ReadOnly); | 139 | QDataStream stream(data,IO_ReadOnly); |
135 | QString name, email; | 140 | QString name, email; |
136 | stream >> name >> email; | 141 | stream >> name >> email; |
137 | // removing the whitespaces at beginning and end is needed! | 142 | // removing the whitespaces at beginning and end is needed! |
138 | slotwriteMail(name.stripWhiteSpace(),email.stripWhiteSpace()); | 143 | slotwriteMail(name.stripWhiteSpace(),email.stripWhiteSpace()); |
139 | } | 144 | } |
140 | else if (msg == "newMail()") | 145 | else if (msg == "newMail()") |
141 | { | 146 | { |
142 | slotComposeMail(); | 147 | slotComposeMail(); |
143 | } | 148 | } |
144 | } | 149 | } |
145 | 150 | ||
146 | /** | 151 | /** |
147 | * Konqueror calls us with the mailto:name@address | 152 | * Konqueror calls us with the mailto:name@address |
148 | */ | 153 | */ |
149 | void OpieMail::setDocument(const QString& mail) | 154 | void OpieMail::setDocument(const QString& mail) |
150 | { | 155 | { |
151 | /* | 156 | /* |
152 | * It looks like a mailto address, lets try it | 157 | * It looks like a mailto address, lets try it |
153 | */ | 158 | */ |
154 | if( mail.startsWith(QString::fromLatin1("mailto:")) ) | 159 | if( mail.startsWith(QString::fromLatin1("mailto:")) ) |
155 | slotwriteMail(QString::null, mail.mid(7)); | 160 | slotwriteMail(QString::null, mail.mid(7)); |
156 | } | 161 | } |
157 | 162 | ||
158 | void OpieMail::slotwriteMail(const QString&name,const QString&email) | 163 | void OpieMail::slotwriteMail(const QString&name,const QString&email) |
159 | { | 164 | { |
160 | ComposeMail compose( settings, this, 0, true , WStyle_ContextHelp ); | 165 | ComposeMail compose( settings, this, 0, true , WStyle_ContextHelp ); |
161 | if (!email.isEmpty()) | 166 | if (!email.isEmpty()) |
162 | { | 167 | { |
163 | if (!name.isEmpty()) | 168 | if (!name.isEmpty()) |
164 | { | 169 | { |
165 | compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">"); | 170 | compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">"); |
166 | } | 171 | } |
167 | else | 172 | else |
168 | { | 173 | { |
169 | compose.setTo(email); | 174 | compose.setTo(email); |
170 | } | 175 | } |
171 | } | 176 | } |
172 | compose.slotAdjustColumns(); | 177 | compose.slotAdjustColumns(); |
173 | QPEApplication::execDialog( &compose ); | 178 | QPEApplication::execDialog( &compose ); |
174 | } | 179 | } |
175 | 180 | ||
176 | void OpieMail::slotComposeMail() | 181 | void OpieMail::slotComposeMail() |
177 | { | 182 | { |
178 | odebug << "Compose Mail" << oendl; | 183 | odebug << "Compose Mail" << oendl; |
179 | slotwriteMail(0l,0l); | 184 | slotwriteMail(0l,0l); |
180 | } | 185 | } |
181 | 186 | ||
182 | void OpieMail::slotSendQueued() | 187 | void OpieMail::slotSendQueued() |
183 | { | 188 | { |
184 | odebug << "Send Queued" << oendl; | 189 | odebug << "Send Queued" << oendl; |
185 | SMTPaccount *smtp = 0; | 190 | SMTPaccount *smtp = 0; |
186 | 191 | ||
187 | QList<Account> list = settings->getAccounts(); | 192 | QList<Account> list = settings->getAccounts(); |
188 | QList<SMTPaccount> smtpList; | 193 | QList<SMTPaccount> smtpList; |
189 | smtpList.setAutoDelete(false); | 194 | smtpList.setAutoDelete(false); |
190 | Account *it; | 195 | Account *it; |
191 | for ( it = list.first(); it; it = list.next() ) | 196 | for ( it = list.first(); it; it = list.next() ) |
192 | { | 197 | { |
193 | if ( it->getType() == MAILLIB::A_SMTP ) | 198 | if ( it->getType() == MAILLIB::A_SMTP ) |
194 | { | 199 | { |
195 | smtp = static_cast<SMTPaccount *>(it); | 200 | smtp = static_cast<SMTPaccount *>(it); |
196 | smtpList.append(smtp); | 201 | smtpList.append(smtp); |
197 | } | 202 | } |
198 | } | 203 | } |
199 | if (smtpList.count()==0) | 204 | if (smtpList.count()==0) |
200 | { | 205 | { |
201 | QMessageBox::information(0,tr("Info"),tr("Define a smtp account first")); | 206 | QMessageBox::information(0,tr("Info"),tr("Define a smtp account first")); |
202 | return; | 207 | return; |
203 | } | 208 | } |
204 | if (smtpList.count()==1) | 209 | if (smtpList.count()==1) |
205 | { | 210 | { |
206 | smtp = smtpList.at(0); | 211 | smtp = smtpList.at(0); |
207 | } | 212 | } |
208 | else | 213 | else |
209 | { | 214 | { |
210 | smtp = 0; | 215 | smtp = 0; |
211 | selectsmtp selsmtp; | 216 | selectsmtp selsmtp; |
212 | selsmtp.setSelectionlist(&smtpList); | 217 | selsmtp.setSelectionlist(&smtpList); |
213 | if ( QPEApplication::execDialog( &selsmtp ) == QDialog::Accepted ) | 218 | if ( QPEApplication::execDialog( &selsmtp ) == QDialog::Accepted ) |
214 | { | 219 | { |
215 | smtp = selsmtp.selected_smtp(); | 220 | smtp = selsmtp.selected_smtp(); |
216 | } | 221 | } |
217 | } | 222 | } |
218 | if (smtp) | 223 | if (smtp) |
219 | { | 224 | { |
220 | SMTPwrapper * wrap = new SMTPwrapper(smtp); | 225 | SMTPwrapper * wrap = new SMTPwrapper(smtp); |
221 | if ( wrap->flushOutbox() ) | 226 | if ( wrap->flushOutbox() ) |
222 | { | 227 | { |
223 | QMessageBox::information(0,tr("Info"),tr("Mail queue flushed")); | 228 | QMessageBox::information(0,tr("Info"),tr("Mail queue flushed")); |
224 | } | 229 | } |
225 | delete wrap; | 230 | delete wrap; |
226 | } | 231 | } |
227 | } | 232 | } |
228 | 233 | ||
229 | void OpieMail::slotSearchMails() | 234 | void OpieMail::slotSearchMails() |
230 | { | 235 | { |
231 | odebug << "Search Mails" << oendl; | 236 | odebug << "Search Mails" << oendl; |
232 | } | 237 | } |
233 | 238 | ||
234 | void OpieMail::slotEditSettings() | 239 | void OpieMail::slotEditSettings() |
235 | { | 240 | { |
236 | SettingsDialog settingsDialog( this, 0, true, WStyle_ContextHelp ); | 241 | SettingsDialog settingsDialog( this, 0, true, WStyle_ContextHelp ); |
237 | QPEApplication::execDialog( &settingsDialog ); | 242 | if (QPEApplication::execDialog( &settingsDialog )) { |
243 | Config cfg("mail"); | ||
244 | cfg.setGroup( "Settings" ); | ||
245 | m_clickopens = cfg.readBoolEntry("clickOpensMail",true); | ||
246 | emit settingsChanged(); | ||
247 | } | ||
238 | } | 248 | } |
239 | 249 | ||
240 | void OpieMail::slotEditAccounts() | 250 | void OpieMail::slotEditAccounts() |
241 | { | 251 | { |
242 | odebug << "Edit Accounts" << oendl; | 252 | odebug << "Edit Accounts" << oendl; |
243 | EditAccounts eaDialog( settings, this, 0, true, WStyle_ContextHelp ); | 253 | EditAccounts eaDialog( settings, this, 0, true, WStyle_ContextHelp ); |
244 | eaDialog.slotAdjustColumns(); | 254 | eaDialog.slotAdjustColumns(); |
245 | if (QPEApplication::execDialog( &eaDialog )==QDialog::Rejected);// return; | 255 | if (QPEApplication::execDialog( &eaDialog )==QDialog::Rejected);// return; |
246 | 256 | ||
247 | if ( settings ) delete settings; | 257 | if ( settings ) delete settings; |
248 | settings = new Settings(); | 258 | settings = new Settings(); |
249 | mailView->clear(); | 259 | mailView->clear(); |
250 | folderView->populate( settings->getAccounts() ); | 260 | folderView->populate( settings->getAccounts() ); |
251 | } | 261 | } |
252 | 262 | ||
253 | void OpieMail::displayMail() | 263 | void OpieMail::displayMail() |
254 | { | 264 | { |
255 | QListViewItem*item = mailView->currentItem(); | 265 | QListViewItem*item = mailView->currentItem(); |
256 | if (!item) return; | 266 | if (!item) return; |
257 | RecMailP mail = ((MailListViewItem*)item)->data(); | 267 | RecMailP mail = ((MailListViewItem*)item)->data(); |
258 | RecBodyP body = folderView->fetchBody(mail); | 268 | RecBodyP body = folderView->fetchBody(mail); |
259 | ViewMail readMail( this,"", Qt::WType_Modal | WStyle_ContextHelp ); | 269 | ViewMail readMail( this,"", Qt::WType_Modal | WStyle_ContextHelp ); |
260 | readMail.setBody( body ); | 270 | readMail.setBody( body ); |
261 | readMail.setMail( mail ); | 271 | readMail.setMail( mail ); |
262 | readMail.showMaximized(); | 272 | readMail.showMaximized(); |
263 | readMail.exec(); | 273 | readMail.exec(); |
264 | 274 | ||
265 | if ( readMail.deleted ) | 275 | if ( readMail.deleted ) |
266 | { | 276 | { |
267 | folderView->refreshCurrent(); | 277 | folderView->refreshCurrent(); |
268 | } | 278 | } |
269 | else | 279 | else |
270 | { | 280 | { |
271 | ( (MailListViewItem*)item )->setPixmap( 0, Resource::loadPixmap( "" ) ); | 281 | ( (MailListViewItem*)item )->setPixmap( 0, Resource::loadPixmap( "" ) ); |
272 | } | 282 | } |
273 | } | 283 | } |
274 | 284 | ||
275 | void OpieMail::slotDeleteMail() | 285 | void OpieMail::slotDeleteMail() |
276 | { | 286 | { |
277 | if (!mailView->currentItem()) return; | 287 | if (!mailView->currentItem()) return; |
278 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); | 288 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); |
279 | if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) | 289 | if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) |
280 | { | 290 | { |
281 | mail->Wrapper()->deleteMail( mail ); | 291 | mail->Wrapper()->deleteMail( mail ); |
282 | folderView->refreshCurrent(); | 292 | folderView->refreshCurrent(); |
283 | } | 293 | } |
284 | } | 294 | } |
285 | 295 | ||
286 | void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) | 296 | void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) |
287 | { | 297 | { |
288 | if (!mailView->currentItem()) return; | 298 | if (!mailView->currentItem()) return; |
289 | MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType(); | 299 | MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType(); |
290 | /* just the RIGHT button - or hold on pda */ | 300 | /* just the RIGHT button - or hold on pda */ |
291 | if (button!=2) {return;} | 301 | if (button!=2) {return;} |
292 | odebug << "Event right/hold" << oendl; | 302 | odebug << "Event right/hold" << oendl; |
293 | if (!item) return; | 303 | if (!item) return; |
294 | QPopupMenu *m = new QPopupMenu(0); | 304 | QPopupMenu *m = new QPopupMenu(0); |
295 | if (m) | 305 | if (m) |
296 | { | 306 | { |
297 | if (mailtype==MAILLIB::A_NNTP) { | 307 | if (mailtype==MAILLIB::A_NNTP) { |
298 | m->insertItem(tr("Read this posting"),this,SLOT(displayMail())); | 308 | m->insertItem(tr("Read this posting"),this,SLOT(displayMail())); |
299 | // m->insertItem(tr("Copy this posting"),this,SLOT(slotMoveCopyMail())); | 309 | // m->insertItem(tr("Copy this posting"),this,SLOT(slotMoveCopyMail())); |
300 | } else { | 310 | } else { |
301 | if (folderView->currentisDraft()) { | 311 | if (folderView->currentisDraft()) { |
302 | m->insertItem(tr("Edit this mail"),this,SLOT(reEditMail())); | 312 | m->insertItem(tr("Edit this mail"),this,SLOT(reEditMail())); |
303 | } | 313 | } |
304 | m->insertItem(tr("Read this mail"),this,SLOT(displayMail())); | 314 | m->insertItem(tr("Read this mail"),this,SLOT(displayMail())); |
305 | m->insertItem(tr("Delete this mail"),this,SLOT(slotDeleteMail())); | 315 | m->insertItem(tr("Delete this mail"),this,SLOT(slotDeleteMail())); |
306 | m->insertItem(tr("Copy/Move this mail"),this,SLOT(slotMoveCopyMail())); | 316 | m->insertItem(tr("Copy/Move this mail"),this,SLOT(slotMoveCopyMail())); |
307 | } | 317 | } |
308 | m->setFocus(); | 318 | m->setFocus(); |
309 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); | 319 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); |
310 | delete m; | 320 | delete m; |
311 | } | 321 | } |
312 | } | 322 | } |
313 | 323 | ||
314 | void OpieMail::slotShowFolders( bool show ) | 324 | void OpieMail::slotShowFolders( bool show ) |
315 | { | 325 | { |
316 | odebug << "Show Folders" << oendl; | 326 | odebug << "Show Folders" << oendl; |
317 | if ( show && folderView->isHidden() ) | 327 | if ( show && folderView->isHidden() ) |
318 | { | 328 | { |
319 | odebug << "-> showing" << oendl; | 329 | odebug << "-> showing" << oendl; |
320 | folderView->show(); | 330 | folderView->show(); |
321 | } | 331 | } |
322 | else if ( !show && !folderView->isHidden() ) | 332 | else if ( !show && !folderView->isHidden() ) |
323 | { | 333 | { |
324 | odebug << "-> hiding" << oendl; | 334 | odebug << "-> hiding" << oendl; |
325 | folderView->hide(); | 335 | folderView->hide(); |
326 | } | 336 | } |
327 | } | 337 | } |
328 | 338 | ||
329 | void OpieMail::refreshMailView(const QValueList<RecMailP>&list) | 339 | void OpieMail::refreshMailView(const QValueList<RecMailP>&list) |
330 | { | 340 | { |
331 | MailListViewItem*item = 0; | 341 | MailListViewItem*item = 0; |
332 | mailView->clear(); | 342 | mailView->clear(); |
333 | 343 | ||
334 | QValueList<RecMailP>::ConstIterator it; | 344 | QValueList<RecMailP>::ConstIterator it; |
335 | for (it = list.begin(); it != list.end();++it) | 345 | for (it = list.begin(); it != list.end();++it) |
336 | { | 346 | { |
337 | item = new MailListViewItem(mailView,item); | 347 | item = new MailListViewItem(mailView,item); |
338 | item->storeData((*it)); | 348 | item->storeData((*it)); |
339 | item->showEntry(); | 349 | item->showEntry(); |
340 | } | 350 | } |
341 | } | 351 | } |
342 | 352 | ||
343 | void OpieMail::mailLeftClicked(int button, QListViewItem *item,const QPoint&,int ) | 353 | void OpieMail::mailLeftClicked(int button, QListViewItem *item,const QPoint&,int ) |
344 | { | 354 | { |
355 | if (!m_clickopens) return; | ||
345 | /* just LEFT button - or tap with stylus on pda */ | 356 | /* just LEFT button - or tap with stylus on pda */ |
346 | if (button!=1) return; | 357 | if (button!=1) return; |
347 | if (!item) return; | 358 | if (!item) return; |
348 | if (folderView->currentisDraft()) { | 359 | if (folderView->currentisDraft()) { |
349 | reEditMail(); | 360 | reEditMail(); |
350 | } else { | 361 | } else { |
351 | displayMail(); | 362 | displayMail(); |
352 | } | 363 | } |
353 | } | 364 | } |
354 | 365 | ||
355 | void OpieMail::slotMoveCopyMail() | 366 | void OpieMail::slotMoveCopyMail() |
356 | { | 367 | { |
357 | if (!mailView->currentItem()) return; | 368 | if (!mailView->currentItem()) return; |
358 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); | 369 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); |
359 | AbstractMail*targetMail = 0; | 370 | AbstractMail*targetMail = 0; |
360 | QString targetFolder = ""; | 371 | QString targetFolder = ""; |
361 | Selectstore sels; | 372 | Selectstore sels; |
362 | folderView->setupFolderselect(&sels); | 373 | folderView->setupFolderselect(&sels); |
363 | if (!sels.exec()) return; | 374 | if (!sels.exec()) return; |
364 | targetMail = sels.currentMail(); | 375 | targetMail = sels.currentMail(); |
365 | targetFolder = sels.currentFolder(); | 376 | targetFolder = sels.currentFolder(); |
366 | if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || | 377 | if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || |
367 | targetFolder.isEmpty()) | 378 | targetFolder.isEmpty()) |
368 | { | 379 | { |
369 | return; | 380 | return; |
370 | } | 381 | } |
371 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) | 382 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) |
372 | { | 383 | { |
373 | QMessageBox::critical(0,tr("Error creating new Folder"), | 384 | QMessageBox::critical(0,tr("Error creating new Folder"), |
374 | tr("<center>Error while creating<br>new folder - breaking.</center>")); | 385 | tr("<center>Error while creating<br>new folder - breaking.</center>")); |
375 | return; | 386 | return; |
376 | } | 387 | } |
377 | mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); | 388 | mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); |
378 | folderView->refreshCurrent(); | 389 | folderView->refreshCurrent(); |
379 | } | 390 | } |
380 | 391 | ||
381 | void OpieMail::reEditMail() | 392 | void OpieMail::reEditMail() |
382 | { | 393 | { |
383 | if (!mailView->currentItem()) return; | 394 | if (!mailView->currentItem()) return; |
384 | 395 | ||
385 | ComposeMail compose( settings, this, 0, true , WStyle_ContextHelp ); | 396 | ComposeMail compose( settings, this, 0, true , WStyle_ContextHelp ); |
386 | compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data()); | 397 | compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data()); |
387 | compose.slotAdjustColumns(); | 398 | compose.slotAdjustColumns(); |
388 | QPEApplication::execDialog( &compose ); | 399 | QPEApplication::execDialog( &compose ); |
389 | } | 400 | } |
390 | 401 | ||
391 | void OpieMail::refreshMenu(int m_isFolder) | 402 | void OpieMail::refreshMenu(int m_isFolder) |
392 | { | 403 | { |
393 | if (QApplication::desktop()->width()<330) { | 404 | if (QApplication::desktop()->width()<330) { |
394 | mailMenu->setItemEnabled(m_ServerMenuId,m_isFolder&1); | 405 | mailMenu->setItemEnabled(m_ServerMenuId,m_isFolder&1); |
395 | mailMenu->setItemEnabled(m_FolderMenuId,m_isFolder&2); | 406 | mailMenu->setItemEnabled(m_FolderMenuId,m_isFolder&2); |
396 | } else { | 407 | } else { |
397 | menuBar->setItemEnabled(m_ServerMenuId,m_isFolder&1); | 408 | menuBar->setItemEnabled(m_ServerMenuId,m_isFolder&1); |
398 | menuBar->setItemEnabled(m_FolderMenuId,m_isFolder&2); | 409 | menuBar->setItemEnabled(m_FolderMenuId,m_isFolder&2); |
399 | } | 410 | } |
400 | 411 | ||
401 | QMap<int,QString>::ConstIterator it; | 412 | QMap<int,QString>::ConstIterator it; |
402 | QMap<int,QString> server_entries=folderView->currentServerMenu(); | 413 | QMap<int,QString> server_entries=folderView->currentServerMenu(); |
403 | QMap<int,QString> folder_entries=folderView->currentFolderMenu(); | 414 | QMap<int,QString> folder_entries=folderView->currentFolderMenu(); |
404 | 415 | ||
405 | int id; | 416 | int id; |
406 | unsigned int i; | 417 | unsigned int i; |
407 | for (i=0; i<folderMenu->count();++i) { | 418 | for (i=0; i<folderMenu->count();++i) { |
408 | id = folderMenu->idAt(i); | 419 | id = folderMenu->idAt(i); |
409 | folderMenu->setItemEnabled(id,false); | 420 | folderMenu->setItemEnabled(id,false); |
410 | } | 421 | } |
411 | for (it=folder_entries.begin();it!=folder_entries.end();++it) { | 422 | for (it=folder_entries.begin();it!=folder_entries.end();++it) { |
412 | folderMenu->changeItem(it.key(),it.data()); | 423 | folderMenu->changeItem(it.key(),it.data()); |
413 | folderMenu->setItemEnabled(it.key(),true); | 424 | folderMenu->setItemEnabled(it.key(),true); |
414 | } | 425 | } |
415 | for (i=0; i<serverMenu->count();++i) { | 426 | for (i=0; i<serverMenu->count();++i) { |
416 | id = serverMenu->idAt(i); | 427 | id = serverMenu->idAt(i); |
417 | serverMenu->setItemEnabled(id,false); | 428 | serverMenu->setItemEnabled(id,false); |
418 | } | 429 | } |
419 | for (it=server_entries.begin();it!=server_entries.end();++it) { | 430 | for (it=server_entries.begin();it!=server_entries.end();++it) { |
420 | serverMenu->changeItem(it.key(),it.data()); | 431 | serverMenu->changeItem(it.key(),it.data()); |
421 | serverMenu->setItemEnabled(it.key(),true); | 432 | serverMenu->setItemEnabled(it.key(),true); |
422 | } | 433 | } |
423 | } | 434 | } |
424 | 435 | ||
425 | void OpieMail::serverSelected(int m_isFolder) | 436 | void OpieMail::serverSelected(int m_isFolder) |
426 | { | 437 | { |
427 | mailView->clear(); | 438 | mailView->clear(); |
428 | refreshMenu(m_isFolder); | 439 | refreshMenu(m_isFolder); |
429 | } | 440 | } |
diff --git a/noncore/net/mail/opiemail.h b/noncore/net/mail/opiemail.h index 75a0b2d..327bef7 100644 --- a/noncore/net/mail/opiemail.h +++ b/noncore/net/mail/opiemail.h | |||
@@ -1,51 +1,54 @@ | |||
1 | #ifndef OPIEMAIL_H | 1 | #ifndef OPIEMAIL_H |
2 | #define OPIEMAIL_H | 2 | #define OPIEMAIL_H |
3 | 3 | ||
4 | #include "mainwindow.h" | 4 | #include "mainwindow.h" |
5 | #include <libmailwrapper/settings.h> | 5 | #include <libmailwrapper/settings.h> |
6 | #include <libmailwrapper/mailtypes.h> | 6 | #include <libmailwrapper/mailtypes.h> |
7 | 7 | ||
8 | #include <opie2/osmartpointer.h> | 8 | #include <opie2/osmartpointer.h> |
9 | 9 | ||
10 | #include <qmap.h> | 10 | #include <qmap.h> |
11 | 11 | ||
12 | class OpieMail : public MainWindow | 12 | class OpieMail : public MainWindow |
13 | { | 13 | { |
14 | Q_OBJECT | 14 | Q_OBJECT |
15 | 15 | ||
16 | public: | 16 | public: |
17 | OpieMail( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); | 17 | OpieMail( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); |
18 | virtual ~OpieMail(); | 18 | virtual ~OpieMail(); |
19 | static QString appName() { return QString::fromLatin1("opiemail"); } | 19 | static QString appName() { return QString::fromLatin1("opiemail"); } |
20 | 20 | ||
21 | public slots: | 21 | public slots: |
22 | virtual void slotwriteMail(const QString&name,const QString&email); | 22 | virtual void slotwriteMail(const QString&name,const QString&email); |
23 | virtual void slotComposeMail(); | 23 | virtual void slotComposeMail(); |
24 | virtual void appMessage(const QCString &msg, const QByteArray &data); | 24 | virtual void appMessage(const QCString &msg, const QByteArray &data); |
25 | void setDocument(const QString&); | 25 | void setDocument(const QString&); |
26 | 26 | ||
27 | protected slots: | 27 | protected slots: |
28 | virtual void slotSendQueued(); | 28 | virtual void slotSendQueued(); |
29 | virtual void slotSearchMails(); | 29 | virtual void slotSearchMails(); |
30 | virtual void slotEditSettings(); | 30 | virtual void slotEditSettings(); |
31 | virtual void slotEditAccounts(); | 31 | virtual void slotEditAccounts(); |
32 | virtual void displayMail(); | 32 | virtual void displayMail(); |
33 | virtual void slotDeleteMail(); | 33 | virtual void slotDeleteMail(); |
34 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); | 34 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); |
35 | virtual void slotShowFolders( bool show ); | 35 | virtual void slotShowFolders( bool show ); |
36 | virtual void refreshMailView(const QValueList<RecMailP>&); | 36 | virtual void refreshMailView(const QValueList<RecMailP>&); |
37 | virtual void mailLeftClicked( int, QListViewItem *,const QPoint&,int ); | 37 | virtual void mailLeftClicked( int, QListViewItem *,const QPoint&,int ); |
38 | virtual void slotMoveCopyMail(); | 38 | virtual void slotMoveCopyMail(); |
39 | virtual void reEditMail(); | 39 | virtual void reEditMail(); |
40 | virtual void serverSelected(int); | 40 | virtual void serverSelected(int); |
41 | virtual void refreshMenu(int); | 41 | virtual void refreshMenu(int); |
42 | 42 | ||
43 | protected: | 43 | protected: |
44 | void setup_signalblocking(); | 44 | void setup_signalblocking(); |
45 | 45 | ||
46 | bool m_clickopens:1; | ||
47 | |||
46 | private: | 48 | private: |
47 | Settings *settings; | 49 | Settings *settings; |
50 | signals: | ||
48 | 51 | ||
49 | }; | 52 | }; |
50 | 53 | ||
51 | #endif | 54 | #endif |
diff --git a/noncore/net/mail/settingsdialog.cpp b/noncore/net/mail/settingsdialog.cpp index 6441948..74b8b12 100644 --- a/noncore/net/mail/settingsdialog.cpp +++ b/noncore/net/mail/settingsdialog.cpp | |||
@@ -1,51 +1,55 @@ | |||
1 | #include <qcheckbox.h> | 1 | #include <qcheckbox.h> |
2 | #include <qspinbox.h> | 2 | #include <qspinbox.h> |
3 | 3 | ||
4 | #include <qpe/config.h> | 4 | #include <qpe/config.h> |
5 | 5 | ||
6 | #include "settingsdialog.h" | 6 | #include "settingsdialog.h" |
7 | 7 | ||
8 | 8 | ||
9 | SettingsDialog::SettingsDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) | 9 | SettingsDialog::SettingsDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) |
10 | : SettingsDialogUI( parent, name, modal, fl ) { | 10 | : SettingsDialogUI( parent, name, modal, fl ) { |
11 | 11 | ||
12 | readConfig(); | 12 | readConfig(); |
13 | } | 13 | } |
14 | 14 | ||
15 | SettingsDialog::~SettingsDialog() { | 15 | SettingsDialog::~SettingsDialog() { |
16 | 16 | ||
17 | } | 17 | } |
18 | 18 | ||
19 | void SettingsDialog::readConfig() { | 19 | void SettingsDialog::readConfig() { |
20 | Config cfg("mail"); | 20 | Config cfg("mail"); |
21 | cfg.setGroup( "Settings" ); | 21 | cfg.setGroup( "Settings" ); |
22 | showHtmlButton->setChecked( cfg.readBoolEntry( "showHtml", false ) ); | 22 | showHtmlButton->setChecked( cfg.readBoolEntry( "showHtml", false ) ); |
23 | clickOpenMailButton->setChecked(cfg.readBoolEntry("clickOpensMail",true)); | ||
24 | clickOpenFolderButton->setChecked(cfg.readBoolEntry("clickOpensFolder",true)); | ||
23 | cfg.setGroup( "Compose" ); | 25 | cfg.setGroup( "Compose" ); |
24 | checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) ); | 26 | checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) ); |
25 | cfg.setGroup( "Applet" ); | 27 | cfg.setGroup( "Applet" ); |
26 | cbEnableTaskbarApplet->setChecked( cfg.readBoolEntry( "Disabled", false ) ); | 28 | cbEnableTaskbarApplet->setChecked( cfg.readBoolEntry( "Disabled", false ) ); |
27 | spCheckOften->setValue( cfg.readNumEntry( "CheckEvery", 5 ) ); | 29 | spCheckOften->setValue( cfg.readNumEntry( "CheckEvery", 5 ) ); |
28 | cbBlinkLed->setChecked( cfg.readBoolEntry( "BlinkLed", true ) ); | 30 | cbBlinkLed->setChecked( cfg.readBoolEntry( "BlinkLed", true ) ); |
29 | cbPlaySound->setChecked( cfg.readBoolEntry( "PlaySound", false ) ); | 31 | cbPlaySound->setChecked( cfg.readBoolEntry( "PlaySound", false ) ); |
30 | 32 | ||
31 | } | 33 | } |
32 | 34 | ||
33 | void SettingsDialog::writeConfig() { | 35 | void SettingsDialog::writeConfig() { |
34 | Config cfg( "mail" ); | 36 | Config cfg( "mail" ); |
35 | cfg.setGroup( "Settings" ); | 37 | cfg.setGroup( "Settings" ); |
38 | cfg.writeEntry("clickOpensMail",clickOpenMailButton->isChecked()); | ||
39 | cfg.writeEntry("clickOpensFolder",clickOpenFolderButton->isChecked()); | ||
36 | cfg.writeEntry( "showHtml", showHtmlButton->isChecked() ); | 40 | cfg.writeEntry( "showHtml", showHtmlButton->isChecked() ); |
37 | cfg.setGroup( "Compose" ); | 41 | cfg.setGroup( "Compose" ); |
38 | cfg.writeEntry( "sendLater", checkBoxLater->isChecked() ); | 42 | cfg.writeEntry( "sendLater", checkBoxLater->isChecked() ); |
39 | cfg.setGroup( "Applet" ); | 43 | cfg.setGroup( "Applet" ); |
40 | cfg.writeEntry( "Disabled", cbEnableTaskbarApplet->isChecked() ); | 44 | cfg.writeEntry( "Disabled", cbEnableTaskbarApplet->isChecked() ); |
41 | int check = spCheckOften->value(); | 45 | int check = spCheckOften->value(); |
42 | if (check<1)check=1;if (check>99)check=99; | 46 | if (check<1)check=1;if (check>99)check=99; |
43 | cfg.writeEntry( "CheckEvery", check); | 47 | cfg.writeEntry( "CheckEvery", check); |
44 | cfg.writeEntry( "BlinkLed", cbBlinkLed->isChecked() ); | 48 | cfg.writeEntry( "BlinkLed", cbBlinkLed->isChecked() ); |
45 | cfg.writeEntry( "PlaySound", cbPlaySound->isChecked() ); | 49 | cfg.writeEntry( "PlaySound", cbPlaySound->isChecked() ); |
46 | } | 50 | } |
47 | 51 | ||
48 | void SettingsDialog::accept() { | 52 | void SettingsDialog::accept() { |
49 | writeConfig(); | 53 | writeConfig(); |
50 | QDialog::accept(); | 54 | QDialog::accept(); |
51 | } | 55 | } |
diff --git a/noncore/net/mail/settingsdialogui.ui b/noncore/net/mail/settingsdialogui.ui index 4acd84a..0a97da0 100644 --- a/noncore/net/mail/settingsdialogui.ui +++ b/noncore/net/mail/settingsdialogui.ui | |||
@@ -1,280 +1,302 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>SettingsDialogUI</class> | 2 | <class>SettingsDialogUI</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QDialog</class> | 4 | <class>QDialog</class> |
5 | <property stdset="1"> | 5 | <property stdset="1"> |
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>SettingsDialogUI</cstring> | 7 | <cstring>SettingsDialogUI</cstring> |
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>312</width> | 14 | <width>304</width> |
15 | <height>379</height> | 15 | <height>378</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
19 | <name>caption</name> | 19 | <name>caption</name> |
20 | <string>Settings Dialog</string> | 20 | <string>Settings Dialog</string> |
21 | </property> | 21 | </property> |
22 | <property> | 22 | <property> |
23 | <name>layoutMargin</name> | 23 | <name>layoutMargin</name> |
24 | </property> | 24 | </property> |
25 | <property> | 25 | <property> |
26 | <name>layoutSpacing</name> | 26 | <name>layoutSpacing</name> |
27 | </property> | 27 | </property> |
28 | <vbox> | 28 | <vbox> |
29 | <property stdset="1"> | 29 | <property stdset="1"> |
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>3</number> | 31 | <number>3</number> |
32 | </property> | 32 | </property> |
33 | <property stdset="1"> | 33 | <property stdset="1"> |
34 | <name>spacing</name> | 34 | <name>spacing</name> |
35 | <number>3</number> | 35 | <number>3</number> |
36 | </property> | 36 | </property> |
37 | <widget> | 37 | <widget> |
38 | <class>QTabWidget</class> | 38 | <class>QTabWidget</class> |
39 | <property stdset="1"> | 39 | <property stdset="1"> |
40 | <name>name</name> | 40 | <name>name</name> |
41 | <cstring>TabWidget2</cstring> | 41 | <cstring>TabWidget2</cstring> |
42 | </property> | 42 | </property> |
43 | <property> | 43 | <property> |
44 | <name>layoutMargin</name> | 44 | <name>layoutMargin</name> |
45 | </property> | 45 | </property> |
46 | <property> | 46 | <property> |
47 | <name>layoutSpacing</name> | 47 | <name>layoutSpacing</name> |
48 | </property> | 48 | </property> |
49 | <widget> | 49 | <widget> |
50 | <class>QWidget</class> | 50 | <class>QWidget</class> |
51 | <property stdset="1"> | 51 | <property stdset="1"> |
52 | <name>name</name> | 52 | <name>name</name> |
53 | <cstring>tab</cstring> | 53 | <cstring>tab</cstring> |
54 | </property> | 54 | </property> |
55 | <attribute> | 55 | <attribute> |
56 | <name>title</name> | 56 | <name>title</name> |
57 | <string>View Mail</string> | 57 | <string>View Mail</string> |
58 | </attribute> | 58 | </attribute> |
59 | <vbox> | 59 | <vbox> |
60 | <property stdset="1"> | 60 | <property stdset="1"> |
61 | <name>margin</name> | 61 | <name>margin</name> |
62 | <number>3</number> | 62 | <number>11</number> |
63 | </property> | 63 | </property> |
64 | <property stdset="1"> | 64 | <property stdset="1"> |
65 | <name>spacing</name> | 65 | <name>spacing</name> |
66 | <number>3</number> | 66 | <number>6</number> |
67 | </property> | 67 | </property> |
68 | <widget> | 68 | <widget> |
69 | <class>QCheckBox</class> | 69 | <class>QCheckBox</class> |
70 | <property stdset="1"> | 70 | <property stdset="1"> |
71 | <name>name</name> | 71 | <name>name</name> |
72 | <cstring>showHtmlButton</cstring> | 72 | <cstring>showHtmlButton</cstring> |
73 | </property> | 73 | </property> |
74 | <property stdset="1"> | 74 | <property stdset="1"> |
75 | <name>text</name> | 75 | <name>text</name> |
76 | <string>View mail as Html</string> | 76 | <string>View mail as Html</string> |
77 | </property> | 77 | </property> |
78 | </widget> | 78 | </widget> |
79 | <widget> | ||
80 | <class>QCheckBox</class> | ||
81 | <property stdset="1"> | ||
82 | <name>name</name> | ||
83 | <cstring>clickOpenMailButton</cstring> | ||
84 | </property> | ||
85 | <property stdset="1"> | ||
86 | <name>text</name> | ||
87 | <string>Click opens mail</string> | ||
88 | </property> | ||
89 | </widget> | ||
90 | <widget> | ||
91 | <class>QCheckBox</class> | ||
92 | <property stdset="1"> | ||
93 | <name>name</name> | ||
94 | <cstring>clickOpenFolderButton</cstring> | ||
95 | </property> | ||
96 | <property stdset="1"> | ||
97 | <name>text</name> | ||
98 | <string>Click activate server/folder</string> | ||
99 | </property> | ||
100 | </widget> | ||
79 | <spacer> | 101 | <spacer> |
80 | <property> | 102 | <property> |
81 | <name>name</name> | 103 | <name>name</name> |
82 | <cstring>Spacer1</cstring> | 104 | <cstring>Spacer1</cstring> |
83 | </property> | 105 | </property> |
84 | <property stdset="1"> | 106 | <property stdset="1"> |
85 | <name>orientation</name> | 107 | <name>orientation</name> |
86 | <enum>Vertical</enum> | 108 | <enum>Vertical</enum> |
87 | </property> | 109 | </property> |
88 | <property stdset="1"> | 110 | <property stdset="1"> |
89 | <name>sizeType</name> | 111 | <name>sizeType</name> |
90 | <enum>Expanding</enum> | 112 | <enum>Expanding</enum> |
91 | </property> | 113 | </property> |
92 | <property> | 114 | <property> |
93 | <name>sizeHint</name> | 115 | <name>sizeHint</name> |
94 | <size> | 116 | <size> |
95 | <width>20</width> | 117 | <width>20</width> |
96 | <height>20</height> | 118 | <height>20</height> |
97 | </size> | 119 | </size> |
98 | </property> | 120 | </property> |
99 | </spacer> | 121 | </spacer> |
100 | </vbox> | 122 | </vbox> |
101 | </widget> | 123 | </widget> |
102 | <widget> | 124 | <widget> |
103 | <class>QWidget</class> | 125 | <class>QWidget</class> |
104 | <property stdset="1"> | 126 | <property stdset="1"> |
105 | <name>name</name> | 127 | <name>name</name> |
106 | <cstring>tab</cstring> | 128 | <cstring>tab</cstring> |
107 | </property> | 129 | </property> |
108 | <attribute> | 130 | <attribute> |
109 | <name>title</name> | 131 | <name>title</name> |
110 | <string>Compose Mail</string> | 132 | <string>Compose Mail</string> |
111 | </attribute> | 133 | </attribute> |
112 | <vbox> | 134 | <vbox> |
113 | <property stdset="1"> | 135 | <property stdset="1"> |
114 | <name>margin</name> | 136 | <name>margin</name> |
115 | <number>3</number> | 137 | <number>3</number> |
116 | </property> | 138 | </property> |
117 | <property stdset="1"> | 139 | <property stdset="1"> |
118 | <name>spacing</name> | 140 | <name>spacing</name> |
119 | <number>3</number> | 141 | <number>3</number> |
120 | </property> | 142 | </property> |
121 | <widget> | 143 | <widget> |
122 | <class>QCheckBox</class> | 144 | <class>QCheckBox</class> |
123 | <property stdset="1"> | 145 | <property stdset="1"> |
124 | <name>name</name> | 146 | <name>name</name> |
125 | <cstring>checkBoxLater</cstring> | 147 | <cstring>checkBoxLater</cstring> |
126 | </property> | 148 | </property> |
127 | <property stdset="1"> | 149 | <property stdset="1"> |
128 | <name>text</name> | 150 | <name>text</name> |
129 | <string>Send mails later ( enqueue in outbox )</string> | 151 | <string>Send mails later ( enqueue in outbox )</string> |
130 | </property> | 152 | </property> |
131 | </widget> | 153 | </widget> |
132 | <spacer> | 154 | <spacer> |
133 | <property> | 155 | <property> |
134 | <name>name</name> | 156 | <name>name</name> |
135 | <cstring>Spacer2</cstring> | 157 | <cstring>Spacer2</cstring> |
136 | </property> | 158 | </property> |
137 | <property stdset="1"> | 159 | <property stdset="1"> |
138 | <name>orientation</name> | 160 | <name>orientation</name> |
139 | <enum>Vertical</enum> | 161 | <enum>Vertical</enum> |
140 | </property> | 162 | </property> |
141 | <property stdset="1"> | 163 | <property stdset="1"> |
142 | <name>sizeType</name> | 164 | <name>sizeType</name> |
143 | <enum>Expanding</enum> | 165 | <enum>Expanding</enum> |
144 | </property> | 166 | </property> |
145 | <property> | 167 | <property> |
146 | <name>sizeHint</name> | 168 | <name>sizeHint</name> |
147 | <size> | 169 | <size> |
148 | <width>20</width> | 170 | <width>20</width> |
149 | <height>20</height> | 171 | <height>20</height> |
150 | </size> | 172 | </size> |
151 | </property> | 173 | </property> |
152 | </spacer> | 174 | </spacer> |
153 | </vbox> | 175 | </vbox> |
154 | </widget> | 176 | </widget> |
155 | <widget> | 177 | <widget> |
156 | <class>QWidget</class> | 178 | <class>QWidget</class> |
157 | <property stdset="1"> | 179 | <property stdset="1"> |
158 | <name>name</name> | 180 | <name>name</name> |
159 | <cstring>tab</cstring> | 181 | <cstring>tab</cstring> |
160 | </property> | 182 | </property> |
161 | <attribute> | 183 | <attribute> |
162 | <name>title</name> | 184 | <name>title</name> |
163 | <string>Taskbar Applet</string> | 185 | <string>Taskbar Applet</string> |
164 | </attribute> | 186 | </attribute> |
165 | <vbox> | 187 | <vbox> |
166 | <property stdset="1"> | 188 | <property stdset="1"> |
167 | <name>margin</name> | 189 | <name>margin</name> |
168 | <number>3</number> | 190 | <number>3</number> |
169 | </property> | 191 | </property> |
170 | <property stdset="1"> | 192 | <property stdset="1"> |
171 | <name>spacing</name> | 193 | <name>spacing</name> |
172 | <number>3</number> | 194 | <number>3</number> |
173 | </property> | 195 | </property> |
174 | <widget> | 196 | <widget> |
175 | <class>QCheckBox</class> | 197 | <class>QCheckBox</class> |
176 | <property stdset="1"> | 198 | <property stdset="1"> |
177 | <name>name</name> | 199 | <name>name</name> |
178 | <cstring>cbEnableTaskbarApplet</cstring> | 200 | <cstring>cbEnableTaskbarApplet</cstring> |
179 | </property> | 201 | </property> |
180 | <property stdset="1"> | 202 | <property stdset="1"> |
181 | <name>text</name> | 203 | <name>text</name> |
182 | <string>Disable Taskbar Applet</string> | 204 | <string>Disable Taskbar Applet</string> |
183 | </property> | 205 | </property> |
184 | </widget> | 206 | </widget> |
185 | <widget> | 207 | <widget> |
186 | <class>QLayoutWidget</class> | 208 | <class>QLayoutWidget</class> |
187 | <property stdset="1"> | 209 | <property stdset="1"> |
188 | <name>name</name> | 210 | <name>name</name> |
189 | <cstring>Layout2</cstring> | 211 | <cstring>Layout2</cstring> |
190 | </property> | 212 | </property> |
191 | <hbox> | 213 | <hbox> |
192 | <property stdset="1"> | 214 | <property stdset="1"> |
193 | <name>margin</name> | 215 | <name>margin</name> |
194 | <number>0</number> | 216 | <number>0</number> |
195 | </property> | 217 | </property> |
196 | <property stdset="1"> | 218 | <property stdset="1"> |
197 | <name>spacing</name> | 219 | <name>spacing</name> |
198 | <number>6</number> | 220 | <number>6</number> |
199 | </property> | 221 | </property> |
200 | <widget> | 222 | <widget> |
201 | <class>QSpinBox</class> | 223 | <class>QSpinBox</class> |
202 | <property stdset="1"> | 224 | <property stdset="1"> |
203 | <name>name</name> | 225 | <name>name</name> |
204 | <cstring>spCheckOften</cstring> | 226 | <cstring>spCheckOften</cstring> |
205 | </property> | 227 | </property> |
206 | <property stdset="1"> | 228 | <property stdset="1"> |
207 | <name>suffix</name> | 229 | <name>suffix</name> |
208 | <string> min</string> | 230 | <string> min</string> |
209 | </property> | 231 | </property> |
210 | <property stdset="1"> | 232 | <property stdset="1"> |
211 | <name>minValue</name> | 233 | <name>minValue</name> |
212 | <number>1</number> | 234 | <number>1</number> |
213 | </property> | 235 | </property> |
214 | <property stdset="1"> | 236 | <property stdset="1"> |
215 | <name>value</name> | 237 | <name>value</name> |
216 | <number>5</number> | 238 | <number>5</number> |
217 | </property> | 239 | </property> |
218 | </widget> | 240 | </widget> |
219 | <widget> | 241 | <widget> |
220 | <class>QLabel</class> | 242 | <class>QLabel</class> |
221 | <property stdset="1"> | 243 | <property stdset="1"> |
222 | <name>name</name> | 244 | <name>name</name> |
223 | <cstring>TextLabel1</cstring> | 245 | <cstring>TextLabel1</cstring> |
224 | </property> | 246 | </property> |
225 | <property stdset="1"> | 247 | <property stdset="1"> |
226 | <name>text</name> | 248 | <name>text</name> |
227 | <string>Check how often</string> | 249 | <string>Check how often</string> |
228 | </property> | 250 | </property> |
229 | </widget> | 251 | </widget> |
230 | </hbox> | 252 | </hbox> |
231 | </widget> | 253 | </widget> |
232 | <widget> | 254 | <widget> |
233 | <class>QCheckBox</class> | 255 | <class>QCheckBox</class> |
234 | <property stdset="1"> | 256 | <property stdset="1"> |
235 | <name>name</name> | 257 | <name>name</name> |
236 | <cstring>cbBlinkLed</cstring> | 258 | <cstring>cbBlinkLed</cstring> |
237 | </property> | 259 | </property> |
238 | <property stdset="1"> | 260 | <property stdset="1"> |
239 | <name>text</name> | 261 | <name>text</name> |
240 | <string>Blink Led when new mails arrive</string> | 262 | <string>Blink Led when new mails arrive</string> |
241 | </property> | 263 | </property> |
242 | </widget> | 264 | </widget> |
243 | <widget> | 265 | <widget> |
244 | <class>QCheckBox</class> | 266 | <class>QCheckBox</class> |
245 | <property stdset="1"> | 267 | <property stdset="1"> |
246 | <name>name</name> | 268 | <name>name</name> |
247 | <cstring>cbPlaySound</cstring> | 269 | <cstring>cbPlaySound</cstring> |
248 | </property> | 270 | </property> |
249 | <property stdset="1"> | 271 | <property stdset="1"> |
250 | <name>text</name> | 272 | <name>text</name> |
251 | <string>Play Sound when new mails arrive</string> | 273 | <string>Play Sound when new mails arrive</string> |
252 | </property> | 274 | </property> |
253 | </widget> | 275 | </widget> |
254 | <spacer> | 276 | <spacer> |
255 | <property> | 277 | <property> |
256 | <name>name</name> | 278 | <name>name</name> |
257 | <cstring>Spacer3</cstring> | 279 | <cstring>Spacer3</cstring> |
258 | </property> | 280 | </property> |
259 | <property stdset="1"> | 281 | <property stdset="1"> |
260 | <name>orientation</name> | 282 | <name>orientation</name> |
261 | <enum>Vertical</enum> | 283 | <enum>Vertical</enum> |
262 | </property> | 284 | </property> |
263 | <property stdset="1"> | 285 | <property stdset="1"> |
264 | <name>sizeType</name> | 286 | <name>sizeType</name> |
265 | <enum>Expanding</enum> | 287 | <enum>Expanding</enum> |
266 | </property> | 288 | </property> |
267 | <property> | 289 | <property> |
268 | <name>sizeHint</name> | 290 | <name>sizeHint</name> |
269 | <size> | 291 | <size> |
270 | <width>20</width> | 292 | <width>20</width> |
271 | <height>20</height> | 293 | <height>20</height> |
272 | </size> | 294 | </size> |
273 | </property> | 295 | </property> |
274 | </spacer> | 296 | </spacer> |
275 | </vbox> | 297 | </vbox> |
276 | </widget> | 298 | </widget> |
277 | </widget> | 299 | </widget> |
278 | </vbox> | 300 | </vbox> |
279 | </widget> | 301 | </widget> |
280 | </UI> | 302 | </UI> |