author | zautrix <zautrix> | 2005-04-03 04:33:19 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-03 04:33:19 (UTC) |
commit | f6c8249db564c1276d4c7ed5ad88c6fbac361b8d (patch) (unidiff) | |
tree | 8e5b6e2d6f9a7bc00326f7c0115bf2af53ae9ce8 | |
parent | 40e5edc1ab153144f0e824ad2d3a0ab37357e408 (diff) | |
download | kdepimpi-f6c8249db564c1276d4c7ed5ad88c6fbac361b8d.zip kdepimpi-f6c8249db564c1276d4c7ed5ad88c6fbac361b8d.tar.gz kdepimpi-f6c8249db564c1276d4c7ed5ad88c6fbac361b8d.tar.bz2 |
fixes
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 8 | ||||
-rw-r--r-- | kabc/addresseedialog.cpp | 80 | ||||
-rw-r--r-- | kalarmd/alarmdialog.cpp | 13 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 19 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 4 | ||||
-rw-r--r-- | korganizer/koeditorgeneral.cpp | 69 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 11 | ||||
-rw-r--r-- | korganizer/kotodoview.h | 1 |
8 files changed, 135 insertions, 70 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 6b739ba..711509d 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1319,25 +1319,25 @@ | |||
1319 | { "There is nothing selected!","Es ist nichts ausgewählt!" }, | 1319 | { "There is nothing selected!","Es ist nichts ausgewählt!" }, |
1320 | { "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " }, | 1320 | { "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " }, |
1321 | { "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" }, | 1321 | { "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" }, |
1322 | { "This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n","Dies druckt die Ansicht wie man sie sieht.\n(Mit dem kompletten Inhalt natürlich.)\nMan kann das Layout ändern durch ändern der Fenstergröße.\nDrucke unskaliert druckt ggf. mehrere Seiten\nabhängig von der Menge der Daten.\nDrucke runterskaliert um auf eine Seite zu passen\ndruckt alles auf eine Seite.\nDrucke hoch/runterskaliert um genau auf eine Seite zu passen\nvergrößert den Text gegebenenfalls.\nDas Seitenlayout kann im nächsten Dialog gewählt werden.\n" }, | 1322 | { "This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n","Dies druckt die Ansicht wie man sie sieht.\n(Mit dem kompletten Inhalt natürlich.)\nMan kann das Layout ändern durch ändern der Fenstergröße.\nDrucke unskaliert druckt ggf. mehrere Seiten\nabhängig von der Menge der Daten.\nDrucke runterskaliert um auf eine Seite zu passen\ndruckt alles auf eine Seite.\nDrucke hoch/runterskaliert um genau auf eine Seite zu passen\nvergrößert den Text gegebenenfalls.\nDas Seitenlayout kann im nächsten Dialog gewählt werden.\n" }, |
1323 | { "KO/Pi Printout","KO/Pi Ausdruck" }, | 1323 | { "KO/Pi Printout","KO/Pi Ausdruck" }, |
1324 | { "Print unscaled","Drucke unskaliert" }, | 1324 | { "Print unscaled","Drucke unskaliert" }, |
1325 | { "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." }, | 1325 | { "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." }, |
1326 | { "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." }, | 1326 | { "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." }, |
1327 | { "Printout Mode","Druck Modus" }, | 1327 | { "Printout Mode","Druck Modus" }, |
1328 | { "Filter menu icon","Filtermenu Icon" }, | 1328 | { "Filter menu icon","Filtermenu Icon" }, |
1329 | { "<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n","<p><b>A+(shift oder ctrl)</b>: Zeige Zeit bis zum nächsten Alarm</p>\n" }, | 1329 | { "<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n","<p><b>A+(shift oder ctrl)</b>: Zeige Zeit bis zum nächsten Alarm</p>\n" }, |
1330 | { "<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n","<p><b>N</b>: Wechsle zur nächsten Ansicht, die ein Icon in der Toolbar hat</p>\n" }, | 1330 | { "<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n","<p><b>N</b>: Wechsle zur nächsten Ansicht, die ein Icon in der Toolbar hat</p>\n" }, |
1331 | { "%1d","%1t" }, | 1331 | { "%1d","%1t" }, |
1332 | { "%1h","%1std" }, | 1332 | { "%1h","%1std" }, |
1333 | { "%1min","%1min" }, | 1333 | { "%1min","%1min" }, |
1334 | { "( %1 before )","( %1 vorher )" }, | 1334 | { "( %1 before )","( %1 vorher )" }, |
1335 | { "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" }, | ||
1336 | { "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" }, | ||
1337 | { "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." }, | ||
1335 | { "","" }, | 1338 | { "","" }, |
1336 | { "","" }, | 1339 | { "","" }, |
1337 | { "","" }, | 1340 | { "","" }, |
1338 | { "","" }, | 1341 | { "","" }, |
1339 | { "","" }, | 1342 | { "","" }, |
1340 | { "","" }, | 1343 | { "","" }, \ No newline at end of file |
1341 | { "","" }, | ||
1342 | { "","" }, | ||
1343 | { "","" } \ No newline at end of file | ||
diff --git a/kabc/addresseedialog.cpp b/kabc/addresseedialog.cpp index 648e780..19b52bb 100644 --- a/kabc/addresseedialog.cpp +++ b/kabc/addresseedialog.cpp | |||
@@ -113,35 +113,36 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : | |||
113 | connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ), | 113 | connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ), |
114 | SLOT( removeSelected() ) ); | 114 | SLOT( removeSelected() ) ); |
115 | 115 | ||
116 | QPushButton *unselectButton = new QPushButton( i18n("Unselect"), selectedGroup ); | 116 | QPushButton *unselectButton = new QPushButton( i18n("Unselect"), selectedGroup ); |
117 | connect ( unselectButton, SIGNAL( clicked() ), SLOT( removeSelected() ) ); | 117 | connect ( unselectButton, SIGNAL( clicked() ), SLOT( removeSelected() ) ); |
118 | 118 | ||
119 | connect( mAddresseeList, SIGNAL( clicked( QListViewItem * ) ), | 119 | connect( mAddresseeList, SIGNAL( clicked( QListViewItem * ) ), |
120 | SLOT( addSelected( QListViewItem * ) ) ); | 120 | SLOT( addSelected( QListViewItem * ) ) ); |
121 | connect( mAddresseeList, SIGNAL( returnPressed( QListViewItem * ) ), | 121 | connect( mAddresseeList, SIGNAL( returnPressed( QListViewItem * ) ), |
122 | SLOT( selectNextItem( QListViewItem * ) ) ); | 122 | SLOT( selectNextItem( QListViewItem * ) ) ); |
123 | 123 | ||
124 | } | 124 | } |
125 | 125 | ||
126 | mAddressBook = StdAddressBook::self( true ); | 126 | mAddressBook = StdAddressBook::self( true ); |
127 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook* ) ), | 127 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook* ) ), |
128 | SLOT( addressBookChanged() ) ); | 128 | SLOT( addressBookChanged() ) ); |
129 | #if 0 | ||
129 | connect( mAddressBook, SIGNAL( loadingFinished( Resource* ) ), | 130 | connect( mAddressBook, SIGNAL( loadingFinished( Resource* ) ), |
130 | SLOT( addressBookChanged() ) ); | 131 | SLOT( addressBookChanged() ) ); |
131 | 132 | #endif | |
132 | loadAddressBook(); | 133 | loadAddressBook(); |
133 | QValueList<int> splitterSize; | 134 | QValueList<int> splitterSize; |
134 | splitterSize.append( ( width() / 5 ) * 3 ); | 135 | splitterSize.append( ( width() / 5 ) * 3 ); |
135 | splitterSize.append( ( width() / 5 ) *2 ); | 136 | splitterSize.append( ( width() / 5 ) *2 ); |
136 | mMiniSplitter->setSizes( splitterSize ); | 137 | mMiniSplitter->setSizes( splitterSize ); |
137 | } | 138 | } |
138 | 139 | ||
139 | AddresseeDialog::~AddresseeDialog() | 140 | AddresseeDialog::~AddresseeDialog() |
140 | { | 141 | { |
141 | qDebug("DELETE AddresseeDialog "); | 142 | qDebug("DELETE AddresseeDialog "); |
142 | } | 143 | } |
143 | 144 | ||
144 | void AddresseeDialog::loadAddressBook() | 145 | void AddresseeDialog::loadAddressBook() |
145 | { | 146 | { |
146 | mAddresseeList->clear(); | 147 | mAddresseeList->clear(); |
147 | mItemDict.clear(); | 148 | mItemDict.clear(); |
@@ -265,47 +266,88 @@ Addressee::List AddresseeDialog::addressees() | |||
265 | aItem = (AddresseeItem *)( item ); | 266 | aItem = (AddresseeItem *)( item ); |
266 | if ( aItem ) al.append( aItem->addressee() ); | 267 | if ( aItem ) al.append( aItem->addressee() ); |
267 | item = item->nextSibling(); | 268 | item = item->nextSibling(); |
268 | } | 269 | } |
269 | } | 270 | } |
270 | else | 271 | else |
271 | { | 272 | { |
272 | aItem = (AddresseeItem *)( mAddresseeList->selectedItem() ); | 273 | aItem = (AddresseeItem *)( mAddresseeList->selectedItem() ); |
273 | if (aItem) al.append( aItem->addressee() ); | 274 | if (aItem) al.append( aItem->addressee() ); |
274 | } | 275 | } |
275 | 276 | ||
276 | return al; | 277 | return al; |
277 | } | 278 | } |
278 | 279 | ||
279 | Addressee AddresseeDialog::getAddressee( QWidget *parent ) | 280 | Addressee AddresseeDialog::getAddressee( QWidget *parent ) |
280 | { | 281 | { |
281 | AddresseeDialog *dlg = new AddresseeDialog( parent ); | 282 | AddresseeDialog *dlg = new AddresseeDialog( parent ); |
282 | Addressee addressee; | 283 | Addressee addressee; |
283 | int result = dlg->exec(); | 284 | #ifdef DESKTOP_VERSION |
285 | static int geoX = 0; | ||
286 | static int geoY = 0; | ||
287 | static int geoW = 0; | ||
288 | static int geoH = 0; | ||
289 | if ( !geoX && ! geoY && !geoW &&!geoH ) { | ||
290 | geoX = dlg->geometry().x(); | ||
291 | geoY = dlg->geometry().y(); | ||
292 | geoW = dlg->width(); | ||
293 | geoH = dlg->height(); | ||
294 | } else { | ||
295 | dlg->show(); | ||
296 | dlg->setGeometry(geoX , geoY,geoW , geoH ); | ||
284 | 297 | ||
285 | if ( result == QDialog::Accepted ) { | 298 | } |
286 | addressee = dlg->addressee(); | 299 | #endif |
287 | } | 300 | int result = dlg->exec(); |
301 | #ifdef DESKTOP_VERSION | ||
302 | geoX = dlg->geometry().x(); | ||
303 | geoY = dlg->geometry().y(); | ||
304 | geoW = dlg->width(); | ||
305 | geoH = dlg->height(); | ||
306 | #endif | ||
307 | if ( result == QDialog::Accepted ) { | ||
308 | addressee = dlg->addressee(); | ||
309 | } | ||
288 | 310 | ||
289 | delete dlg; | 311 | delete dlg; |
290 | return addressee; | 312 | return addressee; |
291 | } | 313 | } |
292 | 314 | ||
293 | Addressee::List AddresseeDialog::getAddressees( QWidget *parent ) | 315 | Addressee::List AddresseeDialog::getAddressees( QWidget *parent ) |
294 | { | 316 | { |
295 | AddresseeDialog *dlg = new AddresseeDialog( parent, true ); | 317 | AddresseeDialog *dlg = new AddresseeDialog( parent, true ); |
296 | Addressee::List addressees; | 318 | Addressee::List addressees; |
297 | if ( QApplication::desktop()->width() <= 640 ) | 319 | static int geoX = 0; |
298 | dlg->showMaximized(); | 320 | static int geoY = 0; |
299 | int result = dlg->exec(); | 321 | static int geoW = 0; |
300 | if ( result == QDialog::Accepted ) { | 322 | static int geoH = 0; |
301 | addressees = dlg->addressees(); | 323 | if ( QApplication::desktop()->width() <= 640 ) |
302 | } | 324 | dlg->showMaximized(); |
325 | else { | ||
326 | if ( !geoX && ! geoY && !geoW &&!geoH ) { | ||
327 | geoX = dlg->geometry().x(); | ||
328 | geoY = dlg->geometry().y(); | ||
329 | geoW = dlg->width(); | ||
330 | geoH = dlg->height(); | ||
331 | } else { | ||
332 | dlg->show(); | ||
333 | dlg->setGeometry(geoX , geoY,geoW , geoH ); | ||
334 | |||
335 | } | ||
336 | } | ||
337 | int result = dlg->exec(); | ||
338 | geoX = dlg->geometry().x(); | ||
339 | geoY = dlg->geometry().y(); | ||
340 | geoW = dlg->width(); | ||
341 | geoH = dlg->height(); | ||
342 | if ( result == QDialog::Accepted ) { | ||
343 | addressees = dlg->addressees(); | ||
344 | } | ||
303 | 345 | ||
304 | delete dlg; | 346 | delete dlg; |
305 | return addressees; | 347 | return addressees; |
306 | } | 348 | } |
307 | 349 | ||
308 | void AddresseeDialog::addressBookChanged() | 350 | void AddresseeDialog::addressBookChanged() |
309 | { | 351 | { |
310 | loadAddressBook(); | 352 | loadAddressBook(); |
311 | } | 353 | } |
diff --git a/kalarmd/alarmdialog.cpp b/kalarmd/alarmdialog.cpp index bdeee4a..53ff488 100644 --- a/kalarmd/alarmdialog.cpp +++ b/kalarmd/alarmdialog.cpp | |||
@@ -19,59 +19,60 @@ | |||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | // $Id$ | 24 | // $Id$ |
25 | 25 | ||
26 | #include <qhbox.h> | 26 | #include <qhbox.h> |
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 | #include <qregexp.h> | ||
35 | #ifndef DESKTOP_VERSION | 36 | #ifndef DESKTOP_VERSION |
36 | #define protected public | 37 | #define protected public |
37 | #include <qspinbox.h> | 38 | #include <qspinbox.h> |
38 | #undef protected | 39 | #undef protected |
39 | #else | 40 | #else |
40 | #include <qspinbox.h> | 41 | #include <qspinbox.h> |
41 | #endif | 42 | #endif |
42 | #include <stdlib.h> | 43 | #include <stdlib.h> |
43 | #ifndef _WIN32_ | 44 | #ifndef _WIN32_ |
44 | #include <unistd.h> | 45 | #include <unistd.h> |
45 | #include <sys/ioctl.h> | 46 | #include <sys/ioctl.h> |
46 | #endif | 47 | #endif |
47 | #include <stdio.h> | 48 | #include <stdio.h> |
48 | #include <fcntl.h> | 49 | #include <fcntl.h> |
49 | 50 | ||
50 | #ifndef DESKTOP_VERSION | 51 | #ifndef DESKTOP_VERSION |
51 | #include <qtopia/alarmserver.h> | 52 | #include <qtopia/alarmserver.h> |
52 | #include <qpe/resource.h> | 53 | #include <qpe/resource.h> |
53 | #include <qtopia/sound.h> | 54 | #include <qtopia/sound.h> |
54 | 55 | ||
55 | #endif | 56 | #endif |
56 | 57 | ||
57 | #include "alarmdialog.h" | 58 | #include "alarmdialog.h" |
58 | 59 | ||
59 | 60 | ||
60 | AlarmDialog::AlarmDialog(QWidget *parent,const char *name) | 61 | AlarmDialog::AlarmDialog(QWidget *parent,const char *name) |
61 | : QDialog (parent, name, true, Qt::WStyle_StaysOnTop ) | 62 | : QDialog (parent, name, true, Qt::WStyle_Customize |Qt::WStyle_StaysOnTop | Qt::WStyle_DialogBorder) |
62 | { | 63 | { |
63 | setCaption( "KO/Pi Alarm!" ); | 64 | setCaption( "KO/Pi Alarm!" ); |
64 | QVBoxLayout* layout = new QVBoxLayout( this); | 65 | QVBoxLayout* layout = new QVBoxLayout( this); |
65 | QLabel* l = new QLabel("The following event triggered alarm:",this); | 66 | QLabel* l = new QLabel("The following event triggered alarm:",this); |
66 | layout->addWidget ( l ); | 67 | layout->addWidget ( l ); |
67 | l->setAlignment( AlignCenter); | 68 | l->setAlignment( AlignCenter); |
68 | mMessage = new QLabel ( " ", this ); | 69 | mMessage = new QLabel ( " ", this ); |
69 | int fs = 18; | 70 | int fs = 18; |
70 | int fs2 = 12; | 71 | int fs2 = 12; |
71 | int baseSize = 6; | 72 | int baseSize = 6; |
72 | if ( QApplication::desktop()->width() < 480 ) { | 73 | if ( QApplication::desktop()->width() < 480 ) { |
73 | fs2 = 10; | 74 | fs2 = 10; |
74 | fs = 12; | 75 | fs = 12; |
75 | baseSize = 4; | 76 | baseSize = 4; |
76 | } | 77 | } |
77 | layout->setSpacing( 3 ); | 78 | layout->setSpacing( 3 ); |
@@ -219,72 +220,74 @@ void AlarmDialog::setSuspendTime( int val ) | |||
219 | } | 220 | } |
220 | bool AlarmDialog::eventNotification( QString mess, int replay , QString fn, bool playwav, int pause , int suspendtimes) | 221 | bool AlarmDialog::eventNotification( QString mess, int replay , QString fn, bool playwav, int pause , int suspendtimes) |
221 | { | 222 | { |
222 | if ( mess.left( 9) != "Suspended" ) | 223 | if ( mess.left( 9) != "Suspended" ) |
223 | mSuspendCounter = suspendtimes; | 224 | mSuspendCounter = suspendtimes; |
224 | mPauseCount = pause; | 225 | mPauseCount = pause; |
225 | mFileName = fn; | 226 | mFileName = fn; |
226 | mPlayWav = playwav; | 227 | mPlayWav = playwav; |
227 | if ( !QFile::exists( fn ) ) | 228 | if ( !QFile::exists( fn ) ) |
228 | mFileName = ""; | 229 | mFileName = ""; |
229 | alarmCounter = 0 ; | 230 | alarmCounter = 0 ; |
230 | maxAlarmReplay = replay ; | 231 | maxAlarmReplay = replay ; |
231 | mStopAlarm = false; | 232 | mStopAlarm = false; |
232 | mSilent = false; | 233 | mSilent = false; |
233 | if ( !mMessage->text().stripWhiteSpace().isEmpty() ) { | 234 | if ( !mMessage->text().stripWhiteSpace().isEmpty() ) { |
234 | mMissedAlarmsCombo->show(); | 235 | mMissedAlarmsCombo->show(); |
235 | mMissedAlarmsCombo->insertItem( mMessage->text().stripWhiteSpace() ); | 236 | QString newItem = mMessage->text().stripWhiteSpace(); |
237 | newItem.replace( QRegExp("\n"), QString(" ") ); | ||
238 | mMissedAlarmsCombo->insertItem( newItem ); | ||
236 | mMissedAlarms->setText( "Missed alarms:"); | 239 | mMissedAlarms->setText( "Missed alarms:"); |
237 | } else | 240 | } else |
238 | mMissedAlarmsCombo->hide(); | 241 | mMissedAlarmsCombo->hide(); |
239 | mMessage->setText(mess); | 242 | mMessage->setText(mess); |
240 | int w =sizeHint().width() ; | 243 | int w =sizeHint().width() ; |
241 | int h = sizeHint().height() ; | 244 | int h = sizeHint().height() ; |
242 | int dw = QApplication::desktop()->width(); | 245 | int dw = QApplication::desktop()->width(); |
243 | int dh = QApplication::desktop()->height(); | 246 | int dh = QApplication::desktop()->height(); |
244 | setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 247 | setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
245 | show(); | 248 | show(); |
246 | raise(); | 249 | raise(); |
247 | //qApp->processEvents(); | 250 | //qApp->processEvents(); |
248 | //repaint(); | 251 | //repaint(); |
249 | qApp->processEvents(); | 252 | qApp->processEvents(); |
250 | 253 | ||
251 | #ifndef _WIN32_ | 254 | #ifndef _WIN32_ |
252 | if ( fd_led > 0 ) { | 255 | if ( fd_led > 0 ) { |
253 | statusLED.status = LED_SALARM_ON ; | 256 | statusLED.status = LED_SALARM_ON ; |
254 | ioctl (fd_led, SHARP_LED_SETSTATUS, &statusLED); | 257 | ioctl (fd_led, SHARP_LED_SETSTATUS, &statusLED); |
255 | } | 258 | } |
256 | #endif | 259 | #endif |
257 | playSoundTimer->start( 1000, true ); | 260 | playSoundTimer->start( 1000, true ); |
258 | return true; | 261 | return true; |
259 | 262 | ||
260 | } | 263 | } |
261 | 264 | ||
262 | 265 | ||
263 | void AlarmDialog::playSound () | 266 | void AlarmDialog::playSound () |
264 | { | 267 | { |
265 | 268 | ||
266 | if (mStopAlarm ) | 269 | if (mStopAlarm ) |
267 | return; | 270 | return; |
268 | if (mSilent ) | 271 | if ( mSilent ) |
269 | return; | 272 | return; |
270 | showNormal(); | 273 | showNormal(); |
271 | setActiveWindow(); | 274 | setActiveWindow(); |
275 | raise(); | ||
272 | mSuspendSpin->setFocus(); | 276 | mSuspendSpin->setFocus(); |
273 | raise(); | 277 | |
274 | repaint(); | ||
275 | 278 | ||
276 | qApp->processEvents(); | 279 | qApp->processEvents(); |
277 | if ( alarmCounter < maxAlarmReplay && ! mSilent) { | 280 | if ( alarmCounter < maxAlarmReplay && ! mSilent) { |
278 | ++alarmCounter; | 281 | ++alarmCounter; |
279 | #ifdef DESKTOP_VERSION | 282 | #ifdef DESKTOP_VERSION |
280 | mPlayWav = true; | 283 | mPlayWav = true; |
281 | #endif | 284 | #endif |
282 | if ( !mPlayWav || mFileName.length() < 2 ) { | 285 | if ( !mPlayWav || mFileName.length() < 2 ) { |
283 | 286 | ||
284 | #ifdef DESKTOP_VERSION | 287 | #ifdef DESKTOP_VERSION |
285 | qDebug("Sound play not possible - file not found"); | 288 | qDebug("Sound play not possible - file not found"); |
286 | #else | 289 | #else |
287 | Sound::soundAlarm (); | 290 | Sound::soundAlarm (); |
288 | #endif | 291 | #endif |
289 | } else | 292 | } else |
290 | 293 | ||
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index beb19d9..76cce26 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -517,32 +517,37 @@ void CalendarView::showDay( QDate d ) | |||
517 | } | 517 | } |
518 | void CalendarView::timerAlarm() | 518 | void CalendarView::timerAlarm() |
519 | { | 519 | { |
520 | //qDebug("CalendarView::timerAlarm() "); | 520 | //qDebug("CalendarView::timerAlarm() "); |
521 | computeAlarm(mAlarmNotification ); | 521 | computeAlarm(mAlarmNotification ); |
522 | } | 522 | } |
523 | 523 | ||
524 | void CalendarView::suspendAlarm() | 524 | void CalendarView::suspendAlarm() |
525 | { | 525 | { |
526 | //qDebug(" CalendarView::suspendAlarm() "); | 526 | //qDebug(" CalendarView::suspendAlarm() "); |
527 | computeAlarm(mSuspendAlarmNotification ); | 527 | computeAlarm(mSuspendAlarmNotification ); |
528 | 528 | ||
529 | } | 529 | } |
530 | 530 | ||
531 | void CalendarView::startAlarm( QString mess , QString filename) | 531 | void CalendarView::startAlarm( QString mess , QString filename) |
532 | { | 532 | { |
533 | |||
534 | topLevelWidget()->showNormal(); | ||
535 | topLevelWidget()->setActiveWindow(); | ||
536 | topLevelWidget()->raise(); | ||
537 | |||
533 | mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); | 538 | mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); |
534 | QTimer::singleShot( 3000, this, SLOT( checkNextTimerAlarm() ) ); | 539 | QTimer::singleShot( 3000, this, SLOT( checkNextTimerAlarm() ) ); |
535 | 540 | ||
536 | } | 541 | } |
537 | 542 | ||
538 | void CalendarView::checkNextTimerAlarm() | 543 | void CalendarView::checkNextTimerAlarm() |
539 | { | 544 | { |
540 | mCalendar->checkAlarmForIncidence( 0, true ); | 545 | mCalendar->checkAlarmForIncidence( 0, true ); |
541 | } | 546 | } |
542 | 547 | ||
543 | void CalendarView::computeAlarm( QString msg ) | 548 | void CalendarView::computeAlarm( QString msg ) |
544 | { | 549 | { |
545 | 550 | ||
546 | QString mess = msg; | 551 | QString mess = msg; |
547 | QString mAlarmMessage = mess.mid( 9 ); | 552 | QString mAlarmMessage = mess.mid( 9 ); |
548 | QString filename = MainWindow::resourcePath(); | 553 | QString filename = MainWindow::resourcePath(); |
@@ -4081,37 +4086,47 @@ void CalendarView::resetFocus() | |||
4081 | 4086 | ||
4082 | void CalendarView::showNextAlarms() | 4087 | void CalendarView::showNextAlarms() |
4083 | { | 4088 | { |
4084 | QString message; | 4089 | QString message; |
4085 | QDateTime nextAl = mCalendar->nextAlarmEventDateTime(); | 4090 | QDateTime nextAl = mCalendar->nextAlarmEventDateTime(); |
4086 | if ( nextAl.isValid() && mNextAlarmDateTime > QDateTime::currentDateTime() ) { | 4091 | if ( nextAl.isValid() && mNextAlarmDateTime > QDateTime::currentDateTime() ) { |
4087 | QString sum = mCalendar->nextSummary(); | 4092 | QString sum = mCalendar->nextSummary(); |
4088 | QDateTime nextA = mNextAlarmDateTime; | 4093 | QDateTime nextA = mNextAlarmDateTime; |
4089 | QDateTime cur = QDateTime::currentDateTime(); | 4094 | QDateTime cur = QDateTime::currentDateTime(); |
4090 | int secs = cur.secsTo( nextA ); | 4095 | int secs = cur.secsTo( nextA ); |
4091 | int min = secs /60; | 4096 | int min = secs /60; |
4092 | int hours = min /60; | 4097 | int hours = min /60; |
4093 | min = min % 60; | 4098 | min = min % 60; |
4094 | int days = hours /24; | 4099 | int days = hours /24; |
4095 | hours = hours % 24; | 4100 | hours = hours % 24; |
4096 | 4101 | ||
4097 | message = i18n("The next alarm is in:\n"); | 4102 | //message = i18n("The next alarm is in:\n"); |
4098 | if ( days > 1 ) | 4103 | if ( days > 1 ) |
4099 | message += i18n("%1 days\n").arg( days ); | 4104 | message += i18n("%1 days\n").arg( days ); |
4100 | else if ( days == 1 ) | 4105 | else if ( days == 1 ) |
4101 | message += i18n("1 day\n"); | 4106 | message += i18n("1 day\n"); |
4102 | if ( hours > 1 ) | 4107 | if ( hours > 1 ) |
4103 | message += i18n("%1 hours\n").arg( hours ); | 4108 | message += i18n("%1 hours\n").arg( hours ); |
4104 | else if ( hours == 1 ) | 4109 | else if ( hours == 1 ) |
4105 | message += i18n("1 hour\n"); | 4110 | message += i18n("1 hour\n"); |
4106 | if ( min > 1 ) | 4111 | if ( min > 1 ) |
4107 | message += i18n("%1 minutes\n").arg( min ); | 4112 | message += i18n("%1 minutes\n").arg( min ); |
4108 | else if ( min == 1 ) | 4113 | else if ( min == 1 ) |
4109 | message += i18n("1 minute\n"); | 4114 | message += i18n("1 minute\n"); |
4110 | 4115 | if ( message.isEmpty() ) | |
4116 | message = i18n("The next alarm is in\nless than one minute!"); | ||
4117 | else | ||
4118 | message = i18n("The next alarm is in:\n") + message; | ||
4111 | message += i18n("\n(%1)\n\n%2\n(%3)\n").arg( KGlobal::locale()->formatDateTime(nextA , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ; | 4119 | message += i18n("\n(%1)\n\n%2\n(%3)\n").arg( KGlobal::locale()->formatDateTime(nextA , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ; |
4112 | } else { | 4120 | } else { |
4113 | message = i18n("There is no next alarm."); | 4121 | message = i18n("There is no next alarm."); |
4114 | 4122 | ||
4115 | } | 4123 | } |
4124 | #ifdef DESKTOP_VERSION | ||
4125 | if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { | ||
4126 | message += i18n("\nThe internal alarm notification is disabled!\n"); | ||
4127 | message += i18n("Enable it in the settings menu, TAB alarm."); | ||
4128 | } | ||
4129 | |||
4130 | #endif | ||
4116 | KMessageBox::information( this, message); | 4131 | KMessageBox::information( this, message); |
4117 | } | 4132 | } |
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index d450a97..6d1e6d5 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -140,33 +140,33 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) | |||
140 | } | 140 | } |
141 | fm = QFontMetrics( nFont ); | 141 | fm = QFontMetrics( nFont ); |
142 | timeHeight = fm.ascent(); | 142 | timeHeight = fm.ascent(); |
143 | } | 143 | } |
144 | //timeHeight -= (timeHeight/4-2); | 144 | //timeHeight -= (timeHeight/4-2); |
145 | QFont sFont = nFont; | 145 | QFont sFont = nFont; |
146 | sFont.setPointSize( sFont.pointSize()/2 ); | 146 | sFont.setPointSize( sFont.pointSize()/2 ); |
147 | QFontMetrics fmS( sFont ); | 147 | QFontMetrics fmS( sFont ); |
148 | int sHei = fmS.ascent() ; | 148 | int sHei = fmS.ascent() ; |
149 | //sHei -= (sHei/4-2); | 149 | //sHei -= (sHei/4-2); |
150 | int startW = mMiniWidth - frameWidth()-2 ; | 150 | int startW = mMiniWidth - frameWidth()-2 ; |
151 | int tw2 = fmS.width(suffix); | 151 | int tw2 = fmS.width(suffix); |
152 | timeHeight = (timeHeight-1) /2 -1; | 152 | timeHeight = (timeHeight-1) /2 -1; |
153 | //testline | 153 | //testline |
154 | //p->drawLine(0,0,0,contentsHeight()); | 154 | //p->drawLine(0,0,0,contentsHeight()); |
155 | while (y < cy + ch+mCellHeight) { | 155 | while (y < cy + ch+mCellHeight) { |
156 | p->drawLine(startW-tw2 ,y,cw+2,y); | 156 | p->drawLine(startW-tw2+1 ,y,cw+2,y); |
157 | hour.setNum(cell); | 157 | hour.setNum(cell); |
158 | // handle 24h and am/pm time formats | 158 | // handle 24h and am/pm time formats |
159 | if (KGlobal::locale()->use12Clock()) { | 159 | if (KGlobal::locale()->use12Clock()) { |
160 | if (cell == 12) suffix = "pm"; | 160 | if (cell == 12) suffix = "pm"; |
161 | if (cell == 0) hour.setNum(12); | 161 | if (cell == 0) hour.setNum(12); |
162 | if (cell > 12) hour.setNum(cell - 12); | 162 | if (cell > 12) hour.setNum(cell - 12); |
163 | } | 163 | } |
164 | 164 | ||
165 | // center and draw the time label | 165 | // center and draw the time label |
166 | int timeWidth = fm.width(hour); | 166 | int timeWidth = fm.width(hour); |
167 | int offset = startW - timeWidth - tw2 -1 ; | 167 | int offset = startW - timeWidth - tw2 -1 ; |
168 | p->setFont( nFont ); | 168 | p->setFont( nFont ); |
169 | p->drawText( offset, y+ timeHeight, hour); | 169 | p->drawText( offset, y+ timeHeight, hour); |
170 | p->setFont( sFont ); | 170 | p->setFont( sFont ); |
171 | offset = startW - tw2; | 171 | offset = startW - tw2; |
172 | p->drawText( offset, y -1, suffix); | 172 | p->drawText( offset, y -1, suffix); |
@@ -202,33 +202,33 @@ void TimeLabels::updateConfig() | |||
202 | test = "12"; | 202 | test = "12"; |
203 | mMiniWidth = fontMetrics().width(test); | 203 | mMiniWidth = fontMetrics().width(test); |
204 | if (KGlobal::locale()->use12Clock()) | 204 | if (KGlobal::locale()->use12Clock()) |
205 | test = "pm"; | 205 | test = "pm"; |
206 | else { | 206 | else { |
207 | test = "00"; | 207 | test = "00"; |
208 | } | 208 | } |
209 | QFont sFont = font(); | 209 | QFont sFont = font(); |
210 | sFont.setPointSize( sFont.pointSize()/2 ); | 210 | sFont.setPointSize( sFont.pointSize()/2 ); |
211 | QFontMetrics fmS( sFont ); | 211 | QFontMetrics fmS( sFont ); |
212 | mMiniWidth += fmS.width( test ) + frameWidth()*2+4 ; | 212 | mMiniWidth += fmS.width( test ) + frameWidth()*2+4 ; |
213 | // update geometry restrictions based on new settings | 213 | // update geometry restrictions based on new settings |
214 | setFixedWidth( mMiniWidth ); | 214 | setFixedWidth( mMiniWidth ); |
215 | 215 | ||
216 | // update HourSize | 216 | // update HourSize |
217 | mCellHeight = KOPrefs::instance()->mHourSize*4; | 217 | mCellHeight = KOPrefs::instance()->mHourSize*4; |
218 | resizeContents(50,mRows * mCellHeight); | 218 | resizeContents(mMiniWidth,mRows * mCellHeight+1); |
219 | } | 219 | } |
220 | 220 | ||
221 | /** update time label positions */ | 221 | /** update time label positions */ |
222 | void TimeLabels::positionChanged() | 222 | void TimeLabels::positionChanged() |
223 | { | 223 | { |
224 | int adjustment = mAgenda->contentsY(); | 224 | int adjustment = mAgenda->contentsY(); |
225 | setContentsPos(0, adjustment); | 225 | setContentsPos(0, adjustment); |
226 | } | 226 | } |
227 | 227 | ||
228 | /** */ | 228 | /** */ |
229 | void TimeLabels::setAgenda(KOAgenda* agenda) | 229 | void TimeLabels::setAgenda(KOAgenda* agenda) |
230 | { | 230 | { |
231 | mAgenda = agenda; | 231 | mAgenda = agenda; |
232 | } | 232 | } |
233 | 233 | ||
234 | void TimeLabels::contentsMousePressEvent ( QMouseEvent * e) | 234 | void TimeLabels::contentsMousePressEvent ( QMouseEvent * e) |
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index b14ca43..abc80d4 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp | |||
@@ -214,85 +214,82 @@ void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout) | |||
214 | mAlarmProgramButton->setToggleButton(true); | 214 | mAlarmProgramButton->setToggleButton(true); |
215 | QToolTip::add(mAlarmProgramButton, i18n("No program set")); | 215 | QToolTip::add(mAlarmProgramButton, i18n("No program set")); |
216 | connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram())); | 216 | connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram())); |
217 | alarmLayout->addWidget(mAlarmProgramButton); | 217 | alarmLayout->addWidget(mAlarmProgramButton); |
218 | mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 ); | 218 | mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 ); |
219 | mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 ); | 219 | mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 ); |
220 | // if ( KOPrefs::instance()->mCompactDialogs ) { | 220 | // if ( KOPrefs::instance()->mCompactDialogs ) { |
221 | // mAlarmSoundButton->hide(); | 221 | // mAlarmSoundButton->hide(); |
222 | // mAlarmProgramButton->hide(); | 222 | // mAlarmProgramButton->hide(); |
223 | // } | 223 | // } |
224 | } | 224 | } |
225 | 225 | ||
226 | void KOEditorGeneral::pickAlarmSound() | 226 | void KOEditorGeneral::pickAlarmSound() |
227 | { | 227 | { |
228 | 228 | ||
229 | qDebug("KOEditorGeneral::pickAlarmSound() %d",mAlarmSoundButton->isOn() ); | 229 | qDebug("KOEditorGeneral::pickAlarmSound() %d",mAlarmSoundButton->isOn() ); |
230 | //QString prefix = mAlarmSound; | 230 | |
231 | if (!mAlarmSoundButton->isOn()) { | 231 | bool oldState = mAlarmSoundButton->isOn(); |
232 | |||
233 | QString fileName(KFileDialog::getOpenFileName(mAlarmSound, | ||
234 | i18n("*.wav|Wav Files"), 0)); | ||
235 | if (!fileName.isEmpty()) { | ||
236 | mAlarmSound = fileName; | ||
237 | QToolTip::remove(mAlarmSoundButton); | ||
238 | QString dispStr = i18n("Playing '%1'").arg(fileName); | ||
239 | QToolTip::add(mAlarmSoundButton, dispStr); | ||
240 | mAlarmProgramButton->setOn(false); | ||
232 | mAlarmSoundButton->setOn(true); | 241 | mAlarmSoundButton->setOn(true); |
233 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); | 242 | QToolTip::add(mAlarmProgramButton, i18n("No program set")); |
234 | } else { | 243 | } else { |
235 | QString fileName(KFileDialog::getOpenFileName(mAlarmSound, | 244 | mAlarmProgramButton->setOn(oldState); |
236 | i18n("*.wav|Wav Files"), 0)); | 245 | mAlarmSoundButton->setOn(!oldState); |
237 | if (!fileName.isEmpty()) { | 246 | |
238 | mAlarmSound = fileName; | 247 | |
239 | QToolTip::remove(mAlarmSoundButton); | ||
240 | QString dispStr = i18n("Playing '%1'").arg(fileName); | ||
241 | QToolTip::add(mAlarmSoundButton, dispStr); | ||
242 | mAlarmProgramButton->setOn(false); | ||
243 | mAlarmSoundButton->setOn(true); | ||
244 | } else { | ||
245 | mAlarmProgramButton->setOn(true); | ||
246 | mAlarmSoundButton->setOn(false); | ||
247 | |||
248 | } | ||
249 | } | 248 | } |
250 | #if 0 | 249 | |
251 | if (mAlarmProgramButton->isOn()) | 250 | if (mAlarmProgramButton->isOn()) |
252 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); | 251 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); |
253 | if ( mAlarmSoundButton->isOn()) | 252 | if ( mAlarmSoundButton->isOn()) |
254 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); | 253 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); |
255 | #endif | 254 | |
256 | } | 255 | } |
257 | 256 | ||
258 | void KOEditorGeneral::pickAlarmProgram() | 257 | void KOEditorGeneral::pickAlarmProgram() |
259 | { | 258 | { |
260 | if (!mAlarmProgramButton->isOn()) { | 259 | bool oldState = mAlarmProgramButton->isOn(); |
260 | |||
261 | QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm: ") , 0)); | ||
262 | if (!fileName.isEmpty()) { | ||
263 | mAlarmProgram = fileName; | ||
264 | QToolTip::remove(mAlarmProgramButton); | ||
265 | QString dispStr = i18n("Running '%1'").arg(fileName); | ||
266 | QToolTip::add(mAlarmProgramButton, dispStr); | ||
267 | mAlarmSoundButton->setOn(false); | ||
261 | mAlarmProgramButton->setOn(true); | 268 | mAlarmProgramButton->setOn(true); |
262 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); | 269 | QToolTip::add(mAlarmSoundButton, i18n("No sound set")); |
263 | } else { | 270 | } else { |
264 | QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm: ") , 0)); | 271 | mAlarmProgramButton->setOn(!oldState); |
265 | if (!fileName.isEmpty()) { | 272 | mAlarmSoundButton->setOn(oldState); |
266 | mAlarmProgram = fileName; | ||
267 | QToolTip::remove(mAlarmProgramButton); | ||
268 | QString dispStr = i18n("Running '%1'").arg(fileName); | ||
269 | QToolTip::add(mAlarmProgramButton, dispStr); | ||
270 | mAlarmSoundButton->setOn(false); | ||
271 | mAlarmProgramButton->setOn(true); | ||
272 | } else { | ||
273 | mAlarmProgramButton->setOn(false); | ||
274 | mAlarmSoundButton->setOn(true); | ||
275 | } | ||
276 | } | 273 | } |
277 | #if 0 | 274 | |
278 | if (mAlarmProgramButton->isOn()) | 275 | if (mAlarmProgramButton->isOn()) |
279 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); | 276 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); |
280 | if ( mAlarmSoundButton->isOn()) | 277 | if ( mAlarmSoundButton->isOn()) |
281 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); | 278 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); |
282 | #endif | 279 | |
283 | } | 280 | } |
284 | 281 | ||
285 | 282 | ||
286 | QString KOEditorGeneral::getFittingPath( const QString s ) | 283 | QString KOEditorGeneral::getFittingPath( const QString s ) |
287 | { | 284 | { |
288 | int maxlen = 50; | 285 | int maxlen = 50; |
289 | if ( QApplication::desktop()->width() < 640 ) { | 286 | if ( QApplication::desktop()->width() < 640 ) { |
290 | if ( QApplication::desktop()->width() < 320 ) | 287 | if ( QApplication::desktop()->width() < 320 ) |
291 | maxlen = 22; | 288 | maxlen = 22; |
292 | else | 289 | else |
293 | maxlen = 35; | 290 | maxlen = 35; |
294 | } | 291 | } |
295 | if ( s.length() > maxlen ) { | 292 | if ( s.length() > maxlen ) { |
296 | return "..."+s.right(maxlen -3); | 293 | return "..."+s.right(maxlen -3); |
297 | } | 294 | } |
298 | return s; | 295 | return s; |
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 01cf0ff..395325c 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -191,58 +191,64 @@ void KOTodoListView::contentsDropEvent(QDropEvent *e) | |||
191 | for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) { | 191 | for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) { |
192 | int pos = (*it).find("<"); | 192 | int pos = (*it).find("<"); |
193 | QString name = (*it).left(pos); | 193 | QString name = (*it).left(pos); |
194 | QString email = (*it).mid(pos); | 194 | QString email = (*it).mid(pos); |
195 | if (!email.isEmpty() && todoi) { | 195 | if (!email.isEmpty() && todoi) { |
196 | todoi->todo()->addAttendee(new Attendee(name,email)); | 196 | todoi->todo()->addAttendee(new Attendee(name,email)); |
197 | } | 197 | } |
198 | } | 198 | } |
199 | } | 199 | } |
200 | else { | 200 | else { |
201 | qDebug("KOTodoListView::contentsDropEvent(): Todo from drop not decodable "); | 201 | qDebug("KOTodoListView::contentsDropEvent(): Todo from drop not decodable "); |
202 | e->ignore(); | 202 | e->ignore(); |
203 | } | 203 | } |
204 | } | 204 | } |
205 | #endif | 205 | #endif |
206 | } | 206 | } |
207 | void KOTodoListView::wheelEvent (QWheelEvent *e) | ||
208 | { | ||
209 | QListView::wheelEvent (e); | ||
210 | } | ||
207 | 211 | ||
208 | void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) | 212 | void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) |
209 | { | 213 | { |
210 | 214 | ||
211 | QPoint p(contentsToViewport(e->pos())); | 215 | QPoint p(contentsToViewport(e->pos())); |
212 | QListViewItem *i = itemAt(p); | 216 | QListViewItem *i = itemAt(p); |
213 | bool rootClicked = true; | 217 | bool rootClicked = true; |
214 | if (i) { | 218 | if (i) { |
215 | // if the user clicked into the root decoration of the item, don't | 219 | // if the user clicked into the root decoration of the item, don't |
216 | // try to start a drag! | 220 | // try to start a drag! |
217 | int X = p.x(); | 221 | int X = p.x(); |
218 | //qDebug("%d %d %d", X, header()->sectionPos(0), treeStepSize() ); | 222 | //qDebug("%d %d %d", X, header()->sectionPos(0), treeStepSize() ); |
219 | if (X > header()->sectionPos(0) + | 223 | if (X > header()->sectionPos(0) + |
220 | treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) + | 224 | treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) + |
221 | itemMargin() +i->height()|| | 225 | itemMargin() +i->height()|| |
222 | X < header()->sectionPos(0)) { | 226 | X < header()->sectionPos(0)) { |
223 | rootClicked = false; | 227 | rootClicked = false; |
224 | } | 228 | } |
225 | } else { | 229 | } else { |
226 | rootClicked = false; | 230 | rootClicked = false; |
227 | } | 231 | } |
228 | #ifndef KORG_NODND | 232 | #ifndef KORG_NODND |
229 | mMousePressed = false; | 233 | mMousePressed = false; |
230 | if (! rootClicked ) { | 234 | if (! rootClicked && !( e->button() == RightButton) ) { |
231 | mPressPos = e->pos(); | 235 | mPressPos = e->pos(); |
232 | mMousePressed = true; | 236 | mMousePressed = true; |
237 | } else { | ||
238 | mMousePressed = false; | ||
233 | } | 239 | } |
234 | #endif | 240 | #endif |
235 | //qDebug("KOTodoListView::contentsMousePressEvent %d", rootClicked); | 241 | //qDebug("KOTodoListView::contentsMousePressEvent %d", rootClicked); |
236 | #ifndef DESKTOP_VERSION | 242 | #ifndef DESKTOP_VERSION |
237 | if (!( e->button() == RightButton && rootClicked) ) | 243 | if (!( e->button() == RightButton && rootClicked) ) |
238 | QListView::contentsMousePressEvent(e); | 244 | QListView::contentsMousePressEvent(e); |
239 | #else | 245 | #else |
240 | QListView::contentsMousePressEvent(e); | 246 | QListView::contentsMousePressEvent(e); |
241 | #endif | 247 | #endif |
242 | } | 248 | } |
243 | void KOTodoListView::paintEvent(QPaintEvent* e) | 249 | void KOTodoListView::paintEvent(QPaintEvent* e) |
244 | { | 250 | { |
245 | emit paintNeeded(); | 251 | emit paintNeeded(); |
246 | QListView::paintEvent( e); | 252 | QListView::paintEvent( e); |
247 | } | 253 | } |
248 | void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) | 254 | void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) |
@@ -1069,33 +1075,33 @@ void KOTodoView::changedCategories(int index) | |||
1069 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); | 1075 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); |
1070 | todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED); | 1076 | todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED); |
1071 | } | 1077 | } |
1072 | } | 1078 | } |
1073 | void KOTodoView::itemDoubleClicked(QListViewItem *item) | 1079 | void KOTodoView::itemDoubleClicked(QListViewItem *item) |
1074 | { | 1080 | { |
1075 | if ( pendingSubtodo != 0 ) { | 1081 | if ( pendingSubtodo != 0 ) { |
1076 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); | 1082 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); |
1077 | } | 1083 | } |
1078 | pendingSubtodo = 0; | 1084 | pendingSubtodo = 0; |
1079 | int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() ); | 1085 | int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() ); |
1080 | //qDebug("ROW %d ", row); | 1086 | //qDebug("ROW %d ", row); |
1081 | if (!item) { | 1087 | if (!item) { |
1082 | newTodo(); | 1088 | newTodo(); |
1083 | return; | 1089 | return; |
1084 | } else { | 1090 | } else { |
1085 | if ( row == 1 ) { | 1091 | if ( row == 1 || row == 2 ) { |
1086 | mActiveItem = (KOTodoViewItem *) item; | 1092 | mActiveItem = (KOTodoViewItem *) item; |
1087 | newSubTodo(); | 1093 | newSubTodo(); |
1088 | return; | 1094 | return; |
1089 | } | 1095 | } |
1090 | } | 1096 | } |
1091 | if ( KOPrefs::instance()->mEditOnDoubleClick ) | 1097 | if ( KOPrefs::instance()->mEditOnDoubleClick ) |
1092 | editItem( item ); | 1098 | editItem( item ); |
1093 | else | 1099 | else |
1094 | showItem( item , QPoint(), 0 ); | 1100 | showItem( item , QPoint(), 0 ); |
1095 | } | 1101 | } |
1096 | void KOTodoView::itemClicked(QListViewItem *item) | 1102 | void KOTodoView::itemClicked(QListViewItem *item) |
1097 | { | 1103 | { |
1098 | //qDebug("KOTodoView::itemClicked %d", item); | 1104 | //qDebug("KOTodoView::itemClicked %d", item); |
1099 | if (!item) { | 1105 | if (!item) { |
1100 | if ( pendingSubtodo != 0 ) { | 1106 | if ( pendingSubtodo != 0 ) { |
1101 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); | 1107 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); |
@@ -1258,32 +1264,33 @@ void KOTodoView::displayAllFlat() | |||
1258 | void KOTodoView::setAllFlat() | 1264 | void KOTodoView::setAllFlat() |
1259 | { | 1265 | { |
1260 | if ( isFlatDisplay ) { | 1266 | if ( isFlatDisplay ) { |
1261 | isFlatDisplay = false; | 1267 | isFlatDisplay = false; |
1262 | mPopupMenu->setItemChecked( 8,false ); | 1268 | mPopupMenu->setItemChecked( 8,false ); |
1263 | updateView(); | 1269 | updateView(); |
1264 | return; | 1270 | return; |
1265 | } | 1271 | } |
1266 | storeCurrentItem(); | 1272 | storeCurrentItem(); |
1267 | displayAllFlat(); | 1273 | displayAllFlat(); |
1268 | resetCurrentItem(); | 1274 | resetCurrentItem(); |
1269 | } | 1275 | } |
1270 | 1276 | ||
1271 | void KOTodoView::purgeCompleted() | 1277 | void KOTodoView::purgeCompleted() |
1272 | { | 1278 | { |
1273 | emit purgeCompletedSignal(); | 1279 | emit purgeCompletedSignal(); |
1280 | |||
1274 | } | 1281 | } |
1275 | void KOTodoView::toggleQuickTodo() | 1282 | void KOTodoView::toggleQuickTodo() |
1276 | { | 1283 | { |
1277 | if ( mQuickAdd->isVisible() ) { | 1284 | if ( mQuickAdd->isVisible() ) { |
1278 | mQuickAdd->hide(); | 1285 | mQuickAdd->hide(); |
1279 | KOPrefs::instance()->mEnableQuickTodo = false; | 1286 | KOPrefs::instance()->mEnableQuickTodo = false; |
1280 | } | 1287 | } |
1281 | else { | 1288 | else { |
1282 | mQuickAdd->show(); | 1289 | mQuickAdd->show(); |
1283 | KOPrefs::instance()->mEnableQuickTodo = true; | 1290 | KOPrefs::instance()->mEnableQuickTodo = true; |
1284 | } | 1291 | } |
1285 | mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); | 1292 | mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); |
1286 | mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); | 1293 | mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); |
1287 | } | 1294 | } |
1288 | 1295 | ||
1289 | void KOTodoView::toggleRunning() | 1296 | void KOTodoView::toggleRunning() |
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index e553d0e..39976cf 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h | |||
@@ -55,32 +55,33 @@ class DocPrefs; | |||
55 | 55 | ||
56 | class KOTodoListView : public KListView | 56 | class KOTodoListView : public KListView |
57 | { | 57 | { |
58 | Q_OBJECT | 58 | Q_OBJECT |
59 | public: | 59 | public: |
60 | KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0); | 60 | KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0); |
61 | virtual ~KOTodoListView() {} | 61 | virtual ~KOTodoListView() {} |
62 | 62 | ||
63 | signals: | 63 | signals: |
64 | void paintNeeded(); | 64 | void paintNeeded(); |
65 | void todoDropped(Todo *, int); | 65 | void todoDropped(Todo *, int); |
66 | void double_Clicked(QListViewItem *item); | 66 | void double_Clicked(QListViewItem *item); |
67 | void reparentTodoSignal( Todo *,Todo * ); | 67 | void reparentTodoSignal( Todo *,Todo * ); |
68 | void unparentTodoSignal(Todo *); | 68 | void unparentTodoSignal(Todo *); |
69 | void deleteTodo( Todo * ); | 69 | void deleteTodo( Todo * ); |
70 | protected: | 70 | protected: |
71 | void wheelEvent (QWheelEvent *e); | ||
71 | void contentsDragEnterEvent(QDragEnterEvent *); | 72 | void contentsDragEnterEvent(QDragEnterEvent *); |
72 | void contentsDragMoveEvent(QDragMoveEvent *); | 73 | void contentsDragMoveEvent(QDragMoveEvent *); |
73 | void contentsDragLeaveEvent(QDragLeaveEvent *); | 74 | void contentsDragLeaveEvent(QDragLeaveEvent *); |
74 | void contentsDropEvent(QDropEvent *); | 75 | void contentsDropEvent(QDropEvent *); |
75 | 76 | ||
76 | void contentsMousePressEvent(QMouseEvent *); | 77 | void contentsMousePressEvent(QMouseEvent *); |
77 | void contentsMouseMoveEvent(QMouseEvent *); | 78 | void contentsMouseMoveEvent(QMouseEvent *); |
78 | void contentsMouseReleaseEvent(QMouseEvent *); | 79 | void contentsMouseReleaseEvent(QMouseEvent *); |
79 | void contentsMouseDoubleClickEvent(QMouseEvent *); | 80 | void contentsMouseDoubleClickEvent(QMouseEvent *); |
80 | 81 | ||
81 | private: | 82 | private: |
82 | void paintEvent(QPaintEvent * pevent); | 83 | void paintEvent(QPaintEvent * pevent); |
83 | bool internalDrop; | 84 | bool internalDrop; |
84 | QString mName; | 85 | QString mName; |
85 | Calendar *mCalendar; | 86 | Calendar *mCalendar; |
86 | QPoint mPressPos; | 87 | QPoint mPressPos; |