-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 2 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 4 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 5 | ||||
-rw-r--r-- | korganizer/main.cpp | 4 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 64 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 6 |
6 files changed, 62 insertions, 23 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index fcfa282..fbd262c 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt @@ -1546,17 +1546,17 @@ { "<b>iCal (*.ics) file on disk:</b><br>(will be created, if not existing)","<b>iCal (*.ics) Datei:</b><br>(Datei wird angelegt, wenn sie nicht existiert)" }, { "Error saving data","Fehler beim Abspeichern" }, { "Calendar(s) not saved:","Nicht gespeicherte Kalender:" }, { "Enable conflict detection","Schalte Konflikterkennung an" }, { "Conflict detection checks an <b>edited event</b> with other <b>existing events</b> for overlapping. You can define which events are checked:","Konflikterkennung prüft einen <b>bearbeiteten Termin</b> auf Überschneidungen mit <b>anderen Terminen</b>. Sie können einstellen welche Termine überprüft werden:" }, { "Filter for the edited event","Filter für den bearbeiteten Termin" }, { "Filter for other existing events","Filter für die anderen Termine" }, { "Check Allday with Allday","Prüfe GanzTag mit GanzTag" }, { "Check Allday with NonAllday","Prüfe GanzTag mit NichtGanzTag" }, { "Check NonAllday with Allday","Prüfe NichtGanzTag mit GanzTag" }, { "Check NonAllday with NonAllday","Prüfe NichtGanzTag mit NichtGanzTag" }, { "Conflict detection","Konflikterkennung" }, -{ "","" }, +{ "Loading calendar files ... please wait","Lade Kalenderdateien ... bitte warten" }, { "","" }, { "","" }, { "","" }, { "","" }, diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index e3b62de..9928b48 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -2382,26 +2382,26 @@ bool CalendarView::openCalendar(QString filename, bool merge) if ( merge ) ;//setModified( true ); else { //setModified( true ); mViewManager->setDocumentId( filename ); mDialogManager->setDocumentId( filename ); mTodoList->setDocumentId( filename ); } globalFlagBlockAgenda = 2; // if ( getLastSyncEvent() ) // getLastSyncEvent()->setReadOnly( true ); mCalendar->reInitAlarmSettings(); setSyncEventsReadOnly(); - updateUnmanagedViews(); - updateView(); + //updateUnmanagedViews(); + //updateView(); if ( filename != MainWindow::defaultFileName() ) { saveCalendar( MainWindow::defaultFileName() ); } else { QFileInfo finf ( MainWindow::defaultFileName()); if ( finf.exists() ) { setLoadedFileVersion( finf.lastModified () ); } } return true; } else { // while failing to load, the calendar object could // have become partially populated. Clear it out. diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 17248dc..07bfdbf 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -495,24 +495,29 @@ void KOQuickTodo::focusInEvent(QFocusEvent *ev) void KOQuickTodo::focusOutEvent(QFocusEvent *ev) { setText(i18n("Click to add new Todo")); QLineEdit::focusOutEvent(ev); } ///////////////////////////////////////////////////////////////////////////// KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : KOrg::BaseView(calendar,parent,name) { + + mCurItem = 0; + mCurItemRootParent = 0; + mCurItemParent = 0; + mCurItemAbove = 0; mActiveItem = 0; mCategoryPopupMenu = 0; mPendingUpdateBeforeRepaint = false; isFlatDisplay = false; mNavigator = 0; QBoxLayout *topLayout = new QVBoxLayout(this); mName = QString ( name ); mBlockUpdate = false; mQuickBar = new QWidget( this ); topLayout->addWidget(mQuickBar); mQuickAdd = new KOQuickTodo(mQuickBar); diff --git a/korganizer/main.cpp b/korganizer/main.cpp index c9d1345..6339370 100644 --- a/korganizer/main.cpp +++ b/korganizer/main.cpp @@ -80,31 +80,31 @@ int main( int argc, char **argv ) KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); #else fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); #endif KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer"))); QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); KPimGlobalPrefs::instance()->setGlobalConfig(); MainWindow m; #ifndef DESKTOP_VERSION - QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); + QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(receiveStart( const QCString&, const QByteArray& ))); a.showMainWidget(&m ); #else a.setMainWidget(&m ); m.show(); //m.resize( 800, 600 ); - QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); + //QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); #endif if ( argc > 1 ) { QCString command = argv[1]; if ( argc > 2 ) command += argv[2]; qApp->processEvents(); m.recieve(command, QByteArray() ); } a.exec(); dumpMissing(); diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 9ae393d..8c72d89 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -337,104 +337,126 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) : oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); finfo.setFile( oldFile ); if (finfo.exists() ) { KMessageBox::information( this, message); mView->openCalendar( oldFile ); qApp->processEvents(); } } mView->saveCalendar( defaultFileName() ); newFile = true; } - QTime neededSaveTime = QDateTime::currentDateTime().time(); - mView->loadCalendars(); - int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); - qDebug("KO: Calendar loading time: %d ms",msNeeded ); + //QTime neededSaveTime = QDateTime::currentDateTime().time(); + //mView->loadCalendars(); + //int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); + //qDebug("KO: Calendar loading time: %d ms",msNeeded ); if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { KOPrefs::instance()->setAllDefaults(); } - processIncidenceSelection( 0 ); - connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), - SLOT( processIncidenceSelection( Incidence * ) ) ); - connect( mView, SIGNAL( modifiedChanged( bool ) ), - SLOT( slotModifiedChanged( bool ) ) ); connect( mView, SIGNAL( tempDisableBR(bool) ), SLOT( disableBR(bool) ) ); connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); - mView->setModified( false ); - mBlockAtStartup = false; - mView->setModified( false ); setCentralWidget( mView ); globalFlagBlockStartup = 0; mView->show(); delete splash; if ( newFile ) mView->updateConfig(); // qApp->processEvents(); //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); //fillSyncMenu(); connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); - connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); mSyncManager->setDefaultFileName( sentSyncFile()); connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); mSyncManager->fillSyncMenu(); mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); if ( showWarning ) { KMessageBox::information( this, "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"); qApp->processEvents(); mView->dialogManager()->showSyncOptions(); } //US listen for result adressed from Ka/Pi -#ifndef DESKTOP_VERSION - connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); -#endif + #ifndef DESKTOP_VERSION infrared = 0; #endif updateFilterToolbar(); updateWeek( mView->startDate() ); connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), SLOT( updateWeekNum( const KCal::DateList & ) ) ); mBRdisabled = false; //toggleBeamReceive(); - QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); + setCaption(i18n("Loading calendar files ... please wait" )); + QTimer::singleShot( 10, this, SLOT ( loadDataAfterStart() )); } MainWindow::~MainWindow() { //qDebug("MainWindow::~MainWindow() "); //save toolbar location delete mCalendar; delete mSyncManager; #ifndef DESKTOP_VERSION if ( infrared ) delete infrared; #endif } + +void MainWindow::loadDataAfterStart() +{ + + qDebug("KO: Start loading files..." ); + QTime neededSaveTime = QDateTime::currentDateTime().time(); + mView->loadCalendars(); + int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); + qDebug("KO: Calendar loading time: %d ms",msNeeded ); + //QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); + mView->setModified( false ); + mBlockAtStartup = false; + mView->setModified( false ); + connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); + processIncidenceSelection( 0 ); + connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), + SLOT( processIncidenceSelection( Incidence * ) ) ); + connect( mView, SIGNAL( modifiedChanged( bool ) ), + SLOT( slotModifiedChanged( bool ) ) ); + +#ifndef DESKTOP_VERSION + connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); + connect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(recieve( const QCString&, const QByteArray& ))); + disconnect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(receiveStart( const QCString&, const QByteArray& ))); + if ( !mCStringMess.isEmpty() ) + recieve( mCStringMess, mByteData ); +#endif + + + QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); +} + void MainWindow::slotResetFocus() { //qDebug(" CalendarView::slotResetFocus() %x %x %x %x", qApp->focusWidget(), menuBar1, mView,iconToolBar); mFocusLoop = 3; QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() )); } void MainWindow::slotResetFocusLoop() { --mFocusLoop; QWidget* fw = mView->viewManager()->currentView(); if ( fw ) { //qDebug("loop "); @@ -531,25 +553,30 @@ void MainWindow::closeEvent( QCloseEvent* ce ) break; case 1: ce->ignore(); break; case 2: default: break; } } - +void MainWindow::receiveStart( const QCString& cmsg, const QByteArray& data ) +{ + qDebug("KO: QCOP start message received: %s ", cmsg.data() ); + mCStringMess = cmsg; + mByteData = data; +} void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) { QDataStream stream( data, IO_ReadOnly ); // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); //QString datamess; //qDebug("message "); qDebug("KO: QCOP message received: %s ", cmsg.data() ); if ( cmsg == "setDocument(QString)" ) { QDataStream stream( data, IO_ReadOnly ); QString fileName; stream >> fileName; @@ -2507,24 +2534,25 @@ void MainWindow::importFile( QString fn, bool quick ) result = QMessageBox::warning( this, "KO/Pi: Warning!", mess, "Import", "Cancel", 0, 0, 1 ); } if ( result == 0 ) { if ( mView->openCalendar( fn, true )) { KOPrefs::instance()->mLastImportFile = fn; setCaption(i18n("Imported file successfully")); } else { setCaption(i18n("Error importing file")); } + mView->updateView(); } } void MainWindow::importIcal() { QString fn =KOPrefs::instance()->mLastImportFile; fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); if ( fn == "" ) return; importFile( fn, true ); diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 7d3d492..fdcf7c4 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h @@ -41,25 +41,27 @@ class MainWindow : public QMainWindow static QString defaultFileName(); static QString syncFileName(); static QString resourcePath(); public slots: void setUsesBigPixmaps ( bool ); void setCaption ( const QString & ); void updateWeekNum(const KCal::DateList &); void updateWeek(QDate); void updateFilterToolbar(); virtual void showMaximized (); void configureAgenda( int ); void recieve( const QCString& msg, const QByteArray& data ); + void receiveStart( const QCString& msg, const QByteArray& data ); protected slots: + void loadDataAfterStart(); void calHint(); void startMultiSync(); void setCaptionToDates(); void weekAction(); void about(); void licence(); void faq(); void usertrans(); void features(); void synchowto(); void storagehowto(); void timetrackinghowto(); @@ -107,24 +109,28 @@ class MainWindow : public QMainWindow void showConfigureAgenda(); void getFile( bool ); void syncFileRequest(); protected: int mFocusLoop; void hideEvent ( QHideEvent * ); QString sentSyncFile(); void displayText( QString, QString); void enableIncidenceActions( bool ); private: + + QCString mCStringMess; + QByteArray mByteData; + //void setMenuBar( QMenuBar * ); bool mBRdisabled; #ifndef DESKTOP_VERSION QCopChannel* infrared; #endif QAction* brAction; KSyncManager* mSyncManager; bool mClosed; void saveOnClose(); bool mFlagKeyPressed; bool mBlockAtStartup; KMenuBar *menuBar1; |