19 #include "configdialog.h" 20 #include "configdialog.moc" 21 #include <tdelocale.h> 23 #include <tdeapplication.h> 24 #include <tdeglobal.h> 25 #include <tdeconfig.h> 26 #include <kstandarddirs.h> 27 #include <ksimpleconfig.h> 29 ConfigDialog::ConfigDialog(TQWidget * parent):KDialogBase(Plain, i18n( "Configure Holidays"), Ok|Cancel, Ok, 32 TQFrame *topFrame = plainPage(); 33 TQVBoxLayout *topLayout = 34 new TQVBoxLayout(topFrame, 0, spacingHint()); 36 israel_box = new TQCheckBox(topFrame); 37 israel_box->setText(i18n( "Use Israeli holidays")); 38 topLayout->addWidget(israel_box); 40 parsha_box = new TQCheckBox(topFrame); 41 parsha_box->setText(i18n( "Show weekly parsha")); 42 topLayout->addWidget(parsha_box); 44 omer_box = new TQCheckBox(topFrame); 45 omer_box->setText(i18n( "Show day of Omer")); 46 topLayout->addWidget(omer_box); 48 chol_box = new TQCheckBox(topFrame); 49 chol_box->setText(i18n( "Show Chol HaMoed")); 50 topLayout->addWidget(chol_box); 55 ConfigDialog::~ConfigDialog() 59 void ConfigDialog::load() 61 TDEConfig config( "korganizerrc", true, false); 63 config.setGroup( "Calendar/Hebrew Calendar Plugin"); 64 israel_box->setChecked(config. 65 readBoolEntry( "Israel", 66 (TDEGlobal::locale()-> 67 country() == ".il"))); 68 parsha_box->setChecked(config.readBoolEntry( "Parsha", true)); 69 chol_box->setChecked(config.readBoolEntry( "Chol_HaMoed", true)); 70 omer_box->setChecked(config.readBoolEntry( "Omer", true)); 74 void ConfigDialog::save() 76 TDEConfig config( "korganizerrc", false, false); 78 config.setGroup( "Calendar/Hebrew Calendar Plugin"); 79 config.writeEntry( "Israel", israel_box->isChecked()); 80 config.writeEntry( "Parsha", parsha_box->isChecked()); 81 config.writeEntry( "Chol_HaMoed", chol_box->isChecked()); 82 config.writeEntry( "Omer", omer_box->isChecked()); 86 void ConfigDialog::slotOk()
|