author | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
commit | b6b1c97559c0ed9f2e33632272426bf98f289232 (patch) (unidiff) | |
tree | d3a9987704770cdf5eb14e1136f6e3ecb2f36a04 /noncore/unsupported | |
parent | 0d59c780513da78033f4d9040475dee9db0256d4 (diff) | |
download | opie-b6b1c97559c0ed9f2e33632272426bf98f289232.zip opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.gz opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.bz2 |
applied the patch generated by the optimize_connect script from
TT.
21 files changed, 129 insertions, 129 deletions
diff --git a/noncore/unsupported/filebrowser/filebrowser.cpp b/noncore/unsupported/filebrowser/filebrowser.cpp index 8cf8a60..92a688a 100644 --- a/noncore/unsupported/filebrowser/filebrowser.cpp +++ b/noncore/unsupported/filebrowser/filebrowser.cpp | |||
@@ -247,36 +247,36 @@ FileView::FileView( const QString & dir, QWidget * parent, | |||
247 | addColumn( "Name" ); | 247 | addColumn( "Name" ); |
248 | addColumn( "Size" ); | 248 | addColumn( "Size" ); |
249 | addColumn( "Date" ); | 249 | addColumn( "Date" ); |
250 | addColumn( "Type" ); | 250 | addColumn( "Type" ); |
251 | 251 | ||
252 | setMultiSelection( TRUE ); | 252 | setMultiSelection( TRUE ); |
253 | //header()->hide(); | 253 | //header()->hide(); |
254 | 254 | ||
255 | setColumnWidthMode( 0, Manual ); | 255 | setColumnWidthMode( 0, Manual ); |
256 | setColumnWidthMode( 3, Manual ); | 256 | setColumnWidthMode( 3, Manual ); |
257 | 257 | ||
258 | // right align yize column | 258 | // right align yize column |
259 | setColumnAlignment( 1, AlignRight ); | 259 | setColumnAlignment( 1, AlignRight ); |
260 | 260 | ||
261 | generateDir( dir ); | 261 | generateDir( dir ); |
262 | 262 | ||
263 | connect( this, SIGNAL( clicked( QListViewItem * )), | 263 | connect( this, SIGNAL( clicked(QListViewItem*)), |
264 | SLOT( itemClicked( QListViewItem * )) ); | 264 | SLOT( itemClicked(QListViewItem*)) ); |
265 | connect( this, SIGNAL( doubleClicked( QListViewItem * )), | 265 | connect( this, SIGNAL( doubleClicked(QListViewItem*)), |
266 | SLOT( itemDblClicked( QListViewItem * )) ); | 266 | SLOT( itemDblClicked(QListViewItem*)) ); |
267 | connect( this, SIGNAL( selectionChanged() ), SLOT( cancelMenuTimer() ) ); | 267 | connect( this, SIGNAL( selectionChanged() ), SLOT( cancelMenuTimer() ) ); |
268 | connect( &menuTimer, SIGNAL( timeout() ), SLOT( showFileMenu() ) ); | 268 | connect( &menuTimer, SIGNAL( timeout() ), SLOT( showFileMenu() ) ); |
269 | } | 269 | } |
270 | 270 | ||
271 | void FileView::resizeEvent( QResizeEvent *e ) | 271 | void FileView::resizeEvent( QResizeEvent *e ) |
272 | { | 272 | { |
273 | setColumnWidth( 0, width() - 2 * lineWidth() - 20 - columnWidth( 1 ) - columnWidth( 2 ) ); | 273 | setColumnWidth( 0, width() - 2 * lineWidth() - 20 - columnWidth( 1 ) - columnWidth( 2 ) ); |
274 | 274 | ||
275 | // hide type column, we use it for "sort by type" only | 275 | // hide type column, we use it for "sort by type" only |
276 | //setColumnWidth( 3, 0 ); | 276 | //setColumnWidth( 3, 0 ); |
277 | QListView::resizeEvent( e ); | 277 | QListView::resizeEvent( e ); |
278 | } | 278 | } |
279 | 279 | ||
280 | void FileView::updateDir() | 280 | void FileView::updateDir() |
281 | { | 281 | { |
282 | generateDir( currentDir ); | 282 | generateDir( currentDir ); |
@@ -895,34 +895,34 @@ void FileBrowser::init(const QString & dir) | |||
895 | a = new QAction( tr("Copy"), Resource::loadPixmap( "copy" ), | 895 | a = new QAction( tr("Copy"), Resource::loadPixmap( "copy" ), |
896 | QString::null, 0, this, 0 ); | 896 | QString::null, 0, this, 0 ); |
897 | connect( a, SIGNAL( activated() ), fileView, SLOT( copy() ) ); | 897 | connect( a, SIGNAL( activated() ), fileView, SLOT( copy() ) ); |
898 | a->addTo( toolBar ); | 898 | a->addTo( toolBar ); |
899 | 899 | ||
900 | pasteAction = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ), | 900 | pasteAction = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ), |
901 | QString::null, 0, this, 0 ); | 901 | QString::null, 0, this, 0 ); |
902 | connect( pasteAction, SIGNAL( activated() ), fileView, SLOT( paste() ) ); | 902 | connect( pasteAction, SIGNAL( activated() ), fileView, SLOT( paste() ) ); |
903 | pasteAction->addTo( toolBar ); | 903 | pasteAction->addTo( toolBar ); |
904 | 904 | ||
905 | // dirLabel = new QLabel(this, "DirLabel"); | 905 | // dirLabel = new QLabel(this, "DirLabel"); |
906 | 906 | ||
907 | connect( fileView, SIGNAL( dirChanged() ), SLOT( updateDirMenu() ) ); | 907 | connect( fileView, SIGNAL( dirChanged() ), SLOT( updateDirMenu() ) ); |
908 | updateDirMenu(); | 908 | updateDirMenu(); |
909 | 909 | ||
910 | QCopChannel* pcmciaChannel = new QCopChannel( "QPE/Card", this ); | 910 | QCopChannel* pcmciaChannel = new QCopChannel( "QPE/Card", this ); |
911 | connect( pcmciaChannel, SIGNAL(received(const QCString &, const QByteArray &)), | 911 | connect( pcmciaChannel, SIGNAL(received(const QCString&,const QByteArray&)), |
912 | this, SLOT(pcmciaMessage( const QCString &, const QByteArray &)) ); | 912 | this, SLOT(pcmciaMessage(const QCString&,const QByteArray&)) ); |
913 | } | 913 | } |
914 | 914 | ||
915 | void FileBrowser::pcmciaMessage( const QCString &msg, const QByteArray &) | 915 | void FileBrowser::pcmciaMessage( const QCString &msg, const QByteArray &) |
916 | { | 916 | { |
917 | if ( msg == "mtabChanged()" ) { | 917 | if ( msg == "mtabChanged()" ) { |
918 | // ## Only really needed if current dir is on a card | 918 | // ## Only really needed if current dir is on a card |
919 | fileView->updateDir(); | 919 | fileView->updateDir(); |
920 | } | 920 | } |
921 | } | 921 | } |
922 | 922 | ||
923 | void FileBrowser::changeCaption(const QString & dir) { | 923 | void FileBrowser::changeCaption(const QString & dir) { |
924 | setCaption( dir); | 924 | setCaption( dir); |
925 | } | 925 | } |
926 | 926 | ||
927 | void FileBrowser::dirSelected( int id ) | 927 | void FileBrowser::dirSelected( int id ) |
928 | { | 928 | { |
diff --git a/noncore/unsupported/gsmtool/gsmtool.cpp b/noncore/unsupported/gsmtool/gsmtool.cpp index 5940b0e..47920e5 100644 --- a/noncore/unsupported/gsmtool/gsmtool.cpp +++ b/noncore/unsupported/gsmtool/gsmtool.cpp | |||
@@ -24,36 +24,36 @@ using namespace gsmlib; | |||
24 | */ | 24 | */ |
25 | GSMTool::GSMTool( QWidget* parent, const char* name, WFlags fl ) | 25 | GSMTool::GSMTool( QWidget* parent, const char* name, WFlags fl ) |
26 | : GSMToolBase( parent, name, fl ) | 26 | : GSMToolBase( parent, name, fl ) |
27 | { | 27 | { |
28 | devicelocked = 0; | 28 | devicelocked = 0; |
29 | me = NULL; | 29 | me = NULL; |
30 | sms_store = NULL; | 30 | sms_store = NULL; |
31 | setConnected(FALSE); | 31 | setConnected(FALSE); |
32 | /* FIXME: Persistent settings for device/baudrate */ | 32 | /* FIXME: Persistent settings for device/baudrate */ |
33 | connect(ConnectButton, SIGNAL(clicked()), this, SLOT(doConnectButton())); | 33 | connect(ConnectButton, SIGNAL(clicked()), this, SLOT(doConnectButton())); |
34 | connect(SMSDeleteButton, SIGNAL(clicked()), this, SLOT(doSMSDeleteButton())); | 34 | connect(SMSDeleteButton, SIGNAL(clicked()), this, SLOT(doSMSDeleteButton())); |
35 | connect(SMSSendButton, SIGNAL(clicked()), this, SLOT(doSMSSendButton())); | 35 | connect(SMSSendButton, SIGNAL(clicked()), this, SLOT(doSMSSendButton())); |
36 | connect(NewSMSClearButton, SIGNAL(clicked()), this, SLOT(doNewSMSClearButton())); | 36 | connect(NewSMSClearButton, SIGNAL(clicked()), this, SLOT(doNewSMSClearButton())); |
37 | connect(NewSMSSaveButton, SIGNAL(clicked()), this, SLOT(doNewSMSSaveButton())); | 37 | connect(NewSMSSaveButton, SIGNAL(clicked()), this, SLOT(doNewSMSSaveButton())); |
38 | connect(NewSMSSendButton, SIGNAL(clicked()), this, SLOT(doNewSMSSendButton())); | 38 | connect(NewSMSSendButton, SIGNAL(clicked()), this, SLOT(doNewSMSSendButton())); |
39 | connect(ScanButton, SIGNAL(clicked()), this, SLOT(doScanButton())); | 39 | connect(ScanButton, SIGNAL(clicked()), this, SLOT(doScanButton())); |
40 | connect(TabWidget2, SIGNAL(currentChanged(QWidget *)), this, SLOT(doTabChanged())); | 40 | connect(TabWidget2, SIGNAL(currentChanged(QWidget*)), this, SLOT(doTabChanged())); |
41 | connect(SMSStoreList, SIGNAL(activated(int)), this, SLOT(doSMSStoreChanged())); | 41 | connect(SMSStoreList, SIGNAL(activated(int)), this, SLOT(doSMSStoreChanged())); |
42 | connect(SMSViewType, SIGNAL(activated(int)), this, SLOT(doSMSTypeChanged())); | 42 | connect(SMSViewType, SIGNAL(activated(int)), this, SLOT(doSMSTypeChanged())); |
43 | connect(SMSList, SIGNAL(selectionChanged(QListViewItem *)), this, SLOT(doSelectedSMSChanged(QListViewItem *))); | 43 | connect(SMSList, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(doSelectedSMSChanged(QListViewItem*))); |
44 | timerid = -1; // Is this not possible normally? | 44 | timerid = -1; // Is this not possible normally? |
45 | } | 45 | } |
46 | 46 | ||
47 | /* | 47 | /* |
48 | * Destroys the object and frees any allocated resources | 48 | * Destroys the object and frees any allocated resources |
49 | */ | 49 | */ |
50 | GSMTool::~GSMTool() | 50 | GSMTool::~GSMTool() |
51 | { | 51 | { |
52 | // no need to delete child widgets, Qt does it all for us | 52 | // no need to delete child widgets, Qt does it all for us |
53 | if (devicelocked) | 53 | if (devicelocked) |
54 | unlockDevice(); | 54 | unlockDevice(); |
55 | } | 55 | } |
56 | const speed_t GSMTool::baudrates[12] = { | 56 | const speed_t GSMTool::baudrates[12] = { |
57 | B300, B600, B1200, B2400, B4800, B9600, B19200, | 57 | B300, B600, B1200, B2400, B4800, B9600, B19200, |
58 | B38400, B57600, B115200, B230400, B460800 | 58 | B38400, B57600, B115200, B230400, B460800 |
59 | }; | 59 | }; |
diff --git a/noncore/unsupported/mail2/bend/bend.cpp b/noncore/unsupported/mail2/bend/bend.cpp index e2ece2a..ab6eb45 100644 --- a/noncore/unsupported/mail2/bend/bend.cpp +++ b/noncore/unsupported/mail2/bend/bend.cpp | |||
@@ -73,41 +73,41 @@ void BenD::slotCheck() | |||
73 | #ifndef QT_NO_DEBUG | 73 | #ifndef QT_NO_DEBUG |
74 | qWarning("BenD: Detected interval change"); | 74 | qWarning("BenD: Detected interval change"); |
75 | #endif | 75 | #endif |
76 | } | 76 | } |
77 | 77 | ||
78 | QValueList<Account> acList = ConfigFile::getAccounts(); | 78 | QValueList<Account> acList = ConfigFile::getAccounts(); |
79 | QValueList<Account>::Iterator ot; | 79 | QValueList<Account>::Iterator ot; |
80 | for (ot = acList.begin(); ot != acList.end(); ot++) { | 80 | for (ot = acList.begin(); ot != acList.end(); ot++) { |
81 | if (!((*ot).imapServer().isEmpty() || | 81 | if (!((*ot).imapServer().isEmpty() || |
82 | (*ot).imapPort().isEmpty() || | 82 | (*ot).imapPort().isEmpty() || |
83 | (*ot).user().isEmpty() || | 83 | (*ot).user().isEmpty() || |
84 | (*ot).pass().isEmpty())) { | 84 | (*ot).pass().isEmpty())) { |
85 | if (!((*ot).imapSsl() && | 85 | if (!((*ot).imapSsl() && |
86 | (*ot).imapSslPort().isEmpty())) { | 86 | (*ot).imapSslPort().isEmpty())) { |
87 | IMAPHandler *handler = new IMAPHandler(*ot); | 87 | IMAPHandler *handler = new IMAPHandler(*ot); |
88 | handler->iStatus("INBOX", "RECENT"); | 88 | handler->iStatus("INBOX", "RECENT"); |
89 | connect(handler, SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPStatus(IMAPResponse &))); | 89 | connect(handler, SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPStatus(IMAPResponse&))); |
90 | } | 90 | } |
91 | } | 91 | } |
92 | } | 92 | } |
93 | } | 93 | } |
94 | 94 | ||
95 | void BenD::slotIMAPStatus(IMAPResponse &response) | 95 | void BenD::slotIMAPStatus(IMAPResponse &response) |
96 | { | 96 | { |
97 | disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPStatus(IMAPResponse &))); | 97 | disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPStatus(IMAPResponse&))); |
98 | 98 | ||
99 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { | 99 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { |
100 | if (response.STATUS()[0].recent().toInt() > 0) { | 100 | if (response.STATUS()[0].recent().toInt() > 0) { |
101 | ODevice *device = ODevice::inst(); | 101 | ODevice *device = ODevice::inst(); |
102 | if (isHidden()) show(); | 102 | if (isHidden()) show(); |
103 | if (_config->readBoolEntry("BlinkLed", true)) { | 103 | if (_config->readBoolEntry("BlinkLed", true)) { |
104 | if ( !device-> ledList ( ). isEmpty ( )) { | 104 | if ( !device-> ledList ( ). isEmpty ( )) { |
105 | OLed led = ( device-> ledList ( ). contains ( Led_Mail )) ? Led_Mail : device-> ledList ( ) [0]; | 105 | OLed led = ( device-> ledList ( ). contains ( Led_Mail )) ? Led_Mail : device-> ledList ( ) [0]; |
106 | 106 | ||
107 | device->setLedState(led, device-> ledStateList ( led ). contains ( Led_BlinkSlow ) ? Led_BlinkSlow : Led_On ); | 107 | device->setLedState(led, device-> ledStateList ( led ). contains ( Led_BlinkSlow ) ? Led_BlinkSlow : Led_On ); |
108 | } | 108 | } |
109 | } | 109 | } |
110 | if (_config->readBoolEntry("PlaySound", false)) | 110 | if (_config->readBoolEntry("PlaySound", false)) |
111 | device->alarmSound(); | 111 | device->alarmSound(); |
112 | } else { | 112 | } else { |
113 | ODevice *device = ODevice::inst(); | 113 | ODevice *device = ODevice::inst(); |
diff --git a/noncore/unsupported/mail2/composer.cpp b/noncore/unsupported/mail2/composer.cpp index cb80299..da1aee9 100644 --- a/noncore/unsupported/mail2/composer.cpp +++ b/noncore/unsupported/mail2/composer.cpp | |||
@@ -145,34 +145,34 @@ void Composer::slotSendMail() | |||
145 | QValueList<Attachment> attachments; | 145 | QValueList<Attachment> attachments; |
146 | QListViewItem *item; | 146 | QListViewItem *item; |
147 | for (item = attachView->firstChild(); item != 0; item = item->itemBelow()) { | 147 | for (item = attachView->firstChild(); item != 0; item = item->itemBelow()) { |
148 | attachments.append(((AttachViewItem *)item)->attachment()); | 148 | attachments.append(((AttachViewItem *)item)->attachment()); |
149 | } | 149 | } |
150 | 150 | ||
151 | smail.setAttachments(attachments); | 151 | smail.setAttachments(attachments); |
152 | 152 | ||
153 | QString header, message; | 153 | QString header, message; |
154 | MailFactory::genMail(header, message, smail, this); | 154 | MailFactory::genMail(header, message, smail, this); |
155 | if (header.isNull() || message.isNull()) return;// Aborted. | 155 | if (header.isNull() || message.isNull()) return;// Aborted. |
156 | 156 | ||
157 | status->setStopEnabled(true); | 157 | status->setStopEnabled(true); |
158 | 158 | ||
159 | SmtpHandler *handler = new SmtpHandler(header, message, accountsLoaded[from->currentItem()], to->text()); | 159 | SmtpHandler *handler = new SmtpHandler(header, message, accountsLoaded[from->currentItem()], to->text()); |
160 | connect(handler, SIGNAL(finished()), SLOT(slotSendFinished())); | 160 | connect(handler, SIGNAL(finished()), SLOT(slotSendFinished())); |
161 | connect(handler, SIGNAL(error(const QString &)), SLOT(slotSendError(const QString &))); | 161 | connect(handler, SIGNAL(error(const QString&)), SLOT(slotSendError(const QString&))); |
162 | connect(handler, SIGNAL(status(const QString &)), status, SLOT(setStatusText(const QString &))); | 162 | connect(handler, SIGNAL(status(const QString&)), status, SLOT(setStatusText(const QString&))); |
163 | } | 163 | } |
164 | 164 | ||
165 | void Composer::slotSendQueued() | 165 | void Composer::slotSendQueued() |
166 | { | 166 | { |
167 | int effSendCount = 0; | 167 | int effSendCount = 0; |
168 | qDebug("Sending queued messages"); | 168 | qDebug("Sending queued messages"); |
169 | Config cfg( "mailqueue", Config::User ); | 169 | Config cfg( "mailqueue", Config::User ); |
170 | cfg.setGroup( "Settings" ); | 170 | cfg.setGroup( "Settings" ); |
171 | _sendCount = 0; | 171 | _sendCount = 0; |
172 | _sendError = 0; | 172 | _sendError = 0; |
173 | _toSend = cfg.readNumEntry( "count", 0 ); | 173 | _toSend = cfg.readNumEntry( "count", 0 ); |
174 | 174 | ||
175 | if (_toSend == 0) close(); | 175 | if (_toSend == 0) close(); |
176 | 176 | ||
177 | qDebug("%i messages to send", _toSend); | 177 | qDebug("%i messages to send", _toSend); |
178 | QString str; | 178 | QString str; |
@@ -234,34 +234,34 @@ void Composer::slotSendQueued() | |||
234 | } | 234 | } |
235 | 235 | ||
236 | smail.setAttachments(attachments); | 236 | smail.setAttachments(attachments); |
237 | 237 | ||
238 | qDebug("putting mail together"); | 238 | qDebug("putting mail together"); |
239 | 239 | ||
240 | QString header, message; | 240 | QString header, message; |
241 | MailFactory::genMail(header, message, smail, this); | 241 | MailFactory::genMail(header, message, smail, this); |
242 | if (header.isNull() || message.isNull()) continue;//return;// Aborted. | 242 | if (header.isNull() || message.isNull()) continue;//return;// Aborted. |
243 | 243 | ||
244 | // abort->setEnabled(true); | 244 | // abort->setEnabled(true); |
245 | 245 | ||
246 | qDebug("Sending to %s",toAdr.latin1()); | 246 | qDebug("Sending to %s",toAdr.latin1()); |
247 | SmtpHandler *handler = new SmtpHandler(header, message, accnt ,toAdr); | 247 | SmtpHandler *handler = new SmtpHandler(header, message, accnt ,toAdr); |
248 | effSendCount++; | 248 | effSendCount++; |
249 | connect(handler, SIGNAL(finished()), SLOT(slotSendQueuedFinished())); | 249 | connect(handler, SIGNAL(finished()), SLOT(slotSendQueuedFinished())); |
250 | connect(handler, SIGNAL(error(const QString &)), SLOT(slotSendQueuedError(const QString &))); | 250 | connect(handler, SIGNAL(error(const QString&)), SLOT(slotSendQueuedError(const QString&))); |
251 | connect(handler, SIGNAL(status(const QString &)), status, SLOT(setStatusText(const QString &))); | 251 | connect(handler, SIGNAL(status(const QString&)), status, SLOT(setStatusText(const QString&))); |
252 | 252 | ||
253 | } | 253 | } |
254 | if (effSendCount < _toSend) | 254 | if (effSendCount < _toSend) |
255 | { | 255 | { |
256 | _toSend = effSendCount; | 256 | _toSend = effSendCount; |
257 | QMessageBox::information(this, tr("Error"), tr("<p>There was a problem sending some of the queued mails.</p>"), tr("Ok")); | 257 | QMessageBox::information(this, tr("Error"), tr("<p>There was a problem sending some of the queued mails.</p>"), tr("Ok")); |
258 | } | 258 | } |
259 | } | 259 | } |
260 | 260 | ||
261 | void Composer::slotQueueMail() | 261 | void Composer::slotQueueMail() |
262 | { | 262 | { |
263 | if (to->text().find(QRegExp(".*\\@.*\\..*")) == -1) { | 263 | if (to->text().find(QRegExp(".*\\@.*\\..*")) == -1) { |
264 | QMessageBox::information(this, tr("Error"), tr("<p>You have to specify a recipient.<br>(eg: foo@bar.org)</p>"), tr("Ok")); | 264 | QMessageBox::information(this, tr("Error"), tr("<p>You have to specify a recipient.<br>(eg: foo@bar.org)</p>"), tr("Ok")); |
265 | return; | 265 | return; |
266 | } | 266 | } |
267 | 267 | ||
diff --git a/noncore/unsupported/mail2/folderwidget.cpp b/noncore/unsupported/mail2/folderwidget.cpp index d27968b..a0520b1 100644 --- a/noncore/unsupported/mail2/folderwidget.cpp +++ b/noncore/unsupported/mail2/folderwidget.cpp | |||
@@ -47,33 +47,33 @@ FolderWidget::FolderWidget(QWidget *parent, const char *name, WFlags fl) | |||
47 | setSorting(-1); | 47 | setSorting(-1); |
48 | 48 | ||
49 | QPopupMenu *menu = new QPopupMenu(); | 49 | QPopupMenu *menu = new QPopupMenu(); |
50 | menu->insertItem(tr("Rename"), MENU_RENAME); | 50 | menu->insertItem(tr("Rename"), MENU_RENAME); |
51 | menu->insertItem(tr("Delete"), MENU_DELETE); | 51 | menu->insertItem(tr("Delete"), MENU_DELETE); |
52 | menu->insertItem(tr("Move"), MENU_MOVE); | 52 | menu->insertItem(tr("Move"), MENU_MOVE); |
53 | menu->insertItem(tr("Copy"), MENU_COPY); | 53 | menu->insertItem(tr("Copy"), MENU_COPY); |
54 | menu->insertSeparator(); | 54 | menu->insertSeparator(); |
55 | menu->insertItem(tr("Create folder"), MENU_CREATE); | 55 | menu->insertItem(tr("Create folder"), MENU_CREATE); |
56 | menu->insertSeparator(); | 56 | menu->insertSeparator(); |
57 | menu->insertItem(tr("Rescan folder list"), MENU_RESCAN); | 57 | menu->insertItem(tr("Rescan folder list"), MENU_RESCAN); |
58 | setPopup(menu); | 58 | setPopup(menu); |
59 | 59 | ||
60 | getAccounts(); | 60 | getAccounts(); |
61 | 61 | ||
62 | connect(menu, SIGNAL(activated(int)), SLOT(slotMenuActivated(int))); | 62 | connect(menu, SIGNAL(activated(int)), SLOT(slotMenuActivated(int))); |
63 | connect(this, SIGNAL(clicked(QListViewItem *)), SLOT(slotItemClicked(QListViewItem *))); | 63 | connect(this, SIGNAL(clicked(QListViewItem*)), SLOT(slotItemClicked(QListViewItem*))); |
64 | } | 64 | } |
65 | 65 | ||
66 | FolderWidget::~FolderWidget() | 66 | FolderWidget::~FolderWidget() |
67 | { | 67 | { |
68 | // TODO: Save folder tree. | 68 | // TODO: Save folder tree. |
69 | } | 69 | } |
70 | 70 | ||
71 | void FolderWidget::update() | 71 | void FolderWidget::update() |
72 | { | 72 | { |
73 | getAccounts(); | 73 | getAccounts(); |
74 | } | 74 | } |
75 | 75 | ||
76 | void FolderWidget::getAccounts() | 76 | void FolderWidget::getAccounts() |
77 | { | 77 | { |
78 | clear(); | 78 | clear(); |
79 | 79 | ||
@@ -130,64 +130,64 @@ FolderWidgetItem *FolderWidget::addFolder(Folder &folder, FolderWidgetItem *fold | |||
130 | 130 | ||
131 | void FolderWidget::slotMenuActivated(int itemid) | 131 | void FolderWidget::slotMenuActivated(int itemid) |
132 | { | 132 | { |
133 | if (currentItem() == NULL) { | 133 | if (currentItem() == NULL) { |
134 | QMessageBox::information(this, tr("Error"), tr("<p>Please select an item first.</p>"), tr("Ok")); | 134 | QMessageBox::information(this, tr("Error"), tr("<p>Please select an item first.</p>"), tr("Ok")); |
135 | return; | 135 | return; |
136 | } | 136 | } |
137 | 137 | ||
138 | if (itemid == MENU_RENAME) { | 138 | if (itemid == MENU_RENAME) { |
139 | if (((FolderWidgetItem *)currentItem())->folder().fullName().isEmpty()) return; | 139 | if (((FolderWidgetItem *)currentItem())->folder().fullName().isEmpty()) return; |
140 | 140 | ||
141 | Folder folder = ((FolderWidgetItem *)currentItem())->folder(); | 141 | Folder folder = ((FolderWidgetItem *)currentItem())->folder(); |
142 | QString newName = Rename::rename(folder.fullName(), this); | 142 | QString newName = Rename::rename(folder.fullName(), this); |
143 | if (newName.isNull()) return; | 143 | if (newName.isNull()) return; |
144 | 144 | ||
145 | folder.topFolder().handler()->iRename(folder.fullName(), newName); | 145 | folder.topFolder().handler()->iRename(folder.fullName(), newName); |
146 | connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPRename(IMAPResponse &))); | 146 | connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPRename(IMAPResponse&))); |
147 | } else if (itemid == MENU_DELETE) { | 147 | } else if (itemid == MENU_DELETE) { |
148 | if (((FolderWidgetItem *)currentItem())->folder().fullName().isEmpty()) return; | 148 | if (((FolderWidgetItem *)currentItem())->folder().fullName().isEmpty()) return; |
149 | 149 | ||
150 | Folder folder = ((FolderWidgetItem *)currentItem())->folder(); | 150 | Folder folder = ((FolderWidgetItem *)currentItem())->folder(); |
151 | 151 | ||
152 | int ret = QMessageBox::information(this, tr("Question"), tr("<p>Do you really want to delete <pre>%1</pre>?").arg(folder.fullName()), tr("Yes"), tr("No")); | 152 | int ret = QMessageBox::information(this, tr("Question"), tr("<p>Do you really want to delete <pre>%1</pre>?").arg(folder.fullName()), tr("Yes"), tr("No")); |
153 | if (ret == 1) return; | 153 | if (ret == 1) return; |
154 | 154 | ||
155 | _createFolder = folder; | 155 | _createFolder = folder; |
156 | 156 | ||
157 | folder.topFolder().handler()->iDelete(folder.fullName()); | 157 | folder.topFolder().handler()->iDelete(folder.fullName()); |
158 | connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPDelete(IMAPResponse &))); | 158 | connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPDelete(IMAPResponse&))); |
159 | } else if (itemid == MENU_MOVE) { | 159 | } else if (itemid == MENU_MOVE) { |
160 | 160 | ||
161 | } else if (itemid == MENU_COPY) { | 161 | } else if (itemid == MENU_COPY) { |
162 | 162 | ||
163 | } else if (itemid == MENU_CREATE) { | 163 | } else if (itemid == MENU_CREATE) { |
164 | Folder folder = (((FolderWidgetItem *)currentItem())->folder()); | 164 | Folder folder = (((FolderWidgetItem *)currentItem())->folder()); |
165 | _createFolder = folder; | 165 | _createFolder = folder; |
166 | 166 | ||
167 | QString folderName = Rename::getText(tr("Foldername"), tr("<p>Please enter the name of the new folder.</p>"), this); | 167 | QString folderName = Rename::getText(tr("Foldername"), tr("<p>Please enter the name of the new folder.</p>"), this); |
168 | if (folderName.isNull()) return; | 168 | if (folderName.isNull()) return; |
169 | 169 | ||
170 | folder.topFolder().handler()->iCreate(folder.fullName() + folder.separator() + folderName); | 170 | folder.topFolder().handler()->iCreate(folder.fullName() + folder.separator() + folderName); |
171 | connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPCreate(IMAPResponse &))); | 171 | connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPCreate(IMAPResponse&))); |
172 | } else if (itemid == MENU_RESCAN) { | 172 | } else if (itemid == MENU_RESCAN) { |
173 | Folder folder = (((FolderWidgetItem *)currentItem())->folder()); | 173 | Folder folder = (((FolderWidgetItem *)currentItem())->folder()); |
174 | _rescanAccount = folder.topFolder().account(); | 174 | _rescanAccount = folder.topFolder().account(); |
175 | 175 | ||
176 | folder.topFolder().handler()->iList("", "*"); | 176 | folder.topFolder().handler()->iList("", "*"); |
177 | connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPList(IMAPResponse &))); | 177 | connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPList(IMAPResponse&))); |
178 | } | 178 | } |
179 | } | 179 | } |
180 | 180 | ||
181 | void FolderWidget::slotItemClicked(QListViewItem *item) | 181 | void FolderWidget::slotItemClicked(QListViewItem *item) |
182 | { | 182 | { |
183 | if (item == NULL) return; | 183 | if (item == NULL) return; |
184 | Folder folder = ((FolderWidgetItem *)item)->folder(); | 184 | Folder folder = ((FolderWidgetItem *)item)->folder(); |
185 | if (folder.fullName().isEmpty()) return; | 185 | if (folder.fullName().isEmpty()) return; |
186 | 186 | ||
187 | emit folderSelected(folder); | 187 | emit folderSelected(folder); |
188 | } | 188 | } |
189 | 189 | ||
190 | void FolderWidget::slotIMAPLookingUpHost() | 190 | void FolderWidget::slotIMAPLookingUpHost() |
191 | { | 191 | { |
192 | emit status(tr("Looking up host...")); | 192 | emit status(tr("Looking up host...")); |
193 | emit connecting(); | 193 | emit connecting(); |
@@ -214,87 +214,87 @@ void FolderWidget::slotIMAPError(int error) | |||
214 | QMessageBox::warning(this, tr("Error"), tr("<p>There was an error while reading from the socket.</p>"), tr("Ok")); | 214 | QMessageBox::warning(this, tr("Error"), tr("<p>There was an error while reading from the socket.</p>"), tr("Ok")); |
215 | } else if (error == IMAPBase::IMAPErrLoginFailed) { | 215 | } else if (error == IMAPBase::IMAPErrLoginFailed) { |
216 | QMessageBox::warning(this, tr("Error"), tr("<p>Login failed. Check your password/username.</p>"), tr("Ok")); | 216 | QMessageBox::warning(this, tr("Error"), tr("<p>Login failed. Check your password/username.</p>"), tr("Ok")); |
217 | } else { | 217 | } else { |
218 | QMessageBox::warning(this, tr("Error"), tr("<p>An unknown error was encountered.</p>"), tr("Ok")); | 218 | QMessageBox::warning(this, tr("Error"), tr("<p>An unknown error was encountered.</p>"), tr("Ok")); |
219 | } | 219 | } |
220 | } | 220 | } |
221 | 221 | ||
222 | void FolderWidget::slotIMAPDisconnected() | 222 | void FolderWidget::slotIMAPDisconnected() |
223 | { | 223 | { |
224 | emit status(tr("Disconnected.")); | 224 | emit status(tr("Disconnected.")); |
225 | emit disconnected(); | 225 | emit disconnected(); |
226 | } | 226 | } |
227 | 227 | ||
228 | void FolderWidget::slotIMAPLogin(IMAPResponse &response) | 228 | void FolderWidget::slotIMAPLogin(IMAPResponse &response) |
229 | { | 229 | { |
230 | disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPLogin(IMAPResponse &))); | 230 | disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPLogin(IMAPResponse&))); |
231 | 231 | ||
232 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { | 232 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { |
233 | emit status(tr("Login successful!")); | 233 | emit status(tr("Login successful!")); |
234 | } else { | 234 | } else { |
235 | QMessageBox::warning(this, tr("Error"), tr("<p>Login failed. Go away.</p>"), tr("Ok")); | 235 | QMessageBox::warning(this, tr("Error"), tr("<p>Login failed. Go away.</p>"), tr("Ok")); |
236 | } | 236 | } |
237 | } | 237 | } |
238 | 238 | ||
239 | void FolderWidget::slotIMAPRename(IMAPResponse &response) | 239 | void FolderWidget::slotIMAPRename(IMAPResponse &response) |
240 | { | 240 | { |
241 | disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPRename(IMAPResponse &))); | 241 | disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPRename(IMAPResponse&))); |
242 | 242 | ||
243 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { | 243 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { |
244 | emit status(tr("Renaming successful!")); | 244 | emit status(tr("Renaming successful!")); |
245 | } else { | 245 | } else { |
246 | QMessageBox::warning(this, tr("Error"), tr("<p>Renaming failed. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok")); | 246 | QMessageBox::warning(this, tr("Error"), tr("<p>Renaming failed. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok")); |
247 | } | 247 | } |
248 | } | 248 | } |
249 | 249 | ||
250 | void FolderWidget::slotIMAPDelete(IMAPResponse &response) | 250 | void FolderWidget::slotIMAPDelete(IMAPResponse &response) |
251 | { | 251 | { |
252 | disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPDelete(IMAPResponse &))); | 252 | disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPDelete(IMAPResponse&))); |
253 | 253 | ||
254 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { | 254 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { |
255 | emit status(tr("Deletion successful!")); | 255 | emit status(tr("Deletion successful!")); |
256 | 256 | ||
257 | _rescanAccount = _createFolder.topFolder().account(); | 257 | _rescanAccount = _createFolder.topFolder().account(); |
258 | 258 | ||
259 | _createFolder.topFolder().handler()->iList(".", "*"); | 259 | _createFolder.topFolder().handler()->iList(".", "*"); |
260 | connect(_createFolder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPList(IMAPResponse &))); | 260 | connect(_createFolder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPList(IMAPResponse&))); |
261 | } else { | 261 | } else { |
262 | QMessageBox::warning(this, tr("Error"), tr("<p>Delete failed. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok")); | 262 | QMessageBox::warning(this, tr("Error"), tr("<p>Delete failed. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok")); |
263 | } | 263 | } |
264 | } | 264 | } |
265 | 265 | ||
266 | void FolderWidget::slotIMAPCreate(IMAPResponse &response) | 266 | void FolderWidget::slotIMAPCreate(IMAPResponse &response) |
267 | { | 267 | { |
268 | disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPCreate(IMAPResponse &))); | 268 | disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPCreate(IMAPResponse&))); |
269 | 269 | ||
270 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { | 270 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { |
271 | emit status(tr("Folder created. Rescanning...")); | 271 | emit status(tr("Folder created. Rescanning...")); |
272 | 272 | ||
273 | _rescanAccount = _createFolder.topFolder().account(); | 273 | _rescanAccount = _createFolder.topFolder().account(); |
274 | 274 | ||
275 | _createFolder.topFolder().handler()->iList(".", "*"); | 275 | _createFolder.topFolder().handler()->iList(".", "*"); |
276 | connect(_createFolder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPList(IMAPResponse &))); | 276 | connect(_createFolder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPList(IMAPResponse&))); |
277 | } else { | 277 | } else { |
278 | QMessageBox::warning(this, tr("Error"), tr("<p>The folder could not be created. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok")); | 278 | QMessageBox::warning(this, tr("Error"), tr("<p>The folder could not be created. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok")); |
279 | } | 279 | } |
280 | } | 280 | } |
281 | 281 | ||
282 | void FolderWidget::slotIMAPList(IMAPResponse &response) | 282 | void FolderWidget::slotIMAPList(IMAPResponse &response) |
283 | { | 283 | { |
284 | disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPList(IMAPResponse &))); | 284 | disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPList(IMAPResponse&))); |
285 | 285 | ||
286 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { | 286 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { |
287 | QDir d((QString) getenv("HOME") + "/Applications/mail/foldercache"); | 287 | QDir d((QString) getenv("HOME") + "/Applications/mail/foldercache"); |
288 | if (!d.exists()) { | 288 | if (!d.exists()) { |
289 | system("mkdir -p $HOME/Applications/mail/foldercache"); | 289 | system("mkdir -p $HOME/Applications/mail/foldercache"); |
290 | qWarning("Created $HOME/Applications/mail/foldercache."); | 290 | qWarning("Created $HOME/Applications/mail/foldercache."); |
291 | } | 291 | } |
292 | QFile f((QString) getenv("HOME") + "/Applications/mail/foldercache/foldercache-" + _rescanAccount.accountName()); | 292 | QFile f((QString) getenv("HOME") + "/Applications/mail/foldercache/foldercache-" + _rescanAccount.accountName()); |
293 | if (!f.open(IO_WriteOnly)) { | 293 | if (!f.open(IO_WriteOnly)) { |
294 | QMessageBox::critical(this, tr("Error"), tr("<p>Couldn't open folder cache file for writing!</p>"), tr("Ok")); | 294 | QMessageBox::critical(this, tr("Error"), tr("<p>Couldn't open folder cache file for writing!</p>"), tr("Ok")); |
295 | return; | 295 | return; |
296 | } | 296 | } |
297 | QTextStream t(&f); | 297 | QTextStream t(&f); |
298 | 298 | ||
299 | QValueList<IMAPResponseLIST>::Iterator it; | 299 | QValueList<IMAPResponseLIST>::Iterator it; |
300 | QValueList<IMAPResponseLIST> lists = response.LIST(); | 300 | QValueList<IMAPResponseLIST> lists = response.LIST(); |
diff --git a/noncore/unsupported/mail2/libmail/imaphandler.cpp b/noncore/unsupported/mail2/libmail/imaphandler.cpp index dc97b28..8da0acd 100644 --- a/noncore/unsupported/mail2/libmail/imaphandler.cpp +++ b/noncore/unsupported/mail2/libmail/imaphandler.cpp | |||
@@ -1,30 +1,30 @@ | |||
1 | #include "imapresponse.h" | 1 | #include "imapresponse.h" |
2 | #include "imaphandler.h" | 2 | #include "imaphandler.h" |
3 | #include "imapbase.h" | 3 | #include "imapbase.h" |
4 | 4 | ||
5 | IMAPHandler::IMAPHandler(const Account &account) | 5 | IMAPHandler::IMAPHandler(const Account &account) |
6 | : QObject(), _account(account) | 6 | : QObject(), _account(account) |
7 | { | 7 | { |
8 | _ready = false; | 8 | _ready = false; |
9 | _loggingin = false; | 9 | _loggingin = false; |
10 | _loggedin = false; | 10 | _loggedin = false; |
11 | _tag = 0; | 11 | _tag = 0; |
12 | _ibase = new IMAPBase(account); | 12 | _ibase = new IMAPBase(account); |
13 | 13 | ||
14 | connect(_ibase, SIGNAL(dataReceived(const QString &)), SLOT(slotDataReceived(const QString &))); | 14 | connect(_ibase, SIGNAL(dataReceived(const QString&)), SLOT(slotDataReceived(const QString&))); |
15 | connect(_ibase, SIGNAL(lookingUpHost()), SLOT(slotLookingUpHost())); | 15 | connect(_ibase, SIGNAL(lookingUpHost()), SLOT(slotLookingUpHost())); |
16 | connect(_ibase, SIGNAL(hostFound()), SLOT(slotHostFound())); | 16 | connect(_ibase, SIGNAL(hostFound()), SLOT(slotHostFound())); |
17 | connect(_ibase, SIGNAL(connected()), SLOT(slotConnected())); | 17 | connect(_ibase, SIGNAL(connected()), SLOT(slotConnected())); |
18 | connect(_ibase, SIGNAL(disconnected()), SLOT(slotDisconnected())); | 18 | connect(_ibase, SIGNAL(disconnected()), SLOT(slotDisconnected())); |
19 | connect(_ibase, SIGNAL(error(int)), SLOT(slotError(int))); | 19 | connect(_ibase, SIGNAL(error(int)), SLOT(slotError(int))); |
20 | } | 20 | } |
21 | 21 | ||
22 | void IMAPHandler::doLogin() | 22 | void IMAPHandler::doLogin() |
23 | { | 23 | { |
24 | if (_loggedin) return; | 24 | if (_loggedin) return; |
25 | if (_loggingin) return; | 25 | if (_loggingin) return; |
26 | 26 | ||
27 | _loggingin = true; | 27 | _loggingin = true; |
28 | iLogin(_account.user(), _account.pass()); | 28 | iLogin(_account.user(), _account.pass()); |
29 | } | 29 | } |
30 | 30 | ||
@@ -286,36 +286,36 @@ QString IMAPHandler::escape(const QString &in) | |||
286 | QString IMAPHandler::tag(bool count) | 286 | QString IMAPHandler::tag(bool count) |
287 | { | 287 | { |
288 | return QString("a%1").arg(count ? _tag++ : _tag); | 288 | return QString("a%1").arg(count ? _tag++ : _tag); |
289 | } | 289 | } |
290 | 290 | ||
291 | void IMAPHandler::slotDataReceived(const QString &data) | 291 | void IMAPHandler::slotDataReceived(const QString &data) |
292 | { | 292 | { |
293 | if (!_ready) { | 293 | if (!_ready) { |
294 | // The first data is always the greeting string. | 294 | // The first data is always the greeting string. |
295 | // We can ignore it. | 295 | // We can ignore it. |
296 | _ready = true; | 296 | _ready = true; |
297 | return; | 297 | return; |
298 | } | 298 | } |
299 | 299 | ||
300 | 300 | ||
301 | IMAPResponseParser parser; | 301 | IMAPResponseParser parser; |
302 | //connect ( &parser, SIGNAL( needMoreData ( QString & )), _ibase, SLOT( tryRead ( QString & ))); | 302 | //connect ( &parser, SIGNAL( needMoreData(QString&)), _ibase, SLOT( tryRead(QString&))); |
303 | parser. parse ( data ); | 303 | parser. parse ( data ); |
304 | IMAPResponse response = parser.response(); | 304 | IMAPResponse response = parser.response(); |
305 | //disconnect ( &parser, SIGNAL( needMoreData ( QString & )), _ibase, SLOT( tryRead ( QString & ))); | 305 | //disconnect ( &parser, SIGNAL( needMoreData(QString&)), _ibase, SLOT( tryRead(QString&))); |
306 | response.setImapHandler(this); | 306 | response.setImapHandler(this); |
307 | 307 | ||
308 | if (!_loggingin) { qDebug("Emitting gotResponse!\n" ); emit gotResponse(response); } | 308 | if (!_loggingin) { qDebug("Emitting gotResponse!\n" ); emit gotResponse(response); } |
309 | else { | 309 | else { |
310 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { | 310 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { |
311 | _loggingin = false; | 311 | _loggingin = false; |
312 | _loggedin = true; | 312 | _loggedin = true; |
313 | qWarning("OK. Logged in. Leaving loggingin state."); | 313 | qWarning("OK. Logged in. Leaving loggingin state."); |
314 | } else { | 314 | } else { |
315 | _loggingin = false; | 315 | _loggingin = false; |
316 | emit IMAPError(IMAPBase::IMAPErrLoginFailed); | 316 | emit IMAPError(IMAPBase::IMAPErrLoginFailed); |
317 | } | 317 | } |
318 | } | 318 | } |
319 | } | 319 | } |
320 | 320 | ||
321 | void IMAPHandler::slotLookingUpHost() | 321 | void IMAPHandler::slotLookingUpHost() |
diff --git a/noncore/unsupported/mail2/listviewplus.cpp b/noncore/unsupported/mail2/listviewplus.cpp index ce5f35f..722b347 100644 --- a/noncore/unsupported/mail2/listviewplus.cpp +++ b/noncore/unsupported/mail2/listviewplus.cpp | |||
@@ -15,34 +15,34 @@ void ListViewPlus::keyPressEvent(QKeyEvent *event) | |||
15 | case Qt::Key_Space: // FALLTHROUGH | 15 | case Qt::Key_Space: // FALLTHROUGH |
16 | case Qt::Key_Enter: | 16 | case Qt::Key_Enter: |
17 | if (currentItem() != 0) | 17 | if (currentItem() != 0) |
18 | emit clicked(currentItem()); | 18 | emit clicked(currentItem()); |
19 | break; | 19 | break; |
20 | default: break; | 20 | default: break; |
21 | } | 21 | } |
22 | 22 | ||
23 | QListView::keyPressEvent(event); | 23 | QListView::keyPressEvent(event); |
24 | } | 24 | } |
25 | 25 | ||
26 | void ListViewPlus::setPopup(QPopupMenu *popup, int delay) | 26 | void ListViewPlus::setPopup(QPopupMenu *popup, int delay) |
27 | { | 27 | { |
28 | _popup = popup; | 28 | _popup = popup; |
29 | _delay = delay; | 29 | _delay = delay; |
30 | 30 | ||
31 | connect(this, SIGNAL(pressed(QListViewItem *, const QPoint &, int)), SLOT(_initPopup(QListViewItem *, const QPoint &, int))); | 31 | connect(this, SIGNAL(pressed(QListViewItem*,const QPoint&,int)), SLOT(_initPopup(QListViewItem*,const QPoint&,int))); |
32 | connect(this, SIGNAL(clicked(QListViewItem *, const QPoint &, int)), SLOT(_cancelPopup(QListViewItem *, const QPoint &, int))); | 32 | connect(this, SIGNAL(clicked(QListViewItem*,const QPoint&,int)), SLOT(_cancelPopup(QListViewItem*,const QPoint&,int))); |
33 | } | 33 | } |
34 | 34 | ||
35 | void ListViewPlus::_initPopup(QListViewItem *, const QPoint &point, int) | 35 | void ListViewPlus::_initPopup(QListViewItem *, const QPoint &point, int) |
36 | { | 36 | { |
37 | _point = point; | 37 | _point = point; |
38 | 38 | ||
39 | _timer = new QTimer(); | 39 | _timer = new QTimer(); |
40 | _timer->start(_delay, true); | 40 | _timer->start(_delay, true); |
41 | 41 | ||
42 | connect(_timer, SIGNAL(timeout()), this, SLOT(_showPopup())); | 42 | connect(_timer, SIGNAL(timeout()), this, SLOT(_showPopup())); |
43 | } | 43 | } |
44 | 44 | ||
45 | void ListViewPlus::_cancelPopup(QListViewItem *, const QPoint &, int) | 45 | void ListViewPlus::_cancelPopup(QListViewItem *, const QPoint &, int) |
46 | { | 46 | { |
47 | delete _timer; | 47 | delete _timer; |
48 | } | 48 | } |
diff --git a/noncore/unsupported/mail2/mailtable.cpp b/noncore/unsupported/mail2/mailtable.cpp index fd179f0..56feab0 100644 --- a/noncore/unsupported/mail2/mailtable.cpp +++ b/noncore/unsupported/mail2/mailtable.cpp | |||
@@ -61,106 +61,106 @@ MailTable::MailTable(QWidget *parent, const char *name, WFlags fl) | |||
61 | 61 | ||
62 | QPopupMenu *menu = new QPopupMenu(this); | 62 | QPopupMenu *menu = new QPopupMenu(this); |
63 | menu->insertItem(tr("Copy"), MENU_COPY); | 63 | menu->insertItem(tr("Copy"), MENU_COPY); |
64 | 64 | ||
65 | QPopupMenu *markMenu = new QPopupMenu(this); | 65 | QPopupMenu *markMenu = new QPopupMenu(this); |
66 | markMenu->insertItem(tr("Seen"), MENU_MARK_READ); | 66 | markMenu->insertItem(tr("Seen"), MENU_MARK_READ); |
67 | markMenu->insertItem(tr("Unseen"), MENU_MARK_UNREAD); | 67 | markMenu->insertItem(tr("Unseen"), MENU_MARK_UNREAD); |
68 | markMenu->insertSeparator(); | 68 | markMenu->insertSeparator(); |
69 | markMenu->insertItem(tr("Marked"), MENU_MARK_MARKED); | 69 | markMenu->insertItem(tr("Marked"), MENU_MARK_MARKED); |
70 | markMenu->insertItem(tr("Unmarked"), MENU_MARK_UNMARKED); | 70 | markMenu->insertItem(tr("Unmarked"), MENU_MARK_UNMARKED); |
71 | 71 | ||
72 | menu->insertItem(tr("Mark as..."), markMenu, MENU_MARK); | 72 | menu->insertItem(tr("Mark as..."), markMenu, MENU_MARK); |
73 | menu->insertSeparator(); | 73 | menu->insertSeparator(); |
74 | menu->insertItem(tr("Delete Mail"), MENU_DELETE); | 74 | menu->insertItem(tr("Delete Mail"), MENU_DELETE); |
75 | setPopup(menu); | 75 | setPopup(menu); |
76 | 76 | ||
77 | connect(this, SIGNAL(clicked(QListViewItem *)), SLOT(itemClicked(QListViewItem *))); | 77 | connect(this, SIGNAL(clicked(QListViewItem*)), SLOT(itemClicked(QListViewItem*))); |
78 | } | 78 | } |
79 | 79 | ||
80 | void MailTable::setFolder(Folder folder) | 80 | void MailTable::setFolder(Folder folder) |
81 | { | 81 | { |
82 | folder.topFolder().handler()->iSelect(folder.fullName()); | 82 | folder.topFolder().handler()->iSelect(folder.fullName()); |
83 | _handler = folder.topFolder().handler(); | 83 | _handler = folder.topFolder().handler(); |
84 | connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPSelect(IMAPResponse &))); | 84 | connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPSelect(IMAPResponse&))); |
85 | } | 85 | } |
86 | 86 | ||
87 | void MailTable::setHeaders(QValueList<IMAPResponseFETCH> response) | 87 | void MailTable::setHeaders(QValueList<IMAPResponseFETCH> response) |
88 | { | 88 | { |
89 | clear(); | 89 | clear(); |
90 | QValueList<IMAPResponseFETCH>::Iterator it; | 90 | QValueList<IMAPResponseFETCH>::Iterator it; |
91 | for (it = response.begin(); it != response.end(); it++) { | 91 | for (it = response.begin(); it != response.end(); it++) { |
92 | (void) new MailTableItem(this, *it); | 92 | (void) new MailTableItem(this, *it); |
93 | } | 93 | } |
94 | } | 94 | } |
95 | 95 | ||
96 | void MailTable::slotIMAPSelect(IMAPResponse &response) | 96 | void MailTable::slotIMAPSelect(IMAPResponse &response) |
97 | { | 97 | { |
98 | disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPSelect(IMAPResponse &))); | 98 | disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPSelect(IMAPResponse&))); |
99 | 99 | ||
100 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { | 100 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { |
101 | clear(); | 101 | clear(); |
102 | QString mails = response.EXISTS()[0].mails(); | 102 | QString mails = response.EXISTS()[0].mails(); |
103 | if (mails.toInt() == 0) { | 103 | if (mails.toInt() == 0) { |
104 | emit status(tr("Mailbox contained no mails.")); | 104 | emit status(tr("Mailbox contained no mails.")); |
105 | return; | 105 | return; |
106 | } | 106 | } |
107 | int a = mails.toInt() / 5; | 107 | int a = mails.toInt() / 5; |
108 | int b = mails.toInt() % 5; | 108 | int b = mails.toInt() % 5; |
109 | 109 | ||
110 | _downloadSteps = a; | 110 | _downloadSteps = a; |
111 | if (b > 0) _downloadSteps++; | 111 | if (b > 0) _downloadSteps++; |
112 | _lastStep = b; | 112 | _lastStep = b; |
113 | _currentProgress = 0; | 113 | _currentProgress = 0; |
114 | 114 | ||
115 | emit totalSteps(_downloadSteps); | 115 | emit totalSteps(_downloadSteps); |
116 | emit progress(_currentProgress); | 116 | emit progress(_currentProgress); |
117 | emit stopEnabled(true); | 117 | emit stopEnabled(true); |
118 | 118 | ||
119 | response.imapHandler()->iFetch(QString("1:%1").arg((a == 0) ? b : 5), "ENVELOPE FLAGS UID"); | 119 | response.imapHandler()->iFetch(QString("1:%1").arg((a == 0) ? b : 5), "ENVELOPE FLAGS UID"); |
120 | emit status(tr("Getting mail headers...")); | 120 | emit status(tr("Getting mail headers...")); |
121 | connect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPFetch(IMAPResponse &))); | 121 | connect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPFetch(IMAPResponse&))); |
122 | } else { | 122 | } else { |
123 | QMessageBox::warning(this, tr("Error"), tr("<p>An error occoured during the selection of the mailbox. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok")); | 123 | QMessageBox::warning(this, tr("Error"), tr("<p>An error occoured during the selection of the mailbox. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok")); |
124 | } | 124 | } |
125 | } | 125 | } |
126 | 126 | ||
127 | void MailTable::slotIMAPFetch(IMAPResponse &response) | 127 | void MailTable::slotIMAPFetch(IMAPResponse &response) |
128 | { | 128 | { |
129 | disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPFetch(IMAPResponse &))); | 129 | disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPFetch(IMAPResponse&))); |
130 | 130 | ||
131 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { | 131 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { |
132 | QValueList<IMAPResponseFETCH>::Iterator it; | 132 | QValueList<IMAPResponseFETCH>::Iterator it; |
133 | QValueList<IMAPResponseFETCH> fetch = response.FETCH(); | 133 | QValueList<IMAPResponseFETCH> fetch = response.FETCH(); |
134 | for (it = fetch.begin(); it != fetch.end(); it++) { | 134 | for (it = fetch.begin(); it != fetch.end(); it++) { |
135 | (void) new MailTableItem(this, *it); | 135 | (void) new MailTableItem(this, *it); |
136 | } | 136 | } |
137 | emit progress(++_currentProgress); | 137 | emit progress(++_currentProgress); |
138 | 138 | ||
139 | if (_currentProgress != _downloadSteps) { | 139 | if (_currentProgress != _downloadSteps) { |
140 | if (_stopped) { | 140 | if (_stopped) { |
141 | _currentProgress = 0; | 141 | _currentProgress = 0; |
142 | _downloadSteps = 0; | 142 | _downloadSteps = 0; |
143 | _lastStep = 0; | 143 | _lastStep = 0; |
144 | _stopped = false; | 144 | _stopped = false; |
145 | emit status(tr("Stopped")); | 145 | emit status(tr("Stopped")); |
146 | emit resetProgress(); | 146 | emit resetProgress(); |
147 | emit stopEnabled(false); | 147 | emit stopEnabled(false); |
148 | } else { | 148 | } else { |
149 | response.imapHandler()->iFetch(QString("%1:%2").arg(_currentProgress * 5 + 1).arg((_currentProgress + 1 == _downloadSteps) ? _currentProgress * 5 + _lastStep : _currentProgress * 5 + 5), "ENVELOPE FLAGS UID"); | 149 | response.imapHandler()->iFetch(QString("%1:%2").arg(_currentProgress * 5 + 1).arg((_currentProgress + 1 == _downloadSteps) ? _currentProgress * 5 + _lastStep : _currentProgress * 5 + 5), "ENVELOPE FLAGS UID"); |
150 | connect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPFetch(IMAPResponse &))); | 150 | connect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPFetch(IMAPResponse&))); |
151 | } | 151 | } |
152 | } else { | 152 | } else { |
153 | _currentProgress = 0; | 153 | _currentProgress = 0; |
154 | _downloadSteps = 0; | 154 | _downloadSteps = 0; |
155 | _lastStep = 0; | 155 | _lastStep = 0; |
156 | emit status(tr("Got all mail headers.")); | 156 | emit status(tr("Got all mail headers.")); |
157 | emit resetProgress(); | 157 | emit resetProgress(); |
158 | emit stopEnabled(false); | 158 | emit stopEnabled(false); |
159 | } | 159 | } |
160 | } else { | 160 | } else { |
161 | emit status(tr("<font color=#ff0000>Couldn't fetch mail.")); | 161 | emit status(tr("<font color=#ff0000>Couldn't fetch mail.")); |
162 | } | 162 | } |
163 | } | 163 | } |
164 | 164 | ||
165 | void MailTable::itemClicked(QListViewItem *item) | 165 | void MailTable::itemClicked(QListViewItem *item) |
166 | { | 166 | { |
diff --git a/noncore/unsupported/mail2/mainwindow.cpp b/noncore/unsupported/mail2/mainwindow.cpp index 0d09ec8..ce80391 100644 --- a/noncore/unsupported/mail2/mainwindow.cpp +++ b/noncore/unsupported/mail2/mainwindow.cpp | |||
@@ -7,56 +7,56 @@ | |||
7 | #include "mailstatusbar.h" | 7 | #include "mailstatusbar.h" |
8 | #include "folderwidget.h" | 8 | #include "folderwidget.h" |
9 | #include "mainwindow.h" | 9 | #include "mainwindow.h" |
10 | #include "configdiag.h" | 10 | #include "configdiag.h" |
11 | #include "configfile.h" | 11 | #include "configfile.h" |
12 | #include "searchdiag.h" | 12 | #include "searchdiag.h" |
13 | #include "mailtable.h" | 13 | #include "mailtable.h" |
14 | #include "composer.h" | 14 | #include "composer.h" |
15 | #include "viewmail.h" | 15 | #include "viewmail.h" |
16 | #include "mailfactory.h" | 16 | #include "mailfactory.h" |
17 | 17 | ||
18 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags fl) | 18 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags fl) |
19 | : MainWindowBase(parent, name, fl) | 19 | : MainWindowBase(parent, name, fl) |
20 | { | 20 | { |
21 | status->setStopEnabled(false); | 21 | status->setStopEnabled(false); |
22 | 22 | ||
23 | connect(folderView, SIGNAL(status(const QString &)), status, SLOT(setStatusText(const QString &))); | 23 | connect(folderView, SIGNAL(status(const QString&)), status, SLOT(setStatusText(const QString&))); |
24 | connect(folderView, SIGNAL(folderSelected(Folder)), mailView, SLOT(setFolder(Folder))); | 24 | connect(folderView, SIGNAL(folderSelected(Folder)), mailView, SLOT(setFolder(Folder))); |
25 | 25 | ||
26 | connect(mailView, SIGNAL(mailClicked(IMAPResponseFETCH, IMAPHandler *)), SLOT(mailClicked(IMAPResponseFETCH, IMAPHandler *))); | 26 | connect(mailView, SIGNAL(mailClicked(IMAPResponseFETCH,IMAPHandler*)), SLOT(mailClicked(IMAPResponseFETCH,IMAPHandler*))); |
27 | connect(mailView, SIGNAL(status(const QString &)), status, SLOT(setStatusText(const QString &))); | 27 | connect(mailView, SIGNAL(status(const QString&)), status, SLOT(setStatusText(const QString&))); |
28 | connect(mailView, SIGNAL(totalSteps(int)), status, SLOT(setProgressTotalSteps(int))); | 28 | connect(mailView, SIGNAL(totalSteps(int)), status, SLOT(setProgressTotalSteps(int))); |
29 | connect(mailView, SIGNAL(progress(int)), status, SLOT(setProgress(int))); | 29 | connect(mailView, SIGNAL(progress(int)), status, SLOT(setProgress(int))); |
30 | connect(mailView, SIGNAL(resetProgress()), status, SLOT(resetProgress())); | 30 | connect(mailView, SIGNAL(resetProgress()), status, SLOT(resetProgress())); |
31 | connect(mailView, SIGNAL(stopEnabled(bool)), status, SLOT(setStopEnabled(bool))); | 31 | connect(mailView, SIGNAL(stopEnabled(bool)), status, SLOT(setStopEnabled(bool))); |
32 | 32 | ||
33 | connect(status, SIGNAL(stop()), mailView, SLOT(stop())); | 33 | connect(status, SIGNAL(stop()), mailView, SLOT(stop())); |
34 | 34 | ||
35 | connect(compose, SIGNAL(activated()), SLOT(slotComposeNoParams())); | 35 | connect(compose, SIGNAL(activated()), SLOT(slotComposeNoParams())); |
36 | connect(sendQueue, SIGNAL(activated()), SLOT(slotSendQueued())); | 36 | connect(sendQueue, SIGNAL(activated()), SLOT(slotSendQueued())); |
37 | connect(findmails, SIGNAL(activated()), SLOT(slotSearch())); | 37 | connect(findmails, SIGNAL(activated()), SLOT(slotSearch())); |
38 | connect(configure, SIGNAL(activated()), SLOT(slotConfigure())); | 38 | connect(configure, SIGNAL(activated()), SLOT(slotConfigure())); |
39 | 39 | ||
40 | // Added by Stefan Eilers to allow starting by addressbook.. | 40 | // Added by Stefan Eilers to allow starting by addressbook.. |
41 | #if !defined(QT_NO_COP) | 41 | #if !defined(QT_NO_COP) |
42 | // QCopChannel *addressChannel = new QCopChannel("QPE/Application/mail" , this ); | 42 | // QCopChannel *addressChannel = new QCopChannel("QPE/Application/mail" , this ); |
43 | // connect (addressChannel, SIGNAL( received(const QCString &, const QByteArray &)), | 43 | // connect (addressChannel, SIGNAL( received(const QCString&,const QByteArray&)), |
44 | // this, SLOT ( appMessage(const QCString &, const QByteArray &) ) ); | 44 | // this, SLOT ( appMessage(const QCString&,const QByteArray&) ) ); |
45 | connect( qApp, SIGNAL( appMessage( const QCString&, const QByteArray& ) ), | 45 | connect( qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ), |
46 | this, SLOT( appMessage( const QCString&, const QByteArray& ) ) ); | 46 | this, SLOT( appMessage(const QCString&,const QByteArray&) ) ); |
47 | #endif | 47 | #endif |
48 | } | 48 | } |
49 | 49 | ||
50 | // Added by Stefan Eilers to allow starting by addressbook.. | 50 | // Added by Stefan Eilers to allow starting by addressbook.. |
51 | void MainWindow::appMessage(const QCString &msg, const QByteArray &data) | 51 | void MainWindow::appMessage(const QCString &msg, const QByteArray &data) |
52 | { | 52 | { |
53 | if (msg == "writeMail(QString,QString)") { | 53 | if (msg == "writeMail(QString,QString)") { |
54 | QDataStream stream(data,IO_ReadOnly); | 54 | QDataStream stream(data,IO_ReadOnly); |
55 | QString name, email; | 55 | QString name, email; |
56 | stream >> name >> email; | 56 | stream >> name >> email; |
57 | 57 | ||
58 | qWarning("opie-mail:: Should send mail to %s with address %s", name.latin1(), email.latin1() ); | 58 | qWarning("opie-mail:: Should send mail to %s with address %s", name.latin1(), email.latin1() ); |
59 | 59 | ||
60 | slotCompose( name, email ); | 60 | slotCompose( name, email ); |
61 | 61 | ||
62 | }else{ | 62 | }else{ |
diff --git a/noncore/unsupported/mail2/searchdiag.cpp b/noncore/unsupported/mail2/searchdiag.cpp index 907f6ff..6fb4e4d 100644 --- a/noncore/unsupported/mail2/searchdiag.cpp +++ b/noncore/unsupported/mail2/searchdiag.cpp | |||
@@ -15,106 +15,106 @@ | |||
15 | #define INMENU_FROM3 | 15 | #define INMENU_FROM3 |
16 | #define INMENU_TO4 | 16 | #define INMENU_TO4 |
17 | 17 | ||
18 | SearchDiag::SearchDiag(QWidget *parent, const char *name, WFlags fl) | 18 | SearchDiag::SearchDiag(QWidget *parent, const char *name, WFlags fl) |
19 | : SearchDiagBase(parent, name, fl) | 19 | : SearchDiagBase(parent, name, fl) |
20 | { | 20 | { |
21 | _selected = false; | 21 | _selected = false; |
22 | 22 | ||
23 | in->insertItem(tr("Body"), INMENU_BODY); | 23 | in->insertItem(tr("Body"), INMENU_BODY); |
24 | in->insertItem(tr("Header Field"), INMENU_HEADERF); | 24 | in->insertItem(tr("Header Field"), INMENU_HEADERF); |
25 | in->insertItem(tr("Subject"), INMENU_SUBJECT); | 25 | in->insertItem(tr("Subject"), INMENU_SUBJECT); |
26 | in->insertItem(tr("From"), INMENU_FROM); | 26 | in->insertItem(tr("From"), INMENU_FROM); |
27 | in->insertItem(tr("To"), INMENU_TO); | 27 | in->insertItem(tr("To"), INMENU_TO); |
28 | 28 | ||
29 | connect(folderView, SIGNAL(folderSelected(Folder)), SLOT(folderSelected(Folder))); | 29 | connect(folderView, SIGNAL(folderSelected(Folder)), SLOT(folderSelected(Folder))); |
30 | connect(in, SIGNAL(activated(int)), SLOT(slotInItemActivated(int))); | 30 | connect(in, SIGNAL(activated(int)), SLOT(slotInItemActivated(int))); |
31 | connect(mailTable, SIGNAL(mailClicked(IMAPResponseFETCH, IMAPHandler *)), SLOT(slotMailClicked(IMAPResponseFETCH, IMAPHandler *))); | 31 | connect(mailTable, SIGNAL(mailClicked(IMAPResponseFETCH,IMAPHandler*)), SLOT(slotMailClicked(IMAPResponseFETCH,IMAPHandler*))); |
32 | } | 32 | } |
33 | 33 | ||
34 | void SearchDiag::accept() | 34 | void SearchDiag::accept() |
35 | { | 35 | { |
36 | if (searchFor->text().isEmpty()) { | 36 | if (searchFor->text().isEmpty()) { |
37 | QMessageBox::information(this, tr("Error"), tr("<p>Please enter what to search for.</p>"), tr("Ok")); | 37 | QMessageBox::information(this, tr("Error"), tr("<p>Please enter what to search for.</p>"), tr("Ok")); |
38 | return; | 38 | return; |
39 | } | 39 | } |
40 | 40 | ||
41 | if (!_selected) { | 41 | if (!_selected) { |
42 | QMessageBox::information(this, tr("Error"), tr("<p>Please select a folder.</p>"), tr("Ok")); | 42 | QMessageBox::information(this, tr("Error"), tr("<p>Please select a folder.</p>"), tr("Ok")); |
43 | return; | 43 | return; |
44 | } | 44 | } |
45 | 45 | ||
46 | if (in->currentItem() == INMENU_HEADERF && other->currentText().isEmpty()) { | 46 | if (in->currentItem() == INMENU_HEADERF && other->currentText().isEmpty()) { |
47 | QMessageBox::information(this, tr("Error"), tr("<p>Please enter a header field to search in.</p>"), tr("Ok")); | 47 | QMessageBox::information(this, tr("Error"), tr("<p>Please enter a header field to search in.</p>"), tr("Ok")); |
48 | return; | 48 | return; |
49 | } | 49 | } |
50 | 50 | ||
51 | _folder.topFolder().handler()->iSelect(_folder.fullName()); | 51 | _folder.topFolder().handler()->iSelect(_folder.fullName()); |
52 | connect(_folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPSelect(IMAPResponse &))); | 52 | connect(_folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPSelect(IMAPResponse&))); |
53 | } | 53 | } |
54 | 54 | ||
55 | void SearchDiag::folderSelected(Folder folder) | 55 | void SearchDiag::folderSelected(Folder folder) |
56 | { | 56 | { |
57 | _selected = true; | 57 | _selected = true; |
58 | _folder = folder; | 58 | _folder = folder; |
59 | } | 59 | } |
60 | 60 | ||
61 | void SearchDiag::slotIMAPSelect(IMAPResponse &response) | 61 | void SearchDiag::slotIMAPSelect(IMAPResponse &response) |
62 | { | 62 | { |
63 | disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPSelect(IMAPResponse &))); | 63 | disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPSelect(IMAPResponse&))); |
64 | 64 | ||
65 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { | 65 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { |
66 | if (in->currentItem() == INMENU_BODY) { | 66 | if (in->currentItem() == INMENU_BODY) { |
67 | response.imapHandler()->iSearch("BODY \"" + searchFor->text() + "\""); | 67 | response.imapHandler()->iSearch("BODY \"" + searchFor->text() + "\""); |
68 | } else if (in->currentItem() == INMENU_HEADERF) { | 68 | } else if (in->currentItem() == INMENU_HEADERF) { |
69 | response.imapHandler()->iSearch("HEADER \""+ other->currentText() + "\" \"" + searchFor->text() + "\""); | 69 | response.imapHandler()->iSearch("HEADER \""+ other->currentText() + "\" \"" + searchFor->text() + "\""); |
70 | } else if (in->currentItem() == INMENU_SUBJECT) { | 70 | } else if (in->currentItem() == INMENU_SUBJECT) { |
71 | response.imapHandler()->iSearch("SUBJECT \"" + searchFor->text() + "\""); | 71 | response.imapHandler()->iSearch("SUBJECT \"" + searchFor->text() + "\""); |
72 | } else if (in->currentItem() == INMENU_FROM) { | 72 | } else if (in->currentItem() == INMENU_FROM) { |
73 | response.imapHandler()->iSearch("FROM \"" + searchFor->text() + "\""); | 73 | response.imapHandler()->iSearch("FROM \"" + searchFor->text() + "\""); |
74 | } else if (in->currentItem() == INMENU_TO) { | 74 | } else if (in->currentItem() == INMENU_TO) { |
75 | response.imapHandler()->iSearch("TO \"" + searchFor->text() + "\""); | 75 | response.imapHandler()->iSearch("TO \"" + searchFor->text() + "\""); |
76 | } else return; | 76 | } else return; |
77 | 77 | ||
78 | connect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPSearch(IMAPResponse &))); | 78 | connect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPSearch(IMAPResponse&))); |
79 | } else { | 79 | } else { |
80 | QMessageBox::warning(this, tr("Error"), tr("<p>Could not select the folder. Aborting. (Server said: %1)").arg(response.statusResponse().comment()), tr("Ok")); | 80 | QMessageBox::warning(this, tr("Error"), tr("<p>Could not select the folder. Aborting. (Server said: %1)").arg(response.statusResponse().comment()), tr("Ok")); |
81 | } | 81 | } |
82 | } | 82 | } |
83 | 83 | ||
84 | void SearchDiag::slotIMAPSearch(IMAPResponse &response) | 84 | void SearchDiag::slotIMAPSearch(IMAPResponse &response) |
85 | { | 85 | { |
86 | disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPSearch(IMAPResponse &))); | 86 | disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPSearch(IMAPResponse&))); |
87 | 87 | ||
88 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { | 88 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { |
89 | IMAPResponseSEARCH results = response.SEARCH()[0]; | 89 | IMAPResponseSEARCH results = response.SEARCH()[0]; |
90 | if (results.mails().count() == 0) { | 90 | if (results.mails().count() == 0) { |
91 | QMessageBox::information(this, tr("Results"), tr("<p>No mails match your criteria.</p>"), tr("Ok")); | 91 | QMessageBox::information(this, tr("Results"), tr("<p>No mails match your criteria.</p>"), tr("Ok")); |
92 | return; | 92 | return; |
93 | } | 93 | } |
94 | 94 | ||
95 | response.imapHandler()->iFetch(results.mails().join(","), "ENVELOPE FLAGS UID"); | 95 | response.imapHandler()->iFetch(results.mails().join(","), "ENVELOPE FLAGS UID"); |
96 | connect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPFetch(IMAPResponse &))); | 96 | connect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPFetch(IMAPResponse&))); |
97 | } else { | 97 | } else { |
98 | QMessageBox::warning(this, tr("Error"), tr("<p>Search failed. (Server said: %1)").arg(response.statusResponse().comment()), tr("Ok")); | 98 | QMessageBox::warning(this, tr("Error"), tr("<p>Search failed. (Server said: %1)").arg(response.statusResponse().comment()), tr("Ok")); |
99 | } | 99 | } |
100 | } | 100 | } |
101 | 101 | ||
102 | void SearchDiag::slotIMAPFetch(IMAPResponse &response) | 102 | void SearchDiag::slotIMAPFetch(IMAPResponse &response) |
103 | { | 103 | { |
104 | disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPSearch(IMAPResponse &))); | 104 | disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPSearch(IMAPResponse&))); |
105 | 105 | ||
106 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { | 106 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { |
107 | mailTable->setHeaders(response.FETCH()); | 107 | mailTable->setHeaders(response.FETCH()); |
108 | } else { | 108 | } else { |
109 | QMessageBox::warning(this, tr("Error"), tr("<p>Couldn't fetch the mail headers. (Server said: %1)").arg(response.statusResponse().comment())); | 109 | QMessageBox::warning(this, tr("Error"), tr("<p>Couldn't fetch the mail headers. (Server said: %1)").arg(response.statusResponse().comment())); |
110 | } | 110 | } |
111 | } | 111 | } |
112 | 112 | ||
113 | void SearchDiag::slotMailClicked(IMAPResponseFETCH fetch, IMAPHandler *) | 113 | void SearchDiag::slotMailClicked(IMAPResponseFETCH fetch, IMAPHandler *) |
114 | { | 114 | { |
115 | ViewMail viewMail(fetch, _folder.topFolder().handler(), this, 0, true); | 115 | ViewMail viewMail(fetch, _folder.topFolder().handler(), this, 0, true); |
116 | viewMail.showMaximized(); | 116 | viewMail.showMaximized(); |
117 | viewMail.exec(); | 117 | viewMail.exec(); |
118 | } | 118 | } |
119 | 119 | ||
120 | void SearchDiag::slotInItemActivated(int index) | 120 | void SearchDiag::slotInItemActivated(int index) |
diff --git a/noncore/unsupported/mail2/viewmail.cpp b/noncore/unsupported/mail2/viewmail.cpp index da6924d..0cfb6e5 100644 --- a/noncore/unsupported/mail2/viewmail.cpp +++ b/noncore/unsupported/mail2/viewmail.cpp | |||
@@ -46,33 +46,33 @@ ViewMail::ViewMail(IMAPResponseFETCH &mail, IMAPHandler *handler, QWidget *paren | |||
46 | : mail.envelope().to().toString())) | 46 | : mail.envelope().to().toString())) |
47 | .arg(mail.envelope().cc().toString().isNull() ? QString(0) | 47 | .arg(mail.envelope().cc().toString().isNull() ? QString(0) |
48 | : tr("<b>Cc:</b> %1<br>").arg(deHtml(mail.envelope().cc().toString()))) | 48 | : tr("<b>Cc:</b> %1<br>").arg(deHtml(mail.envelope().cc().toString()))) |
49 | .arg(mail.envelope().bcc().toString().isNull() ? QString(0) | 49 | .arg(mail.envelope().bcc().toString().isNull() ? QString(0) |
50 | : tr("<b>Bcc:</b> %1<br>").arg(deHtml(mail.envelope().bcc().toString()))) | 50 | : tr("<b>Bcc:</b> %1<br>").arg(deHtml(mail.envelope().bcc().toString()))) |
51 | .arg(mail.envelope().mailDate().isNull() ? tr("(no date)") | 51 | .arg(mail.envelope().mailDate().isNull() ? tr("(no date)") |
52 | : mail.envelope().mailDate()) | 52 | : mail.envelope().mailDate()) |
53 | .arg("%1"); | 53 | .arg("%1"); |
54 | 54 | ||
55 | connect(reply, SIGNAL(activated()), SLOT(slotReply())); | 55 | connect(reply, SIGNAL(activated()), SLOT(slotReply())); |
56 | connect(forward, SIGNAL(activated()), SLOT(slotForward())); | 56 | connect(forward, SIGNAL(activated()), SLOT(slotForward())); |
57 | 57 | ||
58 | attachments->setEnabled(_gotBody); | 58 | attachments->setEnabled(_gotBody); |
59 | browser->setText(QString(_mailHtml).arg(tr("Getting mail body from server. Please wait..."))); | 59 | browser->setText(QString(_mailHtml).arg(tr("Getting mail body from server. Please wait..."))); |
60 | 60 | ||
61 | _handler->iUid("FETCH", QString("%1 (BODY[1])").arg(mail.uid())); | 61 | _handler->iUid("FETCH", QString("%1 (BODY[1])").arg(mail.uid())); |
62 | connect(_handler, SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPUid(IMAPResponse &))); | 62 | connect(_handler, SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPUid(IMAPResponse&))); |
63 | } | 63 | } |
64 | 64 | ||
65 | ViewMail::~ViewMail() | 65 | ViewMail::~ViewMail() |
66 | { | 66 | { |
67 | hide(); | 67 | hide(); |
68 | } | 68 | } |
69 | 69 | ||
70 | void ViewMail::hide() | 70 | void ViewMail::hide() |
71 | { | 71 | { |
72 | QWidget::hide(); | 72 | QWidget::hide(); |
73 | 73 | ||
74 | if (_inLoop) { | 74 | if (_inLoop) { |
75 | _inLoop = false; | 75 | _inLoop = false; |
76 | qApp->exit_loop(); | 76 | qApp->exit_loop(); |
77 | } | 77 | } |
78 | } | 78 | } |
@@ -166,33 +166,33 @@ void ViewMail::slotForward() | |||
166 | .arg(_mail.bodyPart(1).data()); | 166 | .arg(_mail.bodyPart(1).data()); |
167 | 167 | ||
168 | ftext += QString("----- End forwarded message -----\n"); | 168 | ftext += QString("----- End forwarded message -----\n"); |
169 | 169 | ||
170 | SendMail sendMail; | 170 | SendMail sendMail; |
171 | sendMail.setSubject("Fwd: " + _mail.envelope().subject()); | 171 | sendMail.setSubject("Fwd: " + _mail.envelope().subject()); |
172 | sendMail.setMessage(ftext); | 172 | sendMail.setMessage(ftext); |
173 | 173 | ||
174 | Composer composer(this, 0, true); | 174 | Composer composer(this, 0, true); |
175 | composer.setSendMail(sendMail); | 175 | composer.setSendMail(sendMail); |
176 | composer.showMaximized(); | 176 | composer.showMaximized(); |
177 | composer.exec(); | 177 | composer.exec(); |
178 | } | 178 | } |
179 | 179 | ||
180 | void ViewMail::slotIMAPUid(IMAPResponse &response) | 180 | void ViewMail::slotIMAPUid(IMAPResponse &response) |
181 | { | 181 | { |
182 | disconnect(_handler, SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPUid(IMAPResponse &))); | 182 | disconnect(_handler, SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPUid(IMAPResponse&))); |
183 | 183 | ||
184 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { | 184 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { |
185 | QValueList<IMAPResponseBodyPart> bodyParts; | 185 | QValueList<IMAPResponseBodyPart> bodyParts; |
186 | bodyParts.append(response.FETCH()[0].bodyPart(0)); | 186 | bodyParts.append(response.FETCH()[0].bodyPart(0)); |
187 | _mail.setBodyParts(bodyParts); | 187 | _mail.setBodyParts(bodyParts); |
188 | 188 | ||
189 | browser->setText(QString(_mailHtml).arg(deHtml(response.FETCH()[0].bodyPart(0).data()))); | 189 | browser->setText(QString(_mailHtml).arg(deHtml(response.FETCH()[0].bodyPart(0).data()))); |
190 | 190 | ||
191 | // fillList(response.FETCH()[0].bodyStructure()); | 191 | // fillList(response.FETCH()[0].bodyStructure()); |
192 | 192 | ||
193 | _gotBody = true; | 193 | _gotBody = true; |
194 | } else { | 194 | } else { |
195 | QMessageBox::warning(this, tr("Error"), tr("<p>I was unable to retrieve the mail from the server. You can try again later or give up.</p>"), tr("Ok")); | 195 | QMessageBox::warning(this, tr("Error"), tr("<p>I was unable to retrieve the mail from the server. You can try again later or give up.</p>"), tr("Ok")); |
196 | } | 196 | } |
197 | } | 197 | } |
198 | 198 | ||
diff --git a/noncore/unsupported/mailit/addatt.cpp b/noncore/unsupported/mailit/addatt.cpp index 19ac58f..420f84c 100644 --- a/noncore/unsupported/mailit/addatt.cpp +++ b/noncore/unsupported/mailit/addatt.cpp | |||
@@ -77,40 +77,40 @@ AddAtt::AddAtt(QWidget *parent, const char *name, WFlags f) | |||
77 | top->addWidget(fileCategoryButton, 0, 0);*/ | 77 | top->addWidget(fileCategoryButton, 0, 0);*/ |
78 | 78 | ||
79 | 79 | ||
80 | top->addWidget(buttons,1,0); | 80 | top->addWidget(buttons,1,0); |
81 | //buttons->addWidget(attachButton,0,0); | 81 | //buttons->addWidget(attachButton,0,0); |
82 | //buttons->addWidget(removeButton,0,1); | 82 | //buttons->addWidget(removeButton,0,1); |
83 | 83 | ||
84 | //connect(fileCategories, SIGNAL(activated(int)), this, | 84 | //connect(fileCategories, SIGNAL(activated(int)), this, |
85 | //SLOT(fileCategorySelected(int)) );*/ | 85 | //SLOT(fileCategorySelected(int)) );*/ |
86 | connect(attachButton, SIGNAL(clicked()), this, | 86 | connect(attachButton, SIGNAL(clicked()), this, |
87 | SLOT(addattachment()) ); | 87 | SLOT(addattachment()) ); |
88 | connect(removeButton, SIGNAL(clicked()), this, | 88 | connect(removeButton, SIGNAL(clicked()), this, |
89 | SLOT(removeattachment()) ); | 89 | SLOT(removeattachment()) ); |
90 | 90 | ||
91 | /*listView = new QListView(this, "AttView"); | 91 | /*listView = new QListView(this, "AttView"); |
92 | listView->addColumn("Documents");* | 92 | listView->addColumn("Documents");* |
93 | connect(listView, SIGNAL(doubleClicked(QListViewItem *)), this, | 93 | connect(listView, SIGNAL(doubleClicked(QListViewItem*)), this, |
94 | SLOT(addattachment()) );*/ | 94 | SLOT(addattachment()) );*/ |
95 | 95 | ||
96 | 96 | ||
97 | attView = new QListView(this, "Selected"); | 97 | attView = new QListView(this, "Selected"); |
98 | attView->addColumn(tr("Attached")); | 98 | attView->addColumn(tr("Attached")); |
99 | attView->addColumn(tr("File type")); | 99 | attView->addColumn(tr("File type")); |
100 | connect(attView, SIGNAL(doubleClicked(QListViewItem *)), this, | 100 | connect(attView, SIGNAL(doubleClicked(QListViewItem*)), this, |
101 | SLOT(removeattachment()) ); | 101 | SLOT(removeattachment()) ); |
102 | 102 | ||
103 | //top->addWidget(ofs, 0,0); | 103 | //top->addWidget(ofs, 0,0); |
104 | top->addWidget(attView, 0,0); | 104 | top->addWidget(attView, 0,0); |
105 | 105 | ||
106 | clear(); | 106 | clear(); |
107 | 107 | ||
108 | 108 | ||
109 | } | 109 | } |
110 | 110 | ||
111 | void AddAtt::clear() | 111 | void AddAtt::clear() |
112 | { | 112 | { |
113 | attView->clear(); | 113 | attView->clear(); |
114 | //getFiles(); | 114 | //getFiles(); |
115 | modified = FALSE; | 115 | modified = FALSE; |
116 | } | 116 | } |
diff --git a/noncore/unsupported/mailit/emailclient.cpp b/noncore/unsupported/mailit/emailclient.cpp index 8359acf..86c7987 100644 --- a/noncore/unsupported/mailit/emailclient.cpp +++ b/noncore/unsupported/mailit/emailclient.cpp | |||
@@ -46,64 +46,64 @@ EmailClient::EmailClient( QWidget* parent, const char* name, WFlags fl ) | |||
46 | emailHandler = new EmailHandler(); | 46 | emailHandler = new EmailHandler(); |
47 | addressList = new AddressList(); | 47 | addressList = new AddressList(); |
48 | 48 | ||
49 | sending = FALSE; | 49 | sending = FALSE; |
50 | receiving = FALSE; | 50 | receiving = FALSE; |
51 | previewingMail = FALSE; | 51 | previewingMail = FALSE; |
52 | mailIdCount = 1; | 52 | mailIdCount = 1; |
53 | accountIdCount = 1; | 53 | accountIdCount = 1; |
54 | allAccounts = FALSE; | 54 | allAccounts = FALSE; |
55 | 55 | ||
56 | init(); | 56 | init(); |
57 | 57 | ||
58 | 58 | ||
59 | 59 | ||
60 | connect(emailHandler, SIGNAL(mailSent()), this, SLOT(mailSent()) ); | 60 | connect(emailHandler, SIGNAL(mailSent()), this, SLOT(mailSent()) ); |
61 | 61 | ||
62 | connect(emailHandler, SIGNAL(smtpError(int,const QString &)), this, | 62 | connect(emailHandler, SIGNAL(smtpError(int,const QString&)), this, |
63 | SLOT(smtpError(int,const QString &)) ); | 63 | SLOT(smtpError(int,const QString&)) ); |
64 | connect(emailHandler, SIGNAL(popError(int,const QString &)), this, | 64 | connect(emailHandler, SIGNAL(popError(int,const QString&)), this, |
65 | SLOT(popError(int,const QString &)) ); | 65 | SLOT(popError(int,const QString&)) ); |
66 | 66 | ||
67 | connect(inboxView, SIGNAL(doubleClicked(QListViewItem *)), this, SLOT(inboxItemSelected()) ); | 67 | connect(inboxView, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(inboxItemSelected()) ); |
68 | connect(outboxView, SIGNAL(doubleClicked(QListViewItem *)), this, SLOT(outboxItemSelected()) ); | 68 | connect(outboxView, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(outboxItemSelected()) ); |
69 | 69 | ||
70 | connect(inboxView, SIGNAL(pressed(QListViewItem *)), this, SLOT(inboxItemPressed()) ); | 70 | connect(inboxView, SIGNAL(pressed(QListViewItem*)), this, SLOT(inboxItemPressed()) ); |
71 | connect(inboxView, SIGNAL(clicked(QListViewItem *)), this, SLOT(inboxItemReleased()) ); | 71 | connect(inboxView, SIGNAL(clicked(QListViewItem*)), this, SLOT(inboxItemReleased()) ); |
72 | 72 | ||
73 | connect(emailHandler, SIGNAL(mailArrived(const Email &, bool)), this, | 73 | connect(emailHandler, SIGNAL(mailArrived(const Email&,bool)), this, |
74 | SLOT(mailArrived(const Email &, bool)) ); | 74 | SLOT(mailArrived(const Email&,bool)) ); |
75 | connect(emailHandler, SIGNAL(mailTransfered(int)), this, | 75 | connect(emailHandler, SIGNAL(mailTransfered(int)), this, |
76 | SLOT(allMailArrived(int)) ); | 76 | SLOT(allMailArrived(int)) ); |
77 | 77 | ||
78 | mailconf = new Config("mailit"); | 78 | mailconf = new Config("mailit"); |
79 | //In case Synchronize is not defined in settings.txt | 79 | //In case Synchronize is not defined in settings.txt |
80 | 80 | ||
81 | readSettings(); | 81 | readSettings(); |
82 | 82 | ||
83 | updateAccounts(); | 83 | updateAccounts(); |
84 | 84 | ||
85 | lineShift = "\n"; | 85 | lineShift = "\n"; |
86 | readMail(); | 86 | readMail(); |
87 | lineShift = "\r\n"; | 87 | lineShift = "\r\n"; |
88 | 88 | ||
89 | mailboxView->setCurrentTab(0); //ensure that inbox has focus | 89 | mailboxView->setCurrentTab(0); //ensure that inbox has focus |
90 | 90 | ||
91 | /*channel = new QCopChannel( "QPE/Application/mailit", this ); | 91 | /*channel = new QCopChannel( "QPE/Application/mailit", this ); |
92 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), | 92 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), |
93 | this, SLOT(receive(const QCString&, const QByteArray&)) );*/ | 93 | this, SLOT(receive(const QCString&,const QByteArray&)) );*/ |
94 | 94 | ||
95 | } | 95 | } |
96 | 96 | ||
97 | 97 | ||
98 | EmailClient::~EmailClient() | 98 | EmailClient::~EmailClient() |
99 | { | 99 | { |
100 | //needs to be moved from destructor to closewindow event | 100 | //needs to be moved from destructor to closewindow event |
101 | saveMail(getPath(FALSE) + "inbox.txt", inboxView); | 101 | saveMail(getPath(FALSE) + "inbox.txt", inboxView); |
102 | //does not currently work. Defining outbox in the same | 102 | //does not currently work. Defining outbox in the same |
103 | //format as inbox is not a good solution as they have | 103 | //format as inbox is not a good solution as they have |
104 | //different properties | 104 | //different properties |
105 | saveMail(getPath(FALSE) + "outbox.txt", outboxView); | 105 | saveMail(getPath(FALSE) + "outbox.txt", outboxView); |
106 | saveSettings(); | 106 | saveSettings(); |
107 | 107 | ||
108 | mailconf->write(); | 108 | mailconf->write(); |
109 | delete mailconf; | 109 | delete mailconf; |
@@ -204,36 +204,36 @@ void EmailClient::init() | |||
204 | "It keeps the queued mails to send which can be \n" | 204 | "It keeps the queued mails to send which can be \n" |
205 | "reviewed by double clicking the entry.")); | 205 | "reviewed by double clicking the entry.")); |
206 | grid_3->addWidget( outboxView, 0, 0 ); | 206 | grid_3->addWidget( outboxView, 0, 0 ); |
207 | mailboxView->addTab( widget_2,"mailit/outbox", tr( "Outbox" ) ); | 207 | mailboxView->addTab( widget_2,"mailit/outbox", tr( "Outbox" ) ); |
208 | 208 | ||
209 | setCentralWidget(mailboxView); | 209 | setCentralWidget(mailboxView); |
210 | 210 | ||
211 | } | 211 | } |
212 | 212 | ||
213 | void EmailClient::initStatusBar(QWidget* parent) | 213 | void EmailClient::initStatusBar(QWidget* parent) |
214 | { | 214 | { |
215 | statusBar = new QStatusBar(parent); | 215 | statusBar = new QStatusBar(parent); |
216 | statusBar->setSizeGripEnabled(FALSE); | 216 | statusBar->setSizeGripEnabled(FALSE); |
217 | 217 | ||
218 | status1Label = new QLabel( tr("Idle"), statusBar); | 218 | status1Label = new QLabel( tr("Idle"), statusBar); |
219 | status2Label = new QLabel("", statusBar); | 219 | status2Label = new QLabel("", statusBar); |
220 | connect(emailHandler, SIGNAL(updatePopStatus(const QString &)), | 220 | connect(emailHandler, SIGNAL(updatePopStatus(const QString&)), |
221 | status2Label, SLOT(setText(const QString &)) ); | 221 | status2Label, SLOT(setText(const QString&)) ); |
222 | connect(emailHandler, SIGNAL(updateSmtpStatus(const QString &)), | 222 | connect(emailHandler, SIGNAL(updateSmtpStatus(const QString&)), |
223 | status2Label, SLOT(setText(const QString &)) ); | 223 | status2Label, SLOT(setText(const QString&)) ); |
224 | 224 | ||
225 | progressBar = new QProgressBar(statusBar); | 225 | progressBar = new QProgressBar(statusBar); |
226 | 226 | ||
227 | connect(emailHandler, SIGNAL(mailboxSize(int)), | 227 | connect(emailHandler, SIGNAL(mailboxSize(int)), |
228 | this, SLOT(setTotalSize(int)) ); | 228 | this, SLOT(setTotalSize(int)) ); |
229 | connect(emailHandler, SIGNAL(currentMailSize(int)), | 229 | connect(emailHandler, SIGNAL(currentMailSize(int)), |
230 | this, SLOT(setMailSize(int)) ); | 230 | this, SLOT(setMailSize(int)) ); |
231 | connect(emailHandler, SIGNAL(downloadedSize(int)), | 231 | connect(emailHandler, SIGNAL(downloadedSize(int)), |
232 | this, SLOT(setDownloadedSize(int)) ); | 232 | this, SLOT(setDownloadedSize(int)) ); |
233 | 233 | ||
234 | statusBar->addWidget(status1Label); | 234 | statusBar->addWidget(status1Label); |
235 | statusBar->addWidget(progressBar); | 235 | statusBar->addWidget(progressBar); |
236 | statusBar->addWidget(status2Label); | 236 | statusBar->addWidget(status2Label); |
237 | 237 | ||
238 | } | 238 | } |
239 | 239 | ||
diff --git a/noncore/unsupported/mailit/emailhandler.cpp b/noncore/unsupported/mailit/emailhandler.cpp index 06e978d..02b3e9a 100644 --- a/noncore/unsupported/mailit/emailhandler.cpp +++ b/noncore/unsupported/mailit/emailhandler.cpp | |||
@@ -31,44 +31,44 @@ QCollection::Item EnclosureList::newItem(QCollection::Item d) | |||
31 | return dupl( (Enclosure *) d); | 31 | return dupl( (Enclosure *) d); |
32 | } | 32 | } |
33 | 33 | ||
34 | Enclosure* EnclosureList::dupl(Enclosure *in) | 34 | Enclosure* EnclosureList::dupl(Enclosure *in) |
35 | { | 35 | { |
36 | ac = new Enclosure(*in); | 36 | ac = new Enclosure(*in); |
37 | return ac; | 37 | return ac; |
38 | } | 38 | } |
39 | 39 | ||
40 | EmailHandler::EmailHandler() | 40 | EmailHandler::EmailHandler() |
41 | { | 41 | { |
42 | qDebug("EMailHandler::EmailHandler"); | 42 | qDebug("EMailHandler::EmailHandler"); |
43 | 43 | ||
44 | smtpClient = new SmtpClient(); | 44 | smtpClient = new SmtpClient(); |
45 | popClient = new PopClient(); | 45 | popClient = new PopClient(); |
46 | 46 | ||
47 | connect(smtpClient, SIGNAL(errorOccurred(int, const QString &)), this, | 47 | connect(smtpClient, SIGNAL(errorOccurred(int,const QString&)), this, |
48 | SIGNAL(smtpError(int, const QString &)) ); | 48 | SIGNAL(smtpError(int,const QString&)) ); |
49 | connect(smtpClient, SIGNAL(mailSent()), this, SIGNAL(mailSent()) ); | 49 | connect(smtpClient, SIGNAL(mailSent()), this, SIGNAL(mailSent()) ); |
50 | connect(smtpClient, SIGNAL(updateStatus(const QString &)), this, | 50 | connect(smtpClient, SIGNAL(updateStatus(const QString&)), this, |
51 | SIGNAL(updateSmtpStatus(const QString &)) ); | 51 | SIGNAL(updateSmtpStatus(const QString&)) ); |
52 | 52 | ||
53 | connect(popClient, SIGNAL(errorOccurred(int, const QString &)), this, | 53 | connect(popClient, SIGNAL(errorOccurred(int,const QString&)), this, |
54 | SIGNAL(popError(int, const QString &)) ); | 54 | SIGNAL(popError(int,const QString&)) ); |
55 | connect(popClient, SIGNAL(newMessage(const QString &, int, uint, bool)), | 55 | connect(popClient, SIGNAL(newMessage(const QString&,int,uint,bool)), |
56 | this, SLOT(messageArrived(const QString &, int, uint, bool)) ); | 56 | this, SLOT(messageArrived(const QString&,int,uint,bool)) ); |
57 | connect(popClient, SIGNAL(updateStatus(const QString &)), this, | 57 | connect(popClient, SIGNAL(updateStatus(const QString&)), this, |
58 | SIGNAL(updatePopStatus(const QString &)) ); | 58 | SIGNAL(updatePopStatus(const QString&)) ); |
59 | connect(popClient, SIGNAL(mailTransfered(int)), this, | 59 | connect(popClient, SIGNAL(mailTransfered(int)), this, |
60 | SIGNAL(mailTransfered(int)) ); | 60 | SIGNAL(mailTransfered(int)) ); |
61 | 61 | ||
62 | 62 | ||
63 | //relaying size information | 63 | //relaying size information |
64 | connect(popClient, SIGNAL(currentMailSize(int)), | 64 | connect(popClient, SIGNAL(currentMailSize(int)), |
65 | this, SIGNAL(currentMailSize(int)) ); | 65 | this, SIGNAL(currentMailSize(int)) ); |
66 | connect(popClient, SIGNAL(downloadedSize(int)), | 66 | connect(popClient, SIGNAL(downloadedSize(int)), |
67 | this, SIGNAL(downloadedSize(int)) ); | 67 | this, SIGNAL(downloadedSize(int)) ); |
68 | } | 68 | } |
69 | 69 | ||
70 | void EmailHandler::sendMail(QList<Email> *mailList) | 70 | void EmailHandler::sendMail(QList<Email> *mailList) |
71 | { | 71 | { |
72 | Email *currentMail; | 72 | Email *currentMail; |
73 | QString temp; | 73 | QString temp; |
74 | QString userName = QString::null; | 74 | QString userName = QString::null; |
diff --git a/noncore/unsupported/mailit/mailitwindow.cpp b/noncore/unsupported/mailit/mailitwindow.cpp index 6e298c7..fec4d78 100644 --- a/noncore/unsupported/mailit/mailitwindow.cpp +++ b/noncore/unsupported/mailit/mailitwindow.cpp | |||
@@ -24,58 +24,58 @@ | |||
24 | MailItWindow::MailItWindow(QWidget *parent, const char *name, WFlags /*fl*/) | 24 | MailItWindow::MailItWindow(QWidget *parent, const char *name, WFlags /*fl*/) |
25 | : QMainWindow(parent, name, WStyle_ContextHelp) | 25 | : QMainWindow(parent, name, WStyle_ContextHelp) |
26 | { | 26 | { |
27 | currentCaption = tr("Mailit"); | 27 | currentCaption = tr("Mailit"); |
28 | setCaption(tr(currentCaption)); | 28 | setCaption(tr(currentCaption)); |
29 | views = new QWidgetStack(this); | 29 | views = new QWidgetStack(this); |
30 | setCentralWidget(views); | 30 | setCentralWidget(views); |
31 | QWhatsThis::add(views,tr("Central view area")); | 31 | QWhatsThis::add(views,tr("Central view area")); |
32 | emailClient = new EmailClient(views, "client"); | 32 | emailClient = new EmailClient(views, "client"); |
33 | writeMail = new WriteMail(views, "writing"); | 33 | writeMail = new WriteMail(views, "writing"); |
34 | readMail = new ReadMail(views, "reading"); | 34 | readMail = new ReadMail(views, "reading"); |
35 | 35 | ||
36 | views->raiseWidget(emailClient); | 36 | views->raiseWidget(emailClient); |
37 | 37 | ||
38 | connect(emailClient, SIGNAL(composeRequested()), | 38 | connect(emailClient, SIGNAL(composeRequested()), |
39 | this, SLOT(compose()) ); | 39 | this, SLOT(compose()) ); |
40 | connect(emailClient, SIGNAL(viewEmail(QListView *, Email *)), this, | 40 | connect(emailClient, SIGNAL(viewEmail(QListView*,Email*)), this, |
41 | SLOT(viewMail(QListView *, Email *)) ); | 41 | SLOT(viewMail(QListView*,Email*)) ); |
42 | connect(emailClient, SIGNAL(mailUpdated(Email *)), this, | 42 | connect(emailClient, SIGNAL(mailUpdated(Email*)), this, |
43 | SLOT(updateMailView(Email *)) ); | 43 | SLOT(updateMailView(Email*)) ); |
44 | 44 | ||
45 | connect(writeMail, SIGNAL(cancelMail()), this, SLOT(showEmailClient()) ); | 45 | connect(writeMail, SIGNAL(cancelMail()), this, SLOT(showEmailClient()) ); |
46 | connect(writeMail, SIGNAL(sendMailRequested(const Email &)), this, | 46 | connect(writeMail, SIGNAL(sendMailRequested(const Email&)), this, |
47 | SLOT(showEmailClient()) ); | 47 | SLOT(showEmailClient()) ); |
48 | connect(writeMail, SIGNAL(sendMailRequested(const Email &)), emailClient, | 48 | connect(writeMail, SIGNAL(sendMailRequested(const Email&)), emailClient, |
49 | SLOT(enqueMail(const Email &)) ); | 49 | SLOT(enqueMail(const Email&)) ); |
50 | 50 | ||
51 | connect(readMail, SIGNAL(cancelView()), this, SLOT(showEmailClient()) ); | 51 | connect(readMail, SIGNAL(cancelView()), this, SLOT(showEmailClient()) ); |
52 | connect(readMail, SIGNAL(replyRequested(Email &, bool&)), this, | 52 | connect(readMail, SIGNAL(replyRequested(Email&,bool&)), this, |
53 | SLOT(composeReply(Email &, bool&)) ); | 53 | SLOT(composeReply(Email&,bool&)) ); |
54 | connect(readMail, SIGNAL(forwardRequested(Email &)), this, | 54 | connect(readMail, SIGNAL(forwardRequested(Email&)), this, |
55 | SLOT(composeForward(Email &)) ); | 55 | SLOT(composeForward(Email&)) ); |
56 | 56 | ||
57 | connect(readMail, SIGNAL(removeItem(EmailListItem *, bool &)), emailClient, | 57 | connect(readMail, SIGNAL(removeItem(EmailListItem*,bool&)), emailClient, |
58 | SLOT(deleteMail(EmailListItem *, bool &)) ); | 58 | SLOT(deleteMail(EmailListItem*,bool&)) ); |
59 | connect(readMail, SIGNAL(viewingMail(Email *)), emailClient, | 59 | connect(readMail, SIGNAL(viewingMail(Email*)), emailClient, |
60 | SLOT(moveMailFront(Email *)) ); | 60 | SLOT(moveMailFront(Email*)) ); |
61 | 61 | ||
62 | connect(emailClient, SIGNAL(newCaption(const QString &)), | 62 | connect(emailClient, SIGNAL(newCaption(const QString&)), |
63 | this, SLOT(updateCaption(const QString &)) ); | 63 | this, SLOT(updateCaption(const QString&)) ); |
64 | 64 | ||
65 | connect(readMail, SIGNAL(download(Email *)), emailClient, SLOT(download(Email*)) ); | 65 | connect(readMail, SIGNAL(download(Email*)), emailClient, SLOT(download(Email*)) ); |
66 | 66 | ||
67 | viewingMail = FALSE; | 67 | viewingMail = FALSE; |
68 | } | 68 | } |
69 | 69 | ||
70 | MailItWindow::~MailItWindow() | 70 | MailItWindow::~MailItWindow() |
71 | { | 71 | { |
72 | } | 72 | } |
73 | 73 | ||
74 | void MailItWindow::closeEvent(QCloseEvent *e) | 74 | void MailItWindow::closeEvent(QCloseEvent *e) |
75 | { | 75 | { |
76 | if (views->visibleWidget() == emailClient) { | 76 | if (views->visibleWidget() == emailClient) { |
77 | e->accept(); | 77 | e->accept(); |
78 | } else { | 78 | } else { |
79 | showEmailClient(); | 79 | showEmailClient(); |
80 | } | 80 | } |
81 | } | 81 | } |
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index a09bc30..7f1c0b8 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp | |||
@@ -163,54 +163,54 @@ void MainWindow::makeMenu() | |||
163 | setSections(); | 163 | setSections(); |
164 | setSubSections(); | 164 | setSubSections(); |
165 | sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 ); | 165 | sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 ); |
166 | connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) ); | 166 | connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) ); |
167 | sectionAction->setToggleAction( true ); | 167 | sectionAction->setToggleAction( true ); |
168 | sectionAction->addTo( viewMenu ); | 168 | sectionAction->addTo( viewMenu ); |
169 | // sectionBar->setStretchableWidget( section ); | 169 | // sectionBar->setStretchableWidget( section ); |
170 | 170 | ||
171 | //FIND | 171 | //FIND |
172 | findBar = new QToolBar(this); | 172 | findBar = new QToolBar(this); |
173 | addToolBar( findBar, "Filter", QMainWindow::Top, TRUE ); | 173 | addToolBar( findBar, "Filter", QMainWindow::Top, TRUE ); |
174 | label = new QLabel( tr("Filter: "), findBar ); | 174 | label = new QLabel( tr("Filter: "), findBar ); |
175 | // label->setBackgroundMode( PaletteForeground ); | 175 | // label->setBackgroundMode( PaletteForeground ); |
176 | findBar->setHorizontalStretchable( TRUE ); | 176 | findBar->setHorizontalStretchable( TRUE ); |
177 | findEdit = new QLineEdit( findBar, "findEdit" ); | 177 | findEdit = new QLineEdit( findBar, "findEdit" ); |
178 | findBar->setStretchableWidget( findEdit ); | 178 | findBar->setStretchableWidget( findEdit ); |
179 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), | 179 | connect( findEdit, SIGNAL( textChanged(const QString&) ), |
180 | this, SLOT( displayList() ) ); | 180 | this, SLOT( displayList() ) ); |
181 | a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); | 181 | a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); |
182 | connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) ); | 182 | connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) ); |
183 | a->addTo( findBar ); | 183 | a->addTo( findBar ); |
184 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 184 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
185 | connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); | 185 | connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); |
186 | a->addTo( findBar ); | 186 | a->addTo( findBar ); |
187 | findAction = new QAction( tr( "Filter" ), QString::null, 0, this, 0 ); | 187 | findAction = new QAction( tr( "Filter" ), QString::null, 0, this, 0 ); |
188 | connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); | 188 | connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); |
189 | findAction->setToggleAction( true ); | 189 | findAction->setToggleAction( true ); |
190 | findAction->addTo( viewMenu ); | 190 | findAction->addTo( viewMenu ); |
191 | 191 | ||
192 | //SEARCH | 192 | //SEARCH |
193 | searchBar = new QToolBar(this); | 193 | searchBar = new QToolBar(this); |
194 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); | 194 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); |
195 | label = new QLabel( tr("Search: "), searchBar ); | 195 | label = new QLabel( tr("Search: "), searchBar ); |
196 | // label->setBackgroundMode( PaletteForeground ); | 196 | // label->setBackgroundMode( PaletteForeground ); |
197 | searchBar->setHorizontalStretchable( TRUE ); | 197 | searchBar->setHorizontalStretchable( TRUE ); |
198 | searchEdit = new QLineEdit( searchBar, "seachEdit" ); | 198 | searchEdit = new QLineEdit( searchBar, "seachEdit" ); |
199 | searchBar->setStretchableWidget( searchEdit ); | 199 | searchBar->setStretchableWidget( searchEdit ); |
200 | // connect( searchEdit, SIGNAL( textChanged( const QString & ) ), | 200 | // connect( searchEdit, SIGNAL( textChanged(const QString&) ), |
201 | // this, SLOT( displayList() ) ); | 201 | // this, SLOT( displayList() ) ); |
202 | a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); | 202 | a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); |
203 | connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) ); | 203 | connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) ); |
204 | a->addTo( searchBar ); | 204 | a->addTo( searchBar ); |
205 | searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); | 205 | searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); |
206 | connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) ); | 206 | connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) ); |
207 | searchCommit->addTo( searchBar ); | 207 | searchCommit->addTo( searchBar ); |
208 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 208 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
209 | connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) ); | 209 | connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) ); |
210 | a->addTo( searchBar ); | 210 | a->addTo( searchBar ); |
211 | searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 ); | 211 | searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 ); |
212 | connect( searchAction, SIGNAL( toggled(bool) ), this, SLOT( searchShow(bool) ) ); | 212 | connect( searchAction, SIGNAL( toggled(bool) ), this, SLOT( searchShow(bool) ) ); |
213 | searchAction->setToggleAction( true ); | 213 | searchAction->setToggleAction( true ); |
214 | searchAction->addTo( viewMenu ); | 214 | searchAction->addTo( viewMenu ); |
215 | 215 | ||
216 | //DEST | 216 | //DEST |
@@ -455,34 +455,34 @@ void MainWindow::destClose() | |||
455 | destAction->setOn( false ); | 455 | destAction->setOn( false ); |
456 | } | 456 | } |
457 | 457 | ||
458 | void MainWindow::setDocument(const QString &fileName) | 458 | void MainWindow::setDocument(const QString &fileName) |
459 | { | 459 | { |
460 | if ( !QFile::exists( fileName ) ) return; | 460 | if ( !QFile::exists( fileName ) ) return; |
461 | ipkg->installFile( fileName ); | 461 | ipkg->installFile( fileName ); |
462 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 462 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
463 | QString lf = QString::null; | 463 | QString lf = QString::null; |
464 | e << lf; | 464 | e << lf; |
465 | } | 465 | } |
466 | 466 | ||
467 | 467 | ||
468 | void MainWindow::makeChannel() | 468 | void MainWindow::makeChannel() |
469 | { | 469 | { |
470 | channel = new QCopChannel( "QPE/Application/oipkg", this ); | 470 | channel = new QCopChannel( "QPE/Application/oipkg", this ); |
471 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), | 471 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), |
472 | this, SLOT(receive(const QCString&, const QByteArray&)) ); | 472 | this, SLOT(receive(const QCString&,const QByteArray&)) ); |
473 | } | 473 | } |
474 | 474 | ||
475 | 475 | ||
476 | 476 | ||
477 | void MainWindow::receive(const QCString &msg, const QByteArray &arg) | 477 | void MainWindow::receive(const QCString &msg, const QByteArray &arg) |
478 | { | 478 | { |
479 | pvDebug(3, "QCop "+msg+" "+QCString(arg)); | 479 | pvDebug(3, "QCop "+msg+" "+QCString(arg)); |
480 | if ( msg == "installFile(QString)" ) | 480 | if ( msg == "installFile(QString)" ) |
481 | { | 481 | { |
482 | ipkg->installFile( QString(arg) ); | 482 | ipkg->installFile( QString(arg) ); |
483 | }else if( msg == "removeFile(QString)" ) | 483 | }else if( msg == "removeFile(QString)" ) |
484 | { | 484 | { |
485 | ipkg->removeFile( QString(arg) ); | 485 | ipkg->removeFile( QString(arg) ); |
486 | }else if( msg == "createLinks(QString)" ) | 486 | }else if( msg == "createLinks(QString)" ) |
487 | { | 487 | { |
488 | ipkg->createLinks( QString(arg) ); | 488 | ipkg->createLinks( QString(arg) ); |
diff --git a/noncore/unsupported/oipkg/packagelistitem.cpp b/noncore/unsupported/oipkg/packagelistitem.cpp index 1610a37..1b4812d 100644 --- a/noncore/unsupported/oipkg/packagelistitem.cpp +++ b/noncore/unsupported/oipkg/packagelistitem.cpp | |||
@@ -198,39 +198,39 @@ QPopupMenu* PackageListItem::getPopupMenu() | |||
198 | qDebug("PackageListItem::showPopup "); | 198 | qDebug("PackageListItem::showPopup "); |
199 | 199 | ||
200 | if (!package->installed()){ | 200 | if (!package->installed()){ |
201 | popupMenu->insertItem( QObject::tr("Install to"), destsMenu ); | 201 | popupMenu->insertItem( QObject::tr("Install to"), destsMenu ); |
202 | QStringList dests = settings->getDestinationNames(); | 202 | QStringList dests = settings->getDestinationNames(); |
203 | QString ad = settings->getDestinationName(); | 203 | QString ad = settings->getDestinationName(); |
204 | for (uint i = 0; i < dests.count(); i++ ) | 204 | for (uint i = 0; i < dests.count(); i++ ) |
205 | { | 205 | { |
206 | popupAction = new QAction( dests[i], QString::null, 0, popupMenu, 0 ); | 206 | popupAction = new QAction( dests[i], QString::null, 0, popupMenu, 0 ); |
207 | popupAction->addTo( destsMenu ); | 207 | popupAction->addTo( destsMenu ); |
208 | if ( dests[i] == ad && getPackage()->toInstall() ) | 208 | if ( dests[i] == ad && getPackage()->toInstall() ) |
209 | { | 209 | { |
210 | popupAction->setToggleAction( true ); | 210 | popupAction->setToggleAction( true ); |
211 | popupAction->setOn(true); | 211 | popupAction->setOn(true); |
212 | } | 212 | } |
213 | } | 213 | } |
214 | connect( destsMenu, SIGNAL( activated( int ) ), | 214 | connect( destsMenu, SIGNAL( activated(int) ), |
215 | this, SLOT( menuAction( int ) ) ); | 215 | this, SLOT( menuAction(int) ) ); |
216 | popupMenu->popup( QCursor::pos() ); | 216 | popupMenu->popup( QCursor::pos() ); |
217 | }else{ | 217 | }else{ |
218 | popupMenu->insertItem( QObject::tr("Remove")); | 218 | popupMenu->insertItem( QObject::tr("Remove")); |
219 | connect( popupMenu, SIGNAL( activated( int ) ), | 219 | connect( popupMenu, SIGNAL( activated(int) ), |
220 | this, SLOT( menuAction( int ) ) ); | 220 | this, SLOT( menuAction(int) ) ); |
221 | popupMenu->popup( QCursor::pos() ); | 221 | popupMenu->popup( QCursor::pos() ); |
222 | } | 222 | } |
223 | return popupMenu; | 223 | return popupMenu; |
224 | } | 224 | } |
225 | 225 | ||
226 | void PackageListItem::menuAction( int i ) | 226 | void PackageListItem::menuAction( int i ) |
227 | { | 227 | { |
228 | if (!package->installed()){ | 228 | if (!package->installed()){ |
229 | package->setDest( destsMenu->text(i) ); | 229 | package->setDest( destsMenu->text(i) ); |
230 | package->setLink( settings->createLinks() ); | 230 | package->setLink( settings->createLinks() ); |
231 | } | 231 | } |
232 | package->setOn(); | 232 | package->setOn(); |
233 | displayDetails(); | 233 | displayDetails(); |
234 | } | 234 | } |
235 | 235 | ||
236 | //void PackageListItem::toggleProcess() | 236 | //void PackageListItem::toggleProcess() |
diff --git a/noncore/unsupported/oipkg/packagelistview.cpp b/noncore/unsupported/oipkg/packagelistview.cpp index 3c7435d..98ebf88 100644 --- a/noncore/unsupported/oipkg/packagelistview.cpp +++ b/noncore/unsupported/oipkg/packagelistview.cpp | |||
@@ -14,36 +14,36 @@ | |||
14 | 14 | ||
15 | #include "listviewitemoipkg.h" | 15 | #include "listviewitemoipkg.h" |
16 | #include "packagelistitem.h" | 16 | #include "packagelistitem.h" |
17 | #include "pksettings.h" | 17 | #include "pksettings.h" |
18 | 18 | ||
19 | PackageListView::PackageListView(QWidget *p, const char* n, PackageManagerSettings *s) | 19 | PackageListView::PackageListView(QWidget *p, const char* n, PackageManagerSettings *s) |
20 | : QListView(p,n) | 20 | : QListView(p,n) |
21 | { | 21 | { |
22 | settings = s; | 22 | settings = s; |
23 | popupTimer = new QTimer( this ); | 23 | popupTimer = new QTimer( this ); |
24 | setSelectionMode(QListView::NoSelection); | 24 | setSelectionMode(QListView::NoSelection); |
25 | addColumn( tr("Package") ); | 25 | addColumn( tr("Package") ); |
26 | setRootIsDecorated( true ); | 26 | setRootIsDecorated( true ); |
27 | 27 | ||
28 | connect( popupTimer, SIGNAL(timeout()), | 28 | connect( popupTimer, SIGNAL(timeout()), |
29 | this, SLOT(showPopup()) ); | 29 | this, SLOT(showPopup()) ); |
30 | connect( this, SIGNAL( pressed( QListViewItem* ) ), | 30 | connect( this, SIGNAL( pressed(QListViewItem*) ), |
31 | this, SLOT( setCurrent( QListViewItem* ) ) ); | 31 | this, SLOT( setCurrent(QListViewItem*) ) ); |
32 | connect( this, SIGNAL( clicked( QListViewItem* ) ), | 32 | connect( this, SIGNAL( clicked(QListViewItem*) ), |
33 | this, SLOT( stopTimer( QListViewItem* ) ) ); | 33 | this, SLOT( stopTimer(QListViewItem*) ) ); |
34 | 34 | ||
35 | } | 35 | } |
36 | 36 | ||
37 | //PackageListView::~PackageListView() | 37 | //PackageListView::~PackageListView() |
38 | //{ | 38 | //{ |
39 | //} | 39 | //} |
40 | 40 | ||
41 | void PackageListView::setCurrent( QListViewItem* p ) | 41 | void PackageListView::setCurrent( QListViewItem* p ) |
42 | { | 42 | { |
43 | qDebug("PackageListView::setCurrent "); | 43 | qDebug("PackageListView::setCurrent "); |
44 | activeItem = (ListViewItemOipkg*)p; | 44 | activeItem = (ListViewItemOipkg*)p; |
45 | 45 | ||
46 | if ( activeItem != 0 ) popupTimer->start( 750, true ); | 46 | if ( activeItem != 0 ) popupTimer->start( 750, true ); |
47 | 47 | ||
48 | // if ( activeItem->getType() != ListViewItemOipkg::Package ){ | 48 | // if ( activeItem->getType() != ListViewItemOipkg::Package ){ |
49 | // qDebug("PackageListView::setCurrent !p "); | 49 | // qDebug("PackageListView::setCurrent !p "); |
diff --git a/noncore/unsupported/oipkg/pksettings.cpp b/noncore/unsupported/oipkg/pksettings.cpp index 063b018..aac011e 100644 --- a/noncore/unsupported/oipkg/pksettings.cpp +++ b/noncore/unsupported/oipkg/pksettings.cpp | |||
@@ -33,33 +33,33 @@ | |||
33 | #include "debug.h" | 33 | #include "debug.h" |
34 | //#include "utils.h" | 34 | //#include "utils.h" |
35 | 35 | ||
36 | PackageManagerSettings::PackageManagerSettings( QWidget* parent, const char* name, WFlags fl ) | 36 | PackageManagerSettings::PackageManagerSettings( QWidget* parent, const char* name, WFlags fl ) |
37 | : PackageManagerSettingsBase( parent, name, fl ) | 37 | : PackageManagerSettingsBase( parent, name, fl ) |
38 | { | 38 | { |
39 | connect( newserver, SIGNAL(clicked()), this, SLOT(newServer()) ); | 39 | connect( newserver, SIGNAL(clicked()), this, SLOT(newServer()) ); |
40 | connect( removeserver, SIGNAL(clicked()), this, SLOT(removeServer()) ); | 40 | connect( removeserver, SIGNAL(clicked()), this, SLOT(removeServer()) ); |
41 | connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); | 41 | connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); |
42 | connect( newdestination, SIGNAL(clicked()), this, SLOT(newDestination()) ); | 42 | connect( newdestination, SIGNAL(clicked()), this, SLOT(newDestination()) ); |
43 | connect( removedestination, SIGNAL(clicked()), this, SLOT(removeDestination()) ); | 43 | connect( removedestination, SIGNAL(clicked()), this, SLOT(removeDestination()) ); |
44 | connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); | 44 | connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); |
45 | // connect( CheckBoxLink, SIGNAL(toggled(bool)), | 45 | // connect( CheckBoxLink, SIGNAL(toggled(bool)), |
46 | // activeLinkDestination, SLOT(setEnabled(bool)) ); | 46 | // activeLinkDestination, SLOT(setEnabled(bool)) ); |
47 | 47 | ||
48 | // connect( settingName, SIGNAL(activated(int)), this, SLOT(installationSettingChange(int)) ); | 48 | // connect( settingName, SIGNAL(activated(int)), this, SLOT(installationSettingChange(int)) ); |
49 | // connect( settingName, SIGNAL(textChanged(const QString &)), this, SLOT(installationSettingSetName(const QString &)) ); | 49 | // connect( settingName, SIGNAL(textChanged(const QString&)), this, SLOT(installationSettingSetName(const QString&)) ); |
50 | // connect( newsetting, SIGNAL(clicked()), this, SLOT(newInstallationSetting()) ); | 50 | // connect( newsetting, SIGNAL(clicked()), this, SLOT(newInstallationSetting()) ); |
51 | // connect( renamesetting, SIGNAL(clicked()), this, SLOT(renameInstallationSetting()) ); | 51 | // connect( renamesetting, SIGNAL(clicked()), this, SLOT(renameInstallationSetting()) ); |
52 | // connect( removesetting, SIGNAL(clicked()), this, SLOT(removeInstallationSetting()) ); | 52 | // connect( removesetting, SIGNAL(clicked()), this, SLOT(removeInstallationSetting()) ); |
53 | servername->setEnabled(FALSE); | 53 | servername->setEnabled(FALSE); |
54 | serverurl->setEnabled(FALSE); | 54 | serverurl->setEnabled(FALSE); |
55 | serverurlDic.setAutoDelete(TRUE); | 55 | serverurlDic.setAutoDelete(TRUE); |
56 | destinationname->setEnabled(FALSE); | 56 | destinationname->setEnabled(FALSE); |
57 | destinationurl->setEnabled(FALSE); | 57 | destinationurl->setEnabled(FALSE); |
58 | destinationurlDic.setAutoDelete(TRUE); | 58 | destinationurlDic.setAutoDelete(TRUE); |
59 | readSettings(); | 59 | readSettings(); |
60 | activeLinkDestination->hide(); | 60 | activeLinkDestination->hide(); |
61 | serverChanged = false; | 61 | serverChanged = false; |
62 | 62 | ||
63 | // get rid of setups | 63 | // get rid of setups |
64 | // Settings->hide(); | 64 | // Settings->hide(); |
65 | // settingName->hide(); | 65 | // settingName->hide(); |
diff --git a/noncore/unsupported/qpdf/qbusybar.cpp b/noncore/unsupported/qpdf/qbusybar.cpp index ce7ab8e..e942f06 100644 --- a/noncore/unsupported/qpdf/qbusybar.cpp +++ b/noncore/unsupported/qpdf/qbusybar.cpp | |||
@@ -4,33 +4,33 @@ | |||
4 | 4 | ||
5 | #include "qbusybar.h" | 5 | #include "qbusybar.h" |
6 | 6 | ||
7 | 7 | ||
8 | 8 | ||
9 | QBusyBar::QBusyBar ( QWidget *parent, const char *name, int flags ) : QWidget ( parent, name, flags | WRepaintNoErase ) | 9 | QBusyBar::QBusyBar ( QWidget *parent, const char *name, int flags ) : QWidget ( parent, name, flags | WRepaintNoErase ) |
10 | { | 10 | { |
11 | m_busy = 0; | 11 | m_busy = 0; |
12 | 12 | ||
13 | m_div = 0; | 13 | m_div = 0; |
14 | m_pos = 0; | 14 | m_pos = 0; |
15 | m_fade = 0; | 15 | m_fade = 0; |
16 | m_fadecols = 0; | 16 | m_fadecols = 0; |
17 | m_speed = 500; | 17 | m_speed = 500; |
18 | 18 | ||
19 | m_timer = new QTimer ( this ); | 19 | m_timer = new QTimer ( this ); |
20 | connect ( m_timer, SIGNAL( timeout ( )), this, SLOT( slotTimeout ( ))); | 20 | connect ( m_timer, SIGNAL( timeout()), this, SLOT( slotTimeout())); |
21 | 21 | ||
22 | setParameters ( 12, 8, 200 ); | 22 | setParameters ( 12, 8, 200 ); |
23 | } | 23 | } |
24 | 24 | ||
25 | void QBusyBar::setParameters ( int d, int s, int v ) | 25 | void QBusyBar::setParameters ( int d, int s, int v ) |
26 | { | 26 | { |
27 | bool running = m_timer-> isActive ( ); | 27 | bool running = m_timer-> isActive ( ); |
28 | 28 | ||
29 | if ( running ) | 29 | if ( running ) |
30 | m_timer-> stop ( ); | 30 | m_timer-> stop ( ); |
31 | 31 | ||
32 | m_div = d; | 32 | m_div = d; |
33 | m_speed = v; | 33 | m_speed = v; |
34 | 34 | ||
35 | delete [] m_fadecols; | 35 | delete [] m_fadecols; |
36 | m_fade = s; | 36 | m_fade = s; |
diff --git a/noncore/unsupported/qpdf/qpdf.cpp b/noncore/unsupported/qpdf/qpdf.cpp index 5cdcccf..75e86d0 100644 --- a/noncore/unsupported/qpdf/qpdf.cpp +++ b/noncore/unsupported/qpdf/qpdf.cpp | |||
@@ -72,91 +72,91 @@ QPdfDlg::QPdfDlg ( ) : QMainWindow ( ) | |||
72 | m_doc = 0; | 72 | m_doc = 0; |
73 | m_pages = 0; | 73 | m_pages = 0; |
74 | m_zoom = 72; | 74 | m_zoom = 72; |
75 | m_currentpage = 0; | 75 | m_currentpage = 0; |
76 | 76 | ||
77 | m_fullscreen = false; | 77 | m_fullscreen = false; |
78 | m_renderok = false; | 78 | m_renderok = false; |
79 | 79 | ||
80 | 80 | ||
81 | setToolBarsMovable ( false ); | 81 | setToolBarsMovable ( false ); |
82 | 82 | ||
83 | m_stack = new QWidgetStack ( this ); | 83 | m_stack = new QWidgetStack ( this ); |
84 | m_stack-> setSizePolicy ( QSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Expanding )); | 84 | m_stack-> setSizePolicy ( QSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Expanding )); |
85 | setCentralWidget ( m_stack ); | 85 | setCentralWidget ( m_stack ); |
86 | 86 | ||
87 | m_outdev = new QPEOutputDev ( m_stack ); | 87 | m_outdev = new QPEOutputDev ( m_stack ); |
88 | connect ( m_outdev, SIGNAL( selectionChanged ( const QRect & )), this, SLOT( copyToClipboard ( const QRect & ))); | 88 | connect ( m_outdev, SIGNAL( selectionChanged(const QRect&)), this, SLOT( copyToClipboard(const QRect&))); |
89 | 89 | ||
90 | #ifdef QPDF_QPE_ONLY | 90 | #ifdef QPDF_QPE_ONLY |
91 | m_filesel = new FileSelector ( "application/pdf", m_stack, "fs", false, true ); | 91 | m_filesel = new FileSelector ( "application/pdf", m_stack, "fs", false, true ); |
92 | #else | 92 | #else |
93 | m_filesel = new OFileSelector ( "application/pdf", m_stack, "fs", false, true ); | 93 | m_filesel = new OFileSelector ( "application/pdf", m_stack, "fs", false, true ); |
94 | #endif | 94 | #endif |
95 | 95 | ||
96 | connect ( m_filesel, SIGNAL( closeMe ( )), this, SLOT( closeFileSelector ( ))); | 96 | connect ( m_filesel, SIGNAL( closeMe()), this, SLOT( closeFileSelector())); |
97 | connect ( m_filesel, SIGNAL( fileSelected ( const DocLnk & )), this, SLOT( openFile ( const DocLnk & ))); | 97 | connect ( m_filesel, SIGNAL( fileSelected(const DocLnk&)), this, SLOT( openFile(const DocLnk&))); |
98 | 98 | ||
99 | m_tb_menu = new QToolBar ( this ); | 99 | m_tb_menu = new QToolBar ( this ); |
100 | m_tb_menu-> setHorizontalStretchable ( true ); | 100 | m_tb_menu-> setHorizontalStretchable ( true ); |
101 | 101 | ||
102 | QMenuBar *mb = new QMenuBar ( m_tb_menu ); | 102 | QMenuBar *mb = new QMenuBar ( m_tb_menu ); |
103 | 103 | ||
104 | m_pm_zoom = new QPopupMenu ( mb ); | 104 | m_pm_zoom = new QPopupMenu ( mb ); |
105 | m_pm_zoom-> setCheckable ( true ); | 105 | m_pm_zoom-> setCheckable ( true ); |
106 | 106 | ||
107 | mb-> insertItem ( tr( "Zoom" ), m_pm_zoom ); | 107 | mb-> insertItem ( tr( "Zoom" ), m_pm_zoom ); |
108 | 108 | ||
109 | m_pm_zoom-> insertItem ( tr( "Fit to width" ), 1 ); | 109 | m_pm_zoom-> insertItem ( tr( "Fit to width" ), 1 ); |
110 | m_pm_zoom-> insertItem ( tr( "Fit to page" ), 2 ); | 110 | m_pm_zoom-> insertItem ( tr( "Fit to page" ), 2 ); |
111 | m_pm_zoom-> insertSeparator ( ); | 111 | m_pm_zoom-> insertSeparator ( ); |
112 | m_pm_zoom-> insertItem ( tr( "50%" ), 50 ); | 112 | m_pm_zoom-> insertItem ( tr( "50%" ), 50 ); |
113 | m_pm_zoom-> insertItem ( tr( "75%" ), 75 ); | 113 | m_pm_zoom-> insertItem ( tr( "75%" ), 75 ); |
114 | m_pm_zoom-> insertItem ( tr( "100%" ), 100 ); | 114 | m_pm_zoom-> insertItem ( tr( "100%" ), 100 ); |
115 | m_pm_zoom-> insertItem ( tr( "125%" ), 125 ); | 115 | m_pm_zoom-> insertItem ( tr( "125%" ), 125 ); |
116 | m_pm_zoom-> insertItem ( tr( "150%" ), 150 ); | 116 | m_pm_zoom-> insertItem ( tr( "150%" ), 150 ); |
117 | m_pm_zoom-> insertItem ( tr( "200%" ), 200 ); | 117 | m_pm_zoom-> insertItem ( tr( "200%" ), 200 ); |
118 | 118 | ||
119 | connect ( m_pm_zoom, SIGNAL( activated ( int )), this, SLOT( setZoom ( int ))); | 119 | connect ( m_pm_zoom, SIGNAL( activated(int)), this, SLOT( setZoom(int))); |
120 | 120 | ||
121 | m_tb_tool = new QToolBar ( this ); | 121 | m_tb_tool = new QToolBar ( this ); |
122 | 122 | ||
123 | new QToolButton ( Resource::loadIconSet ( "fileopen" ), tr( "Open..." ), QString::null, this, SLOT( openFile ( )), m_tb_tool, "open" ); | 123 | new QToolButton ( Resource::loadIconSet ( "fileopen" ), tr( "Open..." ), QString::null, this, SLOT( openFile()), m_tb_tool, "open" ); |
124 | m_tb_tool-> addSeparator ( ); | 124 | m_tb_tool-> addSeparator ( ); |
125 | m_to_find = new QToolButton ( Resource::loadIconSet ( "find" ), tr( "Find..." ), QString::null, this, SLOT( toggleFindBar ( )), m_tb_tool, "find" ); | 125 | m_to_find = new QToolButton ( Resource::loadIconSet ( "find" ), tr( "Find..." ), QString::null, this, SLOT( toggleFindBar()), m_tb_tool, "find" ); |
126 | m_to_find-> setToggleButton ( true ); | 126 | m_to_find-> setToggleButton ( true ); |
127 | m_tb_tool-> addSeparator ( ); | 127 | m_tb_tool-> addSeparator ( ); |
128 | m_to_full = new QToolButton ( Resource::loadIconSet ( "fullscreen" ), tr( "Fullscreen" ), QString::null, this, SLOT( toggleFullscreen ( )), m_tb_tool, "fullscreen" ); | 128 | m_to_full = new QToolButton ( Resource::loadIconSet ( "fullscreen" ), tr( "Fullscreen" ), QString::null, this, SLOT( toggleFullscreen()), m_tb_tool, "fullscreen" ); |
129 | m_to_full-> setToggleButton ( true ); | 129 | m_to_full-> setToggleButton ( true ); |
130 | m_tb_tool-> addSeparator ( ); | 130 | m_tb_tool-> addSeparator ( ); |
131 | new QToolButton ( Resource::loadIconSet ( "fastback" ), tr( "First page" ), QString::null, this, SLOT( firstPage ( )), m_tb_tool, "first" ); | 131 | new QToolButton ( Resource::loadIconSet ( "fastback" ), tr( "First page" ), QString::null, this, SLOT( firstPage()), m_tb_tool, "first" ); |
132 | new QToolButton ( Resource::loadIconSet ( "back" ), tr( "Previous page" ), QString::null, this, SLOT( prevPage ( )), m_tb_tool, "prev" ); | 132 | new QToolButton ( Resource::loadIconSet ( "back" ), tr( "Previous page" ), QString::null, this, SLOT( prevPage()), m_tb_tool, "prev" ); |
133 | new QToolButton ( Resource::loadIconSet ( "down" ), tr( "Goto page..." ), QString::null, this, SLOT( gotoPageDialog ( )), m_tb_tool, "goto" ); | 133 | new QToolButton ( Resource::loadIconSet ( "down" ), tr( "Goto page..." ), QString::null, this, SLOT( gotoPageDialog()), m_tb_tool, "goto" ); |
134 | new QToolButton ( Resource::loadIconSet ( "forward" ), tr( "Next page" ), QString::null, this, SLOT( nextPage ( )), m_tb_tool, "next" ); | 134 | new QToolButton ( Resource::loadIconSet ( "forward" ), tr( "Next page" ), QString::null, this, SLOT( nextPage()), m_tb_tool, "next" ); |
135 | new QToolButton ( Resource::loadIconSet ( "fastforward" ), tr( "Last page" ), QString::null, this, SLOT( lastPage ( )), m_tb_tool, "last" ); | 135 | new QToolButton ( Resource::loadIconSet ( "fastforward" ), tr( "Last page" ), QString::null, this, SLOT( lastPage()), m_tb_tool, "last" ); |
136 | 136 | ||
137 | m_tb_find = new QToolBar ( this ); | 137 | m_tb_find = new QToolBar ( this ); |
138 | addToolBar ( m_tb_find, "Search", QMainWindow::Top, true ); | 138 | addToolBar ( m_tb_find, "Search", QMainWindow::Top, true ); |
139 | m_tb_find-> setHorizontalStretchable ( true ); | 139 | m_tb_find-> setHorizontalStretchable ( true ); |
140 | m_tb_find-> hide ( ); | 140 | m_tb_find-> hide ( ); |
141 | 141 | ||
142 | m_findedit = new QLineEdit ( m_tb_find, "findedit" ); | 142 | m_findedit = new QLineEdit ( m_tb_find, "findedit" ); |
143 | m_tb_find-> setStretchableWidget ( m_findedit ); | 143 | m_tb_find-> setStretchableWidget ( m_findedit ); |
144 | connect ( m_findedit, SIGNAL( textChanged ( const QString & )), this, SLOT( findText ( const QString & ))); | 144 | connect ( m_findedit, SIGNAL( textChanged(const QString&)), this, SLOT( findText(const QString&))); |
145 | 145 | ||
146 | new QToolButton ( Resource::loadIconSet ( "next" ), tr( "Next" ), QString::null, this, SLOT( findText ( )), m_tb_find, "findnext" ); | 146 | new QToolButton ( Resource::loadIconSet ( "next" ), tr( "Next" ), QString::null, this, SLOT( findText()), m_tb_find, "findnext" ); |
147 | 147 | ||
148 | openFile ( ); | 148 | openFile ( ); |
149 | } | 149 | } |
150 | 150 | ||
151 | QPdfDlg::~QPdfDlg ( ) | 151 | QPdfDlg::~QPdfDlg ( ) |
152 | { | 152 | { |
153 | delete m_doc; | 153 | delete m_doc; |
154 | } | 154 | } |
155 | 155 | ||
156 | // vv Fullscreen handling (for broken QT-lib) [David Hedbor, www.eongames.com] | 156 | // vv Fullscreen handling (for broken QT-lib) [David Hedbor, www.eongames.com] |
157 | 157 | ||
158 | void QPdfDlg::resizeEvent ( QResizeEvent * ) | 158 | void QPdfDlg::resizeEvent ( QResizeEvent * ) |
159 | { | 159 | { |
160 | if ( m_fullscreen && ( size ( ) != qApp-> desktop ( )-> size ( ))) | 160 | if ( m_fullscreen && ( size ( ) != qApp-> desktop ( )-> size ( ))) |
161 | setFullscreen ( true ); | 161 | setFullscreen ( true ); |
162 | } | 162 | } |
@@ -482,33 +482,33 @@ void QPdfDlg::openFile ( const DocLnk &f ) | |||
482 | QFileInfo fi ( fn ); | 482 | QFileInfo fi ( fn ); |
483 | 483 | ||
484 | if ( fi. exists ( )) { | 484 | if ( fi. exists ( )) { |
485 | delete m_doc; | 485 | delete m_doc; |
486 | 486 | ||
487 | m_doc = new PDFDoc ( new GString ( fn. local8Bit ( )), 0, 0 ); | 487 | m_doc = new PDFDoc ( new GString ( fn. local8Bit ( )), 0, 0 ); |
488 | 488 | ||
489 | if ( m_doc-> isOk ( )) { | 489 | if ( m_doc-> isOk ( )) { |
490 | m_currentdoc = f. name ( ); | 490 | m_currentdoc = f. name ( ); |
491 | int sep = m_currentdoc. findRev ( '/' ); | 491 | int sep = m_currentdoc. findRev ( '/' ); |
492 | if ( sep > 0 ) | 492 | if ( sep > 0 ) |
493 | m_currentdoc = m_currentdoc. mid ( sep + 1 ); | 493 | m_currentdoc = m_currentdoc. mid ( sep + 1 ); |
494 | 494 | ||
495 | m_pages = m_doc-> getNumPages ( ); | 495 | m_pages = m_doc-> getNumPages ( ); |
496 | m_currentpage = 0; | 496 | m_currentpage = 0; |
497 | 497 | ||
498 | QTimer::singleShot ( 0, this, SLOT( delayedInit ( ))); | 498 | QTimer::singleShot ( 0, this, SLOT( delayedInit())); |
499 | } | 499 | } |
500 | else { | 500 | else { |
501 | delete m_doc; | 501 | delete m_doc; |
502 | m_doc = 0; | 502 | m_doc = 0; |
503 | 503 | ||
504 | m_currentdoc = QString::null; | 504 | m_currentdoc = QString::null; |
505 | } | 505 | } |
506 | 506 | ||
507 | updateCaption ( ); | 507 | updateCaption ( ); |
508 | } | 508 | } |
509 | else | 509 | else |
510 | QMessageBox::warning ( this, tr( "Error" ), tr( "File does not exist!" )); | 510 | QMessageBox::warning ( this, tr( "Error" ), tr( "File does not exist!" )); |
511 | } | 511 | } |
512 | 512 | ||
513 | void QPdfDlg::setDocument ( const QString &f ) | 513 | void QPdfDlg::setDocument ( const QString &f ) |
514 | { | 514 | { |