Diffstat (limited to 'korganizer/savetemplatedialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/savetemplatedialog.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/korganizer/savetemplatedialog.cpp b/korganizer/savetemplatedialog.cpp index 3544081..35bedba 100644 --- a/korganizer/savetemplatedialog.cpp +++ b/korganizer/savetemplatedialog.cpp | |||
@@ -1,71 +1,74 @@ | |||
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 | //Added by qt3to4: | ||
26 | #include <Q3VBoxLayout> | ||
27 | #include <Q3Frame> | ||
25 | 28 | ||
26 | #include <keditlistbox.h> | 29 | #include <keditlistbox.h> |
27 | #include <klocale.h> | 30 | #include <klocale.h> |
28 | 31 | ||
29 | #include "koprefs.h" | 32 | #include "koprefs.h" |
30 | 33 | ||
31 | #include "savetemplatedialog.h" | 34 | #include "savetemplatedialog.h" |
32 | 35 | ||
33 | SaveTemplateDialog::SaveTemplateDialog( IncidenceType type, QWidget *parent ) | 36 | SaveTemplateDialog::SaveTemplateDialog( IncidenceType type, QWidget *parent ) |
34 | : KDialogBase( Plain, i18n("Save Template"), Ok | Cancel, Ok, parent, 0, | 37 | : KDialogBase( Plain, i18n("Save Template"), Ok | Cancel, Ok, parent, 0, |
35 | true, false ), | 38 | true, false ), |
36 | mType( type ) | 39 | mType( type ) |
37 | { | 40 | { |
38 | QFrame *topFrame = plainPage(); | 41 | Q3Frame *topFrame = plainPage(); |
39 | QVBoxLayout *topLayout = new QVBoxLayout( topFrame, 0, spacingHint() ); | 42 | Q3VBoxLayout *topLayout = new Q3VBoxLayout( topFrame, 0, spacingHint() ); |
40 | 43 | ||
41 | mEditListBox = new KEditListBox( i18n("Select Template Name"), topFrame, | 44 | mEditListBox = new KEditListBox( i18n("Select Template Name"), topFrame, |
42 | 0, false, KEditListBox::Add | | 45 | 0, false, KEditListBox::Add | |
43 | KEditListBox::Remove ); | 46 | KEditListBox::Remove ); |
44 | topLayout->addWidget( mEditListBox ); | 47 | topLayout->addWidget( mEditListBox ); |
45 | connect( mEditListBox, SIGNAL( changed() ), SLOT( slotChanged() ) ); | 48 | connect( mEditListBox, SIGNAL( changed() ), SLOT( slotChanged() ) ); |
46 | 49 | ||
47 | QStringList templates; | 50 | QStringList templates; |
48 | 51 | ||
49 | if ( mType == EventType ) { | 52 | if ( mType == EventType ) { |
50 | templates = KOPrefs::instance()->mEventTemplates; | 53 | templates = KOPrefs::instance()->mEventTemplates; |
51 | } else if( mType == TodoType ) { | 54 | } else if( mType == TodoType ) { |
52 | templates = KOPrefs::instance()->mTodoTemplates; | 55 | templates = KOPrefs::instance()->mTodoTemplates; |
53 | } | 56 | } |
54 | 57 | ||
55 | mEditListBox->insertStringList( templates ); | 58 | mEditListBox->insertStringList( templates ); |
56 | } | 59 | } |
57 | 60 | ||
58 | SaveTemplateDialog::~SaveTemplateDialog() | 61 | SaveTemplateDialog::~SaveTemplateDialog() |
59 | { | 62 | { |
60 | } | 63 | } |
61 | 64 | ||
62 | void SaveTemplateDialog::slotOk() | 65 | void SaveTemplateDialog::slotOk() |
63 | { | 66 | { |
64 | emit templateSelected( mEditListBox->currentText() ); | 67 | emit templateSelected( mEditListBox->currentText() ); |
65 | accept(); | 68 | accept(); |
66 | } | 69 | } |
67 | 70 | ||
68 | void SaveTemplateDialog::slotChanged() | 71 | void SaveTemplateDialog::slotChanged() |
69 | { | 72 | { |
70 | if ( mType == EventType ) { | 73 | if ( mType == EventType ) { |
71 | KOPrefs::instance()->mEventTemplates = mEditListBox->items(); | 74 | KOPrefs::instance()->mEventTemplates = mEditListBox->items(); |