F:/KPlato/koffice/kplato/kptaccountsviewconfigdialog.cc

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002    Copyright (C) 2005 Dag Andersen <danders@get2net.dk>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #include "kptaccountsviewconfigdialog.h"
00021 
00022 #include <QCheckBox>
00023 #include <QComboBox>
00024 #include <q3datetimeedit.h>
00025 #include <qdatetime.h>
00026 #include <QString>
00027 
00028 #include <kdatewidget.h>
00029 #include <klocale.h>
00030 
00031 #include <kdebug.h>
00032 
00033 namespace KPlato
00034 {
00035 
00036 AccountsviewConfigDialog::AccountsviewConfigDialog(const QDate &date, int period,  const QStringList &periodTexts, bool cumulative, QWidget *p)
00037     : KDialog(p)
00038 {
00039     setCaption( i18n("Settings") );
00040     setButtons( Ok|Cancel );
00041     setDefaultButton( Ok );
00042     showButtonSeparator( true );
00043     m_panel = new AccountsviewConfigPanel(this);
00044     m_panel->dateEdit->setDate(date);
00045     m_panel->periodBox->addItems(periodTexts);
00046     m_panel->periodBox->setCurrentIndex(period);
00047     m_panel->cumulative->setChecked(cumulative);
00048     setMainWidget(m_panel);
00049 
00050     enableButtonOk(false);
00051 
00052     connect(m_panel, SIGNAL(changed(bool)), SLOT( enableButtonOk(bool)));
00053 }
00054 
00055 
00056 QDate AccountsviewConfigDialog::date() {
00057     return m_panel->dateEdit->date();
00058 }
00059 
00060 int AccountsviewConfigDialog::period() {
00061     return m_panel->periodBox->currentIndex();
00062 }
00063 
00064 QString AccountsviewConfigDialog::periodText() {
00065     return m_panel->periodBox->currentText();
00066 }
00067 
00068 bool AccountsviewConfigDialog::isCumulative() {
00069     return m_panel->cumulative->isChecked();
00070 }
00071 
00072 
00073 //----------------------------
00074 AccountsviewConfigPanel::AccountsviewConfigPanel(QWidget *parent)
00075     : AccountsviewConfigurePanelBase(parent) {
00076 
00077     connect(dateEdit, SIGNAL(changed(QDate)), SLOT(slotChanged()));
00078     connect(periodBox, SIGNAL(activated(int)), SLOT(slotChanged()));
00079     connect(cumulative, SIGNAL(clicked()), SLOT(slotChanged()));
00080 }
00081 
00082 void AccountsviewConfigPanel::slotChanged() {
00083     emit changed(true);
00084 }
00085 
00086 
00087 }  //KPlato namespace
00088 
00089 #include "kptaccountsviewconfigdialog.moc"

Généré le Wed Nov 22 23:40:55 2006 pour KPlato par  doxygen 1.5.1-p1