summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.com>2016-05-31 22:43:19 +0530
committerPranav Kant <pranavk@collabora.com>2016-06-15 23:30:37 +0530
commit93803d86b97f9dc0e2fc003b9a19036e525a41f0 (patch)
tree1ed48df62403d74860105d3abf4589c5c3a7060a
parentc97422fa103618ba19bde0d815674a0173058bb4 (diff)
gtktiledviewer: Fix runtime gtk warnings
Not all buttons are toggle buttons. Change-Id: I6cddc619f3f760e447ea3ffea07f776e03cdaab9
-rw-r--r--libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 380bc04f3daf..6f2a823c7f5f 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -789,13 +789,11 @@ static void signalCommand(LOKDocView* pLOKDocView, char* pPayload, gpointer /*pD
{
std::string aKey = aPayload.substr(0, nPosition);
std::string aValue = aPayload.substr(nPosition + 1);
-
if (rWindow.m_aCommandNameToolItems.find(aKey) != rWindow.m_aCommandNameToolItems.end())
{
GtkToolItem* pItem = rWindow.m_aCommandNameToolItems[aKey];
- gboolean bEdit = aValue == "true";
- if (GTK_IS_TOGGLE_TOOL_BUTTON(pItem))
- {
+ if (aValue == "true" || aValue == "false") {
+ gboolean bEdit = aValue == "true";
if (gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(pItem)) != bEdit)
{
// Avoid invoking lok_doc_view_post_command().
@@ -803,6 +801,9 @@ static void signalCommand(LOKDocView* pLOKDocView, char* pPayload, gpointer /*pD
gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(pItem), bEdit);
rWindow.m_bToolItemBroadcast = true;
}
+ } else if (aValue == "enabled" || aValue == "disabled") {
+ gboolean bSensitive = aValue == "enabled";
+ gtk_widget_set_sensitive(GTK_WIDGET(pItem), bSensitive);
}
}
}