summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp19
-rw-r--r--korganizer/koagendaview.cpp4
-rw-r--r--korganizer/koeditorgeneral.cpp69
-rw-r--r--korganizer/kotodoview.cpp11
-rw-r--r--korganizer/kotodoview.h1
5 files changed, 62 insertions, 42 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index beb19d9..76cce26 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -529,8 +529,13 @@ 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() ) );
}
@@ -4093,9 +4098,9 @@ void CalendarView::showNextAlarms()
min = min % 60;
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 )
message += i18n("1 day\n");
@@ -4106,12 +4111,22 @@ void CalendarView::showNextAlarms()
if ( min > 1 )
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
@@ -152,9 +152,9 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
timeHeight = (timeHeight-1) /2 -1;
//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()) {
if (cell == 12) suffix = "pm";
@@ -214,9 +214,9 @@ void TimeLabels::updateConfig()
setFixedWidth( mMiniWidth );
// update HourSize
mCellHeight = KOPrefs::instance()->mHourSize*4;
- resizeContents(50,mRows * mCellHeight);
+ resizeContents(mMiniWidth,mRows * mCellHeight+1);
}
/** update time label positions */
void TimeLabels::positionChanged()
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp
index b14ca43..abc80d4 100644
--- a/korganizer/koeditorgeneral.cpp
+++ b/korganizer/koeditorgeneral.cpp
@@ -226,61 +226,58 @@ void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout)
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
+
}
QString KOEditorGeneral::getFittingPath( const QString s )
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 01cf0ff..395325c 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -203,8 +203,12 @@ void KOTodoListView::contentsDropEvent(QDropEvent *e)
}
}
#endif
}
+void KOTodoListView::wheelEvent (QWheelEvent *e)
+{
+ QListView::wheelEvent (e);
+}
void KOTodoListView::contentsMousePressEvent(QMouseEvent* e)
{
@@ -226,11 +230,13 @@ void KOTodoListView::contentsMousePressEvent(QMouseEvent* e)
rootClicked = false;
}
#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);
#ifndef DESKTOP_VERSION
@@ -1081,9 +1087,9 @@ void KOTodoView::itemDoubleClicked(QListViewItem *item)
if (!item) {
newTodo();
return;
} else {
- if ( row == 1 ) {
+ if ( row == 1 || row == 2 ) {
mActiveItem = (KOTodoViewItem *) item;
newSubTodo();
return;
}
@@ -1270,8 +1276,9 @@ void KOTodoView::setAllFlat()
void KOTodoView::purgeCompleted()
{
emit purgeCompletedSignal();
+
}
void KOTodoView::toggleQuickTodo()
{
if ( mQuickAdd->isVisible() ) {
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h
index e553d0e..39976cf 100644
--- a/korganizer/kotodoview.h
+++ b/korganizer/kotodoview.h
@@ -67,8 +67,9 @@ class KOTodoListView : public KListView
void reparentTodoSignal( Todo *,Todo * );
void unparentTodoSignal(Todo *);
void deleteTodo( Todo * );
protected:
+ void wheelEvent (QWheelEvent *e);
void contentsDragEnterEvent(QDragEnterEvent *);
void contentsDragMoveEvent(QDragMoveEvent *);
void contentsDragLeaveEvent(QDragLeaveEvent *);
void contentsDropEvent(QDropEvent *);