[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/kcontrol/keyboard
From:       Andriy Rysin <arysin () gmail ! com>
Date:       2010-11-26 19:05:52
Message-ID: 20101126190552.D564EAC8A2 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1201104 by rysin:

ui cleanup

 M  +8 -9      kcm_keyboard.ui  
 M  +13 -10    kcm_keyboard_widget.cpp  


--- trunk/KDE/kdebase/workspace/kcontrol/keyboard/kcm_keyboard.ui #1201103:1201104
@@ -268,20 +268,19 @@
      </layout>
     </item>
     <item row="1" column="0">
-     <widget class="QCheckBox" name="configureLayoutsChk">
-      <property name="text">
-       <string>Configure layouts</string>
-      </property>
-     </widget>
-    </item>
-    <item row="2" column="0">
      <widget class="QGroupBox" name="layoutsGroupBox">
       <property name="enabled">
-       <bool>false</bool>
+       <bool>true</bool>
       </property>
       <property name="title">
-       <string/>
+       <string>Configure layouts</string>
       </property>
+      <property name="flat">
+       <bool>false</bool>
+      </property>
+      <property name="checkable">
+       <bool>true</bool>
+      </property>
       <layout class="QVBoxLayout" name="verticalLayout">
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout">
--- trunk/KDE/kdebase/workspace/kcontrol/keyboard/kcm_keyboard_widget.cpp \
#1201103:1201104 @@ -135,7 +135,7 @@
 	keyboardConfig->showIndicator = uiWidget->showIndicatorChk->isChecked();
 	keyboardConfig->showSingle = uiWidget->showSingleChk->isChecked();
 
-	keyboardConfig->configureLayouts = uiWidget->configureLayoutsChk->isChecked();
+	keyboardConfig->configureLayouts = uiWidget->layoutsGroupBox->isChecked();
 	keyboardConfig->keyboardModel = \
uiWidget->keyboardModelComboBox->itemData(uiWidget->keyboardModelComboBox->currentIndex()).toString();
  keyboardConfig->showFlag = uiWidget->showFlagRadioBtn->isChecked();
 
@@ -211,6 +211,8 @@
 	int maxLoop = min(X11Helper::MAX_GROUP_COUNT, keyboardConfig->layouts.count() - 1);
 	uiWidget->layoutLoopCountSpinBox->setMaximum(maxLoop);
 
+	bool layoutsConfigured = uiWidget->layoutsGroupBox->isChecked();
+
 	if( maxLoop < MIN_LOOPING_COUNT ) {
 		uiWidget->layoutLoopingCheckBox->setEnabled(false);
 		uiWidget->layoutLoopingCheckBox->setChecked(false);
@@ -220,10 +222,11 @@
 		uiWidget->layoutLoopingCheckBox->setChecked(true);
 	}
 	else{
-		uiWidget->layoutLoopingCheckBox->setEnabled(true);
+		uiWidget->layoutLoopingCheckBox->setEnabled(layoutsConfigured);
 	}
 
-	uiWidget->layoutLoopingGroupBox->setEnabled(uiWidget->layoutLoopingCheckBox->isChecked());
 +	uiWidget->layoutLoopingGroupBox->setEnabled(
+			layoutsConfigured && uiWidget->layoutLoopingCheckBox->isChecked());
 
 	if( uiWidget->layoutLoopingCheckBox->isChecked() ) {
 		if( uiWidget->layoutLoopCountSpinBox->text() == "" ) {
@@ -301,8 +304,8 @@
 	connect(uiWidget->xkbGrpShortcutBtn, SIGNAL(clicked(bool)), this, \
SLOT(scrollToGroupShortcut()));  connect(uiWidget->xkb3rdLevelShortcutBtn, \
SIGNAL(clicked(bool)), this, SLOT(scrollTo3rdLevelShortcut()));  
-	connect(uiWidget->configureLayoutsChk, SIGNAL(toggled(bool)), \
                uiWidget->layoutsGroupBox, SLOT(setEnabled(bool)));
-	connect(uiWidget->configureLayoutsChk, SIGNAL(toggled(bool)), this, \
SLOT(configureLayoutsChanged())); +	//	connect(uiWidget->configureLayoutsChk, \
SIGNAL(toggled(bool)), uiWidget->layoutsGroupBox, SLOT(setEnabled(bool))); \
+	connect(uiWidget->layoutsGroupBox, SIGNAL(toggled(bool)), this, \
SLOT(configureLayoutsChanged()));  
 	connect(uiWidget->showIndicatorChk, SIGNAL(clicked(bool)), this, \
SLOT(uiChanged()));  connect(uiWidget->showIndicatorChk, SIGNAL(toggled(bool)), \
uiWidget->showSingleChk, SLOT(setEnabled(bool))); @@ -316,7 +319,7 @@
 
 void KCMKeyboardWidget::configureLayoutsChanged()
 {
-	if( uiWidget->configureLayoutsChk->isChecked() && keyboardConfig->layouts.isEmpty() \
) { +	if( uiWidget->layoutsGroupBox->isChecked()	&& keyboardConfig->layouts.isEmpty() \
) {  populateWithCurrentLayouts();
 	}
 	uiChanged();
@@ -568,15 +571,15 @@
     uiWidget->configureKeyboardOptionsChk->setChecked(keyboardConfig->resetOldXkbOptions);
  }
 
-void KCMKeyboardWidget::updateLayoutsUI()
-{
-	uiWidget->configureLayoutsChk->setChecked(keyboardConfig->configureLayouts);
+void KCMKeyboardWidget::updateLayoutsUI() {
+	uiWidget->layoutsGroupBox->setChecked(keyboardConfig->configureLayouts);
 	uiWidget->showIndicatorChk->setChecked(keyboardConfig->showIndicator);
 	uiWidget->showSingleChk->setChecked(keyboardConfig->showSingle);
 	uiWidget->showFlagRadioBtn->setChecked(keyboardConfig->showFlag);
 	uiWidget->showLabelRadioBtn->setChecked(!keyboardConfig->showFlag);
 
-	bool loopingOn = keyboardConfig->layoutLoopCount != KeyboardConfig::NO_LOOPING;
+	bool loopingOn = keyboardConfig->configureLayouts && \
keyboardConfig->layoutLoopCount +			!= KeyboardConfig::NO_LOOPING;
 	uiWidget->layoutLoopingCheckBox->setChecked(loopingOn);
 	uiWidget->layoutLoopingGroupBox->setEnabled(loopingOn);
 	if( loopingOn ) {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic