summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-16 13:36:11 (UTC)
committer zautrix <zautrix>2004-10-16 13:36:11 (UTC)
commitc3325ebbb92a2814fcb622caaf71316cfa0c2908 (patch) (side-by-side diff)
treeb53545c39f84fc6ce694f371509b4a9fe2ddd743
parent023b3c542a6dd4d1c4b53dba6bb2c68f605a7917 (diff)
downloadkdepimpi-c3325ebbb92a2814fcb622caaf71316cfa0c2908.zip
kdepimpi-c3325ebbb92a2814fcb622caaf71316cfa0c2908.tar.gz
kdepimpi-c3325ebbb92a2814fcb622caaf71316cfa0c2908.tar.bz2
made todos reparentable
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt8
-rw-r--r--korganizer/calendarview.cpp16
-rw-r--r--korganizer/calendarview.h1
-rw-r--r--korganizer/kotodoview.cpp88
-rw-r--r--korganizer/kotodoview.h3
-rw-r--r--korganizer/koviewmanager.cpp2
-rw-r--r--korganizer/mainwindow.cpp3
-rw-r--r--microkde/kdeui/klistview.cpp5
-rw-r--r--microkde/kdeui/klistview.h1
9 files changed, 121 insertions, 6 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index eb232fa..e17297a 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,50 +1,58 @@
Info about the changes in new versions of KDE-Pim/Pi
+********** VERSION 1.9.8 ************
+
+Fixed character decoding in OM/Pi.
+(e.g. German "Umlaute" were not displayed properly.)
+
+Made is possible to reparent todos in KO/Pi.
+Use contextmenu or keys (look at Help-Keys + Colors) for that.
+
********** VERSION 1.9.7 ************
KO/Pi - KA/Pi on Windows:
Now a directory can be defined by the user, where the
application/config data should be saved.
Define your desired path in the evironment variable
MICROKDEHOME
before starting KO/Pi or KA/Pi.
An easy Kx/Pi to Kx/Pi syncing is now possible
(it is called Pi-Sync) via network.
Please look at the Sync Howto.
Exporting of calendar data and contacts to mobile phones is now possible.
The SyncHowto is updated with information howto
access/sync mobile phones.
Please look at the Sync Howto.
Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly.
Please disable Fastload for the original contact/calendar applications
and close them.
KO/Pi and KA/Pi must be running in order to receive the data.
(KO/Pi and KA/Pi are always running if Fastload for them is enabled!)
In the KA/Pi details view are now the preferred tel. numbers displayed on top
of the other data ( emails/tel.numbers/addresses)
Fixed some syncing problems in KA/Pi.
Added font settings for the KA/Pi details view.
Added fields "children's name" and "gender" to KA/Pi.
Made searching in KA/Pi better:
Now the first item in a view is selected after a search automatically and
the views can be scrolled up/down when the search input field has the keyboard focus.
And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi.
********** VERSION 1.9.6 ************
Changes in the external application communication on the Zaurus
in order to use less RAM when the apps are running.
First syncing of addressbooks (KA/Pi) is possible.
********** VERSION 1.9.5a ************
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index e4a11f5..1f8ad5b 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -374,96 +374,98 @@ void CalendarView::init()
mNavigator, SLOT( selectPrevious() ) );
connect( mDateNavigator, SIGNAL( goNext() ),
mNavigator, SLOT( selectNext() ) );
connect( mDateNavigator, SIGNAL( monthSelected ( int ) ),
mNavigator, SLOT( slotMonthSelect( int ) ) );
connect( mNavigatorBar, SIGNAL( monthSelected ( int ) ),
mNavigator, SLOT( slotMonthSelect( int ) ) );
connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
mNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
connect( mDateNavigator, SIGNAL( eventDropped( Event * ) ),
SLOT( eventAdded( Event *) ) );
connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView()));
connect( this, SIGNAL( configChanged() ),
mDateNavigator, SLOT( updateConfig() ) );
connect( mTodoList, SIGNAL( newTodoSignal() ),
SLOT( newTodo() ) );
connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ),
SLOT( newSubTodo( Todo * ) ) );
connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ),
SLOT( editTodo( Todo * ) ) );
connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ),
SLOT( showTodo( Todo *) ) );
connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ),
SLOT( deleteTodo( Todo *) ) );
connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) );
connect( mTodoList, SIGNAL( purgeCompletedSignal() ),
SLOT( purgeCompleted() ) );
connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ),
SIGNAL( todoModified( Todo *, int ) ) );
connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ),
this, SLOT ( cloneIncidence( Incidence * ) ) );
connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ),
this, SLOT (cancelIncidence( Incidence * ) ) );
connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ),
this, SLOT ( moveIncidence( Incidence * ) ) );
connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ),
this, SLOT ( beamIncidence( Incidence * ) ) );
connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ),
this, SLOT ( todo_unsub( Todo * ) ) );
+ connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ),
+ this, SLOT ( todo_resub( Todo *,Todo * ) ) );
connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList,
SLOT( updateTodo( Todo *, int ) ) );
connect( this, SIGNAL( todoModified( Todo *, int )), this,
SLOT( changeTodoDisplay( Todo *, int ) ) );
connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) );
connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) );
connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) );
connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) );
connect(QApplication::clipboard(),SIGNAL(dataChanged()),
SLOT(checkClipboard()));
connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ),
SLOT( processTodoListSelection( Incidence * ) ) );
connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool)));
// kdDebug() << "CalendarView::CalendarView() done" << endl;
mDateFrame = new QVBox(0,0,WType_Popup);
//mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised);
mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised );
mDateFrame->setLineWidth(3);
mDateFrame->hide();
mDateFrame->setCaption( i18n( "Pick a date to display"));
mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() );
connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate)));
mEventEditor = mDialogManager->getEventEditor();
mTodoEditor = mDialogManager->getTodoEditor();
mFlagEditDescription = false;
mSuspendTimer = new QTimer( this );
mAlarmTimer = new QTimer( this );
mRecheckAlarmTimer = new QTimer( this );
connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) );
connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) );
connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) );
mAlarmDialog = new AlarmDialog( this );
connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) );
mAlarmDialog->setServerNotification( false );
mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime );
@@ -2701,96 +2703,110 @@ void CalendarView::appointment_show()
if (!anEvent) {
KNotifyClient::beep();
return;
}
showEvent(anEvent);
}
void CalendarView::appointment_edit()
{
Event *anEvent = 0;
Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
if (mViewManager->currentView()->isEventView()) {
if ( incidence && incidence->type() == "Event" ) {
anEvent = static_cast<Event *>(incidence);
}
}
if (!anEvent) {
KNotifyClient::beep();
return;
}
editEvent(anEvent);
}
void CalendarView::appointment_delete()
{
Event *anEvent = 0;
Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
if (mViewManager->currentView()->isEventView()) {
if ( incidence && incidence->type() == "Event" ) {
anEvent = static_cast<Event *>(incidence);
}
}
if (!anEvent) {
KNotifyClient::beep();
return;
}
deleteEvent(anEvent);
}
+void CalendarView::todo_resub( Todo * parent, Todo * sub )
+{
+ if (!sub) return;
+ if (!parent) return;
+ if ( sub->relatedTo() )
+ sub->relatedTo()->removeRelation(sub);
+ sub->setRelatedTo(parent);
+ sub->setRelatedToUid(parent->uid());
+ parent->addRelation(sub);
+ sub->updated();
+ parent->updated();
+ setModified(true);
+ updateView();
+}
void CalendarView::todo_unsub(Todo *anTodo )
{
// Todo *anTodo = selectedTodo();
if (!anTodo) return;
if (!anTodo->relatedTo()) return;
anTodo->relatedTo()->removeRelation(anTodo);
anTodo->setRelatedTo(0);
anTodo->updated();
anTodo->setRelatedToUid("");
setModified(true);
updateView();
}
void CalendarView::deleteTodo(Todo *todo)
{
if (!todo) {
KNotifyClient::beep();
return;
}
if (KOPrefs::instance()->mConfirm) {
switch (msgItemDelete()) {
case KMessageBox::Continue: // OK
if (!todo->relations().isEmpty()) {
KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."),
i18n("Delete To-Do"));
} else {
checkExternalId( todo );
calendar()->deleteTodo(todo);
changeTodoDisplay( todo,KOGlobals::EVENTDELETED );
updateView();
}
break;
} // switch
} else {
if (!todo->relations().isEmpty()) {
KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."),
i18n("Delete To-Do"));
} else {
checkExternalId( todo );
mCalendar->deleteTodo(todo);
changeTodoDisplay( todo,KOGlobals::EVENTDELETED );
updateView();
}
}
emit updateSearchDialog();
}
void CalendarView::deleteJournal(Journal *jour)
{
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 660cce7..9f56cc8 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -309,96 +309,97 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
void updateUnmanagedViews();
/** cut the current appointment to the clipboard */
void edit_cut();
/** copy the current appointment(s) to the clipboard */
void edit_copy();
/** paste the current vobject(s) in the clipboard buffer into calendar */
void edit_paste();
/** edit viewing and configuration options. */
void edit_options();
/**
Functions for printing, previewing a print, and setting up printing
parameters.
*/
void print();
void printSetup();
void printPreview();
/** Export as iCalendar file */
void exportICalendar();
/** Export as vCalendar file */
bool exportVCalendar( QString fn);
/** pop up a dialog to show an existing appointment. */
void appointment_show();
/**
* pop up an Appointment Dialog to edit an existing appointment. Get
* information on the appointment from the list of unique IDs that is
* currently in the View, called currIds.
*/
void appointment_edit();
/**
* pop up dialog confirming deletion of currently selected event in the
* View.
*/
void appointment_delete();
/** mails the currently selected event to a particular user as a vCalendar
attachment. */
void action_mail();
/* frees a subtodo from it's relation */
void todo_unsub( Todo * );
+ void todo_resub( Todo * parent, Todo * sub );
/** Take ownership of selected event. */
void takeOverEvent();
/** Take ownership of all events in calendar. */
void takeOverCalendar();
/** query whether or not the calendar is "dirty". */
bool isModified();
/** set the state of calendar. Modified means "dirty", i.e. needing a save. */
void setModified(bool modified=true);
/** query if the calendar is read-only. */
bool isReadOnly();
/** set state of calendar to read-only */
void setReadOnly(bool readOnly=true);
void eventUpdated(Incidence *);
/* iTIP scheduling actions */
void schedule_publish(Incidence *incidence = 0);
void schedule_request(Incidence *incidence = 0);
void schedule_refresh(Incidence *incidence = 0);
void schedule_cancel(Incidence *incidence = 0);
void schedule_add(Incidence *incidence = 0);
void schedule_reply(Incidence *incidence = 0);
void schedule_counter(Incidence *incidence = 0);
void schedule_declinecounter(Incidence *incidence = 0);
void schedule_publish_freebusy(int daysToPublish = 30);
void openAddressbook();
void editFilters();
void toggleFilerEnabled();
QPtrList<CalFilter> filters();
void toggleFilter();
void showFilter(bool visible);
void updateFilter();
void filterEdited();
void selectFilter( int );
KOFilterView *filterView();
void showIntro();
/** Move the curdatepient view date to today */
void goToday();
/** Move to the next date(s) in the current view */
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index ca5eadd..a8143a0 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -166,159 +166,162 @@ void KOTodoListView::contentsDropEvent(QDropEvent *e)
QString text;
if (QTextDrag::decode(e,text)) {
//QListViewItem *qlvi = itemAt( contentsToViewport(e->pos()) );
KOTodoViewItem *todoi = static_cast<KOTodoViewItem *>(itemAt( contentsToViewport(e->pos()) ));
kdDebug() << "Dropped : " << text << endl;
QStringList emails = QStringList::split(",",text);
for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) {
kdDebug() << " Email: " << (*it) << endl;
int pos = (*it).find("<");
QString name = (*it).left(pos);
QString email = (*it).mid(pos);
if (!email.isEmpty() && todoi) {
todoi->todo()->addAttendee(new Attendee(name,email));
}
}
}
else {
kdDebug() << "KOTodoListView::contentsDropEvent(): Todo from drop not decodable" << endl;
e->ignore();
}
}
#endif
}
void KOTodoListView::contentsMousePressEvent(QMouseEvent* e)
{
QListView::contentsMousePressEvent(e);
#ifndef KORG_NODND
QPoint p(contentsToViewport(e->pos()));
QListViewItem *i = itemAt(p);
if (i) {
// if the user clicked into the root decoration of the item, don't
// try to start a drag!
if (p.x() > header()->sectionPos(header()->mapToIndex(0)) +
treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) +
itemMargin() ||
p.x() < header()->sectionPos(header()->mapToIndex(0))) {
if (e->button()==Qt::LeftButton) {
mPressPos = e->pos();
mMousePressed = true;
}
}
}
#endif
}
void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e)
{
+
#ifndef KORG_NODND
// kdDebug() << "KOTodoListView::contentsMouseMoveEvent()" << endl;
QListView::contentsMouseMoveEvent(e);
if (mMousePressed && (mPressPos - e->pos()).manhattanLength() >
QApplication::startDragDistance()) {
mMousePressed = false;
QListViewItem *item = itemAt(contentsToViewport(mPressPos));
if (item) {
// kdDebug() << "Start Drag for item " << item->text(0) << endl;
DndFactory factory( mCalendar );
ICalDrag *vd = factory.createDragTodo(
((KOTodoViewItem *)item)->todo(),viewport());
if (vd->drag()) {
kdDebug() << "KOTodoListView::contentsMouseMoveEvent(): Delete drag source" << endl;
}
/*
QString source = fullPath(item);
if ( QFile::exists(source) ) {
QUriDrag* ud = new QUriDrag(viewport());
ud->setFilenames( source );
if ( ud->drag() )
QMessageBox::information( this, "Drag source",
QString("Delete ")+source, "Not implemented" );
*/
}
}
#endif
}
void KOTodoListView::keyPressEvent ( QKeyEvent * e )
{
QListViewItem* cn;
if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) {
cn = currentItem();
if ( cn ) {
KOTodoViewItem* ci = (KOTodoViewItem*)( cn );
if ( ci ){
if ( e->state() == ShiftButton )
ci->setOn( false );
else
ci->setOn( true );
cn = cn->nextSibling();
if ( cn ) {
setCurrentItem ( cn );
ensureItemVisible ( cn );
}
}
}
return;
}
// qDebug("KOTodoListView::keyPressEvent ");
if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) {
switch ( e->key() ) {
case Qt::Key_Down:
case Qt::Key_Up:
QListView::keyPressEvent ( e );
break;
case Qt::Key_Left:
case Qt::Key_Right:
QListView::keyPressEvent ( e );
+ e->accept();
+ return;
break;
default:
e->ignore();
break;
}
return;
}
e->ignore();
}
void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e)
{
QListView::contentsMouseReleaseEvent(e);
mMousePressed = false;
}
void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
{
if (!e) return;
QPoint vp = contentsToViewport(e->pos());
QListViewItem *item = itemAt(vp);
emit double_Clicked(item);
if (!item) return;
emit doubleClicked(item,vp,0);
}
/////////////////////////////////////////////////////////////////////////////
KOQuickTodo::KOQuickTodo(QWidget *parent) :
QLineEdit(parent)
{
setText(i18n("Click to add a new Todo"));
}
void KOQuickTodo::focusInEvent(QFocusEvent *ev)
{
if ( text()==i18n("Click to add a new Todo") )
setText("");
QLineEdit::focusInEvent(ev);
}
void KOQuickTodo::focusOutEvent(QFocusEvent *ev)
{
setText(i18n("Click to add a new Todo"));
QLineEdit::focusOutEvent(ev);
@@ -369,124 +372,131 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
mTodoListView->setColumnWidthMode(1, QListView::Manual);
mTodoListView->setColumnWidthMode(2, QListView::Manual);
mTodoListView->setColumnWidthMode(3, QListView::Manual);
mTodoListView->setColumnWidthMode(4, QListView::Manual);
mTodoListView->setColumnWidthMode(5, QListView::Manual);
mTodoListView->setColumnAlignment( 2, AlignCenter );
#if 0
mTodoListView->setColumnWidthMode(6, QListView::Manual);
#endif
mPriorityPopupMenu = new QPopupMenu(this);
for (int i = 1; i <= 5; i++) {
QString label = QString ("%1").arg (i);
mPriority[mPriorityPopupMenu->insertItem (label)] = i;
}
connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int)));
mPercentageCompletedPopupMenu = new QPopupMenu(this);
for (int i = 0; i <= 100; i+=20) {
QString label = QString ("%1 %").arg (i);
mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i;
}
connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int)));
mItemPopupMenu = new QPopupMenu(this);
mItemPopupMenu->insertItem(i18n("Show..."), this,
SLOT (showTodo()));
mItemPopupMenu->insertItem(i18n("Edit..."), this,
SLOT (editTodo()));
mItemPopupMenu->insertItem( i18n("Delete"), this,
SLOT (deleteTodo()));
mItemPopupMenu->insertItem( i18n("Clone..."), this,
SLOT (cloneTodo()));
mItemPopupMenu->insertItem( i18n("Move..."), this,
SLOT (moveTodo()));
mItemPopupMenu->insertItem( i18n("Beam..."), this,
SLOT (beamTodo()));
mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this,
SLOT (cancelTodo()));
mItemPopupMenu->insertSeparator();
mItemPopupMenu->insertItem( i18n("New Todo..."), this,
SLOT (newTodo()));
mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this,
SLOT (newSubTodo()));
mItemPopupMenu->insertItem(i18n("Unparent Todo"), this,
- SLOT (unparentTodo()));
+ SLOT (unparentTodo()),0,21);
+ mItemPopupMenu->insertItem(i18n("Reparent Todo"), this,
+ SLOT (reparentTodo()),0,22);
mItemPopupMenu->insertSeparator();
mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed"),
this, SLOT( purgeCompleted() ) );
mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"),
this, SLOT( toggleCompleted() ),0, 33 );
mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
this, SLOT( toggleQuickTodo() ),0, 34 );
mPopupMenu = new QPopupMenu(this);
mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this,
SLOT (newTodo()),0,1);
mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed"),
this, SLOT(purgeCompleted()),0,2);
mPopupMenu->insertItem(i18n("Show Completed"),
this, SLOT( toggleCompleted() ),0,3 );
mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
this, SLOT( toggleQuickTodo() ),0,4 );
mDocPrefs = new DocPrefs( name );
mPopupMenu->setCheckable( true );
mItemPopupMenu->setCheckable( true );
// Double clicking conflicts with opening/closing the subtree
connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ),
SLOT( editItem( QListViewItem *) ) );
+ /*
connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *,
const QPoint &,int ) ),
SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
+ */
+ connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *,
+ const QPoint &,int ) ),
+ SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ),
SLOT( itemClicked( QListViewItem * ) ) );
connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ),
SLOT( itemDoubleClicked( QListViewItem * ) ) );
connect( mTodoListView, SIGNAL( todoDropped( Todo * ) ),
SLOT( updateView() ) );
connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ),
SLOT( itemStateChanged( QListViewItem * ) ) );
connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ),
SLOT( itemStateChanged( QListViewItem * ) ) );
#if 0
connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)),
SLOT(selectionChanged(QListViewItem *)));
connect(mTodoListView,SIGNAL(clicked(QListViewItem *)),
SLOT(selectionChanged(QListViewItem *)));
connect(mTodoListView,SIGNAL(pressed(QListViewItem *)),
SLOT(selectionChanged(QListViewItem *)));
#endif
connect( mTodoListView, SIGNAL(selectionChanged() ),
SLOT( processSelectionChange() ) );
connect( mQuickAdd, SIGNAL( returnPressed () ),
SLOT( addQuickTodo() ) );
// if ( QApplication::desktop()->width() < 480 ) {
// setNarrow();
// mTodoListView->setColumnWidth( 0, 100 );
// }
}
KOTodoView::~KOTodoView()
{
delete mDocPrefs;
}
void KOTodoView::jumpToDate ()
{
// if (mActiveItem) {
// mActiveItem->todo());
// if ( mActiveItem->todo()->hasDueDate() )
// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() );
}
void KOTodoView::setNarrow()
{
//mTodoListView->setColumnWidth( 0, 120 );
mTodoListView->setColumnWidth( 1, 35 );
@@ -650,131 +660,139 @@ QPtrList<Incidence> KOTodoView::selectedIncidences()
}
QPtrList<Todo> KOTodoView::selectedTodos()
{
QPtrList<Todo> selected;
KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem());
// if (!item) item = mActiveItem;
if (item) selected.append(item->todo());
return selected;
}
void KOTodoView::changeEventDisplay(Event *, int)
{
updateView();
}
void KOTodoView::showDates(const QDate &, const QDate &)
{
}
void KOTodoView::showEvents(QPtrList<Event>)
{
kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl;
}
void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd,
const QDate &td)
{
#ifndef KORG_NOPRINTER
calPrinter->preview(CalPrinter::Todolist, fd, td);
#endif
}
void KOTodoView::editItem(QListViewItem *item )
{
// qDebug("editItem(QListViewItem *item ) ");
emit editTodoSignal(((KOTodoViewItem *)item)->todo());
}
void KOTodoView::showItem(QListViewItem *item,const QPoint &,int)
{
emit showTodoSignal(((KOTodoViewItem *)item)->todo());
}
void KOTodoView::popupMenu(QListViewItem *item,const QPoint &,int column)
{
-
mActiveItem = (KOTodoViewItem *)item;
if (item) {
switch (column){
case 1:
mPriorityPopupMenu->popup(QCursor::pos ()); break;
case 2:
mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break;
case 3:
moveTodo();
break;
case 6:
getCategoryPopupMenu((KOTodoViewItem *)item)->popup(QCursor::pos ()); break;
default:
mItemPopupMenu->popup(QCursor::pos());
}
} else mPopupMenu->popup(QCursor::pos());
}
void KOTodoView::newTodo()
{
emit newTodoSignal();
}
void KOTodoView::newSubTodo()
{
if (mActiveItem) {
emit newSubTodoSignal(mActiveItem->todo());
}
}
void KOTodoView::unparentTodo()
{
if (mActiveItem) {
emit unparentTodoSignal(mActiveItem->todo());
}
}
+
+void KOTodoView::reparentTodo()
+{
+ if (mActiveItem) {
+ qDebug("KOTodoView::reparentTodo() ");
+ topLevelWidget()->setCaption(i18n("Click on new parent item"));
+ pendingSubtodo = mActiveItem;
+ }
+}
void KOTodoView::editTodo()
{
if (mActiveItem) {
emit editTodoSignal(mActiveItem->todo());
}
}
void KOTodoView::cloneTodo()
{
if (mActiveItem) {
emit cloneTodoSignal((Incidence*)mActiveItem->todo());
}
}
void KOTodoView::cancelTodo()
{
if (mActiveItem) {
emit cancelTodoSignal((Incidence*)mActiveItem->todo());
}
}
void KOTodoView::moveTodo()
{
if (mActiveItem) {
emit moveTodoSignal((Incidence*)mActiveItem->todo());
}
}
void KOTodoView::beamTodo()
{
if (mActiveItem) {
emit beamTodoSignal((Incidence*)mActiveItem->todo());
}
}
void KOTodoView::showTodo()
{
if (mActiveItem) {
emit showTodoSignal(mActiveItem->todo());
}
}
void KOTodoView::deleteTodo()
{
if (mActiveItem) {
if (mActiveItem->childCount()) {
KMessageBox::sorry(this,i18n("Cannot delete To-Do which has children."),
i18n("Delete To-Do"));
} else {
emit deleteTodoSignal(mActiveItem->todo());
}
@@ -798,112 +816,142 @@ void KOTodoView::setNewPercentage(int index)
mActiveItem->todo()->setCompleted(QDateTime::currentDateTime());
} else {
mActiveItem->todo()->setCompleted(false);
}
mActiveItem->todo()->setPercentComplete(mPercentage[index]);
mActiveItem->construct();
todoModified (mActiveItem->todo (), KOGlobals::COMPLETION_MODIFIED);
mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 );
}
}
QPopupMenu * KOTodoView::getCategoryPopupMenu (KOTodoViewItem *todoItem)
{
QPopupMenu* tempMenu = new QPopupMenu (this);
QStringList checkedCategories = todoItem->todo()->categories ();
tempMenu->setCheckable (true);
for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin ();
it != KOPrefs::instance()->mCustomCategories.end ();
++it) {
int index = tempMenu->insertItem (*it);
mCategory[index] = *it;
if (checkedCategories.find (*it) != checkedCategories.end ()) tempMenu->setItemChecked (index, true);
}
connect (tempMenu, SIGNAL (activated (int)), SLOT (changedCategories (int)));
return tempMenu;
}
void KOTodoView::changedCategories(int index)
{
if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) {
QStringList categories = mActiveItem->todo()->categories ();
if (categories.find (mCategory[index]) != categories.end ())
categories.remove (mCategory[index]);
else
categories.insert (categories.end(), mCategory[index]);
categories.sort ();
mActiveItem->todo()->setCategories (categories);
mActiveItem->construct();
mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 );
todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED);
}
}
void KOTodoView::itemDoubleClicked(QListViewItem *item)
{
+ if ( pendingSubtodo != 0 ) {
+ topLevelWidget()->setCaption(i18n("Reparenting aborted!"));
+ }
+ pendingSubtodo = 0;
if (!item) {
newTodo();
return;
}
if ( KOPrefs::instance()->mEditOnDoubleClick )
editItem( item );
else
showItem( item , QPoint(), 0 );
}
void KOTodoView::itemClicked(QListViewItem *item)
{
+
if (!item) {
+ if ( pendingSubtodo != 0 ) {
+ topLevelWidget()->setCaption(i18n("Reparenting aborted!"));
+ }
+ pendingSubtodo = 0;
return;
}
-
KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
+ if ( pendingSubtodo != 0 ) {
+ bool allowReparent = true;
+ QListViewItem *par = item;
+ while ( par ) {
+ if ( par == pendingSubtodo ) {
+ allowReparent = false;
+ break;
+ }
+ par = par->parent();
+ }
+ if ( !allowReparent ) {
+ topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!"));
+ qDebug("Recursive reparenting not possible ");
+ pendingSubtodo = 0;
+ } else {
+ Todo* newParent = todoItem->todo();
+ Todo* newSub = pendingSubtodo->todo();
+ pendingSubtodo = 0;
+ emit reparentTodoSignal( newParent,newSub );
+ return;
+ }
+ }
int completed = todoItem->todo()->isCompleted(); // Completed or not?
if (todoItem->isOn()) {
if (!completed) {
todoItem->todo()->setCompleted(QDateTime::currentDateTime());
}
} else {
if (completed) {
todoItem->todo()->setCompleted(false);
}
}
}
void KOTodoView::setDocumentId( const QString &id )
{
kdDebug() << "KOTodoView::setDocumentId()" << endl;
mDocPrefs->setDoc( id );
}
void KOTodoView::itemStateChanged( QListViewItem *item )
{
if (!item) return;
KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
// kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl;
if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() );
}
void KOTodoView::saveLayout(KConfig *config, const QString &group) const
{
mTodoListView->saveLayout(config,group);
}
void KOTodoView::restoreLayout(KConfig *config, const QString &group)
{
mTodoListView->restoreLayout(config,group);
}
void KOTodoView::processSelectionChange()
{
// kdDebug() << "KOTodoView::processSelectionChange()" << endl;
KOTodoViewItem *item =
static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() );
@@ -929,106 +977,138 @@ void KOTodoView::clearSelection()
void KOTodoView::purgeCompleted()
{
emit purgeCompletedSignal();
}
void KOTodoView::toggleQuickTodo()
{
if ( mQuickAdd->isVisible() ) {
mQuickAdd->hide();
KOPrefs::instance()->mEnableQuickTodo = false;
}
else {
mQuickAdd->show();
KOPrefs::instance()->mEnableQuickTodo = true;
}
mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo);
mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo );
}
void KOTodoView::toggleCompleted()
{
KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo;
mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo );
mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo );
updateView();
}
void KOTodoView::addQuickTodo()
{
Todo *todo = new Todo();
todo->setSummary(mQuickAdd->text());
todo->setOrganizer(KOPrefs::instance()->email());
CalFilter * cf = mCalendar->filter();
if ( cf ) {
if ( cf->isEnabled()&& cf->showCategories()) {
todo->setCategories(cf->categoryList());
}
if ( cf->isEnabled() )
todo->setSecrecy( cf->getSecrecy());
}
mCalendar->addTodo(todo);
mQuickAdd->setText("");
todoModified (todo, KOGlobals::EVENTADDED );
updateView();
}
void KOTodoView::keyPressEvent ( QKeyEvent * e )
{
// e->ignore();
//return;
+ //qDebug("KOTodoView::keyPressEvent ");
switch ( e->key() ) {
case Qt::Key_Down:
case Qt::Key_Up:
QWidget::keyPressEvent ( e );
break;
case Qt::Key_Q:
toggleQuickTodo();
break;
-
+ case Qt::Key_U:
+ if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) {
+ mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
+ unparentTodo();
+ e->accept();
+ } else
+ e->ignore();
+ break;
+ case Qt::Key_S:
+ if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) {
+ mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
+ reparentTodo();
+ e->accept();
+ } else
+ e->ignore();
+ break;
+ case Qt::Key_P:
+ if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) {
+ mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
+ if ( pendingSubtodo )
+ itemClicked(mActiveItem);
+ e->accept();
+ } else
+ e->ignore();
+ break;
+ case Qt::Key_Escape:
+ if ( pendingSubtodo ) {
+ itemClicked(0);
+ e->accept();
+ } else
+ e->ignore();
+ break;
default:
e->ignore();
}
if ( true ) {
if ( e->key() == Qt::Key_I ) {
KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem();
if ( cn ) {
mActiveItem = cn;
KOTodoViewItem* ci = (KOTodoViewItem*)( cn );
if ( ci ){
showTodo();
cn = (KOTodoViewItem*)cn->itemBelow();
if ( cn ) {
mTodoListView->setCurrentItem ( cn );
mTodoListView->ensureItemVisible ( cn );
}
}
}
e->accept();
}
}
}
void KOTodoView::updateTodo( Todo * t, int type )
{
if ( mBlockUpdate)
return;
QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator;
itemIterator = mTodoMap.find(t);
if (itemIterator != mTodoMap.end()) {
(*itemIterator)->construct();
} else {
if ( type == KOGlobals::EVENTADDED ) {
insertTodoItem( t );
}
}
}
void KOTodoView::todoModified(Todo * t , int p )
{
mBlockUpdate = true;
emit todoModifiedSignal ( t, p );
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h
index 6bf0203..0c08677 100644
--- a/korganizer/kotodoview.h
+++ b/korganizer/kotodoview.h
@@ -102,130 +102,133 @@ class KOQuickTodo : public QLineEdit
@short multi-column list view of todo events.
@author Cornelius Schumacher <schumacher@kde.org>
*/
class KOTodoView : public KOrg::BaseView
{
Q_OBJECT
public:
KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 );
~KOTodoView();
QPtrList<Incidence> selectedIncidences();
QPtrList<Todo> selectedTodos();
DateList selectedDates()
{DateList q;
return q;}
/** Return number of shown dates. TodoView does not show dates, */
int currentDateCount() { return 0; }
void setNarrow();
void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td);
void setDocumentId( const QString & );
void saveLayout(KConfig *config, const QString &group) const;
void restoreLayout(KConfig *config, const QString &group);
/** Create a popup menu to set categories */
QPopupMenu *getCategoryPopupMenu (KOTodoViewItem *todoItem);
public slots:
void updateView();
void updateConfig();
void changeEventDisplay(Event *, int);
void showDates(const QDate &start, const QDate &end);
void showEvents(QPtrList<Event> eventList);
void clearSelection();
void jumpToDate ();
void editItem(QListViewItem *item);
void showItem(QListViewItem *item,const QPoint &,int);
void popupMenu(QListViewItem *item,const QPoint &,int);
void newTodo();
void newSubTodo();
void unparentTodo();
+ void reparentTodo();
void showTodo();
void editTodo();
void cloneTodo();
void cancelTodo();
void moveTodo();
void beamTodo();
void deleteTodo();
void setNewPriority(int);
void setNewPercentage(int);
void changedCategories(int);
void purgeCompleted();
void toggleCompleted();
void toggleQuickTodo();
void updateTodo( Todo *, int );
void itemClicked(QListViewItem *);
void itemStateChanged(QListViewItem *);
void modified(bool);
void itemDoubleClicked(QListViewItem *item);
signals:
void newTodoSignal();
void newSubTodoSignal(Todo *);
void unparentTodoSignal(Todo *);
+ void reparentTodoSignal( Todo *,Todo * );
void showTodoSignal(Todo *);
void editTodoSignal(Todo *);
void deleteTodoSignal(Todo *);
void todoModifiedSignal (Todo *, int);
void isModified(bool);
void cloneTodoSignal( Incidence * );
void cancelTodoSignal( Incidence * );
void moveTodoSignal( Incidence * );
void beamTodoSignal( Incidence * );
void purgeCompletedSignal();
protected slots:
void processSelectionChange();
void addQuickTodo();
private:
/*
* the TodoEditor approach is rather unscaling in the long
* run.
* Korganizer keeps it in memory and we need to update
* 1. make KOTodoViewItem a QObject again?
* 2. add a public method for setting one todo modified?
* 3. add a private method for setting a todo modified + friend here?
* -- zecke 2002-07-08
*/
friend class KOTodoViewItem;
void setTodoModified( Todo* );
QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo);
void restoreItemState( QListViewItem * );
KOTodoListView *mTodoListView;
QPopupMenu *mItemPopupMenu;
QPopupMenu *mPopupMenu;
QPopupMenu *mPriorityPopupMenu;
QPopupMenu *mPercentageCompletedPopupMenu;
QPopupMenu *mCategoryPopupMenu;
QMap<int, int> mPercentage;
QMap<int, int> mPriority;
QMap<int, QString> mCategory;
KOTodoViewItem *mActiveItem;
QMap<Todo *,KOTodoViewItem *> mTodoMap;
QString mName;
DocPrefs *mDocPrefs;
QString mCurrentDoc;
KOQuickTodo *mQuickAdd;
bool mBlockUpdate;
void todoModified(Todo *, int );
void keyPressEvent ( QKeyEvent * ) ;
+ KOTodoViewItem * pendingSubtodo;
};
#endif
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 8e6cc53..391f98c 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -453,96 +453,98 @@ void KOViewManager::showMonthView()
// if(mMonthView == mCurrentView) return;
mMainView->dateNavigator()->selectMonth();
// DateList tmpList = mMainView->dateNavigator()->selectedDates( );
//mMonthView->showDates(tmpList.first(), tmpList.last());
showView(mMonthView, true );
}
void KOViewManager::showTodoView()
{
//mFlagShowNextxDays = false;
if ( !mTodoView ) {
mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(),
"KOViewManager::TodoView" );
addView( mTodoView );
// QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold );
// SIGNALS/SLOTS FOR TODO VIEW
connect( mTodoView, SIGNAL( newTodoSignal() ),
mMainView, SLOT( newTodo() ) );
connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ),
mMainView, SLOT( newSubTodo( Todo *) ) );
connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ),
mMainView, SLOT( showTodo( Todo * ) ) );
connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ),
mMainView, SLOT( editTodo( Todo * ) ) );
connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ),
mMainView, SLOT( deleteTodo( Todo * ) ) );
connect( mTodoView, SIGNAL( purgeCompletedSignal() ),
mMainView, SLOT( purgeCompleted() ) );
connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ),
mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
connect( mMainView, SIGNAL( configChanged() ), mTodoView,
SLOT( updateConfig() ) );
connect( mMainView, SIGNAL( todoModified( Todo *, int )), mTodoView,
SLOT( updateTodo( Todo *, int ) ) );
connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ),
mMainView, SIGNAL ( todoModified( Todo *, int ) ) );
connect( mTodoView, SIGNAL( cloneTodoSignal( Incidence * ) ),
mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
connect( mTodoView, SIGNAL( cancelTodoSignal( Incidence * ) ),
mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
connect( mTodoView, SIGNAL( unparentTodoSignal( Todo * ) ),
mMainView, SLOT ( todo_unsub( Todo * ) ) );
+ connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ),
+ mMainView, SLOT ( todo_resub( Todo *, Todo *) ) );
connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ),
mMainView, SLOT ( moveIncidence( Incidence * ) ) );
connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ),
mMainView, SLOT ( beamIncidence( Incidence * ) ) );
KConfig *config = KOGlobals::config();
mTodoView->restoreLayout(config,"Todo View");
}
globalFlagBlockAgenda = 1;
showView( mTodoView, true );
}
void KOViewManager::showJournalView()
{
//mFlagShowNextxDays = false;
if (!mJournalView) {
mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(),
"KOViewManager::JournalView");
connect( mMainView, SIGNAL( configChanged() ), mJournalView,
SLOT( updateConfig() ) );
connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) );
addView(mJournalView);
}
showView(mJournalView);
}
void KOViewManager::showTimeSpanView()
{
//mFlagShowNextxDays = false;
if (!mTimeSpanView) {
mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(),
"KOViewManager::TimeSpanView");
addView(mTimeSpanView);
mTimeSpanView->readSettings();
}
showView(mTimeSpanView);
}
Incidence *KOViewManager::currentSelection()
{
if (!mCurrentView) return 0;
if ( mCurrentView == mListView ) {
if ( mListView->currentItem() )
return mListView->currentItem();
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 8daacc7..06470b8 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1102,96 +1102,99 @@ void MainWindow::whatsNew()
}
void MainWindow::licence()
{
KApplication::showLicence();
}
void MainWindow::about()
{
QString version;
#include <../version>
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 / 8x0\n") +
#endif
i18n("(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi is based on KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi is licensed\nunder the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.korganizer.org\nwww.pi-sync.net\n") );
}
void MainWindow::keyBindings()
{
QString cap = i18n("Key bindings KOrganizer/Pi");
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>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>F</b>: Toggle filterview |<b>F+ctrl</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>N</b>: Next days view| <b>W</b>: What's next view\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>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</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")+
i18n("<p><h3>In list view:</h3></p>\n") +
i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
i18n("<p><b>return</b>: Select item+one step down</p>\n")+
i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+
i18n("<p><b>up/down</b>: Next/prev item</p>\n")+
i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+
i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+
i18n("<p><h3>In event/todo viewer:</h3></p>\n") +
i18n("<p><b>I,C</b>: Close dialog.</p>\n")+
i18n("<p><b>A</b>: Show agenda view.</p>\n")+
i18n("<p><b>E</b>: Edit item</p>\n") +
i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") +
i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") +
i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+
i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+
i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+
i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+
i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+
i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") +
i18n("<p><b>White</b>: Item readonly</p>\n");
displayText( text, cap);
}
void MainWindow::aboutAutoSaving()
{
QMessageBox* msg;
msg = new QMessageBox( i18n("Auto Saving in KOrganizer/Pi"),
i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configureable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"), QMessageBox::NoIcon,
QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton);
msg->exec();
delete msg;
}
void MainWindow::aboutKnownBugs()
{
QMessageBox* msg;
msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"),
i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+
i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+
i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.net\n") +
i18n("\nor report them in the bugtracker on\n") +
diff --git a/microkde/kdeui/klistview.cpp b/microkde/kdeui/klistview.cpp
index 2856f2d..6477d11 100644
--- a/microkde/kdeui/klistview.cpp
+++ b/microkde/kdeui/klistview.cpp
@@ -1842,99 +1842,100 @@ KListView::SelectionModeExt KListView::selectionModeExt () const
int KListView::itemIndex( const QListViewItem *item ) const
{
if ( !item )
return -1;
if ( item == firstChild() )
return 0;
else {
QListViewItemIterator it(firstChild());
uint j = 0;
for (; it.current() && it.current() != item; ++it, ++j );
if( !it.current() )
return -1;
return j;
}
}
QListViewItem* KListView::itemAtIndex(int index)
{
if (index<0)
return 0;
int j(0);
for (QListViewItemIterator it=firstChild(); it.current(); it++)
{
if (j==index)
return it.current();
j++;
};
return 0;
}
void KListView::emitContextMenu (KListView*, QListViewItem* i)
{
QPoint p;
qDebug("KListView::emitContextMenu ");
if (i)
p = viewport()->mapToGlobal(itemRect(i).center());
else
p = mapToGlobal(rect().center());
emit contextMenu (this, i, p);
}
-void KListView::emitContextMenu (QListViewItem* i, const QPoint& p, int)
+void KListView::emitContextMenu (QListViewItem* i, const QPoint& p, int col)
{
- qDebug("KListView::emitContextMenu ");
+ qDebug("KListView::emitContextMenu col");
+ emit contextRequest( i, p, col );
emit contextMenu (this, i, p);
}
void KListView::setAcceptDrops (bool val)
{
QListView::setAcceptDrops (val);
viewport()->setAcceptDrops (val);
}
int KListView::dropVisualizerWidth () const
{
return d->mDropVisualizerWidth;
}
void KListView::viewportPaintEvent(QPaintEvent *e)
{
QListView::viewportPaintEvent(e);
if (d->mOldDropVisualizer.isValid() && e->rect().intersects(d->mOldDropVisualizer))
{
QPainter painter(viewport());
// This is where we actually draw the drop-visualizer
painter.fillRect(d->mOldDropVisualizer, Dense4Pattern);
}
if (d->mOldDropHighlighter.isValid() && e->rect().intersects(d->mOldDropHighlighter))
{
QPainter painter(viewport());
qDebug("KListView::viewportPaintEvent has to be verified");
// This is where we actually draw the drop-highlighter
//US style().drawPrimitive(QStyle::PE_FocusRect, &painter, d->mOldDropHighlighter, colorGroup(),
//US QStyle::Style_FocusAtBorder);
//LR style().drawFocusRect(&painter, d->mOldDropHighlighter, colorGroup(), (const QColor*)0, true);
}
}
void KListView::setFullWidth()
{
setFullWidth(true);
}
void KListView::setFullWidth(bool fullWidth)
diff --git a/microkde/kdeui/klistview.h b/microkde/kdeui/klistview.h
index f7d9f85..8d933f6 100644
--- a/microkde/kdeui/klistview.h
+++ b/microkde/kdeui/klistview.h
@@ -368,96 +368,97 @@ public:
int columnSorted(void) const;
/**
* @return whether the current sort is ascending (or descending)
*/
bool ascendingSort(void) const;
signals:
/**
* This signal is emitted whenever the user executes an listview item.
* That means depending on the KDE wide Single Click/Double Click
* setting the user clicked or double clicked on that item.
* @param item is the pointer to the executed listview item.
*
* Note that you may not delete any @ref QListViewItem objects in slots
* connected to this signal.
*/
void executed( QListViewItem *item );
/**
* This signal is emitted whenever the user executes an listview item.
* That means depending on the KDE wide Single Click/Double Click
* setting the user clicked or double clicked on that item.
* @param item is the pointer to the executed listview item.
* @param pos is the position where the user has clicked
* @param c is the column into which the user clicked.
*
* Note that you may not delete any @ref QListViewItem objects in slots
* connected to this signal.
*/
void executed( QListViewItem *item, const QPoint &pos, int c );
/**
* This signal gets emitted whenever the user double clicks into the
* listview.
* @param item is the pointer to the clicked listview item.
* @param pos is the position where the user has clicked, and
* @param c is the column into which the user clicked.
*
* Note that you may not delete any @ref QListViewItem objects in slots
* connected to this signal.
*
* This signal is more or less here for the sake of completeness.
* You should normally not need to use this. In most cases its better
* to use @ref #executed() instead.
*/
void doubleClicked( QListViewItem *item, const QPoint &pos, int c );
+ void contextRequest( QListViewItem *item, const QPoint &pos, int c );
/**
* This signal gets emitted whenever something acceptable is
* dropped onto the listview.
*
* @param e is the drop event itself (it has already been accepted)
* @param after is the item after which the drop occured (or 0L, if
* the drop was above all items)
*
* @see #acceptDrop()
*/
void dropped (QDropEvent * e, QListViewItem *after);
/**
* This signal gets emitted whenever something acceptable is
* dropped onto the listview.
*
* This is an overloaded version of the above (provided to simplify
* processing drops outside of the class).
*
* @param list is the listview
* @param e is the drop event itself (it has already been accepted)
* @param after is the item after which the drop occured (or 0L, if
* the drop was above all items
*/
void dropped (KListView* list, QDropEvent* e, QListViewItem* after);
/**
* This signal gets emitted whenever something acceptable is
* dropped onto the listview.
*
* This function also provides a parent, in the event that your listview
* is a tree
* @param list is the listview
* @param e is the drop event itself (it has already been accepted)
* @param parent the item that is to be the parent of the new item
* @param after is the item after which the drop occured (or 0L, if
* the drop was above all items
*/
void dropped (KListView* list, QDropEvent* e, QListViewItem* parent, QListViewItem* after);
/**
* This signal gets emitted whenever something acceptable is
* dropped onto the listview.
*
* This function also provides a parent, in the event that your listview
* is a tree
* @param e is the drop event itself (it has already been accepted)