summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt4
-rw-r--r--kalarmd/simplealarmdaemonimpl.cpp108
-rw-r--r--kalarmd/simplealarmdaemonimpl.h35
-rw-r--r--korganizer/koeditorgeneral.cpp1
-rw-r--r--korganizer/searchdialog.cpp5
5 files changed, 135 insertions, 18 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index a8035d4..b6293b5 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1302,8 +1302,12 @@
{ "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" },
+{ "","" },
+{ "","" },
+{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp
index 50c4605..ec7f730 100644
--- a/kalarmd/simplealarmdaemonimpl.cpp
+++ b/kalarmd/simplealarmdaemonimpl.cpp
@@ -30,12 +30,16 @@
#include <qfile.h>
#include <qhbox.h>
#include <qtimer.h>
#include <qfile.h>
+#include <qdatetime.h>
+#include <qpushbutton.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qdialog.h>
+#define protected public
#include <qspinbox.h>
+#undef protected
#include <qtextstream.h>
#include <qtopia/qcopenvelope_qws.h>
#include <qtopia/alarmserver.h>
@@ -62,9 +66,11 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent )
mPopUp->insertItem( "New Mail", this, SLOT ( newMail() ) );
mPopUp->insertSeparator();
mPopUp->insertItem( "Multi Sync", this, SLOT ( ringSync() ) );
mTimerPopUp = new QPopupMenu( this );
-
+ QFont fon = mTimerPopUp->font();
+ fon.setPointSize( fon.pointSize() *3/2 );
+ mTimerPopUp->setFont( fon );
mBeepPopUp = new QPopupMenu( this );
mSoundPopUp = new QPopupMenu( this );
mPausePopUp = new QPopupMenu( this );
QPopupMenu* savePopUp = new QPopupMenu( this );
@@ -354,9 +360,9 @@ void SimpleAlarmDaemonImpl::fillTimerPopUp()
if ( mTimerPopupConf == mTimerTime ) {
if ( mTimerTime ) {
int secs = QDateTime::currentDateTime().secsTo ( mRunningTimer );
QTime t ( secs/3600, (secs/60)%60, secs%60 );
- mTimerPopUp->changeItem ( 1 , t.toString());
+ mTimerPopUp->changeItem ( 1 , t.toString() + " (remaining time)");
}
else {
QString text = mCustomText.stripWhiteSpace ();
int in = text.find( " " );
@@ -369,10 +375,13 @@ void SimpleAlarmDaemonImpl::fillTimerPopUp()
mTimerPopUp->clear();
if ( mTimerTime ) {
int secs = QDateTime::currentDateTime().secsTo ( mRunningTimer );
QTime t ( secs/3600, (secs/60)%60, secs%60 );
- mTimerPopUp->insertItem( "Stop", 0 );
- mTimerPopUp->insertItem( t.toString(),1);
+
+
+ mTimerPopUp->insertItem( "Stop timer "+ mRunningTimerText , 0 );
+ mTimerPopUp->insertItem( t.toString() + " (remaining time)",1);
+ mTimerPopUp->insertItem( mRunningTimer.time().toString() + " (alarm time)",2);
} else {
QString fileName = QDir::homeDirPath() +"/.kopialarmtimerrc";
QFile file( fileName );
@@ -463,15 +472,27 @@ void SimpleAlarmDaemonImpl::confTimer( int time )
if ( ! mTimerTime )
return;
QDialog dia ( 0, ("Stop Timer" ), true );
- QLabel lab (("Really stop the timer?"), &dia );
+ QLabel lab (("Really stop the timer?\n\n"+ mRunningTimerText+"\n"), &dia );
+ lab.setAlignment( AlignCenter );
dia.setCaption(("KO/Pi Timer Stop" ));
- QVBoxLayout lay( &dia );
+ QVBoxLayout lay( &dia );
+ lay.addWidget( &lab);
+ QPushButton ok ( "Stop timer!", &dia);
+ QFont fo = dia.font();
+ fo.setPointSize( 36 );
+ ok.setFont( fo );
+ lay.addWidget( &ok);
+ connect ( &ok, SIGNAL (clicked()), &dia, SLOT ( accept() ) );
+ QPushButton con ( "Continue timer!", &dia);
+ fo.setPointSize( 36 );
+ con.setFont( fo );
+ lay.addWidget( &con);
+ connect ( &con, SIGNAL (clicked()), &dia, SLOT ( reject() ) );
lay.setMargin(5);
lay.setSpacing(5);
- lay.addWidget( &lab);
- dia.resize( 200, dia.sizeHint().height() );
+ dia.resize(dia.sizeHint() );
if ( !dia.exec() )
return;
@@ -485,17 +506,26 @@ void SimpleAlarmDaemonImpl::confTimer( int time )
return;
}
QString mess = "timer_alarm";
mess += ("Timer Alarm!\n");
- if ( minutes == 22 )
+ if ( minutes == 22 ) {
mess += ( "Pizza is ready");
- else if ( minutes == 45 )
+ mRunningTimerText = "Pizza";
+ }
+ else if ( minutes == 45 ) {
mess += ( "Please wake up!");
- else if ( minutes == 5 )
+ mRunningTimerText = "Nap";
+ }
+ else if ( minutes == 5 ) {
mess += ( "Tea is ready");
+ mRunningTimerText = "Tea";
+ }
else if ( minutes == 3 ) {
mess += mCustomText;
- minutes = mCustomMinutes ;
+ minutes = mCustomMinutes ;
+ mRunningTimerText = mCustomText.stripWhiteSpace ();
+ int in = mRunningTimerText.find( " " );
+ mRunningTimerText = mRunningTimerText.left ( in );
}
else {
if ( minutes == 2 ) {
// ask time
@@ -509,17 +539,52 @@ void SimpleAlarmDaemonImpl::confTimer( int time )
QLineEdit lEdit( mCustomText, &dia );
lay.addWidget( &lEdit);
QLabel lab2 (("Countdown time (1 min - 24 h):"), &dia );
lay.addWidget( &lab2);
+ QHBox hbox1 ( &dia );
+ lay.addWidget( &hbox1);
+ QLabel lab3 (("Hours"), &hbox1 );
+ QLabel lab4 (("Minutes"), &hbox1 );
QHBox hbox ( &dia );
- QLabel lab3 (("h:"), &hbox );
QSpinBox spinh( 0, 24, 1,& hbox );
- QLabel lab4 ((" min:"), &hbox );
+ QFont fo = dia.font();
+ fo.setPointSize( 36 );
QSpinBox spinm( 0, 59, 1,&hbox );
+ spinm.setFont( fo );
+ spinh.setFont( fo );
+ spinh.setButtonSymbols( QSpinBox::PlusMinus );
+ spinm.setButtonSymbols( QSpinBox::PlusMinus );
+ spinh.upButton ()->setFixedSize( QSize( 48, 30 ));
+ spinh.downButton ()->setFixedSize( QSize( 48, 30 ));
+ //spinh.editor ()->setFixedSize( QSize( 50, 100 ));
+ spinh.setFixedSize( 100,62 );
+ spinm.upButton ()->setFixedSize( QSize( 48, 30 ));
+ spinm.downButton ()->setFixedSize( QSize( 48, 30 ));
+ spinm.downButton ()->setGeometry( 50,50,50,50);
+ spinm.setSuffix( " m" );
+ spinh.setSuffix( " h" );
+ spinm.setWrapping ( true );
+ //spinm.editor ()->setFixedSize( QSize( 50, 100 ));
+ spinm.setLineStep( 1 );
+ spinm.setFixedSize( 110,62 );
+ lay.addWidget( &hbox);
+ QLabel lab5 ("Timer fires at:", &dia );
+ lab5.setAlignment( AlignCenter );
+ lay.addWidget( &lab5);
+ KODateLabel dl ( &dia );
+ dl.setAlignment( AlignCenter );
+ dl.setFont( fo );
+ connect ( &spinh, SIGNAL ( valueChanged (int)), &dl, SLOT ( slot_hours( int ) ) );
+ connect ( &spinm, SIGNAL ( valueChanged (int)), &dl, SLOT ( slot_minutes( int ) ) );
+ lay.addWidget( &dl);
spinh.setValue( mCustomMinutes/60 );
spinm.setValue( mCustomMinutes%60 );
- lay.addWidget( &hbox);
+ QPushButton ok ( "Start timer", &dia);
+ ok.setFont( fo );
+ lay.addWidget( &ok);
+ connect ( &ok, SIGNAL (clicked()), &dia, SLOT ( accept() ) );
dia.resize( dia.sizeHint().width(), dia.sizeHint().height() );
+
if ( !dia.exec() )
return;
mCustomText = lEdit.text();
mCustomMinutes = spinh.value()*60+spinm.value();
@@ -527,12 +592,21 @@ void SimpleAlarmDaemonImpl::confTimer( int time )
mCustomMinutes = 1;
if ( mCustomMinutes > 1440 )
mCustomMinutes = 1440;
mess += mCustomText;
- minutes = mCustomMinutes;
+ minutes = mCustomMinutes;
+ mRunningTimerText = mCustomText.stripWhiteSpace ();
+ int in = mRunningTimerText.find( " " );
+ mRunningTimerText = mRunningTimerText.left ( in );
}
- else
+ else {
mess+= QString::number ( minutes ) + ( " minutes are past!");
+ int min = minutes;
+ if ( min % 60 == 0 )
+ mRunningTimerText = QString::number ( min/60 ) + ( " hours");
+ else
+ mRunningTimerText = QString::number ( minutes ) + ( " minutes");
+ }
}
//minutes = 1;
mRunningTimer = QDateTime::currentDateTime().addSecs( minutes * 60 );
timerMesssage = mess;
diff --git a/kalarmd/simplealarmdaemonimpl.h b/kalarmd/simplealarmdaemonimpl.h
index 32a3867..cbdba47 100644
--- a/kalarmd/simplealarmdaemonimpl.h
+++ b/kalarmd/simplealarmdaemonimpl.h
@@ -25,8 +25,9 @@
//#include "simplealarmdaemon.h"
#include <qdatetime.h>
#include <qlabel.h>
+#include <qtimer.h>
class QLabel;
class QTimer;
class QPopupMenu;
@@ -77,10 +78,42 @@ class SimpleAlarmDaemonImpl : public QLabel
QDateTime mRunningTimer;
void fillTimerPopUp();
QString timerMesssage;
QString mCustomText;
+ QString mRunningTimerText;
int mCustomMinutes;
int mTimerPopupConf;
bool wavAlarm;
};
-
+class KODateLabel : public QLabel
+{
+ Q_OBJECT
+ public:
+ KODateLabel( QWidget *parent=0, const char *name=0 ) :
+ QLabel( parent, name )
+ {
+ hour = 0;
+ minutes = 0;
+ QTimer * ti = new QTimer( this );
+ connect ( ti, SIGNAL ( timeout () ), this, SLOT ( updateText() ));
+ ti->start( 1000 );
+
+ }
+public slots:
+ void slot_minutes( int m )
+ {
+ minutes = m; updateText();
+ }
+ void slot_hours( int h )
+ {
+ hour = h; updateText();
+ }
+private slots:
+ void updateText()
+ {
+ QDateTime dt = QDateTime::currentDateTime();
+ dt = dt.addSecs( minutes * 60 + hour * 3600 );
+ setText( dt.time().toString() );
+ }
+ int hour, minutes;
+};
#endif
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp
index 92fcd1c..b14ca43 100644
--- a/korganizer/koeditorgeneral.cpp
+++ b/korganizer/koeditorgeneral.cpp
@@ -184,8 +184,9 @@ void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout)
connect(mAlarmButton, SIGNAL(toggled(bool)), SLOT(enableAlarmEdit(bool)));
alarmLayout->addWidget(mAlarmButton);
mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ;
+ mAlarmTimeEdit->setButtonSymbols( QSpinBox::PlusMinus );
alarmLayout->addWidget(mAlarmTimeEdit);
mAlarmIncrCombo = new QComboBox(false, parent);
if ( QApplication::desktop()->width() < 320 ) {
mAlarmIncrCombo->insertItem(i18n("min"));
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index 678e1bd..341a839 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -163,8 +163,13 @@ void SearchDialog::doSearch()
re.setWildcard(true); // most people understand these better.
re.setCaseSensitive(false);
re.setPattern(searchEdit->text());
+ if (!mSearchEvent->isChecked() && !mSearchTodo->isChecked() && !mSearchJournal->isChecked() ) {
+ KMessageBox::sorry(this,
+ i18n("Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals"));
+ return;
+ }
if (!re.isValid() ) {
KMessageBox::sorry(this,
i18n("Invalid search expression,\ncannot perform "
"the search.\nPlease enter a search expression\n"