-rw-r--r-- | bin/kdepim/WhatsNew.txt | 12 | ||||
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 5 | ||||
-rw-r--r-- | kalarmd/alarmdialog.cpp | 52 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 18 | ||||
-rw-r--r-- | korganizer/calendarview.h | 2 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 19 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 1 |
7 files changed, 95 insertions, 14 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index d4ec863..4250fb3 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt @@ -7,24 +7,36 @@ Some small changed in the new datenavigator in KO/Pi. Changed default setting for new filter in KA/Pi to "exclude categories". Changed the default font size for 640x480 display . Changed popup menu behaviour in agenda and list view. Fixed some layout problems of the date label size in the month view. Made month view update faster. Made first datenavigator repainting faster. Changed the title of the event/todo edit dialogs. Timelabels in agenga changed from 22:00 to 22 oo. ( the oo higher, of course). Many small usebility fixes in KO/Pi. Pressing the "Calendar" button on the Z switches now to the next view in KO/Pi. The set of possible "next views" are the views you have toolbar buttons for. +Made alarm sound working on Linux. + +KO/Pi alarm applet changed: +Made buttons in alarm dialog much bigger. +Made setting of timer more user friendly by showing the actual timer fire time and making the buttons in the timer settings much bigger. +The goal was it to make it possible to use a finger tip ( and not the stylus ) on the touchscreen to adjust the settings. + +And because this version is realeased at Easter, I added an Easter-egg: +With a new undocumented command you can get a message box about the next alarm. +Good luck to find it! + + ********** VERSION 2.0.20 ************ Two small fixes in OM/Pi. Better resizing of the new datenavigator in KO/Pi. ********** VERSION 2.0.19 ************ KO/Pi: Enhancements and bugfixes in the new datenavigator. Bugfix in this changelog: The datenavigator was changed in version 2.0.18, not the datepicker. diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index b6293b5..ce55780 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt @@ -1295,19 +1295,22 @@ { "Week Number","Wochennummer" }, { "Import","Importiere" }, { "Export","Exportiere" }, { "Beam","Beame" }, { "Export selected","Exportiere Selektierte" }, { "As iCal (ics) file...","Als iCal (ics) Datei..." }, { "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, { "Journal/Details...","Journale/Details..." }, { "Agenda View","Agenda Ansicht" }, { "Show current time","Zeige aktuelle Zeit" }, { "Edit new item","Bearbeite neuen Eintrag" }, { "Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals","Bitte wählen Sie mindestens\neinen dieser Typen\num darin zu suchen:\n\nTermine\nTodos\nJournale" }, +{ "There is no next alarm.","Es gibt keinen nächsten Alarm." }, +{ "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" }, +{ "The next alarm is on:\n%1\nat: %2\n\n%3\n(%4)","Der nächste Alarm in am:\n%1\num: %2\n\n%3\n(%4)" }, { "","" }, { "","" }, { "","" }, { "","" }, { "","" }, { "","" }, -{ "","" }, +
\ No newline at end of file diff --git a/kalarmd/alarmdialog.cpp b/kalarmd/alarmdialog.cpp index c939ae0..7ead3b9 100644 --- a/kalarmd/alarmdialog.cpp +++ b/kalarmd/alarmdialog.cpp @@ -38,24 +38,25 @@ #include <stdlib.h> #ifndef _WIN32_ #include <unistd.h> #include <sys/ioctl.h> #endif #include <stdio.h> #include <fcntl.h> #ifndef DESKTOP_VERSION #include <qtopia/alarmserver.h> #include <qpe/resource.h> #include <qtopia/sound.h> + #endif #include "alarmdialog.h" AlarmDialog::AlarmDialog(QWidget *parent,const char *name) : QDialog (parent, name, true, Qt::WStyle_StaysOnTop ) { setCaption( "KO/Pi Alarm!" ); QVBoxLayout* layout = new QVBoxLayout( this); QLabel* l = new QLabel("The following event triggered alarm:",this); layout->addWidget ( l ); @@ -82,46 +83,54 @@ AlarmDialog::AlarmDialog(QWidget *parent,const char *name) layout->addWidget ( mMessage ); mMissedAlarms= new QLabel ( "(No missed Alarms)", this ); mMissedAlarms->setAlignment( AlignCenter); playSoundTimer = new QTimer( this ); connect ( playSoundTimer, SIGNAL( timeout() ), this, SLOT (playSound() ) ); playSoundTimer->stop(); layout->addWidget ( mMissedAlarms ); mMissedAlarmsCombo = new QComboBox ( this ); layout->addWidget ( mMissedAlarmsCombo ); - QVBox *suspendBox = new QVBox( this ); - suspendBox->setSpacing(3); - layout->addWidget ( suspendBox ); - QLabel* labb = new QLabel("Suspend duration (minutes):",suspendBox); + + QLabel* labb = new QLabel("Suspend duration (minutes):",this); labb->setAlignment(AlignCenter); + layout->addWidget ( labb ); fo = font(); - fo.setPointSize( 36 ); - mSuspendSpin = new QSpinBox(1,1440,1,suspendBox); + int pointSize = 36; + if ( QApplication::desktop()->width() <= 320 ) + pointSize = 24; + fo.setPointSize( pointSize ); + mSuspendSpin = new QSpinBox(1,1440,1,this); mSuspendSpin->setFont( fo ); mSuspendSpin->setValue(7); // default suspend duration mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); #if QT_VERSION < 0x030000 mSuspendSpin->upButton ()->setFixedSize( QSize( 48, 30 )); mSuspendSpin->downButton ()->setFixedSize( QSize( 48, 30 )); #endif mSuspendSpin->setFixedSize( 100,62 ); - mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); + mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); + QHBoxLayout* layoutSpin = new QHBoxLayout( layout ); + layoutSpin->addStretch (); + layoutSpin->addWidget ( mSuspendSpin ); + layoutSpin->addStretch (); QVBox * bbox = new QVBox ( this ); layout->addWidget ( bbox ); bbox->layout()->setSpacing( 2 ); + labb = new QLabel("Press \"Cancel\" or \"Esc\" to suspend!",bbox); + labb->setAlignment(AlignCenter); mSuspendButton = new QPushButton( "Suspend", bbox); QPushButton* silen = new QPushButton( " Stop sound ", bbox); QPushButton* okbut = new QPushButton( "Ok", bbox); mSuspendButton->setFont( fo ); silen->setFont( fo ); okbut->setFont( fo ); okbut->setDefault( true ); connect (silen , SIGNAL( clicked() ), this, SLOT (silent() ) ); connect (mSuspendButton, SIGNAL( clicked() ), this, SLOT (slotSuspend() ) ); connect (okbut , SIGNAL( clicked() ), this, SLOT (slotOk() ) ); #ifndef _WIN32_ if ( QFile::exists ( "/dev/sharp_led" ) ) @@ -250,31 +259,54 @@ bool AlarmDialog::eventNotification( QString mess, int replay , QString fn, boo void AlarmDialog::playSound () { if (mStopAlarm ) return; showNormal(); setActiveWindow(); mSuspendSpin->setFocus(); raise(); qApp->processEvents(); if ( alarmCounter < maxAlarmReplay && ! mSilent) { ++alarmCounter; +#ifdef DESKTOP_VERSION + mPlayWav = true; +#endif if ( !mPlayWav || mFileName.length() < 2 ) { -#ifndef DESKTOP_VERSION +#ifdef DESKTOP_VERSION + qDebug("Sound play not possible - file not found"); +#else Sound::soundAlarm (); #endif - } else { + } else + + { +#ifdef DESKTOP_VERSION +#ifdef _WIN32_ + QSound::play ( mFileName ); +#else + + QString command = "playwave -r 22050 " + mFileName; + qDebug("KO: Playing file %s with 22kHz",mFileName.latin1() ); + int ret = system ( command.latin1() ); + if ( ret != 0 ) { + qDebug("Sound play command failed: %s ",command.latin1() ); + } + +#endif + +#else QSound::play ( mFileName ); +#endif //qDebug("BEEP!"); - } + } } else { if ( ! mSilent && mSuspendCounter > 0 ) { --mSuspendCounter; reject (); hide(); return; } } playSoundTimer->start( mPauseCount * 1000, true ); } diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 3a16fe6..73aa733 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -226,25 +226,25 @@ CalendarView::CalendarView( Calendar *calendar, : CalendarViewBase( parent, name ), mCalendar( calendar ), mResourceManager( 0 ) { mEventEditor = 0; mTodoEditor = 0; init(); } void CalendarView::init() { - + mNextAlarmDateTime = QDateTime::currentDateTime(); setFocusPolicy ( WheelFocus ); mViewerCallerIsSearchDialog = false; mBlockShowDates = false; beamDialog = new KOBeamPrefs(); mDatePickerMode = 0; mCurrentSyncDevice = ""; writeLocale(); mViewManager = new KOViewManager( this ); mDialogManager = new KODialogManager( this ); mEventViewerDialog = 0; mModified = false; mReadOnly = false; @@ -633,24 +633,25 @@ void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString ¬i ) { //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); mSuspendAlarmNotification = noti; int ms = QDateTime::currentDateTime().secsTo( qdt )*1000; //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000); mSuspendTimer->start( ms , true ); } void CalendarView::addAlarm(const QDateTime &qdt, const QString ¬i ) { + mNextAlarmDateTime = qdt; //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { #ifndef DESKTOP_VERSION AlarmServer::addAlarm ( qdt,"koalarm", noti.latin1() ); #endif return; } int maxSec; //maxSec = 5; //testing only maxSec = 86400+3600; // one day+1hour mAlarmNotification = noti; int sec = QDateTime::currentDateTime().secsTo( qdt ); @@ -4055,12 +4056,27 @@ void CalendarView::resetFocus() } else mViewerCallerIsSearchDialog = false; } if ( !mViewerCallerIsSearchDialog ) { //mViewManager->currentView()->setFocus(); //qDebug("sssssssssssssssset focus "); topLevelWidget()->raise(); setActiveWindow(); //setFocus(); } mViewerCallerIsSearchDialog = false; } + +void CalendarView::showNextAlarms() +{ + QString message; + if ( mNextAlarmDateTime > QDateTime::currentDateTime() ) { + QString sum = mCalendar->nextSummary(); + QDateTime nextA = mNextAlarmDateTime; + QDateTime nextAl = mCalendar->nextAlarmEventDateTime(); + message = i18n("The next alarm is on:\n%1\nat: %2\n\n%3\n(%4)").arg( KGlobal::locale()->formatDate(nextA.date() , false)).arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ; + } else { + message = i18n("There is no next alarm."); + + } + KMessageBox::information( this, message); +} diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 16e671f..9782ffe 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -167,24 +167,25 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser /** Emitted, when the number of outgoing messages has changed. */ void numOutgoingChanged(int); /** Send status message, which can e.g. be displayed in the status bar. */ void statusMessage(const QString &); void calendarViewExpanded( bool ); void updateSearchDialog(); public slots: + void showNextAlarms(); void showOpenError(); void watchSavedFile(); void recheckTimerAlarm(); void checkNextTimerAlarm(); void addAlarm(const QDateTime &qdt, const QString ¬i ); void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); void removeAlarm(const QDateTime &qdt, const QString ¬i ); /** options dialog made a changed to the configuration. we catch this * and notify all widgets which need to update their configuration. */ void updateConfig(); @@ -490,24 +491,25 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser void setBlockShowDates( bool b ) { mBlockShowDates = b ;} protected: void schedule(Scheduler::Method, Incidence *incidence = 0); // returns KMsgBox::OKCandel() int msgItemDelete(const QString name); void showEventEditor(); void showTodoEditor(); void writeLocale(); Todo *selectedTodo(); private: + QDateTime mNextAlarmDateTime; bool mViewerCallerIsSearchDialog; bool mBlockShowDates; KSyncManager* mSyncManager; AlarmDialog * mAlarmDialog; QString mAlarmNotification; QString mSuspendAlarmNotification; QTimer* mSuspendTimer; QTimer* mAlarmTimer; QTimer* mRecheckAlarmTimer; void computeAlarm( QString ); void startAlarm( QString, QString ); void setSyncEventsReadOnly(); diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 95b836c..7a4275b 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -581,25 +581,25 @@ void MainWindow::initActions() if ( p-> mShowIconWeekNum ) mWeekAction->addTo( iconToolBar ); mWeekFont = font(); int fontPoint = mWeekFont.pointSize(); QFontMetrics f( mWeekFont ); int fontWid = f.width( "30" ); while ( fontWid > pixWid ) { --fontPoint; mWeekFont.setPointSize( fontPoint ); QFontMetrics f( mWeekFont ); fontWid = f.width( "30" ); - qDebug("dec-- "); + //qDebug("dec-- "); } connect( mWeekAction, SIGNAL( activated() ), this, SLOT( weekAction() ) ); connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); //#endif // ****************** QAction *action; // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); configureToolBarMenu->setCheckable( true ); @@ -1739,25 +1739,28 @@ void MainWindow::keyPressEvent ( QKeyEvent * e ) if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) mView->editFilters(); else mView->toggleFilter(); break; case Qt::Key_X: mView->toggleDateNavigatorWidget(); break; case Qt::Key_Space: mView->toggleExpand(); break; case Qt::Key_A: - mView->toggleAllDaySize(); + if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) + mView->showNextAlarms(); + else + mView->toggleAllDaySize(); break; case Qt::Key_T: if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) mView->newTodo(); else { mView->goToday(); showSelectedDates = true; } break; case Qt::Key_J: mView->viewManager()->showJournalView(); break; @@ -2124,12 +2127,24 @@ void MainWindow::weekAction() y = 0; } } //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)))) { month = picker->getResult(); emit selectWeek ( month ); //qDebug("weekSelected %d ", month); } delete popup; } + +void MainWindow::hideEvent ( QHideEvent * ) +{ + QString message; + QDateTime nextA = mCalendar->nextAlarmEventDateTime(); + if ( nextA.isValid() ) { + QString sum = mCalendar->nextSummary(); + + message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false)); + setCaption( message ); + } +} diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 7604529..b3041dc 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h @@ -95,24 +95,25 @@ class MainWindow : public QMainWindow void selectFilter( int ); void exportToPhone( int ); void toggleBeamReceive(); void disableBR(bool); signals: void selectWeek ( int ); private slots: void showConfigureAgenda(); void getFile( bool ); void syncFileRequest(); protected: + void hideEvent ( QHideEvent * ); QString sentSyncFile(); void displayText( QString, QString); void enableIncidenceActions( bool ); private: bool mBRdisabled; #ifndef DESKTOP_VERSION QCopChannel* infrared; #endif QAction* brAction; KSyncManager* mSyncManager; bool mClosed; |