[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: =?utf-8?q?=5Bknights=5D_src=3A_Store_settings_indicating_if_cloc?=
From: José_Manuel_Santamaría_Lema <panfaust () gmail ! com>
Date: 2011-02-26 20:58:44
Message-ID: 20110226205844.70C7EA60C4 () git ! kde ! org
[Download RAW message or body]
Git commit a985c32f7209b96426a3351d67bfda01ffd3501c by José Manuel Santamaría Lema.
Committed on 25/02/2011 at 19:07.
Pushed by joselema into branch 'master'.
Store settings indicating if clock, console and chat are displayed.
M +26 -0 src/knights.cpp
M +4 -0 src/knights.h
http://commits.kde.org/knights/a985c32f7209b96426a3351d67bfda01ffd3501c
diff --git a/src/knights.cpp b/src/knights.cpp
index 4e7a01d..5c88212 100644
--- a/src/knights.cpp
+++ b/src/knights.cpp
@@ -180,6 +180,7 @@ void MainWindow::showFicsSpectateDialog()
KToggleAction* clockAction = new KToggleAction ( \
KIcon(QLatin1String("clock")), i18n("Show Clock"), actionCollection() \
);
actionCollection()->addAction ( QLatin1String("show_clock"), clockAction \
);
connect ( clockAction, SIGNAL(triggered(bool)), m_clockDock, \
SLOT(setVisible(bool)) ); + connect ( clockAction, \
SIGNAL(triggered(bool)), this, SLOT(setShowClockSetting(bool)) );
connect ( m_clockDock, SIGNAL(visibilityChanged(bool)), clockAction, \
SLOT(setChecked(bool)) ); }
@@ -265,6 +266,15 @@ void MainWindow::showFicsSpectateDialog()
KToggleAction* toolAction = new KToggleAction ( KIcon(iconName), \
actionText, actionCollection() );
connect ( toolAction, SIGNAL(triggered(bool)), dock, \
SLOT(setVisible(bool)) ); + switch ( data.type )
+ {
+ case Protocol::ConsoleToolWidget:
+ connect ( toolAction, SIGNAL(triggered(bool)), this, \
SLOT(setShowConsoleSetting(bool)) ); + break;
+ case Protocol::ChatToolWidget:
+ connect ( toolAction, SIGNAL(triggered(bool)), this, \
SLOT(setShowChatSetting(bool)) ); + break;
+ }
connect ( dock, SIGNAL(visibilityChanged(bool)), toolAction, \
SLOT(setChecked(bool)) ); actionCollection()->addAction ( actionName, toolAction );
m_protocolActions << toolAction;
@@ -398,6 +408,21 @@ void MainWindow::showFicsSpectateDialog()
}
}
+ void MainWindow::setShowClockSetting( bool value )
+ {
+ Settings::self()->setShowClock( value );
+ }
+
+ void MainWindow::setShowConsoleSetting( bool value )
+ {
+ Settings::self()->setShowConsole( value );
+ }
+
+ void MainWindow::setShowChatSetting( bool value )
+ {
+ Settings::self()->setShowChat( value );
+ }
+
void MainWindow::exitKnights()
{
//This will close the gnuchess/crafty/whatever process if it's running.
@@ -407,6 +432,7 @@ void MainWindow::showFicsSpectateDialog()
if ( Protocol::black() ) {
delete Protocol::black();
}
+ Settings::self()->writeConfig();
}
}
diff --git a/src/knights.h b/src/knights.h
index b98f012..6a51ed9 100644
--- a/src/knights.h
+++ b/src/knights.h
@@ -59,6 +59,10 @@ namespace Knights
void protocolInitSuccesful();
void protocolError ( Protocol::ErrorCode errorCode, const QString& \
errorString );
+ void setShowClockSetting( bool value );
+ void setShowConsoleSetting( bool value );
+ void setShowChatSetting( bool value );
+
void exitKnights();
private:
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic