author | zautrix <zautrix> | 2005-08-23 21:48:53 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-08-23 21:48:53 (UTC) |
commit | 2acca9aff5bd651923b5d728712a0fd80b3d54e9 (patch) (unidiff) | |
tree | c2113d441908520d86902a8a9fade08eb05ee0d0 /korganizer | |
parent | 6f5464760f5fb1e4c13027464cfe4943b85d29a0 (diff) | |
download | kdepimpi-2acca9aff5bd651923b5d728712a0fd80b3d54e9.zip kdepimpi-2acca9aff5bd651923b5d728712a0fd80b3d54e9.tar.gz kdepimpi-2acca9aff5bd651923b5d728712a0fd80b3d54e9.tar.bz2 |
fastload fixes
-rw-r--r-- | korganizer/mainwindow.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 8c72d89..70baf5c 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -1,1389 +1,1390 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | 2 | ||
3 | #include <qaction.h> | 3 | #include <qaction.h> |
4 | #include <qpopupmenu.h> | 4 | #include <qpopupmenu.h> |
5 | #include <qpainter.h> | 5 | #include <qpainter.h> |
6 | #include <qwhatsthis.h> | 6 | #include <qwhatsthis.h> |
7 | #include <qpushbutton.h> | 7 | #include <qpushbutton.h> |
8 | #include <qmessagebox.h> | 8 | #include <qmessagebox.h> |
9 | #include <qlineedit.h> | 9 | #include <qlineedit.h> |
10 | #include <qtextcodec.h> | 10 | #include <qtextcodec.h> |
11 | #include <qfile.h> | 11 | #include <qfile.h> |
12 | #include <qdir.h> | 12 | #include <qdir.h> |
13 | #include <qapp.h> | 13 | #include <qapp.h> |
14 | #include <qfileinfo.h> | 14 | #include <qfileinfo.h> |
15 | #include <qlabel.h> | 15 | #include <qlabel.h> |
16 | #include <qspinbox.h> | 16 | #include <qspinbox.h> |
17 | #include <qcheckbox.h> | 17 | #include <qcheckbox.h> |
18 | #include <qmap.h> | 18 | #include <qmap.h> |
19 | #include <qwmatrix.h> | 19 | #include <qwmatrix.h> |
20 | #include <qtextbrowser.h> | 20 | #include <qtextbrowser.h> |
21 | #include <qtextstream.h> | 21 | #include <qtextstream.h> |
22 | #ifndef DESKTOP_VERSION | 22 | #ifndef DESKTOP_VERSION |
23 | #include <qpe/global.h> | 23 | #include <qpe/global.h> |
24 | #include <qpe/qpetoolbar.h> | 24 | #include <qpe/qpetoolbar.h> |
25 | #include <qpe/resource.h> | 25 | #include <qpe/resource.h> |
26 | #include <qpe/qpeapplication.h> | 26 | #include <qpe/qpeapplication.h> |
27 | #include <qtopia/alarmserver.h> | 27 | #include <qtopia/alarmserver.h> |
28 | #include <qtopia/qcopenvelope_qws.h> | 28 | #include <qtopia/qcopenvelope_qws.h> |
29 | #include <unistd.h> // for sleep | 29 | #include <unistd.h> // for sleep |
30 | #else | 30 | #else |
31 | #include <qtoolbar.h> | 31 | #include <qtoolbar.h> |
32 | #include <qapplication.h> | 32 | #include <qapplication.h> |
33 | //#include <resource.h> | 33 | //#include <resource.h> |
34 | 34 | ||
35 | #endif | 35 | #endif |
36 | #include <libkcal/calendarlocal.h> | 36 | #include <libkcal/calendarlocal.h> |
37 | #include <libkcal/todo.h> | 37 | #include <libkcal/todo.h> |
38 | #include <libkcal/phoneformat.h> | 38 | #include <libkcal/phoneformat.h> |
39 | #include <libkdepim/ksyncprofile.h> | 39 | #include <libkdepim/ksyncprofile.h> |
40 | #include <libkdepim/phoneaccess.h> | 40 | #include <libkdepim/phoneaccess.h> |
41 | #include <libkcal/kincidenceformatter.h> | 41 | #include <libkcal/kincidenceformatter.h> |
42 | #include <libkdepim/kpimglobalprefs.h> | 42 | #include <libkdepim/kpimglobalprefs.h> |
43 | 43 | ||
44 | #include "calendarview.h" | 44 | #include "calendarview.h" |
45 | #include "koviewmanager.h" | 45 | #include "koviewmanager.h" |
46 | #include "datenavigator.h" | 46 | #include "datenavigator.h" |
47 | #include "koagendaview.h" | 47 | #include "koagendaview.h" |
48 | #include "kojournalview.h" | 48 | #include "kojournalview.h" |
49 | #include "koagenda.h" | 49 | #include "koagenda.h" |
50 | #include "kodialogmanager.h" | 50 | #include "kodialogmanager.h" |
51 | #include "kdialogbase.h" | 51 | #include "kdialogbase.h" |
52 | #include "kapplication.h" | 52 | #include "kapplication.h" |
53 | #include "kofilterview.h" | 53 | #include "kofilterview.h" |
54 | #include "kstandarddirs.h" | 54 | #include "kstandarddirs.h" |
55 | #include "koprefs.h" | 55 | #include "koprefs.h" |
56 | #include "kfiledialog.h" | 56 | #include "kfiledialog.h" |
57 | #include "koglobals.h" | 57 | #include "koglobals.h" |
58 | #include "kglobal.h" | 58 | #include "kglobal.h" |
59 | #include "ktoolbar.h" | 59 | #include "ktoolbar.h" |
60 | #include "klocale.h" | 60 | #include "klocale.h" |
61 | #include "kconfig.h" | 61 | #include "kconfig.h" |
62 | #include "externalapphandler.h" | 62 | #include "externalapphandler.h" |
63 | #include <kglobalsettings.h> | 63 | #include <kglobalsettings.h> |
64 | 64 | ||
65 | using namespace KCal; | 65 | using namespace KCal; |
66 | #ifndef _WIN32_ | 66 | #ifndef _WIN32_ |
67 | #include <unistd.h> | 67 | #include <unistd.h> |
68 | #else | 68 | #else |
69 | #ifdef _OL_IMPORT_ | 69 | #ifdef _OL_IMPORT_ |
70 | #include "koimportoldialog.h" | 70 | #include "koimportoldialog.h" |
71 | #endif | 71 | #endif |
72 | #endif | 72 | #endif |
73 | #include "mainwindow.h" | 73 | #include "mainwindow.h" |
74 | 74 | ||
75 | 75 | ||
76 | class KOex2phonePrefs : public QDialog | 76 | class KOex2phonePrefs : public QDialog |
77 | { | 77 | { |
78 | public: | 78 | public: |
79 | KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : | 79 | KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : |
80 | QDialog( parent, name, true ) | 80 | QDialog( parent, name, true ) |
81 | { | 81 | { |
82 | setCaption( i18n("Export to phone options") ); | 82 | setCaption( i18n("Export to phone options") ); |
83 | QVBoxLayout* lay = new QVBoxLayout( this ); | 83 | QVBoxLayout* lay = new QVBoxLayout( this ); |
84 | lay->setSpacing( 3 ); | 84 | lay->setSpacing( 3 ); |
85 | lay->setMargin( 3 ); | 85 | lay->setMargin( 3 ); |
86 | QLabel *lab; | 86 | QLabel *lab; |
87 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); | 87 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); |
88 | lab->setAlignment (AlignHCenter ); | 88 | lab->setAlignment (AlignHCenter ); |
89 | QHBox* temphb; | 89 | QHBox* temphb; |
90 | temphb = new QHBox( this ); | 90 | temphb = new QHBox( this ); |
91 | new QLabel( i18n("I/O device: "), temphb ); | 91 | new QLabel( i18n("I/O device: "), temphb ); |
92 | mPhoneDevice = new QLineEdit( temphb); | 92 | mPhoneDevice = new QLineEdit( temphb); |
93 | lay->addWidget( temphb ); | 93 | lay->addWidget( temphb ); |
94 | temphb = new QHBox( this ); | 94 | temphb = new QHBox( this ); |
95 | new QLabel( i18n("Connection: "), temphb ); | 95 | new QLabel( i18n("Connection: "), temphb ); |
96 | mPhoneConnection = new QLineEdit( temphb); | 96 | mPhoneConnection = new QLineEdit( temphb); |
97 | lay->addWidget( temphb ); | 97 | lay->addWidget( temphb ); |
98 | temphb = new QHBox( this ); | 98 | temphb = new QHBox( this ); |
99 | new QLabel( i18n("Model(opt.): "), temphb ); | 99 | new QLabel( i18n("Model(opt.): "), temphb ); |
100 | mPhoneModel = new QLineEdit( temphb); | 100 | mPhoneModel = new QLineEdit( temphb); |
101 | lay->addWidget( temphb ); | 101 | lay->addWidget( temphb ); |
102 | mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); | 102 | mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); |
103 | mWriteBackFuture->setChecked( true ); | 103 | mWriteBackFuture->setChecked( true ); |
104 | lay->addWidget( mWriteBackFuture ); | 104 | lay->addWidget( mWriteBackFuture ); |
105 | temphb = new QHBox( this ); | 105 | temphb = new QHBox( this ); |
106 | new QLabel( i18n("Max. weeks in future: ") , temphb ); | 106 | new QLabel( i18n("Max. weeks in future: ") , temphb ); |
107 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); | 107 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); |
108 | mWriteBackFutureWeeks->setValue( 8 ); | 108 | mWriteBackFutureWeeks->setValue( 8 ); |
109 | lay->addWidget( temphb ); | 109 | lay->addWidget( temphb ); |
110 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); | 110 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); |
111 | lab->setAlignment (AlignHCenter ); | 111 | lab->setAlignment (AlignHCenter ); |
112 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); | 112 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); |
113 | lay->addWidget( ok ); | 113 | lay->addWidget( ok ); |
114 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 114 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
115 | lay->addWidget( cancel ); | 115 | lay->addWidget( cancel ); |
116 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 116 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
117 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 117 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
118 | resize( 220, 240 ); | 118 | resize( 220, 240 ); |
119 | qApp->processEvents(); | 119 | qApp->processEvents(); |
120 | int dw = QApplication::desktop()->width(); | 120 | int dw = QApplication::desktop()->width(); |
121 | int dh = QApplication::desktop()->height(); | 121 | int dh = QApplication::desktop()->height(); |
122 | move( (dw-width())/2, (dh - height() )/2 ); | 122 | move( (dw-width())/2, (dh - height() )/2 ); |
123 | } | 123 | } |
124 | 124 | ||
125 | public: | 125 | public: |
126 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; | 126 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; |
127 | QCheckBox* mWriteBackFuture; | 127 | QCheckBox* mWriteBackFuture; |
128 | QSpinBox* mWriteBackFutureWeeks; | 128 | QSpinBox* mWriteBackFutureWeeks; |
129 | }; | 129 | }; |
130 | 130 | ||
131 | QPixmap* sgListViewCompletedPix[6]; | 131 | QPixmap* sgListViewCompletedPix[6]; |
132 | QPixmap* sgListViewJournalPix; | 132 | QPixmap* sgListViewJournalPix; |
133 | 133 | ||
134 | 134 | ||
135 | int globalFlagBlockStartup; | 135 | int globalFlagBlockStartup; |
136 | MainWindow::MainWindow( QWidget *parent, const char *name ) : | 136 | MainWindow::MainWindow( QWidget *parent, const char *name ) : |
137 | QMainWindow( parent, name ) | 137 | QMainWindow( parent, name ) |
138 | { | 138 | { |
139 | sgListViewCompletedPix[5] = &listviewPix; | 139 | sgListViewCompletedPix[5] = &listviewPix; |
140 | sgListViewCompletedPix[0] = &listviewPix0; | 140 | sgListViewCompletedPix[0] = &listviewPix0; |
141 | sgListViewCompletedPix[1] = &listviewPix20; | 141 | sgListViewCompletedPix[1] = &listviewPix20; |
142 | sgListViewCompletedPix[2] = &listviewPix40; | 142 | sgListViewCompletedPix[2] = &listviewPix40; |
143 | sgListViewCompletedPix[3] = &listviewPix60; | 143 | sgListViewCompletedPix[3] = &listviewPix60; |
144 | sgListViewCompletedPix[4] = &listviewPix80; | 144 | sgListViewCompletedPix[4] = &listviewPix80; |
145 | //int size = 12; | 145 | //int size = 12; |
146 | { | 146 | { |
147 | sgListViewCompletedPix[5]->resize( 11, 11 ); | 147 | sgListViewCompletedPix[5]->resize( 11, 11 ); |
148 | sgListViewCompletedPix[5]->fill( Qt::white ); | 148 | sgListViewCompletedPix[5]->fill( Qt::white ); |
149 | QPainter p ( sgListViewCompletedPix[5] ); | 149 | QPainter p ( sgListViewCompletedPix[5] ); |
150 | p.drawRect( 0,0,11,11); | 150 | p.drawRect( 0,0,11,11); |
151 | p.drawLine ( 2, 5, 4 , 7 ) ; | 151 | p.drawLine ( 2, 5, 4 , 7 ) ; |
152 | p.drawLine ( 4 , 7 , 8, 3) ; | 152 | p.drawLine ( 4 , 7 , 8, 3) ; |
153 | int iii = 0; | 153 | int iii = 0; |
154 | for ( iii = 0; iii < 5; ++iii ) { | 154 | for ( iii = 0; iii < 5; ++iii ) { |
155 | sgListViewCompletedPix[iii]->resize( 11, 11 ); | 155 | sgListViewCompletedPix[iii]->resize( 11, 11 ); |
156 | sgListViewCompletedPix[iii]->fill( Qt::white ); | 156 | sgListViewCompletedPix[iii]->fill( Qt::white ); |
157 | QPainter p ( sgListViewCompletedPix[iii] ); | 157 | QPainter p ( sgListViewCompletedPix[iii] ); |
158 | p.drawRect( 0,0,11,11); | 158 | p.drawRect( 0,0,11,11); |
159 | if ( iii ) | 159 | if ( iii ) |
160 | p.fillRect( 1,1,iii*2,9,Qt::gray ); | 160 | p.fillRect( 1,1,iii*2,9,Qt::gray ); |
161 | } | 161 | } |
162 | sgListViewJournalPix = &journalPix; | 162 | sgListViewJournalPix = &journalPix; |
163 | sgListViewJournalPix->resize( 11, 11 ); | 163 | sgListViewJournalPix->resize( 11, 11 ); |
164 | sgListViewJournalPix->fill( Qt::white ); | 164 | sgListViewJournalPix->fill( Qt::white ); |
165 | { | 165 | { |
166 | QPainter p ( sgListViewJournalPix ); | 166 | QPainter p ( sgListViewJournalPix ); |
167 | p.drawRect( 0,0,11,11); | 167 | p.drawRect( 0,0,11,11); |
168 | p.drawLine( 2,3,5,3); | 168 | p.drawLine( 2,3,5,3); |
169 | p.drawLine( 2,5,8,5); | 169 | p.drawLine( 2,5,8,5); |
170 | p.drawLine( 2,7,6,7); | 170 | p.drawLine( 2,7,6,7); |
171 | } | 171 | } |
172 | } | 172 | } |
173 | mClosed = false; | 173 | mClosed = false; |
174 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; | 174 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; |
175 | QString confFile = locateLocal("config","korganizerrc"); | 175 | QString confFile = locateLocal("config","korganizerrc"); |
176 | QFileInfo finf ( confFile ); | 176 | QFileInfo finf ( confFile ); |
177 | bool showWarning = !finf.exists(); | 177 | bool showWarning = !finf.exists(); |
178 | setIcon(SmallIcon( "ko24" ) ); | 178 | setIcon(SmallIcon( "ko24" ) ); |
179 | mBlockAtStartup = true; | 179 | mBlockAtStartup = true; |
180 | mFlagKeyPressed = false; | 180 | mFlagKeyPressed = false; |
181 | setCaption("KO/Pi"); | 181 | setCaption("KO/Pi"); |
182 | KOPrefs *p = KOPrefs::instance(); | 182 | KOPrefs *p = KOPrefs::instance(); |
183 | //KPimGlobalPrefs::instance()->setGlobalConfig(); | 183 | //KPimGlobalPrefs::instance()->setGlobalConfig(); |
184 | p->mCurrentDisplayedView = 0; | 184 | p->mCurrentDisplayedView = 0; |
185 | if ( p->mHourSize > 22 ) | 185 | if ( p->mHourSize > 22 ) |
186 | p->mHourSize = 22; | 186 | p->mHourSize = 22; |
187 | QMainWindow::ToolBarDock tbd; | 187 | QMainWindow::ToolBarDock tbd; |
188 | if ( p->mToolBarHor ) { | 188 | if ( p->mToolBarHor ) { |
189 | if ( p->mToolBarUp ) | 189 | if ( p->mToolBarUp ) |
190 | tbd = Bottom; | 190 | tbd = Bottom; |
191 | else | 191 | else |
192 | tbd = Top; | 192 | tbd = Top; |
193 | } | 193 | } |
194 | else { | 194 | else { |
195 | if ( p->mToolBarUp ) | 195 | if ( p->mToolBarUp ) |
196 | tbd = Right; | 196 | tbd = Right; |
197 | else | 197 | else |
198 | tbd = Left; | 198 | tbd = Left; |
199 | } | 199 | } |
200 | if ( KOPrefs::instance()->mUseAppColors ) | 200 | if ( KOPrefs::instance()->mUseAppColors ) |
201 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 201 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
202 | globalFlagBlockStartup = 1; | 202 | globalFlagBlockStartup = 1; |
203 | iconToolBar = new QPEToolBar( this ); | 203 | iconToolBar = new QPEToolBar( this ); |
204 | addToolBar (iconToolBar , tbd ); | 204 | addToolBar (iconToolBar , tbd ); |
205 | 205 | ||
206 | #ifdef DESKTOP_VERSION | 206 | #ifdef DESKTOP_VERSION |
207 | if ( KOPrefs::instance()->mShowIconFilter ) | 207 | if ( KOPrefs::instance()->mShowIconFilter ) |
208 | #else | 208 | #else |
209 | if ( KOPrefs::instance()->mShowIconFilter || ( !p->mShowIconOnetoolbar &&!p->mShowIconFilterview ) ) | 209 | if ( KOPrefs::instance()->mShowIconFilter || ( !p->mShowIconOnetoolbar &&!p->mShowIconFilterview ) ) |
210 | #endif | 210 | #endif |
211 | 211 | ||
212 | { | 212 | { |
213 | if ( p->mToolBarHorF ) { | 213 | if ( p->mToolBarHorF ) { |
214 | if ( p->mToolBarUpF ) | 214 | if ( p->mToolBarUpF ) |
215 | tbd = Bottom; | 215 | tbd = Bottom; |
216 | else | 216 | else |
217 | tbd = Top; | 217 | tbd = Top; |
218 | } | 218 | } |
219 | else { | 219 | else { |
220 | if ( p->mToolBarUpF ) | 220 | if ( p->mToolBarUpF ) |
221 | tbd = Right; | 221 | tbd = Right; |
222 | else | 222 | else |
223 | tbd = Left; | 223 | tbd = Left; |
224 | } | 224 | } |
225 | filterToolBar = new QPEToolBar ( this ); | 225 | filterToolBar = new QPEToolBar ( this ); |
226 | filterMenubar = new KMenuBar( 0 ); | 226 | filterMenubar = new KMenuBar( 0 ); |
227 | QFontMetrics fm ( filterMenubar->font() ); | 227 | QFontMetrics fm ( filterMenubar->font() ); |
228 | #ifndef DESKTOP_VERSION | 228 | #ifndef DESKTOP_VERSION |
229 | filterToolBar->setFocusPolicy( NoFocus ); | 229 | filterToolBar->setFocusPolicy( NoFocus ); |
230 | filterMenubar->setFocusPolicy( NoFocus ); | 230 | filterMenubar->setFocusPolicy( NoFocus ); |
231 | #endif | 231 | #endif |
232 | filterPopupMenu = new QPopupMenu( this ); | 232 | filterPopupMenu = new QPopupMenu( this ); |
233 | filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); | 233 | filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); |
234 | QString addTest = "A"; | 234 | QString addTest = "A"; |
235 | filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); | 235 | filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); |
236 | #ifdef DESKTOP_VERSION | 236 | #ifdef DESKTOP_VERSION |
237 | addTest = "AAAAAABBBCCCx"; | 237 | addTest = "AAAAAABBBCCCx"; |
238 | #else | 238 | #else |
239 | addTest = "AAAAAx"; | 239 | addTest = "AAAAAx"; |
240 | #endif | 240 | #endif |
241 | filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) ); | 241 | filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) ); |
242 | addToolBar (filterToolBar , tbd ); | 242 | addToolBar (filterToolBar , tbd ); |
243 | connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); | 243 | connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); |
244 | connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); | 244 | connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); |
245 | if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) | 245 | if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) |
246 | filterToolBar->hide(); | 246 | filterToolBar->hide(); |
247 | } else { | 247 | } else { |
248 | filterToolBar = 0; | 248 | filterToolBar = 0; |
249 | filterMenubar = 0; | 249 | filterMenubar = 0; |
250 | filterPopupMenu = 0; | 250 | filterPopupMenu = 0; |
251 | } | 251 | } |
252 | if ( p->mShowIconOnetoolbar ) { | 252 | if ( p->mShowIconOnetoolbar ) { |
253 | viewToolBar = iconToolBar ; | 253 | viewToolBar = iconToolBar ; |
254 | navigatorToolBar = iconToolBar ; | 254 | navigatorToolBar = iconToolBar ; |
255 | } else { | 255 | } else { |
256 | #ifndef DESKTOP_VERSION | 256 | #ifndef DESKTOP_VERSION |
257 | setToolBarsMovable( false ); | 257 | setToolBarsMovable( false ); |
258 | #endif | 258 | #endif |
259 | if ( p->mToolBarHorV ) { | 259 | if ( p->mToolBarHorV ) { |
260 | if ( p->mToolBarUpV ) | 260 | if ( p->mToolBarUpV ) |
261 | tbd = Bottom; | 261 | tbd = Bottom; |
262 | else | 262 | else |
263 | tbd = Top; | 263 | tbd = Top; |
264 | } | 264 | } |
265 | else { | 265 | else { |
266 | if ( p->mToolBarUpV ) | 266 | if ( p->mToolBarUpV ) |
267 | tbd = Right; | 267 | tbd = Right; |
268 | else | 268 | else |
269 | tbd = Left; | 269 | tbd = Left; |
270 | } | 270 | } |
271 | viewToolBar = new QPEToolBar( this ); | 271 | viewToolBar = new QPEToolBar( this ); |
272 | addToolBar (viewToolBar , tbd ); | 272 | addToolBar (viewToolBar , tbd ); |
273 | if ( p->mToolBarHorN ) { | 273 | if ( p->mToolBarHorN ) { |
274 | if ( p->mToolBarUpN ) | 274 | if ( p->mToolBarUpN ) |
275 | tbd = Bottom; | 275 | tbd = Bottom; |
276 | else | 276 | else |
277 | tbd = Top; | 277 | tbd = Top; |
278 | } | 278 | } |
279 | else { | 279 | else { |
280 | if ( p->mToolBarUpN ) | 280 | if ( p->mToolBarUpN ) |
281 | tbd = Right; | 281 | tbd = Right; |
282 | else | 282 | else |
283 | tbd = Left; | 283 | tbd = Left; |
284 | } | 284 | } |
285 | navigatorToolBar = new QPEToolBar( this ); | 285 | navigatorToolBar = new QPEToolBar( this ); |
286 | addToolBar (navigatorToolBar , tbd ); | 286 | addToolBar (navigatorToolBar , tbd ); |
287 | } | 287 | } |
288 | 288 | ||
289 | 289 | ||
290 | 290 | ||
291 | mCalendarModifiedFlag = false; | 291 | mCalendarModifiedFlag = false; |
292 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); | 292 | // QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); |
293 | splash->setAlignment ( AlignCenter ); | 293 | //splash->setAlignment ( AlignCenter ); |
294 | setCentralWidget( splash ); | 294 | //setCentralWidget( splash ); |
295 | #ifndef DESKTOP_VERSION | 295 | #ifndef DESKTOP_VERSION |
296 | showMaximized(); | 296 | //showMaximized(); |
297 | #endif | 297 | #endif |
298 | 298 | ||
299 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); | 299 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); |
300 | setDefaultPreferences(); | 300 | setDefaultPreferences(); |
301 | mCalendar = new CalendarLocal(); | 301 | mCalendar = new CalendarLocal(); |
302 | mView = new CalendarView( mCalendar, this,"mCalendar " ); | 302 | mView = new CalendarView( mCalendar, this,"mCalendar " ); |
303 | mView->hide(); | 303 | setCentralWidget( mView ); |
304 | //mView->hide(); | ||
304 | //mView->resize(splash->size() ); | 305 | //mView->resize(splash->size() ); |
305 | initActions(); | 306 | initActions(); |
306 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); | 307 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); |
307 | mSyncManager->setBlockSave(false); | 308 | mSyncManager->setBlockSave(false); |
308 | mView->setSyncManager(mSyncManager); | 309 | mView->setSyncManager(mSyncManager); |
309 | #ifndef DESKTOP_VERSION | 310 | #ifndef DESKTOP_VERSION |
310 | iconToolBar->show(); | 311 | iconToolBar->show(); |
311 | qApp->processEvents(); | 312 | qApp->processEvents(); |
312 | #endif | 313 | #endif |
313 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); | 314 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); |
314 | int vh = height() ; | 315 | int vh = height() ; |
315 | int vw = width(); | 316 | int vw = width(); |
316 | //qDebug("Toolbar hei %d ",iconToolBar->height() ); | 317 | //qDebug("Toolbar hei %d ",iconToolBar->height() ); |
317 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { | 318 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { |
318 | vh -= iconToolBar->height(); | 319 | vh -= iconToolBar->height(); |
319 | } else { | 320 | } else { |
320 | vw -= iconToolBar->height(); | 321 | vw -= iconToolBar->height(); |
321 | } | 322 | } |
322 | //mView->setMaximumSize( splash->size() ); | 323 | //mView->setMaximumSize( splash->size() ); |
323 | //mView->resize( splash->size() ); | 324 | //mView->resize( splash->size() ); |
324 | //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 ()); |
325 | mView->readSettings(); | 326 | mView->readSettings(); |
326 | bool newFile = false; | 327 | bool newFile = false; |
327 | if( !QFile::exists( defaultFileName() ) ) { | 328 | if( !QFile::exists( defaultFileName() ) ) { |
328 | QFileInfo finfo ( defaultFileName() ); | 329 | QFileInfo finfo ( defaultFileName() ); |
329 | QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); | 330 | QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); |
330 | QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; | 331 | QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; |
331 | finfo.setFile( oldFile ); | 332 | finfo.setFile( oldFile ); |
332 | if (finfo.exists() ) { | 333 | if (finfo.exists() ) { |
333 | KMessageBox::information( this, message); | 334 | KMessageBox::information( this, message); |
334 | mView->openCalendar( oldFile ); | 335 | mView->openCalendar( oldFile ); |
335 | qApp->processEvents(); | 336 | qApp->processEvents(); |
336 | } else { | 337 | } else { |
337 | oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); | 338 | oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); |
338 | finfo.setFile( oldFile ); | 339 | finfo.setFile( oldFile ); |
339 | if (finfo.exists() ) { | 340 | if (finfo.exists() ) { |
340 | KMessageBox::information( this, message); | 341 | KMessageBox::information( this, message); |
341 | mView->openCalendar( oldFile ); | 342 | mView->openCalendar( oldFile ); |
342 | qApp->processEvents(); | 343 | qApp->processEvents(); |
343 | } | 344 | } |
344 | } | 345 | } |
345 | mView->saveCalendar( defaultFileName() ); | 346 | mView->saveCalendar( defaultFileName() ); |
346 | newFile = true; | 347 | newFile = true; |
347 | } | 348 | } |
348 | 349 | ||
349 | //QTime neededSaveTime = QDateTime::currentDateTime().time(); | 350 | //QTime neededSaveTime = QDateTime::currentDateTime().time(); |
350 | //mView->loadCalendars(); | 351 | //mView->loadCalendars(); |
351 | //int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 352 | //int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
352 | //qDebug("KO: Calendar loading time: %d ms",msNeeded ); | 353 | //qDebug("KO: Calendar loading time: %d ms",msNeeded ); |
353 | 354 | ||
354 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { | 355 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { |
355 | KOPrefs::instance()->setAllDefaults(); | 356 | KOPrefs::instance()->setAllDefaults(); |
356 | } | 357 | } |
357 | 358 | ||
358 | 359 | ||
359 | connect( mView, SIGNAL( tempDisableBR(bool) ), | 360 | connect( mView, SIGNAL( tempDisableBR(bool) ), |
360 | SLOT( disableBR(bool) ) ); | 361 | SLOT( disableBR(bool) ) ); |
361 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); | 362 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); |
362 | setCentralWidget( mView ); | 363 | setCentralWidget( mView ); |
363 | globalFlagBlockStartup = 0; | 364 | globalFlagBlockStartup = 0; |
364 | mView->show(); | 365 | //mView->show(); |
365 | delete splash; | 366 | //delete splash; |
366 | if ( newFile ) | 367 | if ( newFile ) |
367 | mView->updateConfig(); | 368 | mView->updateConfig(); |
368 | // qApp->processEvents(); | 369 | // qApp->processEvents(); |
369 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 370 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
370 | //fillSyncMenu(); | 371 | //fillSyncMenu(); |
371 | 372 | ||
372 | 373 | ||
373 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); | 374 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); |
374 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); | 375 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); |
375 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); | 376 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); |
376 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); | 377 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); |
377 | mSyncManager->setDefaultFileName( sentSyncFile()); | 378 | mSyncManager->setDefaultFileName( sentSyncFile()); |
378 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); | 379 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); |
379 | mSyncManager->fillSyncMenu(); | 380 | mSyncManager->fillSyncMenu(); |
380 | 381 | ||
381 | 382 | ||
382 | 383 | ||
383 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); | 384 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); |
384 | if ( showWarning ) { | 385 | if ( showWarning ) { |
385 | KMessageBox::information( this, | 386 | KMessageBox::information( this, |
386 | "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"); | 387 | "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"); |
387 | qApp->processEvents(); | 388 | qApp->processEvents(); |
388 | mView->dialogManager()->showSyncOptions(); | 389 | mView->dialogManager()->showSyncOptions(); |
389 | } | 390 | } |
390 | 391 | ||
391 | //US listen for result adressed from Ka/Pi | 392 | //US listen for result adressed from Ka/Pi |
392 | 393 | ||
393 | #ifndef DESKTOP_VERSION | 394 | #ifndef DESKTOP_VERSION |
394 | infrared = 0; | 395 | infrared = 0; |
395 | #endif | 396 | #endif |
396 | updateFilterToolbar(); | 397 | updateFilterToolbar(); |
397 | updateWeek( mView->startDate() ); | 398 | updateWeek( mView->startDate() ); |
398 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), | 399 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), |
399 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); | 400 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); |
400 | mBRdisabled = false; | 401 | mBRdisabled = false; |
401 | //toggleBeamReceive(); | 402 | //toggleBeamReceive(); |
402 | 403 | ||
403 | setCaption(i18n("Loading calendar files ... please wait" )); | 404 | setCaption(i18n("Loading calendar files ... please wait" )); |
404 | QTimer::singleShot( 10, this, SLOT ( loadDataAfterStart() )); | 405 | QTimer::singleShot( 10, this, SLOT ( loadDataAfterStart() )); |
405 | } | 406 | } |
406 | MainWindow::~MainWindow() | 407 | MainWindow::~MainWindow() |
407 | { | 408 | { |
408 | //qDebug("MainWindow::~MainWindow() "); | 409 | //qDebug("MainWindow::~MainWindow() "); |
409 | //save toolbar location | 410 | //save toolbar location |
410 | delete mCalendar; | 411 | delete mCalendar; |
411 | delete mSyncManager; | 412 | delete mSyncManager; |
412 | #ifndef DESKTOP_VERSION | 413 | #ifndef DESKTOP_VERSION |
413 | if ( infrared ) | 414 | if ( infrared ) |
414 | delete infrared; | 415 | delete infrared; |
415 | #endif | 416 | #endif |
416 | 417 | ||
417 | 418 | ||
418 | } | 419 | } |
419 | 420 | ||
420 | void MainWindow::loadDataAfterStart() | 421 | void MainWindow::loadDataAfterStart() |
421 | { | 422 | { |
422 | 423 | ||
423 | qDebug("KO: Start loading files..." ); | 424 | qDebug("KO: Start loading files..." ); |
424 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 425 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
425 | mView->loadCalendars(); | 426 | mView->loadCalendars(); |
426 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 427 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
427 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); | 428 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); |
428 | //QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); | 429 | //QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); |
429 | mView->setModified( false ); | 430 | mView->setModified( false ); |
430 | mBlockAtStartup = false; | 431 | mBlockAtStartup = false; |
431 | mView->setModified( false ); | 432 | mView->setModified( false ); |
432 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); | 433 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); |
433 | processIncidenceSelection( 0 ); | 434 | processIncidenceSelection( 0 ); |
434 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), | 435 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), |
435 | SLOT( processIncidenceSelection( Incidence * ) ) ); | 436 | SLOT( processIncidenceSelection( Incidence * ) ) ); |
436 | connect( mView, SIGNAL( modifiedChanged( bool ) ), | 437 | connect( mView, SIGNAL( modifiedChanged( bool ) ), |
437 | SLOT( slotModifiedChanged( bool ) ) ); | 438 | SLOT( slotModifiedChanged( bool ) ) ); |
438 | 439 | ||
439 | #ifndef DESKTOP_VERSION | 440 | #ifndef DESKTOP_VERSION |
440 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 441 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
441 | connect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(recieve( const QCString&, const QByteArray& ))); | 442 | connect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(recieve( const QCString&, const QByteArray& ))); |
442 | disconnect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(receiveStart( const QCString&, const QByteArray& ))); | 443 | disconnect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(receiveStart( const QCString&, const QByteArray& ))); |
443 | if ( !mCStringMess.isEmpty() ) | 444 | if ( !mCStringMess.isEmpty() ) |
444 | recieve( mCStringMess, mByteData ); | 445 | recieve( mCStringMess, mByteData ); |
445 | #endif | 446 | #endif |
446 | 447 | ||
447 | 448 | ||
448 | QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); | 449 | QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); |
449 | } | 450 | } |
450 | 451 | ||
451 | void MainWindow::slotResetFocus() | 452 | void MainWindow::slotResetFocus() |
452 | { | 453 | { |
453 | //qDebug(" CalendarView::slotResetFocus() %x %x %x %x", qApp->focusWidget(), menuBar1, mView,iconToolBar); | 454 | //qDebug(" CalendarView::slotResetFocus() %x %x %x %x", qApp->focusWidget(), menuBar1, mView,iconToolBar); |
454 | mFocusLoop = 3; | 455 | mFocusLoop = 3; |
455 | QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() )); | 456 | QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() )); |
456 | } | 457 | } |
457 | void MainWindow::slotResetFocusLoop() | 458 | void MainWindow::slotResetFocusLoop() |
458 | { | 459 | { |
459 | --mFocusLoop; | 460 | --mFocusLoop; |
460 | QWidget* fw = mView->viewManager()->currentView(); | 461 | QWidget* fw = mView->viewManager()->currentView(); |
461 | if ( fw ) { | 462 | if ( fw ) { |
462 | //qDebug("loop "); | 463 | //qDebug("loop "); |
463 | fw->setFocus(); | 464 | fw->setFocus(); |
464 | if ( qApp->focusWidget() != fw && mFocusLoop > 0 ) | 465 | if ( qApp->focusWidget() != fw && mFocusLoop > 0 ) |
465 | QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() )); | 466 | QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() )); |
466 | } | 467 | } |
467 | 468 | ||
468 | } | 469 | } |
469 | void MainWindow::disableBR(bool b) | 470 | void MainWindow::disableBR(bool b) |
470 | { | 471 | { |
471 | #ifndef DESKTOP_VERSION | 472 | #ifndef DESKTOP_VERSION |
472 | if ( b ) { | 473 | if ( b ) { |
473 | if ( infrared ) { | 474 | if ( infrared ) { |
474 | toggleBeamReceive(); | 475 | toggleBeamReceive(); |
475 | mBRdisabled = true; | 476 | mBRdisabled = true; |
476 | } | 477 | } |
477 | mBRdisabled = true; | 478 | mBRdisabled = true; |
478 | } else { | 479 | } else { |
479 | if ( mBRdisabled ) { | 480 | if ( mBRdisabled ) { |
480 | mBRdisabled = false; | 481 | mBRdisabled = false; |
481 | //makes no sense,because other cal ap is probably running | 482 | //makes no sense,because other cal ap is probably running |
482 | // toggleBeamReceive(); | 483 | // toggleBeamReceive(); |
483 | } | 484 | } |
484 | } | 485 | } |
485 | #endif | 486 | #endif |
486 | 487 | ||
487 | } | 488 | } |
488 | bool MainWindow::beamReceiveEnabled() | 489 | bool MainWindow::beamReceiveEnabled() |
489 | { | 490 | { |
490 | #ifndef DESKTOP_VERSION | 491 | #ifndef DESKTOP_VERSION |
491 | return ( infrared != 0 ); | 492 | return ( infrared != 0 ); |
492 | #endif | 493 | #endif |
493 | return false; | 494 | return false; |
494 | } | 495 | } |
495 | 496 | ||
496 | void MainWindow::toggleBeamReceive() | 497 | void MainWindow::toggleBeamReceive() |
497 | { | 498 | { |
498 | if ( mBRdisabled ) | 499 | if ( mBRdisabled ) |
499 | return; | 500 | return; |
500 | #ifndef DESKTOP_VERSION | 501 | #ifndef DESKTOP_VERSION |
501 | if ( infrared ) { | 502 | if ( infrared ) { |
502 | qDebug("KO: Disable BeamReceive "); | 503 | qDebug("KO: Disable BeamReceive "); |
503 | delete infrared; | 504 | delete infrared; |
504 | infrared = 0; | 505 | infrared = 0; |
505 | brAction->setOn(false); | 506 | brAction->setOn(false); |
506 | return; | 507 | return; |
507 | } | 508 | } |
508 | qDebug("KO: Enable BeamReceive "); | 509 | qDebug("KO: Enable BeamReceive "); |
509 | brAction->setOn(true); | 510 | brAction->setOn(true); |
510 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; | 511 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; |
511 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); | 512 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); |
512 | #endif | 513 | #endif |
513 | } | 514 | } |
514 | void MainWindow::showMaximized () | 515 | void MainWindow::showMaximized () |
515 | { | 516 | { |
516 | #ifndef DESKTOP_VERSION | 517 | #ifndef DESKTOP_VERSION |
517 | if ( ! globalFlagBlockStartup ) | 518 | if ( ! globalFlagBlockStartup ) |
518 | if ( mClosed ) | 519 | if ( mClosed ) |
519 | mView->goToday(); | 520 | mView->goToday(); |
520 | #endif | 521 | #endif |
521 | QWidget::showMaximized () ; | 522 | QWidget::showMaximized () ; |
522 | mClosed = false; | 523 | mClosed = false; |
523 | } | 524 | } |
524 | void MainWindow::closeEvent( QCloseEvent* ce ) | 525 | void MainWindow::closeEvent( QCloseEvent* ce ) |
525 | { | 526 | { |
526 | 527 | ||
527 | 528 | ||
528 | 529 | ||
529 | if ( ! KOPrefs::instance()->mAskForQuit ) { | 530 | if ( ! KOPrefs::instance()->mAskForQuit ) { |
530 | saveOnClose(); | 531 | saveOnClose(); |
531 | if ( mCalendarModifiedFlag ) { | 532 | if ( mCalendarModifiedFlag ) { |
532 | ce->ignore(); | 533 | ce->ignore(); |
533 | return; | 534 | return; |
534 | } | 535 | } |
535 | mClosed = true; | 536 | mClosed = true; |
536 | ce->accept(); | 537 | ce->accept(); |
537 | return; | 538 | return; |
538 | 539 | ||
539 | } | 540 | } |
540 | 541 | ||
541 | switch( QMessageBox::information( this, "KO/Pi", | 542 | switch( QMessageBox::information( this, "KO/Pi", |
542 | i18n("Do you really want\nto close KO/Pi?"), | 543 | i18n("Do you really want\nto close KO/Pi?"), |
543 | i18n("Close"), i18n("No"), | 544 | i18n("Close"), i18n("No"), |
544 | 0, 0 ) ) { | 545 | 0, 0 ) ) { |
545 | case 0: | 546 | case 0: |
546 | saveOnClose(); | 547 | saveOnClose(); |
547 | if ( mCalendarModifiedFlag ) { | 548 | if ( mCalendarModifiedFlag ) { |
548 | ce->ignore(); | 549 | ce->ignore(); |
549 | return; | 550 | return; |
550 | } | 551 | } |
551 | mClosed = true; | 552 | mClosed = true; |
552 | ce->accept(); | 553 | ce->accept(); |
553 | break; | 554 | break; |
554 | case 1: | 555 | case 1: |
555 | ce->ignore(); | 556 | ce->ignore(); |
556 | break; | 557 | break; |
557 | case 2: | 558 | case 2: |
558 | 559 | ||
559 | default: | 560 | default: |
560 | break; | 561 | break; |
561 | } | 562 | } |
562 | 563 | ||
563 | 564 | ||
564 | } | 565 | } |
565 | void MainWindow::receiveStart( const QCString& cmsg, const QByteArray& data ) | 566 | void MainWindow::receiveStart( const QCString& cmsg, const QByteArray& data ) |
566 | { | 567 | { |
567 | qDebug("KO: QCOP start message received: %s ", cmsg.data() ); | 568 | qDebug("KO: QCOP start message received: %s ", cmsg.data() ); |
568 | mCStringMess = cmsg; | 569 | mCStringMess = cmsg; |
569 | mByteData = data; | 570 | mByteData = data; |
570 | } | 571 | } |
571 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | 572 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) |
572 | { | 573 | { |
573 | QDataStream stream( data, IO_ReadOnly ); | 574 | QDataStream stream( data, IO_ReadOnly ); |
574 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); | 575 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); |
575 | //QString datamess; | 576 | //QString datamess; |
576 | //qDebug("message "); | 577 | //qDebug("message "); |
577 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); | 578 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); |
578 | 579 | ||
579 | if ( cmsg == "setDocument(QString)" ) { | 580 | if ( cmsg == "setDocument(QString)" ) { |
580 | QDataStream stream( data, IO_ReadOnly ); | 581 | QDataStream stream( data, IO_ReadOnly ); |
581 | QString fileName; | 582 | QString fileName; |
582 | stream >> fileName; | 583 | stream >> fileName; |
583 | //qDebug("filename %s ", fileName.latin1()); | 584 | //qDebug("filename %s ", fileName.latin1()); |
584 | showMaximized(); | 585 | showMaximized(); |
585 | raise(); | 586 | raise(); |
586 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; | 587 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; |
587 | mSyncManager->slotSyncMenu( 1002 ); | 588 | mSyncManager->slotSyncMenu( 1002 ); |
588 | return; | 589 | return; |
589 | } | 590 | } |
590 | 591 | ||
591 | if ( cmsg == "-writeFile" ) { | 592 | if ( cmsg == "-writeFile" ) { |
592 | // I made from the "-writeFile" an "-writeAlarm" | 593 | // I made from the "-writeFile" an "-writeAlarm" |
593 | mView->viewManager()->showWhatsNextView(); | 594 | mView->viewManager()->showWhatsNextView(); |
594 | mCalendar->checkAlarmForIncidence( 0, true); | 595 | mCalendar->checkAlarmForIncidence( 0, true); |
595 | showMaximized(); | 596 | showMaximized(); |
596 | raise(); | 597 | raise(); |
597 | return; | 598 | return; |
598 | 599 | ||
599 | } | 600 | } |
600 | if ( cmsg == "-writeFileSilent" ) { | 601 | if ( cmsg == "-writeFileSilent" ) { |
601 | // I made from the "-writeFile" an "-writeAlarm" | 602 | // I made from the "-writeFile" an "-writeAlarm" |
602 | // mView->viewManager()->showWhatsNextView(); | 603 | // mView->viewManager()->showWhatsNextView(); |
603 | mCalendar->checkAlarmForIncidence( 0, true); | 604 | mCalendar->checkAlarmForIncidence( 0, true); |
604 | //showMaximized(); | 605 | //showMaximized(); |
605 | //raise(); | 606 | //raise(); |
606 | hide(); | 607 | hide(); |
607 | return; | 608 | return; |
608 | } | 609 | } |
609 | if ( cmsg == "-newCountdown" ) { | 610 | if ( cmsg == "-newCountdown" ) { |
610 | qDebug("newCountdown "); | 611 | qDebug("newCountdown "); |
611 | 612 | ||
612 | } | 613 | } |
613 | QString msg ; | 614 | QString msg ; |
614 | QString allmsg = cmsg; | 615 | QString allmsg = cmsg; |
615 | while ( allmsg.length() > 0 ) { | 616 | while ( allmsg.length() > 0 ) { |
616 | int nextC = allmsg.find( "-", 1 ); | 617 | int nextC = allmsg.find( "-", 1 ); |
617 | if ( nextC == -1 ) { | 618 | if ( nextC == -1 ) { |
618 | msg = allmsg; | 619 | msg = allmsg; |
619 | allmsg = ""; | 620 | allmsg = ""; |
620 | } else{ | 621 | } else{ |
621 | msg = allmsg.left( nextC ); | 622 | msg = allmsg.left( nextC ); |
622 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); | 623 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); |
623 | } | 624 | } |
624 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); | 625 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); |
625 | if ( msg == "-newEvent" ) { | 626 | if ( msg == "-newEvent" ) { |
626 | QTimer::singleShot( 0, mView, SLOT ( newEvent())); | 627 | QTimer::singleShot( 0, mView, SLOT ( newEvent())); |
627 | } | 628 | } |
628 | if ( msg == "-newTodo" ) { | 629 | if ( msg == "-newTodo" ) { |
629 | QTimer::singleShot( 0, mView, SLOT ( newTodo())); | 630 | QTimer::singleShot( 0, mView, SLOT ( newTodo())); |
630 | } | 631 | } |
631 | if ( msg == "-showWN" ) { | 632 | if ( msg == "-showWN" ) { |
632 | mView->viewManager()->showWhatsNextView(); | 633 | mView->viewManager()->showWhatsNextView(); |
633 | } | 634 | } |
634 | if ( msg == "-showTodo" ) { | 635 | if ( msg == "-showTodo" ) { |
635 | mView->viewManager()->showTodoView(); | 636 | mView->viewManager()->showTodoView(); |
636 | } | 637 | } |
637 | if ( msg == "-showList" ) { | 638 | if ( msg == "-showList" ) { |
638 | mView->viewManager()->showListView(); | 639 | mView->viewManager()->showListView(); |
639 | } | 640 | } |
640 | else if ( msg == "-showDay" ) { | 641 | else if ( msg == "-showDay" ) { |
641 | mView->viewManager()->showDayView(); | 642 | mView->viewManager()->showDayView(); |
642 | } | 643 | } |
643 | else if ( msg == "-showWWeek" ) { | 644 | else if ( msg == "-showWWeek" ) { |
644 | mView->viewManager()->showWorkWeekView(); | 645 | mView->viewManager()->showWorkWeekView(); |
645 | } | 646 | } |
646 | else if ( msg == "-ringSync" ) { | 647 | else if ( msg == "-ringSync" ) { |
647 | QTimer::singleShot( 0, this, SLOT (startMultiSync())); | 648 | QTimer::singleShot( 0, this, SLOT (startMultiSync())); |
648 | } | 649 | } |
649 | else if ( msg == "-showWeek" ) { | 650 | else if ( msg == "-showWeek" ) { |
650 | mView->viewManager()->showWeekView(); | 651 | mView->viewManager()->showWeekView(); |
651 | } | 652 | } |
652 | else if ( msg == "-showTodo" ) { | 653 | else if ( msg == "-showTodo" ) { |
653 | mView->viewManager()->showTodoView(); | 654 | mView->viewManager()->showTodoView(); |
654 | } | 655 | } |
655 | else if ( msg == "-showJournal" ) { | 656 | else if ( msg == "-showJournal" ) { |
656 | mView->dateNavigator()->selectDates( 1 ); | 657 | mView->dateNavigator()->selectDates( 1 ); |
657 | mView->dateNavigator()->selectToday(); | 658 | mView->dateNavigator()->selectToday(); |
658 | mView->viewManager()->showJournalView(); | 659 | mView->viewManager()->showJournalView(); |
659 | } | 660 | } |
660 | else if ( msg == "-showKO" ) { | 661 | else if ( msg == "-showKO" ) { |
661 | mView->viewManager()->showNextXView(); | 662 | mView->viewManager()->showNextXView(); |
662 | } | 663 | } |
663 | else if ( msg == "-showWNext" ) { | 664 | else if ( msg == "-showWNext" ) { |
664 | mView->viewManager()->showWhatsNextView(); | 665 | mView->viewManager()->showWhatsNextView(); |
665 | } | 666 | } |
666 | else if ( msg == "nextView()" ) { | 667 | else if ( msg == "nextView()" ) { |
667 | mView->viewManager()->showNextView(); | 668 | mView->viewManager()->showNextView(); |
668 | } | 669 | } |
669 | else if ( msg == "-showNextXView" ) { | 670 | else if ( msg == "-showNextXView" ) { |
670 | mView->viewManager()->showNextXView(); | 671 | mView->viewManager()->showNextXView(); |
671 | } | 672 | } |
672 | 673 | ||
673 | 674 | ||
674 | } | 675 | } |
675 | 676 | ||
676 | showMaximized(); | 677 | showMaximized(); |
677 | raise(); | 678 | raise(); |
678 | } | 679 | } |
679 | void MainWindow::startMultiSync() | 680 | void MainWindow::startMultiSync() |
680 | { | 681 | { |
681 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); | 682 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); |
682 | if ( QMessageBox::information( this, i18n("KDE-Pim Sync"), | 683 | if ( QMessageBox::information( this, i18n("KDE-Pim Sync"), |
683 | question, | 684 | question, |
684 | i18n("Yes"), i18n("No"), | 685 | i18n("Yes"), i18n("No"), |
685 | 0, 0 ) != 0 ) { | 686 | 0, 0 ) != 0 ) { |
686 | setCaption(i18n("Aborted! Nothing synced!")); | 687 | setCaption(i18n("Aborted! Nothing synced!")); |
687 | return; | 688 | return; |
688 | } | 689 | } |
689 | mSyncManager->multiSync( false ); | 690 | mSyncManager->multiSync( false ); |
690 | #ifndef DESKTOP_VERSION | 691 | #ifndef DESKTOP_VERSION |
691 | QCopEnvelope e("QPE/Application/kapi", "doRingSync"); | 692 | QCopEnvelope e("QPE/Application/kapi", "doRingSync"); |
692 | #endif | 693 | #endif |
693 | } | 694 | } |
694 | QPixmap MainWindow::loadPixmap( QString name ) | 695 | QPixmap MainWindow::loadPixmap( QString name ) |
695 | { | 696 | { |
696 | return SmallIcon( name ); | 697 | return SmallIcon( name ); |
697 | 698 | ||
698 | } | 699 | } |
699 | void MainWindow::setUsesBigPixmaps ( bool b ) | 700 | void MainWindow::setUsesBigPixmaps ( bool b ) |
700 | { | 701 | { |
701 | qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); | 702 | qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); |
702 | if ( b ) | 703 | if ( b ) |
703 | qDebug("KO: BigPixmaps are not supported "); | 704 | qDebug("KO: BigPixmaps are not supported "); |
704 | } | 705 | } |
705 | void MainWindow::initActions() | 706 | void MainWindow::initActions() |
706 | { | 707 | { |
707 | //KOPrefs::instance()->mShowFullMenu | 708 | //KOPrefs::instance()->mShowFullMenu |
708 | iconToolBar->clear(); | 709 | iconToolBar->clear(); |
709 | KOPrefs *p = KOPrefs::instance(); | 710 | KOPrefs *p = KOPrefs::instance(); |
710 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 711 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
711 | 712 | ||
712 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 713 | QPopupMenu *viewMenu = new QPopupMenu( this ); |
713 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 714 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
714 | mCurrentItemMenu = new QPopupMenu ( this ); | 715 | mCurrentItemMenu = new QPopupMenu ( this ); |
715 | QPopupMenu *nextConflictMenu = new QPopupMenu ( this ); | 716 | QPopupMenu *nextConflictMenu = new QPopupMenu ( this ); |
716 | QPopupMenu *importMenu = new QPopupMenu( this ); | 717 | QPopupMenu *importMenu = new QPopupMenu( this ); |
717 | QPopupMenu *importMenu_X = new QPopupMenu( this ); | 718 | QPopupMenu *importMenu_X = new QPopupMenu( this ); |
718 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); | 719 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); |
719 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); | 720 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); |
720 | selectFilterMenu = new QPopupMenu( this ); | 721 | selectFilterMenu = new QPopupMenu( this ); |
721 | selectFilterMenu->setCheckable( true ); | 722 | selectFilterMenu->setCheckable( true ); |
722 | syncMenu = new QPopupMenu( this ); | 723 | syncMenu = new QPopupMenu( this ); |
723 | configureAgendaMenu = new QPopupMenu( this ); | 724 | configureAgendaMenu = new QPopupMenu( this ); |
724 | configureToolBarMenu = new QPopupMenu( this ); | 725 | configureToolBarMenu = new QPopupMenu( this ); |
725 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 726 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
726 | QIconSet icon; | 727 | QIconSet icon; |
727 | int pixWid = 22, pixHei = 22; | 728 | int pixWid = 22, pixHei = 22; |
728 | QString pathString = ""; | 729 | QString pathString = ""; |
729 | if ( !p->mToolBarMiniIcons ) { | 730 | if ( !p->mToolBarMiniIcons ) { |
730 | if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { | 731 | if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { |
731 | pathString += "icons16/"; | 732 | pathString += "icons16/"; |
732 | pixWid = 18; pixHei = 16; | 733 | pixWid = 18; pixHei = 16; |
733 | } | 734 | } |
734 | } else { | 735 | } else { |
735 | pathString += "iconsmini/"; | 736 | pathString += "iconsmini/"; |
736 | pixWid = 18; pixHei = 16; | 737 | pixWid = 18; pixHei = 16; |
737 | } | 738 | } |
738 | 739 | ||
739 | if ( KOPrefs::instance()->mShowFullMenu ) { | 740 | if ( KOPrefs::instance()->mShowFullMenu ) { |
740 | menuBar1 = new KMenuBar( this );//menuBar(); | 741 | menuBar1 = new KMenuBar( this );//menuBar(); |
741 | //setMenuBar( menuBar1 ); | 742 | //setMenuBar( menuBar1 ); |
742 | menuBar1->show(); | 743 | menuBar1->show(); |
743 | menuBar1->insertItem( i18n("File"), importMenu ); | 744 | menuBar1->insertItem( i18n("File"), importMenu ); |
744 | menuBar1->insertItem( i18n("View"), viewMenu ); | 745 | menuBar1->insertItem( i18n("View"), viewMenu ); |
745 | menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu ); | 746 | menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu ); |
746 | menuBar1->insertItem( i18n("Action"), actionMenu ); | 747 | menuBar1->insertItem( i18n("Action"), actionMenu ); |
747 | #ifdef DESKTOP_VERSION | 748 | #ifdef DESKTOP_VERSION |
748 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); | 749 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); |
749 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 750 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
750 | #else | 751 | #else |
751 | menuBar1->insertItem( i18n("Sync"), syncMenu ); | 752 | menuBar1->insertItem( i18n("Sync"), syncMenu ); |
752 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); | 753 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); |
753 | #endif | 754 | #endif |
754 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 755 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
755 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); | 756 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); |
756 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 757 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
757 | } else { | 758 | } else { |
758 | menuBar1 = new KMenuBar( iconToolBar ); | 759 | menuBar1 = new KMenuBar( iconToolBar ); |
759 | QPopupMenu *menuBar = new QPopupMenu( this ); | 760 | QPopupMenu *menuBar = new QPopupMenu( this ); |
760 | icon = loadPixmap( pathString + "z_menu" ); | 761 | icon = loadPixmap( pathString + "z_menu" ); |
761 | menuBar1->insertItem( icon.pixmap(), menuBar); | 762 | menuBar1->insertItem( icon.pixmap(), menuBar); |
762 | //menuBar1->insertItem( i18n("ME"), menuBar); | 763 | //menuBar1->insertItem( i18n("ME"), menuBar); |
763 | menuBar->insertItem( i18n("File"), importMenu ); | 764 | menuBar->insertItem( i18n("File"), importMenu ); |
764 | menuBar->insertItem( i18n("View"), viewMenu ); | 765 | menuBar->insertItem( i18n("View"), viewMenu ); |
765 | menuBar->insertItem( i18n("Edit"), mCurrentItemMenu ); | 766 | menuBar->insertItem( i18n("Edit"), mCurrentItemMenu ); |
766 | menuBar->insertItem( i18n("Action"), actionMenu ); | 767 | menuBar->insertItem( i18n("Action"), actionMenu ); |
767 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); | 768 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); |
768 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 769 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
769 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 770 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
770 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); | 771 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); |
771 | menuBar->insertItem( i18n("Help"), helpMenu ); | 772 | menuBar->insertItem( i18n("Help"), helpMenu ); |
772 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); | 773 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); |
773 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); | 774 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); |
774 | connect ( menuBar, SIGNAL( aboutToHide () ), this, SLOT ( slotResetFocus() ) ); | 775 | connect ( menuBar, SIGNAL( aboutToHide () ), this, SLOT ( slotResetFocus() ) ); |
775 | } | 776 | } |
776 | connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) ); | 777 | connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) ); |
777 | //connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) ); | 778 | //connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) ); |
778 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 779 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
779 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); | 780 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); |
780 | 781 | ||
781 | 782 | ||
782 | mWeekBgColor = iconToolBar->backgroundColor(); | 783 | mWeekBgColor = iconToolBar->backgroundColor(); |
783 | mWeekPixmap.resize( pixWid , pixHei ); | 784 | mWeekPixmap.resize( pixWid , pixHei ); |
784 | mWeekPixmap.fill( mWeekBgColor ); | 785 | mWeekPixmap.fill( mWeekBgColor ); |
785 | icon = mWeekPixmap; | 786 | icon = mWeekPixmap; |
786 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); | 787 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); |
787 | if ( p-> mShowIconWeekNum ) | 788 | if ( p-> mShowIconWeekNum ) |
788 | mWeekAction->addTo( iconToolBar ); | 789 | mWeekAction->addTo( iconToolBar ); |
789 | mWeekFont = font(); | 790 | mWeekFont = font(); |
790 | 791 | ||
791 | int fontPoint = mWeekFont.pointSize(); | 792 | int fontPoint = mWeekFont.pointSize(); |
792 | QFontMetrics f( mWeekFont ); | 793 | QFontMetrics f( mWeekFont ); |
793 | int fontWid = f.width( "30" ); | 794 | int fontWid = f.width( "30" ); |
794 | while ( fontWid > pixWid ) { | 795 | while ( fontWid > pixWid ) { |
795 | --fontPoint; | 796 | --fontPoint; |
796 | mWeekFont.setPointSize( fontPoint ); | 797 | mWeekFont.setPointSize( fontPoint ); |
797 | QFontMetrics f( mWeekFont ); | 798 | QFontMetrics f( mWeekFont ); |
798 | fontWid = f.width( "30" ); | 799 | fontWid = f.width( "30" ); |
799 | //qDebug("dec-- "); | 800 | //qDebug("dec-- "); |
800 | } | 801 | } |
801 | 802 | ||
802 | connect( mWeekAction, SIGNAL( activated() ), | 803 | connect( mWeekAction, SIGNAL( activated() ), |
803 | this, SLOT( weekAction() ) ); | 804 | this, SLOT( weekAction() ) ); |
804 | 805 | ||
805 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); | 806 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); |
806 | if ( p->mShowIconFilterview ) { | 807 | if ( p->mShowIconFilterview ) { |
807 | icon = loadPixmap( pathString + "filter" ); | 808 | icon = loadPixmap( pathString + "filter" ); |
808 | actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); | 809 | actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); |
809 | connect( actionFilterMenuTB, SIGNAL( activated() ), | 810 | connect( actionFilterMenuTB, SIGNAL( activated() ), |
810 | this, SLOT( fillFilterMenuTB() ) ); | 811 | this, SLOT( fillFilterMenuTB() ) ); |
811 | actionFilterMenuTB->addTo( iconToolBar ); | 812 | actionFilterMenuTB->addTo( iconToolBar ); |
812 | selectFilterMenuTB = new QPopupMenu( this ); | 813 | selectFilterMenuTB = new QPopupMenu( this ); |
813 | selectFilterMenuTB->setCheckable( true ); | 814 | selectFilterMenuTB->setCheckable( true ); |
814 | connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 815 | connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
815 | } | 816 | } |
816 | 817 | ||
817 | //#endif | 818 | //#endif |
818 | // ****************** | 819 | // ****************** |
819 | QAction *action; | 820 | QAction *action; |
820 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); | 821 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); |
821 | configureToolBarMenu->setCheckable( true ); | 822 | configureToolBarMenu->setCheckable( true ); |
822 | 823 | ||
823 | 824 | ||
824 | configureAgendaMenu->setCheckable( true ); | 825 | configureAgendaMenu->setCheckable( true ); |
825 | int iii ; | 826 | int iii ; |
826 | for ( iii = 1;iii<= 10 ;++iii ){ | 827 | for ( iii = 1;iii<= 10 ;++iii ){ |
827 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); | 828 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); |
828 | } | 829 | } |
829 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 830 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
830 | 831 | ||
831 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), | 832 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), |
832 | this, SLOT( showConfigureAgenda( ) ) ); | 833 | this, SLOT( showConfigureAgenda( ) ) ); |
833 | icon = loadPixmap( pathString + "today" ); | 834 | icon = loadPixmap( pathString + "today" ); |
834 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | 835 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); |
835 | today_action->addTo( actionMenu ); | 836 | today_action->addTo( actionMenu ); |
836 | connect( today_action, SIGNAL( activated() ), | 837 | connect( today_action, SIGNAL( activated() ), |
837 | mView, SLOT( goToday() ) ); | 838 | mView, SLOT( goToday() ) ); |
838 | 839 | ||
839 | icon = loadPixmap( pathString + "picker" ); | 840 | icon = loadPixmap( pathString + "picker" ); |
840 | QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); | 841 | QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); |
841 | dPickerAction->addTo( actionMenu ); | 842 | dPickerAction->addTo( actionMenu ); |
842 | connect( dPickerAction, SIGNAL( activated() ), | 843 | connect( dPickerAction, SIGNAL( activated() ), |
843 | mView, SLOT( showDatePicker() ) ); | 844 | mView, SLOT( showDatePicker() ) ); |
844 | 845 | ||
845 | icon = loadPixmap( pathString + "search" ); | 846 | icon = loadPixmap( pathString + "search" ); |
846 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 847 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); |
847 | search_action->addTo( actionMenu ); | 848 | search_action->addTo( actionMenu ); |
848 | connect( search_action, SIGNAL( activated() ), | 849 | connect( search_action, SIGNAL( activated() ), |
849 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | 850 | mView->dialogManager(), SLOT( showSearchDialog() ) ); |
850 | actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu ); | 851 | actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu ); |
851 | 852 | ||
852 | action = new QAction( "Undo Delete", i18n("All events"), 0, this ); | 853 | action = new QAction( "Undo Delete", i18n("All events"), 0, this ); |
853 | action->addTo( nextConflictMenu ); | 854 | action->addTo( nextConflictMenu ); |
854 | connect( action, SIGNAL( activated() ), | 855 | connect( action, SIGNAL( activated() ), |
855 | mView, SLOT( conflictAll() ) ); | 856 | mView, SLOT( conflictAll() ) ); |
856 | 857 | ||
857 | action = new QAction( "Undo Delete", i18n("Allday events"), 0, this ); | 858 | action = new QAction( "Undo Delete", i18n("Allday events"), 0, this ); |
858 | action->addTo( nextConflictMenu ); | 859 | action->addTo( nextConflictMenu ); |
859 | connect( action, SIGNAL( activated() ), | 860 | connect( action, SIGNAL( activated() ), |
860 | mView, SLOT( conflictAllday() ) ); | 861 | mView, SLOT( conflictAllday() ) ); |
861 | 862 | ||
862 | action = new QAction( "Undo Delete", i18n("Events with time"), 0, this ); | 863 | action = new QAction( "Undo Delete", i18n("Events with time"), 0, this ); |
863 | action->addTo( nextConflictMenu ); | 864 | action->addTo( nextConflictMenu ); |
864 | connect( action, SIGNAL( activated() ), | 865 | connect( action, SIGNAL( activated() ), |
865 | mView, SLOT( conflictNotAll() ) ); | 866 | mView, SLOT( conflictNotAll() ) ); |
866 | 867 | ||
867 | actionMenu->insertSeparator(); | 868 | actionMenu->insertSeparator(); |
868 | 869 | ||
869 | icon = loadPixmap( pathString + "newevent" ); | 870 | icon = loadPixmap( pathString + "newevent" ); |
870 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 871 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); |
871 | ne_action->addTo( mCurrentItemMenu ); | 872 | ne_action->addTo( mCurrentItemMenu ); |
872 | connect( ne_action, SIGNAL( activated() ), | 873 | connect( ne_action, SIGNAL( activated() ), |
873 | mView, SLOT( newEvent() ) ); | 874 | mView, SLOT( newEvent() ) ); |
874 | icon = loadPixmap( pathString + "newtodo" ); | 875 | icon = loadPixmap( pathString + "newtodo" ); |
875 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | 876 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); |
876 | nt_action->addTo( mCurrentItemMenu ); | 877 | nt_action->addTo( mCurrentItemMenu ); |
877 | connect( nt_action, SIGNAL( activated() ), | 878 | connect( nt_action, SIGNAL( activated() ), |
878 | mView, SLOT( newTodo() ) ); | 879 | mView, SLOT( newTodo() ) ); |
879 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, | 880 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, |
880 | this ); | 881 | this ); |
881 | mNewSubTodoAction->addTo( mCurrentItemMenu ); | 882 | mNewSubTodoAction->addTo( mCurrentItemMenu ); |
882 | connect( mNewSubTodoAction, SIGNAL( activated() ), | 883 | connect( mNewSubTodoAction, SIGNAL( activated() ), |
883 | mView, SLOT( newSubTodo() ) ); | 884 | mView, SLOT( newSubTodo() ) ); |
884 | 885 | ||
885 | mCurrentItemMenu->insertSeparator(); | 886 | mCurrentItemMenu->insertSeparator(); |
886 | icon = loadPixmap( pathString + "newevent" ); | 887 | icon = loadPixmap( pathString + "newevent" ); |
887 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 888 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
888 | configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); | 889 | configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); |
889 | configureToolBarMenu->insertSeparator(); | 890 | configureToolBarMenu->insertSeparator(); |
890 | configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); | 891 | configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); |
891 | configureToolBarMenu->insertSeparator(); | 892 | configureToolBarMenu->insertSeparator(); |
892 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); | 893 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); |
893 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 894 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
894 | icon = loadPixmap( pathString + "newtodo" ); | 895 | icon = loadPixmap( pathString + "newtodo" ); |
895 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 896 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); |
896 | 897 | ||
897 | //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); | 898 | //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); |
898 | mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this ); | 899 | mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this ); |
899 | mShowAction->addTo( mCurrentItemMenu ); | 900 | mShowAction->addTo( mCurrentItemMenu ); |
900 | connect( mShowAction, SIGNAL( activated() ), | 901 | connect( mShowAction, SIGNAL( activated() ), |
901 | mView, SLOT( showIncidence() ) ); | 902 | mView, SLOT( showIncidence() ) ); |
902 | 903 | ||
903 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | 904 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); |
904 | mEditAction->addTo( mCurrentItemMenu ); | 905 | mEditAction->addTo( mCurrentItemMenu ); |
905 | connect( mEditAction, SIGNAL( activated() ), | 906 | connect( mEditAction, SIGNAL( activated() ), |
906 | mView, SLOT( editIncidence() ) ); | 907 | mView, SLOT( editIncidence() ) ); |
907 | 908 | ||
908 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | 909 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); |
909 | mDeleteAction->addTo( mCurrentItemMenu ); | 910 | mDeleteAction->addTo( mCurrentItemMenu ); |
910 | connect( mDeleteAction, SIGNAL( activated() ), | 911 | connect( mDeleteAction, SIGNAL( activated() ), |
911 | mView, SLOT( deleteIncidence() ) ); | 912 | mView, SLOT( deleteIncidence() ) ); |
912 | 913 | ||
913 | 914 | ||
914 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); | 915 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); |
915 | mCloneAction->addTo( mCurrentItemMenu ); | 916 | mCloneAction->addTo( mCurrentItemMenu ); |
916 | connect( mCloneAction, SIGNAL( activated() ), | 917 | connect( mCloneAction, SIGNAL( activated() ), |
917 | mView, SLOT( cloneIncidence() ) ); | 918 | mView, SLOT( cloneIncidence() ) ); |
918 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); | 919 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); |
919 | mMoveAction->addTo( mCurrentItemMenu ); | 920 | mMoveAction->addTo( mCurrentItemMenu ); |
920 | connect( mMoveAction, SIGNAL( activated() ), | 921 | connect( mMoveAction, SIGNAL( activated() ), |
921 | mView, SLOT( moveIncidence() ) ); | 922 | mView, SLOT( moveIncidence() ) ); |
922 | #ifndef DESKTOP_VERSION | 923 | #ifndef DESKTOP_VERSION |
923 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); | 924 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); |
924 | mBeamAction->addTo(mCurrentItemMenu ); | 925 | mBeamAction->addTo(mCurrentItemMenu ); |
925 | connect( mBeamAction, SIGNAL( activated() ), | 926 | connect( mBeamAction, SIGNAL( activated() ), |
926 | mView, SLOT( beamIncidence() ) ); | 927 | mView, SLOT( beamIncidence() ) ); |
927 | #endif | 928 | #endif |
928 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); | 929 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); |
929 | mCancelAction->addTo( mCurrentItemMenu ); | 930 | mCancelAction->addTo( mCurrentItemMenu ); |
930 | connect( mCancelAction, SIGNAL( activated() ), | 931 | connect( mCancelAction, SIGNAL( activated() ), |
931 | mView, SLOT( toggleCancelIncidence() ) ); | 932 | mView, SLOT( toggleCancelIncidence() ) ); |
932 | 933 | ||
933 | 934 | ||
934 | mCurrentItemMenu->insertSeparator(); | 935 | mCurrentItemMenu->insertSeparator(); |
935 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); | 936 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); |
936 | action->addTo( mCurrentItemMenu ); | 937 | action->addTo( mCurrentItemMenu ); |
937 | connect( action, SIGNAL( activated() ), | 938 | connect( action, SIGNAL( activated() ), |
938 | mView, SLOT( undo_delete() ) ); | 939 | mView, SLOT( undo_delete() ) ); |
939 | 940 | ||
940 | // *********************** | 941 | // *********************** |
941 | if ( KOPrefs::instance()->mVerticalScreen ) { | 942 | if ( KOPrefs::instance()->mVerticalScreen ) { |
942 | icon = SmallIcon( "1updownarrow" ); | 943 | icon = SmallIcon( "1updownarrow" ); |
943 | } else { | 944 | } else { |
944 | icon = SmallIcon("1leftrightarrow" ); | 945 | icon = SmallIcon("1leftrightarrow" ); |
945 | } | 946 | } |
946 | configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); | 947 | configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); |
947 | QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); | 948 | QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); |
948 | FSaction->addTo( viewMenu ); | 949 | FSaction->addTo( viewMenu ); |
949 | connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); | 950 | connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); |
950 | 951 | ||
951 | 952 | ||
952 | icon = loadPixmap( pathString + "filter" ); | 953 | icon = loadPixmap( pathString + "filter" ); |
953 | configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); | 954 | configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); |
954 | icon = loadPixmap( pathString + "configure" ); | 955 | icon = loadPixmap( pathString + "configure" ); |
955 | action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); | 956 | action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); |
956 | action->addTo( viewMenu ); | 957 | action->addTo( viewMenu ); |
957 | connect( action, SIGNAL( activated() ), | 958 | connect( action, SIGNAL( activated() ), |
958 | mView, SLOT( toggleFilter() ) ); | 959 | mView, SLOT( toggleFilter() ) ); |
959 | mToggleFilter = action; | 960 | mToggleFilter = action; |
960 | icon = loadPixmap( pathString + "navi" ); | 961 | icon = loadPixmap( pathString + "navi" ); |
961 | configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); | 962 | configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); |
962 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 963 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
963 | action->addTo( viewMenu ); | 964 | action->addTo( viewMenu ); |
964 | connect( action, SIGNAL( activated() ), | 965 | connect( action, SIGNAL( activated() ), |
965 | mView, SLOT( toggleDateNavigatorWidget() ) ); | 966 | mView, SLOT( toggleDateNavigatorWidget() ) ); |
966 | mToggleNav = action ; | 967 | mToggleNav = action ; |
967 | icon = loadPixmap( pathString + "allday" ); | 968 | icon = loadPixmap( pathString + "allday" ); |
968 | configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); | 969 | configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); |
969 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); | 970 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); |
970 | action->addTo( viewMenu ); | 971 | action->addTo( viewMenu ); |
971 | connect( action, SIGNAL( activated() ), | 972 | connect( action, SIGNAL( activated() ), |
972 | mView, SLOT( toggleAllDaySize() ) ); | 973 | mView, SLOT( toggleAllDaySize() ) ); |
973 | mToggleAllday = action; | 974 | mToggleAllday = action; |
974 | 975 | ||
975 | 976 | ||
976 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 977 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
977 | mToggleNav, SLOT( setEnabled ( bool ) ) ); | 978 | mToggleNav, SLOT( setEnabled ( bool ) ) ); |
978 | //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 979 | //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
979 | // mToggleFilter, SLOT( setEnabled ( bool ) ) ); | 980 | // mToggleFilter, SLOT( setEnabled ( bool ) ) ); |
980 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 981 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
981 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); | 982 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); |
982 | // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 983 | // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
983 | // configureAgendaMenu, SLOT( setEnabled ( bool ) ) ); | 984 | // configureAgendaMenu, SLOT( setEnabled ( bool ) ) ); |
984 | 985 | ||
985 | 986 | ||
986 | dPickerAction->addTo( iconToolBar ); | 987 | dPickerAction->addTo( iconToolBar ); |
987 | viewMenu->insertSeparator(); | 988 | viewMenu->insertSeparator(); |
988 | 989 | ||
989 | if ( p-> mShowIconToggleFull ) | 990 | if ( p-> mShowIconToggleFull ) |
990 | FSaction->addTo( iconToolBar ); | 991 | FSaction->addTo( iconToolBar ); |
991 | if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); | 992 | if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); |
992 | 993 | ||
993 | //******************** | 994 | //******************** |
994 | if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); | 995 | if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); |
995 | 996 | ||
996 | 997 | ||
997 | icon = loadPixmap( pathString + "whatsnext" ); | 998 | icon = loadPixmap( pathString + "whatsnext" ); |
998 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); | 999 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); |
999 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); | 1000 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); |
1000 | whatsnext_action->addTo( viewMenu ); | 1001 | whatsnext_action->addTo( viewMenu ); |
1001 | connect( whatsnext_action, SIGNAL( activated() ), | 1002 | connect( whatsnext_action, SIGNAL( activated() ), |
1002 | mView->viewManager(), SLOT( showWhatsNextView() ) ); | 1003 | mView->viewManager(), SLOT( showWhatsNextView() ) ); |
1003 | 1004 | ||
1004 | icon = loadPixmap( pathString + "xdays" ); | 1005 | icon = loadPixmap( pathString + "xdays" ); |
1005 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); | 1006 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); |
1006 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); | 1007 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); |
1007 | xdays_action->addTo( viewMenu ); | 1008 | xdays_action->addTo( viewMenu ); |
1008 | connect( xdays_action, SIGNAL( activated() ), | 1009 | connect( xdays_action, SIGNAL( activated() ), |
1009 | mView->viewManager(), SLOT( showNextXView() ) ); | 1010 | mView->viewManager(), SLOT( showNextXView() ) ); |
1010 | 1011 | ||
1011 | 1012 | ||
1012 | icon = loadPixmap( pathString + "journal" ); | 1013 | icon = loadPixmap( pathString + "journal" ); |
1013 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); | 1014 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); |
1014 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); | 1015 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); |
1015 | viewjournal_action->addTo( viewMenu ); | 1016 | viewjournal_action->addTo( viewMenu ); |
1016 | connect( viewjournal_action, SIGNAL( activated() ), | 1017 | connect( viewjournal_action, SIGNAL( activated() ), |
1017 | mView->viewManager(), SLOT( showJournalView() ) ); | 1018 | mView->viewManager(), SLOT( showJournalView() ) ); |
1018 | 1019 | ||
1019 | 1020 | ||
1020 | icon = loadPixmap( pathString + "day" ); | 1021 | icon = loadPixmap( pathString + "day" ); |
1021 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); | 1022 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); |
1022 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); | 1023 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); |
1023 | day1_action->addTo( viewMenu ); | 1024 | day1_action->addTo( viewMenu ); |
1024 | // action->addTo( toolBar ); | 1025 | // action->addTo( toolBar ); |
1025 | connect( day1_action, SIGNAL( activated() ), | 1026 | connect( day1_action, SIGNAL( activated() ), |
1026 | mView->viewManager(), SLOT( showDayView() ) ); | 1027 | mView->viewManager(), SLOT( showDayView() ) ); |
1027 | 1028 | ||
1028 | icon = loadPixmap( pathString + "workweek" ); | 1029 | icon = loadPixmap( pathString + "workweek" ); |
1029 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); | 1030 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); |
1030 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); | 1031 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); |
1031 | day5_action->addTo( viewMenu ); | 1032 | day5_action->addTo( viewMenu ); |
1032 | connect( day5_action, SIGNAL( activated() ), | 1033 | connect( day5_action, SIGNAL( activated() ), |
1033 | mView->viewManager(), SLOT( showWorkWeekView() ) ); | 1034 | mView->viewManager(), SLOT( showWorkWeekView() ) ); |
1034 | 1035 | ||
1035 | icon = loadPixmap( pathString + "week" ); | 1036 | icon = loadPixmap( pathString + "week" ); |
1036 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); | 1037 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); |
1037 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); | 1038 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); |
1038 | day7_action->addTo( viewMenu ); | 1039 | day7_action->addTo( viewMenu ); |
1039 | connect( day7_action, SIGNAL( activated() ), | 1040 | connect( day7_action, SIGNAL( activated() ), |
1040 | mView->viewManager(), SLOT( showWeekView() ) ); | 1041 | mView->viewManager(), SLOT( showWeekView() ) ); |
1041 | 1042 | ||
1042 | icon = loadPixmap( pathString + "workweek2" ); | 1043 | icon = loadPixmap( pathString + "workweek2" ); |
1043 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); | 1044 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); |
1044 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); | 1045 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); |
1045 | day6_action->addTo( viewMenu ); | 1046 | day6_action->addTo( viewMenu ); |
1046 | connect( day6_action, SIGNAL( activated() ), | 1047 | connect( day6_action, SIGNAL( activated() ), |
1047 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); | 1048 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); |
1048 | 1049 | ||
1049 | icon = loadPixmap( pathString + "month" ); | 1050 | icon = loadPixmap( pathString + "month" ); |
1050 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); | 1051 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); |
1051 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); | 1052 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); |
1052 | month_action->addTo( viewMenu ); | 1053 | month_action->addTo( viewMenu ); |
1053 | connect( month_action, SIGNAL( activated() ), | 1054 | connect( month_action, SIGNAL( activated() ), |
1054 | mView->viewManager(), SLOT( showMonthView() ) ); | 1055 | mView->viewManager(), SLOT( showMonthView() ) ); |
1055 | 1056 | ||
1056 | icon = loadPixmap( pathString + "list" ); | 1057 | icon = loadPixmap( pathString + "list" ); |
1057 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); | 1058 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); |
1058 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); | 1059 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); |
1059 | showlist_action->addTo( viewMenu ); | 1060 | showlist_action->addTo( viewMenu ); |
1060 | connect( showlist_action, SIGNAL( activated() ), | 1061 | connect( showlist_action, SIGNAL( activated() ), |
1061 | mView->viewManager(), SLOT( showListView() ) ); | 1062 | mView->viewManager(), SLOT( showListView() ) ); |
1062 | 1063 | ||
1063 | icon = loadPixmap( pathString + "todo" ); | 1064 | icon = loadPixmap( pathString + "todo" ); |
1064 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); | 1065 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); |
1065 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); | 1066 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); |
1066 | todoview_action->addTo( viewMenu ); | 1067 | todoview_action->addTo( viewMenu ); |
1067 | connect( todoview_action, SIGNAL( activated() ), | 1068 | connect( todoview_action, SIGNAL( activated() ), |
1068 | mView->viewManager(), SLOT( showTodoView() ) ); | 1069 | mView->viewManager(), SLOT( showTodoView() ) ); |
1069 | 1070 | ||
1070 | 1071 | ||
1071 | 1072 | ||
1072 | #if 0 | 1073 | #if 0 |
1073 | action = new QAction( "view_timespan", "Time Span", 0, this ); | 1074 | action = new QAction( "view_timespan", "Time Span", 0, this ); |
1074 | action->addTo( viewMenu ); | 1075 | action->addTo( viewMenu ); |
1075 | connect( action, SIGNAL( activated() ), | 1076 | connect( action, SIGNAL( activated() ), |
1076 | mView->viewManager(), SLOT( showTimeSpanView() ) ); | 1077 | mView->viewManager(), SLOT( showTimeSpanView() ) ); |
1077 | #endif | 1078 | #endif |
1078 | 1079 | ||
1079 | 1080 | ||
1080 | 1081 | ||
1081 | action = new QAction( "purge_completed", i18n("Purge Completed..."), 0, | 1082 | action = new QAction( "purge_completed", i18n("Purge Completed..."), 0, |
1082 | this ); | 1083 | this ); |
1083 | action->addTo( actionMenu ); | 1084 | action->addTo( actionMenu ); |
1084 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); | 1085 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); |
1085 | 1086 | ||
1086 | 1087 | ||
1087 | icon = loadPixmap( pathString + "search" ); | 1088 | icon = loadPixmap( pathString + "search" ); |
1088 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); | 1089 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); |
1089 | 1090 | ||
1090 | 1091 | ||
1091 | 1092 | ||
1092 | actionMenu->insertSeparator(); | 1093 | actionMenu->insertSeparator(); |
1093 | action = new QAction( "manage cat", i18n("Edit category list..."), 0, | 1094 | action = new QAction( "manage cat", i18n("Edit category list..."), 0, |
1094 | this ); | 1095 | this ); |
1095 | action->addTo( actionMenu ); | 1096 | action->addTo( actionMenu ); |
1096 | connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) ); | 1097 | connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) ); |
1097 | 1098 | ||
1098 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, | 1099 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, |
1099 | this ); | 1100 | this ); |
1100 | action->addTo( actionMenu ); | 1101 | action->addTo( actionMenu ); |
1101 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); | 1102 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); |
1102 | 1103 | ||
1103 | 1104 | ||
1104 | actionMenu->insertSeparator(); | 1105 | actionMenu->insertSeparator(); |
1105 | icon = loadPixmap( pathString + "configure" ); | 1106 | icon = loadPixmap( pathString + "configure" ); |
1106 | action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); | 1107 | action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); |
1107 | action->addTo( actionMenu ); | 1108 | action->addTo( actionMenu ); |
1108 | connect( action, SIGNAL( activated() ), | 1109 | connect( action, SIGNAL( activated() ), |
1109 | mView, SLOT( edit_options() ) ); | 1110 | mView, SLOT( edit_options() ) ); |
1110 | action = new QAction( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this ); | 1111 | action = new QAction( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this ); |
1111 | action->addTo( actionMenu ); | 1112 | action->addTo( actionMenu ); |
1112 | connect( action, SIGNAL( activated() ), | 1113 | connect( action, SIGNAL( activated() ), |
1113 | this, SLOT( calHint() ) ); | 1114 | this, SLOT( calHint() ) ); |
1114 | action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); | 1115 | action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); |
1115 | action->addTo( actionMenu ); | 1116 | action->addTo( actionMenu ); |
1116 | connect( action, SIGNAL( activated() ), | 1117 | connect( action, SIGNAL( activated() ), |
1117 | mView, SLOT( edit_global_options() ) ); | 1118 | mView, SLOT( edit_global_options() ) ); |
1118 | if ( KOPrefs::instance()->mShowFullMenu ) { | 1119 | if ( KOPrefs::instance()->mShowFullMenu ) { |
1119 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); | 1120 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); |
1120 | 1121 | ||
1121 | } | 1122 | } |
1122 | // actionMenu->insertSeparator(); | 1123 | // actionMenu->insertSeparator(); |
1123 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, | 1124 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, |
1124 | this ); | 1125 | this ); |
1125 | action->addTo( importMenu_X ); | 1126 | action->addTo( importMenu_X ); |
1126 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); | 1127 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); |
1127 | action = new QAction( "import_quick", i18n("Import last file"), 0, | 1128 | action = new QAction( "import_quick", i18n("Import last file"), 0, |
1128 | this ); | 1129 | this ); |
1129 | action->addTo( importMenu_X ); | 1130 | action->addTo( importMenu_X ); |
1130 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); | 1131 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); |
1131 | importMenu_X->insertSeparator(); | 1132 | importMenu_X->insertSeparator(); |
1132 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, | 1133 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, |
1133 | this ); | 1134 | this ); |
1134 | action->addTo( importMenu_X ); | 1135 | action->addTo( importMenu_X ); |
1135 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); | 1136 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); |
1136 | //#ifndef DESKTOP_VERSION | 1137 | //#ifndef DESKTOP_VERSION |
1137 | importMenu_X->insertSeparator(); | 1138 | importMenu_X->insertSeparator(); |
1138 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, | 1139 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, |
1139 | this ); | 1140 | this ); |
1140 | action->addTo( importMenu_X ); | 1141 | action->addTo( importMenu_X ); |
1141 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); | 1142 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); |
1142 | //#else | 1143 | //#else |
1143 | #ifdef _OL_IMPORT_ | 1144 | #ifdef _OL_IMPORT_ |
1144 | importMenu_X->insertSeparator(); | 1145 | importMenu_X->insertSeparator(); |
1145 | action = new QAction( "import_ol", i18n("Import from OL"), 0, | 1146 | action = new QAction( "import_ol", i18n("Import from OL"), 0, |
1146 | this ); | 1147 | this ); |
1147 | action->addTo( importMenu_X ); | 1148 | action->addTo( importMenu_X ); |
1148 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); | 1149 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); |
1149 | #endif | 1150 | #endif |
1150 | //#endif | 1151 | //#endif |
1151 | 1152 | ||
1152 | //importMenu->insertSeparator(); | 1153 | //importMenu->insertSeparator(); |
1153 | #if 0 | 1154 | #if 0 |
1154 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, | 1155 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, |
1155 | this ); | 1156 | this ); |
1156 | action->addTo( importMenu ); | 1157 | action->addTo( importMenu ); |
1157 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); | 1158 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); |
1158 | #endif | 1159 | #endif |
1159 | action = new QAction( "save_cal", i18n("Save Backup..."), 0, | 1160 | action = new QAction( "save_cal", i18n("Save Backup..."), 0, |
1160 | this ); | 1161 | this ); |
1161 | action->addTo( importMenu ); | 1162 | action->addTo( importMenu ); |
1162 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); | 1163 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); |
1163 | importMenu->insertSeparator(); | 1164 | importMenu->insertSeparator(); |
1164 | importMenu->insertItem( i18n("Import"), importMenu_X ); | 1165 | importMenu->insertItem( i18n("Import"), importMenu_X ); |
1165 | //importMenu->insertSeparator(); | 1166 | //importMenu->insertSeparator(); |
1166 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, | 1167 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, |
1167 | this ); | 1168 | this ); |
1168 | action->addTo( exportMenu_X ); | 1169 | action->addTo( exportMenu_X ); |
1169 | connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); | 1170 | connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); |
1170 | 1171 | ||
1171 | 1172 | ||
1172 | //LR | 1173 | //LR |
1173 | QPopupMenu *ex2phone = new QPopupMenu( this ); | 1174 | QPopupMenu *ex2phone = new QPopupMenu( this ); |
1174 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 1175 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
1175 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 1176 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
1176 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); | 1177 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); |
1177 | exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); | 1178 | exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); |
1178 | 1179 | ||
1179 | importMenu->insertItem( i18n("Export"), exportMenu_X ); | 1180 | importMenu->insertItem( i18n("Export"), exportMenu_X ); |
1180 | mPrintSelAction = 0; | 1181 | mPrintSelAction = 0; |
1181 | #ifndef DESKTOP_VERSION | 1182 | #ifndef DESKTOP_VERSION |
1182 | //importMenu->insertSeparator(); | 1183 | //importMenu->insertSeparator(); |
1183 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, | 1184 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, |
1184 | this ); | 1185 | this ); |
1185 | brAction->addTo( beamMenu_X ); | 1186 | brAction->addTo( beamMenu_X ); |
1186 | brAction->setToggleAction (true ) ; | 1187 | brAction->setToggleAction (true ) ; |
1187 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); | 1188 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); |
1188 | 1189 | ||
1189 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, | 1190 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, |
1190 | this ); | 1191 | this ); |
1191 | action->addTo( beamMenu_X ); | 1192 | action->addTo( beamMenu_X ); |
1192 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); | 1193 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); |
1193 | 1194 | ||
1194 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, | 1195 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, |
1195 | this ); | 1196 | this ); |
1196 | action->addTo( beamMenu_X ); | 1197 | action->addTo( beamMenu_X ); |
1197 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); | 1198 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); |
1198 | importMenu->insertItem( i18n("Beam"), beamMenu_X ); | 1199 | importMenu->insertItem( i18n("Beam"), beamMenu_X ); |
1199 | #else | 1200 | #else |
1200 | //importMenu->insertSeparator(); | 1201 | //importMenu->insertSeparator(); |
1201 | icon = loadPixmap( pathString + "print" ); | 1202 | icon = loadPixmap( pathString + "print" ); |
1202 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); | 1203 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); |
1203 | action->addTo( beamMenu_X ); | 1204 | action->addTo( beamMenu_X ); |
1204 | connect( action, SIGNAL( activated() ), | 1205 | connect( action, SIGNAL( activated() ), |
1205 | this, SLOT( printCal() ) ); | 1206 | this, SLOT( printCal() ) ); |
1206 | 1207 | ||
1207 | icon = loadPixmap( pathString + "week" ); | 1208 | icon = loadPixmap( pathString + "week" ); |
1208 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); | 1209 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); |
1209 | action->addTo( beamMenu_X ); | 1210 | action->addTo( beamMenu_X ); |
1210 | connect( action, SIGNAL( activated() ), | 1211 | connect( action, SIGNAL( activated() ), |
1211 | this, SLOT( printSel() ) ); | 1212 | this, SLOT( printSel() ) ); |
1212 | icon = loadPixmap( pathString + "whatsnext" ); | 1213 | icon = loadPixmap( pathString + "whatsnext" ); |
1213 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); | 1214 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); |
1214 | action->addTo( beamMenu_X ); | 1215 | action->addTo( beamMenu_X ); |
1215 | connect( action, SIGNAL( activated() ), | 1216 | connect( action, SIGNAL( activated() ), |
1216 | mView->viewManager(), SLOT( slotprintWNV() ) ); | 1217 | mView->viewManager(), SLOT( slotprintWNV() ) ); |
1217 | 1218 | ||
1218 | 1219 | ||
1219 | icon = loadPixmap( pathString + "list" ); | 1220 | icon = loadPixmap( pathString + "list" ); |
1220 | action = new QAction( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this ); | 1221 | action = new QAction( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this ); |
1221 | action->addTo( beamMenu_X ); | 1222 | action->addTo( beamMenu_X ); |
1222 | connect( action, SIGNAL( activated() ), | 1223 | connect( action, SIGNAL( activated() ), |
1223 | this, SLOT( printListView() ) ); | 1224 | this, SLOT( printListView() ) ); |
1224 | 1225 | ||
1225 | icon = loadPixmap( pathString + "newevent" ); | 1226 | icon = loadPixmap( pathString + "newevent" ); |
1226 | action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); | 1227 | action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); |
1227 | action->addTo( beamMenu_X ); | 1228 | action->addTo( beamMenu_X ); |
1228 | connect( action, SIGNAL( activated() ), | 1229 | connect( action, SIGNAL( activated() ), |
1229 | mView, SLOT( slotprintSelInc() ) ); | 1230 | mView, SLOT( slotprintSelInc() ) ); |
1230 | mPrintSelAction = action; | 1231 | mPrintSelAction = action; |
1231 | importMenu->insertItem( i18n("Print"), beamMenu_X ); | 1232 | importMenu->insertItem( i18n("Print"), beamMenu_X ); |
1232 | #endif | 1233 | #endif |
1233 | 1234 | ||
1234 | importMenu->insertSeparator(); | 1235 | importMenu->insertSeparator(); |
1235 | action = new QAction( "beam all", i18n("Save"), 0, | 1236 | action = new QAction( "beam all", i18n("Save"), 0, |
1236 | this ); | 1237 | this ); |
1237 | action->addTo( importMenu ); | 1238 | action->addTo( importMenu ); |
1238 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); | 1239 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); |
1239 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, | 1240 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, |
1240 | this ); | 1241 | this ); |
1241 | action->addTo( importMenu ); | 1242 | action->addTo( importMenu ); |
1242 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); | 1243 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); |
1243 | 1244 | ||
1244 | //menuBar->insertItem( "Configure",configureMenu ); | 1245 | //menuBar->insertItem( "Configure",configureMenu ); |
1245 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); | 1246 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); |
1246 | icon = loadPixmap( "korganizer/korganizer" ); | 1247 | icon = loadPixmap( "korganizer/korganizer" ); |
1247 | 1248 | ||
1248 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); | 1249 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); |
1249 | action->addTo( helpMenu ); | 1250 | action->addTo( helpMenu ); |
1250 | connect( action, SIGNAL( activated() ), | 1251 | connect( action, SIGNAL( activated() ), |
1251 | SLOT( whatsNew() ) ); | 1252 | SLOT( whatsNew() ) ); |
1252 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); | 1253 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); |
1253 | action->addTo( helpMenu ); | 1254 | action->addTo( helpMenu ); |
1254 | connect( action, SIGNAL( activated() ), | 1255 | connect( action, SIGNAL( activated() ), |
1255 | SLOT( features() ) ); | 1256 | SLOT( features() ) ); |
1256 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); | 1257 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); |
1257 | action->addTo( helpMenu ); | 1258 | action->addTo( helpMenu ); |
1258 | connect( action, SIGNAL( activated() ), | 1259 | connect( action, SIGNAL( activated() ), |
1259 | SLOT( keyBindings() ) ); | 1260 | SLOT( keyBindings() ) ); |
1260 | action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this ); | 1261 | action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this ); |
1261 | action->addTo( helpMenu ); | 1262 | action->addTo( helpMenu ); |
1262 | connect( action, SIGNAL( activated() ), | 1263 | connect( action, SIGNAL( activated() ), |
1263 | SLOT( storagehowto() ) ); | 1264 | SLOT( storagehowto() ) ); |
1264 | action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this ); | 1265 | action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this ); |
1265 | action->addTo( helpMenu ); | 1266 | action->addTo( helpMenu ); |
1266 | connect( action, SIGNAL( activated() ), | 1267 | connect( action, SIGNAL( activated() ), |
1267 | SLOT( timetrackinghowto() ) ); | 1268 | SLOT( timetrackinghowto() ) ); |
1268 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); | 1269 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); |
1269 | action->addTo( helpMenu ); | 1270 | action->addTo( helpMenu ); |
1270 | connect( action, SIGNAL( activated() ), | 1271 | connect( action, SIGNAL( activated() ), |
1271 | SLOT( synchowto() ) ); | 1272 | SLOT( synchowto() ) ); |
1272 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); | 1273 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); |
1273 | action->addTo( helpMenu ); | 1274 | action->addTo( helpMenu ); |
1274 | connect( action, SIGNAL( activated() ), | 1275 | connect( action, SIGNAL( activated() ), |
1275 | SLOT( kdesynchowto() ) ); | 1276 | SLOT( kdesynchowto() ) ); |
1276 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); | 1277 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); |
1277 | action->addTo( helpMenu ); | 1278 | action->addTo( helpMenu ); |
1278 | connect( action, SIGNAL( activated() ), | 1279 | connect( action, SIGNAL( activated() ), |
1279 | SLOT( multisynchowto() ) ); | 1280 | SLOT( multisynchowto() ) ); |
1280 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); | 1281 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); |
1281 | action->addTo( helpMenu ); | 1282 | action->addTo( helpMenu ); |
1282 | connect( action, SIGNAL( activated() ), | 1283 | connect( action, SIGNAL( activated() ), |
1283 | SLOT( aboutAutoSaving() ) ); | 1284 | SLOT( aboutAutoSaving() ) ); |
1284 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); | 1285 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); |
1285 | action->addTo( helpMenu ); | 1286 | action->addTo( helpMenu ); |
1286 | connect( action, SIGNAL( activated() ), | 1287 | connect( action, SIGNAL( activated() ), |
1287 | SLOT( aboutKnownBugs() ) ); | 1288 | SLOT( aboutKnownBugs() ) ); |
1288 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); | 1289 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); |
1289 | action->addTo( helpMenu ); | 1290 | action->addTo( helpMenu ); |
1290 | connect( action, SIGNAL( activated() ), | 1291 | connect( action, SIGNAL( activated() ), |
1291 | SLOT( usertrans() ) ); | 1292 | SLOT( usertrans() ) ); |
1292 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); | 1293 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); |
1293 | action->addTo( helpMenu ); | 1294 | action->addTo( helpMenu ); |
1294 | connect( action, SIGNAL( activated() ), | 1295 | connect( action, SIGNAL( activated() ), |
1295 | SLOT( faq() ) ); | 1296 | SLOT( faq() ) ); |
1296 | action = new QAction( "licence", i18n("Licence..."), 0, this ); | 1297 | action = new QAction( "licence", i18n("Licence..."), 0, this ); |
1297 | action->addTo( helpMenu ); | 1298 | action->addTo( helpMenu ); |
1298 | connect( action, SIGNAL( activated() ), | 1299 | connect( action, SIGNAL( activated() ), |
1299 | SLOT( licence() ) ); | 1300 | SLOT( licence() ) ); |
1300 | action = new QAction( "about", i18n("About..."), 0, this ); | 1301 | action = new QAction( "about", i18n("About..."), 0, this ); |
1301 | action->addTo( helpMenu ); | 1302 | action->addTo( helpMenu ); |
1302 | connect( action, SIGNAL( activated() ), | 1303 | connect( action, SIGNAL( activated() ), |
1303 | SLOT( about() ) ); | 1304 | SLOT( about() ) ); |
1304 | //menuBar->insertSeparator(); | 1305 | //menuBar->insertSeparator(); |
1305 | 1306 | ||
1306 | // ****************************************************** | 1307 | // ****************************************************** |
1307 | // menubar icons | 1308 | // menubar icons |
1308 | 1309 | ||
1309 | 1310 | ||
1310 | 1311 | ||
1311 | //menuBar->insertItem( iconToolBar ); | 1312 | //menuBar->insertItem( iconToolBar ); |
1312 | //xdays_action | 1313 | //xdays_action |
1313 | if (p-> mShowIconNewEvent) | 1314 | if (p-> mShowIconNewEvent) |
1314 | ne_action->addTo( iconToolBar ); | 1315 | ne_action->addTo( iconToolBar ); |
1315 | if (p->mShowIconNewTodo ) | 1316 | if (p->mShowIconNewTodo ) |
1316 | nt_action->addTo( iconToolBar ); | 1317 | nt_action->addTo( iconToolBar ); |
1317 | if (p-> mShowIconSearch) | 1318 | if (p-> mShowIconSearch) |
1318 | search_action->addTo( iconToolBar ); | 1319 | search_action->addTo( iconToolBar ); |
1319 | if (p-> mShowIconWhatsThis) | 1320 | if (p-> mShowIconWhatsThis) |
1320 | QWhatsThis::whatsThisButton ( iconToolBar ); | 1321 | QWhatsThis::whatsThisButton ( iconToolBar ); |
1321 | if (p-> mShowIconNext) | 1322 | if (p-> mShowIconNext) |
1322 | whatsnext_action->addTo( viewToolBar ); | 1323 | whatsnext_action->addTo( viewToolBar ); |
1323 | if (p-> mShowIconNextDays) | 1324 | if (p-> mShowIconNextDays) |
1324 | xdays_action->addTo( viewToolBar ); | 1325 | xdays_action->addTo( viewToolBar ); |
1325 | if (p-> mShowIconJournal) | 1326 | if (p-> mShowIconJournal) |
1326 | viewjournal_action->addTo( viewToolBar ); | 1327 | viewjournal_action->addTo( viewToolBar ); |
1327 | if (p-> mShowIconDay1) | 1328 | if (p-> mShowIconDay1) |
1328 | day1_action->addTo( viewToolBar ); | 1329 | day1_action->addTo( viewToolBar ); |
1329 | if (p-> mShowIconDay5) | 1330 | if (p-> mShowIconDay5) |
1330 | day5_action->addTo( viewToolBar ); | 1331 | day5_action->addTo( viewToolBar ); |
1331 | if (p-> mShowIconDay7) | 1332 | if (p-> mShowIconDay7) |
1332 | day7_action->addTo( viewToolBar ); | 1333 | day7_action->addTo( viewToolBar ); |
1333 | if (p-> mShowIconDay6) | 1334 | if (p-> mShowIconDay6) |
1334 | day6_action->addTo( viewToolBar ); | 1335 | day6_action->addTo( viewToolBar ); |
1335 | if (p-> mShowIconMonth) | 1336 | if (p-> mShowIconMonth) |
1336 | month_action->addTo( viewToolBar ); | 1337 | month_action->addTo( viewToolBar ); |
1337 | if (p-> mShowIconList) | 1338 | if (p-> mShowIconList) |
1338 | showlist_action->addTo( viewToolBar ); | 1339 | showlist_action->addTo( viewToolBar ); |
1339 | if (p-> mShowIconTodoview) | 1340 | if (p-> mShowIconTodoview) |
1340 | todoview_action->addTo( viewToolBar ); | 1341 | todoview_action->addTo( viewToolBar ); |
1341 | 1342 | ||
1342 | icon = loadPixmap( pathString + "2leftarrowB" ); | 1343 | icon = loadPixmap( pathString + "2leftarrowB" ); |
1343 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); | 1344 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); |
1344 | if (p-> mShowIconBackFast) { | 1345 | if (p-> mShowIconBackFast) { |
1345 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); | 1346 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); |
1346 | connect( action, SIGNAL( activated() ), | 1347 | connect( action, SIGNAL( activated() ), |
1347 | mView, SLOT( goPreviousMonth() ) ); | 1348 | mView, SLOT( goPreviousMonth() ) ); |
1348 | action->addTo( navigatorToolBar ); | 1349 | action->addTo( navigatorToolBar ); |
1349 | } | 1350 | } |
1350 | icon = loadPixmap( pathString + "1leftarrowB" ); | 1351 | icon = loadPixmap( pathString + "1leftarrowB" ); |
1351 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); | 1352 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); |
1352 | if (p-> mShowIconBack) { | 1353 | if (p-> mShowIconBack) { |
1353 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); | 1354 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); |
1354 | connect( action, SIGNAL( activated() ), | 1355 | connect( action, SIGNAL( activated() ), |
1355 | mView, SLOT( goPrevious() ) ); | 1356 | mView, SLOT( goPrevious() ) ); |
1356 | action->addTo( navigatorToolBar ); | 1357 | action->addTo( navigatorToolBar ); |
1357 | } | 1358 | } |
1358 | icon = loadPixmap( pathString + "today" ); | 1359 | icon = loadPixmap( pathString + "today" ); |
1359 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); | 1360 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); |
1360 | if (p-> mShowIconToday) | 1361 | if (p-> mShowIconToday) |
1361 | today_action->addTo( navigatorToolBar ); | 1362 | today_action->addTo( navigatorToolBar ); |
1362 | icon = loadPixmap( pathString + "1rightarrowB" ); | 1363 | icon = loadPixmap( pathString + "1rightarrowB" ); |
1363 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); | 1364 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); |
1364 | if (p-> mShowIconForward) { | 1365 | if (p-> mShowIconForward) { |
1365 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); | 1366 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); |
1366 | connect( action, SIGNAL( activated() ), | 1367 | connect( action, SIGNAL( activated() ), |
1367 | mView, SLOT( goNext() ) ); | 1368 | mView, SLOT( goNext() ) ); |
1368 | action->addTo( navigatorToolBar ); | 1369 | action->addTo( navigatorToolBar ); |
1369 | } | 1370 | } |
1370 | icon = loadPixmap( pathString + "2rightarrowB" ); | 1371 | icon = loadPixmap( pathString + "2rightarrowB" ); |
1371 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); | 1372 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); |
1372 | if (p-> mShowIconForwardFast) { | 1373 | if (p-> mShowIconForwardFast) { |
1373 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); | 1374 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); |
1374 | connect( action, SIGNAL( activated() ), | 1375 | connect( action, SIGNAL( activated() ), |
1375 | mView, SLOT( goNextMonth() ) ); | 1376 | mView, SLOT( goNextMonth() ) ); |
1376 | action->addTo( navigatorToolBar ); | 1377 | action->addTo( navigatorToolBar ); |
1377 | } | 1378 | } |
1378 | 1379 | ||
1379 | 1380 | ||
1380 | configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6); | 1381 | configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6); |
1381 | 1382 | ||
1382 | 1383 | ||
1383 | if ( p->mShowIconNavigator ) configureToolBarMenu->setItemChecked( 22 , true); | 1384 | if ( p->mShowIconNavigator ) configureToolBarMenu->setItemChecked( 22 , true); |
1384 | if ( p->mShowIconAllday ) configureToolBarMenu->setItemChecked( 24 , true); | 1385 | if ( p->mShowIconAllday ) configureToolBarMenu->setItemChecked( 24 , true); |
1385 | if ( p->mShowIconFilterview ) configureToolBarMenu->setItemChecked( 26 , true); | 1386 | if ( p->mShowIconFilterview ) configureToolBarMenu->setItemChecked( 26 , true); |
1386 | if ( p->mShowIconToggleFull ) configureToolBarMenu->setItemChecked( 28 , true); | 1387 | if ( p->mShowIconToggleFull ) configureToolBarMenu->setItemChecked( 28 , true); |
1387 | 1388 | ||
1388 | if (p-> mShowIconNewEvent) | 1389 | if (p-> mShowIconNewEvent) |
1389 | configureToolBarMenu->setItemChecked( 10, true ); | 1390 | configureToolBarMenu->setItemChecked( 10, true ); |