Logo Search packages:      
Sourcecode: mail-notification version File versions

mn-mailbox-view.c

/* Generated by GOB (v2.0.11) on Sun Mar  6 22:34:27 2005
   (do not edit directly) */

/* End world hunger, donate to the World Food Programme, http://www.wfp.org */

#define GOB_VERSION_MAJOR 2
#define GOB_VERSION_MINOR 0
#define GOB_VERSION_PATCHLEVEL 11

#define selfp (self->_priv)

#include <string.h> /* memset() */

#include "mn-mailbox-view.h"

#include "mn-mailbox-view-private.h"

#ifdef G_LIKELY
#define ___GOB_LIKELY(expr) G_LIKELY(expr)
#define ___GOB_UNLIKELY(expr) G_UNLIKELY(expr)
#else /* ! G_LIKELY */
#define ___GOB_LIKELY(expr) (expr)
#define ___GOB_UNLIKELY(expr) (expr)
#endif /* G_LIKELY */

#line 24 "mn-mailbox-view.gob"

#include "config.h"
#include <glib/gi18n.h>
#include <gdk/gdkkeysyms.h>
#include "mn-util.h"
#include "mn-shell.h"
#include "mn-stock.h"
#include "mn-mailbox-properties-dialog.h"
#include "mn-conf.h"
#include "mn-uri.h"

#define GNOME_COPIED_FILES          "x-special/gnome-copied-files"

  enum {
    COLUMN_URI,
    COLUMN_MAILBOX_ICON,
    COLUMN_MAILBOX,
    COLUMN_FORMAT,
    N_COLUMNS
  };

  static GtkClipboard *global_clipboard;
  static GdkAtom gnome_copied_files_atom;

#line 52 "mn-mailbox-view.c"
/* self casting macros */
#define SELF(x) MN_MAILBOX_VIEW(x)
#define SELF_CONST(x) MN_MAILBOX_VIEW_CONST(x)
#define IS_SELF(x) MN_IS_MAILBOX_VIEW(x)
#define TYPE_SELF MN_TYPE_MAILBOX_VIEW
#define SELF_CLASS(x) MN_MAILBOX_VIEW_CLASS(x)

#define SELF_GET_CLASS(x) MN_MAILBOX_VIEW_GET_CLASS(x)

/* self typedefs */
typedef MNMailboxView Self;
typedef MNMailboxViewClass SelfClass;

/* here are local prototypes */
static void ___real_mn_mailbox_view_activate_add (MNMailboxView * self);
static void ___real_mn_mailbox_view_activate_remove (MNMailboxView * self);
static void ___real_mn_mailbox_view_activate_cut (MNMailboxView * self);
static void ___real_mn_mailbox_view_activate_copy (MNMailboxView * self);
static void ___real_mn_mailbox_view_activate_paste (MNMailboxView * self);
static void mn_mailbox_view_activate_paste_receive_cb (GtkClipboard * clipboard, GtkSelectionData * selection_data, gpointer data) G_GNUC_UNUSED;
static void ___real_mn_mailbox_view_activate_properties (MNMailboxView * self);
static void mn_mailbox_view_activate_properties_cb (GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter, gpointer data) G_GNUC_UNUSED;
static void mn_mailbox_view_class_init (MNMailboxViewClass * class) G_GNUC_UNUSED;
static void mn_mailbox_view_init (MNMailboxView * self) G_GNUC_UNUSED;
static void mn_mailbox_view_append (MNMailboxView * self, MNMailbox * mailbox) G_GNUC_UNUSED;
static void mn_mailbox_view_mailbox_added_h (MNMailboxes * mailboxes, MNMailbox * mailbox, gpointer user_data) G_GNUC_UNUSED;
static void mn_mailbox_view_mailbox_changed_h (MNMailboxes * mailboxes, MNMailbox * mailbox, gpointer user_data) G_GNUC_UNUSED;
static void mn_mailbox_view_mailbox_removed_h (MNMailboxes * mailboxes, MNMailbox * mailbox, gpointer user_data) G_GNUC_UNUSED;
static void mn_mailbox_view_update_iter (MNMailboxView * self, GtkTreeIter * iter, MNMailbox * mailbox) G_GNUC_UNUSED;
static gboolean mn_mailbox_view_find_mailbox (MNMailboxView * self, MNMailbox * mailbox, GtkTreeIter * iter) G_GNUC_UNUSED;
static void mn_mailbox_view_update_sensitivity (MNMailboxView * self) G_GNUC_UNUSED;
static void mn_mailbox_view_remove_mailbox (MNMailboxView * self) G_GNUC_UNUSED;
static void mn_mailbox_view_remove_mailbox_cb (GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter, gpointer data) G_GNUC_UNUSED;
static void mn_mailbox_view_copy_mailbox (MNMailboxView * self) G_GNUC_UNUSED;
static void mn_mailbox_view_copy_mailbox_cb (GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter, gpointer data) G_GNUC_UNUSED;
static void mn_mailbox_view_get_clipboard_cb (GtkClipboard * clipboard, GtkSelectionData * selection_data, unsigned int info, gpointer user_data_or_owner) G_GNUC_UNUSED;
static void mn_mailbox_view_clear_clipboard_cb (GtkClipboard * clipboard, gpointer user_data_or_owner) G_GNUC_UNUSED;
static void mn_mailbox_view_select_all (MNMailboxView * self) G_GNUC_UNUSED;
static void mn_mailbox_view_properties_add_response_h (GtkDialog * dialog, int response, gpointer user_data) G_GNUC_UNUSED;
static void mn_mailbox_view_properties_edit_response_h (GtkDialog * dialog, int response, gpointer user_data) G_GNUC_UNUSED;
static void mn_mailbox_view_popup_menu (MNMailboxView * self, unsigned int button, guint32 activate_time) G_GNUC_UNUSED;
static void mn_mailbox_view_popup_menu_receive_cb (GtkClipboard * clipboard, GtkSelectionData * selection_data, gpointer data) G_GNUC_UNUSED;
static gboolean mn_mailbox_view_popup_menu_h (GtkWidget * widget, gpointer user_data) G_GNUC_UNUSED;
static gboolean mn_mailbox_view_button_press_event_h (GtkWidget * widget, GdkEventButton * event, gpointer user_data) G_GNUC_UNUSED;
static void mn_mailbox_view_row_activated_h (GtkTreeView * treeview, GtkTreePath * path, GtkTreeViewColumn * column, gpointer user_data) G_GNUC_UNUSED;

/*
 * Signal connection wrapper macro shortcuts
 */
