author | zautrix <zautrix> | 2005-07-01 17:57:30 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-01 17:57:30 (UTC) |
commit | 98d29d15275c4b8e9a3348742925f6e6d03f7a07 (patch) (unidiff) | |
tree | ea0af6d2100287c696bb00e1197d6c99f29f41e8 /korganizer/mainwindow.cpp | |
parent | f330b9d0a7f755660ddd59739e3ab9b98d60bc18 (diff) | |
download | kdepimpi-98d29d15275c4b8e9a3348742925f6e6d03f7a07.zip kdepimpi-98d29d15275c4b8e9a3348742925f6e6d03f7a07.tar.gz kdepimpi-98d29d15275c4b8e9a3348742925f6e6d03f7a07.tar.bz2 |
fixx
-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 | |||
@@ -131,30 +131,27 @@ public: | |||
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 ); |
@@ -341,13 +338,12 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
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 ) ) ); |
@@ -1852,17 +1848,17 @@ void MainWindow::saveOnClose() | |||
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, |
@@ -1900,13 +1896,13 @@ void MainWindow::backupAllFiles() | |||
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 ){ |
@@ -2405,16 +2401,15 @@ void MainWindow::quickImportIcal() | |||
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 )); |