summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt9
-rw-r--r--korganizer/kotodoeditor.cpp1
-rw-r--r--korganizer/kotodoview.cpp108
-rw-r--r--korganizer/kotodoview.h3
4 files changed, 94 insertions, 27 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index a5e2597..cb92677 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1483,23 +1483,24 @@
{ "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" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
-{ "","" },
-{ "","" },
-{ "","" },
-{ "","" },
+
+
+
diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp
index 555c1b1..100a81b 100644
--- a/korganizer/kotodoeditor.cpp
+++ b/korganizer/kotodoeditor.cpp
@@ -289,24 +289,25 @@ void KOTodoEditor::deleteTodo()
reject();
}
}
void KOTodoEditor::setDefaults(QDateTime due,Todo *relatedEvent,bool allDay)
{
mRelatedTodo = relatedEvent;
mGeneral->setDefaults(due,allDay);
mDetails->setDefaults();
showPage( 0 );
if ( mRelatedTodo ) {
+ mGeneral->fillCalCombo(mRelatedTodo->calID() );
mGeneral->setCategories (mRelatedTodo->categoriesStr ());
mGeneral->setSecrecy (mRelatedTodo->secrecy ());
if ( mRelatedTodo->priority() < 3 )
mGeneral->mPriorityCombo->setCurrentItem(mRelatedTodo->priority()-1);
mGeneral->mSummaryEdit->lineEdit()->setText(mRelatedTodo->summary()+": ");
int len = mRelatedTodo->summary().length();
mGeneral->mSummaryEdit->lineEdit()->setFocus();
mGeneral->mSummaryEdit->lineEdit()->setCursorPosition ( len+2 );
mGeneral->mSummaryEdit->lineEdit()->setSelection ( 0, len+2 );
} else
mGeneral->setFocusOn( 2 );
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index a87e6fc..c23a8ee 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -495,28 +495,62 @@ void KOQuickTodo::focusOutEvent(QFocusEvent *ev)
/////////////////////////////////////////////////////////////////////////////
KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
KOrg::BaseView(calendar,parent,name)
{
mCategoryPopupMenu = 0;
mPendingUpdateBeforeRepaint = false;
isFlatDisplay = false;
mNavigator = 0;
QBoxLayout *topLayout = new QVBoxLayout(this);
mName = QString ( name );
mBlockUpdate = false;
- mQuickAdd = new KOQuickTodo(this);
- topLayout->addWidget(mQuickAdd);
-
- if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickAdd->hide();
+ mQuickBar = new QWidget( this );
+ topLayout->addWidget(mQuickBar);
+
+ mQuickAdd = new KOQuickTodo(mQuickBar);
+ QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar);
+ quickLayout->addWidget( mQuickAdd );
+ QPushButton * flat = new QPushButton( "F",mQuickBar );
+ int fixwid = flat->sizeHint().height();
+ if ( QApplication::desktop()->width() > 320 )
+ fixwid *= 2;
+ flat->setFixedWidth( fixwid );
+ connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat()));
+ QPushButton * allopen = new QPushButton( "O",mQuickBar );
+ allopen->setFixedWidth( fixwid );
+ connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen()));
+ QPushButton * allclose = new QPushButton( "C",mQuickBar );
+ allclose->setFixedWidth( fixwid );
+ connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose()));
+ QPushButton * s_done = new QPushButton( "D",mQuickBar );
+ s_done->setFixedWidth( fixwid );
+ connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted()));
+ QPushButton * s_run = new QPushButton( "R",mQuickBar );
+ s_run->setFixedWidth( fixwid );
+ connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning()));
+
+ mNewSubBut = new QPushButton( "sub",mQuickBar );
+ mNewSubBut->setFixedWidth( fixwid*3/2 );
+ connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo()));
+ mNewSubBut->setEnabled( false );
+ quickLayout->addWidget( mNewSubBut );
+ quickLayout->addWidget( s_done );
+ quickLayout->addWidget( s_run );
+
+ quickLayout->addWidget( allopen );
+ quickLayout->addWidget( allclose );
+ quickLayout->addWidget( flat );
+
+ if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide();
mTodoListView = new KOTodoListView(calendar,this, name );
topLayout->addWidget(mTodoListView);
//mTodoListView->header()->setMaximumHeight(30);
mTodoListView->setRootIsDecorated(true);
mTodoListView->setAllColumnsShowFocus(true);
mTodoListView->setShowSortIndicator(true);
mTodoListView->addColumn(i18n("Todo"));
mTodoListView->addColumn(i18n("Prio"));
mTodoListView->setColumnAlignment(1,AlignHCenter);
@@ -1073,26 +1107,30 @@ void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column)
default:
mItemPopupMenu->popup(QCursor::pos());
}
} else mPopupMenu->popup(QCursor::pos());
}
void KOTodoView::newTodo()
{
emit newTodoSignal();
}
void KOTodoView::newSubTodo()
{
+ mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
if (mActiveItem) {
- emit newSubTodoSignal(mActiveItem->todo());
+ if ( mQuickAdd->isVisible() && !mQuickAdd->text().isEmpty() && mQuickAdd->text() != i18n("Click to add a new Todo") ) {
+ addQuickTodoPar( mActiveItem->todo());
+ } else
+ emit newSubTodoSignal(mActiveItem->todo());
}
}
void KOTodoView::unparentTodo()
{
if (mActiveItem) {
emit unparentTodoSignal(mActiveItem->todo());
}
}
void KOTodoView::reparentTodo()
{
if (mActiveItem) {
@@ -1382,26 +1420,28 @@ 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() );
if ( !item ) {
emit incidenceSelected( 0 );
+ mNewSubBut->setEnabled( false );
} else {
emit incidenceSelected( item->todo() );
+ mNewSubBut->setEnabled( true );
}
}
void KOTodoView::modified(bool b)
{
emit isModified(b);
}
void KOTodoView::setTodoModified( Todo* todo )
{
todoModified( todo, KOGlobals::UNKNOWN_MODIFIED );
}
void KOTodoView::clearSelection()
@@ -1471,71 +1511,93 @@ void KOTodoView::setAllFlat()
return;
}
displayAllFlat();
}
void KOTodoView::purgeCompleted()
{
emit purgeCompletedSignal();
}
void KOTodoView::toggleQuickTodo()
{
- if ( mQuickAdd->isVisible() ) {
- mQuickAdd->hide();
+ if ( mQuickBar->isVisible() ) {
+ mQuickBar->hide();
KOPrefs::instance()->mEnableQuickTodo = false;
}
else {
- mQuickAdd->show();
+ mQuickBar->show();
KOPrefs::instance()->mEnableQuickTodo = true;
}
mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo);
mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo );
}
void KOTodoView::toggleRunning()
{
KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos;
mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos);
mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos );
updateView();
+ if ( KOPrefs::instance()->mHideNonStartedTodos )
+ topLevelWidget()->setCaption(i18n("Hide not Running"));
+ else
+ topLevelWidget()->setCaption(i18n("Show not Running"));
}
void KOTodoView::toggleCompleted()
{
KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo;
mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo );
mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo );
updateView();
+ if ( KOPrefs::instance()->mShowCompletedTodo )
+ topLevelWidget()->setCaption(i18n("Show Completed"));
+ else
+ topLevelWidget()->setCaption(i18n("Hide Completed"));
}
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();
+ addQuickTodoPar( 0 );
}
+void KOTodoView::addQuickTodoPar( Todo * parentTodo)
+{
+ Todo *todo = new Todo();
+ todo->setSummary(mQuickAdd->text());
+ todo->setOrganizer(KOPrefs::instance()->email());
+ if ( parentTodo ) {
+ todo->setRelatedTo(parentTodo);
+
+ todo->setCategories (parentTodo->categoriesStr ());
+ todo->setSecrecy (parentTodo->secrecy ());
+ if ( parentTodo->priority() < 3 )
+ todo->setPriority( parentTodo->priority() );
+ todo->setCalID( parentTodo->calID() );
+ } else {
+ 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:
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h
index 79cc756..a8e90e2 100644
--- a/korganizer/kotodoview.h
+++ b/korganizer/kotodoview.h
@@ -245,24 +245,25 @@ class KOTodoView : public KOrg::BaseView
void beamTodoSignal( Incidence * );
void purgeCompletedSignal();
protected slots:
void toggleRunningItem();
void paintNeeded();
void processSelectionChange();
void addQuickTodo();
void setTodoModified( Todo* );
void todoModified(Todo *, int );
private:
+ void addQuickTodoPar( Todo * parentTodo);
/*
* 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
*/
KOTodoViewWhatsThis* mKOTodoViewWhatsThis;
friend class KOTodoListView;
void paintEvent(QPaintEvent * pevent);
@@ -280,26 +281,28 @@ class KOTodoView : public KOrg::BaseView
QPopupMenu *mPriorityPopupMenu;
QPopupMenu *mPercentageCompletedPopupMenu;
QPopupMenu *mCategoryPopupMenu;
QPopupMenu *mCalPopupMenu;
QMap<int, int> mPercentage;
QMap<int, int> mPriority;
QMap<int, QString> mCategory;
KOTodoViewItem *mActiveItem;
QMap<Todo *,KOTodoViewItem *> mTodoMap;
QString mName;
+ QWidget* mQuickBar;
DocPrefs *mDocPrefs;
QString mCurrentDoc;
KOQuickTodo *mQuickAdd;
bool mBlockUpdate;
void keyPressEvent ( QKeyEvent * ) ;
KOTodoViewItem * pendingSubtodo;
DateNavigator* mNavigator;
void storeCurrentItem();
void resetCurrentItem();
Incidence * mCurItem, *mCurItemRootParent, *mCurItemParent,*mCurItemAbove;
+ QPushButton * mNewSubBut;
};
#endif