author | zautrix <zautrix> | 2005-03-27 13:04:11 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-27 13:04:11 (UTC) |
commit | 9e3e43aaca0986ae224c752d2d3a760661be61b6 (patch) (unidiff) | |
tree | 18295c0cc7177be6022a7abec716131f06b2a756 | |
parent | 1800cf5f3af1f666dddcbfffe3171adcd467ae3d (diff) | |
download | kdepimpi-9e3e43aaca0986ae224c752d2d3a760661be61b6.zip kdepimpi-9e3e43aaca0986ae224c752d2d3a760661be61b6.tar.gz kdepimpi-9e3e43aaca0986ae224c752d2d3a760661be61b6.tar.bz2 |
fixes
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 13 | ||||
-rw-r--r-- | kalarmd/alarmdialog.cpp | 4 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 28 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 27 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 8 | ||||
-rw-r--r-- | libkcal/calendarlocal.cpp | 1 |
6 files changed, 59 insertions, 22 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index ce55780..5ef60be 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1301,16 +1301,25 @@ | |||
1301 | { "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, | 1301 | { "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, |
1302 | { "Journal/Details...","Journale/Details..." }, | 1302 | { "Journal/Details...","Journale/Details..." }, |
1303 | { "Agenda View","Agenda Ansicht" }, | 1303 | { "Agenda View","Agenda Ansicht" }, |
1304 | { "Show current time","Zeige aktuelle Zeit" }, | 1304 | { "Show current time","Zeige aktuelle Zeit" }, |
1305 | { "Edit new item","Bearbeite neuen Eintrag" }, | 1305 | { "Edit new item","Bearbeite neuen Eintrag" }, |
1306 | { "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" }, | 1306 | { "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" }, |
1307 | { "There is no next alarm.","Es gibt keinen nächsten Alarm." }, | 1307 | { "There is no next alarm.","Es gibt keinen nächsten Alarm." }, |
1308 | { "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" }, | 1308 | { "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" }, |
1309 | { "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)" }, | 1309 | { "The next alarm is in:\n","Der nächste Alarm ist in:\n" }, |
1310 | { "%1 days\n","%1 Tagen\n" }, | ||
1311 | { "1 day\n","1 Tag\n" }, | ||
1312 | { "%1 hours\n","%1 Stunden\n" }, | ||
1313 | { "1 hour\n","1 Stunde\n" }, | ||
1314 | { "%1 minutes\n","%1 Minuten\n" }, | ||
1315 | { "1 minute\n","1 Minute\n" }, | ||
1310 | { "","" }, | 1316 | { "","" }, |
1311 | { "","" }, | 1317 | { "","" }, |
1312 | { "","" }, | 1318 | { "","" }, |
1313 | { "","" }, | 1319 | { "","" }, |
1314 | { "","" }, | 1320 | { "","" }, |
1315 | { "","" }, | 1321 | { "","" }, |
1316 | \ No newline at end of file | 1322 | { "","" }, |
1323 | { "","" }, | ||
1324 | { "","" }, | ||
1325 | { "","" }, \ No newline at end of file | ||
diff --git a/kalarmd/alarmdialog.cpp b/kalarmd/alarmdialog.cpp index 7ead3b9..7b888ab 100644 --- a/kalarmd/alarmdialog.cpp +++ b/kalarmd/alarmdialog.cpp | |||
@@ -27,19 +27,23 @@ | |||
27 | #include <qvbox.h> | 27 | #include <qvbox.h> |
28 | #include <qapp.h> | 28 | #include <qapp.h> |
29 | #include <qlabel.h> | 29 | #include <qlabel.h> |
30 | #include <qlayout.h> | 30 | #include <qlayout.h> |
31 | #include <qfile.h> | 31 | #include <qfile.h> |
32 | #include <qtimer.h> | 32 | #include <qtimer.h> |
33 | #include <qsound.h> | 33 | #include <qsound.h> |
34 | #include <qpushbutton.h> | 34 | #include <qpushbutton.h> |
35 | #ifndef DESKTOP_VERSION | ||
35 | #define protected public | 36 | #define protected public |
36 | #include <qspinbox.h> | 37 | #include <qspinbox.h> |
37 | #undef protected | 38 | #undef protected |
39 | #else | ||
40 | #include <qspinbox.h> | ||
41 | #endif | ||
38 | #include <stdlib.h> | 42 | #include <stdlib.h> |
39 | #ifndef _WIN32_ | 43 | #ifndef _WIN32_ |
40 | #include <unistd.h> | 44 | #include <unistd.h> |
41 | #include <sys/ioctl.h> | 45 | #include <sys/ioctl.h> |
42 | #endif | 46 | #endif |
43 | #include <stdio.h> | 47 | #include <stdio.h> |
44 | #include <fcntl.h> | 48 | #include <fcntl.h> |
45 | 49 | ||
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 73aa733..a330414 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -4064,19 +4064,41 @@ void CalendarView::resetFocus() | |||
4064 | //setFocus(); | 4064 | //setFocus(); |
4065 | } | 4065 | } |
4066 | mViewerCallerIsSearchDialog = false; | 4066 | mViewerCallerIsSearchDialog = false; |
4067 | } | 4067 | } |
4068 | 4068 | ||
4069 | void CalendarView::showNextAlarms() | 4069 | void CalendarView::showNextAlarms() |
4070 | { | 4070 | { |
4071 | QString message; | 4071 | QString message; |
4072 | if ( mNextAlarmDateTime > QDateTime::currentDateTime() ) { | 4072 | QDateTime nextAl = mCalendar->nextAlarmEventDateTime(); |
4073 | if ( nextAl.isValid() && mNextAlarmDateTime > QDateTime::currentDateTime() ) { | ||
4073 | QString sum = mCalendar->nextSummary(); | 4074 | QString sum = mCalendar->nextSummary(); |
4074 | QDateTime nextA = mNextAlarmDateTime; | 4075 | QDateTime nextA = mNextAlarmDateTime; |
4075 | QDateTime nextAl = mCalendar->nextAlarmEventDateTime(); | 4076 | QDateTime cur = QDateTime::currentDateTime(); |
4076 | 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)) ; | 4077 | int secs = cur.secsTo( nextA ); |
4078 | int min = secs /60; | ||
4079 | int hours = min /60; | ||
4080 | min = min % 60; | ||
4081 | int days = hours /24; | ||
4082 | hours = hours % 24; | ||
4083 | |||
4084 | message = i18n("The next alarm is in:\n"); | ||
4085 | if ( days > 1 ) | ||
4086 | message += i18n("%1 days\n").arg( days ); | ||
4087 | else if ( days == 1 ) | ||
4088 | message += i18n("1 day\n"); | ||
4089 | if ( hours > 1 ) | ||
4090 | message += i18n("%1 hours\n").arg( hours ); | ||
4091 | else if ( hours == 1 ) | ||
4092 | message += i18n("1 hour\n"); | ||
4093 | if ( min > 1 ) | ||
4094 | message += i18n("%1 minutes\n").arg( min ); | ||
4095 | else if ( min == 1 ) | ||
4096 | message += i18n("1 minute\n"); | ||
4097 | |||
4098 | message += i18n("\n(%1)\n\n%2\n(%3)\n").arg( KGlobal::locale()->formatDateTime(nextA , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ; | ||
4077 | } else { | 4099 | } else { |
4078 | message = i18n("There is no next alarm."); | 4100 | message = i18n("There is no next alarm."); |
4079 | 4101 | ||
4080 | } | 4102 | } |
4081 | KMessageBox::information( this, message); | 4103 | KMessageBox::information( this, message); |
4082 | } | 4104 | } |
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 18f242c..f6f390b 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -120,17 +120,16 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) | |||
120 | cw = contentsWidth() - 2; | 120 | cw = contentsWidth() - 2; |
121 | // end of workaround | 121 | // end of workaround |
122 | 122 | ||
123 | int cell = ((int)(cy/mCellHeight)); | 123 | int cell = ((int)(cy/mCellHeight)); |
124 | int y = cell * mCellHeight; | 124 | int y = cell * mCellHeight; |
125 | QFontMetrics fm = fontMetrics(); | 125 | QFontMetrics fm = fontMetrics(); |
126 | QString hour; | 126 | QString hour; |
127 | QString suffix; | 127 | QString suffix; |
128 | QString fullTime; | ||
129 | int tW = fm.width("24:00i"); | 128 | int tW = fm.width("24:00i"); |
130 | int timeHeight = fm.height(); | 129 | int timeHeight = fm.height(); |
131 | //timeHeight -= (timeHeight/4-2); | 130 | //timeHeight -= (timeHeight/4-2); |
132 | int borderWidth = 0; | 131 | int borderWidth = 0; |
133 | QFont nFont = p->font(); | 132 | QFont nFont = p->font(); |
134 | 133 | ||
135 | if (!KGlobal::locale()->use12Clock()) | 134 | if (!KGlobal::locale()->use12Clock()) |
136 | suffix = "00"; | 135 | suffix = "00"; |
@@ -150,41 +149,39 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) | |||
150 | borderWidth = 4; | 149 | borderWidth = 4; |
151 | timeHeight = fm.height(); | 150 | timeHeight = fm.height(); |
152 | } | 151 | } |
153 | timeHeight -= (timeHeight/4-2); | 152 | timeHeight -= (timeHeight/4-2); |
154 | QFont sFont = nFont; | 153 | QFont sFont = nFont; |
155 | sFont.setPointSize( sFont.pointSize()/2+2 ); | 154 | sFont.setPointSize( sFont.pointSize()/2+2 ); |
156 | QFontMetrics fmS( sFont ); | 155 | QFontMetrics fmS( sFont ); |
157 | int sHei = fmS.height(); | 156 | int sHei = fmS.height(); |
158 | 157 | sHei -= (sHei/4-2); | |
158 | int startW = this->width() - frameWidth(); | ||
159 | while (y < cy + ch) { | 159 | while (y < cy + ch) { |
160 | p->drawLine(cx,y,cx+tW,y); | 160 | p->drawLine(cx,y,cx+tW,y); |
161 | hour.setNum(cell); | 161 | hour.setNum(cell); |
162 | 162 | ||
163 | // handle 24h and am/pm time formats | 163 | // handle 24h and am/pm time formats |
164 | if (KGlobal::locale()->use12Clock()) { | 164 | if (KGlobal::locale()->use12Clock()) { |
165 | if (cell > 11) suffix = "pm"; | 165 | if (cell > 11) suffix = "pm"; |
166 | else | 166 | else |
167 | suffix = "am"; | 167 | suffix = "am"; |
168 | if (cell == 0) hour.setNum(12); | 168 | if (cell == 0) hour.setNum(12); |
169 | if (cell > 12) hour.setNum(cell - 12); | 169 | if (cell > 12) hour.setNum(cell - 12); |
170 | } | 170 | } |
171 | 171 | ||
172 | // create string in format of "XX:XX" or "XXpm/am" | ||
173 | fullTime = hour;// + suffix; | ||
174 | |||
175 | // center and draw the time label | 172 | // center and draw the time label |
176 | int timeWidth = fm.width(fullTime+"i"); | 173 | int timeWidth = fm.width(hour+"i"); |
177 | int tw2 = fm.width(suffix); | 174 | int tw2 = fm.width(suffix); |
178 | int offset = this->width() - timeWidth - tw2; | 175 | int offset = startW - timeWidth - tw2 ; |
179 | p->setFont( nFont ); | 176 | p->setFont( nFont ); |
180 | p->drawText(cx - borderWidth + offset, y+ timeHeight, fullTime); | 177 | p->drawText(cx - borderWidth + offset, y+ timeHeight, hour); |
181 | p->setFont( sFont ); | 178 | p->setFont( sFont ); |
182 | offset += timeWidth; | 179 | offset = startW - tw2-1; |
183 | p->drawText(cx - borderWidth + offset, y+ sHei, suffix); | 180 | p->drawText(cx - borderWidth + offset, y+ sHei, suffix); |
184 | 181 | ||
185 | // increment indices | 182 | // increment indices |
186 | y += mCellHeight; | 183 | y += mCellHeight; |
187 | cell++; | 184 | cell++; |
188 | } | 185 | } |
189 | } | 186 | } |
190 | 187 | ||
@@ -198,17 +195,20 @@ int TimeLabels::minimumWidth() const | |||
198 | 195 | ||
199 | /** updates widget's internal state */ | 196 | /** updates widget's internal state */ |
200 | void TimeLabels::updateConfig() | 197 | void TimeLabels::updateConfig() |
201 | { | 198 | { |
202 | // set the font | 199 | // set the font |
203 | // config->setGroup("Fonts"); | 200 | // config->setGroup("Fonts"); |
204 | // QFont font = config->readFontEntry("TimeBar Font"); | 201 | // QFont font = config->readFontEntry("TimeBar Font"); |
205 | setFont(KOPrefs::instance()->mTimeBarFont); | 202 | setFont(KOPrefs::instance()->mTimeBarFont); |
206 | mMiniWidth = fontMetrics().width("88:88") + 2 ; | 203 | QString test = "88:88"; |
204 | if (KGlobal::locale()->use12Clock()) | ||
205 | test += "i"; | ||
206 | mMiniWidth = fontMetrics().width(test) + frameWidth()*2 +1 ; | ||
207 | // update geometry restrictions based on new settings | 207 | // update geometry restrictions based on new settings |
208 | setFixedWidth(minimumWidth()); | 208 | setFixedWidth(minimumWidth()); |
209 | 209 | ||
210 | // update HourSize | 210 | // update HourSize |
211 | mCellHeight = KOPrefs::instance()->mHourSize*4; | 211 | mCellHeight = KOPrefs::instance()->mHourSize*4; |
212 | resizeContents(50,mRows * mCellHeight); | 212 | resizeContents(50,mRows * mCellHeight); |
213 | } | 213 | } |
214 | 214 | ||
@@ -831,21 +831,18 @@ void KOAgendaView::createDayLabels() | |||
831 | if ( !appendLabels ) { | 831 | if ( !appendLabels ) { |
832 | dayLabel = mDayLabelsList.next(); | 832 | dayLabel = mDayLabelsList.next(); |
833 | while ( dayLabel ) { | 833 | while ( dayLabel ) { |
834 | //qDebug("!dayLabel %d",dayLabel ); | 834 | //qDebug("!dayLabel %d",dayLabel ); |
835 | dayLabel->hide(); | 835 | dayLabel->hide(); |
836 | dayLabel = mDayLabelsList.next(); | 836 | dayLabel = mDayLabelsList.next(); |
837 | } | 837 | } |
838 | } | 838 | } |
839 | //mDayLabelsFrame->show(); | 839 | |
840 | //mDayLabels->show(); | 840 | mDayLabelsFrame->setFixedHeight( newHight + 4 ); |
841 | //qDebug("heigt %d %d %d ",mDayLabelsFrame->height(), mDayLabelsFrame->sizeHint().height(), newHight); | ||
842 | //mDayLabelsFrame->resize( mAgenda->visibleWidth(), newHight ); | ||
843 | mDayLabelsFrame->setFixedHeight( newHight ); | ||
844 | } | 841 | } |
845 | 842 | ||
846 | int KOAgendaView::maxDatesHint() | 843 | int KOAgendaView::maxDatesHint() |
847 | { | 844 | { |
848 | // Not sure about the max number of events, so return 0 for now. | 845 | // Not sure about the max number of events, so return 0 for now. |
849 | return 0; | 846 | return 0; |
850 | } | 847 | } |
851 | 848 | ||
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 7a4275b..ca0d542 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -1718,18 +1718,22 @@ void MainWindow::keyPressEvent ( QKeyEvent * e ) | |||
1718 | break; | 1718 | break; |
1719 | case Qt::Key_W: | 1719 | case Qt::Key_W: |
1720 | mView->viewManager()->showWhatsNextView(); | 1720 | mView->viewManager()->showWhatsNextView(); |
1721 | break; | 1721 | break; |
1722 | case Qt::Key_L: | 1722 | case Qt::Key_L: |
1723 | mView->viewManager()->showListView(); | 1723 | mView->viewManager()->showListView(); |
1724 | break; | 1724 | break; |
1725 | case Qt::Key_N: | 1725 | case Qt::Key_N: |
1726 | mView->viewManager()->showNextXView(); | 1726 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
1727 | showSelectedDates = true; | 1727 | mView->viewManager()->showNextView(); |
1728 | else { | ||
1729 | mView->viewManager()->showNextXView(); | ||
1730 | showSelectedDates = true; | ||
1731 | } | ||
1728 | break; | 1732 | break; |
1729 | case Qt::Key_V: | 1733 | case Qt::Key_V: |
1730 | mView->viewManager()->showTodoView(); | 1734 | mView->viewManager()->showTodoView(); |
1731 | break; | 1735 | break; |
1732 | case Qt::Key_C: | 1736 | case Qt::Key_C: |
1733 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); | 1737 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); |
1734 | break; | 1738 | break; |
1735 | case Qt::Key_P: | 1739 | case Qt::Key_P: |
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index 52c298b..5c889c3 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp | |||
@@ -293,16 +293,17 @@ void CalendarLocal::checkAlarmForIncidence( Incidence * incidence, bool deleted | |||
293 | //return mNextAlarmEventDateTime; | 293 | //return mNextAlarmEventDateTime; |
294 | bool newNextAlarm = false; | 294 | bool newNextAlarm = false; |
295 | bool computeNextAlarm = false; | 295 | bool computeNextAlarm = false; |
296 | bool ok; | 296 | bool ok; |
297 | int offset; | 297 | int offset; |
298 | QDateTime nextA; | 298 | QDateTime nextA; |
299 | // QString nextSum; | 299 | // QString nextSum; |
300 | //QDateTime nextEvent; | 300 | //QDateTime nextEvent; |
301 | mNextAlarmEventDateTime = QDateTime(); | ||
301 | if ( mNextAlarmIncidence == 0 || incidence == 0 ) { | 302 | if ( mNextAlarmIncidence == 0 || incidence == 0 ) { |
302 | computeNextAlarm = true; | 303 | computeNextAlarm = true; |
303 | } else { | 304 | } else { |
304 | if ( ! deleted ) { | 305 | if ( ! deleted ) { |
305 | nextA = incidence->getNextAlarmDateTime(& ok, &offset ) ; | 306 | nextA = incidence->getNextAlarmDateTime(& ok, &offset ) ; |
306 | if ( ok ) { | 307 | if ( ok ) { |
307 | if ( nextA < mNextAlarmDateTime ) { | 308 | if ( nextA < mNextAlarmDateTime ) { |
308 | deRegisterAlarm(); | 309 | deRegisterAlarm(); |