#define self_connect__activate_add(object,func,data)  mn_mailbox_view_connect__activate_add((object),(func),(data))
#define self_connect_after__activate_add(object,func,data)  mn_mailbox_view_connect_after__activate_add((object),(func),(data))
#define self_connect_data__activate_add(object,func,data,destroy_data,flags)  mn_mailbox_view_connect_data__activate_add((object),(func),(data),(destroy_data),(flags))
#define self_connect__activate_remove(object,func,data)     mn_mailbox_view_connect__activate_remove((object),(func),(data))
#define self_connect_after__activate_remove(object,func,data)     mn_mailbox_view_connect_after__activate_remove((object),(func),(data))
#define self_connect_data__activate_remove(object,func,data,destroy_data,flags)     mn_mailbox_view_connect_data__activate_remove((object),(func),(data),(destroy_data),(flags))
#define self_connect__activate_cut(object,func,data)  mn_mailbox_view_connect__activate_cut((object),(func),(data))
#define self_connect_after__activate_cut(object,func,data)  mn_mailbox_view_connect_after__activate_cut((object),(func),(data))
#define self_connect_data__activate_cut(object,func,data,destroy_data,flags)  mn_mailbox_view_connect_data__activate_cut((object),(func),(data),(destroy_data),(flags))
#define self_connect__activate_copy(object,func,data) mn_mailbox_view_connect__activate_copy((object),(func),(data))
#define self_connect_after__activate_copy(object,func,data) mn_mailbox_view_connect_after__activate_copy((object),(func),(data))
#define self_connect_data__activate_copy(object,func,data,destroy_data,flags) mn_mailbox_view_connect_data__activate_copy((object),(func),(data),(destroy_data),(flags))
#define self_connect__activate_paste(object,func,data)      mn_mailbox_view_connect__activate_paste((object),(func),(data))
#define self_connect_after__activate_paste(object,func,data)      mn_mailbox_view_connect_after__activate_paste((object),(func),(data))
#define self_connect_data__activate_paste(object,func,data,destroy_data,flags)      mn_mailbox_view_connect_data__activate_paste((object),(func),(data),(destroy_data),(flags))
#define self_connect__activate_properties(object,func,data) mn_mailbox_view_connect__activate_properties((object),(func),(data))
#define self_connect_after__activate_properties(object,func,data) mn_mailbox_view_connect_after__activate_properties((object),(func),(data))
#define self_connect_data__activate_properties(object,func,data,destroy_data,flags) mn_mailbox_view_connect_data__activate_properties((object),(func),(data),(destroy_data),(flags))

enum {
      ACTIVATE_ADD_SIGNAL,
      ACTIVATE_REMOVE_SIGNAL,
      ACTIVATE_CUT_SIGNAL,
      ACTIVATE_COPY_SIGNAL,
      ACTIVATE_PASTE_SIGNAL,
      ACTIVATE_PROPERTIES_SIGNAL,
      LAST_SIGNAL
};

static guint object_signals[LAST_SIGNAL] = {0};

/* pointer to the class of our parent */
static GtkTreeViewClass *parent_class = NULL;

/* Short form macros */
#define self_activate_add mn_mailbox_view_activate_add
#define self_activate_remove mn_mailbox_view_activate_remove
#define self_activate_cut mn_mailbox_view_activate_cut
#define self_activate_copy mn_mailbox_view_activate_copy
#define self_activate_paste mn_mailbox_view_activate_paste
#define self_activate_paste_receive_cb mn_mailbox_view_activate_paste_receive_cb
#define self_activate_properties mn_mailbox_view_activate_properties
#define self_activate_properties_cb mn_mailbox_view_activate_properties_cb
#define self_append mn_mailbox_view_append
#define self_mailbox_added_h mn_mailbox_view_mailbox_added_h
#define self_mailbox_changed_h mn_mailbox_view_mailbox_changed_h
#define self_mailbox_removed_h mn_mailbox_view_mailbox_removed_h
#define self_update_iter mn_mailbox_view_update_iter
#define self_find_mailbox mn_mailbox_view_find_mailbox
#define self_update_sensitivity mn_mailbox_view_update_sensitivity
#define self_remove_mailbox mn_mailbox_view_remove_mailbox
#define self_remove_mailbox_cb mn_mailbox_view_remove_mailbox_cb
#define self_copy_mailbox mn_mailbox_view_copy_mailbox
#define self_copy_mailbox_cb mn_mailbox_view_copy_mailbox_cb
#define self_get_clipboard_cb mn_mailbox_view_get_clipboard_cb
#define self_clear_clipboard_cb mn_mailbox_view_clear_clipboard_cb
#define self_select_all mn_mailbox_view_select_all
#define self_properties_add_response_h mn_mailbox_view_properties_add_response_h
#define self_properties_edit_response_h mn_mailbox_view_properties_edit_response_h
#define self_popup_menu mn_mailbox_view_popup_menu
#define self_popup_menu_receive_cb mn_mailbox_view_popup_menu_receive_cb
#define self_popup_menu_h mn_mailbox_view_popup_menu_h
#define self_button_press_event_h mn_mailbox_view_button_press_event_h
#define self_row_activated_h mn_mailbox_view_row_activated_h
#define self_new mn_mailbox_view_new
GType
mn_mailbox_view_get_type (void)
{
      static GType type = 0;

      if ___GOB_UNLIKELY(type == 0) {
            static const GTypeInfo info = {
                  sizeof (MNMailboxViewClass),
                  (GBaseInitFunc) NULL,
                  (GBaseFinalizeFunc) NULL,
                  (GClassInitFunc) mn_mailbox_view_class_init,
                  (GClassFinalizeFunc) NULL,
                  NULL /* class_data */,
                  sizeof (MNMailboxView),
                  0 /* n_preallocs */,
                  (GInstanceInitFunc) mn_mailbox_view_init,
                  NULL
            };

            type = g_type_register_static (GTK_TYPE_TREE_VIEW, "MNMailboxView", &info, (GTypeFlags)0);
      }

      return type;
}

/* a macro for creating a new object of our type */
#define GET_NEW ((MNMailboxView *)g_object_new(mn_mailbox_view_get_type(), NULL))

/* a function for creating a new object of our type */
#include <stdarg.h>
static MNMailboxView * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
static MNMailboxView *
GET_NEW_VARG (const char *first, ...)
{
      MNMailboxView *ret;
      va_list ap;
      va_start (ap, first);
      ret = (MNMailboxView *)g_object_new_valist (mn_mailbox_view_get_type (), first, ap);
      va_end (ap);
      return ret;
}


static void
___finalize(GObject *obj_self)
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::finalize"
      MNMailboxView *self G_GNUC_UNUSED = MN_MAILBOX_VIEW (obj_self);
      gpointer priv G_GNUC_UNUSED = self->_priv;
      if(G_OBJECT_CLASS(parent_class)->finalize) \
            (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
#line 51 "mn-mailbox-view.gob"
      if(self->_priv->menu) { gtk_widget_destroy ((gpointer) self->_priv->menu); self->_priv->menu = NULL; }
#line 220 "mn-mailbox-view.c"
}
#undef __GOB_FUNCTION__

#line 195 "mn-mailbox-view.gob"
static void 
mn_mailbox_view_class_init (MNMailboxViewClass * class G_GNUC_UNUSED)
#line 227 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::class_init"
      GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) class;

      g_type_class_add_private(class,sizeof(MNMailboxViewPrivate));

      parent_class = g_type_class_ref (GTK_TYPE_TREE_VIEW);

      object_signals[ACTIVATE_ADD_SIGNAL] =
            g_signal_new ("activate_add",
                  G_TYPE_FROM_CLASS (g_object_class),
                  (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION | G_SIGNAL_ACTION),
                  G_STRUCT_OFFSET (MNMailboxViewClass, activate_add),
                  NULL, NULL,
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
      object_signals[ACTIVATE_REMOVE_SIGNAL] =
            g_signal_new ("activate_remove",
                  G_TYPE_FROM_CLASS (g_object_class),
                  (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION | G_SIGNAL_ACTION),
                  G_STRUCT_OFFSET (MNMailboxViewClass, activate_remove),
                  NULL, NULL,
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
      object_signals[ACTIVATE_CUT_SIGNAL] =
            g_signal_new ("activate_cut",
                  G_TYPE_FROM_CLASS (g_object_class),
                  (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION | G_SIGNAL_ACTION),
                  G_STRUCT_OFFSET (MNMailboxViewClass, activate_cut),
                  NULL, NULL,
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
      object_signals[ACTIVATE_COPY_SIGNAL] =
            g_signal_new ("activate_copy",
                  G_TYPE_FROM_CLASS (g_object_class),
                  (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION | G_SIGNAL_ACTION),
                  G_STRUCT_OFFSET (MNMailboxViewClass, activate_copy),
                  NULL, NULL,
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
      object_signals[ACTIVATE_PASTE_SIGNAL] =
            g_signal_new ("activate_paste",
                  G_TYPE_FROM_CLASS (g_object_class),
                  (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION | G_SIGNAL_ACTION),
                  G_STRUCT_OFFSET (MNMailboxViewClass, activate_paste),
                  NULL, NULL,
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
      object_signals[ACTIVATE_PROPERTIES_SIGNAL] =
            g_signal_new ("activate_properties",
                  G_TYPE_FROM_CLASS (g_object_class),
                  (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION | G_SIGNAL_ACTION),
                  G_STRUCT_OFFSET (MNMailboxViewClass, activate_properties),
                  NULL, NULL,
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);

#line 58 "mn-mailbox-view.gob"
      class->activate_add = ___real_mn_mailbox_view_activate_add;
#line 75 "mn-mailbox-view.gob"
      class->activate_remove = ___real_mn_mailbox_view_activate_remove;
#line 81 "mn-mailbox-view.gob"
      class->activate_cut = ___real_mn_mailbox_view_activate_cut;
#line 88 "mn-mailbox-view.gob"
      class->activate_copy = ___real_mn_mailbox_view_activate_copy;
#line 94 "mn-mailbox-view.gob"
      class->activate_paste = ___real_mn_mailbox_view_activate_paste;
#line 152 "mn-mailbox-view.gob"
      class->activate_properties = ___real_mn_mailbox_view_activate_properties;
#line 297 "mn-mailbox-view.c"
      g_object_class->finalize = ___finalize;
 {
#line 196 "mn-mailbox-view.gob"

    GtkBindingSet *binding_set;

    global_clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
    gnome_copied_files_atom = gdk_atom_intern(GNOME_COPIED_FILES, FALSE);

    binding_set = gtk_binding_set_by_class(class);

    /* Delete removes a row */
    gtk_binding_entry_add_signal(binding_set, GDK_Delete, 0, "activate-remove", 0);
    gtk_binding_entry_add_signal(binding_set, GDK_KP_Delete, 0, "activate-remove", 0);

    /* HIG 2.0 cut/copy/paste shortcuts */
    gtk_binding_entry_add_signal(binding_set, GDK_x, GDK_CONTROL_MASK, "activate-cut", 0);
    gtk_binding_entry_add_signal(binding_set, GDK_c, GDK_CONTROL_MASK, "activate-copy", 0);
    gtk_binding_entry_add_signal(binding_set, GDK_v, GDK_CONTROL_MASK, "activate-paste", 0);
    
    /* cut/copy/paste shortcuts taken from gtkentry.c */
    gtk_binding_entry_add_signal(binding_set, GDK_Delete, GDK_SHIFT_MASK, "activate-cut", 0);
    gtk_binding_entry_add_signal(binding_set, GDK_Insert, GDK_CONTROL_MASK, "activate-copy", 0);
    gtk_binding_entry_add_signal(binding_set, GDK_Insert, GDK_SHIFT_MASK, "activate-paste", 0);

    /* HIG 2.0 properties */
    gtk_binding_entry_add_signal(binding_set, GDK_Return, GDK_MOD1_MASK, "activate-properties", 0);
    gtk_binding_entry_add_signal(binding_set, GDK_ISO_Enter, GDK_MOD1_MASK, "activate-properties", 0);
    gtk_binding_entry_add_signal(binding_set, GDK_KP_Enter, GDK_MOD1_MASK, "activate-properties", 0);
  
#line 328 "mn-mailbox-view.c"
 }
}
#undef __GOB_FUNCTION__
#line 224 "mn-mailbox-view.gob"
static void 
mn_mailbox_view_init (MNMailboxView * self G_GNUC_UNUSED)
#line 335 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::init"
      self->_priv = G_TYPE_INSTANCE_GET_PRIVATE(self,TYPE_SELF,MNMailboxViewPrivate);
#line 51 "mn-mailbox-view.gob"
      self->_priv->menu = gtk_menu_new();
#line 341 "mn-mailbox-view.c"
 {
#line 225 "mn-mailbox-view.gob"

    GtkMenuShell *shell;
    GtkWidget *add_item;
    GtkWidget *select_all_item;
    GtkListStore *store;
    GtkTreeViewColumn *column;
    GtkCellRenderer *renderer;
    GtkTreeSelection *selection;
    GSList *l;

    /* popup menu */

    shell = GTK_MENU_SHELL(selfp->menu);
    
    add_item = mn_menu_shell_append(shell, GTK_STOCK_ADD, NULL);
    selfp->remove_item = mn_menu_shell_append(shell, GTK_STOCK_REMOVE, NULL);
    mn_menu_shell_append(shell, NULL, NULL);
    selfp->cut_item = mn_menu_shell_append(shell, GTK_STOCK_CUT, NULL);
    selfp->copy_item = mn_menu_shell_append(shell, GTK_STOCK_COPY, NULL);
    selfp->paste_item = mn_menu_shell_append(shell, GTK_STOCK_PASTE, NULL);
    mn_menu_shell_append(shell, NULL, NULL);
    select_all_item = mn_menu_shell_append(shell, MN_STOCK_SELECT_ALL, NULL);
    mn_menu_shell_append(shell, NULL, NULL);
    selfp->properties_item = mn_menu_shell_append(shell, GTK_STOCK_PROPERTIES, NULL);
    
    g_signal_connect_swapped(add_item, "activate", G_CALLBACK(self_activate_add), self);
    g_signal_connect_swapped(selfp->remove_item, "activate", G_CALLBACK(self_activate_remove), self);
    g_signal_connect_swapped(selfp->cut_item, "activate", G_CALLBACK(self_activate_cut), self);
    g_signal_connect_swapped(selfp->copy_item, "activate", G_CALLBACK(self_activate_copy), self);
    g_signal_connect_swapped(selfp->paste_item, "activate", G_CALLBACK(self_activate_paste), self);
    g_signal_connect_swapped(select_all_item, "activate", G_CALLBACK(self_select_all), self);
    g_signal_connect_swapped(selfp->properties_item, "activate", G_CALLBACK(self_activate_properties), self);

    /* store */

    store = gtk_list_store_new(N_COLUMNS,
                         MN_TYPE_URI,
                         G_TYPE_STRING,
                         G_TYPE_STRING,
                         G_TYPE_STRING);
    gtk_tree_view_set_model(GTK_TREE_VIEW(self), GTK_TREE_MODEL(store));
    g_object_unref(store);
    
    /* mailbox column */

    column = gtk_tree_view_column_new();
    gtk_tree_view_column_set_title(column, _("Mailbox"));
    gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
    gtk_tree_view_column_set_sort_column_id(column, COLUMN_MAILBOX);

    renderer = gtk_cell_renderer_pixbuf_new();
    gtk_tree_view_column_pack_start(column, renderer, FALSE);
    gtk_tree_view_column_add_attribute(column, renderer, "stock-id", COLUMN_MAILBOX_ICON);

    renderer = gtk_cell_renderer_text_new();
    gtk_tree_view_column_pack_start(column, renderer, TRUE);
    gtk_tree_view_column_add_attribute(column, renderer, "text", COLUMN_MAILBOX);

    gtk_tree_view_append_column(GTK_TREE_VIEW(self), column);

    /* format column */

    column = gtk_tree_view_column_new_with_attributes(_("Format"),
                                          gtk_cell_renderer_text_new(),
                                          "text", COLUMN_FORMAT,
                                          NULL);

    gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
    gtk_tree_view_column_set_sort_column_id(column, COLUMN_FORMAT);
    gtk_tree_view_append_column(GTK_TREE_VIEW(self), column);

    /* misc */

    gtk_tree_view_set_search_column(GTK_TREE_VIEW(self), COLUMN_MAILBOX);

    selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(self));
    gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
    
    MN_LIST_FOREACH(l, mn_mailboxes_get(mn_shell->mailboxes))
      self_append(self, l->data);
    self_update_sensitivity(self);

    mn_g_object_connect(self,
                  mn_shell->mailboxes,
                  "signal::mailbox-added", self_mailbox_added_h, self,
                  "signal::mailbox-changed", self_mailbox_changed_h, self,
                  "signal::mailbox-removed", self_mailbox_removed_h, self,
                  NULL);

    g_signal_connect_swapped(selection, "changed", G_CALLBACK(self_update_sensitivity), self);

    g_object_connect(self,
                 "signal::popup-menu", self_popup_menu_h, NULL,
                 "signal::button-press-event", self_button_press_event_h, NULL,
                 "signal::row-activated", self_row_activated_h, NULL,
                 NULL);
  
#line 441 "mn-mailbox-view.c"
 }
}
#undef __GOB_FUNCTION__

#line 58 "mn-mailbox-view.gob"
void 
mn_mailbox_view_activate_add (MNMailboxView * self)
#line 449 "mn-mailbox-view.c"
{
      GValue ___param_values[1];
      GValue ___return_val;

memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));

#line 58 "mn-mailbox-view.gob"
      g_return_if_fail (self != NULL);
#line 58 "mn-mailbox-view.gob"
      g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
#line 461 "mn-mailbox-view.c"

      ___param_values[0].g_type = 0;
      g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
      g_value_set_instance (&___param_values[0], (gpointer) self);

      g_signal_emitv (___param_values,
            object_signals[ACTIVATE_ADD_SIGNAL],
            0 /* detail */,
            &___return_val);

      g_value_unset (&___param_values[0]);
}
#line 58 "mn-mailbox-view.gob"
static void 
___real_mn_mailbox_view_activate_add (MNMailboxView * self G_GNUC_UNUSED)
#line 477 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_add"
{
#line 60 "mn-mailbox-view.gob"
      
    GtkWidget *toplevel;
    GtkWidget *dialog;

    toplevel = gtk_widget_get_toplevel(GTK_WIDGET(self));
    dialog = mn_mailbox_properties_dialog_new(GTK_WINDOW(toplevel), NULL);

    g_signal_connect(dialog,
                 "response",
                 G_CALLBACK(self_properties_add_response_h),
                 NULL);

    gtk_widget_show(dialog);
  }}
#line 496 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 75 "mn-mailbox-view.gob"
void 
mn_mailbox_view_activate_remove (MNMailboxView * self)
#line 502 "mn-mailbox-view.c"
{
      GValue ___param_values[1];
      GValue ___return_val;

memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));

#line 75 "mn-mailbox-view.gob"
      g_return_if_fail (self != NULL);
#line 75 "mn-mailbox-view.gob"
      g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
#line 514 "mn-mailbox-view.c"

      ___param_values[0].g_type = 0;
      g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
      g_value_set_instance (&___param_values[0], (gpointer) self);

      g_signal_emitv (___param_values,
            object_signals[ACTIVATE_REMOVE_SIGNAL],
            0 /* detail */,
            &___return_val);

      g_value_unset (&___param_values[0]);
}
#line 75 "mn-mailbox-view.gob"
static void 
___real_mn_mailbox_view_activate_remove (MNMailboxView * self G_GNUC_UNUSED)
#line 530 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_remove"
{
#line 77 "mn-mailbox-view.gob"
      
    self_remove_mailbox(self);
  }}
#line 538 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 81 "mn-mailbox-view.gob"
void 
mn_mailbox_view_activate_cut (MNMailboxView * self)
#line 544 "mn-mailbox-view.c"
{
      GValue ___param_values[1];
      GValue ___return_val;

memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));

#line 81 "mn-mailbox-view.gob"
      g_return_if_fail (self != NULL);
#line 81 "mn-mailbox-view.gob"
      g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
#line 556 "mn-mailbox-view.c"

      ___param_values[0].g_type = 0;
      g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
      g_value_set_instance (&___param_values[0], (gpointer) self);

      g_signal_emitv (___param_values,
            object_signals[ACTIVATE_CUT_SIGNAL],
            0 /* detail */,
            &___return_val);

      g_value_unset (&___param_values[0]);
}
#line 81 "mn-mailbox-view.gob"
static void 
___real_mn_mailbox_view_activate_cut (MNMailboxView * self G_GNUC_UNUSED)
#line 572 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_cut"
{
#line 83 "mn-mailbox-view.gob"
      
    self_copy_mailbox(self);
    self_remove_mailbox(self);
  }}
#line 581 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 88 "mn-mailbox-view.gob"
void 
mn_mailbox_view_activate_copy (MNMailboxView * self)
#line 587 "mn-mailbox-view.c"
{
      GValue ___param_values[1];
      GValue ___return_val;

memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));

#line 88 "mn-mailbox-view.gob"
      g_return_if_fail (self != NULL);
#line 88 "mn-mailbox-view.gob"
      g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
#line 599 "mn-mailbox-view.c"

      ___param_values[0].g_type = 0;
      g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
      g_value_set_instance (&___param_values[0], (gpointer) self);

      g_signal_emitv (___param_values,
            object_signals[ACTIVATE_COPY_SIGNAL],
            0 /* detail */,
            &___return_val);

      g_value_unset (&___param_values[0]);
}
#line 88 "mn-mailbox-view.gob"
static void 
___real_mn_mailbox_view_activate_copy (MNMailboxView * self G_GNUC_UNUSED)
#line 615 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_copy"
{
#line 90 "mn-mailbox-view.gob"
      
    self_copy_mailbox(self);
  }}
#line 623 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 94 "mn-mailbox-view.gob"
void 
mn_mailbox_view_activate_paste (MNMailboxView * self)
#line 629 "mn-mailbox-view.c"
{
      GValue ___param_values[1];
      GValue ___return_val;

memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));

#line 94 "mn-mailbox-view.gob"
      g_return_if_fail (self != NULL);
#line 94 "mn-mailbox-view.gob"
      g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
