-rw-r--r-- | kmicromail/mainwindow.cpp | 64 |
1 files changed, 42 insertions, 22 deletions
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index 250d114..0794e00 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp | |||
@@ -21,2 +21,3 @@ extern QStatusBar* globalSstatusBarMainWindow; | |||
21 | #include "defines.h" | 21 | #include "defines.h" |
22 | #include "koprefs.h" | ||
22 | #include "mainwindow.h" | 23 | #include "mainwindow.h" |
@@ -86,3 +87,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
86 | 0, 0, this ); | 87 | 0, 0, this ); |
87 | searchMails->addTo( toolBar ); | 88 | searchMails->kopddTo( toolBar ); |
88 | searchMails->addTo( mailMenu ); | 89 | searchMails->addTo( mailMenu ); |
@@ -124,11 +125,27 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
124 | //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); | 125 | //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); |
125 | QWidget* infoBox = new QWidget( splithor ); | 126 | subLE = 0; |
126 | QGridLayout *griLay = new QGridLayout( infoBox, 2,2); | 127 | fromLE = 0; |
127 | griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 ); | 128 | toLE = 0; |
128 | griLay->addWidget( new QLabel ( i18n("Fr:"), infoBox ),1,0 ); | 129 | if ( KOPrefs::instance()->mShowInfoSub || KOPrefs::instance()->mShowInfoFrom || KOPrefs::instance()->mShowInfoTo ) { |
129 | griLay->addWidget( new QLabel ( i18n("To:"), infoBox ),2,0 ); | 130 | QWidget* infoBox = new QWidget( splithor ); |
130 | griLay->addWidget( subLE = new QLineEdit( infoBox ),0,1) ; | 131 | QGridLayout *griLay = new QGridLayout( infoBox, 2,2); |
131 | griLay->addWidget( fromLE = new QLineEdit( infoBox ),1,1) ; | 132 | if ( KOPrefs::instance()->mShowInfoSub ) { |
132 | griLay->addWidget( toLE = new QLineEdit( infoBox ),2,1) ; | 133 | griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 ); |
133 | infoBox->setMaximumHeight( infoBox->sizeHint().height() ); | 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 ); | ||
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 ); | ||
142 | griLay->addWidget( toLE = new QLineEdit( infoBox ),2,1) ; | ||
143 | } | ||
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 ); |
@@ -162,5 +179,8 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
162 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); | 179 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); |
163 | QPEApplication::setStylusOperation( subLE ,QPEApplication::RightOnHold); | 180 | if ( subLE ) |
164 | QPEApplication::setStylusOperation( fromLE ,QPEApplication::RightOnHold); | 181 | QPEApplication::setStylusOperation( subLE ,QPEApplication::RightOnHold); |
165 | QPEApplication::setStylusOperation( toLE ,QPEApplication::RightOnHold); | 182 | if ( fromLE ) |
183 | QPEApplication::setStylusOperation( fromLE ,QPEApplication::RightOnHold); | ||
184 | if ( toLE ) | ||
185 | QPEApplication::setStylusOperation( toLE ,QPEApplication::RightOnHold); | ||
166 | #endif | 186 | #endif |
@@ -229,5 +249,5 @@ void MainWindow::setInfoFields(QListViewItem* item ) | |||
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; |
@@ -235,8 +255,8 @@ void MainWindow::setInfoFields(QListViewItem* item ) | |||
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 | ||