/soc/2013/ankitkv/gobjectification: 73c5fb6d78b3: Merged default...
Ankit Vani
a at nevitus.org
Mon Feb 10 05:58:04 EST 2014
Changeset: 73c5fb6d78b3d84480bc451a81d8532d6f980211
Author: Ankit Vani <a at nevitus.org>
Date: 2014-02-10 16:22 +0530
Branch: soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/73c5fb6d78b3
Description:
Merged default branch
diffstat:
libpurple/account.c | 12 ++++++++----
libpurple/protocols/novell/novell.c | 2 ++
libpurple/protocols/zephyr/zephyr.c | 1 -
pidgin/gtkaccount.c | 25 +++++++++++++++++++++++++
pidgin/gtkconv.c | 29 ++++++++++++++++++++++++++++-
pidgin/gtkmedia.c | 16 ++++++++++++++++
pidgin/gtkprefs.c | 8 ++++++++
pidgin/gtkxfer.c | 2 +-
pidgin/pidginstock.c | 2 +-
pidgin/pidginstock.h | 2 +-
10 files changed, 90 insertions(+), 9 deletions(-)
diffs (299 lines):
diff --git a/libpurple/account.c b/libpurple/account.c
--- a/libpurple/account.c
+++ b/libpurple/account.c
@@ -898,7 +898,7 @@ purple_account_set_enabled(PurpleAccount
{
PurpleConnection *gc;
PurpleAccountPrivate *priv;
- gboolean was_enabled = FALSE, wants_to_die = FALSE;
+ gboolean was_enabled = FALSE;
g_return_if_fail(PURPLE_IS_ACCOUNT(account));
g_return_if_fail(ui != NULL);
@@ -916,11 +916,11 @@ purple_account_set_enabled(PurpleAccount
g_object_notify_by_pspec(G_OBJECT(account), properties[PROP_ENABLED]);
if ((gc != NULL) && (_purple_connection_wants_to_die(gc)))
- wants_to_die = TRUE;
+ return;
priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
- if (!wants_to_die && value && purple_presence_is_online(priv->presence))
+ if (value && purple_presence_is_online(priv->presence))
purple_account_connect(account);
else if (!value && !purple_account_is_disconnected(account))
purple_account_disconnect(account);
@@ -2940,7 +2940,11 @@ purple_account_constructed(GObject *obje
static void
purple_account_dispose(GObject *object)
{
- PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(object);
+ PurpleAccount *account = PURPLE_ACCOUNT(object);
+ PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
+
+ if (!purple_account_is_disconnected(account))
+ purple_account_disconnect(account);
if (priv->presence) {
g_object_unref(priv->presence);
diff --git a/libpurple/protocols/novell/novell.c b/libpurple/protocols/novell/novell.c
--- a/libpurple/protocols/novell/novell.c
+++ b/libpurple/protocols/novell/novell.c
@@ -3349,6 +3349,7 @@ novell_set_permit_deny(PurpleConnection
rc = nm_send_create_privacy_item(user, dn, TRUE,
_create_privacy_item_deny_resp_cb,
g_strdup(dn));
+ _check_for_disconnect(user, rc);
}
} else {
purple_account_privacy_permit_remove(account, (char *)node->data, TRUE);
@@ -3392,6 +3393,7 @@ novell_set_permit_deny(PurpleConnection
rc = nm_send_create_privacy_item(user, dn, FALSE,
_create_privacy_item_deny_resp_cb,
g_strdup(name));
+ _check_for_disconnect(user, rc);
}
} else {
purple_account_privacy_deny_remove(account, (char *)node->data, TRUE);
diff --git a/libpurple/protocols/zephyr/zephyr.c b/libpurple/protocols/zephyr/zephyr.c
--- a/libpurple/protocols/zephyr/zephyr.c
+++ b/libpurple/protocols/zephyr/zephyr.c
@@ -1441,7 +1441,6 @@ static void process_zsubs(zephyr_account
char *tmp = g_strdup_printf("%s", zephyr->username);
char *atptr;
- z_class = triple[0];
z_instance = triple[1];
if (triple[2] == NULL) {
recip = g_malloc0(1);
diff --git a/pidgin/gtkaccount.c b/pidgin/gtkaccount.c
--- a/pidgin/gtkaccount.c
+++ b/pidgin/gtkaccount.c
@@ -530,7 +530,12 @@ account_dnd_recv(GtkWidget *widget, GdkD
static void
update_editable(PurpleConnection *gc, AccountPrefsDialog *dialog)
{
+#if GTK_CHECK_VERSION(3,0,0)
+ GtkStyleContext *style;
+ GdkRGBA color;
+#else
GtkStyle *style;
+#endif
gboolean set;
GList *l;
@@ -543,16 +548,36 @@ update_editable(PurpleConnection *gc, Ac
set = !(purple_account_is_connected(dialog->account) || purple_account_is_connecting(dialog->account));
gtk_widget_set_sensitive(dialog->protocol_menu, set);
gtk_editable_set_editable(GTK_EDITABLE(dialog->username_entry), set);
+#if GTK_CHECK_VERSION(3,0,0)
+ style = set ? NULL : gtk_widget_get_style_context(dialog->username_entry);
+ if (style) {
+ gtk_style_context_get_background_color(style, GTK_STATE_FLAG_INSENSITIVE, &color);
+ gtk_widget_override_background_color(dialog->username_entry, GTK_STATE_FLAG_NORMAL, &color);
+ } else {
+ gtk_widget_override_background_color(dialog->username_entry, GTK_STATE_FLAG_NORMAL, NULL);
+ }
+#else
style = set ? NULL : gtk_widget_get_style(dialog->username_entry);
gtk_widget_modify_base(dialog->username_entry, GTK_STATE_NORMAL,
style ? &style->base[GTK_STATE_INSENSITIVE] : NULL);
+#endif
for (l = dialog->user_split_entries ; l != NULL ; l = l->next) {
if (GTK_IS_EDITABLE(l->data)) {
gtk_editable_set_editable(GTK_EDITABLE(l->data), set);
+#if GTK_CHECK_VERSION(3,0,0)
+ style = set ? NULL : gtk_widget_get_style_context(GTK_WIDGET(l->data));
+ if (style) {
+ gtk_style_context_get_background_color(style, GTK_STATE_FLAG_INSENSITIVE, &color);
+ gtk_widget_override_background_color(GTK_WIDGET(l->data), GTK_STATE_FLAG_NORMAL, &color);
+ } else {
+ gtk_widget_override_background_color(GTK_WIDGET(l->data), GTK_STATE_FLAG_NORMAL, NULL);
+ }
+#else
style = set ? NULL : gtk_widget_get_style(GTK_WIDGET(l->data));
gtk_widget_modify_base(GTK_WIDGET(l->data), GTK_STATE_NORMAL,
style ? &style->base[GTK_STATE_INSENSITIVE] : NULL);
+#endif
} else {
gtk_widget_set_sensitive(GTK_WIDGET(l->data), set);
}
diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c
--- a/pidgin/gtkconv.c
+++ b/pidgin/gtkconv.c
@@ -221,13 +221,23 @@ static gboolean pidgin_conv_xy_to_right_
static const GdkColor *get_nick_color(PidginConversation *gtkconv, const char *name)
{
+#if GTK_CHECK_VERSION(3,0,0)
+ GtkStyleContext *style = gtk_widget_get_style_context(gtkconv->webview);
+ GdkRGBA rgba;
+#else
+ GtkStyle *style = gtk_widget_get_style(gtkconv->webview);
+#endif
static GdkColor col;
- GtkStyle *style = gtk_widget_get_style(gtkconv->webview);
float scale;
col = g_array_index(gtkconv->nick_colors, GdkColor, g_str_hash(name) % gtkconv->nick_colors->len);
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &rgba);
+ scale = (1 - LUMINANCE(rgba)) * ((float)0xffff / MAX(MAX(col.red, col.blue), col.green));
+#else
scale = ((1-(LUMINANCE(style->base[GTK_STATE_NORMAL]) / LUMINANCE(style->white))) *
(LUMINANCE(style->white)/MAX(MAX(col.red, col.blue), col.green)));
+#endif
/* The colors are chosen to look fine on white; we should never have to darken */
if (scale > 1) {
@@ -5218,7 +5228,11 @@ pidgin_conv_create_tooltip(GtkWidget *ti
static gboolean
pidgin_conv_end_quickfind(PidginConversation *gtkconv)
{
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_override_background_color(gtkconv->quickfind_entry, GTK_STATE_FLAG_NORMAL, NULL);
+#else
gtk_widget_modify_base(gtkconv->quickfind_entry, GTK_STATE_NORMAL, NULL);
+#endif
webkit_web_view_unmark_text_matches(WEBKIT_WEB_VIEW(gtkconv->webview));
gtk_widget_hide(gtkconv->quickfind_container);
@@ -5234,13 +5248,26 @@ quickfind_process_input(GtkWidget *entry
case GDK_KEY_Return:
case GDK_KEY_KP_Enter:
if (webkit_web_view_search_text(WEBKIT_WEB_VIEW(gtkconv->webview), gtk_entry_get_text(GTK_ENTRY(entry)), FALSE, TRUE, TRUE)) {
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_override_background_color(gtkconv->quickfind_entry, GTK_STATE_FLAG_NORMAL, NULL);
+#else
gtk_widget_modify_base(gtkconv->quickfind_entry, GTK_STATE_NORMAL, NULL);
+#endif
} else {
+#if GTK_CHECK_VERSION(3,0,0)
+ GdkRGBA col;
+ col.red = 1.0;
+ col.green = 0xafff/(double)0xffff;
+ col.blue = 0xafff/(double)0xffff;
+ col.alpha = 1.0;
+ gtk_widget_override_background_color(gtkconv->quickfind_entry, GTK_STATE_FLAG_NORMAL, &col);
+#else
GdkColor col;
col.red = 0xffff;
col.green = 0xafff;
col.blue = 0xafff;
gtk_widget_modify_base(gtkconv->quickfind_entry, GTK_STATE_NORMAL, &col);
+#endif
}
break;
case GDK_KEY_Escape:
diff --git a/pidgin/gtkmedia.c b/pidgin/gtkmedia.c
--- a/pidgin/gtkmedia.c
+++ b/pidgin/gtkmedia.c
@@ -791,7 +791,11 @@ pidgin_media_ready_cb(PurpleMedia *media
PidginMediaRealizeData *data;
GtkWidget *aspect;
GtkWidget *remote_video;
+#if GTK_CHECK_VERSION(3,0,0)
+ GdkRGBA color = {0.0, 0.0, 0.0, 1.0};
+#else
GdkColor color = {0, 0, 0, 0};
+#endif
aspect = gtk_aspect_frame_new(NULL, 0, 0, 4.0/3.0, FALSE);
gtk_frame_set_shadow_type(GTK_FRAME(aspect), GTK_SHADOW_IN);
@@ -803,7 +807,11 @@ pidgin_media_ready_cb(PurpleMedia *media
data->participant = g_strdup(gtkmedia->priv->screenname);
remote_video = gtk_drawing_area_new();
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_override_background_color(remote_video, GTK_STATE_FLAG_NORMAL, &color);
+#else
gtk_widget_modify_bg(remote_video, GTK_STATE_NORMAL, &color);
+#endif
g_signal_connect(G_OBJECT(remote_video), "realize",
G_CALLBACK(realize_cb), data);
gtk_container_add(GTK_CONTAINER(aspect), remote_video);
@@ -822,7 +830,11 @@ pidgin_media_ready_cb(PurpleMedia *media
PidginMediaRealizeData *data;
GtkWidget *aspect;
GtkWidget *local_video;
+#if GTK_CHECK_VERSION(3,0,0)
+ GdkRGBA color = {0.0, 0.0, 0.0, 1.0};
+#else
GdkColor color = {0, 0, 0, 0};
+#endif
aspect = gtk_aspect_frame_new(NULL, 0, 0, 4.0/3.0, TRUE);
gtk_frame_set_shadow_type(GTK_FRAME(aspect), GTK_SHADOW_IN);
@@ -834,7 +846,11 @@ pidgin_media_ready_cb(PurpleMedia *media
data->participant = NULL;
local_video = gtk_drawing_area_new();
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_override_background_color(local_video, GTK_STATE_FLAG_NORMAL, &color);
+#else
gtk_widget_modify_bg(local_video, GTK_STATE_NORMAL, &color);
+#endif
g_signal_connect(G_OBJECT(local_video), "realize",
G_CALLBACK(realize_cb), data);
gtk_container_add(GTK_CONTAINER(aspect), local_video);
diff --git a/pidgin/gtkprefs.c b/pidgin/gtkprefs.c
--- a/pidgin/gtkprefs.c
+++ b/pidgin/gtkprefs.c
@@ -4041,11 +4041,19 @@ make_video_test(GtkWidget *vbox)
{
GtkWidget *test;
GtkWidget *video;
+#if GTK_CHECK_VERSION(3,0,0)
+ GdkRGBA color = {0.0, 0.0, 0.0, 1.0};
+#else
GdkColor color = {0, 0, 0, 0};
+#endif
video = gtk_drawing_area_new();
gtk_box_pack_start(GTK_BOX(vbox), video, TRUE, TRUE, 0);
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_override_background_color(video, GTK_STATE_FLAG_NORMAL, &color);
+#else
gtk_widget_modify_bg(video, GTK_STATE_NORMAL, &color);
+#endif
gtk_widget_set_size_request(GTK_WIDGET(video), 240, 180);
test = gtk_toggle_button_new_with_label(_("Test Video"));
diff --git a/pidgin/gtkxfer.c b/pidgin/gtkxfer.c
--- a/pidgin/gtkxfer.c
+++ b/pidgin/gtkxfer.c
@@ -965,7 +965,7 @@ pidgin_xfer_dialog_cancel_xfer(PidginXfe
update_title_progress(dialog);
pixbuf = gtk_widget_render_icon(dialog->window,
- PIDGIN_STOCK_FILE_CANCELED,
+ PIDGIN_STOCK_FILE_CANCELLED,
GTK_ICON_SIZE_MENU, NULL);
if (purple_xfer_is_cancelled(xfer))
diff --git a/pidgin/pidginstock.c b/pidgin/pidginstock.c
--- a/pidgin/pidginstock.c
+++ b/pidgin/pidginstock.c
@@ -57,7 +57,7 @@ static struct StockIcon
{ PIDGIN_STOCK_DISCONNECT, NULL, GTK_STOCK_DISCONNECT },
{ PIDGIN_STOCK_FGCOLOR, "buttons", "change-fgcolor-small.png" },
{ PIDGIN_STOCK_EDIT, NULL, GTK_STOCK_EDIT },
- { PIDGIN_STOCK_FILE_CANCELED, NULL, GTK_STOCK_CANCEL },
+ { PIDGIN_STOCK_FILE_CANCELLED, NULL, GTK_STOCK_CANCEL },
{ PIDGIN_STOCK_FILE_DONE, NULL, GTK_STOCK_APPLY },
{ PIDGIN_STOCK_IGNORE, NULL, GTK_STOCK_DIALOG_ERROR },
{ PIDGIN_STOCK_INVITE, NULL, GTK_STOCK_JUMP_TO },
diff --git a/pidgin/pidginstock.h b/pidgin/pidginstock.h
--- a/pidgin/pidginstock.h
+++ b/pidgin/pidginstock.h
@@ -46,7 +46,7 @@
#define PIDGIN_STOCK_DOWNLOAD "pidgin-download"
#define PIDGIN_STOCK_EDIT "pidgin-edit"
#define PIDGIN_STOCK_FGCOLOR "pidgin-fgcolor"
-#define PIDGIN_STOCK_FILE_CANCELED "pidgin-file-cancelled"
+#define PIDGIN_STOCK_FILE_CANCELLED "pidgin-file-cancelled"
#define PIDGIN_STOCK_FILE_DONE "pidgin-file-done"
#define PIDGIN_STOCK_IGNORE "pidgin-ignore"
#define PIDGIN_STOCK_INFO "pidgin-info"
More information about the Commits
mailing list