#line 641 "mn-mailbox-view.c"

      ___param_values[0].g_type = 0;
      g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
      g_value_set_instance (&___param_values[0], (gpointer) self);

      g_signal_emitv (___param_values,
            object_signals[ACTIVATE_PASTE_SIGNAL],
            0 /* detail */,
            &___return_val);

      g_value_unset (&___param_values[0]);
}
#line 94 "mn-mailbox-view.gob"
static void 
___real_mn_mailbox_view_activate_paste (MNMailboxView * self G_GNUC_UNUSED)
#line 657 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_paste"
{
#line 96 "mn-mailbox-view.gob"
      
    gtk_clipboard_request_contents(global_clipboard,
                           gnome_copied_files_atom,
                           self_activate_paste_receive_cb,
                           NULL);
  }}
#line 668 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 103 "mn-mailbox-view.gob"
static void 
mn_mailbox_view_activate_paste_receive_cb (GtkClipboard * clipboard, GtkSelectionData * selection_data, gpointer data)
#line 674 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_paste_receive_cb"
#line 103 "mn-mailbox-view.gob"
      g_return_if_fail (clipboard != NULL);
#line 103 "mn-mailbox-view.gob"
      g_return_if_fail (selection_data != NULL);
#line 681 "mn-mailbox-view.c"
{
#line 107 "mn-mailbox-view.gob"
      
    if (selection_data->type == gnome_copied_files_atom
      && selection_data->format == 8
      && selection_data->length > 0)
      {
      char *gnome_copied_files;
      gboolean status;
      MNGnomeCopiedFilesType type;
      GSList *uri_list;

      gnome_copied_files = g_strndup(selection_data->data, selection_data->length);
      status = mn_parse_gnome_copied_files(gnome_copied_files, &type, &uri_list);
      g_free(gnome_copied_files);

      if (status)
        {
          if (type == MN_GNOME_COPIED_FILES_COPY)
            {
            GSList *new_mailboxes = NULL;
            GSList *l;
            
            MN_LIST_FOREACH(l, uri_list)
                {
                const char *uri = l->data;
                
                if (! mn_mailboxes_find(mn_shell->mailboxes, uri))
                  new_mailboxes = g_slist_append(new_mailboxes, g_strdup(uri));
              }

            if (new_mailboxes)
              {
                GSList *gconf_mailboxes;
                
                gconf_mailboxes = eel_gconf_get_string_list(MN_CONF_MAILBOXES);
                gconf_mailboxes = g_slist_concat(gconf_mailboxes, new_mailboxes);
                eel_gconf_set_string_list(MN_CONF_MAILBOXES, gconf_mailboxes);
                eel_g_slist_free_deep(gconf_mailboxes);
              }
            }

          eel_g_slist_free_deep(uri_list);
        }
      }
  }}
#line 728 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 152 "mn-mailbox-view.gob"
void 
mn_mailbox_view_activate_properties (MNMailboxView * self)
#line 734 "mn-mailbox-view.c"
{
      GValue ___param_values[1];
      GValue ___return_val;

memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));

#line 152 "mn-mailbox-view.gob"
      g_return_if_fail (self != NULL);
#line 152 "mn-mailbox-view.gob"
      g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
#line 746 "mn-mailbox-view.c"

      ___param_values[0].g_type = 0;
      g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
      g_value_set_instance (&___param_values[0], (gpointer) self);

      g_signal_emitv (___param_values,
            object_signals[ACTIVATE_PROPERTIES_SIGNAL],
            0 /* detail */,
            &___return_val);

      g_value_unset (&___param_values[0]);
}
#line 152 "mn-mailbox-view.gob"
static void 
___real_mn_mailbox_view_activate_properties (MNMailboxView * self G_GNUC_UNUSED)
#line 762 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_properties"
{
#line 154 "mn-mailbox-view.gob"
      
    GtkTreeSelection *selection;

    selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(self));
    gtk_tree_selection_selected_foreach(selection, self_activate_properties_cb, self);
  }}
#line 773 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 161 "mn-mailbox-view.gob"
static void 
mn_mailbox_view_activate_properties_cb (GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter, gpointer data)
#line 779 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::activate_properties_cb"
#line 161 "mn-mailbox-view.gob"
      g_return_if_fail (model != NULL);
#line 161 "mn-mailbox-view.gob"
      g_return_if_fail (GTK_IS_TREE_MODEL (model));
#line 161 "mn-mailbox-view.gob"
      g_return_if_fail (path != NULL);
#line 161 "mn-mailbox-view.gob"
      g_return_if_fail (iter != NULL);
#line 161 "mn-mailbox-view.gob"
      g_return_if_fail (data != NULL);
#line 792 "mn-mailbox-view.c"
{
#line 166 "mn-mailbox-view.gob"
      
    Self *self = data;
    MNURI *uri;
    GtkWidget *dialog;

    gtk_tree_model_get(model, iter, COLUMN_URI, &uri, -1);

    dialog = (GtkWidget *) mn_shell_get_mailbox_properties_dialog(mn_shell, uri);
    if (dialog)
      gtk_window_present(GTK_WINDOW(dialog));
    else
      {
      GtkWidget *toplevel;
      
      toplevel = gtk_widget_get_toplevel(GTK_WIDGET(self));
      dialog = mn_mailbox_properties_dialog_new(GTK_WINDOW(toplevel), uri);

      g_signal_connect(dialog,
                   "response",
                   G_CALLBACK(self_properties_edit_response_h),
                   NULL);

      mn_shell_add_mailbox_properties_dialog(mn_shell, MN_MAILBOX_PROPERTIES_DIALOG(dialog));
      gtk_widget_show(dialog);
      }

    g_object_unref(uri);
  }}
#line 823 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__



#line 323 "mn-mailbox-view.gob"
static void 
mn_mailbox_view_append (MNMailboxView * self, MNMailbox * mailbox)
#line 831 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::append"
#line 323 "mn-mailbox-view.gob"
      g_return_if_fail (self != NULL);
#line 323 "mn-mailbox-view.gob"
      g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
#line 323 "mn-mailbox-view.gob"
      g_return_if_fail (mailbox != NULL);
#line 323 "mn-mailbox-view.gob"
      g_return_if_fail (MN_IS_MAILBOX (mailbox));
#line 842 "mn-mailbox-view.c"
{
#line 325 "mn-mailbox-view.gob"
      
    GtkTreeModel *model;
    GtkTreeIter iter;

    model = gtk_tree_view_get_model(GTK_TREE_VIEW(self));
    gtk_list_store_append(GTK_LIST_STORE(model), &iter);
    self_update_iter(self, &iter, mailbox);
  }}
#line 853 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 334 "mn-mailbox-view.gob"
static void 
mn_mailbox_view_mailbox_added_h (MNMailboxes * mailboxes, MNMailbox * mailbox, gpointer user_data)
#line 859 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::mailbox_added_h"
#line 334 "mn-mailbox-view.gob"
      g_return_if_fail (mailboxes != NULL);
#line 334 "mn-mailbox-view.gob"
      g_return_if_fail (MN_IS_MAILBOXES (mailboxes));
#line 334 "mn-mailbox-view.gob"
      g_return_if_fail (mailbox != NULL);
#line 334 "mn-mailbox-view.gob"
      g_return_if_fail (MN_IS_MAILBOX (mailbox));
#line 334 "mn-mailbox-view.gob"
      g_return_if_fail (user_data != NULL);
