/soc/2015/igor.gajowiak/chatlog: 3f87635aeb7f: Implemented reloa...
Igor Gajowiak
igor.gajowiak at gmail.com
Sat Aug 1 04:52:38 EDT 2015
Changeset: 3f87635aeb7fc32b3dcdad41c650c935e3917220
Author: Igor Gajowiak <igor.gajowiak at gmail.com>
Date: 2015-08-01 10:52 +0200
Branch: default
URL: https://hg.pidgin.im/soc/2015/igor.gajowiak/chatlog/rev/3f87635aeb7f
Description:
Implemented reload button.
diffstat:
pidgin/gtkgenericlog.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diffs (52 lines):
diff --git a/pidgin/gtkgenericlog.c b/pidgin/gtkgenericlog.c
--- a/pidgin/gtkgenericlog.c
+++ b/pidgin/gtkgenericlog.c
@@ -38,6 +38,25 @@ static PidginGenericLogViewer *generic_l
/******************************************************************************/
static void
+populate_buddylist_store(GtkTreeStore *store);
+
+static void
+on_reload_item_clicked(GtkAction *action, gpointer data)
+{
+ g_assert(data);
+
+ PidginGenericLogViewer *viewer = (PidginGenericLogViewer*) data;
+
+ /* Unhook buddy list model during updating to get better performance */
+ gtk_tree_view_set_model(GTK_TREE_VIEW(viewer->blist_tree_view), NULL);
+
+ populate_buddylist_store(viewer->blist_tree_store);
+
+ gtk_tree_view_set_model(GTK_TREE_VIEW(viewer->blist_tree_view),
+ GTK_TREE_MODEL(viewer->blist_tree_store));
+}
+
+static void
on_search_item_clicked(GtkAction *action, gpointer data)
{
printf("on_search_item_clicked\n");
@@ -80,18 +99,22 @@ create_archive_menu_item(PidginGenericLo
GtkWidget *archive_menu = gtk_menu_new();
gtk_menu_item_set_submenu(GTK_MENU_ITEM(archive_item), archive_menu);
+ GtkWidget *reload_item = gtk_menu_item_new_with_label("Reload");
GtkWidget *search_item = gtk_menu_item_new_with_label("Search");
GtkWidget *export_item = gtk_menu_item_new_with_label("Export");
GtkWidget *import_item = gtk_menu_item_new_with_label("Import");
GtkWidget *print_item = gtk_menu_item_new_with_label("Print");
GtkWidget *close_item = gtk_menu_item_new_with_label("Close");
+ gtk_menu_shell_append(GTK_MENU_SHELL(archive_menu), reload_item);
gtk_menu_shell_append(GTK_MENU_SHELL(archive_menu), search_item);
gtk_menu_shell_append(GTK_MENU_SHELL(archive_menu), export_item);
gtk_menu_shell_append(GTK_MENU_SHELL(archive_menu), import_item);
gtk_menu_shell_append(GTK_MENU_SHELL(archive_menu), print_item);
gtk_menu_shell_append(GTK_MENU_SHELL(archive_menu), close_item);
+ g_signal_connect(G_OBJECT(reload_item), "activate",
+ G_CALLBACK(on_reload_item_clicked), viewer);
g_signal_connect(G_OBJECT(search_item), "activate",
G_CALLBACK(on_search_item_clicked), viewer);
g_signal_connect(G_OBJECT(export_item), "activate",
More information about the Commits
mailing list