Kaydet (Commit) 93803d86 authored tarafından Pranav Kant's avatar Pranav Kant

gtktiledviewer: Fix runtime gtk warnings

Not all buttons are toggle buttons.

Change-Id: I6cddc619f3f760e447ea3ffea07f776e03cdaab9
üst c97422fa
......@@ -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);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment