Diffstat (limited to 'core/pim/todo/newtaskdlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/todo/newtaskdlg.cpp | 56 |
1 files changed, 29 insertions, 27 deletions
diff --git a/core/pim/todo/newtaskdlg.cpp b/core/pim/todo/newtaskdlg.cpp index 0b5a29d..68a0d24 100644 --- a/core/pim/todo/newtaskdlg.cpp +++ b/core/pim/todo/newtaskdlg.cpp | |||
@@ -1,78 +1,80 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | This file is part of the Opie Project |
3 | .=l. Copyright (c) 2005 Dan Williams <drw@handhelds.org> | 3 | |
4 | .>+-= | 4 | Copyright (C) Opie Team <opie-devel@handhelds.org> |
5 | _;:, .> :=|. This program is free software; you can | 5 | =. |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .=l. |
7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 7 | .>+-= |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | _;:, .> :=|. This program is free software; you can |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | ._= =} : or (at your option) any later version. | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | .%`+i> _;_. | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | .i_,=:_. -<s. This program is distributed in the hope that | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | ._= =} : or (at your option) any later version. |
14 | : .. .:, . . . without even the implied warranty of | 14 | .%`+i> _;_. |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | ..}^=.= = ; Library General Public License for more | 17 | : .. .:, . . . without even the implied warranty of |
18 | ++= -. .` .: details. | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | : = ...= . :.=- | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | -. .:....=;==+<; You should have received a copy of the GNU | 20 | ..}^=.= = ; Library General Public License for more |
21 | -_. . . )=. = General Public License along with | 21 | ++= -. .` .: details. |
22 | -- :-=` this library; see the file COPYING.LIB. | 22 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
23 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
24 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
26 | |||
27 | */ | 29 | */ |
28 | 30 | ||
29 | #include "newtaskdlg.h" | 31 | #include "newtaskdlg.h" |
30 | 32 | ||
31 | #include <qbuttongroup.h> | 33 | #include <qbuttongroup.h> |
32 | #include <qcombobox.h> | 34 | #include <qcombobox.h> |
33 | #include <qlayout.h> | 35 | #include <qlayout.h> |
34 | #include <qradiobutton.h> | 36 | #include <qradiobutton.h> |
35 | 37 | ||
36 | NewTaskDlg::NewTaskDlg( const QStringList &templates, QWidget *parent ) | 38 | NewTaskDlg::NewTaskDlg( const QStringList &templates, QWidget *parent ) |
37 | : QDialog( parent, QString::null, true, WStyle_ContextHelp ) | 39 | : QDialog( parent, QString::null, true, WStyle_ContextHelp ) |
38 | { | 40 | { |
39 | setCaption( tr( "New Task" ) ); | 41 | setCaption( tr( "New Task" ) ); |
40 | 42 | ||
41 | QButtonGroup *bg = new QButtonGroup( this ); | 43 | QButtonGroup *bg = new QButtonGroup( this ); |
42 | bg->hide(); | 44 | bg->hide(); |
43 | 45 | ||
44 | QVBoxLayout *layout = new QVBoxLayout( this, 10, 3 ); | 46 | QVBoxLayout *layout = new QVBoxLayout( this, 10, 3 ); |
45 | 47 | ||
46 | QRadioButton *btn = new QRadioButton( tr( "Blank task" ), this ); | 48 | QRadioButton *btn = new QRadioButton( tr( "Blank task" ), this ); |
47 | btn->setChecked( true ); | 49 | btn->setChecked( true ); |
48 | bg->insert( btn ); | 50 | bg->insert( btn ); |
49 | layout->addWidget( btn ); | 51 | layout->addWidget( btn ); |
50 | 52 | ||
51 | layout->addStretch(); | 53 | layout->addStretch(); |
52 | 54 | ||
53 | m_useTemplate = new QRadioButton( tr( "Using template:" ), this ); | 55 | m_useTemplate = new QRadioButton( tr( "Using template:" ), this ); |
54 | connect( m_useTemplate, SIGNAL(toggled(bool)), this, SLOT(slotUseTemplate(bool)) ); | 56 | connect( m_useTemplate, SIGNAL(toggled(bool)), this, SLOT(slotUseTemplate(bool)) ); |
55 | bg->insert( m_useTemplate ); | 57 | bg->insert( m_useTemplate ); |
56 | layout->addWidget( m_useTemplate ); | 58 | layout->addWidget( m_useTemplate ); |
57 | 59 | ||
58 | m_templateList = new QComboBox( this ); | 60 | m_templateList = new QComboBox( this ); |
59 | m_templateList->insertStringList( templates ); | 61 | m_templateList->insertStringList( templates ); |
60 | m_templateList->setEnabled( false ); | 62 | m_templateList->setEnabled( false ); |
61 | layout->addWidget( m_templateList ); | 63 | layout->addWidget( m_templateList ); |
62 | 64 | ||
63 | layout->addStretch(); | 65 | layout->addStretch(); |
64 | } | 66 | } |
65 | 67 | ||
66 | QString NewTaskDlg::tempSelected() { | 68 | QString NewTaskDlg::tempSelected() { |
67 | QString tempStr; | 69 | QString tempStr; |
68 | if ( m_useTemplate->isChecked() ) | 70 | if ( m_useTemplate->isChecked() ) |
69 | tempStr = m_templateList->currentText(); | 71 | tempStr = m_templateList->currentText(); |
70 | 72 | ||
71 | return tempStr; | 73 | return tempStr; |
72 | } | 74 | } |
73 | 75 | ||
74 | void NewTaskDlg::slotUseTemplate( bool on ) { | 76 | void NewTaskDlg::slotUseTemplate( bool on ) { |
75 | m_templateList->setEnabled( on ); | 77 | m_templateList->setEnabled( on ); |
76 | if ( on ) | 78 | if ( on ) |
77 | m_templateList->setFocus(); | 79 | m_templateList->setFocus(); |
78 | } | 80 | } |