]> git.0d.be Git - empathy.git/blobdiff - src/empathy-chatrooms-window.c
Merge branch 'gnome-3-8'
[empathy.git] / src / empathy-chatrooms-window.c
index 35e3e8b9d78b171c35f98b8d96d544a8aba110be..553c91290c700af506246213be710472cf508a14 100644 (file)
  *          Mikael Hallendal <micke@imendio.com>
  */
 
-#include <config.h>
-
-#include <string.h>
-#include <stdio.h>
+#include "config.h"
+#include "empathy-chatrooms-window.h"
 
-#include <gtk/gtk.h>
-#include <glib.h>
 #include <glib/gi18n.h>
 
-#include <libempathy/empathy-chatroom-manager.h>
-#include <libempathy/empathy-utils.h>
-
-#include <libempathy-gtk/empathy-account-chooser.h>
-#include <libempathy-gtk/empathy-ui-utils.h>
-
-#include "empathy-chatrooms-window.h"
-#include "empathy-new-chatroom-dialog.h"
+#include "empathy-account-chooser.h"
+#include "empathy-chatroom-manager.h"
+#include "empathy-ui-utils.h"
+#include "empathy-utils.h"
 
 typedef struct {
        EmpathyChatroomManager *manager;
@@ -97,6 +89,8 @@ empathy_chatrooms_window_show (GtkWindow *parent)
        static EmpathyChatroomsWindow *window = NULL;
        GtkBuilder                    *gui;
        gchar                         *filename;
+       GtkWidget                     *sw, *toolbar;
+       GtkStyleContext               *context;
 
        if (window) {
                gtk_window_present (GTK_WINDOW (window->window));
@@ -110,12 +104,20 @@ empathy_chatrooms_window_show (GtkWindow *parent)
                                       "chatrooms_window", &window->window,
                                       "hbox_account", &window->hbox_account,
                                       "label_account", &window->label_account,
+                                      "sw_room_list", &sw,
                                       "treeview", &window->treeview,
+                                      "toolbar_remove", &toolbar,
                                       "button_remove", &window->button_remove,
                                       "button_close", &window->button_close,
                                       NULL);
        g_free (filename);
 
+       /* join the remove toolbar to the treeview */
+       context = gtk_widget_get_style_context (sw);
+       gtk_style_context_set_junction_sides (context, GTK_JUNCTION_BOTTOM);
+       context = gtk_widget_get_style_context (toolbar);
+       gtk_style_context_set_junction_sides (context, GTK_JUNCTION_TOP);
+
        empathy_builder_connect (gui, window,
                              "chatrooms_window", "destroy", chatrooms_window_destroy_cb,
                              "button_remove", "clicked", chatrooms_window_button_remove_clicked_cb,
@@ -139,7 +141,7 @@ empathy_chatrooms_window_show (GtkWindow *parent)
        /* Account chooser for chat rooms */
        window->account_chooser = empathy_account_chooser_new ();
        empathy_account_chooser_set_filter (EMPATHY_ACCOUNT_CHOOSER (window->account_chooser),
-                                           empathy_account_chooser_filter_is_connected,
+                                           empathy_account_chooser_filter_supports_chatrooms,
                                            NULL);
        g_object_set (window->account_chooser,
                      "has-all-option", TRUE,
@@ -338,8 +340,7 @@ chatrooms_window_model_add (EmpathyChatroomsWindow *window,
        model = gtk_tree_view_get_model (view);
        store = GTK_LIST_STORE (model);
 
-       gtk_list_store_append (store, &iter);
-       gtk_list_store_set (store, &iter,
+       gtk_list_store_insert_with_values (store, &iter, -1,
                            COL_NAME, empathy_chatroom_get_name (chatroom),
                            COL_ROOM, empathy_chatroom_get_room (chatroom),
                            COL_AUTO_CONNECT, empathy_chatroom_get_auto_connect (chatroom),