author | ulf69 <ulf69> | 2004-08-02 22:23:36 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-08-02 22:23:36 (UTC) |
commit | caccbdef7506ed596669c35009bd6d5634ee6ee1 (patch) (unidiff) | |
tree | c45c1ff5cc2dd236dfe96ef087c1eaeb28d7b382 | |
parent | 5a7175ae22a89b28699983e8f97b7896d45f26e1 (diff) | |
download | kdepimpi-caccbdef7506ed596669c35009bd6d5634ee6ee1.zip kdepimpi-caccbdef7506ed596669c35009bd6d5634ee6ee1.tar.gz kdepimpi-caccbdef7506ed596669c35009bd6d5634ee6ee1.tar.bz2 |
optimized layout for SL5500
-rw-r--r-- | microkde/kresources/configpage.cpp | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/microkde/kresources/configpage.cpp b/microkde/kresources/configpage.cpp index 912c62e..2fe021d 100644 --- a/microkde/kresources/configpage.cpp +++ b/microkde/kresources/configpage.cpp | |||
@@ -73,89 +73,99 @@ class ConfigViewItem : public QCheckListItem | |||
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 | ||
92 | ConfigPage::ConfigPage( QWidget *parent, const char *name ) | 92 | ConfigPage::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( 6 ); |
104 | groupBox->layout()->setMargin( 11 ); | 104 | groupBox->layout()->setMargin( 11 ); |
105 | QGridLayout *groupBoxLayout = new QGridLayout( groupBox->layout(), 2, 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 | groupBoxLayout->addWidget( mListView, 1, 0 ); | 117 | //US groupBoxLayout->addWidget( mListView, 1, 0 ); |
118 | groupBoxLayout->addMultiCellWidget( mListView, 1, 1, 0, 1 ); | ||
119 | |||
120 | |||
121 | mAddButton = new QPushButton( i18n( "&Add..." ), this ); | ||
122 | groupBoxLayout->addWidget( mAddButton, 2, 0 ); | ||
123 | mRemoveButton = new QPushButton( i18n( "&Remove" ), this ); | ||
124 | groupBoxLayout->addWidget( mRemoveButton, 2, 1 ); | ||
125 | mEditButton = new QPushButton( i18n( "&Edit..." ), this ); | ||
126 | groupBoxLayout->addWidget( mEditButton, 3, 0 ); | ||
127 | mStandardButton = new QPushButton( i18n( "&Use as Standard" ), this ); | ||
128 | groupBoxLayout->addWidget( mStandardButton, 3, 1 ); | ||
118 | 129 | ||
119 | KButtonBox *buttonBox = new KButtonBox( groupBox, Vertical ); | ||
120 | mAddButton = buttonBox->addButton( i18n( "&Add..." ), this, SLOT(slotAdd()) ); | ||
121 | mRemoveButton = buttonBox->addButton( i18n( "&Remove" ), this, SLOT(slotRemove()) ); | ||
122 | mRemoveButton->setEnabled( false ); | 130 | mRemoveButton->setEnabled( false ); |
123 | mEditButton = buttonBox->addButton( i18n( "&Edit..." ), this, SLOT(slotEdit()) ); | ||
124 | mEditButton->setEnabled( false ); | 131 | mEditButton->setEnabled( false ); |
125 | mStandardButton = buttonBox->addButton( i18n( "&Use as Standard" ), this, SLOT(slotStandard()) ); | ||
126 | mStandardButton->setEnabled( false ); | 132 | mStandardButton->setEnabled( false ); |
127 | buttonBox->layout(); | ||
128 | 133 | ||
129 | groupBoxLayout->addWidget( buttonBox, 1, 1 ); | 134 | |
135 | connect( mAddButton, SIGNAL( clicked() ), SLOT(slotAdd()) ); | ||
136 | connect( mRemoveButton, SIGNAL( clicked() ), SLOT(slotRemove()) ); | ||
137 | connect( mEditButton, SIGNAL( clicked() ), SLOT(slotEdit()) ); | ||
138 | connect( mStandardButton, SIGNAL( clicked() ), SLOT(slotStandard()) ); | ||
139 | |||
130 | 140 | ||
131 | mainLayout->addWidget( groupBox ); | 141 | mainLayout->addWidget( groupBox ); |
132 | 142 | ||
133 | connect( mFamilyCombo, SIGNAL( activated( int ) ), | 143 | connect( mFamilyCombo, SIGNAL( activated( int ) ), |
134 | SLOT( slotFamilyChanged( int ) ) ); | 144 | SLOT( slotFamilyChanged( int ) ) ); |
135 | connect( mListView, SIGNAL( selectionChanged() ), | 145 | connect( mListView, SIGNAL( selectionChanged() ), |
136 | SLOT( slotSelectionChanged() ) ); | 146 | SLOT( slotSelectionChanged() ) ); |
137 | connect( mListView, SIGNAL( clicked( QListViewItem * ) ), | 147 | connect( mListView, SIGNAL( clicked( QListViewItem * ) ), |
138 | SLOT( slotItemClicked( QListViewItem * ) ) ); | 148 | SLOT( slotItemClicked( QListViewItem * ) ) ); |
139 | 149 | ||
140 | mLastItem = 0; | 150 | mLastItem = 0; |
141 | 151 | ||
142 | //US mConfig = new KConfig( "kcmkresourcesrc" ); | 152 | //US mConfig = new KConfig( "kcmkresourcesrc" ); |
143 | mConfig = new KConfig( locateLocal( "config", "kcmkresourcesrc") ); | 153 | mConfig = new KConfig( locateLocal( "config", "kcmkresourcesrc") ); |
144 | mConfig->setGroup( "General" ); | 154 | mConfig->setGroup( "General" ); |
145 | 155 | ||
146 | load(); | 156 | load(); |
147 | } | 157 | } |
148 | 158 | ||
149 | ConfigPage::~ConfigPage() | 159 | ConfigPage::~ConfigPage() |
150 | { | 160 | { |
151 | QValueList<ResourcePageInfo>::Iterator it; | 161 | QValueList<ResourcePageInfo>::Iterator it; |
152 | for ( it = mInfoMap.begin(); it != mInfoMap.end(); ++it ) { | 162 | for ( it = mInfoMap.begin(); it != mInfoMap.end(); ++it ) { |
153 | (*it).mManager->removeListener( this ); | 163 | (*it).mManager->removeListener( this ); |
154 | delete (*it).mManager; | 164 | delete (*it).mManager; |
155 | delete (*it).mConfig; | 165 | delete (*it).mConfig; |
156 | } | 166 | } |
157 | 167 | ||
158 | mConfig->writeEntry( "CurrentFamily", mFamilyCombo->currentItem() ); | 168 | mConfig->writeEntry( "CurrentFamily", mFamilyCombo->currentItem() ); |
159 | delete mConfig; | 169 | delete mConfig; |
160 | mConfig = 0; | 170 | mConfig = 0; |
161 | } | 171 | } |