summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-03-25 00:08:08 (UTC)
committer zautrix <zautrix>2005-03-25 00:08:08 (UTC)
commit7c2e130ddd194f1c4b5365af6999a27c08232f4b (patch) (side-by-side diff)
tree75665681327ee49d7650f4d840b5c8c772180fb4 /korganizer
parent5cf054b82738d65f9b0a34ccb51c993ee4a0189f (diff)
downloadkdepimpi-7c2e130ddd194f1c4b5365af6999a27c08232f4b.zip
kdepimpi-7c2e130ddd194f1c4b5365af6999a27c08232f4b.tar.gz
kdepimpi-7c2e130ddd194f1c4b5365af6999a27c08232f4b.tar.bz2
fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagenda.cpp3
-rw-r--r--korganizer/koeditorgeneral.cpp15
-rw-r--r--korganizer/koeditorgeneral.h1
3 files changed, 15 insertions, 4 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 5420822..2820ca2 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -539,24 +539,27 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
if ( !blockMoving )
performItemAction(viewportPos);
}
}
} else { // ---------- viewport()
if ( mActionType == SELECT ) {
performSelectAction( viewportPos );
}
}
break;
case QEvent::MouseButtonDblClick:
+ blockMoving = false;
+ leftMouseDown = false;
+ rightMouseDown = false;
if (object == viewport()) {
selectItem(0);
int x,y;
viewportToContents(viewportPos.x(),viewportPos.y(),x,y);
int gx,gy;
contentsToGrid(x,y,gx,gy);
emit newEventSignal(gx,gy);
} else {
KOAgendaItem *doubleClickedItem = (KOAgendaItem *)object;
selectItem(doubleClickedItem);
if ( KOPrefs::instance()->mEditOnDoubleClick )
emit editIncidenceSignal(doubleClickedItem->incidence());
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp
index 496f125..4ee5292 100644
--- a/korganizer/koeditorgeneral.cpp
+++ b/korganizer/koeditorgeneral.cpp
@@ -216,80 +216,83 @@ void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout)
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()) {
//mAlarmSound = "";
QToolTip::remove(mAlarmSoundButton);
QToolTip::add(mAlarmSoundButton, i18n("No sound set"));
mAlarmProgramButton->setOn(true);
mAlarmSoundButton->setOn(false);
+ pickAlarmProgram();
} 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 (mAlarmProgramButton->isOn())
((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) );
if ( mAlarmSoundButton->isOn())
- ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio.Al.: ") + getFittingPath(mAlarmSound) );
+ ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) );
}
void KOEditorGeneral::pickAlarmProgram()
{
if (!mAlarmProgramButton->isOn()) {
//mAlarmProgram = "";
QToolTip::remove(mAlarmProgramButton);
QToolTip::add(mAlarmProgramButton, i18n("No program set"));
mAlarmProgramButton->setOn(false);
mAlarmSoundButton->setOn(true);
+ pickAlarmSound();
} else {
- QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm.: ") , 0));
+ 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 (mAlarmProgramButton->isOn())
((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) );
if ( mAlarmSoundButton->isOn())
- ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Sound.Al.: ") + getFittingPath(mAlarmSound) );
+ ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) );
}
QString KOEditorGeneral::getFittingPath( const QString s )
{
int maxlen = 50;
if ( QApplication::desktop()->width() < 640 ) {
if ( QApplication::desktop()->width() < 320 )
maxlen = 22;
else
maxlen = 35;
}
@@ -308,25 +311,27 @@ void KOEditorGeneral::enableAlarmEdit(bool enable)
mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
else {
if ( ! QFile::exists( mAlarmSound ) )
mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
}
}
if (mAlarmProgramButton->isOn())
((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) );
if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn())
((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) );
}
else {
- ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Alarm disabled for this item"));
+ ((QWidget*)parent())->topLevelWidget()->setCaption(mAlarmMessage);
+ //((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Edit item: ") + mSummaryEdit->currentText());
+
}
mAlarmTimeEdit->setEnabled(enable);
mAlarmSoundButton->setEnabled(enable);
mAlarmProgramButton->setEnabled(enable);
mAlarmIncrCombo->setEnabled(enable);
}
void KOEditorGeneral::disableAlarmEdit(bool disable)
{
enableAlarmEdit( !disable );
}
@@ -354,24 +359,25 @@ void KOEditorGeneral::alarmDisable(bool disable)
void KOEditorGeneral::setCategories(const QString &str)
{
mCategoriesLabel->setText(str);
}
void KOEditorGeneral::setDefaults(bool allDay)
{
#if 0
mOwnerLabel->setText(i18n("Owner: ") + KOPrefs::instance()->fullName());
#endif
+ mAlarmMessage = i18n("Edit new item");
enableAlarmEdit( !allDay );
// TODO: Implement a KPrefsComboItem to solve this in a clean way.
int alarmTime;
int a[] = { 1,5,10,15,30,60,180, 1440 };
int index = KOPrefs::instance()->mAlarmTime;
if (index < 0 || index > 7) {
alarmTime = 15;
} else {
alarmTime = a[index];
}
mAlarmButton ->setChecked( false );
@@ -385,24 +391,25 @@ void KOEditorGeneral::setDefaults(bool allDay)
mLocationEdit->setEditText("");
mDescriptionEdit->setText("");
mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
setCategories("");
}
void KOEditorGeneral::setSecrecy( int num )
{
mSecrecyCombo->setCurrentItem(num);
}
void KOEditorGeneral::readIncidence(Incidence *event)
{
+ mAlarmMessage = i18n("Edit") +" "+event->summary();
mAlarmIncrCombo->setCurrentItem(0);
mSummaryEdit->setEditText(event->summary());
mLocationEdit->setEditText(event->location());
mDescriptionEdit->setText(event->description());
#if 0
// organizer information
mOwnerLabel->setText(i18n("Owner: ") + event->organizer());
#endif
enableAlarmEdit( event->isAlarmEnabled() );
//qDebug("KOEditorGeneral::readIncidence(Incidence *event) ");
diff --git a/korganizer/koeditorgeneral.h b/korganizer/koeditorgeneral.h
index de8edaf..f4728c7 100644
--- a/korganizer/koeditorgeneral.h
+++ b/korganizer/koeditorgeneral.h
@@ -99,15 +99,16 @@ class KOEditorGeneral : public QObject
QComboBox *mAlarmIncrCombo;
KTextEdit *mDescriptionEdit;
QLabel *mOwnerLabel;
QComboBox *mSecrecyCombo;
QCheckBox *mCancelBox;
QPushButton *mCategoriesButton;
QLabel *mCategoriesLabel;
private:
QString getFittingPath( const QString ) ;
QString mAlarmSound;
QString mAlarmProgram;
+ QString mAlarmMessage;
};
#endif