Diffstat (limited to 'kabc/plugins/file/resourcefileconfig.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kabc/plugins/file/resourcefileconfig.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kabc/plugins/file/resourcefileconfig.cpp b/kabc/plugins/file/resourcefileconfig.cpp index b63775d..70b0bac 100644 --- a/kabc/plugins/file/resourcefileconfig.cpp +++ b/kabc/plugins/file/resourcefileconfig.cpp | |||
@@ -1,101 +1,103 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkabc. | 2 | This file is part of libkabc. |
3 | Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library 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 GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /* | 21 | /* |
22 | Enhanced Version of the file for platform independent KDE tools. | 22 | Enhanced Version of the file for platform independent KDE tools. |
23 | Copyright (c) 2004 Ulf Schenk | 23 | Copyright (c) 2004 Ulf Schenk |
24 | 24 | ||
25 | $Id$ | 25 | $Id$ |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include <qlabel.h> | 28 | #include <qlabel.h> |
29 | #include <qlayout.h> | 29 | #include <qlayout.h> |
30 | #include <qfileinfo.h> | 30 | #include <qfileinfo.h> |
31 | //Added by qt3to4: | ||
32 | #include <Q3GridLayout> | ||
31 | 33 | ||
32 | #include <kdebug.h> | 34 | #include <kdebug.h> |
33 | #include <klocale.h> | 35 | #include <klocale.h> |
34 | #include <kstandarddirs.h> | 36 | #include <kstandarddirs.h> |
35 | #include <kdialog.h> | 37 | #include <kdialog.h> |
36 | #ifndef _WIN32_ | 38 | #ifndef _WIN32_ |
37 | #include <unistd.h> | 39 | #include <unistd.h> |
38 | #endif | 40 | #endif |
39 | //US #include "formatfactory.h" | 41 | //US #include "formatfactory.h" |
40 | #include <qfile.h> | 42 | #include <qfile.h> |
41 | #include "resourcefile.h" | 43 | #include "resourcefile.h" |
42 | #include "stdaddressbook.h" | 44 | #include "stdaddressbook.h" |
43 | 45 | ||
44 | #include "resourcefileconfig.h" | 46 | #include "resourcefileconfig.h" |
45 | 47 | ||
46 | using namespace KABC; | 48 | using namespace KABC; |
47 | 49 | ||
48 | ResourceFileConfig::ResourceFileConfig( QWidget* parent, const char* name ) | 50 | ResourceFileConfig::ResourceFileConfig( QWidget* parent, const char* name ) |
49 | : ConfigWidget( parent, name ) | 51 | : ConfigWidget( parent, name ) |
50 | { | 52 | { |
51 | //qDebug("ResourceFileConfig::ResourceFileConfig"); | 53 | //qDebug("ResourceFileConfig::ResourceFileConfig"); |
52 | 54 | ||
53 | QGridLayout *mainLayout = new QGridLayout( this, 2, 2, 0, | 55 | Q3GridLayout *mainLayout = new Q3GridLayout( this, 2, 2, 0, |
54 | KDialog::spacingHint() ); | 56 | KDialog::spacingHint() ); |
55 | 57 | ||
56 | QLabel *label = new QLabel( i18n( "Format:" ), this ); | 58 | QLabel *label = new QLabel( i18n( "Format:" ), this ); |
57 | mFormatBox = new KComboBox( this ); | 59 | mFormatBox = new KComboBox( this ); |
58 | 60 | ||
59 | mainLayout->addWidget( label, 0, 0 ); | 61 | mainLayout->addWidget( label, 0, 0 ); |
60 | mainLayout->addWidget( mFormatBox, 0, 1 ); | 62 | mainLayout->addWidget( mFormatBox, 0, 1 ); |
61 | 63 | ||
62 | label = new QLabel( i18n( "Location:" ), this ); | 64 | label = new QLabel( i18n( "Location:" ), this ); |
63 | mFileNameEdit = new KURLRequester( this ); | 65 | mFileNameEdit = new KURLRequester( this ); |
64 | 66 | ||
65 | connect( mFileNameEdit, SIGNAL( textChanged( const QString & ) ), | 67 | connect( mFileNameEdit, SIGNAL( textChanged( const QString & ) ), |
66 | SLOT( checkFilePermissions( const QString & ) ) ); | 68 | SLOT( checkFilePermissions( const QString & ) ) ); |
67 | 69 | ||
68 | mainLayout->addWidget( label, 1, 0 ); | 70 | mainLayout->addWidget( label, 1, 0 ); |
69 | mainLayout->addWidget( mFileNameEdit, 1, 1 ); | 71 | mainLayout->addWidget( mFileNameEdit, 1, 1 ); |
70 | 72 | ||
71 | 73 | ||
72 | /*US lets hardcode the formats instead of using a factory | 74 | /*US lets hardcode the formats instead of using a factory |
73 | FormatFactory *factory = FormatFactory::self(); | 75 | FormatFactory *factory = FormatFactory::self(); |
74 | QStringList formats = factory->formats(); | 76 | QStringList formats = factory->formats(); |
75 | QStringList::Iterator it; | 77 | QStringList::Iterator it; |
76 | 78 | ||
77 | for ( it = formats.begin(); it != formats.end(); ++it ) { | 79 | for ( it = formats.begin(); it != formats.end(); ++it ) { |
78 | FormatInfo *info = factory->info( *it ); | 80 | FormatInfo *info = factory->info( *it ); |
79 | if ( info ) { | 81 | if ( info ) { |
80 | mFormatTypes << (*it); | 82 | mFormatTypes << (*it); |
81 | mFormatBox->insertItem( info->nameLabel ); | 83 | mFormatBox->insertItem( info->nameLabel ); |
82 | } | 84 | } |
83 | } | 85 | } |
84 | */ | 86 | */ |
85 | mFormatTypes << "vcard"; | 87 | mFormatTypes << "vcard"; |
86 | mFormatTypes << "binary"; | 88 | mFormatTypes << "binary"; |
87 | mFormatBox->insertItem( "vcard" ); | 89 | mFormatBox->insertItem( "vcard" ); |
88 | mFormatBox->insertItem( "binary" ); | 90 | mFormatBox->insertItem( "binary" ); |
89 | 91 | ||
90 | mInEditMode = false; | 92 | mInEditMode = false; |
91 | } | 93 | } |
92 | 94 | ||
93 | void ResourceFileConfig::setEditMode( bool value ) | 95 | void ResourceFileConfig::setEditMode( bool value ) |
94 | { | 96 | { |
95 | mFormatBox->setEnabled( !value ); | 97 | mFormatBox->setEnabled( !value ); |
96 | mInEditMode = value; | 98 | mInEditMode = value; |
97 | } | 99 | } |
98 | 100 | ||
99 | void ResourceFileConfig::loadSettings( KRES::Resource *res ) | 101 | void ResourceFileConfig::loadSettings( KRES::Resource *res ) |
100 | { | 102 | { |
101 | //US ResourceFile *resource = dynamic_cast<ResourceFile*>( res ); | 103 | //US ResourceFile *resource = dynamic_cast<ResourceFile*>( res ); |