#line 872 "mn-mailbox-view.c"
{
#line 338 "mn-mailbox-view.gob"
      
    Self *self = user_data;

    self_append(self, mailbox);
  }}
#line 880 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 344 "mn-mailbox-view.gob"
static void 
mn_mailbox_view_mailbox_changed_h (MNMailboxes * mailboxes, MNMailbox * mailbox, gpointer user_data)
#line 886 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::mailbox_changed_h"
#line 344 "mn-mailbox-view.gob"
      g_return_if_fail (mailboxes != NULL);
#line 344 "mn-mailbox-view.gob"
      g_return_if_fail (MN_IS_MAILBOXES (mailboxes));
#line 344 "mn-mailbox-view.gob"
      g_return_if_fail (mailbox != NULL);
#line 344 "mn-mailbox-view.gob"
      g_return_if_fail (MN_IS_MAILBOX (mailbox));
#line 344 "mn-mailbox-view.gob"
      g_return_if_fail (user_data != NULL);
#line 899 "mn-mailbox-view.c"
{
#line 348 "mn-mailbox-view.gob"
      
    Self *self = user_data;
    GtkTreeIter iter;

    if (self_find_mailbox(self, mailbox, &iter))
      self_update_iter(self, &iter, mailbox);
  }}
#line 909 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 356 "mn-mailbox-view.gob"
static void 
mn_mailbox_view_mailbox_removed_h (MNMailboxes * mailboxes, MNMailbox * mailbox, gpointer user_data)
#line 915 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::mailbox_removed_h"
#line 356 "mn-mailbox-view.gob"
      g_return_if_fail (mailboxes != NULL);
#line 356 "mn-mailbox-view.gob"
      g_return_if_fail (MN_IS_MAILBOXES (mailboxes));
#line 356 "mn-mailbox-view.gob"
      g_return_if_fail (mailbox != NULL);
#line 356 "mn-mailbox-view.gob"
      g_return_if_fail (MN_IS_MAILBOX (mailbox));
#line 356 "mn-mailbox-view.gob"
      g_return_if_fail (user_data != NULL);
#line 928 "mn-mailbox-view.c"
{
#line 360 "mn-mailbox-view.gob"
      
    Self *self = user_data;
    GtkTreeIter iter;

    if (self_find_mailbox(self, mailbox, &iter))
      {
      GtkTreeModel *model;
      
      model = gtk_tree_view_get_model(GTK_TREE_VIEW(self));
      gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
      }
  }}
#line 943 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 373 "mn-mailbox-view.gob"
static void 
mn_mailbox_view_update_iter (MNMailboxView * self, GtkTreeIter * iter, MNMailbox * mailbox)
#line 949 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::update_iter"
#line 373 "mn-mailbox-view.gob"
      g_return_if_fail (self != NULL);
#line 373 "mn-mailbox-view.gob"
      g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
#line 373 "mn-mailbox-view.gob"
      g_return_if_fail (iter != NULL);
#line 373 "mn-mailbox-view.gob"
      g_return_if_fail (mailbox != NULL);
#line 373 "mn-mailbox-view.gob"
      g_return_if_fail (MN_IS_MAILBOX (mailbox));
#line 962 "mn-mailbox-view.c"
{
#line 377 "mn-mailbox-view.gob"
      
    MNMailboxClass *class;
    const char *stock_id;
    GtkTreeModel *model;

    class = MN_MAILBOX_GET_CLASS(mailbox);
  
    if (MN_URI_IS_SYSTEM_MAILBOX(mailbox->uri))
      stock_id = MN_STOCK_SYSTEM_MAILBOX;
    else
    {
      if (class->stock_id)
      stock_id = class->stock_id;
      else
      stock_id = MN_URI_IS_LOCAL(mailbox->uri) ? MN_STOCK_LOCAL : MN_STOCK_REMOTE;
    }

    model = gtk_tree_view_get_model(GTK_TREE_VIEW(self));
    gtk_list_store_set(GTK_LIST_STORE(model), iter,
                   COLUMN_URI, mailbox->uri,
                   COLUMN_MAILBOX_ICON, stock_id,
                   COLUMN_MAILBOX, mn_mailbox_get_name(mailbox),
                   COLUMN_FORMAT, class->format,
                   -1);
  }}
#line 990 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 403 "mn-mailbox-view.gob"
static gboolean 
mn_mailbox_view_find_mailbox (MNMailboxView * self, MNMailbox * mailbox, GtkTreeIter * iter)
#line 996 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::find_mailbox"
#line 403 "mn-mailbox-view.gob"
      g_return_val_if_fail (self != NULL, (gboolean )0);
#line 403 "mn-mailbox-view.gob"
      g_return_val_if_fail (MN_IS_MAILBOX_VIEW (self), (gboolean )0);
#line 403 "mn-mailbox-view.gob"
      g_return_val_if_fail (mailbox != NULL, (gboolean )0);
#line 403 "mn-mailbox-view.gob"
      g_return_val_if_fail (MN_IS_MAILBOX (mailbox), (gboolean )0);
#line 403 "mn-mailbox-view.gob"
      g_return_val_if_fail (iter != NULL, (gboolean )0);
#line 1009 "mn-mailbox-view.c"
{
#line 407 "mn-mailbox-view.gob"
      
    GtkTreeModel *model;
    GtkTreeIter our_iter;
    gboolean valid;

    model = gtk_tree_view_get_model(GTK_TREE_VIEW(self));
    valid = gtk_tree_model_get_iter_first(model, &our_iter);

    while (valid)
      {
      MNURI *uri;
      gboolean is;
      
      gtk_tree_model_get(model, &our_iter, COLUMN_URI, &uri, -1);
      is = ! strcmp(uri->text, mailbox->uri->text);
      g_object_unref(uri);

      if (is)
        {
          *iter = our_iter;
          return TRUE;
        }

      valid = gtk_tree_model_iter_next(model, &our_iter);
      }

    return FALSE;
  }}
#line 1040 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 436 "mn-mailbox-view.gob"
static void 
mn_mailbox_view_update_sensitivity (MNMailboxView * self)
#line 1046 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::update_sensitivity"
#line 436 "mn-mailbox-view.gob"
      g_return_if_fail (self != NULL);
#line 436 "mn-mailbox-view.gob"
      g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
#line 1053 "mn-mailbox-view.c"
{
#line 438 "mn-mailbox-view.gob"
      
    GtkTreeSelection *selection;
    gboolean has_selection;
    
    selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(self));
    has_selection = gtk_tree_selection_count_selected_rows(selection) > 0;

    gtk_widget_set_sensitive(selfp->remove_item, has_selection);
    gtk_widget_set_sensitive(selfp->cut_item, has_selection);
    gtk_widget_set_sensitive(selfp->copy_item, has_selection);
    gtk_widget_set_sensitive(selfp->properties_item, has_selection);
  }}
#line 1068 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 451 "mn-mailbox-view.gob"
static void 
mn_mailbox_view_remove_mailbox (MNMailboxView * self)
#line 1074 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::remove_mailbox"
#line 451 "mn-mailbox-view.gob"
      g_return_if_fail (self != NULL);
#line 451 "mn-mailbox-view.gob"
      g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
