author | zecke <zecke> | 2003-01-23 08:01:39 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-01-23 08:01:39 (UTC) |
commit | 197b10539409b5650170879b904b9f781294866e (patch) (unidiff) | |
tree | 5800e0a557386527737f561dd78a6e8d156f9c3d | |
parent | 7c63d26d6c1a4e13a957ab79e58931c551e91eb8 (diff) | |
download | opie-197b10539409b5650170879b904b9f781294866e.zip opie-197b10539409b5650170879b904b9f781294866e.tar.gz opie-197b10539409b5650170879b904b9f781294866e.tar.bz2 |
take the right parent for the MultiLineEdit
-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 89e553f..5e2b026 100644 --- a/core/pim/todo/taskeditoroverview.cpp +++ b/core/pim/todo/taskeditoroverview.cpp | |||
@@ -1,177 +1,177 @@ | |||
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 <opie/orecur.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 | #include <qpe/timestring.h> | 36 | #include <qpe/timestring.h> |
37 | 37 | ||
38 | #include <qcheckbox.h> | 38 | #include <qcheckbox.h> |
39 | #include <qcombobox.h> | 39 | #include <qcombobox.h> |
40 | #include <qlabel.h> | 40 | #include <qlabel.h> |
41 | #include <qlayout.h> | 41 | #include <qlayout.h> |
42 | #include <qmultilineedit.h> | 42 | #include <qmultilineedit.h> |
43 | #include <qwhatsthis.h> | 43 | #include <qwhatsthis.h> |
44 | 44 | ||
45 | TaskEditorOverView::TaskEditorOverView( QWidget* parent, const char* name, WFlags fl ) | 45 | TaskEditorOverView::TaskEditorOverView( QWidget* parent, const char* name, WFlags fl ) |
46 | : QWidget( parent, name, fl ) | 46 | : QWidget( parent, name, fl ) |
47 | { | 47 | { |
48 | // Load icons | 48 | // Load icons |
49 | // TODO - probably should be done globally somewhere else, | 49 | // TODO - probably should be done globally somewhere else, |
50 | // see also quickeditimpl.cpp/h, tableview.cpp/h | 50 | // see also quickeditimpl.cpp/h, tableview.cpp/h |
51 | QString namestr; | 51 | QString namestr; |
52 | for ( unsigned int i = 1; i < 6; i++ ) { | 52 | for ( unsigned int i = 1; i < 6; i++ ) { |
53 | namestr = "todo/priority"; | 53 | namestr = "todo/priority"; |
54 | namestr.append( QString::number( i ) ); | 54 | namestr.append( QString::number( i ) ); |
55 | m_pic_priority[ i - 1 ] = Resource::loadPixmap( namestr ); | 55 | m_pic_priority[ i - 1 ] = Resource::loadPixmap( namestr ); |
56 | } | 56 | } |
57 | 57 | ||
58 | QVBoxLayout *vb = new QVBoxLayout( this ); | 58 | QVBoxLayout *vb = new QVBoxLayout( this ); |
59 | 59 | ||
60 | QScrollView *sv = new QScrollView( this ); | 60 | QScrollView *sv = new QScrollView( this ); |
61 | vb->addWidget( sv ); | 61 | vb->addWidget( sv ); |
62 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 62 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
63 | sv->setFrameStyle( QFrame::NoFrame ); | 63 | sv->setFrameStyle( QFrame::NoFrame ); |
64 | 64 | ||
65 | QWidget *container = new QWidget( sv->viewport() ); | 65 | QWidget *container = new QWidget( sv->viewport() ); |
66 | sv->addChild( container ); | 66 | sv->addChild( container ); |
67 | 67 | ||
68 | QGridLayout *layout = new QGridLayout( container, 7, 2, 4, 4 ); | 68 | QGridLayout *layout = new QGridLayout( container, 7, 2, 4, 4 ); |
69 | 69 | ||
70 | // Description | 70 | // Description |
71 | QLabel *label = new QLabel( tr( "Description:" ), container ); | 71 | QLabel *label = new QLabel( tr( "Description:" ), container ); |
72 | layout->addWidget( label, 0, 0 ); | 72 | layout->addWidget( label, 0, 0 ); |
73 | QWhatsThis::add( label, tr( "Enter brief description of the task here." ) ); | 73 | QWhatsThis::add( label, tr( "Enter brief description of the task here." ) ); |
74 | cmbDesc = new QComboBox( TRUE, container ); | 74 | cmbDesc = new QComboBox( TRUE, container ); |
75 | cmbDesc->insertItem( tr( "Complete " ) ); | 75 | cmbDesc->insertItem( tr( "Complete " ) ); |
76 | cmbDesc->insertItem( tr( "Work on " ) ); | 76 | cmbDesc->insertItem( tr( "Work on " ) ); |
77 | cmbDesc->insertItem( tr( "Buy " ) ); | 77 | cmbDesc->insertItem( tr( "Buy " ) ); |
78 | cmbDesc->insertItem( tr( "Organize " ) ); | 78 | cmbDesc->insertItem( tr( "Organize " ) ); |
79 | cmbDesc->insertItem( tr( "Get " ) ); | 79 | cmbDesc->insertItem( tr( "Get " ) ); |
80 | cmbDesc->insertItem( tr( "Update " ) ); | 80 | cmbDesc->insertItem( tr( "Update " ) ); |
81 | cmbDesc->insertItem( tr( "Create " ) ); | 81 | cmbDesc->insertItem( tr( "Create " ) ); |
82 | cmbDesc->insertItem( tr( "Plan " ) ); | 82 | cmbDesc->insertItem( tr( "Plan " ) ); |
83 | cmbDesc->insertItem( tr( "Call " ) ); | 83 | cmbDesc->insertItem( tr( "Call " ) ); |
84 | cmbDesc->insertItem( tr( "Mail " ) ); | 84 | cmbDesc->insertItem( tr( "Mail " ) ); |
85 | cmbDesc->clearEdit(); | 85 | cmbDesc->clearEdit(); |
86 | layout->addMultiCellWidget( cmbDesc, 1, 1, 0, 1 ); | 86 | layout->addMultiCellWidget( cmbDesc, 1, 1, 0, 1 ); |
87 | QWhatsThis::add( cmbDesc, tr( "Enter brief description of the task here." ) ); | 87 | QWhatsThis::add( cmbDesc, tr( "Enter brief description of the task here." ) ); |
88 | 88 | ||
89 | // Priority | 89 | // Priority |
90 | label = new QLabel( tr( "Priority:" ), container ); | 90 | label = new QLabel( tr( "Priority:" ), container ); |
91 | layout->addWidget( label, 2, 0 ); | 91 | layout->addWidget( label, 2, 0 ); |
92 | QWhatsThis::add( label, tr( "Select priority of task here." ) ); | 92 | QWhatsThis::add( label, tr( "Select priority of task here." ) ); |
93 | cmbPriority = new QComboBox( FALSE, container ); | 93 | cmbPriority = new QComboBox( FALSE, container ); |
94 | cmbPriority->setMinimumHeight( 26 ); | 94 | cmbPriority->setMinimumHeight( 26 ); |
95 | cmbPriority->insertItem( m_pic_priority[ 0 ], tr( "Very High" ) ); | 95 | cmbPriority->insertItem( m_pic_priority[ 0 ], tr( "Very High" ) ); |
96 | cmbPriority->insertItem( m_pic_priority[ 1 ], tr( "High" ) ); | 96 | cmbPriority->insertItem( m_pic_priority[ 1 ], tr( "High" ) ); |
97 | cmbPriority->insertItem( m_pic_priority[ 2 ], tr( "Normal" ) ); | 97 | cmbPriority->insertItem( m_pic_priority[ 2 ], tr( "Normal" ) ); |
98 | cmbPriority->insertItem( m_pic_priority[ 3 ], tr( "Low" ) ); | 98 | cmbPriority->insertItem( m_pic_priority[ 3 ], tr( "Low" ) ); |
99 | cmbPriority->insertItem( m_pic_priority[ 4 ], tr( "Very Low" ) ); | 99 | cmbPriority->insertItem( m_pic_priority[ 4 ], tr( "Very Low" ) ); |
100 | cmbPriority->setCurrentItem( 2 ); | 100 | cmbPriority->setCurrentItem( 2 ); |
101 | layout->addWidget( cmbPriority, 2, 1 ); | 101 | layout->addWidget( cmbPriority, 2, 1 ); |
102 | QWhatsThis::add( cmbPriority, tr( "Select priority of task here." ) ); | 102 | QWhatsThis::add( cmbPriority, tr( "Select priority of task here." ) ); |
103 | 103 | ||
104 | // Category | 104 | // Category |
105 | label = new QLabel( tr( "Category:" ), container ); | 105 | label = new QLabel( tr( "Category:" ), container ); |
106 | layout->addWidget( label, 3, 0 ); | 106 | layout->addWidget( label, 3, 0 ); |
107 | QWhatsThis::add( label, tr( "Select category to organize this task with." ) ); | 107 | QWhatsThis::add( label, tr( "Select category to organize this task with." ) ); |
108 | cmbCategory = new CategorySelect( container ); | 108 | cmbCategory = new CategorySelect( container ); |
109 | layout->addWidget( cmbCategory, 3, 1 ); | 109 | layout->addWidget( cmbCategory, 3, 1 ); |
110 | QWhatsThis::add( cmbCategory, tr( "Select category to organize this task with." ) ); | 110 | QWhatsThis::add( cmbCategory, tr( "Select category to organize this task with." ) ); |
111 | 111 | ||
112 | // Recurrence | 112 | // Recurrence |
113 | ckbRecurrence = new QCheckBox( tr( "Recurring task" ), container ); | 113 | ckbRecurrence = new QCheckBox( tr( "Recurring task" ), container ); |
114 | layout->addMultiCellWidget( ckbRecurrence, 4, 4, 0, 1 ); | 114 | layout->addMultiCellWidget( ckbRecurrence, 4, 4, 0, 1 ); |
115 | QWhatsThis::add( ckbRecurrence, tr( "Click here if task happens on a regular basis. If selected, frequency can be set on the Recurrence tab." ) ); | 115 | QWhatsThis::add( ckbRecurrence, tr( "Click here if task happens on a regular basis. If selected, frequency can be set on the Recurrence tab." ) ); |
116 | connect( ckbRecurrence, SIGNAL(clicked() ), this, SLOT( slotRecClicked() ) ); | 116 | connect( ckbRecurrence, SIGNAL(clicked() ), this, SLOT( slotRecClicked() ) ); |
117 | 117 | ||
118 | // Notes | 118 | // Notes |
119 | label = new QLabel( tr( "Notes:" ), container ); | 119 | label = new QLabel( tr( "Notes:" ), container ); |
120 | layout->addWidget( label, 5, 0 ); | 120 | layout->addWidget( label, 5, 0 ); |
121 | QWhatsThis::add( label, tr( "Enter any additional information about this task here." ) ); | 121 | QWhatsThis::add( label, tr( "Enter any additional information about this task here." ) ); |
122 | mleNotes = new QMultiLineEdit( this ); | 122 | mleNotes = new QMultiLineEdit( container ); |
123 | mleNotes->setWordWrap( QMultiLineEdit::WidgetWidth ); | 123 | mleNotes->setWordWrap( QMultiLineEdit::WidgetWidth ); |
124 | layout->addMultiCellWidget( mleNotes, 6, 6, 0, 1 ); | 124 | layout->addMultiCellWidget( mleNotes, 6, 6, 0, 1 ); |
125 | QWhatsThis::add( mleNotes, tr( "Enter any additional information about this task here." ) ); | 125 | QWhatsThis::add( mleNotes, tr( "Enter any additional information about this task here." ) ); |
126 | } | 126 | } |
127 | 127 | ||
128 | TaskEditorOverView::~TaskEditorOverView() | 128 | TaskEditorOverView::~TaskEditorOverView() |
129 | { | 129 | { |
130 | } | 130 | } |
131 | 131 | ||
132 | void TaskEditorOverView::load( const OTodo& todo ) | 132 | void TaskEditorOverView::load( const OTodo& todo ) |
133 | { | 133 | { |
134 | // Description | 134 | // Description |
135 | cmbDesc->insertItem( todo.summary(), 0 ); | 135 | cmbDesc->insertItem( todo.summary(), 0 ); |
136 | cmbDesc->setCurrentItem( 0 ); | 136 | cmbDesc->setCurrentItem( 0 ); |
137 | 137 | ||
138 | // Priority | 138 | // Priority |
139 | cmbPriority->setCurrentItem( todo.priority() - 1 ); | 139 | cmbPriority->setCurrentItem( todo.priority() - 1 ); |
140 | 140 | ||
141 | // Category | 141 | // Category |
142 | cmbCategory->setCategories( todo.categories(), "Todo List", tr( "Todo List" ) ); | 142 | cmbCategory->setCategories( todo.categories(), "Todo List", tr( "Todo List" ) ); |
143 | 143 | ||
144 | // Recurrence | 144 | // Recurrence |
145 | ckbRecurrence->setChecked( todo.recurrence().doesRecur() ); | 145 | ckbRecurrence->setChecked( todo.recurrence().doesRecur() ); |
146 | emit recurranceEnabled( todo.recurrence().doesRecur() ); | 146 | emit recurranceEnabled( todo.recurrence().doesRecur() ); |
147 | 147 | ||
148 | // Notes | 148 | // Notes |
149 | mleNotes->setText( todo.description() ); | 149 | mleNotes->setText( todo.description() ); |
150 | 150 | ||
151 | } | 151 | } |
152 | 152 | ||
153 | void TaskEditorOverView::save( OTodo &todo ) | 153 | void TaskEditorOverView::save( OTodo &todo ) |
154 | { | 154 | { |
155 | // Description | 155 | // Description |
156 | todo.setSummary( cmbDesc->currentText() ); | 156 | todo.setSummary( cmbDesc->currentText() ); |
157 | 157 | ||
158 | // Priority | 158 | // Priority |
159 | todo.setPriority( cmbPriority->currentItem() + 1 ); | 159 | todo.setPriority( cmbPriority->currentItem() + 1 ); |
160 | 160 | ||
161 | // Category | 161 | // Category |
162 | if ( cmbCategory->currentCategory() != -1 ) | 162 | if ( cmbCategory->currentCategory() != -1 ) |
163 | { | 163 | { |
164 | QArray<int> arr = cmbCategory->currentCategories(); | 164 | QArray<int> arr = cmbCategory->currentCategories(); |
165 | todo.setCategories( arr ); | 165 | todo.setCategories( arr ); |
166 | } | 166 | } |
167 | 167 | ||
168 | // Recurrence - don't need to save here... | 168 | // Recurrence - don't need to save here... |
169 | 169 | ||
170 | // Notes | 170 | // Notes |
171 | todo.setDescription( mleNotes->text() ); | 171 | todo.setDescription( mleNotes->text() ); |
172 | } | 172 | } |
173 | 173 | ||
174 | void TaskEditorOverView::slotRecClicked() | 174 | void TaskEditorOverView::slotRecClicked() |
175 | { | 175 | { |
176 | emit recurranceEnabled( ckbRecurrence->isChecked() ); | 176 | emit recurranceEnabled( ckbRecurrence->isChecked() ); |
177 | } | 177 | } |