author | zautrix <zautrix> | 2005-03-28 13:31:19 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-28 13:31:19 (UTC) |
commit | e4e6bda3a6b0a82e3f64db0fa5f7d60cab9f0e48 (patch) (unidiff) | |
tree | e1b5b2d51b8026b08f6eb3680304fa8d86d1873a /korganizer | |
parent | 314908d5d9139af7711c6e425260363bb014afce (diff) | |
download | kdepimpi-e4e6bda3a6b0a82e3f64db0fa5f7d60cab9f0e48.zip kdepimpi-e4e6bda3a6b0a82e3f64db0fa5f7d60cab9f0e48.tar.gz kdepimpi-e4e6bda3a6b0a82e3f64db0fa5f7d60cab9f0e48.tar.bz2 |
fixes
-rw-r--r-- | korganizer/calendarview.cpp | 11 | ||||
-rw-r--r-- | korganizer/calendarview.h | 1 | ||||
-rw-r--r-- | korganizer/koeventviewer.cpp | 29 | ||||
-rw-r--r-- | korganizer/koeventviewer.h | 1 | ||||
-rw-r--r-- | korganizer/koeventviewerdialog.cpp | 14 | ||||
-rw-r--r-- | korganizer/koeventviewerdialog.h | 1 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 7 | ||||
-rw-r--r-- | korganizer/koviewmanager.h | 1 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 16 | ||||
-rw-r--r-- | korganizer/navigatorbar.cpp | 15 |
10 files changed, 86 insertions, 10 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index a330414..0015bd6 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -3398,65 +3398,74 @@ void CalendarView::schedule(Scheduler::Method method, Incidence *incidence) | |||
3398 | void CalendarView::openAddressbook() | 3398 | void CalendarView::openAddressbook() |
3399 | { | 3399 | { |
3400 | KRun::runCommand("kaddressbook"); | 3400 | KRun::runCommand("kaddressbook"); |
3401 | } | 3401 | } |
3402 | 3402 | ||
3403 | void CalendarView::setModified(bool modified) | 3403 | void CalendarView::setModified(bool modified) |
3404 | { | 3404 | { |
3405 | if ( modified ) | 3405 | if ( modified ) |
3406 | emit signalmodified(); | 3406 | emit signalmodified(); |
3407 | if (mModified != modified) { | 3407 | if (mModified != modified) { |
3408 | mModified = modified; | 3408 | mModified = modified; |
3409 | emit modifiedChanged(mModified); | 3409 | emit modifiedChanged(mModified); |
3410 | } | 3410 | } |
3411 | } | 3411 | } |
3412 | 3412 | ||
3413 | bool CalendarView::isReadOnly() | 3413 | bool CalendarView::isReadOnly() |
3414 | { | 3414 | { |
3415 | return mReadOnly; | 3415 | return mReadOnly; |
3416 | } | 3416 | } |
3417 | 3417 | ||
3418 | void CalendarView::setReadOnly(bool readOnly) | 3418 | void CalendarView::setReadOnly(bool readOnly) |
3419 | { | 3419 | { |
3420 | if (mReadOnly != readOnly) { | 3420 | if (mReadOnly != readOnly) { |
3421 | mReadOnly = readOnly; | 3421 | mReadOnly = readOnly; |
3422 | emit readOnlyChanged(mReadOnly); | 3422 | emit readOnlyChanged(mReadOnly); |
3423 | } | 3423 | } |
3424 | } | 3424 | } |
3425 | 3425 | ||
3426 | bool CalendarView::isModified() | 3426 | bool CalendarView::isModified() |
3427 | { | 3427 | { |
3428 | return mModified; | 3428 | return mModified; |
3429 | } | 3429 | } |
3430 | 3430 | void CalendarView::slotprintSelInc() | |
3431 | { | ||
3432 | if ( currentSelection() == 0 ) { | ||
3433 | KMessageBox::sorry(this,i18n("There is nothing selected!")); | ||
3434 | return; | ||
3435 | } | ||
3436 | showIncidence(); | ||
3437 | getEventViewerDialog()->print(); | ||
3438 | |||
3439 | } | ||
3431 | void CalendarView::printSetup() | 3440 | void CalendarView::printSetup() |
3432 | { | 3441 | { |
3433 | #ifndef KORG_NOPRINTER | 3442 | #ifndef KORG_NOPRINTER |
3434 | createPrinter(); | 3443 | createPrinter(); |
3435 | 3444 | ||
3436 | mCalPrinter->setupPrinter(); | 3445 | mCalPrinter->setupPrinter(); |
3437 | #endif | 3446 | #endif |
3438 | } | 3447 | } |
3439 | 3448 | ||
3440 | void CalendarView::print() | 3449 | void CalendarView::print() |
3441 | { | 3450 | { |
3442 | #ifndef KORG_NOPRINTER | 3451 | #ifndef KORG_NOPRINTER |
3443 | createPrinter(); | 3452 | createPrinter(); |
3444 | 3453 | ||
3445 | DateList tmpDateList = mNavigator->selectedDates(); | 3454 | DateList tmpDateList = mNavigator->selectedDates(); |
3446 | mCalPrinter->print(CalPrinter::Month, | 3455 | mCalPrinter->print(CalPrinter::Month, |
3447 | tmpDateList.first(), tmpDateList.last()); | 3456 | tmpDateList.first(), tmpDateList.last()); |
3448 | #endif | 3457 | #endif |
3449 | } | 3458 | } |
3450 | 3459 | ||
3451 | void CalendarView::printPreview() | 3460 | void CalendarView::printPreview() |
3452 | { | 3461 | { |
3453 | #ifndef KORG_NOPRINTER | 3462 | #ifndef KORG_NOPRINTER |
3454 | kdDebug() << "CalendarView::printPreview()" << endl; | 3463 | kdDebug() << "CalendarView::printPreview()" << endl; |
3455 | 3464 | ||
3456 | createPrinter(); | 3465 | createPrinter(); |
3457 | 3466 | ||
3458 | DateList tmpDateList = mNavigator->selectedDates(); | 3467 | DateList tmpDateList = mNavigator->selectedDates(); |
3459 | 3468 | ||
3460 | mViewManager->currentView()->printPreview(mCalPrinter,tmpDateList.first(), | 3469 | mViewManager->currentView()->printPreview(mCalPrinter,tmpDateList.first(), |
3461 | tmpDateList.last()); | 3470 | tmpDateList.last()); |
3462 | #endif | 3471 | #endif |
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 9782ffe..05a34b4 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -147,64 +147,65 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
147 | /** Emitted when state of events selection has changed and user is organizer*/ | 147 | /** Emitted when state of events selection has changed and user is organizer*/ |
148 | void organizerEventsSelected(bool); | 148 | void organizerEventsSelected(bool); |
149 | /** Emitted when state of events selection has changed and user is attendee*/ | 149 | /** Emitted when state of events selection has changed and user is attendee*/ |
150 | void groupEventsSelected(bool); | 150 | void groupEventsSelected(bool); |
151 | /** | 151 | /** |
152 | Emitted when an incidence gets selected. If the selection is cleared the | 152 | Emitted when an incidence gets selected. If the selection is cleared the |
153 | signal is emitted with 0 as argument. | 153 | signal is emitted with 0 as argument. |
154 | */ | 154 | */ |
155 | void incidenceSelected( Incidence * ); | 155 | void incidenceSelected( Incidence * ); |
156 | /** Emitted, when a todoitem is selected or deselected. */ | 156 | /** Emitted, when a todoitem is selected or deselected. */ |
157 | void todoSelected( bool ); | 157 | void todoSelected( bool ); |
158 | 158 | ||
159 | /** | 159 | /** |
160 | Emitted, when clipboard content changes. Parameter indicates if paste | 160 | Emitted, when clipboard content changes. Parameter indicates if paste |
161 | is possible or not. | 161 | is possible or not. |
162 | */ | 162 | */ |
163 | void pasteEnabled(bool); | 163 | void pasteEnabled(bool); |
164 | 164 | ||
165 | /** Emitted, when the number of incoming messages has changed. */ | 165 | /** Emitted, when the number of incoming messages has changed. */ |
166 | void numIncomingChanged(int); | 166 | void numIncomingChanged(int); |
167 | 167 | ||
168 | /** Emitted, when the number of outgoing messages has changed. */ | 168 | /** Emitted, when the number of outgoing messages has changed. */ |
169 | void numOutgoingChanged(int); | 169 | void numOutgoingChanged(int); |
170 | 170 | ||
171 | /** Send status message, which can e.g. be displayed in the status bar. */ | 171 | /** Send status message, which can e.g. be displayed in the status bar. */ |
172 | void statusMessage(const QString &); | 172 | void statusMessage(const QString &); |
173 | 173 | ||
174 | void calendarViewExpanded( bool ); | 174 | void calendarViewExpanded( bool ); |
175 | void updateSearchDialog(); | 175 | void updateSearchDialog(); |
176 | 176 | ||
177 | 177 | ||
178 | public slots: | 178 | public slots: |
179 | void slotprintSelInc(); | ||
179 | void showNextAlarms(); | 180 | void showNextAlarms(); |
180 | void showOpenError(); | 181 | void showOpenError(); |
181 | void watchSavedFile(); | 182 | void watchSavedFile(); |
182 | void recheckTimerAlarm(); | 183 | void recheckTimerAlarm(); |
183 | void checkNextTimerAlarm(); | 184 | void checkNextTimerAlarm(); |
184 | void addAlarm(const QDateTime &qdt, const QString ¬i ); | 185 | void addAlarm(const QDateTime &qdt, const QString ¬i ); |
185 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); | 186 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); |
186 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); | 187 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); |
187 | 188 | ||
188 | /** options dialog made a changed to the configuration. we catch this | 189 | /** options dialog made a changed to the configuration. we catch this |
189 | * and notify all widgets which need to update their configuration. */ | 190 | * and notify all widgets which need to update their configuration. */ |
190 | void updateConfig(); | 191 | void updateConfig(); |
191 | 192 | ||
192 | void insertBirthdays(const QString& uid, const QStringList& birthdayList, | 193 | void insertBirthdays(const QString& uid, const QStringList& birthdayList, |
193 | const QStringList& anniversaryList, const QStringList& realNameList, | 194 | const QStringList& anniversaryList, const QStringList& realNameList, |
194 | const QStringList& emailList, const QStringList& assembledNameList, | 195 | const QStringList& emailList, const QStringList& assembledNameList, |
195 | const QStringList& uidList); | 196 | const QStringList& uidList); |
196 | 197 | ||
197 | /** | 198 | /** |
198 | Load calendar from file \a filename. If \a merge is true, load | 199 | Load calendar from file \a filename. If \a merge is true, load |
199 | calendar into existing one, if it is false, clear calendar, before | 200 | calendar into existing one, if it is false, clear calendar, before |
200 | loading. Return true, if calendar could be successfully loaded. | 201 | loading. Return true, if calendar could be successfully loaded. |
201 | */ | 202 | */ |
202 | bool openCalendar(QString filename, bool merge=false); | 203 | bool openCalendar(QString filename, bool merge=false); |
203 | bool syncCalendar(QString filename,int mode = 0 ); | 204 | bool syncCalendar(QString filename,int mode = 0 ); |
204 | 205 | ||
205 | /** | 206 | /** |
206 | Save calendar data to file. Return true if calendar could be | 207 | Save calendar data to file. Return true if calendar could be |
207 | successfully saved. | 208 | successfully saved. |
208 | */ | 209 | */ |
209 | bool saveCalendar(QString filename); | 210 | bool saveCalendar(QString filename); |
210 | 211 | ||
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 1508638..445fc86 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp | |||
@@ -24,80 +24,109 @@ | |||
24 | #include <qlabel.h> | 24 | #include <qlabel.h> |
25 | #include <qlayout.h> | 25 | #include <qlayout.h> |
26 | 26 | ||
27 | #include <klocale.h> | 27 | #include <klocale.h> |
28 | #include <kapplication.h> | 28 | #include <kapplication.h> |
29 | #include <libkcal/event.h> | 29 | #include <libkcal/event.h> |
30 | #include <libkcal/todo.h> | 30 | #include <libkcal/todo.h> |
31 | #include <kdebug.h> | 31 | #include <kdebug.h> |
32 | #include <kiconloader.h> | 32 | #include <kiconloader.h> |
33 | #include <krun.h> | 33 | #include <krun.h> |
34 | #include <kglobal.h> | 34 | #include <kglobal.h> |
35 | #include <kprocess.h> | 35 | #include <kprocess.h> |
36 | #include "koprefs.h" | 36 | #include "koprefs.h" |
37 | 37 | ||
38 | #include <kabc/stdaddressbook.h> | 38 | #include <kabc/stdaddressbook.h> |
39 | 39 | ||
40 | #ifndef KORG_NODCOP | 40 | #ifndef KORG_NODCOP |
41 | #include <dcopclient.h> | 41 | #include <dcopclient.h> |
42 | #include "korganizer.h" | 42 | #include "korganizer.h" |
43 | #include "koprefs.h" | 43 | #include "koprefs.h" |
44 | #include "actionmanager.h" | 44 | #include "actionmanager.h" |
45 | #endif | 45 | #endif |
46 | 46 | ||
47 | #include "koeventviewer.h" | 47 | #include "koeventviewer.h" |
48 | //#ifndef KORG_NOKABC | 48 | //#ifndef KORG_NOKABC |
49 | //#include <kabc/stdaddressbook.h> | 49 | //#include <kabc/stdaddressbook.h> |
50 | //#define size count | 50 | //#define size count |
51 | //#endif | 51 | //#endif |
52 | 52 | ||
53 | #ifdef DESKTOP_VERSION | 53 | #ifdef DESKTOP_VERSION |
54 | #include <kabc/addresseedialog.h> | 54 | #include <kabc/addresseedialog.h> |
55 | #include <kabc/addresseeview.h> | 55 | #include <kabc/addresseeview.h> |
56 | #include <qprinter.h> | ||
57 | #include <qpainter.h> | ||
58 | #include <qpaintdevicemetrics.h> | ||
56 | #else //DESKTOP_VERSION | 59 | #else //DESKTOP_VERSION |
57 | #include <externalapphandler.h> | 60 | #include <externalapphandler.h> |
58 | #include <qtopia/qcopenvelope_qws.h> | 61 | #include <qtopia/qcopenvelope_qws.h> |
59 | #endif //DESKTOP_VERSION | 62 | #endif //DESKTOP_VERSION |
60 | 63 | ||
61 | KOEventViewer::KOEventViewer(QWidget *parent,const char *name) | 64 | KOEventViewer::KOEventViewer(QWidget *parent,const char *name) |
62 | : QTextBrowser(parent,name) | 65 | : QTextBrowser(parent,name) |
63 | { | 66 | { |
64 | mSyncMode = false; | 67 | mSyncMode = false; |
65 | mColorMode = 0; | 68 | mColorMode = 0; |
66 | } | 69 | } |
67 | 70 | ||
68 | KOEventViewer::~KOEventViewer() | 71 | KOEventViewer::~KOEventViewer() |
69 | { | 72 | { |
70 | } | 73 | } |
71 | 74 | ||
75 | void KOEventViewer::printMe() | ||
76 | { | ||
77 | #ifdef DESKTOP_VERSION | ||
78 | QPrinter printer; | ||
79 | if (!printer.setup() ) | ||
80 | return; | ||
81 | QPainter p; | ||
82 | p.begin ( &printer ); | ||
83 | QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); | ||
84 | float dx, dy; | ||
85 | int wid = (m.width() * 9)/10; | ||
86 | dx = (float) wid/(float)contentsWidth (); | ||
87 | dy = (float)(m.height()) / (float)contentsHeight (); | ||
88 | float scale; | ||
89 | // scale to fit the width or height of the paper | ||
90 | if ( dx < dy ) | ||
91 | scale = dx; | ||
92 | else | ||
93 | scale = dy; | ||
94 | p.translate( m.width()/10,0 ); | ||
95 | p.scale( scale, scale ); | ||
96 | drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); | ||
97 | p.end(); | ||
98 | #endif | ||
99 | |||
100 | } | ||
72 | void KOEventViewer::setSource(const QString& n) | 101 | void KOEventViewer::setSource(const QString& n) |
73 | { | 102 | { |
74 | 103 | ||
75 | if ( n.left(3) == "uid" ) | 104 | if ( n.left(3) == "uid" ) |
76 | #ifdef DESKTOP_VERSION | 105 | #ifdef DESKTOP_VERSION |
77 | { | 106 | { |
78 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); | 107 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); |
79 | KABC::AddressBook::Iterator it; | 108 | KABC::AddressBook::Iterator it; |
80 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { | 109 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { |
81 | // LR I do not understand, why the uid string is different on zaurus and desktop | 110 | // LR I do not understand, why the uid string is different on zaurus and desktop |
82 | QString uid = "uid://"+(*it).uid(); | 111 | QString uid = "uid://"+(*it).uid(); |
83 | 112 | ||
84 | //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); | 113 | //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); |
85 | if (n == uid ) { | 114 | if (n == uid ) { |
86 | //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); | 115 | //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); |
87 | QDialog dia( this,"dia123", true ); | 116 | QDialog dia( this,"dia123", true ); |
88 | dia.setCaption( i18n("Details of attendee") ); | 117 | dia.setCaption( i18n("Details of attendee") ); |
89 | QVBoxLayout lay ( &dia ); | 118 | QVBoxLayout lay ( &dia ); |
90 | KABC::AddresseeView av ( &dia ); | 119 | KABC::AddresseeView av ( &dia ); |
91 | av.setAddressee( (*it) ); | 120 | av.setAddressee( (*it) ); |
92 | lay.addWidget( &av ); | 121 | lay.addWidget( &av ); |
93 | if ( QApplication::desktop()->width() < 480 ) | 122 | if ( QApplication::desktop()->width() < 480 ) |
94 | dia.resize( 220, 240); | 123 | dia.resize( 220, 240); |
95 | else { | 124 | else { |
96 | dia.resize( 400,400); | 125 | dia.resize( 400,400); |
97 | } | 126 | } |
98 | dia.exec(); | 127 | dia.exec(); |
99 | break; | 128 | break; |
100 | } | 129 | } |
101 | } | 130 | } |
102 | return; | 131 | return; |
103 | } | 132 | } |
diff --git a/korganizer/koeventviewer.h b/korganizer/koeventviewer.h index 47cc5e9..ca5bc15 100644 --- a/korganizer/koeventviewer.h +++ b/korganizer/koeventviewer.h | |||
@@ -23,55 +23,56 @@ | |||
23 | // | 23 | // |
24 | 24 | ||
25 | #include <qtextbrowser.h> | 25 | #include <qtextbrowser.h> |
26 | 26 | ||
27 | #include <libkcal/event.h> | 27 | #include <libkcal/event.h> |
28 | #include <libkcal/journal.h> | 28 | #include <libkcal/journal.h> |
29 | 29 | ||
30 | 30 | ||
31 | using namespace KCal; | 31 | using namespace KCal; |
32 | 32 | ||
33 | class KOEventViewer : public QTextBrowser { | 33 | class KOEventViewer : public QTextBrowser { |
34 | Q_OBJECT | 34 | Q_OBJECT |
35 | public: | 35 | public: |
36 | KOEventViewer(QWidget *parent=0,const char *name=0); | 36 | KOEventViewer(QWidget *parent=0,const char *name=0); |
37 | virtual ~KOEventViewer(); | 37 | virtual ~KOEventViewer(); |
38 | 38 | ||
39 | void setSource(const QString &); | 39 | void setSource(const QString &); |
40 | void setEvent(Event *event); | 40 | void setEvent(Event *event); |
41 | void addEvent(Event *event); | 41 | void addEvent(Event *event); |
42 | void setTodo(Todo *event, bool clearV = true ); | 42 | void setTodo(Todo *event, bool clearV = true ); |
43 | void setJournal(Journal *jour, bool clearV = true ); | 43 | void setJournal(Journal *jour, bool clearV = true ); |
44 | 44 | ||
45 | void appendEvent(Event *event, int mode = 0 ); | 45 | void appendEvent(Event *event, int mode = 0 ); |
46 | void appendTodo(Todo *event, int mode = 0 ); | 46 | void appendTodo(Todo *event, int mode = 0 ); |
47 | void appendJournal(Journal *jour, int mode = 0 ); | 47 | void appendJournal(Journal *jour, int mode = 0 ); |
48 | 48 | ||
49 | void clearEvents(bool now=false); | 49 | void clearEvents(bool now=false); |
50 | 50 | ||
51 | void addText(QString text); | 51 | void addText(QString text); |
52 | void setSyncMode( bool ); | 52 | void setSyncMode( bool ); |
53 | void setColorMode( int ); | 53 | void setColorMode( int ); |
54 | void mailToAttendees( bool all ); | 54 | void mailToAttendees( bool all ); |
55 | void printMe(); | ||
55 | 56 | ||
56 | protected: | 57 | protected: |
57 | int mColorMode; | 58 | int mColorMode; |
58 | void addTag(const QString & tag,const QString & text); | 59 | void addTag(const QString & tag,const QString & text); |
59 | 60 | ||
60 | void formatCategories(Incidence *event); | 61 | void formatCategories(Incidence *event); |
61 | void formatAttendees(Incidence *event); | 62 | void formatAttendees(Incidence *event); |
62 | void formatReadOnly(Incidence *event); | 63 | void formatReadOnly(Incidence *event); |
63 | void keyPressEvent ( QKeyEvent * e ); | 64 | void keyPressEvent ( QKeyEvent * e ); |
64 | 65 | ||
65 | private: | 66 | private: |
66 | QTextBrowser *mEventTextView; | 67 | QTextBrowser *mEventTextView; |
67 | bool mSyncMode; | 68 | bool mSyncMode; |
68 | QString deTag(QString text); | 69 | QString deTag(QString text); |
69 | 70 | ||
70 | QString mText; | 71 | QString mText; |
71 | QString mMailSubject; | 72 | QString mMailSubject; |
72 | Incidence* mCurrentIncidence; | 73 | Incidence* mCurrentIncidence; |
73 | signals: | 74 | signals: |
74 | void launchaddressbook(QString uid); | 75 | void launchaddressbook(QString uid); |
75 | }; | 76 | }; |
76 | 77 | ||
77 | #endif | 78 | #endif |
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp index f734696..ec55cca 100644 --- a/korganizer/koeventviewerdialog.cpp +++ b/korganizer/koeventviewerdialog.cpp | |||
@@ -1,58 +1,59 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <klocale.h> | 20 | #include <klocale.h> |
21 | 21 | ||
22 | #include <libkcal/event.h> | 22 | #include <libkcal/event.h> |
23 | #include <qtimer.h> | 23 | #include <qtimer.h> |
24 | #include <qpushbutton.h> | 24 | #include <qpushbutton.h> |
25 | 25 | ||
26 | #include "koeventviewer.h" | 26 | #include "koeventviewer.h" |
27 | #include <kmessagebox.h> | ||
27 | #include "koprefs.h" | 28 | #include "koprefs.h" |
28 | #include <libkcal/todo.h> | 29 | #include <libkcal/todo.h> |
29 | #include "qapp.h" | 30 | #include "qapp.h" |
30 | 31 | ||
31 | #include "koeventviewerdialog.h" | 32 | #include "koeventviewerdialog.h" |
32 | extern int globalFlagBlockAgenda; | 33 | extern int globalFlagBlockAgenda; |
33 | 34 | ||
34 | KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name) | 35 | KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name) |
35 | : KDialogBase(parent,name, | 36 | : KDialogBase(parent,name, |
36 | #ifndef DESKTOP_VERSION | 37 | #ifndef DESKTOP_VERSION |
37 | true , | 38 | true , |
38 | #else | 39 | #else |
39 | false, | 40 | false, |
40 | #endif | 41 | #endif |
41 | i18n("Event Viewer"),Ok|User1|Close,Close, false, i18n("Agenda")) | 42 | i18n("Event Viewer"),Ok|User1|Close,Close, false, i18n("Agenda")) |
42 | { | 43 | { |
43 | sendSignalViewerClosed = true; | 44 | sendSignalViewerClosed = true; |
44 | mEventViewer = new KOEventViewer(this); | 45 | mEventViewer = new KOEventViewer(this); |
45 | mEventViewer->setFont( KOPrefs::instance()->mEventViewFont ); | 46 | mEventViewer->setFont( KOPrefs::instance()->mEventViewFont ); |
46 | setMainWidget(mEventViewer); | 47 | setMainWidget(mEventViewer); |
47 | setButtonText(Ok, i18n("Edit") ); | 48 | setButtonText(Ok, i18n("Edit") ); |
48 | 49 | ||
49 | QObject::connect(findButton( Ok ),SIGNAL(clicked()), | 50 | QObject::connect(findButton( Ok ),SIGNAL(clicked()), |
50 | SLOT(editIncidence())); | 51 | SLOT(editIncidence())); |
51 | QObject::connect(this,SIGNAL(user1Clicked()), | 52 | QObject::connect(this,SIGNAL(user1Clicked()), |
52 | SLOT(showIncidence())); | 53 | SLOT(showIncidence())); |
53 | mIncidence = 0; | 54 | mIncidence = 0; |
54 | // TODO: Set a sensible size (based on the content?). | 55 | // TODO: Set a sensible size (based on the content?). |
55 | //showMaximized(); | 56 | //showMaximized(); |
56 | //qDebug("++++++++++++KOEventViewerDialog() "); | 57 | //qDebug("++++++++++++KOEventViewerDialog() "); |
57 | // if ( KOPrefs::instance()->mCompactDialogs ) { | 58 | // if ( KOPrefs::instance()->mCompactDialogs ) { |
58 | // setFixedSize( 240,284 ); | 59 | // setFixedSize( 240,284 ); |
@@ -61,64 +62,77 @@ KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name) | |||
61 | // setMinimumSize(300,200); | 62 | // setMinimumSize(300,200); |
62 | // resize(320,300); | 63 | // resize(320,300); |
63 | // } | 64 | // } |
64 | mSyncMode = false; | 65 | mSyncMode = false; |
65 | mSyncResult = 0; | 66 | mSyncResult = 0; |
66 | 67 | ||
67 | } | 68 | } |
68 | 69 | ||
69 | KOEventViewerDialog::~KOEventViewerDialog() | 70 | KOEventViewerDialog::~KOEventViewerDialog() |
70 | { | 71 | { |
71 | //qDebug("-------~KOEventViewerDialog() "); | 72 | //qDebug("-------~KOEventViewerDialog() "); |
72 | } | 73 | } |
73 | void KOEventViewerDialog::showMe() | 74 | void KOEventViewerDialog::showMe() |
74 | { | 75 | { |
75 | 76 | ||
76 | #ifdef DESKTOP_VERSION | 77 | #ifdef DESKTOP_VERSION |
77 | int x,y,w,h; | 78 | int x,y,w,h; |
78 | x = geometry().x(); | 79 | x = geometry().x(); |
79 | y = geometry().y(); | 80 | y = geometry().y(); |
80 | w = width(); | 81 | w = width(); |
81 | h = height(); | 82 | h = height(); |
82 | show(); | 83 | show(); |
83 | setGeometry(x,y,w,h); | 84 | setGeometry(x,y,w,h); |
84 | #else | 85 | #else |
85 | showMaximized(); | 86 | showMaximized(); |
86 | #endif | 87 | #endif |
87 | raise(); | 88 | raise(); |
88 | setActiveWindow(); | 89 | setActiveWindow(); |
89 | mEventViewer->setFocus(); | 90 | mEventViewer->setFocus(); |
90 | //raise(); | 91 | //raise(); |
91 | 92 | ||
92 | } | 93 | } |
94 | void KOEventViewerDialog::print() | ||
95 | { | ||
96 | qDebug("PRINT "); | ||
97 | int km = KMessageBox::warningContinueCancel(this,mIncidence->summary().left(35) + | ||
98 | i18n("\n\nDo you really want to print this item?"), | ||
99 | i18n("KO/Pi Print Confirmation"),i18n("Print")); | ||
100 | if ( km != KMessageBox::Continue ) { | ||
101 | qDebug("cancel "); | ||
102 | return; | ||
103 | } | ||
104 | mEventViewer->printMe(); | ||
105 | |||
106 | } | ||
93 | void KOEventViewerDialog::setSyncMode( bool b ) | 107 | void KOEventViewerDialog::setSyncMode( bool b ) |
94 | { | 108 | { |
95 | mSyncMode = b; | 109 | mSyncMode = b; |
96 | //qDebug("KOEventViewerDialog::setSyncMode %d ",mSyncMode ); | 110 | //qDebug("KOEventViewerDialog::setSyncMode %d ",mSyncMode ); |
97 | if ( mSyncMode ) { | 111 | if ( mSyncMode ) { |
98 | findButton( Close )->setText( i18n("Cancel Sync")); | 112 | findButton( Close )->setText( i18n("Cancel Sync")); |
99 | findButton( Ok )->setText( i18n("Remote")); | 113 | findButton( Ok )->setText( i18n("Remote")); |
100 | findButton( User1 )->setText( i18n("Local")); | 114 | findButton( User1 )->setText( i18n("Local")); |
101 | } else { | 115 | } else { |
102 | findButton( Close )->setText( i18n("Close")); | 116 | findButton( Close )->setText( i18n("Close")); |
103 | findButton( Ok )->setText( i18n("Edit")); | 117 | findButton( Ok )->setText( i18n("Edit")); |
104 | findButton( User1 )->setText( i18n("Agenda")); | 118 | findButton( User1 )->setText( i18n("Agenda")); |
105 | } | 119 | } |
106 | mEventViewer->setSyncMode( b ); | 120 | mEventViewer->setSyncMode( b ); |
107 | } | 121 | } |
108 | void KOEventViewerDialog::setColorMode( int m ) | 122 | void KOEventViewerDialog::setColorMode( int m ) |
109 | { | 123 | { |
110 | mEventViewer->setColorMode( m ); | 124 | mEventViewer->setColorMode( m ); |
111 | } | 125 | } |
112 | int KOEventViewerDialog::executeS( bool local ) | 126 | int KOEventViewerDialog::executeS( bool local ) |
113 | { | 127 | { |
114 | mSyncResult = 3; | 128 | mSyncResult = 3; |
115 | if ( local ) | 129 | if ( local ) |
116 | findButton( User1 )->setFocus(); | 130 | findButton( User1 )->setFocus(); |
117 | else | 131 | else |
118 | findButton( Ok )->setFocus(); | 132 | findButton( Ok )->setFocus(); |
119 | exec(); | 133 | exec(); |
120 | return mSyncResult; | 134 | return mSyncResult; |
121 | } | 135 | } |
122 | 136 | ||
123 | void KOEventViewerDialog::updateConfig() | 137 | void KOEventViewerDialog::updateConfig() |
124 | { | 138 | { |
diff --git a/korganizer/koeventviewerdialog.h b/korganizer/koeventviewerdialog.h index 36431ad..8e1cd44 100644 --- a/korganizer/koeventviewerdialog.h +++ b/korganizer/koeventviewerdialog.h | |||
@@ -22,54 +22,55 @@ | |||
22 | // Viewer dialog for events. | 22 | // Viewer dialog for events. |
23 | // | 23 | // |
24 | 24 | ||
25 | #include <qtextview.h> | 25 | #include <qtextview.h> |
26 | 26 | ||
27 | #include <kdialogbase.h> | 27 | #include <kdialogbase.h> |
28 | 28 | ||
29 | #include <libkcal/event.h> | 29 | #include <libkcal/event.h> |
30 | 30 | ||
31 | using namespace KCal; | 31 | using namespace KCal; |
32 | 32 | ||
33 | class KOEventViewer; | 33 | class KOEventViewer; |
34 | 34 | ||
35 | class KOEventViewerDialog : public KDialogBase { | 35 | class KOEventViewerDialog : public KDialogBase { |
36 | Q_OBJECT | 36 | Q_OBJECT |
37 | public: | 37 | public: |
38 | KOEventViewerDialog(QWidget *parent=0,const char *name=0); | 38 | KOEventViewerDialog(QWidget *parent=0,const char *name=0); |
39 | virtual ~KOEventViewerDialog(); | 39 | virtual ~KOEventViewerDialog(); |
40 | 40 | ||
41 | void setEvent(Event *event); | 41 | void setEvent(Event *event); |
42 | void addEvent(Event *event); | 42 | void addEvent(Event *event); |
43 | void setTodo(Todo *event); | 43 | void setTodo(Todo *event); |
44 | void setJournal(Journal *journal); | 44 | void setJournal(Journal *journal); |
45 | void setIncidence(Incidence *inc); | 45 | void setIncidence(Incidence *inc); |
46 | void addIncidence(Incidence *inc); | 46 | void addIncidence(Incidence *inc); |
47 | void addText(QString text); | 47 | void addText(QString text); |
48 | void showMe(); | 48 | void showMe(); |
49 | void setSyncMode( bool ); | 49 | void setSyncMode( bool ); |
50 | void setColorMode( int m ); | 50 | void setColorMode( int m ); |
51 | int executeS( bool ); | 51 | int executeS( bool ); |
52 | public slots: | 52 | public slots: |
53 | void updateConfig(); | 53 | void updateConfig(); |
54 | void print(); | ||
54 | signals: | 55 | signals: |
55 | void editIncidence( Incidence* ); | 56 | void editIncidence( Incidence* ); |
56 | void jumpToTime( const QDate &); | 57 | void jumpToTime( const QDate &); |
57 | void showAgendaView( bool ); | 58 | void showAgendaView( bool ); |
58 | void todoCompleted(Todo*); | 59 | void todoCompleted(Todo*); |
59 | void signalViewerClosed(); | 60 | void signalViewerClosed(); |
60 | private slots: | 61 | private slots: |
61 | void slotViewerClosed(); | 62 | void slotViewerClosed(); |
62 | void editIncidence(); | 63 | void editIncidence(); |
63 | void showIncidence(); | 64 | void showIncidence(); |
64 | protected: | 65 | protected: |
65 | void hideEvent ( QHideEvent * e ); | 66 | void hideEvent ( QHideEvent * e ); |
66 | private: | 67 | private: |
67 | bool sendSignalViewerClosed; | 68 | bool sendSignalViewerClosed; |
68 | bool mSyncMode; | 69 | bool mSyncMode; |
69 | int mSyncResult; | 70 | int mSyncResult; |
70 | KOEventViewer *mEventViewer; | 71 | KOEventViewer *mEventViewer; |
71 | Incidence* mIncidence; | 72 | Incidence* mIncidence; |
72 | void keyPressEvent ( QKeyEvent * e ); | 73 | void keyPressEvent ( QKeyEvent * e ); |
73 | }; | 74 | }; |
74 | 75 | ||
75 | #endif | 76 | #endif |
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index e80b3fc..8752636 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -353,64 +353,71 @@ void KOViewManager::updateView(const QDate &start, const QDate &end) | |||
353 | { | 353 | { |
354 | // kdDebug() << "KOViewManager::updateView()" << endl; | 354 | // kdDebug() << "KOViewManager::updateView()" << endl; |
355 | 355 | ||
356 | if (mCurrentView) mCurrentView->showDates(start, end); | 356 | if (mCurrentView) mCurrentView->showDates(start, end); |
357 | 357 | ||
358 | if (mTodoView && mTodoView == mCurrentView ) mTodoView->updateView(); | 358 | if (mTodoView && mTodoView == mCurrentView ) mTodoView->updateView(); |
359 | } | 359 | } |
360 | 360 | ||
361 | 361 | ||
362 | void KOViewManager::updateWNview() | 362 | void KOViewManager::updateWNview() |
363 | { | 363 | { |
364 | if ( mCurrentView == mWhatsNextView && mWhatsNextView ) | 364 | if ( mCurrentView == mWhatsNextView && mWhatsNextView ) |
365 | mWhatsNextView->updateView(); | 365 | mWhatsNextView->updateView(); |
366 | 366 | ||
367 | } | 367 | } |
368 | void KOViewManager::showWhatsNextView() | 368 | void KOViewManager::showWhatsNextView() |
369 | { | 369 | { |
370 | if (!mWhatsNextView) { | 370 | if (!mWhatsNextView) { |
371 | mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), | 371 | mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), |
372 | "KOViewManager::WhatsNextView"); | 372 | "KOViewManager::WhatsNextView"); |
373 | mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); | 373 | mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); |
374 | connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); | 374 | connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); |
375 | addView(mWhatsNextView); | 375 | addView(mWhatsNextView); |
376 | connect(this, SIGNAL( printWNV() ), | 376 | connect(this, SIGNAL( printWNV() ), |
377 | mWhatsNextView, SLOT( printMe() ) ); | 377 | mWhatsNextView, SLOT( printMe() ) ); |
378 | } | 378 | } |
379 | globalFlagBlockAgenda = 1; | 379 | globalFlagBlockAgenda = 1; |
380 | showView(mWhatsNextView, true ); | 380 | showView(mWhatsNextView, true ); |
381 | //mWhatsNextView->updateView(); | 381 | //mWhatsNextView->updateView(); |
382 | 382 | ||
383 | } | 383 | } |
384 | 384 | ||
385 | void KOViewManager::slotprintWNV() | ||
386 | { | ||
387 | if (!mWhatsNextView) | ||
388 | showWhatsNextView(); | ||
389 | emit printWNV(); | ||
390 | |||
391 | } | ||
385 | void KOViewManager::showListView() | 392 | void KOViewManager::showListView() |
386 | { | 393 | { |
387 | if (!mListView) { | 394 | if (!mListView) { |
388 | mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); | 395 | mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); |
389 | addView(mListView); | 396 | addView(mListView); |
390 | 397 | ||
391 | connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), | 398 | connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), |
392 | mMainView, SLOT(showIncidence(Incidence *))); | 399 | mMainView, SLOT(showIncidence(Incidence *))); |
393 | connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), | 400 | connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), |
394 | mMainView, SLOT(editIncidence(Incidence *))); | 401 | mMainView, SLOT(editIncidence(Incidence *))); |
395 | connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), | 402 | connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), |
396 | mMainView, SLOT(deleteIncidence(Incidence *))); | 403 | mMainView, SLOT(deleteIncidence(Incidence *))); |
397 | connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), | 404 | connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), |
398 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 405 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
399 | connect( mListView, SIGNAL( signalNewEvent() ), | 406 | connect( mListView, SIGNAL( signalNewEvent() ), |
400 | mMainView, SLOT( newEvent() ) ); | 407 | mMainView, SLOT( newEvent() ) ); |
401 | connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); | 408 | connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); |
402 | connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), | 409 | connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), |
403 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); | 410 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); |
404 | connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), | 411 | connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), |
405 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); | 412 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); |
406 | connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 413 | connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
407 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 414 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
408 | connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 415 | connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
409 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 416 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
410 | } | 417 | } |
411 | // bool temp = mFlagShowNextxDays; | 418 | // bool temp = mFlagShowNextxDays; |
412 | //globalFlagBlockPainting = true; | 419 | //globalFlagBlockPainting = true; |
413 | globalFlagBlockAgenda = 1; | 420 | globalFlagBlockAgenda = 1; |
414 | if ( KOPrefs::instance()->mListViewMonthTimespan ) { | 421 | if ( KOPrefs::instance()->mListViewMonthTimespan ) { |
415 | mMainView->setBlockShowDates( true ); | 422 | mMainView->setBlockShowDates( true ); |
416 | mMainView->dateNavigator()->selectMonth(); | 423 | mMainView->dateNavigator()->selectMonth(); |
diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h index d829f14..1d565a6 100644 --- a/korganizer/koviewmanager.h +++ b/korganizer/koviewmanager.h | |||
@@ -53,64 +53,65 @@ class KOViewManager : public QObject | |||
53 | 53 | ||
54 | /** changes the view to be the currently selected view */ | 54 | /** changes the view to be the currently selected view */ |
55 | void showView(KOrg::BaseView *, bool fullScreen = false ); | 55 | void showView(KOrg::BaseView *, bool fullScreen = false ); |
56 | void updateWNview(); | 56 | void updateWNview(); |
57 | void readSettings(KConfig *config); | 57 | void readSettings(KConfig *config); |
58 | void writeSettings(KConfig *config); | 58 | void writeSettings(KConfig *config); |
59 | bool showsNextDays(); | 59 | bool showsNextDays(); |
60 | /** Read which view was shown last from config file */ | 60 | /** Read which view was shown last from config file */ |
61 | void readCurrentView(KConfig *); | 61 | void readCurrentView(KConfig *); |
62 | /** Write which view is currently shown to config file */ | 62 | /** Write which view is currently shown to config file */ |
63 | void writeCurrentView(KConfig *); | 63 | void writeCurrentView(KConfig *); |
64 | 64 | ||
65 | KOrg::BaseView *currentView(); | 65 | KOrg::BaseView *currentView(); |
66 | 66 | ||
67 | void setDocumentId( const QString & ); | 67 | void setDocumentId( const QString & ); |
68 | 68 | ||
69 | void updateView( const QDate &start, const QDate &end ); | 69 | void updateView( const QDate &start, const QDate &end ); |
70 | 70 | ||
71 | void raiseCurrentView( bool fullScreen = false , bool updateView = false); | 71 | void raiseCurrentView( bool fullScreen = false , bool updateView = false); |
72 | 72 | ||
73 | void addView(KOrg::BaseView *); | 73 | void addView(KOrg::BaseView *); |
74 | 74 | ||
75 | Incidence *currentSelection(); | 75 | Incidence *currentSelection(); |
76 | QDate currentSelectionDate(); | 76 | QDate currentSelectionDate(); |
77 | 77 | ||
78 | KOAgendaView *agendaView() const { return mAgendaView; } | 78 | KOAgendaView *agendaView() const { return mAgendaView; } |
79 | 79 | ||
80 | signals: | 80 | signals: |
81 | void printWNV(); | 81 | void printWNV(); |
82 | void signalFullScreen( bool ); | 82 | void signalFullScreen( bool ); |
83 | void signalAgendaView( bool ); | 83 | void signalAgendaView( bool ); |
84 | public slots: | 84 | public slots: |
85 | void slotprintWNV(); | ||
85 | void showNextView(); | 86 | void showNextView(); |
86 | void showMonth( const QDate & ); | 87 | void showMonth( const QDate & ); |
87 | void showDateView( int, QDate ); | 88 | void showDateView( int, QDate ); |
88 | void updateView(); | 89 | void updateView(); |
89 | void showWhatsNextView(); | 90 | void showWhatsNextView(); |
90 | void showListView(); | 91 | void showListView(); |
91 | void showAgendaView( bool fullScreen = false ); | 92 | void showAgendaView( bool fullScreen = false ); |
92 | void showDayView(); | 93 | void showDayView(); |
93 | void showWorkWeekView(); | 94 | void showWorkWeekView(); |
94 | void showWeekView(); | 95 | void showWeekView(); |
95 | void showNextXView(); | 96 | void showNextXView(); |
96 | void showMonthView(); | 97 | void showMonthView(); |
97 | void showMonthViewWeek(); | 98 | void showMonthViewWeek(); |
98 | void showTodoView(); | 99 | void showTodoView(); |
99 | void showJournalView(); | 100 | void showJournalView(); |
100 | void showTimeSpanView(); | 101 | void showTimeSpanView(); |
101 | 102 | ||
102 | private: | 103 | private: |
103 | void createMonthView(); | 104 | void createMonthView(); |
104 | CalendarView *mMainView; | 105 | CalendarView *mMainView; |
105 | 106 | ||
106 | int mCurrentAgendaView; | 107 | int mCurrentAgendaView; |
107 | KOAgendaView *mAgendaView; | 108 | KOAgendaView *mAgendaView; |
108 | KOListView *mListView; | 109 | KOListView *mListView; |
109 | KOMonthView *mMonthView; | 110 | KOMonthView *mMonthView; |
110 | KOTodoView *mTodoView; | 111 | KOTodoView *mTodoView; |
111 | KOWhatsNextView *mWhatsNextView; | 112 | KOWhatsNextView *mWhatsNextView; |
112 | KOJournalView *mJournalView; | 113 | KOJournalView *mJournalView; |
113 | KOTimeSpanView *mTimeSpanView; | 114 | KOTimeSpanView *mTimeSpanView; |
114 | 115 | ||
115 | KOrg::BaseView *mCurrentView; // currently active event view | 116 | KOrg::BaseView *mCurrentView; // currently active event view |
116 | 117 | ||
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index a4e0834..ad1c0cd 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -156,65 +156,69 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
156 | } | 156 | } |
157 | else { | 157 | else { |
158 | if ( p->mToolBarUp ) | 158 | if ( p->mToolBarUp ) |
159 | tbd = Right; | 159 | tbd = Right; |
160 | else | 160 | else |
161 | tbd = Left; | 161 | tbd = Left; |
162 | } | 162 | } |
163 | if ( KOPrefs::instance()->mUseAppColors ) | 163 | if ( KOPrefs::instance()->mUseAppColors ) |
164 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 164 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
165 | globalFlagBlockStartup = 1; | 165 | globalFlagBlockStartup = 1; |
166 | iconToolBar = new QPEToolBar( this ); | 166 | iconToolBar = new QPEToolBar( this ); |
167 | addToolBar (iconToolBar , tbd ); | 167 | addToolBar (iconToolBar , tbd ); |
168 | 168 | ||
169 | if ( KOPrefs::instance()->mShowIconFilter ) { | 169 | if ( KOPrefs::instance()->mShowIconFilter ) { |
170 | if ( p->mToolBarHorF ) { | 170 | if ( p->mToolBarHorF ) { |
171 | if ( p->mToolBarUpF ) | 171 | if ( p->mToolBarUpF ) |
172 | tbd = Bottom; | 172 | tbd = Bottom; |
173 | else | 173 | else |
174 | tbd = Top; | 174 | tbd = Top; |
175 | } | 175 | } |
176 | else { | 176 | else { |
177 | if ( p->mToolBarUpF ) | 177 | if ( p->mToolBarUpF ) |
178 | tbd = Right; | 178 | tbd = Right; |
179 | else | 179 | else |
180 | tbd = Left; | 180 | tbd = Left; |
181 | } | 181 | } |
182 | filterToolBar = new QPEToolBar ( this ); | 182 | filterToolBar = new QPEToolBar ( this ); |
183 | filterMenubar = new QPEMenuBar( filterToolBar ); | 183 | filterMenubar = new QPEMenuBar( filterToolBar ); |
184 | QFontMetrics fm ( filterMenubar->font() ); | 184 | QFontMetrics fm ( filterMenubar->font() ); |
185 | 185 | ||
186 | filterPopupMenu = new QPopupMenu( this ); | 186 | filterPopupMenu = new QPopupMenu( this ); |
187 | filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); | 187 | filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); |
188 | filterMenubar->setFixedWidth( fm.width( i18n("No Filter")+"Ax" ) ); | 188 | QString addTest = "Ax"; |
189 | #ifdef DESKTOP_VERSION | ||
190 | addTest = "AAAx"; | ||
191 | #endif | ||
192 | filterMenubar->setFixedWidth( fm.width( i18n("No Filter")+addTest ) ); | ||
189 | addToolBar (filterToolBar , tbd ); | 193 | addToolBar (filterToolBar , tbd ); |
190 | connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); | 194 | connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); |
191 | connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); | 195 | connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); |
192 | } else { | 196 | } else { |
193 | filterToolBar = 0; | 197 | filterToolBar = 0; |
194 | filterMenubar = 0; | 198 | filterMenubar = 0; |
195 | filterPopupMenu = 0; | 199 | filterPopupMenu = 0; |
196 | } | 200 | } |
197 | if ( p->mShowIconOnetoolbar ) { | 201 | if ( p->mShowIconOnetoolbar ) { |
198 | viewToolBar = iconToolBar ; | 202 | viewToolBar = iconToolBar ; |
199 | navigatorToolBar = iconToolBar ; | 203 | navigatorToolBar = iconToolBar ; |
200 | } else { | 204 | } else { |
201 | if ( p->mToolBarHorV ) { | 205 | if ( p->mToolBarHorV ) { |
202 | if ( p->mToolBarUpV ) | 206 | if ( p->mToolBarUpV ) |
203 | tbd = Bottom; | 207 | tbd = Bottom; |
204 | else | 208 | else |
205 | tbd = Top; | 209 | tbd = Top; |
206 | } | 210 | } |
207 | else { | 211 | else { |
208 | if ( p->mToolBarUpV ) | 212 | if ( p->mToolBarUpV ) |
209 | tbd = Right; | 213 | tbd = Right; |
210 | else | 214 | else |
211 | tbd = Left; | 215 | tbd = Left; |
212 | } | 216 | } |
213 | viewToolBar = new QPEToolBar( this ); | 217 | viewToolBar = new QPEToolBar( this ); |
214 | addToolBar (viewToolBar , tbd ); | 218 | addToolBar (viewToolBar , tbd ); |
215 | if ( p->mToolBarHorN ) { | 219 | if ( p->mToolBarHorN ) { |
216 | if ( p->mToolBarUpN ) | 220 | if ( p->mToolBarUpN ) |
217 | tbd = Bottom; | 221 | tbd = Bottom; |
218 | else | 222 | else |
219 | tbd = Top; | 223 | tbd = Top; |
220 | } | 224 | } |
@@ -319,64 +323,65 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
319 | mView->updateConfig(); | 323 | mView->updateConfig(); |
320 | // qApp->processEvents(); | 324 | // qApp->processEvents(); |
321 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 325 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
322 | //fillSyncMenu(); | 326 | //fillSyncMenu(); |
323 | 327 | ||
324 | 328 | ||
325 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); | 329 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); |
326 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); | 330 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); |
327 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); | 331 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); |
328 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); | 332 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); |
329 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); | 333 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); |
330 | mSyncManager->setDefaultFileName( sentSyncFile()); | 334 | mSyncManager->setDefaultFileName( sentSyncFile()); |
331 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); | 335 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); |
332 | mSyncManager->fillSyncMenu(); | 336 | mSyncManager->fillSyncMenu(); |
333 | 337 | ||
334 | 338 | ||
335 | 339 | ||
336 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); | 340 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); |
337 | if ( showWarning ) { | 341 | if ( showWarning ) { |
338 | KMessageBox::information( this, | 342 | KMessageBox::information( this, |
339 | "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); | 343 | "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); |
340 | qApp->processEvents(); | 344 | qApp->processEvents(); |
341 | mView->dialogManager()->showSyncOptions(); | 345 | mView->dialogManager()->showSyncOptions(); |
342 | } | 346 | } |
343 | 347 | ||
344 | //US listen for result adressed from Ka/Pi | 348 | //US listen for result adressed from Ka/Pi |
345 | #ifndef DESKTOP_VERSION | 349 | #ifndef DESKTOP_VERSION |
346 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 350 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
347 | #endif | 351 | #endif |
348 | #ifndef DESKTOP_VERSION | 352 | #ifndef DESKTOP_VERSION |
349 | infrared = 0; | 353 | infrared = 0; |
350 | #endif | 354 | #endif |
355 | updateFilterToolbar(); | ||
351 | updateWeek( mView->startDate() ); | 356 | updateWeek( mView->startDate() ); |
352 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), | 357 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), |
353 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); | 358 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); |
354 | mBRdisabled = false; | 359 | mBRdisabled = false; |
355 | //toggleBeamReceive(); | 360 | //toggleBeamReceive(); |
356 | } | 361 | } |
357 | MainWindow::~MainWindow() | 362 | MainWindow::~MainWindow() |
358 | { | 363 | { |
359 | //qDebug("MainWindow::~MainWindow() "); | 364 | //qDebug("MainWindow::~MainWindow() "); |
360 | //save toolbar location | 365 | //save toolbar location |
361 | delete mCalendar; | 366 | delete mCalendar; |
362 | delete mSyncManager; | 367 | delete mSyncManager; |
363 | #ifndef DESKTOP_VERSION | 368 | #ifndef DESKTOP_VERSION |
364 | if ( infrared ) | 369 | if ( infrared ) |
365 | delete infrared; | 370 | delete infrared; |
366 | #endif | 371 | #endif |
367 | 372 | ||
368 | 373 | ||
369 | } | 374 | } |
370 | 375 | ||
371 | void MainWindow::disableBR(bool b) | 376 | void MainWindow::disableBR(bool b) |
372 | { | 377 | { |
373 | #ifndef DESKTOP_VERSION | 378 | #ifndef DESKTOP_VERSION |
374 | if ( b ) { | 379 | if ( b ) { |
375 | if ( infrared ) { | 380 | if ( infrared ) { |
376 | toggleBeamReceive(); | 381 | toggleBeamReceive(); |
377 | mBRdisabled = true; | 382 | mBRdisabled = true; |
378 | } | 383 | } |
379 | mBRdisabled = true; | 384 | mBRdisabled = true; |
380 | } else { | 385 | } else { |
381 | if ( mBRdisabled ) { | 386 | if ( mBRdisabled ) { |
382 | mBRdisabled = false; | 387 | mBRdisabled = false; |
@@ -963,65 +968,72 @@ void MainWindow::initActions() | |||
963 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, | 968 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, |
964 | this ); | 969 | this ); |
965 | brAction->addTo( beamMenu_X ); | 970 | brAction->addTo( beamMenu_X ); |
966 | brAction->setToggleAction (true ) ; | 971 | brAction->setToggleAction (true ) ; |
967 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); | 972 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); |
968 | 973 | ||
969 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, | 974 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, |
970 | this ); | 975 | this ); |
971 | action->addTo( beamMenu_X ); | 976 | action->addTo( beamMenu_X ); |
972 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); | 977 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); |
973 | 978 | ||
974 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, | 979 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, |
975 | this ); | 980 | this ); |
976 | action->addTo( beamMenu_X ); | 981 | action->addTo( beamMenu_X ); |
977 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); | 982 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); |
978 | importMenu->insertItem( i18n("Beam"), beamMenu_X ); | 983 | importMenu->insertItem( i18n("Beam"), beamMenu_X ); |
979 | #else | 984 | #else |
980 | //importMenu->insertSeparator(); | 985 | //importMenu->insertSeparator(); |
981 | icon = loadPixmap( pathString + "print" ); | 986 | icon = loadPixmap( pathString + "print" ); |
982 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); | 987 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); |
983 | action->addTo( beamMenu_X ); | 988 | action->addTo( beamMenu_X ); |
984 | connect( action, SIGNAL( activated() ), | 989 | connect( action, SIGNAL( activated() ), |
985 | this, SLOT( printCal() ) ); | 990 | this, SLOT( printCal() ) ); |
986 | 991 | ||
987 | icon = loadPixmap( pathString + "print" ); | 992 | icon = loadPixmap( pathString + "print" ); |
988 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); | 993 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); |
989 | action->addTo( beamMenu_X ); | 994 | action->addTo( beamMenu_X ); |
990 | connect( action, SIGNAL( activated() ), | 995 | connect( action, SIGNAL( activated() ), |
991 | this, SLOT( printSel() ) ); | 996 | this, SLOT( printSel() ) ); |
992 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); | 997 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); |
993 | action->addTo( beamMenu_X ); | 998 | action->addTo( beamMenu_X ); |
994 | connect( action, SIGNAL( activated() ), | 999 | connect( action, SIGNAL( activated() ), |
995 | mView->viewManager(), SIGNAL( printWNV() ) ); | 1000 | mView->viewManager(), SLOT( slotprintWNV() ) ); |
1001 | |||
1002 | action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); | ||
1003 | action->addTo( beamMenu_X ); | ||
1004 | connect( action, SIGNAL( activated() ), | ||
1005 | mView, SLOT( slotprintSelInc() ) ); | ||
1006 | |||
1007 | |||
996 | importMenu->insertItem( i18n("Print"), beamMenu_X ); | 1008 | importMenu->insertItem( i18n("Print"), beamMenu_X ); |
997 | #endif | 1009 | #endif |
998 | importMenu->insertSeparator(); | 1010 | importMenu->insertSeparator(); |
999 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, | 1011 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, |
1000 | this ); | 1012 | this ); |
1001 | action->addTo( importMenu ); | 1013 | action->addTo( importMenu ); |
1002 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); | 1014 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); |
1003 | importMenu->insertSeparator(); | 1015 | importMenu->insertSeparator(); |
1004 | action = new QAction( "beam all", i18n("Save"), 0, | 1016 | action = new QAction( "beam all", i18n("Save"), 0, |
1005 | this ); | 1017 | this ); |
1006 | action->addTo( importMenu ); | 1018 | action->addTo( importMenu ); |
1007 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); | 1019 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); |
1008 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, | 1020 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, |
1009 | this ); | 1021 | this ); |
1010 | action->addTo( importMenu ); | 1022 | action->addTo( importMenu ); |
1011 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); | 1023 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); |
1012 | 1024 | ||
1013 | //menuBar->insertItem( "Configure",configureMenu ); | 1025 | //menuBar->insertItem( "Configure",configureMenu ); |
1014 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); | 1026 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); |
1015 | icon = loadPixmap( "korganizer/korganizer" ); | 1027 | icon = loadPixmap( "korganizer/korganizer" ); |
1016 | 1028 | ||
1017 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); | 1029 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); |
1018 | action->addTo( helpMenu ); | 1030 | action->addTo( helpMenu ); |
1019 | connect( action, SIGNAL( activated() ), | 1031 | connect( action, SIGNAL( activated() ), |
1020 | SLOT( whatsNew() ) ); | 1032 | SLOT( whatsNew() ) ); |
1021 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); | 1033 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); |
1022 | action->addTo( helpMenu ); | 1034 | action->addTo( helpMenu ); |
1023 | connect( action, SIGNAL( activated() ), | 1035 | connect( action, SIGNAL( activated() ), |
1024 | SLOT( features() ) ); | 1036 | SLOT( features() ) ); |
1025 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); | 1037 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); |
1026 | action->addTo( helpMenu ); | 1038 | action->addTo( helpMenu ); |
1027 | connect( action, SIGNAL( activated() ), | 1039 | connect( action, SIGNAL( activated() ), |
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index 49149f2..0610d55 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp | |||
@@ -84,109 +84,110 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam | |||
84 | // Create forward navigation buttons | 84 | // Create forward navigation buttons |
85 | mNextMonth = new QPushButton( mCtrlFrame ); | 85 | mNextMonth = new QPushButton( mCtrlFrame ); |
86 | mNextMonth->setPixmap( SmallIcon( isDesktop ? "2rightarrowB" : "2rightarrow") ); | 86 | mNextMonth->setPixmap( SmallIcon( isDesktop ? "2rightarrowB" : "2rightarrow") ); |
87 | QToolTip::add( mNextMonth, i18n("Next Month") ); | 87 | QToolTip::add( mNextMonth, i18n("Next Month") ); |
88 | 88 | ||
89 | mPrevWeek = new QPushButton( mCtrlFrame ); | 89 | mPrevWeek = new QPushButton( mCtrlFrame ); |
90 | mPrevWeek->setPixmap( SmallIcon( isDesktop ? "1leftarrowB" : "1leftarrow") ); | 90 | mPrevWeek->setPixmap( SmallIcon( isDesktop ? "1leftarrowB" : "1leftarrow") ); |
91 | QToolTip::add( mPrevWeek, i18n("Previous Week") ); | 91 | QToolTip::add( mPrevWeek, i18n("Previous Week") ); |
92 | 92 | ||
93 | // Create forward navigation buttons | 93 | // Create forward navigation buttons |
94 | mNextWeek = new QPushButton( mCtrlFrame ); | 94 | mNextWeek = new QPushButton( mCtrlFrame ); |
95 | mNextWeek->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") ); | 95 | mNextWeek->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") ); |
96 | QToolTip::add( mNextWeek, i18n("Next Week") ); | 96 | QToolTip::add( mNextWeek, i18n("Next Week") ); |
97 | 97 | ||
98 | mNextYear = new QPushButton( mCtrlFrame ); | 98 | mNextYear = new QPushButton( mCtrlFrame ); |
99 | mNextYear->setPixmap( SmallIcon( isDesktop ? "3rightarrowB": "3rightarrow") ); | 99 | mNextYear->setPixmap( SmallIcon( isDesktop ? "3rightarrowB": "3rightarrow") ); |
100 | QToolTip::add( mNextYear, i18n("Next Year") ); | 100 | QToolTip::add( mNextYear, i18n("Next Year") ); |
101 | mSelectMonth = new QPushButton( mCtrlFrame ); | 101 | mSelectMonth = new QPushButton( mCtrlFrame ); |
102 | // Create month name label | 102 | // Create month name label |
103 | //selectMonth->setFont( tfont ); | 103 | //selectMonth->setFont( tfont ); |
104 | // selectMonth->setAlignment( AlignCenter ); | 104 | // selectMonth->setAlignment( AlignCenter ); |
105 | //mDateLabel = new QLabel( selectMonth ); | 105 | //mDateLabel = new QLabel( selectMonth ); |
106 | //mDateLabel->setFont( tfont ); | 106 | //mDateLabel->setFont( tfont ); |
107 | //mDateLabel->setAlignment( AlignCenter ); | 107 | //mDateLabel->setAlignment( AlignCenter ); |
108 | if ( QString ( name ) == QString("useBigPixmaps") ) { | 108 | if ( QString ( name ) == QString("useBigPixmaps") ) { |
109 | mNextMonth->setFlat( true); | 109 | mNextMonth->setFlat( true); |
110 | mNextWeek->setFlat( true); | 110 | mNextWeek->setFlat( true); |
111 | mNextYear->setFlat( true); | 111 | mNextYear->setFlat( true); |
112 | mSelectMonth->setFlat( true); | 112 | mSelectMonth->setFlat( true); |
113 | mPrevYear->setFlat( true); | 113 | mPrevYear->setFlat( true); |
114 | mPrevMonth->setFlat( true); | 114 | mPrevMonth->setFlat( true); |
115 | mPrevWeek->setFlat( true); | 115 | mPrevWeek->setFlat( true); |
116 | |||
117 | mPrevYear->setAutoRepeat( true ); | ||
118 | mPrevMonth->setAutoRepeat( true ); | ||
119 | mNextMonth->setAutoRepeat( true ); | ||
120 | mPrevWeek->setAutoRepeat( true ); | ||
121 | mNextWeek->setAutoRepeat( true ); | ||
122 | mNextYear->setAutoRepeat( true ); | ||
116 | } else { | 123 | } else { |
117 | mPrevWeek->hide(); | 124 | mPrevWeek->hide(); |
118 | mNextWeek->hide(); | 125 | mNextWeek->hide(); |
119 | } | 126 | } |
120 | 127 | ||
121 | resetFont( font() ); | 128 | resetFont( font() ); |
122 | 129 | ||
123 | 130 | ||
124 | // set up control frame layout | 131 | // set up control frame layout |
125 | QBoxLayout *ctrlLayout = new QHBoxLayout( mCtrlFrame, 1 ); | 132 | QBoxLayout *ctrlLayout = new QHBoxLayout( mCtrlFrame, 1 ); |
126 | ctrlLayout->addWidget( mPrevYear, 3 ); | 133 | ctrlLayout->addWidget( mPrevYear, 3 ); |
127 | ctrlLayout->addWidget( mPrevMonth, 3 ); | 134 | ctrlLayout->addWidget( mPrevMonth, 3 ); |
128 | ctrlLayout->addWidget( mPrevWeek, 3 ); | 135 | ctrlLayout->addWidget( mPrevWeek, 3 ); |
129 | //ctrlLayout->addStretch( 1 ); | 136 | //ctrlLayout->addStretch( 1 ); |
130 | // ctrlLayout->addSpacing( 1 ); | 137 | // ctrlLayout->addSpacing( 1 ); |
131 | // ctrlLayout->addWidget( mDateLabel ); | 138 | // ctrlLayout->addWidget( mDateLabel ); |
132 | ctrlLayout->addWidget( mSelectMonth ); | 139 | ctrlLayout->addWidget( mSelectMonth ); |
133 | // ctrlLayout->addSpacing( 1 ); | 140 | // ctrlLayout->addSpacing( 1 ); |
134 | // ctrlLayout->addStretch( 1 ); | 141 | // ctrlLayout->addStretch( 1 ); |
135 | ctrlLayout->addWidget( mNextWeek, 3 ); | 142 | ctrlLayout->addWidget( mNextWeek, 3 ); |
136 | ctrlLayout->addWidget( mNextMonth, 3 ); | 143 | ctrlLayout->addWidget( mNextMonth, 3 ); |
137 | ctrlLayout->addWidget( mNextYear, 3 ); | 144 | ctrlLayout->addWidget( mNextYear, 3 ); |
138 | 145 | ||
139 | connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) ); | 146 | connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) ); |
140 | connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) ); | 147 | connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) ); |
141 | connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) ); | 148 | connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) ); |
142 | connect( mPrevWeek, SIGNAL( clicked() ), SIGNAL( goPrevWeek() ) ); | 149 | connect( mPrevWeek, SIGNAL( clicked() ), SIGNAL( goPrevWeek() ) ); |
143 | connect( mNextWeek, SIGNAL( clicked() ), SIGNAL( goNextWeek() ) ); | 150 | connect( mNextWeek, SIGNAL( clicked() ), SIGNAL( goNextWeek() ) ); |
144 | connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) ); | 151 | connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) ); |
145 | connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) ); | 152 | connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) ); |
146 | mPrevYear->setFocusPolicy(NoFocus); | 153 | mPrevYear->setFocusPolicy(NoFocus); |
147 | mPrevMonth->setFocusPolicy(NoFocus); | 154 | mPrevMonth->setFocusPolicy(NoFocus); |
148 | mNextMonth->setFocusPolicy(NoFocus); | 155 | mNextMonth->setFocusPolicy(NoFocus); |
149 | mPrevWeek->setFocusPolicy(NoFocus); | 156 | mPrevWeek->setFocusPolicy(NoFocus); |
150 | mNextWeek->setFocusPolicy(NoFocus); | 157 | mNextWeek->setFocusPolicy(NoFocus); |
151 | mNextYear->setFocusPolicy(NoFocus); | 158 | mNextYear->setFocusPolicy(NoFocus); |
152 | mSelectMonth->setFocusPolicy(NoFocus); | 159 | mSelectMonth->setFocusPolicy(NoFocus); |
153 | setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); | 160 | setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); |
154 | mPrevYear->setAutoRepeat( true ); | 161 | |
155 | mPrevMonth->setAutoRepeat( true ); | ||
156 | mNextMonth->setAutoRepeat( true ); | ||
157 | mPrevWeek->setAutoRepeat( true ); | ||
158 | mNextWeek->setAutoRepeat( true ); | ||
159 | mNextYear->setAutoRepeat( true ); | ||
160 | |||
161 | } | 162 | } |
162 | 163 | ||
163 | NavigatorBar::~NavigatorBar() | 164 | NavigatorBar::~NavigatorBar() |
164 | { | 165 | { |
165 | } | 166 | } |
166 | QSize NavigatorBar::sizeHint() const | 167 | QSize NavigatorBar::sizeHint() const |
167 | { | 168 | { |
168 | int wid = mCurrentMinWid ; | 169 | int wid = mCurrentMinWid ; |
169 | if ( mPrevYear->isVisible() ) | 170 | if ( mPrevYear->isVisible() ) |
170 | wid += mCurrentButtonMinWid; | 171 | wid += mCurrentButtonMinWid; |
171 | if ( mPrevMonth->isVisible() ) | 172 | if ( mPrevMonth->isVisible() ) |
172 | wid += mCurrentButtonMinWid; | 173 | wid += mCurrentButtonMinWid; |
173 | if ( mPrevWeek->isVisible() ) | 174 | if ( mPrevWeek->isVisible() ) |
174 | wid += mCurrentButtonMinWid; | 175 | wid += mCurrentButtonMinWid; |
175 | if ( mNextMonth->isVisible() ) | 176 | if ( mNextMonth->isVisible() ) |
176 | wid += mCurrentButtonMinWid; | 177 | wid += mCurrentButtonMinWid; |
177 | if ( mNextWeek->isVisible() ) | 178 | if ( mNextWeek->isVisible() ) |
178 | wid += mCurrentButtonMinWid; | 179 | wid += mCurrentButtonMinWid; |
179 | if ( mNextYear->isVisible() ) | 180 | if ( mNextYear->isVisible() ) |
180 | wid += mCurrentButtonMinWid; | 181 | wid += mCurrentButtonMinWid; |
181 | //qDebug("ret %d %d ", wid, mCurrentHei); | 182 | //qDebug("ret %d %d ", wid, mCurrentHei); |
182 | return QSize ( wid, mCurrentHei ); | 183 | return QSize ( wid, mCurrentHei ); |
183 | } | 184 | } |
184 | QSize NavigatorBar::sizeHintTwoButtons( int butNum ) const | 185 | QSize NavigatorBar::sizeHintTwoButtons( int butNum ) const |
185 | { | 186 | { |
186 | return QSize ( mCurrentMinWid + butNum * mCurrentButtonMinWid , mCurrentHei ); | 187 | return QSize ( mCurrentMinWid + butNum * mCurrentButtonMinWid , mCurrentHei ); |
187 | } | 188 | } |
188 | void NavigatorBar::resetFont ( QFont fo ) | 189 | void NavigatorBar::resetFont ( QFont fo ) |
189 | { | 190 | { |
190 | 191 | ||
191 | QFont tfont = fo; | 192 | QFont tfont = fo; |
192 | if ( QApplication::desktop()->width() >= 480 ) | 193 | if ( QApplication::desktop()->width() >= 480 ) |