From 94f0e8140c07696174dc3774dc2c11efad2ffa68 Mon Sep 17 00:00:00 2001 From: zautrix Date: Fri, 28 Jan 2005 03:22:17 +0000 Subject: missing config --- (limited to 'kmicromail/mainwindow.cpp') 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; #include #endif #include "defines.h" +#include "koprefs.h" #include "mainwindow.h" #include "mailistviewitem.h" #include @@ -84,7 +85,7 @@ 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 ); */ @@ -122,15 +123,31 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) 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 ); @@ -160,9 +177,12 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) #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*) ) ); @@ -227,18 +247,18 @@ 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 ) -- cgit v0.9.0.2