Diffstat (limited to 'korganizer/savetemplatedialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | korganizer/savetemplatedialog.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/korganizer/savetemplatedialog.cpp b/korganizer/savetemplatedialog.cpp index 0da524f..3544081 100644 --- a/korganizer/savetemplatedialog.cpp +++ b/korganizer/savetemplatedialog.cpp | |||
@@ -1,76 +1,75 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qlayout.h> | 24 | #include <qlayout.h> |
25 | 25 | ||
26 | #include <keditlistbox.h> | 26 | #include <keditlistbox.h> |
27 | #include <klocale.h> | 27 | #include <klocale.h> |
28 | 28 | ||
29 | #include "koprefs.h" | 29 | #include "koprefs.h" |
30 | 30 | ||
31 | #include "savetemplatedialog.h" | 31 | #include "savetemplatedialog.h" |
32 | #include "savetemplatedialog.moc" | ||
33 | 32 | ||
34 | SaveTemplateDialog::SaveTemplateDialog( IncidenceType type, QWidget *parent ) | 33 | SaveTemplateDialog::SaveTemplateDialog( IncidenceType type, QWidget *parent ) |
35 | : KDialogBase( Plain, i18n("Save Template"), Ok | Cancel, Ok, parent, 0, | 34 | : KDialogBase( Plain, i18n("Save Template"), Ok | Cancel, Ok, parent, 0, |
36 | true, false ), | 35 | true, false ), |
37 | mType( type ) | 36 | mType( type ) |
38 | { | 37 | { |
39 | QFrame *topFrame = plainPage(); | 38 | QFrame *topFrame = plainPage(); |
40 | QVBoxLayout *topLayout = new QVBoxLayout( topFrame, 0, spacingHint() ); | 39 | QVBoxLayout *topLayout = new QVBoxLayout( topFrame, 0, spacingHint() ); |
41 | 40 | ||
42 | mEditListBox = new KEditListBox( i18n("Select Template Name"), topFrame, | 41 | mEditListBox = new KEditListBox( i18n("Select Template Name"), topFrame, |
43 | 0, false, KEditListBox::Add | | 42 | 0, false, KEditListBox::Add | |
44 | KEditListBox::Remove ); | 43 | KEditListBox::Remove ); |
45 | topLayout->addWidget( mEditListBox ); | 44 | topLayout->addWidget( mEditListBox ); |
46 | connect( mEditListBox, SIGNAL( changed() ), SLOT( slotChanged() ) ); | 45 | connect( mEditListBox, SIGNAL( changed() ), SLOT( slotChanged() ) ); |
47 | 46 | ||
48 | QStringList templates; | 47 | QStringList templates; |
49 | 48 | ||
50 | if ( mType == EventType ) { | 49 | if ( mType == EventType ) { |
51 | templates = KOPrefs::instance()->mEventTemplates; | 50 | templates = KOPrefs::instance()->mEventTemplates; |
52 | } else if( mType == TodoType ) { | 51 | } else if( mType == TodoType ) { |
53 | templates = KOPrefs::instance()->mTodoTemplates; | 52 | templates = KOPrefs::instance()->mTodoTemplates; |
54 | } | 53 | } |
55 | 54 | ||
56 | mEditListBox->insertStringList( templates ); | 55 | mEditListBox->insertStringList( templates ); |
57 | } | 56 | } |
58 | 57 | ||
59 | SaveTemplateDialog::~SaveTemplateDialog() | 58 | SaveTemplateDialog::~SaveTemplateDialog() |
60 | { | 59 | { |
61 | } | 60 | } |
62 | 61 | ||
63 | void SaveTemplateDialog::slotOk() | 62 | void SaveTemplateDialog::slotOk() |
64 | { | 63 | { |
65 | emit templateSelected( mEditListBox->currentText() ); | 64 | emit templateSelected( mEditListBox->currentText() ); |
66 | accept(); | 65 | accept(); |
67 | } | 66 | } |
68 | 67 | ||
69 | void SaveTemplateDialog::slotChanged() | 68 | void SaveTemplateDialog::slotChanged() |
70 | { | 69 | { |
71 | if ( mType == EventType ) { | 70 | if ( mType == EventType ) { |
72 | KOPrefs::instance()->mEventTemplates = mEditListBox->items(); | 71 | KOPrefs::instance()->mEventTemplates = mEditListBox->items(); |
73 | } else if( mType == TodoType ) { | 72 | } else if( mType == TodoType ) { |
74 | KOPrefs::instance()->mTodoTemplates = mEditListBox->items(); | 73 | KOPrefs::instance()->mTodoTemplates = mEditListBox->items(); |
75 | } | 74 | } |
76 | } | 75 | } |