summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt12
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt5
-rw-r--r--kalarmd/alarmdialog.cpp52
-rw-r--r--korganizer/calendarview.cpp18
-rw-r--r--korganizer/calendarview.h2
-rw-r--r--korganizer/mainwindow.cpp19
-rw-r--r--korganizer/mainwindow.h1
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
@@ -1,42 +1,54 @@
Info about the changes in new versions of KDE-Pim/Pi
********** VERSION 2.0.21 ************
Fixed another SMTP problem in OM/Pi.
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.
********** VERSION 2.0.18 ************
KO/Pi:
Fixed some minor problems.
Cleaned up the KO/Pi config dialog.
Fixed problem moving events in aganda view.
Made datepicker scaleable, i.e. if the datenavigator shows now a
datenavigator matrix depending on its size.
Birthdays are now displayed green in the datenavigator.
What'sThis Help in datenavigator shows all events of the day.
OM/Pi:
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
@@ -1283,31 +1283,34 @@
{ "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" },
{ "View Options","Anzeige Optionen" },
{ "<b>Created: ","<b>Erstellt am: " },
{ "<b>Last modified: ","<b>Zuletzt geändert am: " },
{ "Journal: ","Journal: " },
{ "yearly","jährlich" },
{ "(%1) ","%1-" },
{ "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" },
{ "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" },
{ "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" },
{ "Summary/Loc.","Titel/Ort" },
{ "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." },
{ "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
@@ -26,114 +26,123 @@
#include <qhbox.h>
#include <qvbox.h>
#include <qapp.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qfile.h>
#include <qtimer.h>
#include <qsound.h>
#include <qpushbutton.h>
#define protected public
#include <qspinbox.h>
#undef protected
#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 );
l->setAlignment( AlignCenter);
mMessage = new QLabel ( " ", this );
int fs = 18;
int fs2 = 12;
if ( QApplication::desktop()->width() < 480 ) {
setMaximumSize(220, 260);
fs2 = 10;
}
else {
setMaximumSize(440, 440);
}
layout->setSpacing( 3 );
layout->setMargin( 3 );
QFont fo = QApplication::font();
fo.setBold( true );
fo.setPointSize( fs2 );
l->setFont( fo );
fo.setPointSize( fs );
mMessage->setFont(fo );
mMessage->setAlignment( AlignCenter);
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" ) )
fd_led = open ( "/dev/sharp_led", O_RDWR|O_NONBLOCK );
else
#endif
fd_led = 0;
statusLED.which = SHARP_LED_SALARM;
mSilent = false;
mSuspendCounter = 0;
setServerNotification( true );
}
void AlarmDialog::reject ()
{
QTimer::singleShot ( 3000, this, SLOT (suspend()) );
@@ -238,43 +247,66 @@ bool AlarmDialog::eventNotification( QString mess, int replay , QString fn, boo
#ifndef _WIN32_
if ( fd_led > 0 ) {
statusLED.status = LED_SALARM_ON ;
ioctl (fd_led, SHARP_LED_SETSTATUS, &statusLED);
}
#endif
playSoundTimer->start( 1000, true );
return true;
}
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
@@ -214,49 +214,49 @@ CalendarView::CalendarView( CalendarResources *calendar,
mCalendar( calendar ),
mResourceManager( calendar->resourceManager() )
{
mEventEditor = 0;
mTodoEditor = 0;
init();
}
CalendarView::CalendarView( Calendar *calendar,
QWidget *parent, const char *name )
: 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;
mSelectedIncidence = 0;
mCalPrinter = 0;
mFilters.setAutoDelete(true);
mCalendar->registerObserver( this );
// TODO: Make sure that view is updated, when calendar is changed.
mStorage = new FileStorage( mCalendar );
mNavigator = new DateNavigator( this, "datevav", mViewManager );
QBoxLayout *topLayout = (QBoxLayout*)layout();
#ifndef KORG_NOSPLITTER
@@ -621,48 +621,49 @@ void CalendarView::computeAlarm( QString msg )
//qDebug("audio file command %s ",tempfilename.latin1() );
}
if ( mess.left( 9 ) == "cal_alarm") {
mAlarmMessage = mess.mid( 9 ) ;
}
startAlarm( mAlarmMessage, filename );
}
void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString &noti )
{
//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 &noti )
{
+ 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 );
if ( sec > maxSec ) {
mRecheckAlarmTimer->start( maxSec * 1000 );
// qDebug("recheck Alarm timer started with secs: %d next alarm in sec:%d", maxSec,sec );
return;
} else {
mRecheckAlarmTimer->stop();
}
//qDebug("Alarm timer started with secs: %d ", sec);
mAlarmTimer->start( sec *1000 , true );
}
// called by mRecheckAlarmTimer to get next alarm
@@ -4043,24 +4044,39 @@ void CalendarView::undo_delete()
void CalendarView::slotViewerClosed()
{
QTimer::singleShot( 50, this, SLOT ( resetFocus() ) );
}
void CalendarView::resetFocus()
{
if ( mViewerCallerIsSearchDialog ) {
if ( mDialogManager->getSearchDialog()->isVisible() ){
mDialogManager->getSearchDialog()->raise();
mDialogManager->getSearchDialog()->setActiveWindow();
mDialogManager->getSearchDialog()->listview()->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
@@ -155,48 +155,49 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
void incidenceSelected( Incidence * );
/** Emitted, when a todoitem is selected or deselected. */
void todoSelected( bool );
/**
Emitted, when clipboard content changes. Parameter indicates if paste
is possible or not.
*/
void pasteEnabled(bool);
/** Emitted, when the number of incoming messages has changed. */
void numIncomingChanged(int);
/** 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 &noti );
void addSuspendAlarm(const QDateTime &qdt, const QString &noti );
void removeAlarm(const QDateTime &qdt, const QString &noti );
/** options dialog made a changed to the configuration. we catch this
* and notify all widgets which need to update their configuration. */
void updateConfig();
void insertBirthdays(const QString& uid, const QStringList& birthdayList,
const QStringList& anniversaryList, const QStringList& realNameList,
const QStringList& emailList, const QStringList& assembledNameList,
const QStringList& uidList);
/**
Load calendar from file \a filename. If \a merge is true, load
calendar into existing one, if it is false, clear calendar, before
loading. Return true, if calendar could be successfully loaded.
*/
bool openCalendar(QString filename, bool merge=false);
bool syncCalendar(QString filename,int mode = 0 );
@@ -478,48 +479,49 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
void setSyncManager(KSyncManager* manager);
void setLoadedFileVersion(QDateTime);
bool checkFileVersion(QString fn);
bool checkFileChanged(QString fn);
Event* getLastSyncEvent();
/** Adapt navigation units correpsonding to step size of navigation of the
* current view.
*/
void adaptNavigationUnits();
bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode );
int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false );
//Attendee* getYourAttendee(Event *event);
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();
QDateTime loadedFileVersion;
void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete );
void checkExternalId( Incidence * inc );
int mGlobalSyncMode;
QString mCurrentSyncDevice;
QString mCurrentSyncName;
KOBeamPrefs* beamDialog;
void init();
int mDatePickerMode;
bool mFlagEditDescription;
QDateTime mLastCalendarSync;
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 95b836c..7a4275b 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -569,49 +569,49 @@ void MainWindow::initActions()
menuBar->insertItem( i18n("Filter"),selectFilterMenu );
menuBar->insertItem( i18n("Help"), helpMenu );
//menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
menuBar1->setMaximumSize( menuBar1->sizeHint( ));
}
connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) );
mWeekBgColor = iconToolBar->backgroundColor();
mWeekPixmap.resize( pixWid , pixHei );
mWeekPixmap.fill( mWeekBgColor );
icon = mWeekPixmap;
mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this );
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 );
configureAgendaMenu->setCheckable( true );
int iii ;
for ( iii = 1;iii<= 10 ;++iii ){
configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 );
}
//configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
connect( configureAgendaMenu, SIGNAL( aboutToShow()),
this, SLOT( showConfigureAgenda( ) ) );
@@ -1727,49 +1727,52 @@ void MainWindow::keyPressEvent ( QKeyEvent * e )
showSelectedDates = true;
break;
case Qt::Key_V:
mView->viewManager()->showTodoView();
break;
case Qt::Key_C:
mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() );
break;
case Qt::Key_P:
mView->showDatePicker( );
break;
case Qt::Key_F:
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;
case Qt::Key_B:
mView->editIncidenceDescription();;
break;
// case Qt::Key_Return:
case Qt::Key_E:
if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
mView->newEvent();
else
mView->editIncidence();
break;
case Qt::Key_Plus:
size = p->mHourSize +2;
@@ -2112,24 +2115,36 @@ void MainWindow::weekAction()
if ( iconToolBar->orientation () == Qt:: Horizontal ) {
if ( iconToolBar->y() > height()/2 ) {
dY = picker->sizeHint().height()+8;
y = 0;
}
} else {
if ( iconToolBar->x() > width()/2 ) { // right side
x=0;
dX= picker->sizeHint().width()+8;
y = 0;
} else {
x= iconToolBar->width();
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
@@ -83,48 +83,49 @@ class MainWindow : public QMainWindow
void slotModifiedChanged( bool );
void save();
void saveStopTimer();
void configureToolBar( int );
void printSel();
void printCal();
void saveCalendar();
void loadCalendar();
void exportVCalendar();
void fillFilterMenu();
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;
void saveOnClose();
bool mFlagKeyPressed;
bool mBlockAtStartup;
QPEToolBar *iconToolBar;
void initActions();
void setDefaultPreferences();
void keyPressEvent ( QKeyEvent * ) ;
void keyReleaseEvent ( QKeyEvent * ) ;
QPopupMenu *configureToolBarMenu;
QPopupMenu *selectFilterMenu;
QPopupMenu *configureAgendaMenu, *syncMenu;
CalendarLocal *mCalendar;