aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--widgets/e-table/Makefile.am3
-rw-r--r--widgets/e-table/e-table-config.c29
-rw-r--r--widgets/e-table/e-table-config.h8
-rw-r--r--widgets/e-table/test-check.c1
-rw-r--r--widgets/e-table/test-table.c5
-rw-r--r--widgets/table/e-table-config.c29
-rw-r--r--widgets/table/e-table-config.h8
-rw-r--r--widgets/table/test-check.c1
-rw-r--r--widgets/table/test-table.c5
9 files changed, 61 insertions, 28 deletions
diff --git a/widgets/e-table/Makefile.am b/widgets/e-table/Makefile.am
index 74facae1e1..99e4bf154d 100644
--- a/widgets/e-table/Makefile.am
+++ b/widgets/e-table/Makefile.am
@@ -11,6 +11,7 @@ glade_headers = \
INCLUDES = \
$(EXTRA_GNOME_CFLAGS) \
$(GNOME_INCLUDEDIR) \
+ -DETABLE_GLADEDIR=\""$(gladedir)"\" \
-I$(top_srcdir)/widgets/e-text \
-I$(top_srcdir)/e-util \
-I$(top_srcdir)
@@ -31,6 +32,8 @@ libetable_a_SOURCES = \
e-table.h \
e-table-col.c \
e-table-col.h \
+ e-table-config.c \
+ e-table-config.h \
e-table-group.c \
e-table-group.h \
e-table-group-container.c \
diff --git a/widgets/e-table/e-table-config.c b/widgets/e-table/e-table-config.c
index 8367a727c1..1345bed88f 100644
--- a/widgets/e-table/e-table-config.c
+++ b/widgets/e-table/e-table-config.c
@@ -18,6 +18,7 @@
#include "e-table-subset.h"
#include "e-table-item.h"
#include "e-table-group.h"
+#include "e-table-config.h"
typedef struct {
GladeXML *gui;
@@ -41,18 +42,18 @@ get_fields (ETable *etable)
char *s;
res = g_string_new ("");
- xmlRoot = xmlDocGetRootElement (xmlSpec);
+ xmlRoot = xmlDocGetRootElement (etable->specification);
xmlColumns = e_xml_get_child_by_name (xmlRoot, "columns-shown");
for (column = xmlColumns->childs; column; column = column->next){
ETableCol *ecol;
- int col = atoi (colum->childs->content);
+ int col = atoi (column->childs->content);
ecol = e_table_header_get_column (etable->header, col);
- g_string_append (res, text);
+ g_string_append (res, ecol->text);
if (column->next)
- g_string_appen (res, ", ");
+ g_string_append (res, ", ");
}
s = res->str;
g_string_free (res, FALSE);
@@ -83,9 +84,8 @@ get_filter (ETable *etable)
* into the dialog for configuring it
*/
static void
-load_label_data (GladeXML *gui, ETabel *etable)
+load_label_data (GladeXML *gui, ETable *etable)
{
- GtkWidget *l;
char *s;
s = get_fields (etable);
@@ -125,13 +125,14 @@ cb_button_filter (GtkWidget *widget, ETable *etable)
{
}
-GtkWidget *
+GnomeDialog *
e_table_gui_config (ETable *etable)
{
GladeXML *gui;
GnomeDialog *dialog;
-
- gui = glade_xml_new (ETABLE_GLADEDIR "/e-table-config.glade");
+ ConfigData *config_data;
+
+ gui = glade_xml_new (ETABLE_GLADEDIR "/e-table-config.glade", NULL);
if (!gui)
return NULL;
@@ -150,7 +151,11 @@ e_table_gui_config (ETable *etable)
GTK_OBJECT (glade_xml_get_widget (gui, "button-filter")),
"clicked", GTK_SIGNAL_FUNC (cb_button_filter), etable);
- load_label_data (etable);
+ load_label_data (gui, etable);
+
+ config_data = g_new (ConfigData, 1);
+ config_data->gui = gui;
+ config_data->old_spec = e_table_get_specification (etable);
gtk_object_set_data (
GTK_OBJECT (dialog), "config-data",
@@ -165,7 +170,7 @@ e_table_gui_destroy_config_data (GtkWidget *widget)
ConfigData *cd = gtk_object_get_data (GTK_OBJECT (widget), "config-data");
g_free (cd->old_spec);
- gtk_object_destroy (cd->gui);
+ gtk_object_destroy (GTK_OBJECT (cd->gui));
g_free (cd);
}
@@ -192,7 +197,7 @@ e_table_do_gui_config (GtkWidget *parent, ETable *etable)
return;
if (parent)
- gnome_dialog_set_parent (dialog, parent);
+ gnome_dialog_set_parent (dialog, GTK_WINDOW (parent));
r = gnome_dialog_run (GNOME_DIALOG (dialog));
diff --git a/widgets/e-table/e-table-config.h b/widgets/e-table/e-table-config.h
index 9bd16071a2..617ef6a331 100644
--- a/widgets/e-table/e-table-config.h
+++ b/widgets/e-table/e-table-config.h
@@ -1,7 +1,11 @@
#ifndef _E_TABLE_CONFIG_H
#define _E_TABLE_CONFIG_H
-GtkWidget *e_table_gui_config (ETable *etable);
-void e_table_do_gui_config (ETable *etable);
+GnomeDialog *e_table_gui_config (ETable *etable);
+void e_table_do_gui_config (GtkWidget *, ETable *etable);
+
+void e_table_gui_config_accept (GtkWidget *widget, ETable *etable);
+void e_table_gui_config_cancel (GtkWidget *widget, ETable *etable);
+
#endif /* _E_TABLE_CONFIG_H */
diff --git a/widgets/e-table/test-check.c b/widgets/e-table/test-check.c
index 4f5c07d7dd..06b26105b1 100644
--- a/widgets/e-table/test-check.c
+++ b/widgets/e-table/test-check.c
@@ -14,6 +14,7 @@
#include "e-table-item.h"
#include "e-util/e-cursors.h"
#include "e-util/e-canvas-utils.h"
+#include "e-util/e-canvas.h"
#include "e-util/e-util.h"
#include "e-cell-text.h"
#include "e-cell-checkbox.h"
diff --git a/widgets/e-table/test-table.c b/widgets/e-table/test-table.c
index 54fe02ae71..beae0b7707 100644
--- a/widgets/e-table/test-table.c
+++ b/widgets/e-table/test-table.c
@@ -10,6 +10,7 @@
#include <string.h>
#include <gnome.h>
#include "e-util/e-cursors.h"
+#include "e-util/e-canvas.h"
#include "e-table-simple.h"
#include "e-table-header.h"
#include "e-table-header-item.h"
@@ -343,6 +344,10 @@ do_e_table_demo (const char *spec)
gtk_widget_show (vbox);
gtk_widget_show (frame);
gtk_widget_show (window);
+
+ if (getenv ("TEST")){
+ e_config_do_gui_config (NULL, e_table);
+ }
}
void
diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c
index 8367a727c1..1345bed88f 100644
--- a/widgets/table/e-table-config.c
+++ b/widgets/table/e-table-config.c
@@ -18,6 +18,7 @@
#include "e-table-subset.h"
#include "e-table-item.h"
#include "e-table-group.h"
+#include "e-table-config.h"
typedef struct {
GladeXML *gui;
@@ -41,18 +42,18 @@ get_fields (ETable *etable)
char *s;
res = g_string_new ("");
- xmlRoot = xmlDocGetRootElement (xmlSpec);
+ xmlRoot = xmlDocGetRootElement (etable->specification);
xmlColumns = e_xml_get_child_by_name (xmlRoot, "columns-shown");
for (column = xmlColumns->childs; column; column = column->next){
ETableCol *ecol;
- int col = atoi (colum->childs->content);
+ int col = atoi (column->childs->content);
ecol = e_table_header_get_column (etable->header, col);
- g_string_append (res, text);
+ g_string_append (res, ecol->text);
if (column->next)
- g_string_appen (res, ", ");
+ g_string_append (res, ", ");
}
s = res->str;
g_string_free (res, FALSE);
@@ -83,9 +84,8 @@ get_filter (ETable *etable)
* into the dialog for configuring it
*/
static void
-load_label_data (GladeXML *gui, ETabel *etable)
+load_label_data (GladeXML *gui, ETable *etable)
{
- GtkWidget *l;
char *s;
s = get_fields (etable);
@@ -125,13 +125,14 @@ cb_button_filter (GtkWidget *widget, ETable *etable)
{
}
-GtkWidget *
+GnomeDialog *
e_table_gui_config (ETable *etable)
{
GladeXML *gui;
GnomeDialog *dialog;
-
- gui = glade_xml_new (ETABLE_GLADEDIR "/e-table-config.glade");
+ ConfigData *config_data;
+
+ gui = glade_xml_new (ETABLE_GLADEDIR "/e-table-config.glade", NULL);
if (!gui)
return NULL;
@@ -150,7 +151,11 @@ e_table_gui_config (ETable *etable)
GTK_OBJECT (glade_xml_get_widget (gui, "button-filter")),
"clicked", GTK_SIGNAL_FUNC (cb_button_filter), etable);
- load_label_data (etable);
+ load_label_data (gui, etable);
+
+ config_data = g_new (ConfigData, 1);
+ config_data->gui = gui;
+ config_data->old_spec = e_table_get_specification (etable);
gtk_object_set_data (
GTK_OBJECT (dialog), "config-data",
@@ -165,7 +170,7 @@ e_table_gui_destroy_config_data (GtkWidget *widget)
ConfigData *cd = gtk_object_get_data (GTK_OBJECT (widget), "config-data");
g_free (cd->old_spec);
- gtk_object_destroy (cd->gui);
+ gtk_object_destroy (GTK_OBJECT (cd->gui));
g_free (cd);
}
@@ -192,7 +197,7 @@ e_table_do_gui_config (GtkWidget *parent, ETable *etable)
return;
if (parent)
- gnome_dialog_set_parent (dialog, parent);
+ gnome_dialog_set_parent (dialog, GTK_WINDOW (parent));
r = gnome_dialog_run (GNOME_DIALOG (dialog));
diff --git a/widgets/table/e-table-config.h b/widgets/table/e-table-config.h
index 9bd16071a2..617ef6a331 100644
--- a/widgets/table/e-table-config.h
+++ b/widgets/table/e-table-config.h
@@ -1,7 +1,11 @@
#ifndef _E_TABLE_CONFIG_H
#define _E_TABLE_CONFIG_H
-GtkWidget *e_table_gui_config (ETable *etable);
-void e_table_do_gui_config (ETable *etable);
+GnomeDialog *e_table_gui_config (ETable *etable);
+void e_table_do_gui_config (GtkWidget *, ETable *etable);
+
+void e_table_gui_config_accept (GtkWidget *widget, ETable *etable);
+void e_table_gui_config_cancel (GtkWidget *widget, ETable *etable);
+
#endif /* _E_TABLE_CONFIG_H */
diff --git a/widgets/table/test-check.c b/widgets/table/test-check.c
index 4f5c07d7dd..06b26105b1 100644
--- a/widgets/table/test-check.c
+++ b/widgets/table/test-check.c
@@ -14,6 +14,7 @@
#include "e-table-item.h"
#include "e-util/e-cursors.h"
#include "e-util/e-canvas-utils.h"
+#include "e-util/e-canvas.h"
#include "e-util/e-util.h"
#include "e-cell-text.h"
#include "e-cell-checkbox.h"
diff --git a/widgets/table/test-table.c b/widgets/table/test-table.c
index 54fe02ae71..beae0b7707 100644
--- a/widgets/table/test-table.c
+++ b/widgets/table/test-table.c
@@ -10,6 +10,7 @@
#include <string.h>
#include <gnome.h>
#include "e-util/e-cursors.h"
+#include "e-util/e-canvas.h"
#include "e-table-simple.h"
#include "e-table-header.h"
#include "e-table-header-item.h"
@@ -343,6 +344,10 @@ do_e_table_demo (const char *spec)
gtk_widget_show (vbox);
gtk_widget_show (frame);
gtk_widget_show (window);
+
+ if (getenv ("TEST")){
+ e_config_do_gui_config (NULL, e_table);
+ }
}
void