summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp8
-rw-r--r--korganizer/mainwindow.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 4b00062..d4fadcb 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -154,128 +154,136 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
154 finfo.setFile( oldFile ); 154 finfo.setFile( oldFile );
155 if (finfo.exists() ) { 155 if (finfo.exists() ) {
156 KMessageBox::information( this, message); 156 KMessageBox::information( this, message);
157 mView->openCalendar( oldFile ); 157 mView->openCalendar( oldFile );
158 qApp->processEvents(); 158 qApp->processEvents();
159 } 159 }
160 } 160 }
161 mView->saveCalendar( defaultFileName() ); 161 mView->saveCalendar( defaultFileName() );
162 newFile = true; 162 newFile = true;
163 } 163 }
164 164
165 QTime neededSaveTime = QDateTime::currentDateTime().time(); 165 QTime neededSaveTime = QDateTime::currentDateTime().time();
166 if ( ! oldOpened ) 166 if ( ! oldOpened )
167 mView->openCalendar( defaultFileName() ); 167 mView->openCalendar( defaultFileName() );
168 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 168 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
169 qDebug("KO: Calendar loading time: %d ms",msNeeded ); 169 qDebug("KO: Calendar loading time: %d ms",msNeeded );
170 170
171 if ( KOPrefs::instance()->mLanguageChanged ) { 171 if ( KOPrefs::instance()->mLanguageChanged ) {
172 KOPrefs::instance()->setCategoryDefaults(); 172 KOPrefs::instance()->setCategoryDefaults();
173 int count = mView->addCategories(); 173 int count = mView->addCategories();
174 KOPrefs::instance()->mLanguageChanged = false; 174 KOPrefs::instance()->mLanguageChanged = false;
175 } 175 }
176 processIncidenceSelection( 0 ); 176 processIncidenceSelection( 0 );
177 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), 177 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ),
178 SLOT( processIncidenceSelection( Incidence * ) ) ); 178 SLOT( processIncidenceSelection( Incidence * ) ) );
179 connect( mView, SIGNAL( modifiedChanged( bool ) ), 179 connect( mView, SIGNAL( modifiedChanged( bool ) ),
180 SLOT( slotModifiedChanged( bool ) ) ); 180 SLOT( slotModifiedChanged( bool ) ) );
181 181
182 182
183 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); 183 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) );
184 mView->setModified( false ); 184 mView->setModified( false );
185 mBlockAtStartup = false; 185 mBlockAtStartup = false;
186 mView->setModified( false ); 186 mView->setModified( false );
187 setCentralWidget( mView ); 187 setCentralWidget( mView );
188 globalFlagBlockStartup = 0; 188 globalFlagBlockStartup = 0;
189 mView->show(); 189 mView->show();
190 delete splash; 190 delete splash;
191 if ( newFile ) 191 if ( newFile )
192 mView->updateConfig(); 192 mView->updateConfig();
193 // qApp->processEvents(); 193 // qApp->processEvents();
194 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 194 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
195 fillSyncMenu(); 195 fillSyncMenu();
196 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); 196 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins );
197 if ( showWarning ) { 197 if ( showWarning ) {
198 KMessageBox::information( this, 198 KMessageBox::information( this,
199 "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"); 199 "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");
200 qApp->processEvents(); 200 qApp->processEvents();
201 mView->dialogManager()->showSyncOptions(); 201 mView->dialogManager()->showSyncOptions();
202 } 202 }
203 203
204 //US listen for result adressed from Ka/Pi 204 //US listen for result adressed from Ka/Pi
205 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 205 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
206} 206}
207MainWindow::~MainWindow() 207MainWindow::~MainWindow()
208{ 208{
209 //qDebug("MainWindow::~MainWindow() "); 209 //qDebug("MainWindow::~MainWindow() ");
210 //save toolbar location 210 //save toolbar location
211 211
212 delete mCalendar; 212 delete mCalendar;
213 delete KOPrefs::instance(); 213 delete KOPrefs::instance();
214 delete KIncidenceFormatter::instance(); 214 delete KIncidenceFormatter::instance();
215 215
216 216
217} 217}
218void MainWindow::showMaximized ()
219{
220#ifndef DESKTOP_VERSION
221 if ( ! globalFlagBlockStartup )
222 mView->goToday();
223#endif
224 QWidget::showMaximized () ;
225}
218void MainWindow::closeEvent( QCloseEvent* ce ) 226void MainWindow::closeEvent( QCloseEvent* ce )
219{ 227{
220 228
221 229
222 230
223 if ( ! KOPrefs::instance()->mAskForQuit ) { 231 if ( ! KOPrefs::instance()->mAskForQuit ) {
224 saveOnClose(); 232 saveOnClose();
225 ce->accept(); 233 ce->accept();
226 return; 234 return;
227 235
228 } 236 }
229 237
230 switch( QMessageBox::information( this, "KO/Pi", 238 switch( QMessageBox::information( this, "KO/Pi",
231 i18n("Do you really want\nto close KO/Pi?"), 239 i18n("Do you really want\nto close KO/Pi?"),
232 i18n("Close"), i18n("No"), 240 i18n("Close"), i18n("No"),
233 0, 0 ) ) { 241 0, 0 ) ) {
234 case 0: 242 case 0:
235 saveOnClose(); 243 saveOnClose();
236 ce->accept(); 244 ce->accept();
237 break; 245 break;
238 case 1: 246 case 1:
239 ce->ignore(); 247 ce->ignore();
240 break; 248 break;
241 case 2: 249 case 2:
242 250
243 default: 251 default:
244 break; 252 break;
245 } 253 }
246 254
247 255
248} 256}
249 257
250void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) 258void MainWindow::recieve( const QCString& cmsg, const QByteArray& data )
251{ 259{
252 QDataStream stream( data, IO_ReadOnly ); 260 QDataStream stream( data, IO_ReadOnly );
253 // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); 261 // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" );
254 //QString datamess; 262 //QString datamess;
255 //qDebug("message "); 263 //qDebug("message ");
256 qDebug("KO: QCOP message received: %s ", cmsg.data() ); 264 qDebug("KO: QCOP message received: %s ", cmsg.data() );
257 265
258 if ( cmsg == "-writeFile" ) { 266 if ( cmsg == "-writeFile" ) {
259 // I made from the "-writeFile" an "-writeAlarm" 267 // I made from the "-writeFile" an "-writeAlarm"
260 mView->viewManager()->showWhatsNextView(); 268 mView->viewManager()->showWhatsNextView();
261 mCalendar->checkAlarmForIncidence( 0, true); 269 mCalendar->checkAlarmForIncidence( 0, true);
262 showMaximized(); 270 showMaximized();
263 raise(); 271 raise();
264 return; 272 return;
265 } 273 }
266 274
267 if ( cmsg == "-writeFile" ) { 275 if ( cmsg == "-writeFile" ) {
268 // I made from the "-writeFile" an "-writeAlarm" 276 // I made from the "-writeFile" an "-writeAlarm"
269 mView->viewManager()->showWhatsNextView(); 277 mView->viewManager()->showWhatsNextView();
270 mCalendar->checkAlarmForIncidence( 0, true); 278 mCalendar->checkAlarmForIncidence( 0, true);
271 showMaximized(); 279 showMaximized();
272 raise(); 280 raise();
273 return; 281 return;
274 282
275 } 283 }
276 if ( cmsg == "-writeFileSilent" ) { 284 if ( cmsg == "-writeFileSilent" ) {
277 // I made from the "-writeFile" an "-writeAlarm" 285 // I made from the "-writeFile" an "-writeAlarm"
278 // mView->viewManager()->showWhatsNextView(); 286 // mView->viewManager()->showWhatsNextView();
279 mCalendar->checkAlarmForIncidence( 0, true); 287 mCalendar->checkAlarmForIncidence( 0, true);
280 //showMaximized(); 288 //showMaximized();
281 //raise(); 289 //raise();
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index 1d87db0..3e854cb 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -1,97 +1,98 @@
1#ifndef KORGE_MAINWINDOW_H 1#ifndef KORGE_MAINWINDOW_H
2#define KORGE_MAINWINDOW_H 2#define KORGE_MAINWINDOW_H
3 3
4#include <qmainwindow.h> 4#include <qmainwindow.h>
5#include <qtimer.h> 5#include <qtimer.h>
6#include <qdict.h> 6#include <qdict.h>
7 7
8#include <libkcal/incidence.h> 8#include <libkcal/incidence.h>
9#include "simplealarmclient.h" 9#include "simplealarmclient.h"
10 10
11class QAction; 11class QAction;
12class CalendarView; 12class CalendarView;
13class KSyncProfile; 13class KSyncProfile;
14#ifdef DESKTOP_VERSION 14#ifdef DESKTOP_VERSION
15 15
16#define QPEToolBar QToolBar 16#define QPEToolBar QToolBar
17#define QPEMenuBar QMenuBar 17#define QPEMenuBar QMenuBar
18#endif 18#endif
19class QPEToolBar; 19class QPEToolBar;
20 20
21namespace KCal { 21namespace KCal {
22class CalendarLocal; 22class CalendarLocal;
23} 23}
24 24
25using namespace KCal; 25using namespace KCal;
26 26
27class MainWindow : public QMainWindow 27class MainWindow : public QMainWindow
28{ 28{
29 Q_OBJECT 29 Q_OBJECT
30 public: 30 public:
31 MainWindow( QWidget *parent = 0, const char *name = 0, QString command = ""); 31 MainWindow( QWidget *parent = 0, const char *name = 0, QString command = "");
32 ~MainWindow(); 32 ~MainWindow();
33 public slots: 33 public slots:
34 virtual void showMaximized ();
34 void configureAgenda( int ); 35 void configureAgenda( int );
35 void recieve( const QCString& msg, const QByteArray& data ); 36 void recieve( const QCString& msg, const QByteArray& data );
36 static QString defaultFileName(); 37 static QString defaultFileName();
37 static QString resourcePath(); 38 static QString resourcePath();
38 protected slots: 39 protected slots:
39 void setCaptionToDates(); 40 void setCaptionToDates();
40 int ringSync(); 41 int ringSync();
41 void multiSync( bool askforPrefs = false ); 42 void multiSync( bool askforPrefs = false );
42 void about(); 43 void about();
43 void licence(); 44 void licence();
44 void faq(); 45 void faq();
45 void usertrans(); 46 void usertrans();
46 void features(); 47 void features();
47 void synchowto(); 48 void synchowto();
48 void whatsNew(); 49 void whatsNew();
49 void keyBindings(); 50 void keyBindings();
50 void aboutAutoSaving();; 51 void aboutAutoSaving();;
51 void aboutKnownBugs(); 52 void aboutKnownBugs();
52 53
53 void processIncidenceSelection( Incidence * ); 54 void processIncidenceSelection( Incidence * );
54 55
55 void importQtopia(); 56 void importQtopia();
56 void importBday(); 57 void importBday();
57 void importOL(); 58 void importOL();
58 void importIcal(); 59 void importIcal();
59 void importFile( QString, bool ); 60 void importFile( QString, bool );
60 void quickImportIcal(); 61 void quickImportIcal();
61 62
62 void slotModifiedChanged( bool ); 63 void slotModifiedChanged( bool );
63 64
64 void save(); 65 void save();
65 void configureToolBar( int ); 66 void configureToolBar( int );
66 void printSel(); 67 void printSel();
67 void printCal(); 68 void printCal();
68 void saveCalendar(); 69 void saveCalendar();
69 void loadCalendar(); 70 void loadCalendar();
70 void exportVCalendar(); 71 void exportVCalendar();
71 void fillFilterMenu(); 72 void fillFilterMenu();
72 void selectFilter( int ); 73 void selectFilter( int );
73 74
74 void slotSyncMenu( int ); 75 void slotSyncMenu( int );
75 void syncSSH(); 76 void syncSSH();
76 void confSync(); 77 void confSync();
77 void syncSharp(); 78 void syncSharp();
78 void syncPhone(); 79 void syncPhone();
79 void syncLocalFile(); 80 void syncLocalFile();
80 bool syncWithFile( QString, bool ); 81 bool syncWithFile( QString, bool );
81 void quickSyncLocalFile(); 82 void quickSyncLocalFile();
82 83
83 84
84 protected: 85 protected:
85 void displayText( QString, QString); 86 void displayText( QString, QString);
86 void displayFile( QString, QString); 87 void displayFile( QString, QString);
87 88
88 void enableIncidenceActions( bool ); 89 void enableIncidenceActions( bool );
89 90
90 private: 91 private:
91 void saveOnClose(); 92 void saveOnClose();
92 int mCurrentSyncProfile; 93 int mCurrentSyncProfile;
93 void syncRemote( KSyncProfile* , bool ask = true); 94 void syncRemote( KSyncProfile* , bool ask = true);
94 void fillSyncMenu(); 95 void fillSyncMenu();
95 bool mFlagKeyPressed; 96 bool mFlagKeyPressed;
96 bool mBlockAtStartup; 97 bool mBlockAtStartup;
97 QPEToolBar *iconToolBar; 98 QPEToolBar *iconToolBar;