-rw-r--r-- | kmicromail/mainwindow.cpp | 44 |
1 files changed, 32 insertions, 12 deletions
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index 250d114..0794e00 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp | |||
@@ -19,6 +19,7 @@ extern QStatusBar* globalSstatusBarMainWindow; | |||
19 | #include <klocale.h> | 19 | #include <klocale.h> |
20 | #endif | 20 | #endif |
21 | #include "defines.h" | 21 | #include "defines.h" |
22 | #include "koprefs.h" | ||
22 | #include "mainwindow.h" | 23 | #include "mainwindow.h" |
23 | #include "mailistviewitem.h" | 24 | #include "mailistviewitem.h" |
24 | #include <KDGanttMinimizeSplitter.h> | 25 | #include <KDGanttMinimizeSplitter.h> |
@@ -84,7 +85,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
84 | /* | 85 | /* |
85 | searchMails = new QAction( i18n( "Search mails" ), SmallIcon("find") ), | 86 | searchMails = new QAction( i18n( "Search mails" ), SmallIcon("find") ), |
86 | 0, 0, this ); | 87 | 0, 0, this ); |
87 | searchMails->addTo( toolBar ); | 88 | searchMails->kopddTo( toolBar ); |
88 | searchMails->addTo( mailMenu ); | 89 | searchMails->addTo( mailMenu ); |
89 | */ | 90 | */ |
90 | 91 | ||
@@ -122,15 +123,31 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
122 | KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, splithor); | 123 | KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, splithor); |
123 | split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); | 124 | split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); |
124 | //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); | 125 | //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); |
126 | subLE = 0; | ||
127 | fromLE = 0; | ||
128 | toLE = 0; | ||
129 | if ( KOPrefs::instance()->mShowInfoSub || KOPrefs::instance()->mShowInfoFrom || KOPrefs::instance()->mShowInfoTo ) { | ||
125 | QWidget* infoBox = new QWidget( splithor ); | 130 | QWidget* infoBox = new QWidget( splithor ); |
126 | QGridLayout *griLay = new QGridLayout( infoBox, 2,2); | 131 | QGridLayout *griLay = new QGridLayout( infoBox, 2,2); |
132 | if ( KOPrefs::instance()->mShowInfoSub ) { | ||
127 | griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 ); | 133 | griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 ); |
128 | griLay->addWidget( new QLabel ( i18n("Fr:"), infoBox ),1,0 ); | ||
129 | griLay->addWidget( new QLabel ( i18n("To:"), infoBox ),2,0 ); | ||
130 | griLay->addWidget( subLE = new QLineEdit( infoBox ),0,1) ; | 134 | griLay->addWidget( subLE = new QLineEdit( infoBox ),0,1) ; |
135 | } | ||
136 | if ( KOPrefs::instance()->mShowInfoFrom ) { | ||
137 | griLay->addWidget( new QLabel ( i18n("Fr:"), infoBox ),1,0 ); | ||
131 | griLay->addWidget( fromLE = new QLineEdit( infoBox ),1,1) ; | 138 | griLay->addWidget( fromLE = new QLineEdit( infoBox ),1,1) ; |
139 | } | ||
140 | if ( KOPrefs::instance()->mShowInfoTo ) { | ||
141 | griLay->addWidget( new QLabel ( i18n("To:"), infoBox ),2,0 ); | ||
132 | griLay->addWidget( toLE = new QLineEdit( infoBox ),2,1) ; | 142 | griLay->addWidget( toLE = new QLineEdit( infoBox ),2,1) ; |
143 | } | ||
133 | infoBox->setMaximumHeight( infoBox->sizeHint().height() ); | 144 | infoBox->setMaximumHeight( infoBox->sizeHint().height() ); |
145 | if ( !KOPrefs::instance()->mShowInfoStart ) { | ||
146 | QTimer::singleShot( 1,splithor, SLOT ( toggle() ) ); | ||
147 | } | ||
148 | } | ||
149 | |||
150 | |||
134 | folderView = new AccountView( split ); | 151 | folderView = new AccountView( split ); |
135 | folderView->header()->hide(); | 152 | folderView->header()->hide(); |
136 | folderView->setRootIsDecorated( false ); | 153 | folderView->setRootIsDecorated( false ); |
@@ -160,8 +177,11 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
160 | #ifndef DESKTOP_VERSION | 177 | #ifndef DESKTOP_VERSION |
161 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); | 178 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); |
162 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); | 179 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); |
180 | if ( subLE ) | ||
163 | QPEApplication::setStylusOperation( subLE ,QPEApplication::RightOnHold); | 181 | QPEApplication::setStylusOperation( subLE ,QPEApplication::RightOnHold); |
182 | if ( fromLE ) | ||
164 | QPEApplication::setStylusOperation( fromLE ,QPEApplication::RightOnHold); | 183 | QPEApplication::setStylusOperation( fromLE ,QPEApplication::RightOnHold); |
184 | if ( toLE ) | ||
165 | QPEApplication::setStylusOperation( toLE ,QPEApplication::RightOnHold); | 185 | QPEApplication::setStylusOperation( toLE ,QPEApplication::RightOnHold); |
166 | #endif | 186 | #endif |
167 | connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, | 187 | connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, |
@@ -227,18 +247,18 @@ MainWindow::~MainWindow() | |||
227 | void MainWindow::setInfoFields(QListViewItem* item ) | 247 | void MainWindow::setInfoFields(QListViewItem* item ) |
228 | { | 248 | { |
229 | if ( item == 0) { | 249 | if ( item == 0) { |
230 | subLE->setText(""); | 250 | if ( subLE ) subLE->setText(""); |
231 | fromLE->setText(""); | 251 | if ( fromLE ) fromLE->setText(""); |
232 | toLE->setText(""); | 252 | if ( toLE ) toLE->setText(""); |
233 | return; | 253 | return; |
234 | } | 254 | } |
235 | RecMailP mail = ((MailListViewItem*)item)->data(); | 255 | RecMailP mail = ((MailListViewItem*)item)->data(); |
236 | subLE->setText(mail->getSubject()); | 256 | if ( subLE ) subLE->setText(mail->getSubject()); |
237 | fromLE->setText(mail->getFrom()); | 257 | if ( fromLE ) fromLE->setText(mail->getFrom()); |
238 | toLE->setText(mail->To().join(";" )); | 258 | if ( toLE ) toLE->setText(mail->To().join(";" )); |
239 | subLE->setCursorPosition(0); | 259 | if ( subLE ) subLE->setCursorPosition(0); |
240 | fromLE->setCursorPosition(0); | 260 | if ( fromLE ) fromLE->setCursorPosition(0); |
241 | toLE->setCursorPosition(0); | 261 | if ( toLE ) toLE->setCursorPosition(0); |
242 | 262 | ||
243 | } | 263 | } |
244 | void MainWindow::slotSetCodec( int codec ) | 264 | void MainWindow::slotSetCodec( int codec ) |