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: Thu Sep 14 16:11:06 2006
00007 **      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.6   edited Aug 31 2005 $)
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     layout3->addWidget( mAlarmOffset );
00061 
00062     mOffsetUnit = new QComboBox( FALSE, mTimeGroup, "mOffsetUnit" );
00063     layout3->addWidget( mOffsetUnit );
00064 
00065     mBeforeAfter = new QComboBox( FALSE, mTimeGroup, "mBeforeAfter" );
00066     layout3->addWidget( mBeforeAfter );
00067     mTimeGroupLayout->addLayout( layout3 );
00068 
00069     layout8 = new QGridLayout( 0, 1, 1, 0, 6, "layout8"); 
00070 
00071     mHowOftenLabel = new QLabel( mTimeGroup, "mHowOftenLabel" );
00072     mHowOftenLabel->setEnabled( FALSE );
00073     mHowOftenLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)5, 0, 0, mHowOftenLabel->sizePolicy().hasHeightForWidth() ) );
00074 
00075     layout8->addWidget( mHowOftenLabel, 0, 1 );
00076 
00077     mRepeatCount = new QSpinBox( mTimeGroup, "mRepeatCount" );
00078     mRepeatCount->setEnabled( FALSE );
00079     mRepeatCount->setMaxValue( 500 );
00080     mRepeatCount->setMinValue( 1 );
00081 
00082     layout8->addWidget( mRepeatCount, 0, 2 );
00083 
00084     mIntervalLabel = new QLabel( mTimeGroup, "mIntervalLabel" );
00085     mIntervalLabel->setEnabled( FALSE );
00086 
00087     layout8->addWidget( mIntervalLabel, 1, 1 );
00088 
00089     mRepeats = new QCheckBox( mTimeGroup, "mRepeats" );
00090     mRepeats->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)0, 0, 0, mRepeats->sizePolicy().hasHeightForWidth() ) );
00091 
00092     layout8->addWidget( mRepeats, 0, 0 );
00093 
00094     mRepeatInterval = new QSpinBox( mTimeGroup, "mRepeatInterval" );
00095     mRepeatInterval->setEnabled( FALSE );
00096     mRepeatInterval->setMaxValue( 999 );
00097     mRepeatInterval->setMinValue( 1 );
00098 
00099     layout8->addWidget( mRepeatInterval, 1, 2 );
00100     mTimeGroupLayout->addLayout( layout8 );
00101 
00102     KOEditorAlarms_baseLayout->addWidget( mTimeGroup, 1, 0 );
00103 
00104     mTypeGroup = new QGroupBox( this, "mTypeGroup" );
00105     mTypeGroup->setColumnLayout(0, Qt::Vertical );
00106     mTypeGroup->layout()->setSpacing( 6 );
00107     mTypeGroup->layout()->setMargin( 11 );
00108     mTypeGroupLayout = new QHBoxLayout( mTypeGroup->layout() );
00109     mTypeGroupLayout->setAlignment( Qt::AlignTop );
00110 
00111     mAlarmType = new QButtonGroup( mTypeGroup, "mAlarmType" );
00112     mAlarmType->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)5, 0, 0, mAlarmType->sizePolicy().hasHeightForWidth() ) );
00113     mAlarmType->setFrameShape( QButtonGroup::NoFrame );
00114     mAlarmType->setLineWidth( 0 );
00115     mAlarmType->setFlat( TRUE );
00116     mAlarmType->setColumnLayout(0, Qt::Vertical );
00117     mAlarmType->layout()->setSpacing( 6 );
00118     mAlarmType->layout()->setMargin( 0 );
00119     mAlarmTypeLayout = new QVBoxLayout( mAlarmType->layout() );
00120     mAlarmTypeLayout->setAlignment( Qt::AlignTop );
00121 
00122     mTypeDisplayRadio = new QRadioButton( mAlarmType, "mTypeDisplayRadio" );
00123     mTypeDisplayRadio->setChecked( TRUE );
00124     mAlarmTypeLayout->addWidget( mTypeDisplayRadio );
00125 
00126     mTypeSoundRadio = new QRadioButton( mAlarmType, "mTypeSoundRadio" );
00127     mAlarmTypeLayout->addWidget( mTypeSoundRadio );
00128 
00129     mTypeAppRadio = new QRadioButton( mAlarmType, "mTypeAppRadio" );
00130     mAlarmTypeLayout->addWidget( mTypeAppRadio );
00131 
00132     mTypeEmailRadio = new QRadioButton( mAlarmType, "mTypeEmailRadio" );
00133     mTypeEmailRadio->setEnabled( FALSE );
00134     mAlarmTypeLayout->addWidget( mTypeEmailRadio );
00135     spacer2 = new QSpacerItem( 21, 41, QSizePolicy::Minimum, QSizePolicy::Expanding );
00136     mAlarmTypeLayout->addItem( spacer2 );
00137     mTypeGroupLayout->addWidget( mAlarmType );
00138 
00139     line1 = new QFrame( mTypeGroup, "line1" );
00140     line1->setFrameShape( QFrame::VLine );
00141     line1->setFrameShadow( QFrame::Sunken );
00142     line1->setFrameShape( QFrame::VLine );
00143     mTypeGroupLayout->addWidget( line1 );
00144 
00145     mTypeStack = new QWidgetStack( mTypeGroup, "mTypeStack" );
00146 
00147     WStackPage = new QWidget( mTypeStack, "WStackPage" );
00148     WStackPageLayout = new QVBoxLayout( WStackPage, 0, 6, "WStackPageLayout"); 
00149 
00150     mDisplayTextLabel = new QLabel( WStackPage, "mDisplayTextLabel" );
00151     WStackPageLayout->addWidget( mDisplayTextLabel );
00152 
00153     mDisplayText = new QTextEdit( WStackPage, "mDisplayText" );
00154     WStackPageLayout->addWidget( mDisplayText );
00155     mTypeStack->addWidget( WStackPage, 0 );
00156 
00157     WStackPage_2 = new QWidget( mTypeStack, "WStackPage_2" );
00158     WStackPageLayout_2 = new QVBoxLayout( WStackPage_2, 0, 6, "WStackPageLayout_2"); 
00159 
00160     mSoundFileLabel = new QLabel( WStackPage_2, "mSoundFileLabel" );
00161     WStackPageLayout_2->addWidget( mSoundFileLabel );
00162 
00163     mSoundFile = new KURLRequester( WStackPage_2, "mSoundFile" );
00164     WStackPageLayout_2->addWidget( mSoundFile );
00165     spacer3 = new QSpacerItem( 20, 61, QSizePolicy::Minimum, QSizePolicy::Expanding );
00166     WStackPageLayout_2->addItem( spacer3 );
00167     mTypeStack->addWidget( WStackPage_2, 1 );
00168 
00169     WStackPage_3 = new QWidget( mTypeStack, "WStackPage_3" );
00170     WStackPageLayout_3 = new QVBoxLayout( WStackPage_3, 0, 6, "WStackPageLayout_3"); 
00171 
00172     mApplicationLabel = new QLabel( WStackPage_3, "mApplicationLabel" );
00173     WStackPageLayout_3->addWidget( mApplicationLabel );
00174 
00175     mApplication = new KURLRequester( WStackPage_3, "mApplication" );
00176     WStackPageLayout_3->addWidget( mApplication );
00177 
00178     mAppArgumentsLabel = new QLabel( WStackPage_3, "mAppArgumentsLabel" );
00179     WStackPageLayout_3->addWidget( mAppArgumentsLabel );
00180 
00181     mAppArguments = new QLineEdit( WStackPage_3, "mAppArguments" );
00182     WStackPageLayout_3->addWidget( mAppArguments );
00183     spacer3_2 = new QSpacerItem( 20, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
00184     WStackPageLayout_3->addItem( spacer3_2 );
00185     mTypeStack->addWidget( WStackPage_3, 2 );
00186 
00187     WStackPage_4 = new QWidget( mTypeStack, "WStackPage_4" );
00188     WStackPageLayout_4 = new QGridLayout( WStackPage_4, 1, 1, 0, 6, "WStackPageLayout_4"); 
00189 
00190     mEmailTextLabel = new QLabel( WStackPage_4, "mEmailTextLabel" );
00191 
00192     WStackPageLayout_4->addMultiCellWidget( mEmailTextLabel, 1, 1, 0, 1 );
00193 
00194     mEmailText = new QTextEdit( WStackPage_4, "mEmailText" );
00195 
00196     WStackPageLayout_4->addMultiCellWidget( mEmailText, 2, 2, 0, 1 );
00197 
00198     mEmailAddress = new KPIM::AddresseeLineEdit( WStackPage_4, "mEmailAddress" );
00199 
00200     WStackPageLayout_4->addWidget( mEmailAddress, 0, 1 );
00201 
00202     mEmailToLabel = new QLabel( WStackPage_4, "mEmailToLabel" );
00203 
00204     WStackPageLayout_4->addWidget( mEmailToLabel, 0, 0 );
00205     mTypeStack->addWidget( WStackPage_4, 3 );
00206     mTypeGroupLayout->addWidget( mTypeStack );
00207 
00208     KOEditorAlarms_baseLayout->addWidget( mTypeGroup, 2, 0 );
00209 
00210     layout7 = new QGridLayout( 0, 1, 1, 0, 6, "layout7"); 
00211 
00212     mRemoveButton = new QPushButton( this, "mRemoveButton" );
00213 
00214     layout7->addWidget( mRemoveButton, 2, 1 );
00215 
00216     mAddButton = new QPushButton( this, "mAddButton" );
00217 
00218     layout7->addWidget( mAddButton, 0, 1 );
00219 
00220     mDuplicateButton = new QPushButton( this, "mDuplicateButton" );
00221 
00222     layout7->addWidget( mDuplicateButton, 1, 1 );
00223     spacer1 = new QSpacerItem( 20, 60, QSizePolicy::Minimum, QSizePolicy::Expanding );
00224     layout7->addItem( spacer1, 3, 1 );
00225 
00226     mAlarmList = new QListView( this, "mAlarmList" );
00227     mAlarmList->addColumn( tr2i18n( "Type" ) );
00228     mAlarmList->addColumn( tr2i18n( "Offset" ) );
00229     mAlarmList->addColumn( tr2i18n( "Repeat" ) );
00230     mAlarmList->setAllColumnsShowFocus( TRUE );
00231     mAlarmList->setResizeMode( QListView::AllColumns );
00232 
00233     layout7->addMultiCellWidget( mAlarmList, 0, 3, 0, 0 );
00234 
00235     KOEditorAlarms_baseLayout->addLayout( layout7, 0, 0 );
00236     languageChange();
00237     resize( QSize(500, 300).expandedTo(minimumSizeHint()) );
00238     clearWState( WState_Polished );
00239 
00240     // signals and slots connections
00241     connect( mAlarmType, SIGNAL( clicked(int) ), mTypeStack, SLOT( raiseWidget(int) ) );
00242     connect( mRepeats, SIGNAL( toggled(bool) ), mIntervalLabel, SLOT( setEnabled(bool) ) );
00243     connect( mRepeats, SIGNAL( toggled(bool) ), mRepeatInterval, SLOT( setEnabled(bool) ) );
00244     connect( mRepeats, SIGNAL( toggled(bool) ), mHowOftenLabel, SLOT( setEnabled(bool) ) );
00245     connect( mRepeats, SIGNAL( toggled(bool) ), mRepeatCount, SLOT( setEnabled(bool) ) );
00246 
00247     // buddies
00248     mHowOftenLabel->setBuddy( mRepeatCount );
00249     mIntervalLabel->setBuddy( mRepeatInterval );
00250     mDisplayTextLabel->setBuddy( mDisplayText );
00251     mSoundFileLabel->setBuddy( mSoundFile );
00252     mApplicationLabel->setBuddy( mApplication );
00253     mAppArgumentsLabel->setBuddy( mAppArguments );
00254     mEmailTextLabel->setBuddy( mEmailText );
00255 }
00256 
00257 /*
00258  *  Destroys the object and frees any allocated resources
00259  */
00260 KOEditorAlarms_base::~KOEditorAlarms_base()
00261 {
00262     // no need to delete child widgets, Qt does it all for us
00263 }
00264 
00265 /*
00266  *  Sets the strings of the subwidgets using the current
00267  *  language.
00268  */
00269 void KOEditorAlarms_base::languageChange()
00270 {
00271     setCaption( tr2i18n( "Alarms" ) );
00272     mTimeGroup->setTitle( tr2i18n( "Time" ) );
00273     mOffsetUnit->clear();
00274     mOffsetUnit->insertItem( tr2i18n( "Minutes" ) );
00275     mOffsetUnit->insertItem( tr2i18n( "Hours" ) );
00276     mOffsetUnit->insertItem( tr2i18n( "Days" ) );
00277     mBeforeAfter->clear();
00278     mBeforeAfter->insertItem( tr2i18n( "Before the Start" ) );
00279     mBeforeAfter->insertItem( tr2i18n( "After the Start" ) );
00280     mBeforeAfter->insertItem( tr2i18n( "Before the End" ) );
00281     mBeforeAfter->insertItem( tr2i18n( "After the End" ) );
00282     mHowOftenLabel->setText( tr2i18n( "&How often:" ) );
00283     mRepeatCount->setSuffix( tr2i18n( " time(s)" ) );
00284     mIntervalLabel->setText( tr2i18n( "&Interval:" ) );
00285     mRepeats->setText( tr2i18n( "&Repeating:" ) );
00286     mRepeatInterval->setPrefix( tr2i18n( "every " ) );
00287     mRepeatInterval->setSuffix( tr2i18n( " Minute(s)" ) );
00288     mTypeGroup->setTitle( tr2i18n( "Type" ) );
00289     mAlarmType->setTitle( QString::null );
00290     mTypeDisplayRadio->setText( tr2i18n( "&Display reminder" ) );
00291     mTypeSoundRadio->setText( tr2i18n( "&Sound" ) );
00292     mTypeAppRadio->setText( tr2i18n( "Application / script" ) );
00293     mTypeEmailRadio->setText( tr2i18n( "Send Email" ) );
00294     mDisplayTextLabel->setText( tr2i18n( "Reminder &text:" ) );
00295     mSoundFileLabel->setText( tr2i18n( "Sound &file:" ) );
00296     mSoundFile->setFilter( tr2i18n( "*.wav|Wav Files\\n*.mp3|MP3 files\\n*.*|All files" ) );
00297     mApplicationLabel->setText( tr2i18n( "&Application / Script:" ) );
00298     mApplication->setFilter( tr2i18n( "*.*|All files" ) );
00299     mAppArgumentsLabel->setText( tr2i18n( "Ar&guments:" ) );
00300     mEmailTextLabel->setText( tr2i18n( "&Text of the message:" ) );
00301     mEmailToLabel->setText( tr2i18n( "&To:" ) );
00302     mRemoveButton->setText( tr2i18n( "&Remove..." ) );
00303     mAddButton->setText( tr2i18n( "&Add" ) );
00304     mDuplicateButton->setText( tr2i18n( "D&uplicate" ) );
00305     mAlarmList->header()->setLabel( 0, tr2i18n( "Type" ) );
00306     mAlarmList->header()->setLabel( 1, tr2i18n( "Offset" ) );
00307     mAlarmList->header()->setLabel( 2, tr2i18n( "Repeat" ) );
00308 }
00309 
00310 #include "koeditoralarms_base.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys