korganizer

koeditoralarms_base.cpp

00001 #include <kdialog.h>
00002 #include <klocale.h>
00003 /****************************************************************************
00004 ** Form implementation generated from reading ui file './koeditoralarms_base.ui'
00005 **
00006 ** Created: Sun Sep 30 15:34:23 2007
00007 **      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.8   edited Jan 11 14:47 $)
00008 **
00009 ** WARNING! All changes made in this file will be lost!
00010 ****************************************************************************/
00011 
00012 #include "koeditoralarms_base.h"
00013 
00014 #include <qvariant.h>
00015 #include <qpushbutton.h>
00016 #include <qgroupbox.h>
00017 #include <qspinbox.h>
00018 #include <qcombobox.h>
00019 #include <qlabel.h>
00020 #include <qcheckbox.h>
00021 #include <qbuttongroup.h>
00022 #include <qradiobutton.h>
00023 #include <qframe.h>
00024 #include <qwidgetstack.h>
00025 #include <qtextedit.h>
00026 #include <kurlrequester.h>
00027 #include <qlineedit.h>
00028 #include <qheader.h>
00029 #include <qlistview.h>
00030 #include <qlayout.h>
00031 #include <qtooltip.h>
00032 #include <qwhatsthis.h>
00033 #include "kurlrequester.h"
00034 #include "klineedit.h"
00035 #include "kpushbutton.h"
00036 #include "libkdepim/addresseelineedit.h"
00037 
00038 /*
00039  *  Constructs a KOEditorAlarms_base as a child of 'parent', with the
00040  *  name 'name' and widget flags set to 'f'.
00041  */
00042 KOEditorAlarms_base::KOEditorAlarms_base( QWidget* parent, const char* name, WFlags fl )
00043     : QWidget( parent, name, fl )
00044 {
00045     if ( !name )
00046     setName( "KOEditorAlarms_base" );
00047     KOEditorAlarms_baseLayout = new QGridLayout( this, 1, 1, 0, 6, "KOEditorAlarms_baseLayout"); 
00048 
00049     mTimeGroup = new QGroupBox( this, "mTimeGroup" );
00050     mTimeGroup->setColumnLayout(0, Qt::Vertical );
00051     mTimeGroup->layout()->setSpacing( 6 );
00052     mTimeGroup->layout()->setMargin( 11 );
00053     mTimeGroupLayout = new QVBoxLayout( mTimeGroup->layout() );
00054     mTimeGroupLayout->setAlignment( Qt::AlignTop );
00055 
00056     layout3 = new QHBoxLayout( 0, 0, 6, "layout3"); 
00057 
00058     mAlarmOffset = new QSpinBox( mTimeGroup, "mAlarmOffset" );
00059     mAlarmOffset->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)0, 0, 0, mAlarmOffset->sizePolicy().hasHeightForWidth() ) );
00060     mAlarmOffset->setMaxValue( 999999999 );
00061     layout3->addWidget( mAlarmOffset );
00062 
00063     mOffsetUnit = new QComboBox( FALSE, mTimeGroup, "mOffsetUnit" );
00064     layout3->addWidget( mOffsetUnit );
00065 
00066     mBeforeAfter = new QComboBox( FALSE, mTimeGroup, "mBeforeAfter" );
00067     layout3->addWidget( mBeforeAfter );
00068     mTimeGroupLayout->addLayout( layout3 );
00069 
00070     layout8 = new QGridLayout( 0, 1, 1, 0, 6, "layout8"); 
00071 
00072     mHowOftenLabel = new QLabel( mTimeGroup, "mHowOftenLabel" );
00073     mHowOftenLabel->setEnabled( FALSE );
00074     mHowOftenLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)5, 0, 0, mHowOftenLabel->sizePolicy().hasHeightForWidth() ) );
00075 
00076     layout8->addWidget( mHowOftenLabel, 0, 1 );
00077 
00078     mRepeatCount = new QSpinBox( mTimeGroup, "mRepeatCount" );
00079     mRepeatCount->setEnabled( FALSE );
00080     mRepeatCount->setMaxValue( 500 );
00081     mRepeatCount->setMinValue( 1 );
00082 
00083     layout8->addWidget( mRepeatCount, 0, 2 );
00084 
00085     mIntervalLabel = new QLabel( mTimeGroup, "mIntervalLabel" );
00086     mIntervalLabel->setEnabled( FALSE );
00087 
00088     layout8->addWidget( mIntervalLabel, 1, 1 );
00089 
00090     mRepeats = new QCheckBox( mTimeGroup, "mRepeats" );
00091     mRepeats->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)0, 0, 0, mRepeats->sizePolicy().hasHeightForWidth() ) );
00092 
00093     layout8->addWidget( mRepeats, 0, 0 );
00094 
00095     mRepeatInterval = new QSpinBox( mTimeGroup, "mRepeatInterval" );
00096     mRepeatInterval->setEnabled( FALSE );
00097     mRepeatInterval->setMaxValue( 999 );
00098     mRepeatInterval->setMinValue( 1 );
00099 
00100     layout8->addWidget( mRepeatInterval, 1, 2 );
00101     mTimeGroupLayout->addLayout( layout8 );
00102 
00103     KOEditorAlarms_baseLayout->addWidget( mTimeGroup, 1, 0 );
00104 
00105     mTypeGroup = new QGroupBox( this, "mTypeGroup" );
00106     mTypeGroup->setColumnLayout(0, Qt::Vertical );
00107     mTypeGroup->layout()->setSpacing( 6 );
00108     mTypeGroup->layout()->setMargin( 11 );
00109     mTypeGroupLayout = new QHBoxLayout( mTypeGroup->layout() );
00110     mTypeGroupLayout->setAlignment( Qt::AlignTop );
00111 
00112     mAlarmType = new QButtonGroup( mTypeGroup, "mAlarmType" );
00113     mAlarmType->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)5, 0, 0, mAlarmType->sizePolicy().hasHeightForWidth() ) );
00114     mAlarmType->setFrameShape( QButtonGroup::NoFrame );
00115     mAlarmType->setLineWidth( 0 );
00116     mAlarmType->setFlat( TRUE );
00117     mAlarmType->setColumnLayout(0, Qt::Vertical );
00118     mAlarmType->layout()->setSpacing( 6 );
00119     mAlarmType->layout()->setMargin( 0 );
00120     mAlarmTypeLayout = new QVBoxLayout( mAlarmType->layout() );
00121     mAlarmTypeLayout->setAlignment( Qt::AlignTop );
00122 
00123     mTypeDisplayRadio = new QRadioButton( mAlarmType, "mTypeDisplayRadio" );
00124     mTypeDisplayRadio->setChecked( TRUE );
00125     mAlarmTypeLayout->addWidget( mTypeDisplayRadio );
00126 
00127     mTypeSoundRadio = new QRadioButton( mAlarmType, "mTypeSoundRadio" );
00128     mAlarmTypeLayout->addWidget( mTypeSoundRadio );
00129 
00130     mTypeAppRadio = new QRadioButton( mAlarmType, "mTypeAppRadio" );
00131     mAlarmTypeLayout->addWidget( mTypeAppRadio );
00132 
00133     mTypeEmailRadio = new QRadioButton( mAlarmType, "mTypeEmailRadio" );
00134     mTypeEmailRadio->setEnabled( FALSE );
00135     mAlarmTypeLayout->addWidget( mTypeEmailRadio );
00136     spacer2 = new QSpacerItem( 21, 41, QSizePolicy::Minimum, QSizePolicy::Expanding );
00137     mAlarmTypeLayout->addItem( spacer2 );
00138     mTypeGroupLayout->addWidget( mAlarmType );
00139 
00140     line1 = new QFrame( mTypeGroup, "line1" );
00141     line1->setFrameShape( QFrame::VLine );
00142     line1->setFrameShadow( QFrame::Sunken );
00143     line1->setFrameShape( QFrame::VLine );
00144     mTypeGroupLayout->addWidget( line1 );
00145 
00146     mTypeStack = new QWidgetStack( mTypeGroup, "mTypeStack" );
00147 
00148     WStackPage = new QWidget( mTypeStack, "WStackPage" );
00149     WStackPageLayout = new QVBoxLayout( WStackPage, 0, 6, "WStackPageLayout"); 
00150 
00151     mDisplayTextLabel = new QLabel( WStackPage, "mDisplayTextLabel" );
00152     WStackPageLayout->addWidget( mDisplayTextLabel );
00153 
00154     mDisplayText = new QTextEdit( WStackPage, "mDisplayText" );
00155     WStackPageLayout->addWidget( mDisplayText );
00156     mTypeStack->addWidget( WStackPage, 0 );
00157 
00158     WStackPage_2 = new QWidget( mTypeStack, "WStackPage_2" );
00159     WStackPageLayout_2 = new QVBoxLayout( WStackPage_2, 0, 6, "WStackPageLayout_2"); 
00160 
00161     mSoundFileLabel = new QLabel( WStackPage_2, "mSoundFileLabel" );
00162     WStackPageLayout_2->addWidget( mSoundFileLabel );
00163 
00164     mSoundFile = new KURLRequester( WStackPage_2, "mSoundFile" );
00165     WStackPageLayout_2->addWidget( mSoundFile );
00166     spacer3 = new QSpacerItem( 20, 61, QSizePolicy::Minimum, QSizePolicy::Expanding );
00167     WStackPageLayout_2->addItem( spacer3 );
00168     mTypeStack->addWidget( WStackPage_2, 1 );
00169 
00170     WStackPage_3 = new QWidget( mTypeStack, "WStackPage_3" );
00171     WStackPageLayout_3 = new QVBoxLayout( WStackPage_3, 0, 6, "WStackPageLayout_3"); 
00172 
00173     mApplicationLabel = new QLabel( WStackPage_3, "mApplicationLabel" );
00174     WStackPageLayout_3->addWidget( mApplicationLabel );
00175 
00176     mApplication = new KURLRequester( WStackPage_3, "mApplication" );
00177     WStackPageLayout_3->addWidget( mApplication );
00178 
00179     mAppArgumentsLabel = new QLabel( WStackPage_3, "mAppArgumentsLabel" );
00180     WStackPageLayout_3->addWidget( mAppArgumentsLabel );
00181 
00182     mAppArguments = new QLineEdit( WStackPage_3, "mAppArguments" );
00183     WStackPageLayout_3->addWidget( mAppArguments );
00184     spacer3_2 = new QSpacerItem( 20, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
00185     WStackPageLayout_3->addItem( spacer3_2 );
00186     mTypeStack->addWidget( WStackPage_3, 2 );
00187 
00188     WStackPage_4 = new QWidget( mTypeStack, "WStackPage_4" );
00189     WStackPageLayout_4 = new QGridLayout( WStackPage_4, 1, 1, 0, 6, "WStackPageLayout_4"); 
00190 
00191     mEmailTextLabel = new QLabel( WStackPage_4, "mEmailTextLabel" );
00192 
00193     WStackPageLayout_4->addMultiCellWidget( mEmailTextLabel, 1, 1, 0, 1 );
00194 
00195     mEmailText = new QTextEdit( WStackPage_4, "mEmailText" );
00196 
00197     WStackPageLayout_4->addMultiCellWidget( mEmailText, 2, 2, 0, 1 );
00198 
00199     mEmailAddress = new KPIM::AddresseeLineEdit( WStackPage_4, "mEmailAddress" );
00200 
00201     WStackPageLayout_4->addWidget( mEmailAddress, 0, 1 );
00202 
00203     mEmailToLabel = new QLabel( WStackPage_4, "mEmailToLabel" );
00204 
00205     WStackPageLayout_4->addWidget( mEmailToLabel, 0, 0 );
00206     mTypeStack->addWidget( WStackPage_4, 3 );
00207     mTypeGroupLayout->addWidget( mTypeStack );
00208 
00209     KOEditorAlarms_baseLayout->addWidget( mTypeGroup, 2, 0 );
00210 
00211     layout7 = new QGridLayout( 0, 1, 1, 0, 6, "layout7"); 
00212 
00213     mRemoveButton = new QPushButton( this, "mRemoveButton" );
00214 
00215     layout7->addWidget( mRemoveButton, 2, 1 );
00216 
00217     mAddButton = new QPushButton( this, "mAddButton" );
00218 
00219     layout7->addWidget( mAddButton, 0, 1 );
00220 
00221     mDuplicateButton = new QPushButton( this, "mDuplicateButton" );
00222 
00223     layout7->addWidget( mDuplicateButton, 1, 1 );
00224     spacer1 = new QSpacerItem( 20, 60, QSizePolicy::Minimum, QSizePolicy::Expanding );
00225     layout7->addItem( spacer1, 3, 1 );
00226 
00227     mAlarmList = new QListView( this, "mAlarmList" );
00228     mAlarmList->addColumn( tr2i18n( "Type" ) );
00229     mAlarmList->header()->setClickEnabled( FALSE, mAlarmList->header()->count() - 1 );
00230     mAlarmList->addColumn( tr2i18n( "Time Offset" ) );
00231     mAlarmList->header()->setClickEnabled( FALSE, mAlarmList->header()->count() - 1 );
00232     mAlarmList->addColumn( tr2i18n( "Repeat" ) );
00233     mAlarmList->header()->setClickEnabled( FALSE, mAlarmList->header()->count() - 1 );
00234     mAlarmList->setAllColumnsShowFocus( TRUE );
00235     mAlarmList->setResizeMode( QListView::AllColumns );
00236 
00237     layout7->addMultiCellWidget( mAlarmList, 0, 3, 0, 0 );
00238 
00239     KOEditorAlarms_baseLayout->addLayout( layout7, 0, 0 );
00240     languageChange();
00241     resize( QSize(500, 300).expandedTo(minimumSizeHint()) );
00242     clearWState( WState_Polished );
00243 
00244     // signals and slots connections
00245     connect( mAlarmType, SIGNAL( clicked(int) ), mTypeStack, SLOT( raiseWidget(int) ) );
00246     connect( mRepeats, SIGNAL( toggled(bool) ), mIntervalLabel, SLOT( setEnabled(bool) ) );
00247     connect( mRepeats, SIGNAL( toggled(bool) ), mRepeatInterval, SLOT( setEnabled(bool) ) );
00248     connect( mRepeats, SIGNAL( toggled(bool) ), mHowOftenLabel, SLOT( setEnabled(bool) ) );
00249     connect( mRepeats, SIGNAL( toggled(bool) ), mRepeatCount, SLOT( setEnabled(bool) ) );
00250 
00251     // buddies
00252     mHowOftenLabel->setBuddy( mRepeatCount );
00253     mIntervalLabel->setBuddy( mRepeatInterval );
00254     mDisplayTextLabel->setBuddy( mDisplayText );
00255     mSoundFileLabel->setBuddy( mSoundFile );
00256     mApplicationLabel->setBuddy( mApplication );
00257     mAppArgumentsLabel->setBuddy( mAppArguments );
00258     mEmailTextLabel->setBuddy( mEmailText );
00259 }
00260 
00261 /*
00262  *  Destroys the object and frees any allocated resources
00263  */
00264 KOEditorAlarms_base::~KOEditorAlarms_base()
00265 {
00266     // no need to delete child widgets, Qt does it all for us
00267 }
00268 
00269 /*
00270  *  Sets the strings of the subwidgets using the current
00271  *  language.
00272  */
00273 void KOEditorAlarms_base::languageChange()
00274 {
00275     setCaption( tr2i18n( "Alarms" ) );
00276     mTimeGroup->setTitle( tr2i18n( "Time Offset" ) );
00277     mOffsetUnit->clear();
00278     mOffsetUnit->insertItem( tr2i18n( "minute(s)" ) );
00279     mOffsetUnit->insertItem( tr2i18n( "hour(s)" ) );
00280     mOffsetUnit->insertItem( tr2i18n( "day(s)" ) );
00281     mBeforeAfter->clear();
00282     mBeforeAfter->insertItem( tr2i18n( "before the start" ) );
00283     mBeforeAfter->insertItem( tr2i18n( "after the start" ) );
00284     mBeforeAfter->insertItem( tr2i18n( "before the end" ) );
00285     mBeforeAfter->insertItem( tr2i18n( "after the end" ) );
00286     mHowOftenLabel->setText( tr2i18n( "&How often:" ) );
00287     mRepeatCount->setSuffix( tr2i18n( " time(s)" ) );
00288     mIntervalLabel->setText( tr2i18n( "&Interval:" ) );
00289     mRepeats->setText( tr2i18n( "&Repeat:" ) );
00290     mRepeatInterval->setPrefix( tr2i18n( "every " ) );
00291     mRepeatInterval->setSuffix( tr2i18n( " minute(s)" ) );
00292     mTypeGroup->setTitle( tr2i18n( "Type" ) );
00293     mAlarmType->setTitle( QString::null );
00294     mTypeDisplayRadio->setText( tr2i18n( "&Reminder Dialog" ) );
00295     mTypeSoundRadio->setText( tr2i18n( "A&udio" ) );
00296     mTypeAppRadio->setText( tr2i18n( "Program" ) );
00297     mTypeEmailRadio->setText( tr2i18n( "Email" ) );
00298     mDisplayTextLabel->setText( tr2i18n( "Reminder Dialog &text:" ) );
00299     mSoundFileLabel->setText( tr2i18n( "Audio &file:" ) );
00300     mSoundFile->setFilter( tr2i18n( "*.wav|Wav Files\\n*.mp3|MP3 files\\n*.*|All files" ) );
00301     mApplicationLabel->setText( tr2i18n( "&Program file:" ) );
00302     mApplication->setFilter( tr2i18n( "*.*|All files" ) );
00303     mAppArgumentsLabel->setText( tr2i18n( "Program ar&guments:" ) );
00304     mEmailTextLabel->setText( tr2i18n( "Email &message text:" ) );
00305     mEmailToLabel->setText( tr2i18n( "Email &address(es):" ) );
00306     mRemoveButton->setText( tr2i18n( "&Remove..." ) );
00307     mAddButton->setText( tr2i18n( "&Add" ) );
00308     mDuplicateButton->setText( tr2i18n( "D&uplicate" ) );
00309     mAlarmList->header()->setLabel( 0, tr2i18n( "Type" ) );
00310     mAlarmList->header()->setLabel( 1, tr2i18n( "Time Offset" ) );
00311     mAlarmList->header()->setLabel( 2, tr2i18n( "Repeat" ) );
00312 }
00313 
00314 #include "koeditoralarms_base.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys