summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-27 09:46:04 (UTC)
committer zautrix <zautrix>2005-03-27 09:46:04 (UTC)
commitb170a7414ff72016285ea207caa7ccf786530e77 (patch) (side-by-side diff)
treecb635d155fed20ecb33f877659a00d88bedb309e
parentee6f7d5329658c567882e8e496c65eef8874496e (diff)
downloadkdepimpi-b170a7414ff72016285ea207caa7ccf786530e77.zip
kdepimpi-b170a7414ff72016285ea207caa7ccf786530e77.tar.gz
kdepimpi-b170a7414ff72016285ea207caa7ccf786530e77.tar.bz2
many fixes
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt12
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt5
-rw-r--r--kalarmd/alarmdialog.cpp48
-rw-r--r--korganizer/calendarview.cpp18
-rw-r--r--korganizer/calendarview.h2
-rw-r--r--korganizer/mainwindow.cpp17
-rw-r--r--korganizer/mainwindow.h1
7 files changed, 92 insertions, 11 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
@@ -18,2 +18,14 @@ 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!
+
+
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
@@ -1306,2 +1306,5 @@
{ "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)" },
{ "","" },
@@ -1312,2 +1315,2 @@
{ "","" },
-{ "","" },
+ \ 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
@@ -49,2 +49,3 @@
#include <qtopia/sound.h>
+
#endif
@@ -93,10 +94,12 @@ AlarmDialog::AlarmDialog(QWidget *parent,const char *name)
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 );
@@ -111,2 +114,6 @@ AlarmDialog::AlarmDialog(QWidget *parent,const char *name)
mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus );
+ QHBoxLayout* layoutSpin = new QHBoxLayout( layout );
+ layoutSpin->addStretch ();
+ layoutSpin->addWidget ( mSuspendSpin );
+ layoutSpin->addStretch ();
@@ -115,2 +122,4 @@ AlarmDialog::AlarmDialog(QWidget *parent,const char *name)
bbox->layout()->setSpacing( 2 );
+ labb = new QLabel("Press \"Cancel\" or \"Esc\" to suspend!",bbox);
+ labb->setAlignment(AlignCenter);
mSuspendButton = new QPushButton( "Suspend", bbox);
@@ -261,9 +270,32 @@ void AlarmDialog::playSound ()
++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!");
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 3a16fe6..73aa733 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -237,3 +237,3 @@ void CalendarView::init()
{
-
+ mNextAlarmDateTime = QDateTime::currentDateTime();
setFocusPolicy ( WheelFocus );
@@ -644,2 +644,3 @@ void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti )
{
+ mNextAlarmDateTime = qdt;
//qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
@@ -4066 +4067,16 @@ void CalendarView::resetFocus()
}
+
+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
@@ -178,2 +178,3 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
public slots:
+ void showNextAlarms();
void showOpenError();
@@ -501,2 +502,3 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
private:
+ QDateTime mNextAlarmDateTime;
bool mViewerCallerIsSearchDialog;
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 95b836c..7a4275b 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -592,3 +592,3 @@ void MainWindow::initActions()
fontWid = f.width( "30" );
- qDebug("dec-- ");
+ //qDebug("dec-- ");
}
@@ -1750,2 +1750,5 @@ void MainWindow::keyPressEvent ( QKeyEvent * e )
case Qt::Key_A:
+ if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton )
+ mView->showNextAlarms();
+ else
mView->toggleAllDaySize();
@@ -2135 +2138,13 @@ void MainWindow::weekAction()
}
+
+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
@@ -106,2 +106,3 @@ class MainWindow : public QMainWindow
protected:
+ void hideEvent ( QHideEvent * );
QString sentSyncFile();