00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <tqbuttongroup.h>
00024 #include <tqcheckbox.h>
00025 #include <tqhbox.h>
00026 #include <tqlabel.h>
00027 #include <tqlayout.h>
00028 #include <tqlineedit.h>
00029 #include <tqpixmap.h>
00030 #include <tqpushbutton.h>
00031 #include <tqstring.h>
00032 #include <tqwidget.h>
00033 #include <tqwhatsthis.h>
00034
00035 #include <kiconloader.h>
00036 #include <tdelocale.h>
00037 #include <twinmodule.h>
00038
00039 #include "printdialog.h"
00040 #include <libtdepim/kdateedit.h>
00041
00042
00043 PrintDialog::PrintDialog()
00044 : KDialogBase(0, "PrintDialog", true, i18n("Print Dialog"), Ok|Cancel,
00045 Ok, true )
00046 {
00047 TQWidget *page = new TQWidget( this );
00048 setMainWidget(page);
00049 int year, month;
00050
00051 TQVBoxLayout *layout = new TQVBoxLayout(page, KDialog::spacingHint());
00052 layout->addSpacing(10);
00053 layout->addStretch(1);
00054
00055
00056 TQGroupBox *rangeGroup = new TQGroupBox(1, Qt::Horizontal, i18n("Date Range"),
00057 page);
00058 layout->addWidget(rangeGroup);
00059
00060 TQWidget *rangeWidget = new TQWidget(rangeGroup);
00061 TQHBoxLayout *rangeLayout = new TQHBoxLayout(rangeWidget, 0, spacingHint());
00062
00063 rangeLayout->addWidget(new TQLabel(i18n("From:"), rangeWidget));
00064 _from = new KDateEdit(rangeWidget);
00065
00066
00067 year = TQDate::currentDate().year();
00068 month = TQDate::currentDate().month();
00069 _from->setDate(TQDate(year, month, 1));
00070 rangeLayout->addWidget(_from);
00071 rangeLayout->addWidget(new TQLabel(i18n("To:"), rangeWidget));
00072 _to = new KDateEdit(rangeWidget);
00073 rangeLayout->addWidget(_to);
00074
00075 layout->addSpacing(10);
00076 layout->addStretch(1);
00077
00078 _allTasks = new TQComboBox( page );
00079 _allTasks->insertItem( i18n( "Selected Task" ) );
00080 _allTasks->insertItem( i18n( "All Tasks" ) );
00081 layout->addWidget( _allTasks );
00082
00083 _perWeek = new TQCheckBox( i18n( "Summarize per week" ), page );
00084 layout->addWidget( _perWeek );
00085 _totalsOnly = new TQCheckBox( i18n( "Totals only" ), page );
00086 layout->addWidget( _totalsOnly );
00087
00088 layout->addSpacing(10);
00089 layout->addStretch(1);
00090 }
00091
00092 TQDate PrintDialog::from() const
00093 {
00094 return _from->date();
00095 }
00096
00097 TQDate PrintDialog::to() const
00098 {
00099 return _to->date();
00100 }
00101
00102 bool PrintDialog::perWeek() const
00103 {
00104 return _perWeek->isChecked();
00105 }
00106
00107 bool PrintDialog::allTasks() const
00108 {
00109 return _allTasks->currentItem() == 1;
00110 }
00111
00112 bool PrintDialog::totalsOnly() const
00113 {
00114 return _totalsOnly->isChecked();
00115 }
00116
00117 #include "printdialog.moc"