summaryrefslogtreecommitdiffabout
path: root/microkde
authorzautrix <zautrix>2004-09-15 10:22:55 (UTC)
committer zautrix <zautrix>2004-09-15 10:22:55 (UTC)
commitd4adafe41cf399585b8e35cb600ff35706d55ae0 (patch) (unidiff)
tree1becc87f6c40390fd73082996d18f71fb5e9c772 /microkde
parent8889ffd6f6958c3a1d07bafedcc8af5d786a1660 (diff)
downloadkdepimpi-d4adafe41cf399585b8e35cb600ff35706d55ae0.zip
kdepimpi-d4adafe41cf399585b8e35cb600ff35706d55ae0.tar.gz
kdepimpi-d4adafe41cf399585b8e35cb600ff35706d55ae0.tar.bz2
fixes for desktop version
Diffstat (limited to 'microkde') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kresources/configpage.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/microkde/kresources/configpage.cpp b/microkde/kresources/configpage.cpp
index 1a3a22c..02c5fb1 100644
--- a/microkde/kresources/configpage.cpp
+++ b/microkde/kresources/configpage.cpp
@@ -55,121 +55,121 @@ $Id$
55#include <qfile.h> 55#include <qfile.h>
56#include <kglobal.h> 56#include <kglobal.h>
57 57
58using namespace KRES; 58using namespace KRES;
59 59
60const QString ConfigPage::syncfamily = "syncprofiles"; 60const QString ConfigPage::syncfamily = "syncprofiles";
61 61
62 62
63class ConfigViewItem : public QCheckListItem 63class ConfigViewItem : public QCheckListItem
64{ 64{
65 public: 65 public:
66 ConfigViewItem( QListView *parent, Resource* resource ) : 66 ConfigViewItem( QListView *parent, Resource* resource ) :
67 QCheckListItem( parent, resource->resourceName(), CheckBox ), 67 QCheckListItem( parent, resource->resourceName(), CheckBox ),
68 mResource( resource ), 68 mResource( resource ),
69 mIsStandard( false ) 69 mIsStandard( false )
70 { 70 {
71 setText( 1, mResource->type() ); 71 setText( 1, mResource->type() );
72 setOn( mResource->isActive() ); 72 setOn( mResource->isActive() );
73 } 73 }
74 74
75 void setStandard( bool value ) 75 void setStandard( bool value )
76 { 76 {
77 setText( 2, ( value ? i18n( "Yes" ) : QString::null ) ); 77 setText( 2, ( value ? i18n( "Yes" ) : QString::null ) );
78 mIsStandard = value; 78 mIsStandard = value;
79 } 79 }
80 80
81 bool standard() const { return mIsStandard; } 81 bool standard() const { return mIsStandard; }
82 bool readOnly() const { return mResource->readOnly(); } 82 bool readOnly() const { return mResource->readOnly(); }
83 83
84 Resource *resource() { return mResource; } 84 Resource *resource() { return mResource; }
85 85
86 private: 86 private:
87 Resource* mResource; 87 Resource* mResource;
88 88
89 bool mIsStandard; 89 bool mIsStandard;
90}; 90};
91 91
92ConfigPage::ConfigPage( QWidget *parent, const char *name ) 92ConfigPage::ConfigPage( QWidget *parent, const char *name )
93 : QWidget( parent, name ), 93 : QWidget( parent, name ),
94 mCurrentManager( 0 ), 94 mCurrentManager( 0 ),
95 mCurrentConfig( 0 ) 95 mCurrentConfig( 0 )
96{ 96{
97 setCaption( i18n( "Resource Configuration" ) ); 97 setCaption( i18n( "Resource Configuration" ) );
98 98
99 QVBoxLayout *mainLayout = new QVBoxLayout( this ); 99 QVBoxLayout *mainLayout = new QVBoxLayout( this );
100 100
101 QGroupBox *groupBox = new QGroupBox( i18n( "Resources" ), this ); 101 QGroupBox *groupBox = new QGroupBox( i18n( "Resources" ), this );
102 groupBox->setColumnLayout(0, Qt::Vertical ); 102 groupBox->setColumnLayout(0, Qt::Vertical );
103 groupBox->layout()->setSpacing( 6 ); 103 groupBox->layout()->setSpacing( 3 );
104 groupBox->layout()->setMargin( 11 ); 104 groupBox->layout()->setMargin( 5 );
105 QGridLayout *groupBoxLayout = new QGridLayout( groupBox->layout(), 4, 2 ); 105 QGridLayout *groupBoxLayout = new QGridLayout( groupBox->layout(), 4, 2 );
106 106
107//US mFamilyCombo = new KComboBox( false, groupBox ); 107//US mFamilyCombo = new KComboBox( false, groupBox );
108 mFamilyCombo = new KComboBox( groupBox ); 108 mFamilyCombo = new KComboBox( groupBox );
109 groupBoxLayout->addMultiCellWidget( mFamilyCombo, 0, 0, 0, 1 ); 109 groupBoxLayout->addMultiCellWidget( mFamilyCombo, 0, 0, 0, 1 );
110 110
111 mListView = new KListView( groupBox ); 111 mListView = new KListView( groupBox );
112 mListView->setAllColumnsShowFocus( true ); 112 mListView->setAllColumnsShowFocus( true );
113 mListView->addColumn( i18n( "Name" ) ); 113 mListView->addColumn( i18n( "Name" ) );
114 mListView->addColumn( i18n( "Type" ) ); 114 mListView->addColumn( i18n( "Type" ) );
115 mListView->addColumn( i18n( "Standard" ) ); 115 mListView->addColumn( i18n( "Standard" ) );
116 116
117//US groupBoxLayout->addWidget( mListView, 1, 0 ); 117//US groupBoxLayout->addWidget( mListView, 1, 0 );
118 groupBoxLayout->addMultiCellWidget( mListView, 1, 1, 0, 1 ); 118 groupBoxLayout->addMultiCellWidget( mListView, 1, 1, 0, 1 );
119 119
120 120
121 mAddButton = new QPushButton( i18n( "&Add..." ), this ); 121 mAddButton = new QPushButton( i18n( "&Add..." ), groupBox );
122 groupBoxLayout->addWidget( mAddButton, 2, 0 ); 122 groupBoxLayout->addWidget( mAddButton, 2, 0 );
123 mRemoveButton = new QPushButton( i18n( "&Remove" ), this ); 123 mRemoveButton = new QPushButton( i18n( "&Remove" ), groupBox );
124 groupBoxLayout->addWidget( mRemoveButton, 2, 1 ); 124 groupBoxLayout->addWidget( mRemoveButton, 2, 1 );
125 mEditButton = new QPushButton( i18n( "&Edit..." ), this ); 125 mEditButton = new QPushButton( i18n( "&Edit..." ), groupBox );
126 groupBoxLayout->addWidget( mEditButton, 3, 0 ); 126 groupBoxLayout->addWidget( mEditButton, 3, 0 );
127 mStandardButton = new QPushButton( i18n( "&Use as Standard" ), this ); 127 mStandardButton = new QPushButton( i18n( "&Use as Standard" ), groupBox );
128 groupBoxLayout->addWidget( mStandardButton, 3, 1 ); 128 groupBoxLayout->addWidget( mStandardButton, 3, 1 );
129 129
130 mRemoveButton->setEnabled( false ); 130 mRemoveButton->setEnabled( false );
131 mEditButton->setEnabled( false ); 131 mEditButton->setEnabled( false );
132 mStandardButton->setEnabled( false ); 132 mStandardButton->setEnabled( false );
133 133
134 134
135 connect( mAddButton, SIGNAL( clicked() ), SLOT(slotAdd()) ); 135 connect( mAddButton, SIGNAL( clicked() ), SLOT(slotAdd()) );
136 connect( mRemoveButton, SIGNAL( clicked() ), SLOT(slotRemove()) ); 136 connect( mRemoveButton, SIGNAL( clicked() ), SLOT(slotRemove()) );
137 connect( mEditButton, SIGNAL( clicked() ), SLOT(slotEdit()) ); 137 connect( mEditButton, SIGNAL( clicked() ), SLOT(slotEdit()) );
138 connect( mStandardButton, SIGNAL( clicked() ), SLOT(slotStandard()) ); 138 connect( mStandardButton, SIGNAL( clicked() ), SLOT(slotStandard()) );
139 139
140 140
141 mainLayout->addWidget( groupBox ); 141 mainLayout->addWidget( groupBox );
142 142
143 connect( mFamilyCombo, SIGNAL( activated( int ) ), 143 connect( mFamilyCombo, SIGNAL( activated( int ) ),
144 SLOT( slotFamilyChanged( int ) ) ); 144 SLOT( slotFamilyChanged( int ) ) );
145 connect( mListView, SIGNAL( selectionChanged() ), 145 connect( mListView, SIGNAL( selectionChanged() ),
146 SLOT( slotSelectionChanged() ) ); 146 SLOT( slotSelectionChanged() ) );
147 connect( mListView, SIGNAL( clicked( QListViewItem * ) ), 147 connect( mListView, SIGNAL( clicked( QListViewItem * ) ),
148 SLOT( slotItemClicked( QListViewItem * ) ) ); 148 SLOT( slotItemClicked( QListViewItem * ) ) );
149 149
150 mLastItem = 0; 150 mLastItem = 0;
151 151
152//US mConfig = new KConfig( "kcmkresourcesrc" ); 152//US mConfig = new KConfig( "kcmkresourcesrc" );
153 mConfig = new KConfig( locateLocal( "config", "kcmkresourcesrc") ); 153 mConfig = new KConfig( locateLocal( "config", "kcmkresourcesrc") );
154 mConfig->setGroup( "General" ); 154 mConfig->setGroup( "General" );
155 155
156 load(); 156 load();
157} 157}
158 158
159ConfigPage::~ConfigPage() 159ConfigPage::~ConfigPage()
160{ 160{
161 QValueList<ResourcePageInfo>::Iterator it; 161 QValueList<ResourcePageInfo>::Iterator it;
162 for ( it = mInfoMap.begin(); it != mInfoMap.end(); ++it ) { 162 for ( it = mInfoMap.begin(); it != mInfoMap.end(); ++it ) {
163 (*it).mManager->removeListener( this ); 163 (*it).mManager->removeListener( this );
164 delete (*it).mManager; 164 delete (*it).mManager;
165 delete (*it).mConfig; 165 delete (*it).mConfig;
166 } 166 }
167 167
168 mConfig->writeEntry( "CurrentFamily", mFamilyCombo->currentItem() ); 168 mConfig->writeEntry( "CurrentFamily", mFamilyCombo->currentItem() );
169 delete mConfig; 169 delete mConfig;
170 mConfig = 0; 170 mConfig = 0;
171} 171}
172 172
173void ConfigPage::load() 173void ConfigPage::load()
174{ 174{
175 kdDebug(5650) << "ConfigPage::load()" << endl; 175 kdDebug(5650) << "ConfigPage::load()" << endl;