summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-07-01 17:57:30 (UTC)
committer zautrix <zautrix>2005-07-01 17:57:30 (UTC)
commit98d29d15275c4b8e9a3348742925f6e6d03f7a07 (patch) (side-by-side diff)
treeea0af6d2100287c696bb00e1197d6c99f29f41e8 /korganizer
parentf330b9d0a7f755660ddd59739e3ab9b98d60bc18 (diff)
downloadkdepimpi-98d29d15275c4b8e9a3348742925f6e6d03f7a07.zip
kdepimpi-98d29d15275c4b8e9a3348742925f6e6d03f7a07.tar.gz
kdepimpi-98d29d15275c4b8e9a3348742925f6e6d03f7a07.tar.bz2
fixx
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp47
-rw-r--r--korganizer/calendarview.h2
-rw-r--r--korganizer/kodialogmanager.cpp4
-rw-r--r--korganizer/kolistview.cpp3
-rw-r--r--korganizer/mainwindow.cpp17
-rw-r--r--korganizer/mainwindow.h2
6 files changed, 36 insertions, 39 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index fd026fa..70a1d2d 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -770,33 +770,33 @@ void CalendarView::timerAlarm()
void CalendarView::suspendAlarm()
{
//qDebug(" CalendarView::suspendAlarm() ");
computeAlarm(mSuspendAlarmNotification );
}
void CalendarView::startAlarm( QString mess , QString filename)
{
topLevelWidget()->showNormal();
topLevelWidget()->setActiveWindow();
topLevelWidget()->raise();
mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount );
- QTimer::singleShot( 3000, this, SLOT( checkNextTimerAlarm() ) );
+ QTimer::singleShot( 2000, this, SLOT( checkNextTimerAlarm() ) );
}
void CalendarView::checkNextTimerAlarm()
{
mCalendar->checkAlarmForIncidence( 0, true );
}
void CalendarView::computeAlarm( QString msg )
{
QString mess = msg;
QString mAlarmMessage = mess.mid( 9 );
QString filename = MainWindow::resourcePath();
filename += "koalarm.wav";
QString tempfilename;
@@ -913,38 +913,42 @@ void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti )
return;
} else {
mRecheckAlarmTimer->stop();
}
//qDebug("Alarm timer started with secs: %d ", sec);
mAlarmTimer->start( sec *1000 , true );
}
// called by mRecheckAlarmTimer to get next alarm
// we need this, because a QTimer has only a max range of 25 days
void CalendarView::recheckTimerAlarm()
{
mAlarmTimer->stop();
mRecheckAlarmTimer->stop();
mCalendar->checkAlarmForIncidence( 0, true );
}
+#ifndef DESKTOP_VERSION
void CalendarView::removeAlarm(const QDateTime &qdt, const QString &noti )
+#else
+void CalendarView::removeAlarm(const QDateTime &, const QString & )
+#endif
{
//qDebug("-----removeAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) {
#ifndef DESKTOP_VERSION
- AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.latin1() );
+ AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.utf8() );
#endif
return;
}
mAlarmTimer->stop();
}
void CalendarView::selectWeekNum ( int num )
{
dateNavigator()->blockSignals( true );
dateNavigator()->selectWeek( num );
dateNavigator()->blockSignals( false );
mViewManager->showWeekView();
}
KOViewManager *CalendarView::viewManager()
{
return mViewManager;
}
@@ -1197,33 +1201,32 @@ void CalendarView::checkExternalId( Incidence * inc )
}
bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode )
{
bool syncOK = true;
int addedEvent = 0;
int addedEventR = 0;
int deletedEventR = 0;
int deletedEventL = 0;
int changedLocal = 0;
int changedRemote = 0;
int filteredIN = 0;
int filteredOUT = 0;
//QPtrList<Event> el = local->rawEvents();
Event* eventR;
QString uid;
int take;
- Event* eventL;
Event* eventRSync;
Event* eventLSync;
clearAllViews();
QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents();
QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents();
bool fullDateRange = false;
local->resetTempSyncStat();
mLastCalendarSync = QDateTime::currentDateTime();
if ( mSyncManager->syncWithDesktop() ) {
remote->resetPilotStat(1);
if ( KSyncManager::mRequestedSyncEvent.isValid() ) {
mLastCalendarSync = KSyncManager::mRequestedSyncEvent;
qDebug("KO: using extern time for calendar sync: %s ", mLastCalendarSync.toString().latin1() );
} else {
qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime ");
}
@@ -2297,37 +2300,42 @@ void CalendarView::readSettings()
sizes << resetval;
if ( maxVal < resetval + resetval)
resetval = maxVal - resetval;
sizes << resetval;
}
mMainFrame->setSizes(sizes);
if ( dateCount == 5 ) mNavigator->selectWorkWeek();
else if ( dateCount == 7 ) mNavigator->selectWeek();
else mNavigator->selectDates( dateCount );
// mViewManager->readSettings( config );
updateConfig();
globalFlagBlockAgenda = 2;
mViewManager->readSettings( config );
QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) );
}
-
+void CalendarView::checkSuspendAlarm()
+{
+ if ( mSuspendTimer->isActive() ) {
+ KMessageBox::information( this, i18n("<b>WARNING:</b> There is a pending suspended alarm!"), i18n("Pending Suspend Alarm"));
+ }
+}
void CalendarView::writeSettings()
{
// kdDebug() << "CalendarView::writeSettings" << endl;
-
+
KConfig *config = KOGlobals::config();
mViewManager->writeSettings( config );
mTodoList->saveLayout(config,QString("Todo Layout"));
mDialogManager->writeSettings( config );
//KOPrefs::instance()->usrWriteConfig();
KOPrefs::instance()->writeConfig();
writeFilterSettings(config);
config->setGroup( "AppRun" );
QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
int days = dt.daysTo( QDate::currentDate() );
dt = dt.addDays( days );
int secs = dt.secsTo( QDateTime::currentDateTime() );
config->writeEntry( "LatestProgramStopDays", days );
config->writeEntry( "LatestProgramStopSecs", secs );
@@ -2781,54 +2789,53 @@ void CalendarView::slotSelectPickerDate( QDate d)
mMoveIncidence->setDtStart( dt );
((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) );
changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED);
}
mMoveIncidence->setRevision( mMoveIncidence->revision()+1 );
}
}
void CalendarView::removeCategories()
{
QPtrList<Incidence> incList = mCalendar->rawIncidences();
QStringList catList = KOPrefs::instance()->mCustomCategories;
QStringList catIncList;
QStringList newCatList;
Incidence* inc = incList.first();
- int i;
- int count = 0;
+ uint i;
while ( inc ) {
newCatList.clear();
catIncList = inc->categories() ;
for( i = 0; i< catIncList.count(); ++i ) {
if ( catList.contains (catIncList[i]))
newCatList.append( catIncList[i] );
}
newCatList.sort();
inc->setCategories( newCatList.join(",") );
inc = incList.next();
}
}
int CalendarView::addCategories()
{
QPtrList<Incidence> incList = mCalendar->rawIncidences();
QStringList catList = KOPrefs::instance()->mCustomCategories;
QStringList catIncList;
Incidence* inc = incList.first();
- int i;
+ uint i;
int count = 0;
while ( inc ) {
catIncList = inc->categories() ;
for( i = 0; i< catIncList.count(); ++i ) {
if ( !catList.contains (catIncList[i])) {
catList.append( catIncList[i] );
//qDebug("add cat %s ", catIncList[i].latin1());
++count;
}
}
inc = incList.next();
}
catList.sort();
KOPrefs::instance()->mCustomCategories = catList;
return count;
}
@@ -2932,41 +2939,43 @@ void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
} else {
fn += ".ics";
FileStorage storage( cal, fn, new ICalFormat( ) );
storage.save();
}
delete cal;
mes = i18n("KO/Pi: Ready for beaming");
topLevelWidget()->setCaption(mes);
KApplication::convert2latin1( fn );
#ifndef DESKTOP_VERSION
Ir *ir = new Ir( this );
connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
ir->send( fn, description, "text/x-vCalendar" );
#endif
}
}
+
+#ifndef DESKTOP_VERSION
void CalendarView::beamDone( Ir *ir )
{
-#ifndef DESKTOP_VERSION
delete ir;
-#endif
topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") );
topLevelWidget()->raise();
}
-
+#else
+void CalendarView::beamDone( Ir *){;}
+#endif
void CalendarView::moveIncidence(Incidence * inc )
{
if ( !inc ) return;
showDatePickerPopup();
mDatePickerMode = 2;
mMoveIncidence = inc ;
QDate da;
if ( mMoveIncidence->typeID() == todoID ) {
Todo * to = (Todo *) mMoveIncidence;
if ( to->hasDueDate() )
da = to->dtDue().date();
else
da = QDate::currentDate();
} else {
da = mMoveIncidence->dtStart().date();
}
@@ -4294,37 +4303,32 @@ void CalendarView::calendarModified( bool modified, Calendar * )
Todo *CalendarView::selectedTodo()
{
Incidence *incidence = currentSelection();
if ( incidence && incidence->typeID() == todoID ) {
return static_cast<Todo *>( incidence );
}
incidence = mTodoList->selectedIncidences().first();
if ( incidence && incidence->typeID() == todoID ) {
return static_cast<Todo *>( incidence );
}
return 0;
}
-void CalendarView::dialogClosing(Incidence *in)
-{
- // mDialogList.remove(in);
-}
-
void CalendarView::showIncidence()
{
mViewerCallerIsSearchDialog = false;
Incidence *incidence = currentSelection();
if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
if ( incidence ) {
ShowIncidenceVisitor v;
v.act( incidence, this );
}
}
void CalendarView::editIncidenceDescription()
{
mFlagEditDescription = true;
editIncidence();
mFlagEditDescription = false;
}
@@ -4419,74 +4423,75 @@ bool CalendarView::removeCompletedSubTodos( Todo* t )
else
deleteTodo = false;
}
return deleteTodo;
}
void CalendarView::purgeCompleted()
{
int result = KMessageBox::warningContinueCancel(this,
i18n("Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)"),i18n("Purge Todos"),i18n("Purge"));
if (result == KMessageBox::Continue) {
QPtrList<Todo> todoCal;
QPtrList<Todo> rootTodos;
//QPtrList<Incidence> rel;
- Todo *aTodo;//, *rTodo;
- Incidence *rIncidence;
- bool childDelete = false;
- bool deletedOne = true;
+ Todo *aTodo;
todoCal = calendar()->todos();
for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) {
if ( !aTodo->relatedTo() )
rootTodos.append( aTodo );
}
for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) {
removeCompletedSubTodos( aTodo );
}
updateView();
}
}
void CalendarView::slotCalendarChanged()
{
;
}
void CalendarView::keyPressEvent ( QKeyEvent *e)
{
//qDebug(" alendarView::keyPressEvent ");
e->ignore();
}
bool CalendarView::sync(KSyncManager* manager, QString filename, int mode)
{
- // mSyncManager = manager;
+
+ if ( manager != mSyncManager)
+ qDebug("KO: Internal error-1. SyncManager mismatch ");
if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) {
qDebug("KO: SyncKDE request detected!");
}
mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice();
mCurrentSyncName = mSyncManager->getCurrentSyncName();
return syncCalendar( filename, mode );
}
bool CalendarView::syncExternal(KSyncManager* manager, QString resource)
{
//mSyncManager = manager;
+ if ( manager != mSyncManager)
+ qDebug("KO: Internal error-2. SyncManager mismatch ");
mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice();
mCurrentSyncName = mSyncManager->getCurrentSyncName();
if ( resource == "sharp" )
syncExternal( 0 );
if ( resource == "phone" )
syncExternal( 1 );
// pending setmodified
return true;
}
void CalendarView::setSyncManager(KSyncManager* manager)
{
mSyncManager = manager;
}
void CalendarView::removeSyncInfo( QString syncProfile)
{
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 3323a98..c9e9870 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -124,32 +124,33 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
KOViewManager *viewManager();
KODialogManager *dialogManager();
QDate startDate();
QDate endDate();
QWidgetStack *viewStack();
QWidget *leftFrame();
DateNavigator *dateNavigator();
KDateNavigator *dateNavigatorWidget();
void addView(KOrg::BaseView *);
void showView(KOrg::BaseView *);
KOEventViewerDialog* getEventViewerDialog();
Incidence *currentSelection();
+ void checkSuspendAlarm();
signals:
void save ();
void saveStopTimer ();
void tempDisableBR(bool);
/** This todo has been modified */
void todoModified(Todo *, int);
/** when change is made to options dialog, the topwidget will catch this
* and emit this signal which notifies all widgets which have registered
* for notification to update their settings. */
void configChanged();
/** emitted when the topwidget is closing down, so that any attached
child windows can also close. */
void closingDown();
/** emitted right before we die */
@@ -442,33 +443,32 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
void goToday();
/** Move to the next date(s) in the current view */
void goNext();
/** Move to the previous date(s) in the current view */
void goPrevious();
/** Move to the next date(s) in the current view */
void goNextMonth();
/** Move to the previous date(s) in the current view */
void goPreviousMonth();
void toggleExpand();
void toggleDateNavigatorWidget();
void toggleAllDaySize();
- void dialogClosing(Incidence *);
/** Look for new messages in the inbox */
void lookForIncomingMessages();
/** Look for new messages in the outbox */
void lookForOutgoingMessages();
void processMainViewSelection( Incidence * );
void processTodoListSelection( Incidence * );
void processIncidenceSelection( Incidence * );
void purgeCompleted();
bool removeCompletedSubTodos( Todo* );
void slotCalendarChanged();
bool importBday();
bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday );
diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp
index 5455098..ea30fac 100644
--- a/korganizer/kodialogmanager.cpp
+++ b/korganizer/kodialogmanager.cpp
@@ -285,60 +285,56 @@ KOEventEditor *KODialogManager::getEventEditor()
mMainView,SLOT(eventAdded(Event *)));
connect(eventEditor,SIGNAL(eventChanged(Event *)),
mMainView,SLOT(eventChanged(Event *)));
connect(eventEditor,SIGNAL(eventDeleted()),
mMainView,SLOT(eventDeleted()));
connect(eventEditor,SIGNAL(deleteAttendee(Incidence *)),
mMainView,SLOT(schedule_cancel(Incidence *)));
connect( eventEditor, SIGNAL(jumpToTime( const QDate &)),
mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) );
connect( eventEditor, SIGNAL( showAgendaView( bool)),
mMainView->viewManager(), SLOT( showAgendaView( bool) ) );
// connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()),
// eventEditor,SLOT(updateCategoryConfig()));
// connect(eventEditor,SIGNAL(editCategories()),
// mCategoryEditDialog,SLOT(show()));
- connect(eventEditor,SIGNAL(dialogClose(Incidence*)),
- mMainView,SLOT(dialogClosing(Incidence*)));
//connect(mMainView,SIGNAL(closingDown()),eventEditor,SLOT(reject()));
#ifndef DESKTOP_VERSION
eventEditor->resize( QApplication::desktop()->width() -20, 100 );
#endif
return eventEditor;
}
KOTodoEditor *KODialogManager::getTodoEditor()
{
KOTodoEditor *todoEditor = new KOTodoEditor( mMainView->calendar(),
mMainView );
// connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()),
// todoEditor,SLOT(updateCategoryConfig()));
// connect(todoEditor,SIGNAL(editCategories()),mCategoryEditDialog,SLOT(show()));
connect(todoEditor,SIGNAL(todoAdded(Todo *)),
mMainView,SLOT(todoAdded(Todo *)));
connect(todoEditor,SIGNAL(todoChanged(Todo *)),
mMainView,SLOT(todoChanged(Todo *)));
connect(todoEditor,SIGNAL(todoDeleted()),
mMainView,SLOT(todoDeleted()));
- connect(todoEditor,SIGNAL(dialogClose(Incidence*)),
- mMainView,SLOT(dialogClosing(Incidence*)));
connect( todoEditor, SIGNAL(jumpToTime( const QDate &)),
mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) );
connect( todoEditor, SIGNAL( showAgendaView( bool)),
mMainView->viewManager(), SLOT( showAgendaView( bool) ) );
// connect(todoEditor,SIGNAL(deleteAttendee(Incidence *)),
// mMainView,SLOT(schedule_cancel(Incidence *)));
//connect(mMainView,SIGNAL(closingDown()),todoEditor,SLOT(reject()));
#ifndef DESKTOP_VERSION
todoEditor->resize( QApplication::desktop()->width() -20, 100 );
#endif
return todoEditor;
}
void KODialogManager::updateSearchDialog()
{
if (mSearchDialog) mSearchDialog->updateView();
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 517677c..e5e3704 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -426,33 +426,34 @@ void KOListView::setCalendar( int c )
mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled );
mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly );
if ( cal->isStandard )
mCalendar->setDefaultCalendar( cal->mCalNumber );
cal = calendars.next();
}
mCalendar->setSyncEventsReadOnly();
mCalendar->reInitAlarmSettings();
}
void KOListView::populateCalPopup()
{
mCalPopup->clear();
KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
while ( kkf ) {
int index = mCalPopup->insertItem( kkf->mName, kkf->mCalNumber);
- mCalPopup->setItemEnabled( index, !kkf->isReadOnly );
+ if ( kkf->mErrorOnLoad || kkf->isReadOnly )
+ mCalPopup->setItemEnabled( index, false );
kkf = KOPrefs::instance()->mCalendars.next();
}
}
void KOListView::updateList()
{
// qDebug(" KOListView::updateList() ");
}
void KOListView::clearList()
{
clear ();
}
void KOListView::addCat( )
{
setCategories( false );
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index b6ce7d5..b797d8c 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -121,50 +121,47 @@ class KOex2phonePrefs : public QDialog
qApp->processEvents();
int dw = QApplication::desktop()->width();
int dh = QApplication::desktop()->height();
move( (dw-width())/2, (dh - height() )/2 );
}
public:
QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
QCheckBox* mWriteBackFuture;
QSpinBox* mWriteBackFutureWeeks;
};
QPixmap* sgListViewCompletedPix[6];
int globalFlagBlockStartup;
-MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
+MainWindow::MainWindow( QWidget *parent, const char *name ) :
QMainWindow( parent, name )
{
sgListViewCompletedPix[5] = &listviewPix;
sgListViewCompletedPix[0] = &listviewPix0;
sgListViewCompletedPix[1] = &listviewPix20;
sgListViewCompletedPix[2] = &listviewPix40;
sgListViewCompletedPix[3] = &listviewPix60;
sgListViewCompletedPix[4] = &listviewPix80;
if ( sgListViewCompletedPix[5]->height() < 5 ) {
- int size = 12;
+ //int size = 12;
sgListViewCompletedPix[5]->resize( 11, 11 );
sgListViewCompletedPix[5]->fill( Qt::white );
QPainter p ( sgListViewCompletedPix[5] );
p.drawRect( 0,0,11,11);
- int half = size/2;
- int heihei = size/2;
- int x = 1;
p.drawLine ( 2, 5, 4 , 7 ) ;
p.drawLine ( 4 , 7 , 8, 3) ;
int iii = 0;
for ( iii = 0; iii < 5; ++iii ) {
sgListViewCompletedPix[iii]->resize( 11, 11 );
sgListViewCompletedPix[iii]->fill( Qt::white );
QPainter p ( sgListViewCompletedPix[iii] );
p.drawRect( 0,0,11,11);
if ( iii )
p.fillRect( 1,1,iii*2,9,Qt::gray );
}
}
mClosed = false;
//QString confFile = KStandardDirs::appDir() + "config/korganizerrc";
QString confFile = locateLocal("config","korganizerrc");
QFileInfo finf ( confFile );
@@ -331,33 +328,32 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
KMessageBox::information( this, message);
mView->openCalendar( oldFile );
qApp->processEvents();
}
}
mView->saveCalendar( defaultFileName() );
newFile = true;
}
QTime neededSaveTime = QDateTime::currentDateTime().time();
mView->loadCalendars();
int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
qDebug("KO: Calendar loading time: %d ms",msNeeded );
if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) {
KOPrefs::instance()->setAllDefaults();
- int count = mView->addCategories();
}
processIncidenceSelection( 0 );
connect( mView, SIGNAL( incidenceSelected( Incidence * ) ),
SLOT( processIncidenceSelection( Incidence * ) ) );
connect( mView, SIGNAL( modifiedChanged( bool ) ),
SLOT( slotModifiedChanged( bool ) ) );
connect( mView, SIGNAL( tempDisableBR(bool) ),
SLOT( disableBR(bool) ) );
connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) );
mView->setModified( false );
mBlockAtStartup = false;
mView->setModified( false );
setCentralWidget( mView );
globalFlagBlockStartup = 0;
@@ -1842,37 +1838,37 @@ void MainWindow::saveOnClose()
if ( p->mToolBarHorV )
p->mToolBarUpV = viewToolBar->y() > height()/2;
else
p->mToolBarUpV = viewToolBar->x() > width()/2 ;
if ( p->mToolBarHorN )
p->mToolBarUpN = navigatorToolBar->y() > height()/2;
else
p->mToolBarUpN = navigatorToolBar->x() > width()/2 ;
if ( filterToolBar ) {
if ( p->mToolBarHorF )
p->mToolBarUpF = filterToolBar->y() > height()/2;
else
p->mToolBarUpF = filterToolBar->x() > width()/2 ;
}
#endif
-
save();
mView->writeSettings();
+ mView->checkSuspendAlarm();
}
-void MainWindow::slotModifiedChanged( bool changed )
+void MainWindow::slotModifiedChanged( bool )
{
if ( mBlockAtStartup )
return;
int msec;
// we store the changes after 1 minute,
// and for safety reasons after 10 minutes again
if ( !mSyncManager->blockSave() )
msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000;
else
msec = 1000 * 600;
mSaveTimer.start( msec, true ); // 1 minute
qDebug("KO: Saving File in %d secs!", msec/1000);
mCalendarModifiedFlag = true;
}
void MainWindow::saveStopTimer()
@@ -1890,33 +1886,33 @@ void MainWindow::backupAllFiles()
if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir)
bupDir = KGlobalSettings::backupDataDir();
int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers );
if ( retval == 0 ) {
setCaption(i18n("Backup cancelled" ));
qDebug("KO: Backup cancelled. Will try again tomorrow ");
// retval == 0 : backup skipped for today, try again tomorrow
KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1;
} else if ( retval == 1 ){
qDebug("KO: Backup created.");
// backup ok
QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
KopiCalendarFile * cal = calendars.first();
cal = calendars.next();
while ( cal ) {
if ( !cal->mErrorOnLoad ) {
- int retval = KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers );
+ KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers );
}
cal = calendars.next();
}
KOPrefs::instance()->mLastBackupDate = daysTo;
setCaption(i18n("Backup succesfully finished" ));
} else if ( retval == 2 ){
setCaption(i18n("Backup globally disabled" ));
qDebug("KO: Backup globally cancelled.");
// backup globally cancelled
KPimGlobalPrefs::instance()->mBackupEnabled = false;
}
// retval == 3: do nothing, try again later
}
void MainWindow::save()
{
if ( mView->viewManager()->journalView() )
@@ -2395,36 +2391,35 @@ void MainWindow::loadCalendar()
KOPrefs::instance()->mLastLoadFile = fn;
mess = i18n("KO/Pi:Loaded %1").arg(fn) ;
setCaption(mess);
}
#endif
}
void MainWindow::quickImportIcal()
{
importFile( KOPrefs::instance()->mLastImportFile, false );
}
void MainWindow::importFile( QString fn, bool quick )
{
QFileInfo info;
info.setFile( fn );
QString mess;
- bool loadbup = true;
if ( !info. exists() ) {
mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30));
- int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
+ QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
mess );
return;
}
int result = 0;
if ( !quick ) {
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 ));
result = QMessageBox::warning( this, "KO/Pi: Warning!",
mess,
"Import", "Cancel", 0,
0, 1 );
}
if ( result == 0 ) {
if ( mView->openCalendar( fn, true )) {
KOPrefs::instance()->mLastImportFile = fn;
setCaption(i18n("Imported file successfully"));
} else {
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index 953774f..a948a52 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -23,33 +23,33 @@ class KSyncProfile;
#define QPEMenuBar QMenuBar
#endif
class QPEToolBar;
class QPEMenuBar;
namespace KCal {
class CalendarLocal;
}
using namespace KCal;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
- MainWindow( QWidget *parent = 0, const char *name = 0, QString command = "");
+ MainWindow( QWidget *parent = 0, const char *name = 0 );
~MainWindow();
bool beamReceiveEnabled();
static QString defaultFileName();
static QString syncFileName();
static QString resourcePath();
public slots:
void setUsesBigPixmaps ( bool );
void setCaption ( const QString & );
void updateWeekNum(const KCal::DateList &);
void updateWeek(QDate);
void updateFilterToolbar();
virtual void showMaximized ();
void configureAgenda( int );
void recieve( const QCString& msg, const QByteArray& data );
protected slots:
void startMultiSync();