Diffstat (limited to 'core/pim/todo/taskeditoroverview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/todo/taskeditoroverview.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/pim/todo/taskeditoroverview.cpp b/core/pim/todo/taskeditoroverview.cpp index 415dcf2..294acb9 100644 --- a/core/pim/todo/taskeditoroverview.cpp +++ b/core/pim/todo/taskeditoroverview.cpp | |||
@@ -1,63 +1,63 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2002 <> | 3 | .=l. Copyright (c) 2002 <> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This program is free software; you can | 5 | _;:, .> :=|. This program is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This program is distributed in the hope that | 12 | .i_,=:_. -<s. This program is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
17 | ..}^=.= = ; Library General Public License for more | 17 | ..}^=.= = ; Library General Public License for more |
18 | ++= -. .` .: details. | 18 | ++= -. .` .: details. |
19 | : = ...= . :.=- | 19 | : = ...= . :.=- |
20 | -. .:....=;==+<; You should have received a copy of the GNU | 20 | -. .:....=;==+<; You should have received a copy of the GNU |
21 | -_. . . )=. = General Public License along with | 21 | -_. . . )=. = General Public License along with |
22 | -- :-=` this library; see the file COPYING.LIB. | 22 | -- :-=` this library; see the file COPYING.LIB. |
23 | If not, write to the Free Software Foundation, | 23 | If not, write to the Free Software Foundation, |
24 | Inc., 59 Temple Place - Suite 330, | 24 | Inc., 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "taskeditoroverview.h" | 29 | #include "taskeditoroverview.h" |
30 | 30 | ||
31 | #include <opie/orecur.h> | 31 | //#include <opie2/opimrecurrence.h> |
32 | 32 | ||
33 | #include <qpe/categoryselect.h> | 33 | #include <qpe/categoryselect.h> |
34 | #include <qpe/datebookmonth.h> | 34 | #include <qpe/datebookmonth.h> |
35 | #include <qpe/resource.h> | 35 | #include <qpe/resource.h> |
36 | 36 | ||
37 | #include <qcheckbox.h> | 37 | #include <qcheckbox.h> |
38 | #include <qlabel.h> | 38 | #include <qlabel.h> |
39 | #include <qlayout.h> | 39 | #include <qlayout.h> |
40 | #include <qmultilineedit.h> | 40 | #include <qmultilineedit.h> |
41 | #include <qwhatsthis.h> | 41 | #include <qwhatsthis.h> |
42 | 42 | ||
43 | TaskEditorOverView::TaskEditorOverView( QWidget* parent, const char* name, WFlags fl ) | 43 | TaskEditorOverView::TaskEditorOverView( QWidget* parent, const char* name, WFlags fl ) |
44 | : QWidget( parent, name, fl ) | 44 | : QWidget( parent, name, fl ) |
45 | { | 45 | { |
46 | // Load icons | 46 | // Load icons |
47 | // TODO - probably should be done globally somewhere else, | 47 | // TODO - probably should be done globally somewhere else, |
48 | // see also quickeditimpl.cpp/h, tableview.cpp/h | 48 | // see also quickeditimpl.cpp/h, tableview.cpp/h |
49 | QString namestr; | 49 | QString namestr; |
50 | for ( unsigned int i = 1; i < 6; i++ ) { | 50 | for ( unsigned int i = 1; i < 6; i++ ) { |
51 | namestr = "todo/priority"; | 51 | namestr = "todo/priority"; |
52 | namestr.append( QString::number( i ) ); | 52 | namestr.append( QString::number( i ) ); |
53 | m_pic_priority[ i - 1 ] = Resource::loadPixmap( namestr ); | 53 | m_pic_priority[ i - 1 ] = Resource::loadPixmap( namestr ); |
54 | } | 54 | } |
55 | 55 | ||
56 | QVBoxLayout *vb = new QVBoxLayout( this ); | 56 | QVBoxLayout *vb = new QVBoxLayout( this ); |
57 | 57 | ||
58 | QScrollView *sv = new QScrollView( this ); | 58 | QScrollView *sv = new QScrollView( this ); |
59 | vb->addWidget( sv ); | 59 | vb->addWidget( sv ); |
60 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 60 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
61 | sv->setFrameStyle( QFrame::NoFrame ); | 61 | sv->setFrameStyle( QFrame::NoFrame ); |
62 | 62 | ||
63 | QWidget *container = new QWidget( sv->viewport() ); | 63 | QWidget *container = new QWidget( sv->viewport() ); |
@@ -98,78 +98,78 @@ TaskEditorOverView::TaskEditorOverView( QWidget* parent, const char* name, WFla | |||
98 | cmbPriority->setCurrentItem( 2 ); | 98 | cmbPriority->setCurrentItem( 2 ); |
99 | layout->addWidget( cmbPriority, 2, 1 ); | 99 | layout->addWidget( cmbPriority, 2, 1 ); |
100 | QWhatsThis::add( cmbPriority, tr( "Select priority of task here." ) ); | 100 | QWhatsThis::add( cmbPriority, tr( "Select priority of task here." ) ); |
101 | 101 | ||
102 | // Category | 102 | // Category |
103 | label = new QLabel( tr( "Category:" ), container ); | 103 | label = new QLabel( tr( "Category:" ), container ); |
104 | layout->addWidget( label, 3, 0 ); | 104 | layout->addWidget( label, 3, 0 ); |
105 | QWhatsThis::add( label, tr( "Select category to organize this task with." ) ); | 105 | QWhatsThis::add( label, tr( "Select category to organize this task with." ) ); |
106 | cmbCategory = new CategorySelect( container ); | 106 | cmbCategory = new CategorySelect( container ); |
107 | layout->addWidget( cmbCategory, 3, 1 ); | 107 | layout->addWidget( cmbCategory, 3, 1 ); |
108 | QWhatsThis::add( cmbCategory, tr( "Select category to organize this task with." ) ); | 108 | QWhatsThis::add( cmbCategory, tr( "Select category to organize this task with." ) ); |
109 | 109 | ||
110 | // Recurrence | 110 | // Recurrence |
111 | ckbRecurrence = new QCheckBox( tr( "Recurring task" ), container ); | 111 | ckbRecurrence = new QCheckBox( tr( "Recurring task" ), container ); |
112 | layout->addMultiCellWidget( ckbRecurrence, 4, 4, 0, 1 ); | 112 | layout->addMultiCellWidget( ckbRecurrence, 4, 4, 0, 1 ); |
113 | QWhatsThis::add( ckbRecurrence, tr( "Click here if task happens on a regular basis. If selected, frequency can be set on the Recurrence tab." ) ); | 113 | QWhatsThis::add( ckbRecurrence, tr( "Click here if task happens on a regular basis. If selected, frequency can be set on the Recurrence tab." ) ); |
114 | connect( ckbRecurrence, SIGNAL(clicked() ), this, SLOT( slotRecClicked() ) ); | 114 | connect( ckbRecurrence, SIGNAL(clicked() ), this, SLOT( slotRecClicked() ) ); |
115 | 115 | ||
116 | // Notes | 116 | // Notes |
117 | label = new QLabel( tr( "Description:" ), container ); | 117 | label = new QLabel( tr( "Description:" ), container ); |
118 | layout->addWidget( label, 5, 0 ); | 118 | layout->addWidget( label, 5, 0 ); |
119 | QWhatsThis::add( label, tr( "Enter any additional information about this task here." ) ); | 119 | QWhatsThis::add( label, tr( "Enter any additional information about this task here." ) ); |
120 | mleNotes = new QMultiLineEdit( container ); | 120 | mleNotes = new QMultiLineEdit( container ); |
121 | mleNotes->setWordWrap( QMultiLineEdit::WidgetWidth ); | 121 | mleNotes->setWordWrap( QMultiLineEdit::WidgetWidth ); |
122 | layout->addMultiCellWidget( mleNotes, 6, 6, 0, 1 ); | 122 | layout->addMultiCellWidget( mleNotes, 6, 6, 0, 1 ); |
123 | QWhatsThis::add( mleNotes, tr( "Enter any additional information about this task here." ) ); | 123 | QWhatsThis::add( mleNotes, tr( "Enter any additional information about this task here." ) ); |
124 | } | 124 | } |
125 | 125 | ||
126 | TaskEditorOverView::~TaskEditorOverView() | 126 | TaskEditorOverView::~TaskEditorOverView() |
127 | { | 127 | { |
128 | } | 128 | } |
129 | 129 | ||
130 | void TaskEditorOverView::load( const OTodo& todo ) | 130 | void TaskEditorOverView::load( const OPimTodo& todo ) |
131 | { | 131 | { |
132 | // Description | 132 | // Description |
133 | cmbDesc->insertItem( todo.summary(), 0 ); | 133 | cmbDesc->insertItem( todo.summary(), 0 ); |
134 | cmbDesc->setCurrentItem( 0 ); | 134 | cmbDesc->setCurrentItem( 0 ); |
135 | 135 | ||
136 | // Priority | 136 | // Priority |
137 | cmbPriority->setCurrentItem( todo.priority() - 1 ); | 137 | cmbPriority->setCurrentItem( todo.priority() - 1 ); |
138 | 138 | ||
139 | // Category | 139 | // Category |
140 | cmbCategory->setCategories( todo.categories(), "Todo List", tr( "Todo List" ) ); | 140 | cmbCategory->setCategories( todo.categories(), "Todo List", tr( "Todo List" ) ); |
141 | 141 | ||
142 | // Recurrence | 142 | // Recurrence |
143 | ckbRecurrence->setChecked( todo.hasRecurrence() ); | 143 | ckbRecurrence->setChecked( todo.hasRecurrence() ); |
144 | emit recurranceEnabled( todo.hasRecurrence() ); | 144 | emit recurranceEnabled( todo.hasRecurrence() ); |
145 | 145 | ||
146 | // Notes | 146 | // Notes |
147 | mleNotes->setText( todo.description() ); | 147 | mleNotes->setText( todo.description() ); |
148 | 148 | ||
149 | } | 149 | } |
150 | 150 | ||
151 | void TaskEditorOverView::save( OTodo &todo ) | 151 | void TaskEditorOverView::save( OPimTodo &todo ) |
152 | { | 152 | { |
153 | // Description | 153 | // Description |
154 | todo.setSummary( cmbDesc->currentText() ); | 154 | todo.setSummary( cmbDesc->currentText() ); |
155 | 155 | ||
156 | // Priority | 156 | // Priority |
157 | todo.setPriority( cmbPriority->currentItem() + 1 ); | 157 | todo.setPriority( cmbPriority->currentItem() + 1 ); |
158 | 158 | ||
159 | // Category | 159 | // Category |
160 | if ( cmbCategory->currentCategory() != -1 ) | 160 | if ( cmbCategory->currentCategory() != -1 ) |
161 | { | 161 | { |
162 | QArray<int> arr = cmbCategory->currentCategories(); | 162 | QArray<int> arr = cmbCategory->currentCategories(); |
163 | todo.setCategories( arr ); | 163 | todo.setCategories( arr ); |
164 | } | 164 | } |
165 | 165 | ||
166 | // Recurrence - don't need to save here... | 166 | // Recurrence - don't need to save here... |
167 | 167 | ||
168 | // Notes | 168 | // Notes |
169 | todo.setDescription( mleNotes->text() ); | 169 | todo.setDescription( mleNotes->text() ); |
170 | } | 170 | } |
171 | 171 | ||
172 | void TaskEditorOverView::slotRecClicked() | 172 | void TaskEditorOverView::slotRecClicked() |
173 | { | 173 | { |
174 | emit recurranceEnabled( ckbRecurrence->isChecked() ); | 174 | emit recurranceEnabled( ckbRecurrence->isChecked() ); |
175 | } | 175 | } |