/pidgin/main: 014800693d22: Fix compilation for GTK2
Tomasz Wasilczyk
tomkiewicz at cpw.pidgin.im
Thu May 9 07:12:21 EDT 2013
Changeset: 014800693d224b43059e0258a2aadc2c6af15ff7
Author: Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date: 2013-05-09 13:12 +0200
Branch: default
URL: https://hg.pidgin.im/pidgin/main/rev/014800693d22
Description:
Fix compilation for GTK2
diffstat:
pidgin/gtkdebug.c | 5 +++++
pidgin/gtkmain.c | 2 ++
pidgin/gtkprefs.c | 5 +++++
3 files changed, 12 insertions(+), 0 deletions(-)
diffs (84 lines):
diff --git a/pidgin/gtkdebug.c b/pidgin/gtkdebug.c
--- a/pidgin/gtkdebug.c
+++ b/pidgin/gtkdebug.c
@@ -434,6 +434,7 @@ debug_window_new(void)
gint width, height;
void *handle;
GtkToolItem *item;
+#if GTK_CHECK_VERSION(3,0,0)
GtkStyleContext *context;
GtkCssProvider *filter_css;
const gchar filter_style[] =
@@ -449,6 +450,7 @@ debug_window_new(void)
"background-image: none;"
"background-color: @success_color;"
"}";
+#endif
win = g_new0(DebugWindow, 1);
@@ -542,12 +544,15 @@ debug_window_new(void)
gtk_container_add(GTK_CONTAINER(item), GTK_WIDGET(win->expression));
gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item));
+#if GTK_CHECK_VERSION(3,0,0)
+ /* TODO: implement it for GTK2 */
filter_css = gtk_css_provider_new();
gtk_css_provider_load_from_data(filter_css, filter_style, -1, NULL);
context = gtk_widget_get_style_context(win->expression);
gtk_style_context_add_provider(context,
GTK_STYLE_PROVIDER(filter_css),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+#endif
/* this needs to be before the text is set from the pref if we want it
* to colorize a stored expression.
diff --git a/pidgin/gtkmain.c b/pidgin/gtkmain.c
--- a/pidgin/gtkmain.c
+++ b/pidgin/gtkmain.c
@@ -429,8 +429,10 @@ int main(int argc, char *argv[])
char *opt_login_arg = NULL;
char *opt_session_arg = NULL;
char *search_path;
+#if GTK_CHECK_VERSION(3,0,0)
GtkCssProvider *provider;
GdkScreen *screen;
+#endif
GList *accounts;
#ifdef HAVE_SIGNAL_H
int sig_indx; /* for setting up signal catching */
diff --git a/pidgin/gtkprefs.c b/pidgin/gtkprefs.c
--- a/pidgin/gtkprefs.c
+++ b/pidgin/gtkprefs.c
@@ -2034,6 +2034,7 @@ network_page(void)
GtkWidget *vbox, *hbox, *entry;
GtkWidget *label, *auto_ip_checkbox, *ports_checkbox, *spin_button;
GtkSizeGroup *sg;
+#if GTK_CHECK_VERSION(3,0,0)
GtkStyleContext *context;
GtkCssProvider *ip_css;
const gchar ip_style[] =
@@ -2049,6 +2050,7 @@ network_page(void)
"background-image: none;"
"background-color: @success_color;"
"}";
+#endif
ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER);
@@ -2090,12 +2092,15 @@ network_page(void)
g_signal_connect(G_OBJECT(entry), "changed",
G_CALLBACK(network_ip_changed), NULL);
+#if GTK_CHECK_VERSION(3,0,0)
+ /* TODO: implement it for GTK2 */
ip_css = gtk_css_provider_new();
gtk_css_provider_load_from_data(ip_css, ip_style, -1, NULL);
context = gtk_widget_get_style_context(entry);
gtk_style_context_add_provider(context,
GTK_STYLE_PROVIDER(ip_css),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+#endif
hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Public _IP:"),
sg, entry, TRUE, NULL);
More information about the Commits
mailing list