#line 1081 "mn-mailbox-view.c"
{
#line 453 "mn-mailbox-view.gob"
      
    GtkTreeSelection *selection;
    GSList *gconf_mailboxes;
    
    gconf_mailboxes = eel_gconf_get_string_list(MN_CONF_MAILBOXES);
    
    selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(self));
    gtk_tree_selection_selected_foreach(selection, self_remove_mailbox_cb, &gconf_mailboxes);
    eel_gconf_set_string_list(MN_CONF_MAILBOXES, gconf_mailboxes);
    eel_g_slist_free_deep(gconf_mailboxes);
  }}
#line 1095 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 465 "mn-mailbox-view.gob"
static void 
mn_mailbox_view_remove_mailbox_cb (GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter, gpointer data)
#line 1101 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::remove_mailbox_cb"
#line 465 "mn-mailbox-view.gob"
      g_return_if_fail (model != NULL);
#line 465 "mn-mailbox-view.gob"
      g_return_if_fail (GTK_IS_TREE_MODEL (model));
#line 465 "mn-mailbox-view.gob"
      g_return_if_fail (path != NULL);
#line 465 "mn-mailbox-view.gob"
      g_return_if_fail (iter != NULL);
#line 465 "mn-mailbox-view.gob"
      g_return_if_fail (data != NULL);
#line 1114 "mn-mailbox-view.c"
{
#line 470 "mn-mailbox-view.gob"
      
    GSList **gconf_mailboxes = data;
    MNURI *uri;
    GSList *elem;
  
    gtk_tree_model_get(model, iter, COLUMN_URI, &uri, -1);

    /* remove all the mailboxes with that URI */
    while ((elem = mn_mailboxes_conf_find_uri(*gconf_mailboxes, uri)))
      *gconf_mailboxes = mn_g_slist_delete_link_deep(*gconf_mailboxes, elem);

    g_object_unref(uri);
  }}
#line 1130 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 484 "mn-mailbox-view.gob"
static void 
mn_mailbox_view_copy_mailbox (MNMailboxView * self)
#line 1136 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::copy_mailbox"
#line 484 "mn-mailbox-view.gob"
      g_return_if_fail (self != NULL);
#line 484 "mn-mailbox-view.gob"
      g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
#line 1143 "mn-mailbox-view.c"
{
#line 486 "mn-mailbox-view.gob"
      
    GtkTreeSelection *selection;
    GSList *uri_list = NULL;
    char *gnome_copied_files;
    const GtkTargetEntry target = { GNOME_COPIED_FILES, 0, 0 };
    gboolean status;

    selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(self));
    gtk_tree_selection_selected_foreach(selection, self_copy_mailbox_cb, &uri_list);

    gnome_copied_files = mn_build_gnome_copied_files(MN_GNOME_COPIED_FILES_COPY, uri_list);
    eel_g_slist_free_deep(uri_list);

    status = gtk_clipboard_set_with_data(global_clipboard,
                               &target,
                               1,
                               self_get_clipboard_cb,
                               self_clear_clipboard_cb,
                               gnome_copied_files);
    g_return_if_fail(status == TRUE);
  }}
#line 1167 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 508 "mn-mailbox-view.gob"
static void 
mn_mailbox_view_copy_mailbox_cb (GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter, gpointer data)
#line 1173 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::copy_mailbox_cb"
#line 508 "mn-mailbox-view.gob"
      g_return_if_fail (model != NULL);
#line 508 "mn-mailbox-view.gob"
      g_return_if_fail (GTK_IS_TREE_MODEL (model));
#line 508 "mn-mailbox-view.gob"
      g_return_if_fail (path != NULL);
#line 508 "mn-mailbox-view.gob"
      g_return_if_fail (iter != NULL);
#line 508 "mn-mailbox-view.gob"
      g_return_if_fail (data != NULL);
#line 1186 "mn-mailbox-view.c"
{
#line 513 "mn-mailbox-view.gob"
      
    GSList **uri_list = data;
    MNURI *uri;

    gtk_tree_model_get(model, iter, COLUMN_URI, &uri, -1);
    *uri_list = g_slist_append(*uri_list, g_strdup(uri->text));
    g_object_unref(uri);
  }}
#line 1197 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 522 "mn-mailbox-view.gob"
static void 
mn_mailbox_view_get_clipboard_cb (GtkClipboard * clipboard, GtkSelectionData * selection_data, unsigned int info, gpointer user_data_or_owner)
#line 1203 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::get_clipboard_cb"
#line 522 "mn-mailbox-view.gob"
      g_return_if_fail (clipboard != NULL);
#line 522 "mn-mailbox-view.gob"
      g_return_if_fail (selection_data != NULL);
#line 522 "mn-mailbox-view.gob"
      g_return_if_fail (user_data_or_owner != NULL);
#line 1212 "mn-mailbox-view.c"
{
#line 527 "mn-mailbox-view.gob"
      
    const char *gnome_copied_files = user_data_or_owner;
    gtk_selection_data_set(selection_data, gnome_copied_files_atom, 8, gnome_copied_files, strlen(gnome_copied_files));
  }}
#line 1219 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 532 "mn-mailbox-view.gob"
static void 
mn_mailbox_view_clear_clipboard_cb (GtkClipboard * clipboard, gpointer user_data_or_owner)
#line 1225 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::clear_clipboard_cb"
#line 532 "mn-mailbox-view.gob"
      g_return_if_fail (clipboard != NULL);
#line 532 "mn-mailbox-view.gob"
      g_return_if_fail (user_data_or_owner != NULL);
#line 1232 "mn-mailbox-view.c"
{
#line 535 "mn-mailbox-view.gob"
      
    char *gnome_copied_files = user_data_or_owner;
    g_free(gnome_copied_files);
  }}
#line 1239 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 540 "mn-mailbox-view.gob"
static void 
mn_mailbox_view_select_all (MNMailboxView * self)
#line 1245 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::select_all"
#line 540 "mn-mailbox-view.gob"
      g_return_if_fail (self != NULL);
#line 540 "mn-mailbox-view.gob"
      g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
#line 1252 "mn-mailbox-view.c"
{
#line 542 "mn-mailbox-view.gob"
      
    GtkTreeSelection *selection;
    
    selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(self));
    gtk_tree_selection_select_all(selection);
  }}
#line 1261 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 549 "mn-mailbox-view.gob"
static void 
mn_mailbox_view_properties_add_response_h (GtkDialog * dialog, int response, gpointer user_data)
#line 1267 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::properties_add_response_h"
#line 549 "mn-mailbox-view.gob"
      g_return_if_fail (dialog != NULL);
#line 549 "mn-mailbox-view.gob"
      g_return_if_fail (GTK_IS_DIALOG (dialog));
