00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "datebookpluginconfig.h"
00019
00020 #include <qpe/config.h>
00021
00022 #include <qlayout.h>
00023
00024 DatebookPluginConfig::DatebookPluginConfig( QWidget* parent, const char* name)
00025 : TodayConfigWidget( parent, name ) {
00026
00027 QVBoxLayout *layout = new QVBoxLayout( this );
00028
00029 m_gui = new DatebookPluginConfigBase( this );
00030
00031 layout->addWidget( m_gui );
00032
00033 readConfig();
00034 }
00035
00036 void DatebookPluginConfig::readConfig() {
00037 Config cfg( "todaydatebookplugin" );
00038 cfg.setGroup( "config" );
00039
00040 m_max_lines_meet = cfg.readNumEntry( "maxlinesmeet", 5 );
00041 m_gui->SpinBox1->setValue( m_max_lines_meet );
00042 m_show_location = cfg.readNumEntry( "showlocation", 1 );
00043 m_gui->CheckBox1->setChecked( m_show_location );
00044 m_show_notes = cfg.readNumEntry( "shownotes", 0 );
00045 m_gui->CheckBox2->setChecked( m_show_notes );
00046 m_only_later = cfg.readNumEntry( "onlylater", 1 );
00047 m_gui->CheckBox4->setChecked( cfg.readNumEntry( "timeextraline", 1 ) );
00048 m_gui->CheckBox3->setChecked( m_only_later );
00049 m_more_days = cfg.readNumEntry( "moredays", 0 );
00050 m_gui->SpinBox2->setValue( m_more_days );
00051 m_maxCharClip = cfg.readNumEntry( "maxcharclip" , 38 );
00052 m_gui->SpinBox3->setValue( m_maxCharClip );
00053 }
00054
00055
00056 void DatebookPluginConfig::writeConfig() {
00057 Config cfg( "todaydatebookplugin" );
00058 cfg.setGroup( "config" );
00059
00060 m_max_lines_meet = m_gui->SpinBox1->value();
00061 cfg.writeEntry( "maxlinesmeet", m_max_lines_meet);
00062 m_show_location = m_gui->CheckBox1->isChecked();
00063 cfg.writeEntry( "showlocation", m_show_location);
00064 m_show_notes = m_gui->CheckBox2->isChecked();
00065 cfg.writeEntry( "shownotes", m_show_notes );
00066 m_only_later = m_gui->CheckBox3->isChecked();
00067 cfg.writeEntry( "timeextraline", m_gui->CheckBox4->isChecked() );
00068 cfg.writeEntry( "onlylater", m_only_later );
00069 m_more_days = m_gui->SpinBox2->value();
00070 cfg.writeEntry( "moredays", m_more_days );
00071 m_maxCharClip = m_gui->SpinBox3->value();
00072 cfg.writeEntry( "maxcharclip", m_maxCharClip );
00073 cfg.write();
00074 }
00075
00076 DatebookPluginConfig::~DatebookPluginConfig() {
00077 }