summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp14
-rw-r--r--korganizer/kolistview.cpp4
-rw-r--r--korganizer/koprefs.cpp1
-rw-r--r--korganizer/koprefs.h1
-rw-r--r--korganizer/searchdialog.cpp4
5 files changed, 23 insertions, 1 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 4b3f806..558fc55 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2646,48 +2646,57 @@ void CalendarView::changeEventDisplay(Event *which, int action)
void CalendarView::updateTodoViews()
{
mTodoList->updateView();
mViewManager->currentView()->updateView();
}
void CalendarView::clearAllViews()
{
mTodoList->clearList();
mViewManager->clearAllViews();
SearchDialog * sd = mDialogManager->getSearchDialog();
if ( sd ) {
KOListView* kol = sd->listview();
if ( kol )
kol->clearList();
}
}
void CalendarView::updateView()
{
+ static bool clearallviews = false;
+ if ( KOPrefs::instance()->mGlobalUpdateDisabled ) {
+ if ( clearallviews ) {
+ clearAllViews();
+ clearallviews = false;
+ }
+ return;
+ }
+ clearallviews = true;
DateList tmpList = mNavigator->selectedDates();
if ( KOPrefs::instance()->mHideNonStartedTodos )
mTodoList->updateView();
// We assume that the navigator only selects consecutive days.
updateView( tmpList.first(), tmpList.last() );
}
void CalendarView::updateUnmanagedViews()
{
mDateNavigator->updateDayMatrix();
}
int CalendarView::msgItemDelete(const QString name)
{
return KMessageBox::warningContinueCancel(this,name +"\n\n"+
i18n("This item will be\npermanently deleted."),
i18n("KO/Pi Confirmation"),i18n("Delete"));
}
void CalendarView::edit_cut()
{
Event *anEvent=0;
@@ -4390,48 +4399,53 @@ void CalendarView::showIncidence(Incidence *incidence)
if ( sender() && mDialogManager->getSearchDialog() ) {
if ( sender () == mDialogManager->getSearchDialog()->listview() ) {
mViewerCallerIsSearchDialog = true;
}
}
if ( incidence ) {
ShowIncidenceVisitor v;
v.act( incidence, this );
}
}
void CalendarView::editIncidence(Incidence *incidence)
{
if ( incidence ) {
EditIncidenceVisitor v;
v.act( incidence, this );
}
}
void CalendarView::deleteIncidence(Incidence *incidence)
{
//qDebug(" CalendarView::deleteIncidence ");
+ if ( incidence == 0 ) {
+ updateView();
+ emit updateSearchDialog();
+ return;
+ }
if ( incidence ) {
DeleteIncidenceVisitor v;
v.act( incidence, this );
}
}
void CalendarView::lookForOutgoingMessages()
{
OutgoingDialog *ogd = mDialogManager->outgoingDialog();
ogd->loadMessages();
}
void CalendarView::lookForIncomingMessages()
{
IncomingDialog *icd = mDialogManager->incomingDialog();
icd->retrieve();
}
bool CalendarView::removeCompletedSubTodos( Todo* t )
{
bool deleteTodo = true;
QPtrList<Incidence> subTodos;
Incidence *aTodo;
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 25e599d..5690bdb 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -844,61 +844,63 @@ void KOListView::deleteAll()
Incidence *incidence = delSel.first();
Incidence *toDelete;
KOPrefs *p = KOPrefs::instance();
bool confirm = p->mConfirm;
QString mess;
mess = mess.sprintf( i18n("You have %d item(s) selected.\n"), icount );
if ( KMessageBox::Continue == KMessageBox::warningContinueCancel(this, mess + i18n("All selected items will be\npermanently deleted.\n(Deleting items will take\nsome time on a PDA)\n"), i18n("KO/Pi Confirmation"),i18n("Delete")) ) {
p->mConfirm = false;
int delCounter = 0;
QDialog dia ( this, "p-dialog", true );
QLabel lab (i18n("Close dialog to abort deletion!"), &dia );
QVBoxLayout lay( &dia );
lay.setMargin(7);
lay.setSpacing(7);
lay.addWidget( &lab);
QProgressBar bar( icount, &dia );
lay.addWidget( &bar);
int w = 220;
int h = 50;
int dw = QApplication::desktop()->width();
int dh = QApplication::desktop()->height();
dia.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
//dia.resize( 240,50 );
dia.show();
-
+ KOPrefs::instance()->mGlobalUpdateDisabled = true;
while ( incidence ) {
bar.setProgress( delCounter );
mess = mess.sprintf( i18n("Deleting item %d ..."), ++delCounter );
dia.setCaption( mess );
qApp->processEvents();
toDelete = (incidence);
incidence = delSel.next();
emit deleteIncidenceSignal(toDelete );
if ( dia.result() != 0 )
break;
}
+ KOPrefs::instance()->mGlobalUpdateDisabled = false;
+ emit deleteIncidenceSignal( 0 );
mess = mess.sprintf( i18n("%d items remaining in list."), count() );
topLevelWidget ()->setCaption( mess );
p->mConfirm = confirm;
}
}
}
int KOListView::maxDatesHint()
{
return 0;
}
int KOListView::currentDateCount()
{
return 0;
}
QPtrList<Incidence> KOListView::selectedIncidences()
{
QPtrList<Incidence> eventList;
QListViewItem *item = mListView->firstChild ();
while ( item ) {
if ( item->isSelected() ) {
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 138028d..a63297e 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -32,48 +32,49 @@
#include <qregexp.h>
#include <qfont.h>
#include <qcolor.h>
#include <qstringlist.h>
#include <stdlib.h>
#include <kglobal.h>
#include <kglobalsettings.h>
#include <kconfig.h>
#include <klocale.h>
#include <kdebug.h>
#include <kemailsettings.h>
#include <kstaticdeleter.h>
#include <libkdepim/kpimglobalprefs.h>
#include "koprefs.h"
#include "mainwindow.h"
KOPrefs *KOPrefs::mInstance = 0;
static KStaticDeleter<KOPrefs> insd;
KOPrefs::KOPrefs() :
KPimPrefs("korganizerrc")
{
+ mGlobalUpdateDisabled = false;
mCategoryColors.setAutoDelete(true);
fillMailDefaults();
mDefaultCategoryColor = QColor(175,210,255);//196,196,196);
QColor defaultHolidayColor = QColor(255,0,0);
QColor defaultHighlightColor = QColor(129,112,255);//64,64,255);
QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128);
QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160);
QColor defaultTodoDueTodayColor = QColor(255,220,100);
QColor defaultTodoOverdueColor = QColor(255,153,125);
QColor defaultTodoRunColor = QColor(99,194,30);
KPrefs::setCurrentGroup("General");
addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true);
addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true);
addItemBool("ShowIconSearch",&mShowIconSearch,true);
addItemBool("ShowIconList",&mShowIconList,true);
addItemBool("ShowIconDay1",&mShowIconDay1,true);
addItemBool("ShowIconDay5",&mShowIconDay5,true);
addItemBool("ShowIconDay6",&mShowIconDay6,true);
addItemBool("ShowIconDay7",&mShowIconDay7,true);
addItemBool("ShowIconMonth",&mShowIconMonth,true);
addItemBool("ShowIconTodoview",&mShowIconTodoview,true);
addItemBool("ShowIconBackFast",&mShowIconBackFast,true);
addItemBool("ShowIconBack",&mShowIconBack,true);
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 0779e27..392360d 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -324,39 +324,40 @@ class KOPrefs : public KPimPrefs
bool mUseInternalAlarmNotification;
int mAlarmPlayBeeps;
int mAlarmSuspendTime;
int mAlarmSuspendCount;
int mAlarmBeepInterval;
int mOldLanguage;
int mOldLoadedLanguage;
QString mActiveSyncPort;
QString mActiveSyncIP;
// settings for eventviewer
bool mEVshowDetails;
bool mEVshowCreated;
bool mEVshowChanged;
bool mWTshowDetails;
bool mWTshowCreated;
bool mWTshowChanged;
int mCurrentDisplayedView;
QPtrList<KopiCalendarFile> mCalendars;
int mNextAvailableCalendar;
+ bool mGlobalUpdateDisabled;
private:
QDict<QColor> mCategoryColors;
QArray<KopiCalendarFile*> mDefCalColors;
QColor mDefaultCategoryColor;
QFont mDefaultTimeBarFont;
QFont mDefaultViewFont;
QFont mDefaultMonthViewFont;
QString mName;
QString mEmail;
};
#endif
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index 2e32ac2..9cfdc35 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -233,48 +233,52 @@ void SearchDialog::raiseAndSelect()
mSearchEvent->setChecked( false );
}
}
else {
if ( ! mSearchEvent->isChecked() ) {
mSearchEvent->setChecked( true );
mSearchJournal->setChecked( false );
mSearchTodo->setChecked( false );
}
}
}
currentState = newState;
raise();
}
void SearchDialog::setFocusToList()
{
listView->resetFocus();
}
void SearchDialog::accept()
{
doSearch();
}
void SearchDialog::updateList()
{
+ if ( KOPrefs::instance()->mGlobalUpdateDisabled ) {
+ listView->clear();
+ return;
+ }
//listView->updateList();
if ( isVisible() ) {
updateView();
//qDebug("SearchDialog::updated ");
}
else {
listView->clear();
//qDebug("SearchDialog::cleared ");
}
}
void SearchDialog::searchTextChanged( const QString &_text )
{
#if 0
enableButton( KDialogBase::User1, !_text.isEmpty() );
#endif
}
void SearchDialog::doSearch()
{
QRegExp re;
re.setWildcard(true); // most people understand these better.
re.setCaseSensitive(false);
QString st = searchEdit->text();