Diffstat (limited to 'korganizer/koeditorgeneral.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koeditorgeneral.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index 92fcd1c..b14ca43 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp @@ -92,192 +92,193 @@ void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout) QLabel *locationLabel = new QLabel(i18n("Location:"),parent); headerLayout->addWidget(locationLabel,2,0); mLocationEdit = new KOLocationBox(TRUE,parent,10); mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); if ( QApplication::desktop()->width() > 320 ) mLocationEdit->setMaximumHeight( hei + 6); // mLocationEdit = new QLineEdit(parent); connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); headerLayout->addWidget(mLocationEdit,2,1); headerLayout->setColStretch( 1, 10); } void KOEditorGeneral::setFocusOn( int i ) { qApp->processEvents(); if ( i == 1 ) { mDescriptionEdit->setFocus(); mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333); } if ( i == 2 ) { mSummaryEdit->setFocus(); } } void KOEditorGeneral::editCategories() { // qDebug("KOEditorGeneral::editCategories() "); KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); connect(csd,SIGNAL(categoriesSelected(const QString &)), this ,SLOT(setCategories(const QString &))); //KOGlobals::fitDialogToScreen( csd ); csd->setColorEnabled(); csd->setSelected( QStringList::split (",", mCategoriesLabel->text()) ); csd->exec(); delete csd; } void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout) { QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout ); mCategoriesButton = new QPushButton(parent); mCategoriesButton->setText(i18n("Categories...")); connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() )); categoriesLayout->addWidget(mCategoriesButton); mCategoriesLabel = new QLabel(parent); mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken); categoriesLayout->addWidget(mCategoriesLabel,1); } void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) { QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout ); QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent); mCancelBox = new QCheckBox ( i18n("Cancelled"), parent); secrecyLayout->addWidget(mCancelBox); secrecyLayout->addWidget(secrecyLabel); mSecrecyCombo = new QComboBox(parent); mSecrecyCombo->insertStringList(Incidence::secrecyList()); secrecyLayout->addWidget(mSecrecyCombo); } void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout) { mDescriptionEdit = new KTextEdit(parent); mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont ); mDescriptionEdit->append(""); mDescriptionEdit->setReadOnly(false); mDescriptionEdit->setOverwriteMode(false); mDescriptionEdit->setWordWrap( KTextEdit::WidgetWidth ); topLayout->addWidget(mDescriptionEdit); #ifndef DESKTOP_VERSION QPEApplication::setStylusOperation( mDescriptionEdit, QPEApplication::RightOnHold ); #endif } void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout) { QBoxLayout *alarmLayout = new QHBoxLayout(topLayout); //mAlarmBell = new QLabel(parent); //mAlarmBell->setPixmap(SmallIcon("bell")); //alarmLayout->addWidget(mAlarmBell); if ( QApplication::desktop()->width() < 320 ) mAlarmButton = new QCheckBox(i18n("Rem."),parent); else mAlarmButton = new QCheckBox(i18n("Reminder:"),parent); connect(mAlarmButton, SIGNAL(toggled(bool)), SLOT(enableAlarmEdit(bool))); alarmLayout->addWidget(mAlarmButton); mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ; + mAlarmTimeEdit->setButtonSymbols( QSpinBox::PlusMinus ); alarmLayout->addWidget(mAlarmTimeEdit); mAlarmIncrCombo = new QComboBox(false, parent); if ( QApplication::desktop()->width() < 320 ) { mAlarmIncrCombo->insertItem(i18n("min")); mAlarmIncrCombo->insertItem(i18n("hou")); mAlarmIncrCombo->insertItem(i18n("day")); mAlarmTimeEdit->setMaximumWidth( mAlarmTimeEdit->sizeHint().width() ); mAlarmIncrCombo->setMaximumWidth( mAlarmIncrCombo->sizeHint().width() ); } else { mAlarmIncrCombo->insertItem(i18n("minute(s)")); mAlarmIncrCombo->insertItem(i18n("hour(s)")); mAlarmIncrCombo->insertItem(i18n("day(s)")); } // mAlarmIncrCombo->setMinimumHeight(20); alarmLayout->addWidget(mAlarmIncrCombo); mAlarmSoundButton = new QPushButton(parent); mAlarmSoundButton->setPixmap(SmallIcon("playsound")); mAlarmSoundButton->setToggleButton(true); QToolTip::add(mAlarmSoundButton, i18n("No sound set")); connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound())); alarmLayout->addWidget(mAlarmSoundButton); mAlarmProgramButton = new QPushButton(parent); mAlarmProgramButton->setPixmap(SmallIcon("run")); mAlarmProgramButton->setToggleButton(true); QToolTip::add(mAlarmProgramButton, i18n("No program set")); connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram())); alarmLayout->addWidget(mAlarmProgramButton); mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 ); mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 ); // if ( KOPrefs::instance()->mCompactDialogs ) { // mAlarmSoundButton->hide(); // mAlarmProgramButton->hide(); // } } void KOEditorGeneral::pickAlarmSound() { qDebug("KOEditorGeneral::pickAlarmSound() %d",mAlarmSoundButton->isOn() ); //QString prefix = mAlarmSound; if (!mAlarmSoundButton->isOn()) { mAlarmSoundButton->setOn(true); ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); } else { QString fileName(KFileDialog::getOpenFileName(mAlarmSound, i18n("*.wav|Wav Files"), 0)); if (!fileName.isEmpty()) { mAlarmSound = fileName; QToolTip::remove(mAlarmSoundButton); QString dispStr = i18n("Playing '%1'").arg(fileName); QToolTip::add(mAlarmSoundButton, dispStr); mAlarmProgramButton->setOn(false); mAlarmSoundButton->setOn(true); } else { mAlarmProgramButton->setOn(true); mAlarmSoundButton->setOn(false); } } #if 0 if (mAlarmProgramButton->isOn()) ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); if ( mAlarmSoundButton->isOn()) ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); #endif } void KOEditorGeneral::pickAlarmProgram() { if (!mAlarmProgramButton->isOn()) { mAlarmProgramButton->setOn(true); ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); } else { QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm: ") , 0)); if (!fileName.isEmpty()) { mAlarmProgram = fileName; QToolTip::remove(mAlarmProgramButton); QString dispStr = i18n("Running '%1'").arg(fileName); QToolTip::add(mAlarmProgramButton, dispStr); mAlarmSoundButton->setOn(false); mAlarmProgramButton->setOn(true); } else { mAlarmProgramButton->setOn(false); mAlarmSoundButton->setOn(true); } } #if 0 if (mAlarmProgramButton->isOn()) ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); if ( mAlarmSoundButton->isOn()) ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); #endif } |