summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-07-07 04:18:11 (UTC)
committer zautrix <zautrix>2005-07-07 04:18:11 (UTC)
commitb4d85da57e2d558ec088af6f3b2a34b1854462c0 (patch) (side-by-side diff)
tree0860bfaae1d15aae6cd24861eaa87d0331fb364a
parentcb350dbe9151db2ded62942d29d11d6c8b88eabd (diff)
downloadkdepimpi-b4d85da57e2d558ec088af6f3b2a34b1854462c0.zip
kdepimpi-b4d85da57e2d558ec088af6f3b2a34b1854462c0.tar.gz
kdepimpi-b4d85da57e2d558ec088af6f3b2a34b1854462c0.tar.bz2
conflict
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt2
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt14
-rw-r--r--korganizer/calendarview.cpp80
-rw-r--r--korganizer/calendarview.h4
-rw-r--r--korganizer/mainwindow.cpp69
5 files changed, 141 insertions, 28 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 79de197..814c541 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,31 +1,33 @@
Info about the changes in new versions of KDE-Pim/Pi
********** VERSION 2.1.14 ************
Added some buttons to the KO/Pi Quick-todo line to make it possible to quickly access some todo view layout settings like display all flat/open/close and hide/show running/done.
Added a button to add a subtodo quickly.
+Added a possibility to search for conflicting events. (In the Action menu. Keyboard shortcut "q" ).
+
********** VERSION 2.1.13 ************
Fixed a problem in KA/Pi search.
Fixed some minor problems in KO/Pi.
Added calendar selection possibility to the todo view popup and to the event/todo/journal editor.
Fixed memory usage problems in KA/Pi:
When loading data KA/Pi did load the file data twice.
Example:
A 600k file did consume 1200k memory during loading process.
This is fixed, it does now consume only 600k during loading process.
When saving data KA/Pi did consume a lot of memory for the data parsing during the save process.
This is fixed.
Example:
Before saving a 600k file KA/Pi did consume 21.7 Meg of Ram.
When saving KA/Pi did consume 28.6 Meg of Ram. That causes a crash on the Zaurus because there was no memeory left in the system.
Now KA/Pi is consuming on saving the same data 22.0 Meg of Ram during the save process.
Note: The memory usage of KA/Pi after the data is loaded/saved has not changed.
The saving of data may be a bit slower now.
Fixed memory usage problems in KO/Pi:
When KO/Pi did save the data to file, it did not release the used buffers after saving.
The used buffer was released after saving the next time, but there was new buffer space allocated again on that save operation.
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index bcc23dc..b225594 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1473,34 +1473,48 @@
{ "Pending Suspend Alarm","Laufender Suspend Alarm" },
{ "Error loading calendar %1","Fehler beim Laden von Kalender %1" },
{ "Calendar(s) not loaded:","Nicht geladene(r) Kalender:" },
{ "Loding of calendar(s) failed","Laden von Kalendern fehlgeschlagen" },
{ "Alarm Options","Alarm Einstellungen" },
{ "Delete selected...","Lösche Ausgewählte..." },
{ "None","Nichts" },
{ "Selection","Auswahl" },
{ "Set categories","Setze Kategorien" },
{ "This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!","Das fügt die ausgewählten\nEinträge dem Kalender\n%1\nhinzu und entfernt sie von\nihrem aktuellen Kalender!" },
{ "Reset","Neu setzen" },
{ "Do you want to <b>add</b> categories to the selected items or <b>reset</b> the list (i.e. remove current categories)?","Möchten Sie Kategorien zu den ausgewählten Einträgen <b>hinzufügen</b> oder die Liste <b>neu setzen</b> (d.h. vorhandene Kategorien löschen)?" },
{ "The file\n%1\ndoes not exist!\nShall I create it for you?","Die Datei\n%1\nexistiert nicht!\nSoll sie neu angelegt werden?" },
{ "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" },
{ "\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n","\nKEIN\n SCHREIBBARER\n KALENDER\n GEFUNDEN!\n\nBitte korrigieren Sie\nihre Kalendereinstellungen!\n" },
{ "\nThe file\n%1\non disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n","\nDie Datei\n%1\nwurde verändert!\nDatei Grösse: %2 Bytes.\nZuletzt geändert: %3\nMöchten Sie:\n\n - Speichern und die Datei überschreiben?\n - Mit Datei Synchronisieren, dann speichern?\n - Abbrechen ohne zu speichern? \n" },
{ "Edit","Edit" },
{ "Last Modified","Zuletzt geändert" },
{ "Journal viewer","Journal Anzeige" },
{ "Configure Calendar Files...","Konfiguriere Kalenderdateien..." },
{ "You can use and display <b>more than one</b> calendar file in KO/Pi. A calendar file is called a <b>resource</b>. To add a calendar or change calendar settings please use menu: <b>View -> Toggle Resource View</b>.","Sie können <b>mehr als eine</b> Kalenderdatei in KO/Pi darstellen und benutzen. Eine Kalenderdatei wird <b>Resource</b> genannt. Um einen Kalender hinzuzufügen oder die Kalendereinstellungen zu ändern benutzen Sie bitte das Menu: <b>Ansicht -> Resourcenansicht umschalten</b>." },
{ "Hide Completed","Verstecke erledigte Todos" },
{ "Show not Running","Zeige nicht Laufende" },
{ "Click to add new Todo","Klick für neues Todo!" },
+{ "Show next conflict for","Zeige nächsten Konflikt für" },
+{ "All events","Alle Termine" },
+{ "Allday events","Ganztagestermine" },
+{ "Events with time","Termine mit Zeit" },
+{ "No conflict found within the next two years","Kein Konflikt innerhalb der nächsten zwei Jahre gefunden" },
+{ "Conflict %1 <-> %2","Konflikt %1 <-> %2" },
+{ "<p><b>Q</b>: Show next date with conflicting events\n ","<p><b>Q</b>: Zeige nächstes Datum mit Terminen im Konflikt\n " },
+{ "","" },
+{ "","" },
+{ "","" },
+{ "","" },
+{ "","" },
+{ "","" },
+{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index bc1c0c7..9a114d0 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -633,48 +633,114 @@ void CalendarView::init()
mAlarmDialog->setServerNotification( false );
mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime );
#ifndef DESKTOP_VERSION
//US listen for arriving address resultsets
connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)),
this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
#endif
mDateNavigator->setCalendar( mCalendar );
}
CalendarView::~CalendarView()
{
// kdDebug() << "~CalendarView()" << endl;
//qDebug("CalendarView::~CalendarView() ");
delete mDialogManager;
delete mViewManager;
delete mStorage;
delete mDateFrame ;
delete mEventViewerDialog;
//kdDebug() << "~CalendarView() done" << endl;
}
+void CalendarView::nextConflict( bool all, bool allday )
+{
+ QDate start = mNavigator->selectedDates().first().addDays(1);
+ QDate end = start.addDays( 365*2);
+ while ( start < end ) {
+ QPtrList<Event> eventList = calendar()->events( start );
+ Event * ev = eventList.first();
+ QPtrList<Event> test = eventList;
+ while ( ev ) {
+ //qDebug("found %d on %s ", eventList.count(), start.toString().latin1());
+ Event * t_ev = test.first();
+ QDateTime es = ev->dtStart();
+ QDateTime ee = ev->dtEnd();
+ if ( ev->doesFloat() )
+ ee = ee.addDays( 1 );
+ if ( ! all ) {
+ if ( ev->doesFloat() != allday )
+ t_ev = 0;
+ }
+ while ( t_ev ) {
+ bool skip = false;
+ if ( ! all ) {
+ if ( t_ev->doesFloat() != allday )
+ skip = true;
+ }
+ if ( !skip && ev != t_ev ) {
+ QDateTime ets = t_ev->dtStart();
+ QDateTime ete = t_ev->dtEnd();
+ if ( t_ev->doesFloat() )
+ ete = ete.addDays( 1 );
+ //qDebug("test %s -- %s -------- %s -- %s ", es.toString().latin1() , ee.toString().latin1(), ets.toString().latin1() , ete.toString().latin1() );
+ if ( es < ete && ets < ee ) {
+ if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )
+ mViewManager->showDayView();
+ mNavigator->slotDaySelect( start );
+ int hour = es.time().hour();
+ if ( ets > es )
+ hour = ets.time().hour();
+ mViewManager->agendaView()->setStartHour( hour );
+ topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( ev->summary().left( 20 ) ).arg( t_ev->summary().left( 20 ) ) );
+ return;
+ }
+ }
+ t_ev = test.next();
+ }
+ ev = eventList.next();
+ }
+ start = start.addDays( 1 );
+ }
+ topLevelWidget()->setCaption( i18n("No conflict found within the next two years") );
+ qDebug("No conflict found ");
+}
+
+void CalendarView::conflictAll()
+{
+ nextConflict ( true, true );
+}
+void CalendarView::conflictAllday()
+{
+ nextConflict ( false, true );
+}
+void CalendarView::conflictNotAll()
+{
+ nextConflict ( false, false );
+}
+
void CalendarView::setCalReadOnly( int id, bool readO )
{
if ( readO ) {
emit save();
}
mCalendar->setReadOnly( id, readO );
}
void CalendarView::setScrollBarStep(int val )
{
#ifdef DESKTOP_VERSION
mDateScrollBar->setLineStep ( val );
#endif
}
void CalendarView::scrollBarValue(int val )
{
#ifdef DESKTOP_VERSION
if ( QApplication::desktop()->width() < 800 ) return;
static bool block = false;
if ( block ) return;
block = true;
int count = mNavigator->selectedDates().count();
int day = mNavigator->selectedDates().first().dayOfYear();
int stepdays = val;
if ( mDateScrollBar->lineStep () <= count ) {
@@ -3141,49 +3207,49 @@ void CalendarView::toggleCancelIncidence()
Incidence *incidence = currentSelection();
if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
if ( incidence ) {
cancelIncidence(incidence);
}
}
void CalendarView::cancelIncidence(Incidence * inc )
{
inc->setCancelled( ! inc->cancelled() );
changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED );
updateView();
}
void CalendarView::cloneIncidence(Incidence * orgInc )
{
Incidence * newInc = orgInc->clone();
newInc->recreate();
if ( newInc->typeID() == todoID ) {
Todo* t = (Todo*) newInc;
bool cloneSub = false;
if ( orgInc->relations().count() ) {
int result = KMessageBox::warningYesNoCancel(this,
- i18n("The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?").arg( newInc->summary().left ( 25 ) ),
+ i18n("The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?").arg( KGlobal::formatMessage ( newInc->summary(),0 ) ),
i18n("Todo has subtodos"),
i18n("Yes"),
i18n("No"));
if ( result == KMessageBox::Cancel ) {
delete t;
return;
}
if (result == KMessageBox::Yes) cloneSub = true;
}
showTodoEditor();
mTodoEditor->editTodo( t );
if ( mTodoEditor->exec() ) {
if ( cloneSub ) {
orgInc->cloneRelations( t );
mCalendar->addIncidenceBranch( t );
updateView();
} else {
mCalendar->addTodo( t );
updateView();
}
} else {
delete t;
@@ -3479,170 +3545,170 @@ void CalendarView::appointment_delete()
}
void CalendarView::todo_resub( Todo * parent, Todo * sub )
{
if (!sub) return;
if ( sub->relatedTo() == parent )
return;
sub->setRelatedTo(parent);
sub->updated();
setModified(true);
updateView();
}
void CalendarView::todo_unsub(Todo *anTodo )
{
todo_resub( 0, anTodo );
}
void CalendarView::deleteTodo(Todo *todo)
{
if (!todo) {
KNotifyClient::beep();
return;
}
if (KOPrefs::instance()->mConfirm) {
- QString text = todo->summary().left(20);
+ QString text = KGlobal::formatMessage ( todo->summary(),0 );
if (!todo->relations().isEmpty()) {
text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!");
}
switch (msgItemDelete(i18n("Todo:") +"\n"+text)) {
case KMessageBox::Continue: // OK
bool deleteT = false;
if (!todo->relations().isEmpty()) {
deleteT = removeCompletedSubTodos( todo );
}
// deleteT == true: todo already deleted in removeCompletedSubTodos
if ( !deleteT ) {
checkExternalId( todo );
calendar()->deleteTodo(todo);
changeTodoDisplay( todo,KOGlobals::EVENTDELETED );
updateView();
}
break;
} // switch
} else {
checkExternalId( todo );
mCalendar->deleteTodo(todo);
changeTodoDisplay( todo,KOGlobals::EVENTDELETED );
updateView();
}
emit updateSearchDialog();
}
void CalendarView::deleteJournal(Journal *jour)
{
if (!jour) {
KNotifyClient::beep();
return;
}
if (KOPrefs::instance()->mConfirm) {
QString des;
if ( !jour->summary().isEmpty() ) {
des = jour->summary();
} else {
des = jour->description().left(30);
des = des.simplifyWhiteSpace ();
des.replace (QRegExp ("\\n"),"" );
des.replace (QRegExp ("\\r"),"" );
}
- switch (msgItemDelete( i18n("Journal:") +"\n"+des.left(20))) {
+ switch (msgItemDelete( i18n("Journal:") +"\n"+KGlobal::formatMessage ( des,0 ))) {
case KMessageBox::Continue: // OK
calendar()->deleteJournal(jour);
updateView();
break;
} // switch
} else {
calendar()->deleteJournal(jour);;
updateView();
}
emit updateSearchDialog();
}
void CalendarView::deleteEvent(Event *anEvent)
{
if (!anEvent) {
KNotifyClient::beep();
return;
}
if (anEvent->recurrence()->doesRecur()) {
QDate itemDate = mViewManager->currentSelectionDate();
int km;
if (!itemDate.isValid()) {
//kdDebug() << "Date Not Valid" << endl;
if (KOPrefs::instance()->mConfirm) {
- km = KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) +
+ km = KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) +
i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"),
i18n("KO/Pi Confirmation"),i18n("Delete All"));
if ( km == KMessageBox::Continue )
km = KMessageBox::No; // No = all below
} else
km = KMessageBox::No;
} else {
- km = KMessageBox::warningYesNoCancel(this,anEvent->summary().left(25) +
+ km = KMessageBox::warningYesNoCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) +
i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+
KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"),
i18n("KO/Pi Confirmation"),i18n("Current"),
i18n("All"));
}
switch(km) {
case KMessageBox::No: // Continue // all
//qDebug("KMessageBox::No ");
if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
schedule(Scheduler::Cancel,anEvent);
checkExternalId( anEvent);
mCalendar->deleteEvent(anEvent);
changeEventDisplay(anEvent,KOGlobals::EVENTDELETED);
break;
// Disabled because it does not work
//#if 0
case KMessageBox::Yes: // just this one
//QDate qd = mNavigator->selectedDates().first();
//if (!qd.isValid()) {
// kdDebug() << "no date selected, or invalid date" << endl;
// KNotifyClient::beep();
// return;
//}
//while (!anEvent->recursOn(qd)) qd = qd.addDays(1);
if (itemDate!=QDate(1,1,1) || itemDate.isValid()) {
anEvent->addExDate(itemDate);
int duration = anEvent->recurrence()->duration();
if ( duration > 0 ) {
anEvent->recurrence()->setDuration( duration - 1 );
}
changeEventDisplay(anEvent, KOGlobals::EVENTEDITED);
}
break;
//#endif
} // switch
} else {
if (KOPrefs::instance()->mConfirm) {
- switch (KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) +
+ switch (KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) +
i18n("\nAre you sure you want\nto delete this event?"),
i18n("KO/Pi Confirmation"),i18n("Delete"))) {
case KMessageBox::Continue: // OK
if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
schedule(Scheduler::Cancel,anEvent);
checkExternalId( anEvent);
mCalendar->deleteEvent(anEvent);
changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
break;
} // switch
} else {
if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
schedule(Scheduler::Cancel,anEvent);
checkExternalId( anEvent);
mCalendar->deleteEvent(anEvent);
changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
}
} // if-else
emit updateSearchDialog();
}
bool CalendarView::deleteEvent(const QString &uid)
{
Event *ev = mCalendar->event(uid);
@@ -4559,49 +4625,49 @@ bool CalendarView::syncExternal(KSyncManager* manager, QString resource)
// pending setmodified
return true;
}
void CalendarView::setSyncManager(KSyncManager* manager)
{
mSyncManager = manager;
}
void CalendarView::removeSyncInfo( QString syncProfile)
{
qDebug("KO: removeSyncInfo for profile %s ", syncProfile.latin1());
mCalendar->removeSyncInfo( syncProfile );
}
void CalendarView::undo_delete()
{
//qDebug("undo_delete() ");
Incidence* undo = mCalendar->undoIncidence();
if ( !undo ) {
KMessageBox::sorry(this,i18n("There is nothing to undo!"),
i18n("KO/Pi"));
return;
}
- if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,undo->summary().left(25) +
+ if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( undo->summary(),0 ) +
i18n("\nAre you sure you want\nto restore this?"),
i18n("KO/Pi Confirmation"),i18n("Restore"))) {
mCalendar->undoDeleteIncidence();
updateView();
}
}
void CalendarView::slotViewerClosed()
{
QTimer::singleShot( 50, this, SLOT ( resetFocus() ) );
}
void CalendarView::resetFocus()
{
if ( mViewerCallerIsSearchDialog ) {
if ( mDialogManager->getSearchDialog()->isVisible() ){
mDialogManager->getSearchDialog()->raise();
mDialogManager->getSearchDialog()->setActiveWindow();
mDialogManager->getSearchDialog()->listview()->resetFocus();
} else
mViewerCallerIsSearchDialog = false;
}
if ( !mViewerCallerIsSearchDialog ) {
//mViewManager->currentView()->setFocus();
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index a5f230a..51eb1d4 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -179,48 +179,52 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
/** Emitted, when a todoitem is selected or deselected. */
void todoSelected( bool );
/**
Emitted, when clipboard content changes. Parameter indicates if paste
is possible or not.
*/
void pasteEnabled(bool);
/** Emitted, when the number of incoming messages has changed. */
void numIncomingChanged(int);
/** Emitted, when the number of outgoing messages has changed. */
void numOutgoingChanged(int);
/** Send status message, which can e.g. be displayed in the status bar. */
void statusMessage(const QString &);
void calendarViewExpanded( bool );
void updateSearchDialog();
void filtersUpdated();
public slots:
+ void nextConflict( bool all, bool allday );
+ void conflictAll();
+ void conflictAllday();
+ void conflictNotAll();
void setCalReadOnly( int id, bool readO );
void checkAlarms();
void checkFiles();
void slotprintSelInc();
void showNextAlarms();
void showOpenError();
void watchSavedFile();
void recheckTimerAlarm();
void checkNextTimerAlarm();
void addAlarm(const QDateTime &qdt, const QString &noti );
void addSuspendAlarm(const QDateTime &qdt, const QString &noti );
void removeAlarm(const QDateTime &qdt, const QString &noti );
/** options dialog made a changed to the configuration. we catch this
* and notify all widgets which need to update their configuration. */
void updateConfig();
void insertBirthdays(const QString& uid, const QStringList& birthdayList,
const QStringList& anniversaryList, const QStringList& realNameList,
const QStringList& emailList, const QStringList& assembledNameList,
const QStringList& uidList);
/**
Load calendar from file \a filename. If \a merge is true, load
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 9c2ac82..bfae1b5 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -638,48 +638,49 @@ void MainWindow::startMultiSync()
QCopEnvelope e("QPE/Application/kapi", "doRingSync");
#endif
}
QPixmap MainWindow::loadPixmap( QString name )
{
return SmallIcon( name );
}
void MainWindow::setUsesBigPixmaps ( bool b )
{
qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b);
if ( b )
qDebug("KO: BigPixmaps are not supported ");
}
void MainWindow::initActions()
{
//KOPrefs::instance()->mShowFullMenu
iconToolBar->clear();
KOPrefs *p = KOPrefs::instance();
//QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar );
QPopupMenu *viewMenu = new QPopupMenu( this );
QPopupMenu *actionMenu = new QPopupMenu( this );
mCurrentItemMenu = new QPopupMenu ( this );
+ QPopupMenu *nextConflictMenu = new QPopupMenu ( this );
QPopupMenu *importMenu = new QPopupMenu( this );
QPopupMenu *importMenu_X = new QPopupMenu( this );
QPopupMenu *exportMenu_X = new QPopupMenu( this );
QPopupMenu *beamMenu_X = new QPopupMenu( this );
selectFilterMenu = new QPopupMenu( this );
selectFilterMenu->setCheckable( true );
syncMenu = new QPopupMenu( this );
configureAgendaMenu = new QPopupMenu( this );
configureToolBarMenu = new QPopupMenu( this );
QPopupMenu *helpMenu = new QPopupMenu( this );
QIconSet icon;
int pixWid = 22, pixHei = 22;
QString pathString = "";
if ( !p->mToolBarMiniIcons ) {
if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) {
pathString += "icons16/";
pixWid = 18; pixHei = 16;
}
} else {
pathString += "iconsmini/";
pixWid = 18; pixHei = 16;
}
if ( KOPrefs::instance()->mShowFullMenu ) {
QMenuBar *menuBar1;
@@ -768,115 +769,136 @@ void MainWindow::initActions()
for ( iii = 1;iii<= 10 ;++iii ){
configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 );
}
//configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
connect( configureAgendaMenu, SIGNAL( aboutToShow()),
this, SLOT( showConfigureAgenda( ) ) );
icon = loadPixmap( pathString + "today" );
QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
today_action->addTo( actionMenu );
connect( today_action, SIGNAL( activated() ),
mView, SLOT( goToday() ) );
icon = loadPixmap( pathString + "picker" );
QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this );
dPickerAction->addTo( actionMenu );
connect( dPickerAction, SIGNAL( activated() ),
mView, SLOT( showDatePicker() ) );
icon = loadPixmap( pathString + "search" );
QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this );
search_action->addTo( actionMenu );
connect( search_action, SIGNAL( activated() ),
mView->dialogManager(), SLOT( showSearchDialog() ) );
+ actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu );
- actionMenu->insertSeparator();
-
+ action = new QAction( "Undo Delete", i18n("All events"), 0, this );
+ action->addTo( nextConflictMenu );
+ connect( action, SIGNAL( activated() ),
+ mView, SLOT( conflictAll() ) );
+ action = new QAction( "Undo Delete", i18n("Allday events"), 0, this );
+ action->addTo( nextConflictMenu );
+ connect( action, SIGNAL( activated() ),
+ mView, SLOT( conflictAllday() ) );
- action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
- action->addTo( mCurrentItemMenu );
+ action = new QAction( "Undo Delete", i18n("Events with time"), 0, this );
+ action->addTo( nextConflictMenu );
connect( action, SIGNAL( activated() ),
- mView, SLOT( undo_delete() ) );
+ mView, SLOT( conflictNotAll() ) );
+
+ actionMenu->insertSeparator();
+
+ icon = loadPixmap( pathString + "newevent" );
+ QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
+ ne_action->addTo( mCurrentItemMenu );
+ connect( ne_action, SIGNAL( activated() ),
+ mView, SLOT( newEvent() ) );
+ icon = loadPixmap( pathString + "newtodo" );
+ configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
+ QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
+ nt_action->addTo( mCurrentItemMenu );
+ connect( nt_action, SIGNAL( activated() ),
+ mView, SLOT( newTodo() ) );
+ mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0,
+ this );
+ mNewSubTodoAction->addTo( mCurrentItemMenu );
+ connect( mNewSubTodoAction, SIGNAL( activated() ),
+ mView, SLOT( newSubTodo() ) );
+
mCurrentItemMenu->insertSeparator();
icon = loadPixmap( pathString + "newevent" );
configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 );
configureToolBarMenu->insertSeparator();
configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 );
configureToolBarMenu->insertSeparator();
configureToolBarMenu->insertItem(i18n("Week Number"), 400);
configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
//actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu);
mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this );
mShowAction->addTo( mCurrentItemMenu );
connect( mShowAction, SIGNAL( activated() ),
mView, SLOT( showIncidence() ) );
mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this );
mEditAction->addTo( mCurrentItemMenu );
connect( mEditAction, SIGNAL( activated() ),
mView, SLOT( editIncidence() ) );
mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this );
mDeleteAction->addTo( mCurrentItemMenu );
connect( mDeleteAction, SIGNAL( activated() ),
mView, SLOT( deleteIncidence() ) );
mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this );
mCloneAction->addTo( mCurrentItemMenu );
connect( mCloneAction, SIGNAL( activated() ),
mView, SLOT( cloneIncidence() ) );
mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this );
mMoveAction->addTo( mCurrentItemMenu );
connect( mMoveAction, SIGNAL( activated() ),
mView, SLOT( moveIncidence() ) );
#ifndef DESKTOP_VERSION
mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this );
mBeamAction->addTo(mCurrentItemMenu );
connect( mBeamAction, SIGNAL( activated() ),
mView, SLOT( beamIncidence() ) );
#endif
mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this );
mCancelAction->addTo( mCurrentItemMenu );
connect( mCancelAction, SIGNAL( activated() ),
mView, SLOT( toggleCancelIncidence() ) );
- QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
- ne_action->addTo( actionMenu );
- connect( ne_action, SIGNAL( activated() ),
- mView, SLOT( newEvent() ) );
- icon = loadPixmap( pathString + "newtodo" );
- configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
- QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
- nt_action->addTo( actionMenu );
- connect( nt_action, SIGNAL( activated() ),
- mView, SLOT( newTodo() ) );
-
+ mCurrentItemMenu->insertSeparator();
+ action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
+ action->addTo( mCurrentItemMenu );
+ connect( action, SIGNAL( activated() ),
+ mView, SLOT( undo_delete() ) );
// ***********************
if ( KOPrefs::instance()->mVerticalScreen ) {
icon = SmallIcon( "1updownarrow" );
} else {
icon = SmallIcon("1leftrightarrow" );
}
configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 );
QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this );
FSaction->addTo( viewMenu );
connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() ));
icon = loadPixmap( pathString + "filter" );
configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 );
icon = loadPixmap( pathString + "configure" );
action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this );
action->addTo( viewMenu );
connect( action, SIGNAL( activated() ),
mView, SLOT( toggleFilter() ) );
mToggleFilter = action;
icon = loadPixmap( pathString + "navi" );
configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 );
action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this );
@@ -975,53 +997,49 @@ void MainWindow::initActions()
icon = loadPixmap( pathString + "list" );
configureToolBarMenu->insertItem(icon, i18n("List View"), 30 );
QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this );
showlist_action->addTo( viewMenu );
connect( showlist_action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showListView() ) );
icon = loadPixmap( pathString + "todo" );
configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 );
QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this );
todoview_action->addTo( viewMenu );
connect( todoview_action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showTodoView() ) );
#if 0
action = new QAction( "view_timespan", "Time Span", 0, this );
action->addTo( viewMenu );
connect( action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showTimeSpanView() ) );
#endif
- mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0,
- this );
- mNewSubTodoAction->addTo( actionMenu );
- connect( mNewSubTodoAction, SIGNAL( activated() ),
- mView, SLOT( newSubTodo() ) );
+
action = new QAction( "purge_completed", i18n("Purge Completed..."), 0,
this );
action->addTo( actionMenu );
connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) );
configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5);
actionMenu->insertSeparator();
action = new QAction( "manage cat", i18n("Edit category list..."), 0,
this );
action->addTo( actionMenu );
connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) );
action = new QAction( "manage cat", i18n("Manage new categories..."), 0,
this );
action->addTo( actionMenu );
connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) );
actionMenu->insertSeparator();
@@ -1544,48 +1562,49 @@ void MainWindow::about()
QMessageBox::about( this, i18n("About KOrganizer/Pi"),
i18n("KOrganizer/Platform-independent\n") +
"(KO/Pi) " + version + " - " +
#ifdef DESKTOP_VERSION
i18n("Desktop Edition\n") +
#else
i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") +
#endif
i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") );
}
void MainWindow::keyBindings()
{
QString cap = i18n("KO/Pi Keys + Colors");
QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") +
i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+
i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") +
i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") +
i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") +
i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+
i18n("<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n")+
i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+
i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+
i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+
+ i18n("<p><b>Q</b>: Show next date with conflicting events\n ")+
i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+
i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+
i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+
i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+
i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+
i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+
i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+
i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+
i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+
i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+
i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+
i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+
i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+
i18n("<p><h3>In agenda view:</h3></p>\n") +
i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+
i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+
i18n("<p><h3>In todo view:</h3></p>\n") +
i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+
i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+
i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+
i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+
i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+
i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+
@@ -2078,48 +2097,56 @@ void MainWindow::keyPressEvent ( QKeyEvent * e )
if ( e->state() == Qt::ControlButton )
mView->toggleDateNavigatorWidget();
else {
mView->viewManager()->showNextXView();
showSelectedDates = true;
}
break;
case Qt::Key_Space:
mView->toggleExpand();
break;
case Qt::Key_A:
if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton )
mView->showNextAlarms();
else
mView->toggleAllDaySize();
break;
case Qt::Key_T:
if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
mView->newTodo();
else {
mView->goToday();
showSelectedDates = true;
}
break;
+ case Qt::Key_Q:
+ if ( e->state() == Qt::ControlButton )
+ mView->conflictNotAll();
+ else if ( e->state() == Qt::ShiftButton )
+ mView->conflictAllday();
+ else
+ mView->conflictAll();
+ break;
case Qt::Key_J:
mView->viewManager()->showJournalView();
break;
case Qt::Key_B:
mView->editIncidenceDescription();;
break;
// case Qt::Key_Return:
case Qt::Key_E:
if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
mView->newEvent();
else
mView->editIncidence();
break;
case Qt::Key_Plus:
size = p->mHourSize +2;
if ( size <= 22 )
configureAgenda( size );
break;
case Qt::Key_Minus:
size = p->mHourSize - 2;
if ( size >= 4 )
configureAgenda( size );
break;