-rw-r--r-- | core/pim/todo/taskeditorstatus.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/pim/todo/taskeditorstatus.cpp b/core/pim/todo/taskeditorstatus.cpp index 9a5fe7a..b11fdab 100644 --- a/core/pim/todo/taskeditorstatus.cpp +++ b/core/pim/todo/taskeditorstatus.cpp | |||
@@ -1,142 +1,145 @@ | |||
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 "taskeditorstatus.h" | 29 | #include "taskeditorstatus.h" |
30 | 30 | ||
31 | #include <opie/otodo.h> | 31 | #include <opie/otodo.h> |
32 | #include <opie/opimmaintainer.h> | 32 | #include <opie/opimmaintainer.h> |
33 | #include <opie/opimstate.h> | 33 | #include <opie/opimstate.h> |
34 | 34 | ||
35 | #include <qpe/datebookmonth.h> | 35 | #include <qpe/datebookmonth.h> |
36 | #include <qpe/resource.h> | 36 | #include <qpe/resource.h> |
37 | #include <qpe/timestring.h> | 37 | #include <qpe/timestring.h> |
38 | 38 | ||
39 | #include <qcheckbox.h> | 39 | #include <qcheckbox.h> |
40 | #include <qcombobox.h> | 40 | #include <qcombobox.h> |
41 | #include <qlabel.h> | 41 | #include <qlabel.h> |
42 | #include <qlayout.h> | 42 | #include <qlayout.h> |
43 | #include <qscrollview.h> | 43 | #include <qscrollview.h> |
44 | #include <qtoolbutton.h> | 44 | #include <qtoolbutton.h> |
45 | #include <qwhatsthis.h> | 45 | #include <qwhatsthis.h> |
46 | 46 | ||
47 | // FIXME add the hack slots instead of setPopup!!!! | ||
48 | // drw you shouldn't have removed them | ||
49 | |||
47 | TaskEditorStatus::TaskEditorStatus( QWidget* parent, const char* name, WFlags fl ) | 50 | TaskEditorStatus::TaskEditorStatus( QWidget* parent, const char* name, WFlags fl ) |
48 | : QWidget( parent, name, fl ) | 51 | : QWidget( parent, name, fl ) |
49 | { | 52 | { |
50 | QDate curDate = QDate::currentDate(); | 53 | QDate curDate = QDate::currentDate(); |
51 | m_start = m_comp = m_due = curDate; | 54 | m_start = m_comp = m_due = curDate; |
52 | QString curDateStr = TimeString::longDateString( curDate ); | 55 | QString curDateStr = TimeString::longDateString( curDate ); |
53 | 56 | ||
54 | QVBoxLayout *vb = new QVBoxLayout( this ); | 57 | QVBoxLayout *vb = new QVBoxLayout( this ); |
55 | 58 | ||
56 | QScrollView *sv = new QScrollView( this ); | 59 | QScrollView *sv = new QScrollView( this ); |
57 | vb->addWidget( sv ); | 60 | vb->addWidget( sv ); |
58 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 61 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
59 | sv->setFrameStyle( QFrame::NoFrame ); | 62 | sv->setFrameStyle( QFrame::NoFrame ); |
60 | 63 | ||
61 | QWidget *container = new QWidget( sv->viewport() ); | 64 | QWidget *container = new QWidget( sv->viewport() ); |
62 | sv->addChild( container ); | 65 | sv->addChild( container ); |
63 | 66 | ||
64 | QGridLayout *layout = new QGridLayout( container, 7, 3, 4, 4 ); | 67 | QGridLayout *layout = new QGridLayout( container, 7, 3, 4, 4 ); |
65 | 68 | ||
66 | // Status | 69 | // Status |
67 | QLabel *label = new QLabel( tr( "Status:" ), container ); | 70 | QLabel *label = new QLabel( tr( "Status:" ), container ); |
68 | layout->addWidget( label, 0, 0 ); | 71 | layout->addWidget( label, 0, 0 ); |
69 | QWhatsThis::add( label, tr( "Click here to set the current status of this task." ) ); | 72 | QWhatsThis::add( label, tr( "Click here to set the current status of this task." ) ); |
70 | cmbStatus = new QComboBox( FALSE, container ); | 73 | cmbStatus = new QComboBox( FALSE, container ); |
71 | cmbStatus->insertItem( tr( "Started" ) ); | 74 | cmbStatus->insertItem( tr( "Started" ) ); |
72 | cmbStatus->insertItem( tr( "Postponed" ) ); | 75 | cmbStatus->insertItem( tr( "Postponed" ) ); |
73 | cmbStatus->insertItem( tr( "Finished" ) ); | 76 | cmbStatus->insertItem( tr( "Finished" ) ); |
74 | cmbStatus->insertItem( tr( "Not started" ) ); | 77 | cmbStatus->insertItem( tr( "Not started" ) ); |
75 | layout->addMultiCellWidget( cmbStatus, 0, 0, 1, 2 ); | 78 | layout->addMultiCellWidget( cmbStatus, 0, 0, 1, 2 ); |
76 | QWhatsThis::add( cmbStatus, tr( "Click here to set the current status of this task." ) ); | 79 | QWhatsThis::add( cmbStatus, tr( "Click here to set the current status of this task." ) ); |
77 | 80 | ||
78 | // Progress | 81 | // Progress |
79 | label = new QLabel( tr( "Progress:" ), container ); | 82 | label = new QLabel( tr( "Progress:" ), container ); |
80 | layout->addWidget( label, 1, 0 ); | 83 | layout->addWidget( label, 1, 0 ); |
81 | QWhatsThis::add( label, tr( "Select progress made on this task here." ) ); | 84 | QWhatsThis::add( label, tr( "Select progress made on this task here." ) ); |
82 | cmbProgress = new QComboBox( FALSE, container ); | 85 | cmbProgress = new QComboBox( FALSE, container ); |
83 | cmbProgress->insertItem( tr( "0 %" ) ); | 86 | cmbProgress->insertItem( tr( "0 %" ) ); |
84 | cmbProgress->insertItem( tr( "20 %" ) ); | 87 | cmbProgress->insertItem( tr( "20 %" ) ); |
85 | cmbProgress->insertItem( tr( "40 %" ) ); | 88 | cmbProgress->insertItem( tr( "40 %" ) ); |
86 | cmbProgress->insertItem( tr( "60 %" ) ); | 89 | cmbProgress->insertItem( tr( "60 %" ) ); |
87 | cmbProgress->insertItem( tr( "80 %" ) ); | 90 | cmbProgress->insertItem( tr( "80 %" ) ); |
88 | cmbProgress->insertItem( tr( "100 %" ) ); | 91 | cmbProgress->insertItem( tr( "100 %" ) ); |
89 | layout->addMultiCellWidget( cmbProgress, 1, 1, 1, 2 ); | 92 | layout->addMultiCellWidget( cmbProgress, 1, 1, 1, 2 ); |
90 | QWhatsThis::add( cmbProgress, tr( "Select progress made on this task here." ) ); | 93 | QWhatsThis::add( cmbProgress, tr( "Select progress made on this task here." ) ); |
91 | 94 | ||
92 | // Start date | 95 | // Start date |
93 | ckbStart = new QCheckBox( tr( "Start Date:" ), container ); | 96 | ckbStart = new QCheckBox( tr( "Start Date:" ), container ); |
94 | layout->addWidget( ckbStart, 2, 0 ); | 97 | layout->addWidget( ckbStart, 2, 0 ); |
95 | QWhatsThis::add( ckbStart, tr( "Click here to set the date this task was started." ) ); | 98 | QWhatsThis::add( ckbStart, tr( "Click here to set the date this task was started." ) ); |
96 | connect( ckbStart, SIGNAL( clicked() ), this, SLOT( slotStartChecked() ) ); | 99 | connect( ckbStart, SIGNAL( clicked() ), this, SLOT( slotStartChecked() ) ); |
97 | btnStart = new QPushButton( curDateStr, container ); | 100 | btnStart = new QPushButton( curDateStr, container ); |
98 | btnStart->setEnabled( FALSE ); | 101 | btnStart->setEnabled( FALSE ); |
99 | layout->addMultiCellWidget( btnStart, 2, 2, 1, 2 ); | 102 | layout->addMultiCellWidget( btnStart, 2, 2, 1, 2 ); |
100 | QWhatsThis::add( btnStart, tr( "Click here to set the date this task was started." ) ); | 103 | QWhatsThis::add( btnStart, tr( "Click here to set the date this task was started." ) ); |
101 | QPopupMenu *popup = new QPopupMenu( this ); | 104 | QPopupMenu *popup = new QPopupMenu( this ); |
102 | m_startBook = new DateBookMonth( popup, 0, TRUE ); | 105 | m_startBook = new DateBookMonth( popup, 0, TRUE ); |
103 | popup->insertItem( m_startBook ); | 106 | popup->insertItem( m_startBook ); |
104 | btnStart->setPopup( popup ); | 107 | btnStart->setPopup( popup ); |
105 | connect( m_startBook, SIGNAL( dateClicked( int, int, int ) ), | 108 | connect( m_startBook, SIGNAL( dateClicked( int, int, int ) ), |
106 | this, SLOT( slotStartChanged( int, int, int ) ) ); | 109 | this, SLOT( slotStartChanged( int, int, int ) ) ); |
107 | 110 | ||
108 | // Due date | 111 | // Due date |
109 | ckbDue = new QCheckBox( tr( "Due Date:" ), container ); | 112 | ckbDue = new QCheckBox( tr( "Due Date:" ), container ); |
110 | layout->addWidget( ckbDue, 3, 0 ); | 113 | layout->addWidget( ckbDue, 3, 0 ); |
111 | QWhatsThis::add( ckbDue, tr( "Click here to set the date this task needs to be completed by." ) ); | 114 | QWhatsThis::add( ckbDue, tr( "Click here to set the date this task needs to be completed by." ) ); |
112 | connect( ckbDue, SIGNAL( clicked() ), this, SLOT( slotDueChecked() ) ); | 115 | connect( ckbDue, SIGNAL( clicked() ), this, SLOT( slotDueChecked() ) ); |
113 | btnDue = new QPushButton( curDateStr, container ); | 116 | btnDue = new QPushButton( curDateStr, container ); |
114 | btnDue->setEnabled( FALSE ); | 117 | btnDue->setEnabled( FALSE ); |
115 | layout->addMultiCellWidget( btnDue, 3, 3, 1, 2 ); | 118 | layout->addMultiCellWidget( btnDue, 3, 3, 1, 2 ); |
116 | QWhatsThis::add( btnDue, tr( "Click here to set the date this task needs to be completed by." ) ); | 119 | QWhatsThis::add( btnDue, tr( "Click here to set the date this task needs to be completed by." ) ); |
117 | popup = new QPopupMenu( this ); | 120 | popup = new QPopupMenu( this ); |
118 | m_dueBook = new DateBookMonth( popup, 0, TRUE ); | 121 | m_dueBook = new DateBookMonth( popup, 0, TRUE ); |
119 | popup->insertItem( m_dueBook ); | 122 | popup->insertItem( m_dueBook ); |
120 | btnDue->setPopup( popup ); | 123 | btnDue->setPopup( popup ); |
121 | connect( m_dueBook, SIGNAL( dateClicked( int, int, int ) ), | 124 | connect( m_dueBook, SIGNAL( dateClicked( int, int, int ) ), |
122 | this, SLOT( slotDueChanged( int, int, int ) ) ); | 125 | this, SLOT( slotDueChanged( int, int, int ) ) ); |
123 | 126 | ||
124 | // Completed | 127 | // Completed |
125 | ckbComp = new QCheckBox( tr( "Completed:" ), container ); | 128 | ckbComp = new QCheckBox( tr( "Completed:" ), container ); |
126 | layout->addWidget( ckbComp, 4, 0 ); | 129 | layout->addWidget( ckbComp, 4, 0 ); |
127 | QWhatsThis::add( ckbComp, tr( "Click here to mark this task as completed." ) ); | 130 | QWhatsThis::add( ckbComp, tr( "Click here to mark this task as completed." ) ); |
128 | connect( ckbComp, SIGNAL( clicked() ), this, SLOT( slotCompChecked() ) ); | 131 | connect( ckbComp, SIGNAL( clicked() ), this, SLOT( slotCompChecked() ) ); |
129 | btnComp = new QPushButton( curDateStr, container ); | 132 | btnComp = new QPushButton( curDateStr, container ); |
130 | btnComp->setEnabled( FALSE ); | 133 | btnComp->setEnabled( FALSE ); |
131 | layout->addMultiCellWidget( btnComp, 4, 4, 1, 2 ); | 134 | layout->addMultiCellWidget( btnComp, 4, 4, 1, 2 ); |
132 | QWhatsThis::add( btnComp, tr( "Click here to set the date this task was completed." ) ); | 135 | QWhatsThis::add( btnComp, tr( "Click here to set the date this task was completed." ) ); |
133 | popup = new QPopupMenu( this ); | 136 | popup = new QPopupMenu( this ); |
134 | m_compBook = new DateBookMonth( popup, 0, TRUE ); | 137 | m_compBook = new DateBookMonth( popup, 0, TRUE ); |
135 | popup->insertItem( m_compBook ); | 138 | popup->insertItem( m_compBook ); |
136 | btnComp->setPopup( popup ); | 139 | btnComp->setPopup( popup ); |
137 | connect( m_compBook, SIGNAL( dateClicked( int, int, int ) ), | 140 | connect( m_compBook, SIGNAL( dateClicked( int, int, int ) ), |
138 | this, SLOT( slotCompChanged( int, int, int ) ) ); | 141 | this, SLOT( slotCompChanged( int, int, int ) ) ); |
139 | 142 | ||
140 | QSpacerItem *spacer = new QSpacerItem( 5, 5, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding ); | 143 | QSpacerItem *spacer = new QSpacerItem( 5, 5, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding ); |
141 | layout->addItem( spacer, 5, 0 ); | 144 | layout->addItem( spacer, 5, 0 ); |
142 | 145 | ||