aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorChandni Verma <chandniverma2112@gmail.com>2011-02-14 10:11:30 +0800
committerChandni Verma <chandniverma2112@gmail.com>2011-02-15 01:08:46 +0800
commitc7e246e02d143268e0e8fc310c2078d312e4b91a (patch)
tree7e2bef519932cc37cea8ae670143ec86b6f3ff84 /libempathy-gtk
parent9314023680793975ddd928ca3f7b672b605da760 (diff)
downloadgsoc2013-empathy-c7e246e02d143268e0e8fc310c2078d312e4b91a.tar
gsoc2013-empathy-c7e246e02d143268e0e8fc310c2078d312e4b91a.tar.gz
gsoc2013-empathy-c7e246e02d143268e0e8fc310c2078d312e4b91a.tar.bz2
gsoc2013-empathy-c7e246e02d143268e0e8fc310c2078d312e4b91a.tar.lz
gsoc2013-empathy-c7e246e02d143268e0e8fc310c2078d312e4b91a.tar.xz
gsoc2013-empathy-c7e246e02d143268e0e8fc310c2078d312e4b91a.tar.zst
gsoc2013-empathy-c7e246e02d143268e0e8fc310c2078d312e4b91a.zip
Reset network list button
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=642264
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-irc-network-chooser-dialog.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-irc-network-chooser-dialog.c b/libempathy-gtk/empathy-irc-network-chooser-dialog.c
index f81ba80bb..9d29aff4a 100644
--- a/libempathy-gtk/empathy-irc-network-chooser-dialog.c
+++ b/libempathy-gtk/empathy-irc-network-chooser-dialog.c
@@ -47,6 +47,10 @@ enum {
PROP_NETWORK
};
+enum {
+ RESPONSE_RESET = 0
+};
+
typedef struct {
EmpathyAccountSettings *settings;
EmpathyIrcNetwork *network;
@@ -390,6 +394,32 @@ remove_network (EmpathyIrcNetworkChooserDialog *self)
}
static void
+reset_networks (EmpathyIrcNetworkChooserDialog *self)
+{
+ EmpathyIrcNetworkChooserDialogPriv *priv = GET_PRIV (self);
+ GSList *networks, *l;
+
+ networks = empathy_irc_network_manager_get_dropped_networks (
+ priv->network_manager);
+
+ for (l = networks; l != NULL; l = g_slist_next (l))
+ {
+ EmpathyIrcNetwork *network;
+ GtkTreeIter iter;
+
+ network = EMPATHY_IRC_NETWORK (l->data);
+ empathy_irc_network_activate (network);
+
+ gtk_list_store_insert_with_values (priv->store, &iter, -1,
+ COL_NETWORK_OBJ, network,
+ COL_NETWORK_NAME, empathy_irc_network_get_name (network),
+ -1);
+ }
+
+ g_slist_foreach (networks, (GFunc) g_object_unref, NULL);
+}
+
+static void
dialog_response_cb (GtkDialog *dialog,
gint response,
EmpathyIrcNetworkChooserDialog *self)
@@ -400,6 +430,8 @@ dialog_response_cb (GtkDialog *dialog,
edit_network (self);
else if (response == GTK_RESPONSE_REJECT)
remove_network (self);
+ else if (response == RESPONSE_RESET)
+ reset_networks (self);
}
static gboolean
@@ -549,6 +581,7 @@ empathy_irc_network_chooser_dialog_constructed (GObject *object)
GTK_STOCK_ADD, GTK_RESPONSE_OK,
GTK_STOCK_EDIT, GTK_RESPONSE_APPLY,
GTK_STOCK_REMOVE, GTK_RESPONSE_REJECT,
+ _("Reset _Networks List"), RESPONSE_RESET,
NULL);
priv->select_button = gtk_dialog_add_button (dialog,