summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/.cvsignore2
-rw-r--r--core/pim/todo/otaskeditor.cpp8
-rw-r--r--core/pim/todo/otaskeditor.h4
-rw-r--r--core/pim/todo/taskeditoradvanced.cpp132
-rw-r--r--core/pim/todo/taskeditoradvanced.h73
-rw-r--r--core/pim/todo/taskeditoradvanced.ui224
-rw-r--r--core/pim/todo/taskeditoradvancedimpl.cpp63
-rw-r--r--core/pim/todo/taskeditoradvancedimpl.h37
-rw-r--r--core/pim/todo/taskeditoroverview.cpp3
-rw-r--r--core/pim/todo/todo.pro5
10 files changed, 213 insertions, 338 deletions
diff --git a/core/pim/todo/.cvsignore b/core/pim/todo/.cvsignore
index c212d11..77e97da 100644
--- a/core/pim/todo/.cvsignore
+++ b/core/pim/todo/.cvsignore
@@ -1,6 +1,4 @@
Makefile*
moc_*
-taskeditoradvanced.cpp
-taskeditoradvanced.h
todoentry.cpp
todoentry.h
diff --git a/core/pim/todo/otaskeditor.cpp b/core/pim/todo/otaskeditor.cpp
index e6ebf60..bde25ef 100644
--- a/core/pim/todo/otaskeditor.cpp
+++ b/core/pim/todo/otaskeditor.cpp
@@ -1,93 +1,93 @@
#include <qdatetime.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qmultilineedit.h>
#include <opie/orecurrancewidget.h>
#include "taskeditoroverview.h"
-#include "taskeditoradvancedimpl.h"
+#include "taskeditoradvanced.h"
#include "taskeditoralarms.h"
#include "otaskeditor.h"
OTaskEditor::OTaskEditor(int cur)
: QDialog(0, 0, TRUE ) {
init();
init( cur );
}
OTaskEditor::OTaskEditor( const OTodo& to)
: QDialog(0, 0, TRUE ) {
init();
init( to );
}
OTaskEditor::~OTaskEditor() {
}
void OTaskEditor::init( int cur ) {
OTodo to;
if ( cur != 0 )
to.setCategories( cur );
load(to);
m_uid = 1; // generate a new one
}
void OTaskEditor::init( const OTodo& to ) {
load( to );
m_uid = to.uid();
}
OTodo OTaskEditor::todo()const{
qWarning("saving!");
OTodo to;
to.setUid(m_uid );
m_overView->save( to );
- //m_adv->save( to );
+ m_adv->save( to );
to.setRecurrence( m_rec->recurrence() );
return to;
}
void OTaskEditor::load(const OTodo& to) {
m_overView->load( to );
- //m_adv->load( to );
+ m_adv->load( to );
m_rec->setRecurrence( to.recurrence(), to.hasDueDate() ? to.dueDate() : QDate::currentDate() );
}
void OTaskEditor::init() {
setCaption("Task Editor");
QVBoxLayout* layo = new QVBoxLayout( this );
m_tab = new OTabWidget( this );
layo->addWidget( m_tab );
/*
* Add the Widgets
*/
m_overView = new TaskEditorOverView( m_tab );
m_tab->addTab( m_overView, "TodoList", tr("Overview") );
- m_adv = new TaskEditorAdvancedImpl( m_tab );
+ m_adv = new TaskEditorAdvanced( m_tab );
m_tab->addTab( m_adv, "todo/advanced", tr("Advanced") );
m_alarm = new TaskEditorAlarms( m_tab );
m_tab->addTab( m_alarm, "todo/alarm", tr("Alarms") );
m_remind = new TaskEditorAlarms( m_tab );
m_tab->addTab( m_remind, "todo/reminder", tr("Reminders") );
QLabel* lbl = new QLabel( m_tab );
lbl->setText( tr("X-Ref") );
m_tab->addTab( lbl, "todo/xref", tr("X-Ref") );
m_rec = new ORecurranceWidget( true, QDate::currentDate(), this );
m_tab->addTab( m_rec, "repeat", tr("Recurrance") );
/* signal and slots */
connect(m_overView, SIGNAL(recurranceEnabled(bool) ),
m_rec, SLOT(setEnabled(bool) ) );
/* connect due date changed to the recurrence tab */
connect(m_overView, SIGNAL(dueDateChanged(const QDate&) ),
m_rec, SLOT(setStartDate(const QDate& ) ) );
m_tab->setCurrentTab( m_overView );
}
diff --git a/core/pim/todo/otaskeditor.h b/core/pim/todo/otaskeditor.h
index d13e157..8232886 100644
--- a/core/pim/todo/otaskeditor.h
+++ b/core/pim/todo/otaskeditor.h
@@ -1,44 +1,44 @@
#ifndef OPIE_TASK_EDITOR_H
#define OPIE_TASK_EDITOR_H
#include <qdialog.h>
#include <opie/otodo.h>
#include <opie/otabwidget.h>
class TaskEditorOverView;
-class TaskEditorAdvancedImpl;
+class TaskEditorAdvanced;
class TaskEditorAlarms;
class ORecurranceWidget;
class QMultiLineEdit;
class OTaskEditor : public QDialog {
Q_OBJECT
public:
OTaskEditor(int cur);
OTaskEditor( const OTodo& todo );
~OTaskEditor();
/*
* same as the c'tor but this gives us the
* power to 'preload' the dialog
*/
void init( int cur );
void init( const OTodo& todo );
OTodo todo()const;
private:
void load( const OTodo& );
void init();
OTabWidget *m_tab;
TaskEditorOverView *m_overView;
- TaskEditorAdvancedImpl *m_adv;
+ TaskEditorAdvanced *m_adv;
TaskEditorAlarms *m_alarm;
TaskEditorAlarms *m_remind;
ORecurranceWidget *m_rec;
int m_uid;
};
#endif
diff --git a/core/pim/todo/taskeditoradvanced.cpp b/core/pim/todo/taskeditoradvanced.cpp
new file mode 100644
index 0000000..a431d47
--- a/dev/null
+++ b/core/pim/todo/taskeditoradvanced.cpp
@@ -0,0 +1,132 @@
+/*
+               =. This file is part of the OPIE Project
+             .=l. Copyright (c) 2002 <>
+           .>+-=
+ _;:,     .>    :=|. This program is free software; you can
+.> <`_,   >  .   <= redistribute it and/or modify it under
+:`=1 )Y*s>-.--   : the terms of the GNU General Public
+.="- .-=="i,     .._ License as published by the Free Software
+ - .   .-<_>     .<> Foundation; either version 2 of the License,
+     ._= =}       : or (at your option) any later version.
+    .%`+i>       _;_.
+    .i_,=:_.      -<s. This program is distributed in the hope that
+     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
+    : ..    .:,     . . . without even the implied warranty of
+    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
+  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.=       =       ; Library General Public License for more
+++=   -.     .`     .: details.
+ :     =  ...= . :.=-
+ -.   .:....=;==+<; You should have received a copy of the GNU
+  -_. . .   )=.  = General Public License along with
+    --        :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+
+#include "taskeditoradvanced.h"
+
+#include <opie/otodo.h>
+#include <opie/opimmaintainer.h>
+#include <opie/opimstate.h>
+
+#include <qpe/resource.h>
+
+#include <qcombobox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qmultilineedit.h>
+#include <qscrollview.h>
+#include <qtoolbutton.h>
+#include <qwhatsthis.h>
+
+TaskEditorAdvanced::TaskEditorAdvanced( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ QVBoxLayout *vb = new QVBoxLayout( this );
+
+ QScrollView *sv = new QScrollView( this );
+ vb->addWidget( sv );
+ sv->setResizePolicy( QScrollView::AutoOneFit );
+ sv->setFrameStyle( QFrame::NoFrame );
+
+ QWidget *container = new QWidget( sv->viewport() );
+ sv->addChild( container );
+
+ QGridLayout *layout = new QGridLayout( container, 5, 3, 4, 4 );
+
+ QLabel *label = new QLabel( tr( "State:" ), container );
+ layout->addWidget( label, 0, 0 );
+
+ cmbState = new QComboBox( FALSE, container );
+ cmbState->insertItem( tr( "Started" ) );
+ cmbState->insertItem( tr( "Postponed" ) );
+ cmbState->insertItem( tr( "Finished" ) );
+ cmbState->insertItem( tr( "Not started" ) );
+ layout->addMultiCellWidget( cmbState, 0, 0, 1, 2 );
+
+ label = new QLabel( tr( "Maintain Mode:" ), container );
+ layout->addWidget( label, 1, 0 );
+
+ cmbMode = new QComboBox( FALSE, container );
+ cmbMode->insertItem( tr( "Nothing" ) );
+ cmbMode->insertItem( tr( "Responsible" ) );
+ cmbMode->insertItem( tr( "Done By" ) );
+ cmbMode->insertItem( tr( "Coordinating" ) );
+ layout->addMultiCellWidget( cmbMode, 1, 1, 1, 2 );
+
+ label = new QLabel( tr( "Maintainer:" ), container );
+ layout->addWidget( label, 2, 0 );
+
+ txtMaintainer = new QLabel( tr( "test" ), container );
+ txtMaintainer->setTextFormat( QLabel::RichText );
+ layout->addWidget( txtMaintainer, 2, 1 );
+
+ tbtMaintainer = new QToolButton( container );
+ tbtMaintainer->setPixmap( Resource::loadPixmap( "todo/more" ) );
+ layout->addWidget( tbtMaintainer, 2, 2 );
+
+ label = new QLabel( tr( "Description:" ), container );
+ layout->addWidget( label, 3, 0 );
+
+ m_edit = new QMultiLineEdit( this );
+ m_edit->setWordWrap( QMultiLineEdit::WidgetWidth );
+ layout->addMultiCellWidget( m_edit, 4, 4, 0, 2 );
+}
+
+TaskEditorAdvanced::~TaskEditorAdvanced()
+{
+}
+
+void TaskEditorAdvanced::load( const OTodo &todo )
+{
+ m_edit->setText( todo.description() );
+
+ /* OPimState */
+ int state = todo.state().state();
+
+ /* defualt to not started */
+ if ( state == OPimState::Undefined )
+ state = OPimState::NotStarted;
+
+ cmbState->setCurrentItem( state );
+
+ /* Maintainer Mode */
+ state = todo.maintainer().mode();
+ if ( state == OPimMaintainer::Undefined )
+ state = OPimMaintainer::Nothing;
+
+ cmbMode->setCurrentItem( state );
+}
+
+void TaskEditorAdvanced::save( OTodo &todo )
+{
+ todo.setDescription( m_edit->text() );
+ todo.setState( OPimState( cmbState->currentItem() ) );
+
+ /* Fix me resolve name to uid.....*/
+ todo.setMaintainer( OPimMaintainer( cmbMode->currentItem(), -10 ) );
+ qWarning("save");
+}
diff --git a/core/pim/todo/taskeditoradvanced.h b/core/pim/todo/taskeditoradvanced.h
new file mode 100644
index 0000000..65359e9
--- a/dev/null
+++ b/core/pim/todo/taskeditoradvanced.h
@@ -0,0 +1,73 @@
+/*
+               =. This file is part of the OPIE Project
+             .=l. Copyright (c) 2002 <>
+           .>+-=
+ _;:,     .>    :=|. This program is free software; you can
+.> <`_,   >  .   <= redistribute it and/or modify it under
+:`=1 )Y*s>-.--   : the terms of the GNU General Public
+.="- .-=="i,     .._ License as published by the Free Software
+ - .   .-<_>     .<> Foundation; either version 2 of the License,
+     ._= =}       : or (at your option) any later version.
+    .%`+i>       _;_.
+    .i_,=:_.      -<s. This program is distributed in the hope that
+     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
+    : ..    .:,     . . . without even the implied warranty of
+    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
+  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.=       =       ; Library General Public License for more
+++=   -.     .`     .: details.
+ :     =  ...= . :.=-
+ -.   .:....=;==+<; You should have received a copy of the GNU
+  -_. . .   )=.  = General Public License along with
+    --        :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+
+#ifndef TASKEDITORADVANCED_H
+#define TASKEDITORADVANCED_H
+
+#include <qwidget.h>
+
+class OTodo;
+class QComboBox;
+class QLabel;
+class QMultiLineEdit;
+class QToolButton;
+
+/**
+ * This is the implementation of the Opie Task Editor Advanced tab
+ * it features the State!
+ * MaintainerMode
+ * Description
+ */
+class TaskEditorAdvanced : public QWidget
+{
+ Q_OBJECT
+
+public:
+ TaskEditorAdvanced( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~TaskEditorAdvanced();
+
+ /*
+ * I could have a struct which returns a QWidget*
+ * load and save to a OTodo
+ * and use multiple inheretence with all other widgets
+ * and then simply iterate over the list of structs
+ * this way I could easily have plugins for the whole editor....
+ * but I do not do it -zecke
+ */
+ void load( const OTodo& );
+ void save( OTodo& );
+
+ QComboBox *cmbState;
+ QLabel *txtMaintainer;
+ QToolButton *tbtMaintainer;
+ QComboBox *cmbMode;
+ QMultiLineEdit *m_edit;
+
+};
+
+#endif // TASKEDITORADVANCED_H
diff --git a/core/pim/todo/taskeditoradvanced.ui b/core/pim/todo/taskeditoradvanced.ui
deleted file mode 100644
index 3aac216..0000000
--- a/core/pim/todo/taskeditoradvanced.ui
+++ b/dev/null
@@ -1,224 +0,0 @@
-<!DOCTYPE UI><UI>
-<class>TaskEditorAdvanced</class>
-<widget>
- <class>QWidget</class>
- <property stdset="1">
- <name>name</name>
- <cstring>TaskEditorAdvanced</cstring>
- </property>
- <property stdset="1">
- <name>geometry</name>
- <rect>
- <x>0</x>
- <y>0</y>
- <width>232</width>
- <height>307</height>
- </rect>
- </property>
- <property>
- <name>layoutMargin</name>
- </property>
- <property>
- <name>layoutSpacing</name>
- </property>
- <grid>
- <property stdset="1">
- <name>margin</name>
- <number>8</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- <widget row="0" column="0" >
- <class>QLayoutWidget</class>
- <property stdset="1">
- <name>name</name>
- <cstring>Layout13</cstring>
- </property>
- <hbox>
- <property stdset="1">
- <name>margin</name>
- <number>0</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- <widget>
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>lblState</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>State:</string>
- </property>
- </widget>
- <widget>
- <class>QComboBox</class>
- <item>
- <property>
- <name>text</name>
- <string>Started</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>Postponed</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>Finished</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>Not started</string>
- </property>
- </item>
- <property stdset="1">
- <name>name</name>
- <cstring>cmbState</cstring>
- </property>
- </widget>
- </hbox>
- </widget>
- <widget row="2" column="0" >
- <class>QLayoutWidget</class>
- <property stdset="1">
- <name>name</name>
- <cstring>Layout17</cstring>
- </property>
- <hbox>
- <property stdset="1">
- <name>margin</name>
- <number>0</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- <widget>
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>lblMaintainer</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Maintainer</string>
- </property>
- </widget>
- <widget>
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>txtMaintainer</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>test</string>
- </property>
- <property stdset="1">
- <name>textFormat</name>
- <enum>RichText</enum>
- </property>
- </widget>
- <widget>
- <class>QLayoutWidget</class>
- <property stdset="1">
- <name>name</name>
- <cstring>Layout16</cstring>
- </property>
- <vbox>
- <property stdset="1">
- <name>margin</name>
- <number>0</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- <widget>
- <class>QToolButton</class>
- <property stdset="1">
- <name>name</name>
- <cstring>tbtMaintainer</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>...</string>
- </property>
- </widget>
- </vbox>
- </widget>
- </hbox>
- </widget>
- <widget row="1" column="0" >
- <class>QLayoutWidget</class>
- <property stdset="1">
- <name>name</name>
- <cstring>Layout4</cstring>
- </property>
- <hbox>
- <property stdset="1">
- <name>margin</name>
- <number>0</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- <widget>
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>txtMode</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Maintain Mode:</string>
- </property>
- </widget>
- <widget>
- <class>QComboBox</class>
- <item>
- <property>
- <name>text</name>
- <string>Nothing</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>Responsible</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>Done By</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>Coordinating</string>
- </property>
- </item>
- <property stdset="1">
- <name>name</name>
- <cstring>cmbMode</cstring>
- </property>
- </widget>
- </hbox>
- </widget>
- </grid>
-</widget>
-</UI>
diff --git a/core/pim/todo/taskeditoradvancedimpl.cpp b/core/pim/todo/taskeditoradvancedimpl.cpp
deleted file mode 100644
index 89f672c..0000000
--- a/core/pim/todo/taskeditoradvancedimpl.cpp
+++ b/dev/null
@@ -1,63 +0,0 @@
-#include <qmultilineedit.h>
-#include <qcombobox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-
-
-#include <opie/otodo.h>
-#include <opie/opimmaintainer.h>
-#include <opie/opimstate.h>
-
-#include "taskeditoradvancedimpl.h"
-
-
-TaskEditorAdvancedImpl::TaskEditorAdvancedImpl( QWidget* parent, const char* name )
- : TaskEditorAdvanced( parent, name ) {
- initUI();
-}
-TaskEditorAdvancedImpl::~TaskEditorAdvancedImpl() {
-}
-void TaskEditorAdvancedImpl::load( const OTodo& todo) {
- m_edit->setText( todo.description() );
-
- /* OPimState */
- int state = todo.state().state();
-
- /* defualt to not started */
- if ( state == OPimState::Undefined )
- state = OPimState::NotStarted;
-
- cmbState->setCurrentItem( state );
-
- /* Maintainer Mode */
- state = todo.maintainer().mode();
- if ( state == OPimMaintainer::Undefined )
- state = OPimMaintainer::Nothing;
-
- cmbMode->setCurrentItem( state );
-
-}
-void TaskEditorAdvancedImpl::save( OTodo& todo) {
- todo.setDescription( m_edit->text() );
- todo.setState( OPimState( cmbState->currentItem() ) );
-
- /* Fix me resolve name to uid.....*/
- todo.setMaintainer( OPimMaintainer( cmbMode->currentItem(), -10 ) );
- qWarning("save");
-}
-/*
- * int the damn UI
- */
-void TaskEditorAdvancedImpl::initUI() {
- /* a MultiLineEdit */
- m_edit = new QMultiLineEdit( this );
- m_edit->setWordWrap( QMultiLineEdit::WidgetWidth );
-
- /* a Label */
- QLabel* lbl = new QLabel(this );
- lbl->setText( tr("Description") );
-
- /* add it to the QGridLayout of our base class */
- static_cast<QGridLayout*>(layout() )->addWidget( lbl , 3, 0 );
- static_cast<QGridLayout*>(layout() )->addWidget( m_edit, 4, 0 );
-}
diff --git a/core/pim/todo/taskeditoradvancedimpl.h b/core/pim/todo/taskeditoradvancedimpl.h
deleted file mode 100644
index 215d8cb..0000000
--- a/core/pim/todo/taskeditoradvancedimpl.h
+++ b/dev/null
@@ -1,37 +0,0 @@
-#ifndef OPIE_TASK_EDITOR_ADVANCED_IMPL_H
-#define OPIE_TASK_EDITOR_ADVANCED_IMPL_H
-
-#include "taskeditoradvanced.h"
-
-/**
- * This is the implementation of the Opie Task Editor Advanced tab
- * it features the State!
- * MaintainerMode
- * Description
- */
-class QMultiLineEdit;
-class OTodo;
-class TaskEditorAdvancedImpl : public TaskEditorAdvanced {
- Q_OBJECT
-public:
- TaskEditorAdvancedImpl( QWidget* parent = 0, const char* name = 0 );
- ~TaskEditorAdvancedImpl();
-
- /*
- * I could have a struct which returns a QWidget*
- * load and save to a OTodo
- * and use multiple inheretence with all other widgets
- * and then simply iterate over the list of structs
- * this way I could easily have plugins for the whole editor....
- * but I do not do it -zecke
- */
- void load( const OTodo& );
- void save( OTodo& );
-
-private:
- void initUI();
- QMultiLineEdit* m_edit;
-};
-
-
-#endif
diff --git a/core/pim/todo/taskeditoroverview.cpp b/core/pim/todo/taskeditoroverview.cpp
index 9aab76a..6906c26 100644
--- a/core/pim/todo/taskeditoroverview.cpp
+++ b/core/pim/todo/taskeditoroverview.cpp
@@ -1,317 +1,314 @@
/*
               =. This file is part of the OPIE Project
             .=l. Copyright (c) 2002 <>
           .>+-=
 _;:,     .>    :=|. This program is free software; you can
.> <`_,   >  .   <= redistribute it and/or modify it under
:`=1 )Y*s>-.--   : the terms of the GNU General Public
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This program is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.=       =       ; Library General Public License for more
++=   -.     .`     .: details.
 :     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "taskeditoroverview.h"
#include <opie/orecur.h>
#include <qpe/categoryselect.h>
#include <qpe/datebookmonth.h>
#include <qpe/resource.h>
#include <qpe/timestring.h>
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qpushbutton.h>
-#include <qtooltip.h>
-#include <qvariant.h>
#include <qwhatsthis.h>
TaskEditorOverView::TaskEditorOverView( QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl )
{
// Load icons
// TODO - probably should be done globally somewhere else,
// see also quickeditimpl.cpp/h, tableview.cpp/h
QString namestr;
for ( unsigned int i = 1; i < 6; i++ ) {
namestr = "todo/priority";
namestr.append( QString::number( i ) );
m_pic_priority[ i - 1 ] = Resource::loadPixmap( namestr );
}
QDate curDate = QDate::currentDate();
m_start = m_comp = m_due = curDate;
QString curDateStr = TimeString::longDateString( curDate );
- // TODO - add QScrollView for contents
QVBoxLayout *vb = new QVBoxLayout( this );
QScrollView *sv = new QScrollView( this );
vb->addWidget( sv );
sv->setResizePolicy( QScrollView::AutoOneFit );
sv->setFrameStyle( QFrame::NoFrame );
QWidget *container = new QWidget( sv->viewport() );
sv->addChild( container );
QGridLayout *layout = new QGridLayout( container, 10, 2, 4, 4 );
// Summary
QLabel *label = new QLabel( tr( "Summary:" ), container );
layout->addWidget( label, 0, 0 );
cmbSum = new QComboBox( TRUE, container );
cmbSum->insertItem( tr( "Complete " ) );
cmbSum->insertItem( tr( "Work on " ) );
cmbSum->insertItem( tr( "Buy " ) );
cmbSum->insertItem( tr( "Organize " ) );
cmbSum->insertItem( tr( "Get " ) );
cmbSum->insertItem( tr( "Update " ) );
cmbSum->insertItem( tr( "Create " ) );
cmbSum->insertItem( tr( "Plan " ) );
cmbSum->insertItem( tr( "Call " ) );
cmbSum->insertItem( tr( "Mail " ) );
cmbSum->clearEdit();
layout->addMultiCellWidget( cmbSum, 1, 1, 0, 1 );
// Priority
label = new QLabel( tr( "Priority:" ), container );
layout->addWidget( label, 2, 0 );
cmbPrio = new QComboBox( FALSE, container );
cmbPrio->setMinimumHeight( 26 );
cmbPrio->insertItem( m_pic_priority[ 0 ], tr( "Very High" ) );
cmbPrio->insertItem( m_pic_priority[ 1 ], tr( "High" ) );
cmbPrio->insertItem( m_pic_priority[ 2 ], tr( "Normal" ) );
cmbPrio->insertItem( m_pic_priority[ 3 ], tr( "Low" ) );
cmbPrio->insertItem( m_pic_priority[ 4 ], tr( "Very Low" ) );
cmbPrio->setCurrentItem( 2 );
layout->addWidget( cmbPrio, 2, 1 );
// Category
label = new QLabel( tr( "Category:" ), container );
layout->addWidget( label, 3, 0 );
comboCategory = new CategorySelect( container );
layout->addWidget( comboCategory, 3, 1 );
// Recurrance
CheckBox7 = new QCheckBox( tr( "Recurring task" ), container );
layout->addMultiCellWidget( CheckBox7, 4, 4, 0, 1 );
connect( CheckBox7, SIGNAL(clicked() ), this, SLOT( slotRecClicked() ) );
QSpacerItem *spacer = new QSpacerItem( 5, 5, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding );
layout->addItem( spacer, 5, 0 );
// Start date
ckbStart = new QCheckBox( tr( "Start Date:" ), container );
layout->addWidget( ckbStart, 6, 0 );
connect( ckbStart, SIGNAL( clicked() ), this, SLOT( slotStartChecked() ) );
btnStart = new QPushButton( curDateStr, container );
btnStart->setEnabled( FALSE );
layout->addWidget( btnStart, 6, 1 );
QPopupMenu *popup = new QPopupMenu( this );
m_startBook = new DateBookMonth( popup, 0, TRUE );
popup->insertItem( m_startBook );
btnStart->setPopup( popup );
connect( m_startBook, SIGNAL( dateClicked( int, int, int ) ),
this, SLOT( slotStartChanged( int, int, int ) ) );
// Due date
ckbDue = new QCheckBox( tr( "Due Date:" ), container );
layout->addWidget( ckbDue, 7, 0 );
connect( ckbDue, SIGNAL( clicked() ), this, SLOT( slotDueChecked() ) );
btnDue = new QPushButton( curDateStr, container );
btnDue->setEnabled( FALSE );
layout->addWidget( btnDue, 7, 1 );
popup = new QPopupMenu( this );
m_dueBook = new DateBookMonth( popup, 0, TRUE );
popup->insertItem( m_dueBook );
btnDue->setPopup( popup );
connect( m_dueBook, SIGNAL( dateClicked( int, int, int ) ),
this, SLOT( slotDueChanged( int, int, int ) ) );
// Progress
label = new QLabel( tr( "Progress:" ), container );
layout->addWidget( label, 8, 0 );
cmbProgress = new QComboBox( FALSE, container );
cmbProgress->insertItem( tr( "0 %" ) );
cmbProgress->insertItem( tr( "20 %" ) );
cmbProgress->insertItem( tr( "40 %" ) );
cmbProgress->insertItem( tr( "60 %" ) );
cmbProgress->insertItem( tr( "80 %" ) );
cmbProgress->insertItem( tr( "100 %" ) );
layout->addWidget( cmbProgress, 8, 1 );
// Completed
ckbComp = new QCheckBox( tr( "Completed:" ), container );
layout->addWidget( ckbComp, 9, 0 );
connect( ckbComp, SIGNAL( clicked() ), this, SLOT( slotCompChecked() ) );
btnComp = new QPushButton( curDateStr, container );
btnComp->setEnabled( FALSE );
layout->addWidget( btnComp, 9, 1 );
popup = new QPopupMenu( this );
m_compBook = new DateBookMonth( popup, 0, TRUE );
popup->insertItem( m_compBook );
btnComp->setPopup( popup );
connect( m_compBook, SIGNAL( dateClicked( int, int, int ) ),
this, SLOT( slotCompChanged( int, int, int ) ) );
}
TaskEditorOverView::~TaskEditorOverView()
{
}
void TaskEditorOverView::load( const OTodo& todo )
{
/*
* now that we're 'preloaded' we
* need to disable the buttons
* holding the dat
*/
btnDue->setEnabled( FALSE );
btnComp->setEnabled( FALSE );
btnStart->setEnabled( FALSE );
/*
* get some basic dateinfos for now
*/
QDate date = QDate::currentDate();
QString str = TimeString::longDateString( date );
CheckBox7->setChecked( todo.recurrence().doesRecur() );
emit recurranceEnabled( todo.recurrence().doesRecur() );
ckbStart->setChecked( todo.hasStartDate() );
btnStart->setEnabled( todo.hasStartDate() );
if ( todo.hasStartDate() )
{
m_start = todo.startDate();
btnStart->setText( TimeString::longDateString( m_start ) );
}
else
btnStart->setText( str );
ckbComp->setChecked( todo.hasCompletedDate() );
btnComp->setEnabled( todo.hasCompletedDate() );
if ( todo.hasCompletedDate() )
{
m_comp = todo.completedDate();
btnComp->setText( TimeString::longDateString( m_comp ) );
}
else
btnComp->setText( str );
cmbProgress->setCurrentItem( todo.progress() / 20 );
cmbSum->insertItem( todo.summary(), 0 );
cmbSum->setCurrentItem( 0 );
ckbDue->setChecked( todo.hasDueDate() );
btnDue->setText( TimeString::longDateString( todo.dueDate() ) );
btnDue->setEnabled( todo.hasDueDate() );
m_due = todo.dueDate();
cmbPrio->setCurrentItem( todo.priority() - 1 );
ckbComp->setChecked( todo.isCompleted() );
comboCategory->setCategories( todo.categories(), "Todo List", tr( "Todo List" ) );
}
void TaskEditorOverView::save( OTodo &to )
{
/* a invalid date */
QDate inval;
/* save our info back */
/* due date */
if ( ckbDue->isChecked() )
{
to.setDueDate( m_due );
to.setHasDueDate( true );
}
else
to.setHasDueDate( false );
/* start date */
if ( ckbStart->isChecked() )
{
to.setStartDate( m_start );
}
else
to.setStartDate( inval );
/* comp date */
if ( ckbComp->isChecked() )
{
to.setCompletedDate( m_comp );
}
else
to.setCompletedDate( inval );
if ( comboCategory->currentCategory() != -1 )
{
QArray<int> arr = comboCategory->currentCategories();
to.setCategories( arr );
}
to.setPriority( cmbPrio->currentItem() + 1 );
to.setCompleted( ckbComp->isChecked() );
to.setSummary( cmbSum->currentText() );
to.setProgress( cmbProgress->currentItem() * 20 );
}
void TaskEditorOverView::slotRecClicked()
{
emit recurranceEnabled( CheckBox7->isChecked() );
}
void TaskEditorOverView::slotStartChecked()
{
btnStart->setEnabled( ckbStart->isChecked() );
}
void TaskEditorOverView::slotCompChecked()
{
btnComp->setEnabled( ckbComp->isChecked() );
}
void TaskEditorOverView::slotDueChecked()
{
btnDue->setEnabled( ckbDue->isChecked() );
}
void TaskEditorOverView::slotStartChanged(int y, int m, int d)
{
m_start.setYMD( y, m, d );
btnStart->setText( TimeString::longDateString( m_start ) );
}
void TaskEditorOverView::slotCompChanged(int y, int m, int d)
{
m_comp.setYMD( y, m, d );
btnComp->setText( TimeString::longDateString( m_comp ) );
}
void TaskEditorOverView::slotDueChanged(int y, int m, int d)
{
m_due.setYMD( y, m, d );
btnDue->setText( TimeString::longDateString( m_due ) );
}
diff --git a/core/pim/todo/todo.pro b/core/pim/todo/todo.pro
index 9960c65..697c005 100644
--- a/core/pim/todo/todo.pro
+++ b/core/pim/todo/todo.pro
@@ -1,65 +1,64 @@
TEMPLATE = app
CONFIG = qt warn_on release
DESTDIR = $(OPIEDIR)/bin
HEADERS = smalltodo.h \
todomanager.h \
mainwindow.h \
todoview.h \
tableview.h \
todotemplatemanager.h \
todoeditor.h \
todoshow.h \
textviewshow.h \
templateeditor.h \
templatedialog.h \
templatedialogimpl.h \
quickedit.h \
quickeditimpl.h \
otaskeditor.h \
taskeditoroverview.h \
- taskeditoradvancedimpl.h \
+ taskeditoradvanced.h \
taskeditoralarms.h
SOURCES = smalltodo.cpp \
todomanager.cpp \
mainwindow.cpp \
main.cpp \
tableview.cpp \
todoview.cpp \
todotemplatemanager.cpp \
todoeditor.cpp \
todoshow.cpp \
textviewshow.cpp \
templateeditor.cpp \
templatedialog.cpp \
templatedialogimpl.cpp \
quickeditimpl.cpp \
quickedit.cpp \
otaskeditor.cpp \
taskeditoroverview.cpp \
- taskeditoradvancedimpl.cpp \
+ taskeditoradvanced.cpp \
taskeditoralarms.cpp
-INTERFACES = taskeditoradvanced.ui
TARGET = todolist
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe -lopie
TRANSLATIONS = ../../../i18n/de/todolist.ts \
../../../i18n/da/todolist.ts \
../../../i18n/xx/todolist.ts \
../../../i18n/en/todolist.ts \
../../../i18n/es/todolist.ts \
../../../i18n/fr/todolist.ts \
../../../i18n/hu/todolist.ts \
../../../i18n/ja/todolist.ts \
../../../i18n/ko/todolist.ts \
../../../i18n/no/todolist.ts \
../../../i18n/pl/todolist.ts \
../../../i18n/pt/todolist.ts \
../../../i18n/pt_BR/todolist.ts \
../../../i18n/sl/todolist.ts \
../../../i18n/zh_CN/todolist.ts \
../../../i18n/zh_TW/todolist.ts