#line 1274 "mn-mailbox-view.c"
{
#line 553 "mn-mailbox-view.gob"
      
    if (response == GTK_RESPONSE_HELP)
      mn_display_help(GTK_WINDOW(dialog), "mailbox-properties");
    else if (response == GTK_RESPONSE_CANCEL)
      gtk_widget_destroy(GTK_WIDGET(dialog));
    else if (response == GTK_RESPONSE_ACCEPT)
      {
      MNURI *uri;
      
      uri = mn_mailbox_properties_dialog_get_current_uri(MN_MAILBOX_PROPERTIES_DIALOG(dialog));
      g_return_if_fail(MN_IS_URI(uri));
      
      if (! mn_mailboxes_find_uri(mn_shell->mailboxes, uri))
        {
          GSList *gconf_mailboxes;
          
          gconf_mailboxes = eel_gconf_get_string_list(MN_CONF_MAILBOXES);
          gconf_mailboxes = g_slist_append(gconf_mailboxes, g_strdup(uri->text));
          eel_gconf_set_string_list(MN_CONF_MAILBOXES, gconf_mailboxes);
          eel_g_slist_free_deep(gconf_mailboxes);
          
          gtk_widget_destroy(GTK_WIDGET(dialog));
        }
      else
        mn_error_dialog(GTK_WINDOW(dialog), NULL, NULL, _("Unable to add mailbox"), _("The mailbox is already in the list."));

      g_object_unref(uri);
      }
  }}
#line 1306 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 583 "mn-mailbox-view.gob"
static void 
mn_mailbox_view_properties_edit_response_h (GtkDialog * dialog, int response, gpointer user_data)
#line 1312 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::properties_edit_response_h"
#line 583 "mn-mailbox-view.gob"
      g_return_if_fail (dialog != NULL);
#line 583 "mn-mailbox-view.gob"
      g_return_if_fail (GTK_IS_DIALOG (dialog));
#line 1319 "mn-mailbox-view.c"
{
#line 587 "mn-mailbox-view.gob"
      
    if (response == GTK_RESPONSE_HELP)
      mn_display_help(GTK_WINDOW(dialog), "mailbox-properties");
    else
      {
      if (response == GTK_RESPONSE_APPLY || response == GTK_RESPONSE_OK)
        mn_mailbox_properties_dialog_apply(MN_MAILBOX_PROPERTIES_DIALOG(dialog));
      if (response == GTK_RESPONSE_CANCEL || response == GTK_RESPONSE_OK)
        gtk_widget_destroy(GTK_WIDGET(dialog));
      }
  }}
#line 1333 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 599 "mn-mailbox-view.gob"
static void 
mn_mailbox_view_popup_menu (MNMailboxView * self, unsigned int button, guint32 activate_time)
#line 1339 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::popup_menu"
#line 599 "mn-mailbox-view.gob"
      g_return_if_fail (self != NULL);
#line 599 "mn-mailbox-view.gob"
      g_return_if_fail (MN_IS_MAILBOX_VIEW (self));
#line 1346 "mn-mailbox-view.c"
{
#line 601 "mn-mailbox-view.gob"
      
    gtk_clipboard_request_contents(global_clipboard,
                           gnome_copied_files_atom,
                           self_popup_menu_receive_cb,
                           self);
    gtk_menu_popup(GTK_MENU(selfp->menu), NULL, NULL, NULL, NULL, button, activate_time);
  }}
#line 1356 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 609 "mn-mailbox-view.gob"
static void 
mn_mailbox_view_popup_menu_receive_cb (GtkClipboard * clipboard, GtkSelectionData * selection_data, gpointer data)
#line 1362 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::popup_menu_receive_cb"
#line 609 "mn-mailbox-view.gob"
      g_return_if_fail (clipboard != NULL);
#line 609 "mn-mailbox-view.gob"
      g_return_if_fail (selection_data != NULL);
#line 609 "mn-mailbox-view.gob"
      g_return_if_fail (data != NULL);
#line 1371 "mn-mailbox-view.c"
{
#line 613 "mn-mailbox-view.gob"
      
    Self *self = data;
    gboolean can_paste = FALSE;

    if (selection_data->type == gnome_copied_files_atom
      && selection_data->format == 8
      && selection_data->length > 0)
      {
      char *gnome_copied_files;
      gboolean status;
      MNGnomeCopiedFilesType type;
      GSList *uri_list;
      
      gnome_copied_files = g_strndup(selection_data->data, selection_data->length);
      status = mn_parse_gnome_copied_files(gnome_copied_files, &type, &uri_list);
      g_free(gnome_copied_files);

      if (status)
        {
          if (type == MN_GNOME_COPIED_FILES_COPY && uri_list)
            can_paste = TRUE;
          eel_g_slist_free_deep(uri_list);
        }
      }

    gtk_widget_set_sensitive(selfp->paste_item, can_paste);
  }}
#line 1401 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 641 "mn-mailbox-view.gob"
static gboolean 
mn_mailbox_view_popup_menu_h (GtkWidget * widget, gpointer user_data)
#line 1407 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::popup_menu_h"
#line 641 "mn-mailbox-view.gob"
      g_return_val_if_fail (widget != NULL, (gboolean )0);
#line 641 "mn-mailbox-view.gob"
      g_return_val_if_fail (GTK_IS_WIDGET (widget), (gboolean )0);
#line 1414 "mn-mailbox-view.c"
{
#line 644 "mn-mailbox-view.gob"
      
    Self *self = SELF(widget);

    self_popup_menu(self, 0, gtk_get_current_event_time());
    gtk_menu_shell_select_first(GTK_MENU_SHELL(selfp->menu), FALSE);

    return TRUE;        /* a menu was activated */
  }}
#line 1425 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 653 "mn-mailbox-view.gob"
static gboolean 
mn_mailbox_view_button_press_event_h (GtkWidget * widget, GdkEventButton * event, gpointer user_data)
#line 1431 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::button_press_event_h"
#line 653 "mn-mailbox-view.gob"
      g_return_val_if_fail (widget != NULL, (gboolean )0);
#line 653 "mn-mailbox-view.gob"
      g_return_val_if_fail (GTK_IS_WIDGET (widget), (gboolean )0);
#line 653 "mn-mailbox-view.gob"
      g_return_val_if_fail (event != NULL, (gboolean )0);
#line 1440 "mn-mailbox-view.c"
{
#line 657 "mn-mailbox-view.gob"
      
    if (event->button == 3)
      self_popup_menu(SELF(widget), event->button, event->time);
    
    return FALSE;             /* propagate event */
  }}
#line 1449 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 664 "mn-mailbox-view.gob"
static void 
mn_mailbox_view_row_activated_h (GtkTreeView * treeview, GtkTreePath * path, GtkTreeViewColumn * column, gpointer user_data)
#line 1455 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::row_activated_h"
#line 664 "mn-mailbox-view.gob"
      g_return_if_fail (treeview != NULL);
#line 664 "mn-mailbox-view.gob"
      g_return_if_fail (GTK_IS_TREE_VIEW (treeview));
#line 664 "mn-mailbox-view.gob"
      g_return_if_fail (path != NULL);
#line 664 "mn-mailbox-view.gob"
      g_return_if_fail (column != NULL);
#line 664 "mn-mailbox-view.gob"
      g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (column));
#line 1468 "mn-mailbox-view.c"
{
#line 669 "mn-mailbox-view.gob"
      
    self_activate_properties(SELF(treeview));
  }}
#line 1474 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

#line 673 "mn-mailbox-view.gob"
GtkWidget * 
mn_mailbox_view_new (void)
#line 1480 "mn-mailbox-view.c"
{
#define __GOB_FUNCTION__ "MN:Mailbox:View::new"
{
#line 675 "mn-mailbox-view.gob"
      
    g_return_val_if_fail(mn_shell != NULL, NULL);
    return GTK_WIDGET(GET_NEW);
  }}
#line 1489 "mn-mailbox-view.c"
#undef __GOB_FUNCTION__

Generated by  Doxygen 1.6.0   Back to index