[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-08-31 2:16:25
Message-ID: 20100831021625.4B12EAC857 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1170190 by rysin:
Allow kcm_keyboard to start even if rule files not found
BUG: 248096
M +16 -0 kcm_keyboard_widget.cpp
M +13 -12 xkb_helper.cpp
M +0 -1 xkb_helper.h
--- trunk/KDE/kdebase/workspace/kcontrol/keyboard/kcm_keyboard_widget.cpp #1170189:1170190
@@ -70,10 +70,17 @@
connect(kcmMiscWidget, SIGNAL(changed(bool)), this, SIGNAL(changed(bool)));
//TODO: connect save/load
+ if( rules != NULL ) {
initializeKeyboardModelUI();
initializeXkbOptionsUI();
initializeLayoutsUI();
}
+ else {
+ uiWidget->tabLayouts->setEnabled(false);
+ uiWidget->tabAdvanced->setEnabled(false);
+ uiWidget->keyboardModelComboBox->setEnabled(false);
+ }
+}
KCMKeyboardWidget::~KCMKeyboardWidget()
{
@@ -82,6 +89,9 @@
void KCMKeyboardWidget::save()
{
+ if( rules == NULL )
+ return;
+
KAction* action = static_cast<KAction*>(actionCollection->action(0));
KShortcut shortcut(uiWidget->kdeKeySequence->keySequence());
action->setGlobalShortcut(shortcut, KAction::ActiveShortcut, KAction::NoAutoloading);
@@ -92,6 +102,9 @@
void KCMKeyboardWidget::updateUI()
{
+ if( rules == NULL )
+ return;
+
uiWidget->layoutsTableView->setModel(uiWidget->layoutsTableView->model());
((LayoutsTableModel*)uiWidget->layoutsTableView->model())->refresh();
@@ -106,6 +119,9 @@
void KCMKeyboardWidget::uiChanged()
{
+ if( rules == NULL )
+ return;
+
((LayoutsTableModel*)uiWidget->layoutsTableView->model())->refresh();
// this collapses the tree so use more fine-grained updates
// ((LayoutsTableModel*)uiWidget->xkbOptionsTreeView->model())->refresh();
--- trunk/KDE/kdebase/workspace/kcontrol/keyboard/xkb_helper.cpp #1170189:1170190
@@ -30,6 +30,7 @@
#include "keyboard_config.h"
+
static const char* SETXKBMAP_EXEC = "setxkbmap";
static bool setxkbmapNotFound = false;
@@ -71,19 +72,19 @@
}
}
-bool XkbHelper::initializeKeyboardLayouts()
-{
- getSetxkbmapExe();
- if( ! setxkbmapNotFound ) {
+//bool XkbHelper::initializeKeyboardLayouts()
+//{
+// getSetxkbmapExe();
+// if( ! setxkbmapNotFound ) {
+//
+// KeyboardConfig config;
+// config.load();
+//
+// return XkbHelper::initializeKeyboardLayouts(config);
+// }
+// return false;
+//}
- KeyboardConfig config;
- config.load();
-
- return XkbHelper::initializeKeyboardLayouts(config);
- }
- return false;
-}
-
bool XkbHelper::initializeKeyboardLayouts(KeyboardConfig& config)
{
QStringList setxkbmapCommandArguments;
--- trunk/KDE/kdebase/workspace/kcontrol/keyboard/xkb_helper.h #1170189:1170190
@@ -24,7 +24,6 @@
class XkbHelper {
public:
- static bool initializeKeyboardLayouts();
static bool initializeKeyboardLayouts(KeyboardConfig& config);
//private:
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic