aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/menus
diff options
context:
space:
mode:
authorGilles Dartiguelongue <gdartigu@svn.gnome.org>2007-11-27 05:40:20 +0800
committerGilles Dartiguelongue <gdartigu@src.gnome.org>2007-11-27 05:40:20 +0800
commitdd34eba30cd90659975dc8b56d00dfe36f243854 (patch)
treeec47c5af0d66ff24044ff2dc1b8f251755950cd4 /widgets/menus
parentd218775fe404a4533636d972f9c5e18bffaa6309 (diff)
downloadgsoc2013-evolution-dd34eba30cd90659975dc8b56d00dfe36f243854.tar.gz
gsoc2013-evolution-dd34eba30cd90659975dc8b56d00dfe36f243854.tar.zst
gsoc2013-evolution-dd34eba30cd90659975dc8b56d00dfe36f243854.zip
** Fixes bug #495951 Use GtkTreeView in place of ETable
2007-11-26 Gilles Dartiguelongue <gdartigu@svn.gnome.org> ** Fixes bug #495951 Use GtkTreeView in place of ETable svn path=/trunk/; revision=34590
Diffstat (limited to 'widgets/menus')
-rw-r--r--widgets/menus/gal-view-instance-save-as-dialog.c223
-rw-r--r--widgets/menus/gal-view-instance-save-as-dialog.glade286
-rw-r--r--widgets/menus/gal-view-instance-save-as-dialog.h9
3 files changed, 242 insertions, 276 deletions
diff --git a/widgets/menus/gal-view-instance-save-as-dialog.c b/widgets/menus/gal-view-instance-save-as-dialog.c
index 1a3b917c28..7fcaf6699d 100644
--- a/widgets/menus/gal-view-instance-save-as-dialog.c
+++ b/widgets/menus/gal-view-instance-save-as-dialog.c
@@ -25,8 +25,8 @@
#include <gtk/gtk.h>
-#include "table/e-table-scrolled.h"
#include <glib/gi18n.h>
+#include "e-util/e-util.h"
#include "e-util/e-util-private.h"
#include "gal-define-views-model.h"
@@ -41,56 +41,109 @@ enum {
PROP_INSTANCE,
};
-typedef struct {
- char *title;
- ETableModel *model;
- GalViewInstanceSaveAsDialog *names;
-} GalViewInstanceSaveAsDialogChild;
-
+enum {
+ COL_GALVIEW_NAME,
+ COL_GALVIEW_DATA
+};
/* Static functions */
static void
-gal_view_instance_save_as_dialog_set_instance(GalViewInstanceSaveAsDialog *dialog,
- GalViewInstance *instance)
+gal_view_instance_save_as_dialog_set_instance (GalViewInstanceSaveAsDialog *dialog,
+ GalViewInstance *instance)
{
+ int i;
+ GtkListStore *store;
+ GtkCellRenderer *renderer;
dialog->instance = instance;
- if (dialog->model) {
- GtkWidget *table;
- g_object_set(dialog->model,
- "collection", instance ? instance->collection : NULL,
- NULL);
- table = glade_xml_get_widget(dialog->gui, "custom-replace");
- if (table) {
- ETable *etable;
- etable = e_table_scrolled_get_table (E_TABLE_SCROLLED (table));
- e_selection_model_select_single_row (e_table_get_selection_model (etable), 0);
- e_selection_model_change_cursor (e_table_get_selection_model (etable), 0, 0);
- }
+
+ store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER);
+
+ for (i=0; i<instance->collection->view_count; i++) {
+ GalViewCollectionItem *item = instance->collection->view_data[i];
+ GtkTreeIter iter;
+ char *title = NULL;
+
+ /* hide built in views */
+ /*if (item->built_in == 1)
+ continue;*/
+
+ title = e_str_without_underscores (item->title);
+
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ COL_GALVIEW_NAME, title,
+ COL_GALVIEW_DATA, item,
+ -1);
+
+ g_free (title);
+ }
+
+ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store),
+ COL_GALVIEW_NAME, GTK_SORT_ASCENDING);
+
+ /* attaching treeview to model */
+ gtk_tree_view_set_model (dialog->treeview, GTK_TREE_MODEL (store));
+ gtk_tree_view_set_search_column (dialog->treeview, COL_GALVIEW_NAME);
+
+ dialog->model = GTK_TREE_MODEL (store);
+
+ renderer = gtk_cell_renderer_text_new ();
+
+ gtk_tree_view_insert_column_with_attributes (dialog->treeview,
+ COL_GALVIEW_NAME, _("Name"),
+ renderer, "text", COL_GALVIEW_NAME,
+ NULL);
+
+ /* set sort column */
+ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (dialog->model),
+ COL_GALVIEW_NAME, GTK_SORT_ASCENDING);
+}
+
+static void
+gvisad_setup_validate_button (GalViewInstanceSaveAsDialog *dialog)
+{
+ if ((dialog->toggle == GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TOGGLE_CREATE
+ && g_utf8_strlen (gtk_entry_get_text (GTK_ENTRY (dialog->entry_create)), -1) > 0)
+ || dialog->toggle == GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TOGGLE_REPLACE) {
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, TRUE);
+ } else {
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, FALSE);
}
}
+
static void
gvisad_setup_radio_buttons (GalViewInstanceSaveAsDialog *dialog)
{
- GtkWidget *radio_replace = glade_xml_get_widget (dialog->gui, "radiobutton-replace");
- GtkWidget *radio_create = glade_xml_get_widget (dialog->gui, "radiobutton-create" );
- GtkWidget *widget;
+ GtkWidget *widget;
+
+ widget = dialog->scrolledwindow;
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->radiobutton_replace))) {
+ GtkTreeIter iter;
+ GtkTreeSelection *selection;
+
+ selection = gtk_tree_view_get_selection (dialog->treeview);
+ if (!gtk_tree_selection_get_selected (selection, &dialog->model, &iter)) {
+ if (gtk_tree_model_get_iter_first (dialog->model, &iter)) {
+ gtk_tree_selection_select_iter (selection, &iter);
+ }
+ }
- widget = glade_xml_get_widget (dialog->gui, "custom-replace");
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio_replace))) {
gtk_widget_set_sensitive (widget, TRUE);
dialog->toggle = GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TOGGLE_REPLACE;
} else {
gtk_widget_set_sensitive (widget, FALSE);
}
- widget = glade_xml_get_widget (dialog->gui, "entry-create");
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio_create))) {
+ widget = dialog->entry_create;
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->radiobutton_create))) {
gtk_widget_set_sensitive (widget, TRUE);
dialog->toggle = GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TOGGLE_CREATE;
} else {
gtk_widget_set_sensitive (widget, FALSE);
}
+
+ gvisad_setup_validate_button (dialog);
}
static void
@@ -100,16 +153,12 @@ gvisad_radio_toggled (GtkWidget *widget, GalViewInstanceSaveAsDialog *dialog)
}
static void
-gvisad_connect_signal(GalViewInstanceSaveAsDialog *dialog, char *widget_name, char *signal, GCallback handler)
+gvisad_entry_changed (GtkWidget *widget, GalViewInstanceSaveAsDialog *dialog)
{
- GtkWidget *widget;
-
- widget = glade_xml_get_widget(dialog->gui, widget_name);
-
- if (widget)
- g_signal_connect (G_OBJECT (widget), signal, handler, dialog);
+ gvisad_setup_validate_button (dialog);
}
+
/* Method override implementations */
static void
gal_view_instance_save_as_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
@@ -118,12 +167,12 @@ gal_view_instance_save_as_dialog_set_property (GObject *object, guint prop_id, c
dialog = GAL_VIEW_INSTANCE_SAVE_AS_DIALOG (object);
- switch (prop_id){
+ switch (prop_id) {
case PROP_INSTANCE:
if (g_value_get_object (value))
- gal_view_instance_save_as_dialog_set_instance(dialog, GAL_VIEW_INSTANCE(g_value_get_object (value)));
+ gal_view_instance_save_as_dialog_set_instance (dialog, GAL_VIEW_INSTANCE (g_value_get_object (value)));
else
- gal_view_instance_save_as_dialog_set_instance(dialog, NULL);
+ gal_view_instance_save_as_dialog_set_instance (dialog, NULL);
break;
default:
@@ -152,10 +201,10 @@ gal_view_instance_save_as_dialog_get_property (GObject *object, guint prop_id, G
static void
gal_view_instance_save_as_dialog_dispose (GObject *object)
{
- GalViewInstanceSaveAsDialog *gal_view_instance_save_as_dialog = GAL_VIEW_INSTANCE_SAVE_AS_DIALOG(object);
+ GalViewInstanceSaveAsDialog *gal_view_instance_save_as_dialog = GAL_VIEW_INSTANCE_SAVE_AS_DIALOG (object);
if (gal_view_instance_save_as_dialog->gui)
- g_object_unref(gal_view_instance_save_as_dialog->gui);
+ g_object_unref (gal_view_instance_save_as_dialog->gui);
gal_view_instance_save_as_dialog->gui = NULL;
if (G_OBJECT_CLASS (gal_view_instance_save_as_dialog_parent_class)->dispose)
@@ -187,68 +236,55 @@ gal_view_instance_save_as_dialog_init (GalViewInstanceSaveAsDialog *dialog)
{
GladeXML *gui;
GtkWidget *widget;
- GtkWidget *table;
+
gchar *filename = g_build_filename (EVOLUTION_GLADEDIR,
"gal-view-instance-save-as-dialog.glade",
NULL);
dialog->instance = NULL;
+ dialog->model = NULL;
+ dialog->collection = NULL;
gui = glade_xml_new_with_domain (filename , NULL, GETTEXT_PACKAGE);
g_free (filename);
dialog->gui = gui;
- widget = glade_xml_get_widget(gui, "vbox-top");
+ widget = glade_xml_get_widget (gui, "vbox-top");
if (!widget) {
return;
}
- g_object_ref(widget);
+
+ g_object_ref (widget);
gtk_container_remove (GTK_CONTAINER (widget->parent), widget);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), widget, TRUE, TRUE, 0);
- g_object_unref(widget);
+
+ /* TODO: add position/size saving/restoring */
+ gtk_window_set_default_size (GTK_WINDOW (dialog), 300, 360);
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), widget, TRUE, TRUE, 0);
+ g_object_unref (widget);
gtk_dialog_add_buttons (GTK_DIALOG (dialog),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
- gvisad_connect_signal(dialog, "radiobutton-replace", "toggled", G_CALLBACK(gvisad_radio_toggled));
- gvisad_connect_signal(dialog, "radiobutton-create", "toggled", G_CALLBACK(gvisad_radio_toggled));
+ dialog->scrolledwindow = glade_xml_get_widget (dialog->gui, "scrolledwindow2");
+ dialog->treeview = GTK_TREE_VIEW (glade_xml_get_widget (dialog->gui, "custom-replace"));
+ dialog->entry_create = glade_xml_get_widget (dialog->gui, "entry-create");
+ dialog->radiobutton_replace = glade_xml_get_widget (dialog->gui, "radiobutton-replace");
+ dialog->radiobutton_create = glade_xml_get_widget (dialog->gui, "radiobutton-create");
- dialog->model = NULL;
- table = glade_xml_get_widget(dialog->gui, "custom-replace");
- if (table) {
- dialog->model = g_object_get_data(G_OBJECT (table), "GalViewInstanceSaveAsDialog::model");
+ gtk_tree_view_set_reorderable (GTK_TREE_VIEW (dialog->treeview), FALSE);
+ gtk_tree_view_set_headers_visible (dialog->treeview, FALSE);
- gal_view_instance_save_as_dialog_set_instance (dialog, dialog->instance);
- gtk_widget_show_all (table);
- }
+ g_signal_connect (dialog->radiobutton_replace, "toggled", G_CALLBACK (gvisad_radio_toggled), dialog);
+ g_signal_connect (dialog->radiobutton_create, "toggled", G_CALLBACK (gvisad_radio_toggled), dialog);
+ g_signal_connect (dialog->entry_create, "changed", G_CALLBACK (gvisad_entry_changed), dialog);
gvisad_setup_radio_buttons (dialog);
- gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, TRUE, FALSE);
- gtk_window_set_title (GTK_WINDOW (dialog), _("Save Current View"));
-}
+ gvisad_setup_validate_button (dialog);
-
-/* For use from libglade. */
-/* ETable creation */
-#define SPEC "<ETableSpecification no-headers=\"true\" cursor-mode=\"line\" draw-grid=\"false\" selection-mode=\"single\" gettext-domain=\"" GETTEXT_PACKAGE "\">" \
- "<ETableColumn model_col= \"0\" _title=\"Name\" expansion=\"1.0\" minimum_width=\"18\" resizable=\"true\" cell=\"string\" compare=\"string\"/>" \
- "<ETableState> <column source=\"0\"/> <grouping> </grouping> </ETableState>" \
- "</ETableSpecification>"
-
-GtkWidget *gal_view_instance_save_as_dialog_create_etable(char *name, char *string1, char *string2, int int1, int int2);
-
-GtkWidget *
-gal_view_instance_save_as_dialog_create_etable(char *name, char *string1, char *string2, int int1, int int2)
-{
- GtkWidget *table;
- ETableModel *model;
- model = gal_define_views_model_new ();
- table = e_table_scrolled_new(model, NULL, SPEC, NULL);
- g_object_set_data(G_OBJECT (table), "GalViewInstanceSaveAsDialog::model", model);
-
- return table;
+ gtk_window_set_title (GTK_WINDOW (dialog), _("Save Current View"));
+ gtk_widget_show (GTK_WIDGET (dialog));
}
/* External methods */
@@ -259,11 +295,11 @@ gal_view_instance_save_as_dialog_create_etable(char *name, char *string1, char *
*
* Returns: The GalViewInstanceSaveAsDialog.
*/
-GtkWidget*
+GtkWidget *
gal_view_instance_save_as_dialog_new (GalViewInstance *instance)
{
GtkWidget *widget = g_object_new (GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TYPE, NULL);
- gal_view_instance_save_as_dialog_set_instance(GAL_VIEW_INSTANCE_SAVE_AS_DIALOG (widget), instance);
+ gal_view_instance_save_as_dialog_set_instance (GAL_VIEW_INSTANCE_SAVE_AS_DIALOG (widget), instance);
return widget;
}
@@ -271,25 +307,36 @@ void
gal_view_instance_save_as_dialog_save (GalViewInstanceSaveAsDialog *dialog)
{
GalView *view = gal_view_instance_get_current_view (dialog->instance);
- GtkWidget *widget;
const char *title;
int n;
const char *id = NULL;
+ GalViewCollectionItem *item;
view = gal_view_clone (view);
switch (dialog->toggle) {
case GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TOGGLE_REPLACE:
- widget = glade_xml_get_widget(dialog->gui, "custom-replace");
- if (widget && E_IS_TABLE_SCROLLED (widget)) {
- n = e_table_get_cursor_row (e_table_scrolled_get_table (E_TABLE_SCROLLED (widget)));
- id = gal_view_collection_set_nth_view (dialog->instance->collection, n, view);
- gal_view_collection_save (dialog->instance->collection);
+ if (dialog->treeview) {
+ GtkTreeIter iter;
+ GtkTreeSelection *selection;
+
+ selection = gtk_tree_view_get_selection (dialog->treeview);
+ if (gtk_tree_selection_get_selected (selection, &dialog->model, &iter)) {
+ gtk_tree_model_get (dialog->model, &iter, COL_GALVIEW_DATA, &item, -1);
+
+ for (n=0; n<dialog->instance->collection->view_count; n++) {
+ if (item == dialog->instance->collection->view_data[n]) {
+ id = gal_view_collection_set_nth_view (dialog->instance->collection, n, view);
+ gal_view_collection_save (dialog->instance->collection);
+ }
+ }
+ }
+
}
break;
+
case GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TOGGLE_CREATE:
- widget = glade_xml_get_widget(dialog->gui, "entry-create");
- if (widget && GTK_IS_ENTRY (widget)) {
- title = gtk_entry_get_text (GTK_ENTRY (widget));
+ if (dialog->entry_create && GTK_IS_ENTRY (dialog->entry_create)) {
+ title = gtk_entry_get_text (GTK_ENTRY (dialog->entry_create));
id = gal_view_collection_append_with_title (dialog->instance->collection, title, view);
gal_view_collection_save (dialog->instance->collection);
}
diff --git a/widgets/menus/gal-view-instance-save-as-dialog.glade b/widgets/menus/gal-view-instance-save-as-dialog.glade
index d7e3d8c948..aa40910113 100644
--- a/widgets/menus/gal-view-instance-save-as-dialog.glade
+++ b/widgets/menus/gal-view-instance-save-as-dialog.glade
@@ -1,256 +1,170 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--*- mode: xml -*-->
<glade-interface>
-<requires lib="gnome"/>
-
<widget class="GtkDialog" id="dialog1">
- <property name="title" translatable="yes"></property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="decorated">True</property>
- <property name="skip_taskbar_hint">False</property>
- <property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
- <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
- <property name="has_separator">True</property>
-
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
- <property name="homogeneous">False</property>
<property name="spacing">8</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button3">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
<child>
<widget class="GtkVBox" id="vbox-top">
- <property name="border_width">18</property>
<property name="visible">True</property>
- <property name="homogeneous">False</property>
+ <property name="border_width">18</property>
<property name="spacing">12</property>
-
<child>
- <widget class="GtkVBox" id="vbox2">
+ <widget class="GtkVBox" id="vbox1">
<property name="visible">True</property>
- <property name="homogeneous">False</property>
<property name="spacing">6</property>
-
<child>
<widget class="GtkRadioButton" id="radiobutton-create">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">_Create new view</property>
<property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
+ <property name="response_id">0</property>
<property name="active">True</property>
- <property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
- <property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
-
<child>
- <widget class="GtkHBox" id="hbox1">
+ <widget class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label9">
- <property name="visible">True</property>
- <property name="label" translatable="no"> </property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="left_padding">24</property>
<child>
- <widget class="GtkLabel" id="label8">
+ <widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
- <property name="label" translatable="yes">_Name:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-create</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-create">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char">*</property>
- <property name="activates_default">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Name:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">entry-create</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="entry-create">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
</child>
</widget>
<packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
+ <property name="position">1</property>
</packing>
</child>
</widget>
<packing>
- <property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-replace">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Replace existing view</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">radiobutton-create</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
<child>
- <widget class="GtkHBox" id="hbox2">
+ <widget class="GtkVBox" id="vbox2">
<property name="visible">True</property>
- <property name="homogeneous">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">6</property>
-
<child>
- <widget class="GtkLabel" id="label10">
+ <widget class="GtkRadioButton" id="radiobutton-replace">
<property name="visible">True</property>
- <property name="label" translatable="no"> </property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Replace existing view</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">radiobutton-create</property>
</widget>
<packing>
- <property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
-
<child>
- <widget class="Custom" id="custom-replace">
+ <widget class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
- <property name="creation_function">gal_view_instance_save_as_dialog_create_etable</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 01 Feb 2002 20:18:32 GMT</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="left_padding">24</property>
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <child>
+ <widget class="GtkTreeView" id="custom-replace">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="headers_clickable">True</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
</widget>
<packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
+ <property name="position">1</property>
</packing>
</child>
</widget>
<packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <child>
+ <widget class="GtkButton" id="button3">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-cancel</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">0</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkButton" id="button1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-ok</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">0</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
</packing>
</child>
</widget>
<packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
</widget>
diff --git a/widgets/menus/gal-view-instance-save-as-dialog.h b/widgets/menus/gal-view-instance-save-as-dialog.h
index 5808d9840c..f3d30ad7d0 100644
--- a/widgets/menus/gal-view-instance-save-as-dialog.h
+++ b/widgets/menus/gal-view-instance-save-as-dialog.h
@@ -26,7 +26,8 @@
#include <gtk/gtkdialog.h>
#include <glade/glade.h>
-#include <table/e-table-model.h>
+#include <gtk/gtktreeview.h>
+#include <gtk/gtktreemodel.h>
#include <widgets/menus/gal-view-collection.h>
#include <widgets/menus/gal-view-instance.h>
@@ -63,7 +64,11 @@ struct _GalViewInstanceSaveAsDialog
/* item specific fields */
GladeXML *gui;
- ETableModel *model;
+ GtkTreeView *treeview;
+ GtkTreeModel *model;
+
+ GtkWidget *scrolledwindow, *radiobutton_replace;
+ GtkWidget *entry_create, *radiobutton_create;
GalViewInstance *instance;
GalViewCollection *collection;