-rw-r--r-- | korganizer/mainwindow.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index b6ce7d5..b797d8c 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -129,34 +129,31 @@ public: | |||
129 | QCheckBox* mWriteBackFuture; | 129 | QCheckBox* mWriteBackFuture; |
130 | QSpinBox* mWriteBackFutureWeeks; | 130 | QSpinBox* mWriteBackFutureWeeks; |
131 | }; | 131 | }; |
132 | 132 | ||
133 | QPixmap* sgListViewCompletedPix[6]; | 133 | QPixmap* sgListViewCompletedPix[6]; |
134 | 134 | ||
135 | 135 | ||
136 | int globalFlagBlockStartup; | 136 | int globalFlagBlockStartup; |
137 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | 137 | MainWindow::MainWindow( QWidget *parent, const char *name ) : |
138 | QMainWindow( parent, name ) | 138 | QMainWindow( parent, name ) |
139 | { | 139 | { |
140 | sgListViewCompletedPix[5] = &listviewPix; | 140 | sgListViewCompletedPix[5] = &listviewPix; |
141 | sgListViewCompletedPix[0] = &listviewPix0; | 141 | sgListViewCompletedPix[0] = &listviewPix0; |
142 | sgListViewCompletedPix[1] = &listviewPix20; | 142 | sgListViewCompletedPix[1] = &listviewPix20; |
143 | sgListViewCompletedPix[2] = &listviewPix40; | 143 | sgListViewCompletedPix[2] = &listviewPix40; |
144 | sgListViewCompletedPix[3] = &listviewPix60; | 144 | sgListViewCompletedPix[3] = &listviewPix60; |
145 | sgListViewCompletedPix[4] = &listviewPix80; | 145 | sgListViewCompletedPix[4] = &listviewPix80; |
146 | if ( sgListViewCompletedPix[5]->height() < 5 ) { | 146 | if ( sgListViewCompletedPix[5]->height() < 5 ) { |
147 | int size = 12; | 147 | //int size = 12; |
148 | sgListViewCompletedPix[5]->resize( 11, 11 ); | 148 | sgListViewCompletedPix[5]->resize( 11, 11 ); |
149 | sgListViewCompletedPix[5]->fill( Qt::white ); | 149 | sgListViewCompletedPix[5]->fill( Qt::white ); |
150 | QPainter p ( sgListViewCompletedPix[5] ); | 150 | QPainter p ( sgListViewCompletedPix[5] ); |
151 | p.drawRect( 0,0,11,11); | 151 | p.drawRect( 0,0,11,11); |
152 | int half = size/2; | ||
153 | int heihei = size/2; | ||
154 | int x = 1; | ||
155 | p.drawLine ( 2, 5, 4 , 7 ) ; | 152 | p.drawLine ( 2, 5, 4 , 7 ) ; |
156 | p.drawLine ( 4 , 7 , 8, 3) ; | 153 | p.drawLine ( 4 , 7 , 8, 3) ; |
157 | int iii = 0; | 154 | int iii = 0; |
158 | for ( iii = 0; iii < 5; ++iii ) { | 155 | for ( iii = 0; iii < 5; ++iii ) { |
159 | sgListViewCompletedPix[iii]->resize( 11, 11 ); | 156 | sgListViewCompletedPix[iii]->resize( 11, 11 ); |
160 | sgListViewCompletedPix[iii]->fill( Qt::white ); | 157 | sgListViewCompletedPix[iii]->fill( Qt::white ); |
161 | QPainter p ( sgListViewCompletedPix[iii] ); | 158 | QPainter p ( sgListViewCompletedPix[iii] ); |
162 | p.drawRect( 0,0,11,11); | 159 | p.drawRect( 0,0,11,11); |
@@ -339,17 +336,16 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
339 | 336 | ||
340 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 337 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
341 | mView->loadCalendars(); | 338 | mView->loadCalendars(); |
342 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 339 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
343 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); | 340 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); |
344 | 341 | ||
345 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { | 342 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { |
346 | KOPrefs::instance()->setAllDefaults(); | 343 | KOPrefs::instance()->setAllDefaults(); |
347 | int count = mView->addCategories(); | ||
348 | } | 344 | } |
349 | processIncidenceSelection( 0 ); | 345 | processIncidenceSelection( 0 ); |
350 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), | 346 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), |
351 | SLOT( processIncidenceSelection( Incidence * ) ) ); | 347 | SLOT( processIncidenceSelection( Incidence * ) ) ); |
352 | connect( mView, SIGNAL( modifiedChanged( bool ) ), | 348 | connect( mView, SIGNAL( modifiedChanged( bool ) ), |
353 | SLOT( slotModifiedChanged( bool ) ) ); | 349 | SLOT( slotModifiedChanged( bool ) ) ); |
354 | 350 | ||
355 | 351 | ||
@@ -1850,21 +1846,21 @@ void MainWindow::saveOnClose() | |||
1850 | p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; | 1846 | p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; |
1851 | if ( filterToolBar ) { | 1847 | if ( filterToolBar ) { |
1852 | if ( p->mToolBarHorF ) | 1848 | if ( p->mToolBarHorF ) |
1853 | p->mToolBarUpF = filterToolBar->y() > height()/2; | 1849 | p->mToolBarUpF = filterToolBar->y() > height()/2; |
1854 | else | 1850 | else |
1855 | p->mToolBarUpF = filterToolBar->x() > width()/2 ; | 1851 | p->mToolBarUpF = filterToolBar->x() > width()/2 ; |
1856 | } | 1852 | } |
1857 | #endif | 1853 | #endif |
1858 | |||
1859 | save(); | 1854 | save(); |
1860 | mView->writeSettings(); | 1855 | mView->writeSettings(); |
1856 | mView->checkSuspendAlarm(); | ||
1861 | } | 1857 | } |
1862 | void MainWindow::slotModifiedChanged( bool changed ) | 1858 | void MainWindow::slotModifiedChanged( bool ) |
1863 | { | 1859 | { |
1864 | if ( mBlockAtStartup ) | 1860 | if ( mBlockAtStartup ) |
1865 | return; | 1861 | return; |
1866 | 1862 | ||
1867 | int msec; | 1863 | int msec; |
1868 | // we store the changes after 1 minute, | 1864 | // we store the changes after 1 minute, |
1869 | // and for safety reasons after 10 minutes again | 1865 | // and for safety reasons after 10 minutes again |
1870 | if ( !mSyncManager->blockSave() ) | 1866 | if ( !mSyncManager->blockSave() ) |
@@ -1898,17 +1894,17 @@ void MainWindow::backupAllFiles() | |||
1898 | } else if ( retval == 1 ){ | 1894 | } else if ( retval == 1 ){ |
1899 | qDebug("KO: Backup created."); | 1895 | qDebug("KO: Backup created."); |
1900 | // backup ok | 1896 | // backup ok |
1901 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; | 1897 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; |
1902 | KopiCalendarFile * cal = calendars.first(); | 1898 | KopiCalendarFile * cal = calendars.first(); |
1903 | cal = calendars.next(); | 1899 | cal = calendars.next(); |
1904 | while ( cal ) { | 1900 | while ( cal ) { |
1905 | if ( !cal->mErrorOnLoad ) { | 1901 | if ( !cal->mErrorOnLoad ) { |
1906 | int retval = KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); | 1902 | KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); |
1907 | } | 1903 | } |
1908 | cal = calendars.next(); | 1904 | cal = calendars.next(); |
1909 | } | 1905 | } |
1910 | KOPrefs::instance()->mLastBackupDate = daysTo; | 1906 | KOPrefs::instance()->mLastBackupDate = daysTo; |
1911 | setCaption(i18n("Backup succesfully finished" )); | 1907 | setCaption(i18n("Backup succesfully finished" )); |
1912 | } else if ( retval == 2 ){ | 1908 | } else if ( retval == 2 ){ |
1913 | setCaption(i18n("Backup globally disabled" )); | 1909 | setCaption(i18n("Backup globally disabled" )); |
1914 | qDebug("KO: Backup globally cancelled."); | 1910 | qDebug("KO: Backup globally cancelled."); |
@@ -2403,20 +2399,19 @@ void MainWindow::quickImportIcal() | |||
2403 | { | 2399 | { |
2404 | importFile( KOPrefs::instance()->mLastImportFile, false ); | 2400 | importFile( KOPrefs::instance()->mLastImportFile, false ); |
2405 | } | 2401 | } |
2406 | void MainWindow::importFile( QString fn, bool quick ) | 2402 | void MainWindow::importFile( QString fn, bool quick ) |
2407 | { | 2403 | { |
2408 | QFileInfo info; | 2404 | QFileInfo info; |
2409 | info.setFile( fn ); | 2405 | info.setFile( fn ); |
2410 | QString mess; | 2406 | QString mess; |
2411 | bool loadbup = true; | ||
2412 | if ( !info. exists() ) { | 2407 | if ( !info. exists() ) { |
2413 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); | 2408 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); |
2414 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 2409 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
2415 | mess ); | 2410 | mess ); |
2416 | return; | 2411 | return; |
2417 | } | 2412 | } |
2418 | int result = 0; | 2413 | int result = 0; |
2419 | if ( !quick ) { | 2414 | if ( !quick ) { |
2420 | mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); | 2415 | mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); |
2421 | result = QMessageBox::warning( this, "KO/Pi: Warning!", | 2416 | result = QMessageBox::warning( this, "KO/Pi: Warning!", |
2422 | mess, | 2417 | mess, |