diff options
author | David Tardon <dtardon@redhat.com> | 2011-12-02 13:43:15 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2011-12-05 15:19:40 +0100 |
commit | 62fd44a5e342d97aacc0c2b33c07e3918251676c (patch) | |
tree | 23541c06a56e67c2fe6801f907f25a9f2f014192 /vcl/unx | |
parent | 53f89022b541a14a40556acf0e1eb1462e6b5a42 (diff) |
attach signals after activation of the control to avoid warnings
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/gtk/gdi/salprn-gtk.cxx | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/vcl/unx/gtk/gdi/salprn-gtk.cxx b/vcl/unx/gtk/gdi/salprn-gtk.cxx index 2fc29fb1335a..2b34672e0915 100644 --- a/vcl/unx/gtk/gdi/salprn-gtk.cxx +++ b/vcl/unx/gtk/gdi/salprn-gtk.cxx @@ -641,6 +641,14 @@ GtkPrintDialog::impl_initCustomTab() continue; else { + // change handlers for all the controls set up in this block + // should be set _after_ the control has been made (in)active, + // because: + // 1. value of the property is _known_--we are using it to + // _set_ the control, right?--no need to change it back .-) + // 2. it may cause warning because the widget may not + // have been placed in m_aControlToPropertyMap yet + GtkWidget* pWidget = NULL; beans::PropertyValue* pVal = NULL; if (aCtrlType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Bool")) && pCurParent) @@ -649,7 +657,6 @@ GtkPrintDialog::impl_initCustomTab() rtl::OUStringToOString(aText, RTL_TEXTENCODING_UTF8).getStr()); lcl_setHelpText(pWidget, aHelpTexts, 0); m_aControlToPropertyMap[pWidget] = aPropertyName; - g_signal_connect(pWidget, "toggled", G_CALLBACK(GtkPrintDialog::UIOption_CheckHdl), this); sal_Bool bVal = sal_False; pVal = m_rController.getValue(aPropertyName); @@ -658,6 +665,7 @@ GtkPrintDialog::impl_initCustomTab() gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pWidget), bVal); gtk_widget_set_sensitive(pWidget, m_rController.isUIOptionEnabled(aPropertyName) && pVal != NULL); + g_signal_connect(pWidget, "toggled", G_CALLBACK(GtkPrintDialog::UIOption_CheckHdl), this); } else if (aCtrlType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Radio")) && pCurParent) { @@ -684,11 +692,11 @@ GtkPrintDialog::impl_initCustomTab() gtk_box_pack_start(GTK_BOX(pVbox), pRow, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(pRow), pWidget, FALSE, FALSE, 0); aPropertyToDependencyRowMap[aPropertyName + rtl::OUString::valueOf(m)] = pRow; - g_signal_connect(pWidget, "toggled", - G_CALLBACK(GtkPrintDialog::UIOption_RadioHdl), this); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pWidget), m == nSelectVal); gtk_widget_set_sensitive(pWidget, m_rController.isUIOptionEnabled(aPropertyName) && pVal != NULL); + g_signal_connect(pWidget, "toggled", + G_CALLBACK(GtkPrintDialog::UIOption_RadioHdl), this); } if (pGroup) @@ -718,11 +726,6 @@ GtkPrintDialog::impl_initCustomTab() pVal = m_rController.getValue(aPropertyName); if (pVal && pVal->Value.hasValue()) pVal->Value >>= nSelectVal; - // set active value before attaching the change handler, because: - // 1. value of the property is _known_--we are using it to - // _set_ the control, right?--no need to change it back .-) - // 2. it would cause assertion because the widget has not - // been placed in m_aControlToPropertyMap yet gtk_combo_box_set_active(GTK_COMBO_BOX(pWidget), nSelectVal); g_signal_connect(pWidget, "changed", G_CALLBACK(GtkPrintDialog::UIOption_SelectHdl), this); } |