aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2007-09-14 23:29:05 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2007-09-14 23:29:05 +0800
commit5ad1bf8506772c6e02da2e48391d0a9e03b80048 (patch)
treed1842e355beb2431b16c587a5add7434ef24179b /addressbook
parent3cf65fa9b41612c0a126503fae88b85a9f3d8ae0 (diff)
downloadgsoc2013-evolution-5ad1bf8506772c6e02da2e48391d0a9e03b80048.tar
gsoc2013-evolution-5ad1bf8506772c6e02da2e48391d0a9e03b80048.tar.gz
gsoc2013-evolution-5ad1bf8506772c6e02da2e48391d0a9e03b80048.tar.bz2
gsoc2013-evolution-5ad1bf8506772c6e02da2e48391d0a9e03b80048.tar.lz
gsoc2013-evolution-5ad1bf8506772c6e02da2e48391d0a9e03b80048.tar.xz
gsoc2013-evolution-5ad1bf8506772c6e02da2e48391d0a9e03b80048.tar.zst
gsoc2013-evolution-5ad1bf8506772c6e02da2e48391d0a9e03b80048.zip
Remove the --enable-file-chooser configure option.
GtkFileChooser has been around since 2004. svn path=/trunk/; revision=34257
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog8
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c38
-rw-r--r--addressbook/gui/widgets/eab-gui-util.c45
3 files changed, 8 insertions, 83 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 6bac422bf0..2ddfeaf1b2 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,11 @@
+2007-09-14 Matthew Barnes <mbarnes@redhat.com>
+
+ ** Fixes part of bug #476231
+
+ * gui/widgets/eab-gui-util.c:
+ Remove non-USE_GTKFILECHOOSER code.
+ GtkFileChooser has been around since 2004.
+
2007-09-07 Milan Crha <mcrha@redhat.com>
** Fix for bug #473903
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 8d44cb5fa7..212225b3e5 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -2713,11 +2713,7 @@ image_selected (EContactEditor *editor)
gchar *file_name;
GtkWidget *image_chooser;
-#ifdef USE_GTKFILECHOOSER
file_name = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (editor->file_selector));
-#else
- file_name = (gchar *) gtk_file_selection_get_filename (GTK_FILE_SELECTION (editor->file_selector));
-#endif
if (!file_name)
return;
@@ -2754,8 +2750,6 @@ image_cleared (EContactEditor *editor)
object_changed (G_OBJECT (image_chooser), editor);
}
-#ifdef USE_GTKFILECHOOSER
-
static void
file_chooser_response (GtkWidget *widget, gint response, EContactEditor *editor)
{
@@ -2767,8 +2761,6 @@ file_chooser_response (GtkWidget *widget, gint response, EContactEditor *editor)
gtk_widget_hide (editor->file_selector);
}
-#endif
-
static gboolean
file_selector_deleted (GtkWidget *widget)
{
@@ -2813,7 +2805,6 @@ image_clicked (GtkWidget *button, EContactEditor *editor)
GtkImage *preview;
if (!editor->file_selector) {
-#ifdef USE_GTKFILECHOOSER
editor->file_selector = gtk_file_chooser_dialog_new (title,
GTK_WINDOW (editor->app),
GTK_FILE_CHOOSER_ACTION_OPEN,
@@ -2831,35 +2822,6 @@ image_clicked (GtkWidget *button, EContactEditor *editor)
g_signal_connect (editor->file_selector, "response",
G_CALLBACK (file_chooser_response), editor);
-#else
- GtkWidget *clear_button;
- GtkWidget *dialog;
-
- /* Create the selector */
-
- editor->file_selector = gtk_file_selection_new (title);
-
- dialog = GTK_FILE_SELECTION (editor->file_selector)->fileop_dialog;
-
- clear_button = gtk_dialog_add_button (GTK_DIALOG (editor->file_selector), no_image, 0);
-
- g_signal_connect_swapped (GTK_OBJECT (GTK_FILE_SELECTION (editor->file_selector)->ok_button),
- "clicked", G_CALLBACK (image_selected), editor);
-
- g_signal_connect_swapped (clear_button,
- "clicked", G_CALLBACK (image_cleared), editor);
-
- /* Ensure that the dialog box gets hidden when the user clicks a button */
-
- g_signal_connect_swapped (GTK_OBJECT (GTK_FILE_SELECTION (editor->file_selector)->ok_button),
- "clicked", G_CALLBACK (gtk_widget_hide), editor->file_selector);
-
- g_signal_connect_swapped (GTK_OBJECT (GTK_FILE_SELECTION (editor->file_selector)->cancel_button),
- "clicked", G_CALLBACK (gtk_widget_hide), editor->file_selector);
-
- g_signal_connect_swapped (clear_button,
- "clicked", G_CALLBACK (gtk_widget_hide), editor->file_selector);
-#endif
g_signal_connect_after (editor->file_selector,
"delete-event", G_CALLBACK (file_selector_deleted),
diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c
index 52861a2800..e3c23c0105 100644
--- a/addressbook/gui/widgets/eab-gui-util.c
+++ b/addressbook/gui/widgets/eab-gui-util.c
@@ -352,12 +352,8 @@ save_it(GtkWidget *widget, SaveAsInfo *info)
gint response = 0;
-#ifdef USE_GTKFILECHOOSER
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (info->filesel));
uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (info->filesel));
-#else
- filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (info->filesel));
-#endif
if (filename && g_file_test (filename, G_FILE_TEST_EXISTS)) {
response = file_exists(GTK_WINDOW (info->filesel), filename);
@@ -409,7 +405,6 @@ destroy_it(void *data, GObject *where_the_object_was)
g_free (info);
}
-#ifdef USE_GTKFILECHOOSER
static void
filechooser_response (GtkWidget *widget, gint response_id, SaveAsInfo *info)
{
@@ -418,7 +413,6 @@ filechooser_response (GtkWidget *widget, gint response_id, SaveAsInfo *info)
else
close_it (widget, info);
}
-#endif
static char *
make_safe_filename (char *name)
@@ -511,9 +505,7 @@ eab_contact_save (char *title, EContact *contact, GtkWindow *parent_window)
GtkWidget *filesel;
char *file;
char *name;
-#ifndef USE_GTKFILECHOOSER
char *full_filename;
-#endif
SaveAsInfo *info = g_new(SaveAsInfo, 1);
name = e_contact_get (contact, E_CONTACT_FILE_AS);
@@ -521,7 +513,6 @@ eab_contact_save (char *title, EContact *contact, GtkWindow *parent_window)
info->has_multiple_contacts = FALSE;
-#ifdef USE_GTKFILECHOOSER
filesel = gtk_file_chooser_dialog_new (title,
parent_window,
GTK_FILE_CHOOSER_ACTION_SAVE,
@@ -540,22 +531,6 @@ eab_contact_save (char *title, EContact *contact, GtkWindow *parent_window)
g_signal_connect (G_OBJECT (filesel), "response",
G_CALLBACK (filechooser_response), info);
g_object_weak_ref (G_OBJECT (filesel), destroy_it, info);
-#else
- filesel = gtk_file_selection_new (title);
-
- full_filename = g_strdup_printf ("%s/%s", g_get_home_dir (), file);
- gtk_file_selection_set_filename (GTK_FILE_SELECTION (filesel), full_filename);
- g_free (full_filename);
-
- info->filesel = filesel;
- info->vcard = e_vcard_to_string (E_VCARD (contact), EVC_FORMAT_VCARD_30);
-
- g_signal_connect(G_OBJECT (GTK_FILE_SELECTION (filesel)->ok_button), "clicked",
- G_CALLBACK (save_it), info);
- g_signal_connect(G_OBJECT (GTK_FILE_SELECTION (filesel)->cancel_button), "clicked",
- G_CALLBACK (close_it), info);
- g_object_weak_ref (G_OBJECT (filesel), destroy_it, info);
-#endif
if (parent_window) {
gtk_window_set_transient_for (GTK_WINDOW (filesel),
@@ -573,11 +548,8 @@ eab_contact_list_save (char *title, GList *list, GtkWindow *parent_window)
GtkWidget *filesel;
SaveAsInfo *info = g_new(SaveAsInfo, 1);
char *file;
-#ifndef USE_GTKFILECHOOSER
char *full_filename;
-#endif
-#ifdef USE_GTKFILECHOOSER
filesel = gtk_file_chooser_dialog_new (title,
parent_window,
GTK_FILE_CHOOSER_ACTION_SAVE,
@@ -586,9 +558,6 @@ eab_contact_list_save (char *title, GList *list, GtkWindow *parent_window)
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (filesel), GTK_RESPONSE_ACCEPT);
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (filesel), FALSE);
-#else
- filesel = gtk_file_selection_new(title);
-#endif
/* Check if the list has more than one contact */
if (g_list_next (list))
@@ -608,29 +577,15 @@ eab_contact_list_save (char *title, GList *list, GtkWindow *parent_window)
file = make_safe_filename (_("list"));
}
-#ifdef USE_GTKFILECHOOSER
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (filesel), g_get_home_dir ());
gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (filesel), file);
-#else
- full_filename = g_strdup_printf ("%s/%s", g_get_home_dir (), file);
- gtk_file_selection_set_filename (GTK_FILE_SELECTION (filesel), full_filename);
- g_free (full_filename);
-#endif
info->filesel = filesel;
info->vcard = eab_contact_list_to_string (list);
-#ifdef USE_GTKFILECHOOSER
g_signal_connect (G_OBJECT (filesel), "response",
G_CALLBACK (filechooser_response), info);
g_object_weak_ref (G_OBJECT (filesel), destroy_it, info);
-#else
- g_signal_connect(G_OBJECT (GTK_FILE_SELECTION (filesel)->ok_button), "clicked",
- G_CALLBACK (save_it), info);
- g_signal_connect(G_OBJECT (GTK_FILE_SELECTION (filesel)->cancel_button), "clicked",
- G_CALLBACK (close_it), info);
- g_object_weak_ref (G_OBJECT (filesel), destroy_it, info);
-#endif
if (parent_window) {
gtk_window_set_transient_for (GTK_WINDOW (filesel),