author | alwin <alwin> | 2005-03-07 23:12:51 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-03-07 23:12:51 (UTC) |
commit | 2ba21de3fce9ca9fe9a70474a1927f0106d1d7ce (patch) (side-by-side diff) | |
tree | d0ff8c035e34a83fbc935c8f3f6ab926ed432559 | |
parent | a1fab1e1abd009a6a64c7ea3957bdb5587f4be81 (diff) | |
download | opie-2ba21de3fce9ca9fe9a70474a1927f0106d1d7ce.zip opie-2ba21de3fce9ca9fe9a70474a1927f0106d1d7ce.tar.gz opie-2ba21de3fce9ca9fe9a70474a1927f0106d1d7ce.tar.bz2 |
beauty
hopefull some speedups
obsolete stuff removed
fixed a crasher
-rw-r--r-- | noncore/net/mail/accountview.cpp | 1 | ||||
-rw-r--r-- | noncore/net/mail/mail.pro | 3 | ||||
-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 16 | ||||
-rw-r--r-- | noncore/net/mail/mainwindow.h | 2 | ||||
-rw-r--r-- | noncore/net/mail/opiemail.cpp | 12 | ||||
-rw-r--r-- | noncore/net/mail/statuswidget.cpp | 33 | ||||
-rw-r--r-- | noncore/net/mail/statuswidget.h | 24 | ||||
-rw-r--r-- | noncore/net/mail/statuswidgetui.ui | 71 | ||||
-rw-r--r-- | noncore/net/mail/viewmail.cpp | 37 | ||||
-rw-r--r-- | noncore/net/mail/viewmail.h | 4 |
10 files changed, 44 insertions, 159 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp index 0fe8475..c747a8b 100644 --- a/noncore/net/mail/accountview.cpp +++ b/noncore/net/mail/accountview.cpp @@ -60,5 +60,4 @@ void AccountView::populate( QList<Account> list ) imapAccounts.clear(); mhAccounts.clear(); - mhAccounts.append(new MHviewItem(AbstractMail::defaultLocalfolder(),this)); diff --git a/noncore/net/mail/mail.pro b/noncore/net/mail/mail.pro index e394bbf..a1de8b5 100644 --- a/noncore/net/mail/mail.pro +++ b/noncore/net/mail/mail.pro @@ -12,5 +12,4 @@ HEADERS = defines.h \ mailistviewitem.h \ settingsdialog.h \ - statuswidget.h \ newmaildir.h \ selectstore.h \ @@ -31,5 +30,4 @@ SOURCES = main.cpp \ mailistviewitem.cpp \ settingsdialog.cpp \ - statuswidget.cpp \ newmaildir.cpp \ selectstore.cpp \ @@ -47,5 +45,4 @@ INTERFACES = editaccountsui.ui \ composemailui.ui \ settingsdialogui.ui \ - statuswidgetui.ui \ newmaildirui.ui \ selectstoreui.ui \ diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp index 93d80d9..0a45445 100644 --- a/noncore/net/mail/mainwindow.cpp +++ b/noncore/net/mail/mainwindow.cpp @@ -82,10 +82,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) editAccounts->addTo( settingsMenu ); - //setCentralWidget( view ); - QVBox* wrapperBox = new QVBox( this ); - setCentralWidget( wrapperBox ); - - QWidget *view = new QWidget( wrapperBox ); + QWidget *view = new QWidget( this ); + setCentralWidget( view ); layout = new QBoxLayout ( view, QBoxLayout::LeftToRight ); @@ -107,7 +104,4 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) mailView->setSorting(4,false); - statusWidget = new StatusWidget( wrapperBox ); - statusWidget->hide(); - layout->addWidget( mailView ); layout->setStretchFactor( folderView, 1 ); @@ -125,12 +119,16 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); + connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), this,SLOT(refreshMailView(const QValueList<RecMailP>&))); + connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); + // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); // Added by Stefan Eilers to allow starting by addressbook.. // copied from old mail2 + #if !defined(QT_NO_COP) connect( qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ), @@ -141,5 +139,5 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) #endif - QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); + QTimer::singleShot( 10, this, SLOT( slotAdjustColumns() ) ); } diff --git a/noncore/net/mail/mainwindow.h b/noncore/net/mail/mainwindow.h index 8cec888..ad71a54 100644 --- a/noncore/net/mail/mainwindow.h +++ b/noncore/net/mail/mainwindow.h @@ -10,5 +10,4 @@ #include "accountview.h" -#include "statuswidget.h" #include <libmailwrapper/mailtypes.h> @@ -46,5 +45,4 @@ protected slots: protected: QToolBar *toolBar; - StatusWidget *statusWidget; QMenuBar *menuBar; QPopupMenu *mailMenu, *settingsMenu; diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp index 2bbc8f1..9eba23e 100644 --- a/noncore/net/mail/opiemail.cpp +++ b/noncore/net/mail/opiemail.cpp @@ -108,12 +108,5 @@ OpieMail::OpieMail( QWidget *parent, const char *name, WFlags ) setup_signalblocking(); settings = new Settings(); - folderView->populate( settings->getAccounts() ); -#if 0 - tvaluelist s = ValueExplode("a=1&b=holladiewaldfee&c=3&d=&e=3450"); - for (int i = 0; i < s.count();++i) { - odebug<<"Key: " << s[i].key << " Value: " << s[i].data << oendl; - } -#endif } @@ -249,8 +242,9 @@ void OpieMail::slotEditAccounts() EditAccounts eaDialog( settings, this, 0, true, WStyle_ContextHelp ); eaDialog.slotAdjustColumns(); - QPEApplication::execDialog( &eaDialog ); + if (QPEApplication::execDialog( &eaDialog )==QDialog::Rejected);// return; + if ( settings ) delete settings; settings = new Settings(); - + mailView->clear(); folderView->populate( settings->getAccounts() ); } diff --git a/noncore/net/mail/statuswidget.cpp b/noncore/net/mail/statuswidget.cpp deleted file mode 100644 index 19cf635..0000000 --- a/noncore/net/mail/statuswidget.cpp +++ b/dev/null @@ -1,33 +0,0 @@ -#include <qtimer.h> -#include <qprogressbar.h> -#include <qlabel.h> - -#include "statuswidget.h" - -// the current problem I see is "locking": used exclusive by one sender - - -StatusWidget::StatusWidget( QWidget* parent, const char* name,WFlags fl ) - : StatusWidgetUI( parent, name, fl ) { - - setMaximumHeight( 15 ); - // hide for now since nothing reports decent progress data yet. - statusProgress->hide(); - } - -StatusWidget::~StatusWidget() { -} - -void StatusWidget::setText( const QString& text ) { - show(); - statusText->setText( text ); - QTimer::singleShot( 5000, this, SLOT( hide() ) ); -} - -void StatusWidget::setProgress( int progress ) { - show(); - statusProgress->setProgress( progress ); - if ( progress == 100 ) { - hide(); - } -} diff --git a/noncore/net/mail/statuswidget.h b/noncore/net/mail/statuswidget.h deleted file mode 100644 index 73f0d75..0000000 --- a/noncore/net/mail/statuswidget.h +++ b/dev/null @@ -1,24 +0,0 @@ -#ifndef STATUS_WIDGET_H -#define STATUS_WIDGET_H - -#include <qwidget.h> -#include "statuswidgetui.h" - -class StatusWidget : public StatusWidgetUI { - -Q_OBJECT - -public: - StatusWidget( QWidget* parent = 0, const char* name = 0,WFlags fl = 0 ); - ~StatusWidget(); - - -public slots: - - void setText( const QString& text ); - void setProgress( int progress ); -}; - - -#endif - diff --git a/noncore/net/mail/statuswidgetui.ui b/noncore/net/mail/statuswidgetui.ui deleted file mode 100644 index ffe3528..0000000 --- a/noncore/net/mail/statuswidgetui.ui +++ b/dev/null @@ -1,71 +0,0 @@ -<!DOCTYPE UI><UI> -<class>StatusWidgetUI</class> -<widget> - <class>QWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>StatusWidgetUI</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>0</x> - <y>0</y> - <width>596</width> - <height>480</height> - </rect> - </property> - <property stdset="1"> - <name>caption</name> - <string>Form1</string> - </property> - <property> - <name>layoutMargin</name> - </property> - <property> - <name>layoutSpacing</name> - </property> - <hbox> - <property stdset="1"> - <name>margin</name> - <number>3</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>3</number> - </property> - <widget> - <class>QProgressBar</class> - <property stdset="1"> - <name>name</name> - <cstring>statusProgress</cstring> - </property> - <property stdset="1"> - <name>sizePolicy</name> - <sizepolicy> - <hsizetype>5</hsizetype> - <vsizetype>0</vsizetype> - </sizepolicy> - </property> - </widget> - <widget> - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>statusText</cstring> - </property> - <property stdset="1"> - <name>sizePolicy</name> - <sizepolicy> - <hsizetype>5</hsizetype> - <vsizetype>1</vsizetype> - </sizepolicy> - </property> - <property stdset="1"> - <name>text</name> - <string>TextLabel1</string> - </property> - </widget> - </hbox> -</widget> -</UI> diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp index a64a168..5206220 100644 --- a/noncore/net/mail/viewmail.cpp +++ b/noncore/net/mail/viewmail.cpp @@ -197,5 +197,5 @@ void ViewMail::slotShowHtml( bool state ) { m_showHtml = state; - setText(); + setMainText(); } @@ -207,5 +207,5 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int if ( ( ( AttachItem* )item )->Partnumber() == -1 ) { - setText(); + setMainText(); return; } @@ -251,4 +251,13 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int case 2: { + if (m_lastimagepart== (( AttachItem* )item )->Partnumber()) { + if (m_lastdlg) { + setUpdatesEnabled(false); + browser->hide(); + m_lastdlg->show(); + setUpdatesEnabled(true); + return; + } + } QString tmpfile = QString("/tmp/opiemail-image-%1").arg(_icounter++); encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); @@ -277,4 +286,5 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int QMessageBox::critical(this, tr("Reading attachment"), tr("Could not read content of attachment")); } + m_lastimagepart=(( AttachItem* )item )->Partnumber(); } break; @@ -282,5 +292,5 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int if ( ( ( AttachItem* )item )->Partnumber() == -1 ) { - setText(); + setMainText(); } else @@ -288,5 +298,15 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int if ( m_recMail->Wrapper() != 0l ) { // make sure that there is a wrapper , even after delete or simular actions - browser->setText( m_recMail->Wrapper()->fetchTextPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ) ); + if (m_lastdlg) { + m_lastdlg->hide(); + browser->show(); + } + if (m_lasttextpart == ( ( AttachItem* )item )->Partnumber() ) return; + m_lasttextpart = ( ( AttachItem* )item )->Partnumber(); + QString s = m_recMail->Wrapper()->fetchTextPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] );; + if (item->text(0).right(4)!="html") { + s = QString("<html><body>\n<font face=fixed>%1</font></body></html>").arg(QStyleSheet::convertFromPlainText(s)); + } + browser->setText(s); } } @@ -312,5 +332,5 @@ void ViewMail::setMail(const RecMailP&mail ) setCaption(tr("E-Mail by %1").arg( m_mail[0] ) ); - setText(); + setMainText(); } @@ -333,4 +353,6 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) m_lastdlg = 0; _icounter = 0; + m_lastimagepart = -1; + m_lasttextpart = -2; readConfig(); @@ -349,4 +371,5 @@ void ViewMail::slotImageInline(bool how) delete m_lastdlg; m_lastdlg = 0; + m_lastimagepart = -1; } } @@ -362,5 +385,5 @@ void ViewMail::readConfig() } -void ViewMail::setText() +void ViewMail::setMainText() { QString toString; @@ -373,4 +396,6 @@ void ViewMail::setText() } browser->show(); + if (m_lasttextpart == -1) return; + m_lasttextpart = -1; for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it ) { diff --git a/noncore/net/mail/viewmail.h b/noncore/net/mail/viewmail.h index f5033f0..18b1796 100644 --- a/noncore/net/mail/viewmail.h +++ b/noncore/net/mail/viewmail.h @@ -56,5 +56,5 @@ protected slots: void slotReply(); void slotForward(); - void setText(); + void setMainText(); void slotItemClicked( QListViewItem * item , const QPoint & point, int c ); void slotDeleteMail( ); @@ -73,4 +73,6 @@ private: bool m_PicsInline:1; unsigned int _icounter; + int m_lastimagepart; + int m_lasttextpart; // 0 from 1 subject 2 bodytext 3 date |