summaryrefslogtreecommitdiffabout
path: root/microkde/kresources
Unidiff
Diffstat (limited to 'microkde/kresources') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kresources/configpage.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/microkde/kresources/configpage.cpp b/microkde/kresources/configpage.cpp
index 011e47e..fc7a42e 100644
--- a/microkde/kresources/configpage.cpp
+++ b/microkde/kresources/configpage.cpp
@@ -1,131 +1,135 @@
1/* 1/*
2 This file is part of libkresources. 2 This file is part of libkresources.
3 3
4 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> 4 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org>
5 Copyright (c) 2002 Jan-Pascal van Best <janpascal@vanbest.org> 5 Copyright (c) 2002 Jan-Pascal van Best <janpascal@vanbest.org>
6 Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org> 6 Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version. 11 version 2 of the License, or (at your option) any later version.
12 12
13 This library is distributed in the hope that it will be useful, 13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Library General Public License for more details. 16 Library General Public License for more details.
17 17
18 You should have received a copy of the GNU Library General Public License 18 You should have received a copy of the GNU Library General Public License
19 along with this library; see the file COPYING.LIB. If not, write to 19 along with this library; see the file COPYING.LIB. If not, write to
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. 21 Boston, MA 02111-1307, USA.
22*/ 22*/
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include <qgroupbox.h> 31#include <qgroupbox.h>
32
33#ifdef DESKTOP_VERSION
32#include <qinputdialog.h> 34#include <qinputdialog.h>
35#else
36#include <qtcompat/qinputdialog.h>
37#endif
33#include <qlabel.h> 38#include <qlabel.h>
34#include <qlayout.h> 39#include <qlayout.h>
35
36#include <kapplication.h> 40#include <kapplication.h>
37#include <kcombobox.h> 41#include <kcombobox.h>
38#include <kdebug.h> 42#include <kdebug.h>
39#include <klocale.h> 43#include <klocale.h>
40#include <kmessagebox.h> 44#include <kmessagebox.h>
41#include <ksimpleconfig.h> 45#include <ksimpleconfig.h>
42#include <kstandarddirs.h> 46#include <kstandarddirs.h>
43#include <kurlrequester.h> 47#include <kurlrequester.h>
44#include <klistview.h> 48#include <klistview.h>
45#include <kbuttonbox.h> 49#include <kbuttonbox.h>
46//US #include <ktrader.h> 50//US #include <ktrader.h>
47 51
48#include "resource.h" 52#include "resource.h"
49#include "configdialog.h" 53#include "configdialog.h"
50 54
51#include "configpage.h" 55#include "configpage.h"
52 56
53//US 57//US
54#include <qpushbutton.h> 58#include <qpushbutton.h>
55#include <qfile.h> 59#include <qfile.h>
56#include <kglobal.h> 60#include <kglobal.h>
57 61
58using namespace KRES; 62using namespace KRES;
59 63
60class ConfigViewItem : public QCheckListItem 64class ConfigViewItem : public QCheckListItem
61{ 65{
62 public: 66 public:
63 ConfigViewItem( QListView *parent, Resource* resource ) : 67 ConfigViewItem( QListView *parent, Resource* resource ) :
64 QCheckListItem( parent, resource->resourceName(), CheckBox ), 68 QCheckListItem( parent, resource->resourceName(), CheckBox ),
65 mResource( resource ), 69 mResource( resource ),
66 mIsStandard( false ) 70 mIsStandard( false )
67 { 71 {
68 setText( 1, mResource->type() ); 72 setText( 1, mResource->type() );
69 setOn( mResource->isActive() ); 73 setOn( mResource->isActive() );
70 } 74 }
71 75
72 void setStandard( bool value ) 76 void setStandard( bool value )
73 { 77 {
74 setText( 2, ( value ? i18n( "Yes" ) : QString::null ) ); 78 setText( 2, ( value ? i18n( "Yes" ) : QString::null ) );
75 mIsStandard = value; 79 mIsStandard = value;
76 } 80 }
77 81
78 bool standard() const { return mIsStandard; } 82 bool standard() const { return mIsStandard; }
79 bool readOnly() const { return mResource->readOnly(); } 83 bool readOnly() const { return mResource->readOnly(); }
80 84
81 Resource *resource() { return mResource; } 85 Resource *resource() { return mResource; }
82 86
83 private: 87 private:
84 Resource* mResource; 88 Resource* mResource;
85 89
86 bool mIsStandard; 90 bool mIsStandard;
87}; 91};
88 92
89ConfigPage::ConfigPage( QWidget *parent, const char *name ) 93ConfigPage::ConfigPage( QWidget *parent, const char *name )
90 : QWidget( parent, name ), 94 : QWidget( parent, name ),
91 mCurrentManager( 0 ), 95 mCurrentManager( 0 ),
92 mCurrentConfig( 0 ) 96 mCurrentConfig( 0 )
93{ 97{
94 setCaption( i18n( "Resource Configuration" ) ); 98 setCaption( i18n( "Resource Configuration" ) );
95 99
96 QVBoxLayout *mainLayout = new QVBoxLayout( this ); 100 QVBoxLayout *mainLayout = new QVBoxLayout( this );
97 101
98 QGroupBox *groupBox = new QGroupBox( i18n( "Resources" ), this ); 102 QGroupBox *groupBox = new QGroupBox( i18n( "Resources" ), this );
99 groupBox->setColumnLayout(0, Qt::Vertical ); 103 groupBox->setColumnLayout(0, Qt::Vertical );
100 groupBox->layout()->setSpacing( 3 ); 104 groupBox->layout()->setSpacing( 3 );
101 groupBox->layout()->setMargin( 5 ); 105 groupBox->layout()->setMargin( 5 );
102 QGridLayout *groupBoxLayout = new QGridLayout( groupBox->layout(), 4, 2 ); 106 QGridLayout *groupBoxLayout = new QGridLayout( groupBox->layout(), 4, 2 );
103 107
104//US mFamilyCombo = new KComboBox( false, groupBox ); 108//US mFamilyCombo = new KComboBox( false, groupBox );
105 mFamilyCombo = new KComboBox( groupBox ); 109 mFamilyCombo = new KComboBox( groupBox );
106 groupBoxLayout->addMultiCellWidget( mFamilyCombo, 0, 0, 0, 1 ); 110 groupBoxLayout->addMultiCellWidget( mFamilyCombo, 0, 0, 0, 1 );
107 111
108 mListView = new KListView( groupBox ); 112 mListView = new KListView( groupBox );
109 mListView->setAllColumnsShowFocus( true ); 113 mListView->setAllColumnsShowFocus( true );
110 mListView->addColumn( i18n( "Name" ) ); 114 mListView->addColumn( i18n( "Name" ) );
111 mListView->addColumn( i18n( "Type" ) ); 115 mListView->addColumn( i18n( "Type" ) );
112 mListView->addColumn( i18n( "Standard" ) ); 116 mListView->addColumn( i18n( "Standard" ) );
113 117
114//US groupBoxLayout->addWidget( mListView, 1, 0 ); 118//US groupBoxLayout->addWidget( mListView, 1, 0 );
115 groupBoxLayout->addMultiCellWidget( mListView, 1, 1, 0, 1 ); 119 groupBoxLayout->addMultiCellWidget( mListView, 1, 1, 0, 1 );
116 120
117 121
118 mAddButton = new QPushButton( i18n( "&Add..." ), groupBox ); 122 mAddButton = new QPushButton( i18n( "&Add..." ), groupBox );
119 groupBoxLayout->addWidget( mAddButton, 2, 0 ); 123 groupBoxLayout->addWidget( mAddButton, 2, 0 );
120 mRemoveButton = new QPushButton( i18n( "&Remove" ), groupBox ); 124 mRemoveButton = new QPushButton( i18n( "&Remove" ), groupBox );
121 groupBoxLayout->addWidget( mRemoveButton, 2, 1 ); 125 groupBoxLayout->addWidget( mRemoveButton, 2, 1 );
122 mEditButton = new QPushButton( i18n( "&Edit..." ), groupBox ); 126 mEditButton = new QPushButton( i18n( "&Edit..." ), groupBox );
123 groupBoxLayout->addWidget( mEditButton, 3, 0 ); 127 groupBoxLayout->addWidget( mEditButton, 3, 0 );
124 mStandardButton = new QPushButton( i18n( "&Use as Standard" ), groupBox ); 128 mStandardButton = new QPushButton( i18n( "&Use as Standard" ), groupBox );
125 groupBoxLayout->addWidget( mStandardButton, 3, 1 ); 129 groupBoxLayout->addWidget( mStandardButton, 3, 1 );
126 130
127 mRemoveButton->setEnabled( false ); 131 mRemoveButton->setEnabled( false );
128 mEditButton->setEnabled( false ); 132 mEditButton->setEnabled( false );
129 mStandardButton->setEnabled( false ); 133 mStandardButton->setEnabled( false );
130 134
131 135