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

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002    Copyright (C) 2004 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;
00007    version 2 of the License.
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 <klocale.h>
00021 
00022 #include "kptcalendareditbase.h"
00023 
00024 #include <QVariant>
00025 #include <QPushButton>
00026 #include <q3groupbox.h>
00027 
00028 #include <Q3VBoxLayout>
00029 #include <Q3HBoxLayout>
00030 #include <Q3GridLayout>
00031 #include <kptcalendarpanel.h>
00032 #include <QLabel>
00033 #include <QComboBox>
00034 #include <q3buttongroup.h>
00035 #include <QHeaderView>
00036 #include <QTreeWidget>
00037 #include <q3listview.h>
00038 #include <q3datetimeedit.h>
00039 #include <QLayout>
00040 #include <QToolTip>
00041 #include <q3whatsthis.h>
00042 
00043 namespace KPlato
00044 {
00045 
00046 /*
00047  *  Constructs a CalendarEditBase as a child of 'parent', with the
00048  *  name 'name' and widget flags set to 'f'.
00049  */
00050 CalendarEditBase::CalendarEditBase( QWidget* parent, Qt::WFlags fl )
00051     : QWidget( parent, fl )
00052 {
00053     setObjectName( "CalendarEditBase" );
00054     CalendarEditBaseLayout = new Q3HBoxLayout( this, 0, 0, "CalendarEditBaseLayout");
00055 
00056     groupBox2 = new Q3GroupBox( this, "groupBox2" );
00057     groupBox2->setColumnLayout(0, Qt::Vertical );
00058     groupBox2->layout()->setSpacing( 6 );
00059     groupBox2->layout()->setMargin( 6 );
00060     groupBox2Layout = new Q3GridLayout( groupBox2->layout() );
00061     groupBox2Layout->setAlignment( Qt::AlignTop );
00062 
00063     calendarPanel = new CalendarPanel( groupBox2, "calendarPanel" );
00064 
00065     groupBox2Layout->addWidget( calendarPanel, 1, 0 );
00066 
00067     day = new Q3ButtonGroup( groupBox2, "day" );
00068     day->setColumnLayout(0, Qt::Vertical );
00069     day->layout()->setSpacing( 6 );
00070     day->layout()->setMargin( 6 );
00071     dayLayout = new Q3VBoxLayout( day->layout() );
00072     dayLayout->setAlignment( Qt::AlignTop );
00073 
00074     layout8 = new Q3HBoxLayout( 0, 0, 6, "layout8");
00075 
00076     state = new QComboBox( day );
00077     state->setObjectName( "state" );
00078     state->setEditable( false );
00079     layout8->addWidget( state );
00080 
00081     bApply = new QPushButton( day, "bApply" );
00082     layout8->addWidget( bApply );
00083     dayLayout->addLayout( layout8 );
00084 
00085     groupBox4 = new Q3GroupBox( day, "groupBox4" );
00086     groupBox4->setColumnLayout(0, Qt::Vertical );
00087     groupBox4->layout()->setSpacing( 6 );
00088     groupBox4->layout()->setMargin( 6 );
00089     groupBox4Layout = new Q3VBoxLayout( groupBox4->layout() );
00090     groupBox4Layout->setAlignment( Qt::AlignTop );
00091 
00092     intervalList = new QTreeWidget( groupBox4 );
00093     intervalList->setHeaderLabel( tr2i18n( "Work Interval" ) );
00094     groupBox4Layout->addWidget( intervalList );
00095 
00096     layout6 = new Q3HBoxLayout( 0, 0, 6, "layout6");
00097 
00098     startTime = new Q3TimeEdit( groupBox4, "startTime" );
00099     layout6->addWidget( startTime );
00100 
00101     endTime = new Q3TimeEdit( groupBox4, "endTime" );
00102     layout6->addWidget( endTime );
00103     groupBox4Layout->addLayout( layout6 );
00104 
00105     layout5 = new Q3HBoxLayout( 0, 0, 6, "layout5");
00106 
00107     bClear = new QPushButton( groupBox4, "bClear" );
00108     layout5->addWidget( bClear );
00109 
00110     bAddInterval = new QPushButton( groupBox4, "bAddInterval" );
00111     layout5->addWidget( bAddInterval );
00112     groupBox4Layout->addLayout( layout5 );
00113     dayLayout->addWidget( groupBox4 );
00114 
00115     groupBox2Layout->addWidget( day, 1, 1 );
00116     CalendarEditBaseLayout->addWidget( groupBox2 );
00117     languageChange();
00118     resize( QSize(540, 340).expandedTo(minimumSizeHint()) );
00119 #warning "kde4: port it ?"      
00120     //clearWState( WState_Polished );
00121 }
00122 
00123 /*
00124  *  Destroys the object and frees any allocated resources
00125  */
00126 CalendarEditBase::~CalendarEditBase()
00127 {
00128     // no need to delete child widgets, Qt does it all for us
00129 }
00130 
00131 /*
00132  *  Sets the strings of the subwidgets using the current
00133  *  language.
00134  */
00135 void CalendarEditBase::languageChange()
00136 {
00137     setCaption( tr2i18n( "CalendarEditBase" ) );
00138     groupBox2->setTitle( QString::null );
00139     day->setTitle( QString::null );
00140     bApply->setText( tr2i18n( "Apply" ) );
00141     groupBox4->setTitle( QString::null );
00142     intervalList->headerItem()->setText( 0, tr2i18n( "Work Interval" ) );
00143     bClear->setText( tr2i18n( "Clear" ) );
00144     bAddInterval->setText( tr2i18n( "Add Interval" ) );
00145 }
00146 
00147 }  //KPlato namespace
00148 
00149 #include "kptcalendareditbase.moc"

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