From f6c8249db564c1276d4c7ed5ad88c6fbac361b8d Mon Sep 17 00:00:00 2001 From: zautrix Date: Sun, 03 Apr 2005 04:33:19 +0000 Subject: fixes --- diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 6b739ba..711509d 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt @@ -1332,12 +1332,12 @@ { "%1h","%1std" }, { "%1min","%1min" }, { "( %1 before )","( %1 vorher )" }, +{ "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" }, +{ "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" }, +{ "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." }, { "","" }, { "","" }, { "","" }, { "","" }, { "","" }, -{ "","" }, -{ "","" }, -{ "","" }, -{ "","" } \ No newline at end of file +{ "","" }, \ No newline at end of file diff --git a/kabc/addresseedialog.cpp b/kabc/addresseedialog.cpp index 648e780..19b52bb 100644 --- a/kabc/addresseedialog.cpp +++ b/kabc/addresseedialog.cpp @@ -126,9 +126,10 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : mAddressBook = StdAddressBook::self( true ); connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook* ) ), SLOT( addressBookChanged() ) ); +#if 0 connect( mAddressBook, SIGNAL( loadingFinished( Resource* ) ), SLOT( addressBookChanged() ) ); - +#endif loadAddressBook(); QValueList splitterSize; splitterSize.append( ( width() / 5 ) * 3 ); @@ -278,31 +279,72 @@ Addressee::List AddresseeDialog::addressees() Addressee AddresseeDialog::getAddressee( QWidget *parent ) { - AddresseeDialog *dlg = new AddresseeDialog( parent ); - Addressee addressee; - int result = dlg->exec(); + AddresseeDialog *dlg = new AddresseeDialog( parent ); + Addressee addressee; +#ifdef DESKTOP_VERSION + static int geoX = 0; + static int geoY = 0; + static int geoW = 0; + static int geoH = 0; + if ( !geoX && ! geoY && !geoW &&!geoH ) { + geoX = dlg->geometry().x(); + geoY = dlg->geometry().y(); + geoW = dlg->width(); + geoH = dlg->height(); + } else { + dlg->show(); + dlg->setGeometry(geoX , geoY,geoW , geoH ); - if ( result == QDialog::Accepted ) { - addressee = dlg->addressee(); - } + } +#endif + int result = dlg->exec(); +#ifdef DESKTOP_VERSION + geoX = dlg->geometry().x(); + geoY = dlg->geometry().y(); + geoW = dlg->width(); + geoH = dlg->height(); +#endif + if ( result == QDialog::Accepted ) { + addressee = dlg->addressee(); + } - delete dlg; - return addressee; + delete dlg; + return addressee; } Addressee::List AddresseeDialog::getAddressees( QWidget *parent ) { - AddresseeDialog *dlg = new AddresseeDialog( parent, true ); - Addressee::List addressees; - if ( QApplication::desktop()->width() <= 640 ) - dlg->showMaximized(); - int result = dlg->exec(); - if ( result == QDialog::Accepted ) { - addressees = dlg->addressees(); - } + AddresseeDialog *dlg = new AddresseeDialog( parent, true ); + Addressee::List addressees; + static int geoX = 0; + static int geoY = 0; + static int geoW = 0; + static int geoH = 0; + if ( QApplication::desktop()->width() <= 640 ) + dlg->showMaximized(); + else { + if ( !geoX && ! geoY && !geoW &&!geoH ) { + geoX = dlg->geometry().x(); + geoY = dlg->geometry().y(); + geoW = dlg->width(); + geoH = dlg->height(); + } else { + dlg->show(); + dlg->setGeometry(geoX , geoY,geoW , geoH ); + + } + } + int result = dlg->exec(); + geoX = dlg->geometry().x(); + geoY = dlg->geometry().y(); + geoW = dlg->width(); + geoH = dlg->height(); + if ( result == QDialog::Accepted ) { + addressees = dlg->addressees(); + } - delete dlg; - return addressees; + delete dlg; + return addressees; } void AddresseeDialog::addressBookChanged() diff --git a/kalarmd/alarmdialog.cpp b/kalarmd/alarmdialog.cpp index bdeee4a..53ff488 100644 --- a/kalarmd/alarmdialog.cpp +++ b/kalarmd/alarmdialog.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #ifndef DESKTOP_VERSION #define protected public #include @@ -58,7 +59,7 @@ AlarmDialog::AlarmDialog(QWidget *parent,const char *name) - : QDialog (parent, name, true, Qt::WStyle_StaysOnTop ) + : QDialog (parent, name, true, Qt::WStyle_Customize |Qt::WStyle_StaysOnTop | Qt::WStyle_DialogBorder) { setCaption( "KO/Pi Alarm!" ); QVBoxLayout* layout = new QVBoxLayout( this); @@ -232,7 +233,9 @@ bool AlarmDialog::eventNotification( QString mess, int replay , QString fn, boo mSilent = false; if ( !mMessage->text().stripWhiteSpace().isEmpty() ) { mMissedAlarmsCombo->show(); - mMissedAlarmsCombo->insertItem( mMessage->text().stripWhiteSpace() ); + QString newItem = mMessage->text().stripWhiteSpace(); + newItem.replace( QRegExp("\n"), QString(" ") ); + mMissedAlarmsCombo->insertItem( newItem ); mMissedAlarms->setText( "Missed alarms:"); } else mMissedAlarmsCombo->hide(); @@ -265,13 +268,13 @@ void AlarmDialog::playSound () if (mStopAlarm ) return; - if (mSilent ) + if ( mSilent ) return; showNormal(); setActiveWindow(); + raise(); mSuspendSpin->setFocus(); - raise(); - repaint(); + qApp->processEvents(); if ( alarmCounter < maxAlarmReplay && ! mSilent) { diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index beb19d9..76cce26 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -530,6 +530,11 @@ void CalendarView::suspendAlarm() void CalendarView::startAlarm( QString mess , QString filename) { + + topLevelWidget()->showNormal(); + topLevelWidget()->setActiveWindow(); + topLevelWidget()->raise(); + mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); QTimer::singleShot( 3000, this, SLOT( checkNextTimerAlarm() ) ); @@ -4094,7 +4099,7 @@ void CalendarView::showNextAlarms() int days = hours /24; hours = hours % 24; - message = i18n("The next alarm is in:\n"); + //message = i18n("The next alarm is in:\n"); if ( days > 1 ) message += i18n("%1 days\n").arg( days ); else if ( days == 1 ) @@ -4107,11 +4112,21 @@ void CalendarView::showNextAlarms() message += i18n("%1 minutes\n").arg( min ); else if ( min == 1 ) message += i18n("1 minute\n"); - + if ( message.isEmpty() ) + message = i18n("The next alarm is in\nless than one minute!"); + else + message = i18n("The next alarm is in:\n") + message; message += i18n("\n(%1)\n\n%2\n(%3)\n").arg( KGlobal::locale()->formatDateTime(nextA , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ; } else { message = i18n("There is no next alarm."); } +#ifdef DESKTOP_VERSION + if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { + message += i18n("\nThe internal alarm notification is disabled!\n"); + message += i18n("Enable it in the settings menu, TAB alarm."); + } + +#endif KMessageBox::information( this, message); } diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index d450a97..6d1e6d5 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -153,7 +153,7 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) //testline //p->drawLine(0,0,0,contentsHeight()); while (y < cy + ch+mCellHeight) { - p->drawLine(startW-tw2 ,y,cw+2,y); + p->drawLine(startW-tw2+1 ,y,cw+2,y); hour.setNum(cell); // handle 24h and am/pm time formats if (KGlobal::locale()->use12Clock()) { @@ -215,7 +215,7 @@ void TimeLabels::updateConfig() // update HourSize mCellHeight = KOPrefs::instance()->mHourSize*4; - resizeContents(50,mRows * mCellHeight); + resizeContents(mMiniWidth,mRows * mCellHeight+1); } /** update time label positions */ diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index b14ca43..abc80d4 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp @@ -227,59 +227,56 @@ void KOEditorGeneral::pickAlarmSound() { qDebug("KOEditorGeneral::pickAlarmSound() %d",mAlarmSoundButton->isOn() ); - //QString prefix = mAlarmSound; - if (!mAlarmSoundButton->isOn()) { + + bool oldState = mAlarmSoundButton->isOn(); + + 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); - ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); + QToolTip::add(mAlarmProgramButton, i18n("No program set")); } 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); - - } + mAlarmProgramButton->setOn(oldState); + mAlarmSoundButton->setOn(!oldState); + + } -#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()) { + bool oldState = mAlarmProgramButton->isOn(); + + 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); - ((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); - } + QToolTip::add(mAlarmSoundButton, i18n("No sound set")); + } else { + mAlarmProgramButton->setOn(!oldState); + mAlarmSoundButton->setOn(oldState); } -#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 + } diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 01cf0ff..395325c 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -204,6 +204,10 @@ void KOTodoListView::contentsDropEvent(QDropEvent *e) } #endif } +void KOTodoListView::wheelEvent (QWheelEvent *e) +{ + QListView::wheelEvent (e); +} void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) { @@ -227,9 +231,11 @@ void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) } #ifndef KORG_NODND mMousePressed = false; - if (! rootClicked ) { + if (! rootClicked && !( e->button() == RightButton) ) { mPressPos = e->pos(); mMousePressed = true; + } else { + mMousePressed = false; } #endif //qDebug("KOTodoListView::contentsMousePressEvent %d", rootClicked); @@ -1082,7 +1088,7 @@ void KOTodoView::itemDoubleClicked(QListViewItem *item) newTodo(); return; } else { - if ( row == 1 ) { + if ( row == 1 || row == 2 ) { mActiveItem = (KOTodoViewItem *) item; newSubTodo(); return; @@ -1271,6 +1277,7 @@ void KOTodoView::setAllFlat() void KOTodoView::purgeCompleted() { emit purgeCompletedSignal(); + } void KOTodoView::toggleQuickTodo() { diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index e553d0e..39976cf 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h @@ -68,6 +68,7 @@ class KOTodoListView : public KListView void unparentTodoSignal(Todo *); void deleteTodo( Todo * ); protected: + void wheelEvent (QWheelEvent *e); void contentsDragEnterEvent(QDragEnterEvent *); void contentsDragMoveEvent(QDragMoveEvent *); void contentsDragLeaveEvent(QDragLeaveEvent *); -- cgit v0.9.0.2