[Xfce4-commits] [apps/xfce4-dict] 09/43: Remove compat code for panel < 4.9 and GTK <=2
noreply at xfce.org
noreply at xfce.org
Tue Nov 1 00:31:22 CET 2016
This is an automated email from the git hooks/post-receive script.
andre pushed a commit to branch master
in repository apps/xfce4-dict.
commit 4d8aa2bab2d04b8ff16150cc7bfbe719653922ab
Author: Andre Miranda <andre42m at gmail.com>
Date: Wed Jul 20 22:40:45 2016 -0300
Remove compat code for panel < 4.9 and GTK <=2
---
lib/gui.c | 8 +------
panel-plugin/xfce4-dict-plugin.c | 51 ----------------------------------------
2 files changed, 1 insertion(+), 58 deletions(-)
diff --git a/lib/gui.c b/lib/gui.c
index 2f44c54..1c826e1 100644
--- a/lib/gui.c
+++ b/lib/gui.c
@@ -897,10 +897,8 @@ void dict_gui_create_main_window(DictData *dd)
G_CALLBACK(textview_populate_popup_cb), dd);
}
/* tooltips */
-#if GTK_CHECK_VERSION(2, 12, 0)
gtk_widget_set_has_tooltip(dd->main_textview, TRUE);
g_signal_connect(dd->main_textview, "query-tooltip", G_CALLBACK(textview_query_tooltip_cb), dd);
-#endif
gtk_widget_show(dd->main_textview);
gtk_container_add(GTK_CONTAINER(scrolledwindow_results), dd->main_textview);
@@ -966,11 +964,7 @@ void dict_gui_about_dialog(GtkWidget *widget, DictData *dd)
"translator-credits", _("translator-credits"),
"license", XFCE_LICENSE_GPL,
"version", PACKAGE_VERSION,
-#if GTK_CHECK_VERSION(2,11,0)
- "program-name", title,
-#else
- "name", title,
-#endif
+ "program-name", _("Xfce4 Dictionary"),
NULL);
if (logo != NULL)
diff --git a/panel-plugin/xfce4-dict-plugin.c b/panel-plugin/xfce4-dict-plugin.c
index 3fe6457..6ba3cee 100644
--- a/panel-plugin/xfce4-dict-plugin.c
+++ b/panel-plugin/xfce4-dict-plugin.c
@@ -80,10 +80,7 @@ static gboolean dict_plugin_panel_set_size(XfcePanelPlugin *plugin, gint wsize,
{
gint size;
gint bsize = wsize;
-
-#if defined(LIBXFCE4PANEL_CHECK_VERSION) && LIBXFCE4PANEL_CHECK_VERSION(4,9,0)
bsize /= xfce_panel_plugin_get_nrows(plugin);
-#endif
size = bsize - 2 - (2 * MAX(dpd->panel_button->style->xthickness,
dpd->panel_button->style->ythickness));
@@ -92,7 +89,6 @@ static gboolean dict_plugin_panel_set_size(XfcePanelPlugin *plugin, gint wsize,
gtk_image_set_from_pixbuf(GTK_IMAGE(dpd->panel_button_image), dpd->dd->icon);
-#if defined(LIBXFCE4PANEL_CHECK_VERSION) && LIBXFCE4PANEL_CHECK_VERSION(4,9,0)
if (dpd->dd->show_panel_entry &&
xfce_panel_plugin_get_mode(dpd->plugin) != XFCE_PANEL_PLUGIN_MODE_VERTICAL)
{
@@ -109,16 +105,6 @@ static gboolean dict_plugin_panel_set_size(XfcePanelPlugin *plugin, gint wsize,
gtk_widget_hide(dpd->dd->panel_entry);
xfce_panel_plugin_set_small(plugin, TRUE);
}
-#else
- if (dpd->dd->show_panel_entry &&
- xfce_panel_plugin_get_orientation(plugin) == GTK_ORIENTATION_HORIZONTAL)
- {
- gtk_widget_show(dpd->dd->panel_entry);
- gtk_widget_set_size_request(dpd->dd->panel_entry, dpd->dd->panel_entry_size, -1);
- }
- else
- gtk_widget_hide(dpd->dd->panel_entry);
-#endif
gtk_widget_set_size_request(dpd->panel_button, bsize, bsize);
@@ -126,30 +112,6 @@ static gboolean dict_plugin_panel_set_size(XfcePanelPlugin *plugin, gint wsize,
}
-/* TODO remove me, unused
-static void dict_toggle_main_window(GtkWidget *button, DictData *dd)
-{
- if (GTK_WIDGET_VISIBLE(dd->window))
- gtk_widget_hide(dd->window);
- else
- {
- const gchar *panel_text = "";
-
- if (dd->panel_entry != NULL)
- panel_text = gtk_entry_get_text(GTK_ENTRY(dd->panel_entry));
-
- dict_show_main_window(dd);
- if (NZV(panel_text))
- {
- dict_search_word(dd, panel_text);
- gtk_entry_set_text(GTK_ENTRY(dd->main_entry), panel_text);
- }
- gtk_widget_grab_focus(dd->main_entry);
- }
-}
-*/
-
-
static void dict_plugin_panel_button_clicked(GtkWidget *button, DictPanelData *dpd)
{
if (GTK_WIDGET_VISIBLE(dpd->dd->window))
@@ -272,21 +234,12 @@ static void dict_plugin_free_data(XfcePanelPlugin *plugin, DictPanelData *dpd)
}
-#if defined(LIBXFCE4PANEL_CHECK_VERSION) && LIBXFCE4PANEL_CHECK_VERSION(4,9,0)
static void dict_plugin_panel_change_mode(XfcePanelPlugin *plugin,
XfcePanelPluginMode mode, DictPanelData *dpd)
{
dict_plugin_panel_set_size(plugin, xfce_panel_plugin_get_size(plugin), dpd);
}
-#else
-static void dict_plugin_panel_change_orientation(XfcePanelPlugin *plugin,
- GtkOrientation orientation, DictPanelData *dpd)
-{
- dict_plugin_panel_set_size(plugin, xfce_panel_plugin_get_size(plugin), dpd);
-}
-#endif
-
static void dict_plugin_style_set(XfcePanelPlugin *plugin, gpointer unused, DictPanelData *dpd)
{
@@ -441,11 +394,7 @@ static void dict_plugin_construct(XfcePanelPlugin *plugin)
g_signal_connect(dpd->dd->close_button, "clicked", G_CALLBACK(dict_plugin_close_button_clicked), dpd);
g_signal_connect(plugin, "free-data", G_CALLBACK(dict_plugin_free_data), dpd);
g_signal_connect(plugin, "size-changed", G_CALLBACK(dict_plugin_panel_set_size), dpd);
-#if defined(LIBXFCE4PANEL_CHECK_VERSION) && LIBXFCE4PANEL_CHECK_VERSION(4,9,0)
g_signal_connect(plugin, "mode-changed", G_CALLBACK(dict_plugin_panel_change_mode), dpd);
-#else
- g_signal_connect(plugin, "orientation-changed", G_CALLBACK(dict_plugin_panel_change_orientation), dpd);
-#endif
g_signal_connect(plugin, "style-set", G_CALLBACK(dict_plugin_style_set), dpd);
g_signal_connect(plugin, "save", G_CALLBACK(dict_plugin_write_rc_file), dpd);
g_signal_connect(plugin, "configure-plugin", G_CALLBACK(dict_plugin_properties_dialog), dpd);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list