[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: =?utf-8?q?=5Bknights=5D_src=3A_Add_configuration_for_enabling_an?=
From: Miha Čančula <miha.cancula () gmail ! com>
Date: 2011-03-24 14:11:15
Message-ID: 20110324141115.5A2EFA60AE () git ! kde ! org
[Download RAW message or body]
Git commit 965910d6aea3484e9ecfddf282a0befa6c580223 by Miha Čančula.
Committed on 24/03/2011 at 14:54.
Pushed by mihac into branch 'master'.
Add configuration for enabling and disabling speech syntesis and external control.
M +1 -0 src/CMakeLists.txt
M +2 -3 src/gamemanager.cpp
M +5 -0 src/knights.cpp
M +3 -1 src/knights.h
M +5 -1 src/knights.kcfg
A +48 -0 src/prefs_access.ui [License: UNKNOWN] *
The files marked with a * at the end have a non valid license. Please read: \
http://techbase.kde.org/Policies/Licensing_Policy and use the headers which are \
listed at that page.
http://commits.kde.org/knights/965910d6aea3484e9ecfddf282a0befa6c580223
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 365e36d..8400152 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -50,6 +50,7 @@ endif()
kde4_add_ui_files(knights_SRCS
knightsview_base.ui
prefs_base.ui
+ prefs_access.ui
gamedialog.ui
clockwidget.ui
promotiondialog.ui
diff --git a/src/gamemanager.cpp b/src/gamemanager.cpp
index 20da286..1b49835 100644
--- a/src/gamemanager.cpp
+++ b/src/gamemanager.cpp
@@ -722,11 +722,10 @@ void Manager::moveByBoard(const Move& move)
void Manager::moveByExternalControl(const Knights::Move& move)
{
Q_D(GameManager);
- if ( !Protocol::byColor(d->activePlayer)->isLocal() )
+ if ( Settings::allowExternalControl() && \
Protocol::byColor(d->activePlayer)->isLocal() ) {
- return;
+ processMove(move);
}
- processMove(move);
}
diff --git a/src/knights.cpp b/src/knights.cpp
index 2f59542..da577c3 100644
--- a/src/knights.cpp
+++ b/src/knights.cpp
@@ -367,6 +367,11 @@ void MainWindow::showFicsSpectateDialog()
#endif
dialog->addPage ( generalSettingsDlg, i18n ( "General" ), QLatin1String ( \
"games-config-options" ) );
connect ( dialog, SIGNAL ( settingsChanged ( QString ) ), m_view, SLOT ( \
settingsChanged() ) ); +
+ QWidget* accessDlg = new QWidget;
+ ui_prefs_access.setupUi ( accessDlg );
+ dialog->addPage ( accessDlg, i18n( "Accessibility"), \
QLatin1String("preferences-desktop-accessibility") ); +
QWidget* themeDlg = new KGameThemeSelector ( dialog, Settings::self(), \
KGameThemeSelector::NewStuffEnableDownload );
dialog->addPage ( themeDlg, i18n ( "Theme" ), QLatin1String ( \
"games-config-theme" ) ); dialog->setAttribute ( Qt::WA_DeleteOnClose );
diff --git a/src/knights.h b/src/knights.h
index 6bcafe3..046faa6 100644
--- a/src/knights.h
+++ b/src/knights.h
@@ -23,6 +23,7 @@
#define KNIGHTS_H
#include "ui_prefs_base.h"
+#include "ui_prefs_access.h"
#include "proto/protocol.h"
#include <KXmlGuiWindow>
@@ -72,7 +73,8 @@ namespace Knights
void showFicsSpectateDialog();
private:
- Ui::prefs_base ui_prefs_base ;
+ Ui::prefs_base ui_prefs_base;
+ Ui::prefs_access ui_prefs_access;
KnightsView *m_view;
QPointer<QDockWidget> m_clockDock;
diff --git a/src/knights.kcfg b/src/knights.kcfg
index d435b37..9f54b99 100644
--- a/src/knights.kcfg
+++ b/src/knights.kcfg
@@ -141,10 +141,14 @@
<default>500</default>
</entry>
</group>
- <group name="Voice">
+ <group name="Accessibility">
<entry name="speakOpponentsMoves" type="Bool">
<label>whether opponents' moves are spoken by Jovie</label>
<default>true</default>
</entry>
+ <entry name="allowExternalControl" type="Bool">
+ <label>whether commands over D-Bus are accepted</label>
+ <default>true</default>
+ </entry>
</group>
</kcfg>
diff --git a/src/prefs_access.ui b/src/prefs_access.ui
new file mode 100644
index 0000000..aa3471b
--- /dev/null
+++ b/src/prefs_access.ui
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>prefs_access</class>
+ <widget class="QWidget" name="prefs_access">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QCheckBox" name="kcfg_speakOpponentsMoves">
+ <property name="text">
+ <string>Speak opponent's moves</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="kcfg_allowExternalControl">
+ <property name="text">
+ <string>Allow other programs to control Knights</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic