Index: today.cpp =================================================================== RCS file: /cvs/opie/today/today.cpp,v retrieving revision 1.25 diff -u -r1.25 today.cpp --- today.cpp 7 Apr 2002 13:08:50 -0000 1.25 +++ today.cpp 8 Apr 2002 21:08:23 -0000 @@ -54,6 +54,7 @@ // show only later dates int ONLY_LATER; int AUTOSTART; +int SHOW_EMAIL; int NEW_START=1; /* @@ -144,7 +145,9 @@ void Today::draw() { init(); getDates(); - getMail(); + + if (SHOW_EMAIL) + getMail(); // if the todolist.xml file was not modified in between, do not parse it. if (checkIfModified()) { @@ -209,6 +212,8 @@ SHOW_NOTES = cfg.readNumEntry("shownotes",0); // should only later appointments be shown or all for the current day. ONLY_LATER = cfg.readNumEntry("onlylater",1); + // Show we show email? + SHOW_EMAIL = cfg.readNumEntry("showemail",1); //db = new DateBookDB; } @@ -238,6 +243,8 @@ conf->CheckBox3->setChecked(ONLY_LATER); // if today should be autostarted conf->CheckBoxAuto->setChecked(AUTOSTART); + // If we should show email. + conf->ShowEmailCheckBox->setChecked(SHOW_EMAIL); conf->exec(); @@ -248,6 +255,7 @@ int maxcharclip = conf->SpinBox7->value(); int onlylater = conf->CheckBox3->isChecked(); int autostart =conf->CheckBoxAuto->isChecked(); + int showemail =conf->ShowEmailCheckBox->isChecked(); cfg.writeEntry("maxlinestask",maxlinestask); cfg.writeEntry("maxcharclip", maxcharclip); @@ -255,6 +263,7 @@ cfg.writeEntry("showlocation",location); cfg.writeEntry("shownotes", notes); cfg.writeEntry("onlylater", onlylater); + cfg.writeEntry("showemail", showemail); cfg.setGroup("Autostart"); cfg.writeEntry("autostart", autostart); Index: todaybase.cpp =================================================================== RCS file: /cvs/opie/today/todaybase.cpp,v retrieving revision 1.12 diff -u -r1.12 todaybase.cpp --- todaybase.cpp 8 Apr 2002 19:58:35 -0000 1.12 +++ todaybase.cpp 8 Apr 2002 21:08:23 -0000 @@ -31,6 +31,7 @@ #include #include +#include /* * Constructs a TodayBase which is a child of 'parent', with the @@ -53,6 +54,12 @@ pal.setColor(QPalette::Disabled, QColorGroup::Button, col); this->setPalette(pal); + /* Read so we know whether or not to show email. */ + Config cfg("today"); + cfg.setGroup("BaseConfig"); + int SHOW_EMAIL=0; + SHOW_EMAIL = cfg.readNumEntry("showemail",1); + QWidget *d = QApplication::desktop(); int w=d->width(); @@ -139,13 +146,19 @@ MailField->setMaximumHeight(40); MailField->setMinimumHeight(15); + /* If we are not showing email then hide this frame. */ + if (! SHOW_EMAIL) { + MailFrame->setGeometry (QRect( 0, 0, 0, 0) ); + MailFrame->hide(); + } + // --- todo section -- Frame15 = new QFrame( this, "Frame15" ); Frame15->setFrameStyle( QFrame::NoFrame ); Frame15->setGeometry (QRect( 40, 3, this->width() , this->height()) ); QFrame* Line2 = new QFrame( Frame15); - Line2->setGeometry( QRect( -5, 0, MailFrame->width()+5, 5 ) ); + Line2->setGeometry( QRect( -5, 0, this->width()+5, 5 ) ); Line2->setFrameStyle( QFrame::HLine | QFrame::Sunken ); TodoButton = new QPushButton (Frame15, "TodoButton" ); @@ -177,12 +190,17 @@ layout->addWidget(Frame); layout->addWidget(OwnerField); layout->addWidget(Frame4); - layout->addWidget(MailFrame); + if ( SHOW_EMAIL ) + layout->addWidget(MailFrame); layout->addWidget(Frame15); layout->setStretchFactor(Frame4,5); - layout->setStretchFactor(MailFrame,1); - layout->setStretchFactor(Frame15,4); + if ( SHOW_EMAIL ) { + layout->setStretchFactor(MailFrame,1); + layout->setStretchFactor(Frame15,4); + } + else + layout->setStretchFactor(Frame15,5); } /* Index: todayconfig.cpp =================================================================== RCS file: /cvs/opie/today/todayconfig.cpp,v retrieving revision 1.5 diff -u -r1.5 todayconfig.cpp --- todayconfig.cpp 4 Apr 2002 15:02:30 -0000 1.5 +++ todayconfig.cpp 8 Apr 2002 21:08:23 -0000 @@ -131,7 +131,14 @@ CheckBoxAuto = new QCheckBox (Frame14, "CheckBoxAuto" ); CheckBoxAuto->setGeometry( QRect( 158, 60, 27, 21 ) ); - + + ShowEmail = new QLabel( Frame14, "ShowEmail" ); + ShowEmail->setGeometry( QRect( 20, 120, 100, 40 ) ); + ShowEmail->setText( tr( "Should email be\nshown?" ) ); + + ShowEmailCheckBox = new QCheckBox (Frame14, "ShowEmailCheckBox" ); + ShowEmailCheckBox->setGeometry( QRect( 158, 120, 27, 21 ) ); + TabWidget3->insertTab( tab_3, tr( "Misc" ) ); } Index: todayconfig.h =================================================================== RCS file: /cvs/opie/today/todayconfig.h,v retrieving revision 1.4 diff -u -r1.4 todayconfig.h --- todayconfig.h 11 Mar 2002 15:05:28 -0000 1.4 +++ todayconfig.h 8 Apr 2002 21:08:23 -0000 @@ -49,6 +49,8 @@ QFrame* Frame14; QLabel* TextLabel1; QSpinBox* SpinBox7; + QLabel* ShowEmail; + QCheckBox* ShowEmailCheckBox; };