summaryrefslogtreecommitdiffabout
path: root/korganizer/mainwindow.cpp
Unidiff
Diffstat (limited to 'korganizer/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp9
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
@@ -164,25 +164,25 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
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 )
@@ -1714,25 +1714,25 @@ 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}
1724void MainWindow::importBday() 1724void 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}
1737void MainWindow::importQtopia() 1737void MainWindow::importQtopia()
1738{ 1738{
@@ -2301,33 +2301,36 @@ void MainWindow::showConfigureAgenda( )
2301 configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); 2301 configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true );
2302} 2302}
2303void MainWindow::configureAgenda( int item ) 2303void 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
2311void MainWindow::saveCalendar() 2311void 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}
2324void MainWindow::loadCalendar() 2327void 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;