author | zautrix <zautrix> | 2005-01-28 03:22:17 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-28 03:22:17 (UTC) |
commit | 94f0e8140c07696174dc3774dc2c11efad2ffa68 (patch) (side-by-side diff) | |
tree | d95cc80e5c5221e8d9ce1cbf4b01cbf78fdf843a /kmicromail/mainwindow.cpp | |
parent | 6fb044008531ec883fc25a3ef2b43904930cfff6 (diff) | |
download | kdepimpi-94f0e8140c07696174dc3774dc2c11efad2ffa68.zip kdepimpi-94f0e8140c07696174dc3774dc2c11efad2ffa68.tar.gz kdepimpi-94f0e8140c07696174dc3774dc2c11efad2ffa68.tar.bz2 |
missing config
-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 @@ -18,8 +18,9 @@ extern QStatusBar* globalSstatusBarMainWindow; #include <qpe/qpeapplication.h> #include <klocale.h> #endif #include "defines.h" +#include "koprefs.h" #include "mainwindow.h" #include "mailistviewitem.h" #include <KDGanttMinimizeSplitter.h> @@ -83,9 +84,9 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) /* searchMails = new QAction( i18n( "Search mails" ), SmallIcon("find") ), 0, 0, this ); - searchMails->addTo( toolBar ); + searchMails->kopddTo( toolBar ); searchMails->addTo( mailMenu ); */ deleteMails = new QAction(i18n("Delete Mail"), SmallIcon("trash"), 0, 0, this); @@ -121,17 +122,33 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) splithor->setMinimizeDirection( KDGanttMinimizeSplitter::Down); KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, splithor); split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); - QWidget* infoBox = new QWidget( splithor ); - QGridLayout *griLay = new QGridLayout( infoBox, 2,2); - griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 ); - griLay->addWidget( new QLabel ( i18n("Fr:"), infoBox ),1,0 ); - griLay->addWidget( new QLabel ( i18n("To:"), infoBox ),2,0 ); - griLay->addWidget( subLE = new QLineEdit( infoBox ),0,1) ; - griLay->addWidget( fromLE = new QLineEdit( infoBox ),1,1) ; - griLay->addWidget( toLE = new QLineEdit( infoBox ),2,1) ; - infoBox->setMaximumHeight( infoBox->sizeHint().height() ); + subLE = 0; + fromLE = 0; + toLE = 0; + if ( KOPrefs::instance()->mShowInfoSub || KOPrefs::instance()->mShowInfoFrom || KOPrefs::instance()->mShowInfoTo ) { + QWidget* infoBox = new QWidget( splithor ); + QGridLayout *griLay = new QGridLayout( infoBox, 2,2); + if ( KOPrefs::instance()->mShowInfoSub ) { + griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 ); + griLay->addWidget( subLE = new QLineEdit( infoBox ),0,1) ; + } + if ( KOPrefs::instance()->mShowInfoFrom ) { + griLay->addWidget( new QLabel ( i18n("Fr:"), infoBox ),1,0 ); + griLay->addWidget( fromLE = new QLineEdit( infoBox ),1,1) ; + } + if ( KOPrefs::instance()->mShowInfoTo ) { + griLay->addWidget( new QLabel ( i18n("To:"), infoBox ),2,0 ); + griLay->addWidget( toLE = new QLineEdit( infoBox ),2,1) ; + } + infoBox->setMaximumHeight( infoBox->sizeHint().height() ); + if ( !KOPrefs::instance()->mShowInfoStart ) { + QTimer::singleShot( 1,splithor, SLOT ( toggle() ) ); + } + } + + folderView = new AccountView( split ); folderView->header()->hide(); folderView->setRootIsDecorated( false ); folderView->addColumn( i18n( "Mailbox" ) ); @@ -159,11 +176,14 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) slotAdjustLayout(); #ifndef DESKTOP_VERSION QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); - QPEApplication::setStylusOperation( subLE ,QPEApplication::RightOnHold); - QPEApplication::setStylusOperation( fromLE ,QPEApplication::RightOnHold); - QPEApplication::setStylusOperation( toLE ,QPEApplication::RightOnHold); + if ( subLE ) + QPEApplication::setStylusOperation( subLE ,QPEApplication::RightOnHold); + if ( fromLE ) + QPEApplication::setStylusOperation( fromLE ,QPEApplication::RightOnHold); + if ( toLE ) + QPEApplication::setStylusOperation( toLE ,QPEApplication::RightOnHold); #endif connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, SLOT( mailLeftClicked(QListViewItem*) ) ); connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, @@ -226,20 +246,20 @@ MainWindow::~MainWindow() void MainWindow::setInfoFields(QListViewItem* item ) { if ( item == 0) { - subLE->setText(""); - fromLE->setText(""); - toLE->setText(""); + if ( subLE ) subLE->setText(""); + if ( fromLE ) fromLE->setText(""); + if ( toLE ) toLE->setText(""); return; } RecMailP mail = ((MailListViewItem*)item)->data(); - subLE->setText(mail->getSubject()); - fromLE->setText(mail->getFrom()); - toLE->setText(mail->To().join(";" )); - subLE->setCursorPosition(0); - fromLE->setCursorPosition(0); - toLE->setCursorPosition(0); + if ( subLE ) subLE->setText(mail->getSubject()); + if ( fromLE ) fromLE->setText(mail->getFrom()); + if ( toLE ) toLE->setText(mail->To().join(";" )); + if ( subLE ) subLE->setCursorPosition(0); + if ( fromLE ) fromLE->setCursorPosition(0); + if ( toLE ) toLE->setCursorPosition(0); } void MainWindow::slotSetCodec( int codec ) { |