summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-09-25 02:28:24 (UTC)
committer zautrix <zautrix>2005-09-25 02:28:24 (UTC)
commitfa126dfea03b4ebed9a4eed4f2104f93abb72e22 (patch) (side-by-side diff)
treedab730835ae807e407b928623a85294558d756cb /korganizer
parent3bbc14431e854bc3d8870b5ba12d64f6e1af6eb6 (diff)
downloadkdepimpi-fa126dfea03b4ebed9a4eed4f2104f93abb72e22.zip
kdepimpi-fa126dfea03b4ebed9a4eed4f2104f93abb72e22.tar.gz
kdepimpi-fa126dfea03b4ebed9a4eed4f2104f93abb72e22.tar.bz2
todo timer fix
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/main.cpp2
-rw-r--r--korganizer/mainwindow.cpp8
2 files changed, 5 insertions, 5 deletions
diff --git a/korganizer/main.cpp b/korganizer/main.cpp
index 9410c6a..4a0e24f 100644
--- a/korganizer/main.cpp
+++ b/korganizer/main.cpp
@@ -85,33 +85,33 @@ int main( int argc, char **argv )
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(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()));
#endif
if ( argc > 1 ) {
QCString command = argv[1];
if ( argc > 2 )
command += argv[2];
m.recieve(command, QByteArray() );
}
#ifndef DESKTOP_VERSION
- QPEApplication::setTempScreenSaverMode ( QPEApplication::Disable );
+ // QPEApplication::setTempScreenSaverMode ( QPEApplication::Disable );
#endif
a.exec();
dumpMissing();
KPimGlobalPrefs::instance()->writeConfig();
}
qDebug("KO: Bye! ");
}
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 05e5087..c597138 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -2035,84 +2035,84 @@ void MainWindow::save()
if ( mSaveDelay ) {
int elapsed = mSaveTimerStart.secsTo( QDateTime::currentDateTime() );
if ( mSaveDelay < elapsed ) {
qDebug("KO: Pending save after wakeup from suspend detected.");
qDebug("KO: Save delay %d sec. Elapsed save time %d sec.", mSaveDelay, elapsed );
qDebug("KO: Restarting save timer to save in 10 sec.");
int msec = 10000;
mSaveTimer.start( msec, true );
mSaveTimerStart = QDateTime::currentDateTime();
mSaveDelay = msec/1000;
return;
}
}
if ( mView->viewManager()->journalView() )
mView->viewManager()->journalView()->checkModified();
if ( !mCalendarModifiedFlag ) {
qDebug("KO: Calendar not modified. Nothing saved.");
return;
}
if ( mSyncManager->blockSave() ) {
slotModifiedChanged( true );
return;
}
#ifndef DESKTOP_VERSION
- QPEApplication::setTempScreenSaverMode ( QPEApplication::Disable );
+ // QPEApplication::setTempScreenSaverMode ( QPEApplication::Disable );
#endif
mSaveDelay = 0;
mSyncManager->setBlockSave(true);
if ( mView->checkAllFileVersions() ) {
if ( KPimGlobalPrefs::instance()->mBackupEnabled ){
QDate reference ( 2000,1,1);
int daysTo = reference.daysTo ( QDate::currentDate() );
if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) {
backupAllFiles();
}
; // KPimGlobalPrefs::instance()->mLastBackupDate
}
QTime neededSaveTime;
neededSaveTime.start();
if ( !isMinimized () )
setCaption(i18n("KO/Pi:Saving Data to File ..." ));
qDebug("KO: Start saving data to file!");
if ( mView->saveCalendars() )
mCalendarModifiedFlag = false;
int msNeeded = neededSaveTime.elapsed();
qDebug("KO: Needed %d ms for saving.",msNeeded );
QString savemes;
savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 );
if ( !isMinimized () )
setCaption(savemes);
else
qDebug(savemes);
} else {
setCaption(i18n("Saving cancelled!"));
mCalendarModifiedFlag = false;
slotModifiedChanged( true );
}
mSyncManager->setBlockSave( false );
#ifndef DESKTOP_VERSION
- QPEApplication::setTempScreenSaverMode ( QPEApplication::Enable );
+ //QPEApplication::setTempScreenSaverMode ( QPEApplication::Enable );
#endif
}
void MainWindow::keyReleaseEvent ( QKeyEvent * e)
{
if ( !e->isAutoRepeat() ) {
mFlagKeyPressed = false;
}
}
void MainWindow::keyPressEvent ( QKeyEvent * e )
{
qApp->processEvents();
if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
e->ignore();
// qDebug(" ignore %d",e->isAutoRepeat() );
return;
}
if (! e->isAutoRepeat() )
mFlagKeyPressed = true;
KOPrefs *p = KOPrefs::instance();
bool showSelectedDates = false;
int size;
int pro = 0;
//qDebug("MainWindow::keyPressEvent ");
@@ -2491,54 +2491,54 @@ void MainWindow::showConfigureAgenda( )
configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true );
}
void MainWindow::configureAgenda( int item )
{
if ( KOPrefs::instance()->mHourSize == item )
return;
KOPrefs::instance()->mHourSize=item;
mView->viewManager()->agendaView()->updateConfig();
}
void MainWindow::saveCalendar()
{
QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir;
if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir)
bupDir = KGlobalSettings::backupDataDir();
bupDir = KGlobal::formatMessage ( bupDir, 0 );
QString bupHint;
if ( !KPimGlobalPrefs::instance()->mBackupEnabled )
bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)");
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;
bool enabled = KPimGlobalPrefs::instance()->mBackupEnabled;
KPimGlobalPrefs::instance()->mBackupEnabled = false;
save();
#ifndef DESKTOP_VERSION
- QPEApplication::setTempScreenSaverMode ( QPEApplication::Disable );
+ //QPEApplication::setTempScreenSaverMode ( QPEApplication::Disable );
#endif
KPimGlobalPrefs::instance()->mBackupEnabled = enabled;
backupAllFiles();
#ifndef DESKTOP_VERSION
- QPEApplication::setTempScreenSaverMode ( QPEApplication::Enable );
+ //QPEApplication::setTempScreenSaverMode ( QPEApplication::Enable );
#endif
}
void MainWindow::loadCalendar()
{
#if 0
QString fn = KOPrefs::instance()->mLastLoadFile;
fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this );
if ( fn == "" )
return;
QFileInfo info;
info.setFile( fn );
QString mess;
bool loadbup = true;
if ( info. exists() ) {
mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false ));
int result = QMessageBox::warning( this, "KO/Pi: Warning!",
mess,
i18n("Load!"), i18n("Cancel"), 0,
0, 1 );
if ( result != 0 ) {
loadbup = false;