-rw-r--r-- | korganizer/mainwindow.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index b9d8742..68233e8 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -160,33 +160,33 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
160 | QPainter p ( sgListViewCompletedPix[iii] ); | 160 | QPainter p ( sgListViewCompletedPix[iii] ); |
161 | p.drawRect( 0,0,11,11); | 161 | p.drawRect( 0,0,11,11); |
162 | if ( iii ) | 162 | if ( iii ) |
163 | p.fillRect( 1,1,iii*2,9,Qt::gray ); | 163 | p.fillRect( 1,1,iii*2,9,Qt::gray ); |
164 | } | 164 | } |
165 | } | 165 | } |
166 | mClosed = false; | 166 | mClosed = false; |
167 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; | 167 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; |
168 | QString confFile = locateLocal("config","korganizerrc"); | 168 | QString confFile = locateLocal("config","korganizerrc"); |
169 | QFileInfo finf ( confFile ); | 169 | QFileInfo finf ( confFile ); |
170 | bool showWarning = !finf.exists(); | 170 | bool showWarning = !finf.exists(); |
171 | setIcon(SmallIcon( "ko24" ) ); | 171 | setIcon(SmallIcon( "ko24" ) ); |
172 | mBlockAtStartup = true; | 172 | mBlockAtStartup = true; |
173 | mFlagKeyPressed = false; | 173 | mFlagKeyPressed = false; |
174 | setCaption("KO/Pi"); | 174 | setCaption("KO/Pi"); |
175 | KOPrefs *p = KOPrefs::instance(); | 175 | KOPrefs *p = KOPrefs::instance(); |
176 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 176 | //KPimGlobalPrefs::instance()->setGlobalConfig(); |
177 | p->mCurrentDisplayedView = 0; | 177 | p->mCurrentDisplayedView = 0; |
178 | if ( p->mHourSize > 22 ) | 178 | if ( p->mHourSize > 22 ) |
179 | p->mHourSize = 22; | 179 | p->mHourSize = 22; |
180 | QMainWindow::ToolBarDock tbd; | 180 | QMainWindow::ToolBarDock tbd; |
181 | if ( p->mToolBarHor ) { | 181 | if ( p->mToolBarHor ) { |
182 | if ( p->mToolBarUp ) | 182 | if ( p->mToolBarUp ) |
183 | tbd = Bottom; | 183 | tbd = Bottom; |
184 | else | 184 | else |
185 | tbd = Top; | 185 | tbd = Top; |
186 | } | 186 | } |
187 | else { | 187 | else { |
188 | if ( p->mToolBarUp ) | 188 | if ( p->mToolBarUp ) |
189 | tbd = Right; | 189 | tbd = Right; |
190 | else | 190 | else |
191 | tbd = Left; | 191 | tbd = Left; |
192 | } | 192 | } |
@@ -1710,33 +1710,33 @@ void MainWindow::enableIncidenceActions( bool enabled ) | |||
1710 | mCancelAction->setEnabled( enabled ); | 1710 | mCancelAction->setEnabled( enabled ); |
1711 | } | 1711 | } |
1712 | 1712 | ||
1713 | void MainWindow::importOL() | 1713 | void MainWindow::importOL() |
1714 | { | 1714 | { |
1715 | #ifdef _OL_IMPORT_ | 1715 | #ifdef _OL_IMPORT_ |
1716 | mView->clearAllViews(); | 1716 | mView->clearAllViews(); |
1717 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); | 1717 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); |
1718 | id->exec(); | 1718 | id->exec(); |
1719 | delete id; | 1719 | delete id; |
1720 | mView->calendar()->checkAlarmForIncidence( 0, true ); | 1720 | mView->calendar()->checkAlarmForIncidence( 0, true ); |
1721 | mView->updateView(); | 1721 | mView->updateView(); |
1722 | #endif | 1722 | #endif |
1723 | } | 1723 | } |
1724 | void MainWindow::importBday() | 1724 | void MainWindow::importBday() |
1725 | { | 1725 | { |
1726 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1726 | int result = QMessageBox::warning( this, i18n("KO/Pi import information!"), |
1727 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), | 1727 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), |
1728 | i18n("Import!"), i18n("Cancel"), 0, | 1728 | i18n("Import!"), i18n("Cancel"), 0, |
1729 | 0, 1 ); | 1729 | 0, 1 ); |
1730 | if ( result == 0 ) { | 1730 | if ( result == 0 ) { |
1731 | mView->importBday(); | 1731 | mView->importBday(); |
1732 | 1732 | ||
1733 | } | 1733 | } |
1734 | 1734 | ||
1735 | 1735 | ||
1736 | } | 1736 | } |
1737 | void MainWindow::importQtopia() | 1737 | void MainWindow::importQtopia() |
1738 | { | 1738 | { |
1739 | //#ifndef DESKTOP_VERSION | 1739 | //#ifndef DESKTOP_VERSION |
1740 | QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); | 1740 | QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); |
1741 | #ifdef DESKTOP_VERSION | 1741 | #ifdef DESKTOP_VERSION |
1742 | mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); | 1742 | mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); |
@@ -2297,41 +2297,44 @@ void MainWindow::showConfigureAgenda( ) | |||
2297 | int iii; | 2297 | int iii; |
2298 | for ( iii = 1;iii<= 10 ;++iii ){ | 2298 | for ( iii = 1;iii<= 10 ;++iii ){ |
2299 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); | 2299 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); |
2300 | } | 2300 | } |
2301 | configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); | 2301 | configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); |
2302 | } | 2302 | } |
2303 | void MainWindow::configureAgenda( int item ) | 2303 | void MainWindow::configureAgenda( int item ) |
2304 | { | 2304 | { |
2305 | if ( KOPrefs::instance()->mHourSize == item ) | 2305 | if ( KOPrefs::instance()->mHourSize == item ) |
2306 | return; | 2306 | return; |
2307 | KOPrefs::instance()->mHourSize=item; | 2307 | KOPrefs::instance()->mHourSize=item; |
2308 | mView->viewManager()->agendaView()->updateConfig(); | 2308 | mView->viewManager()->agendaView()->updateConfig(); |
2309 | } | 2309 | } |
2310 | 2310 | ||
2311 | void MainWindow::saveCalendar() | 2311 | void MainWindow::saveCalendar() |
2312 | { | 2312 | { |
2313 | |||
2314 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; | 2313 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; |
2315 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) | 2314 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) |
2316 | bupDir = KGlobalSettings::backupDataDir(); | 2315 | bupDir = KGlobalSettings::backupDataDir(); |
2317 | bupDir = KGlobal::formatMessage ( bupDir, 0 ); | 2316 | bupDir = KGlobal::formatMessage ( bupDir, 0 ); |
2318 | QString bupHint; | 2317 | QString bupHint; |
2319 | if ( !KPimGlobalPrefs::instance()->mBackupEnabled ) | 2318 | if ( !KPimGlobalPrefs::instance()->mBackupEnabled ) |
2320 | bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)"); | 2319 | bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)"); |
2321 | if ( KMessageBox::warningContinueCancel( this, i18n("This will <b>backup all calendar files</b> to the directory %1 %2").arg(bupDir).arg(bupHint),i18n("Information") ) != KMessageBox::Continue ) return; | 2320 | if ( KMessageBox::warningContinueCancel( this, i18n("This will <b>backup all calendar files</b> to the directory %1 %2").arg(bupDir).arg(bupHint),i18n("Information") ) != KMessageBox::Continue ) return; |
2321 | bool enabled = KPimGlobalPrefs::instance()->mBackupEnabled; | ||
2322 | KPimGlobalPrefs::instance()->mBackupEnabled = false; | ||
2323 | save(); | ||
2324 | KPimGlobalPrefs::instance()->mBackupEnabled = enabled; | ||
2322 | backupAllFiles(); | 2325 | backupAllFiles(); |
2323 | } | 2326 | } |
2324 | void MainWindow::loadCalendar() | 2327 | void MainWindow::loadCalendar() |
2325 | { | 2328 | { |
2326 | 2329 | ||
2327 | 2330 | ||
2328 | #if 0 | 2331 | #if 0 |
2329 | QString fn = KOPrefs::instance()->mLastLoadFile; | 2332 | QString fn = KOPrefs::instance()->mLastLoadFile; |
2330 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); | 2333 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); |
2331 | 2334 | ||
2332 | if ( fn == "" ) | 2335 | if ( fn == "" ) |
2333 | return; | 2336 | return; |
2334 | QFileInfo info; | 2337 | QFileInfo info; |
2335 | info.setFile( fn ); | 2338 | info.setFile( fn ); |
2336 | QString mess; | 2339 | QString mess; |
2337 | bool loadbup = true; | 2340 | bool loadbup = true; |