diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2000-08-04 04:53:14 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2000-08-04 04:53:14 +0800 |
commit | b83eccac16d2cf08a97c6c7c2b046d17565cefd1 (patch) | |
tree | 5d0b691724a2872b8bbc6445caf6ca6058c74485 /filter/filter-folder.c | |
parent | 36109c82b3480eb14f8ecd07b5fa14f45de7fbbb (diff) | |
download | gsoc2013-evolution-b83eccac16d2cf08a97c6c7c2b046d17565cefd1.tar.gz gsoc2013-evolution-b83eccac16d2cf08a97c6c7c2b046d17565cefd1.tar.zst gsoc2013-evolution-b83eccac16d2cf08a97c6c7c2b046d17565cefd1.zip |
Make the filter dialog display only the name of the folder, not the
whole URI.
svn path=/trunk/; revision=4516
Diffstat (limited to 'filter/filter-folder.c')
-rw-r--r-- | filter/filter-folder.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/filter/filter-folder.c b/filter/filter-folder.c index b5be1be8a9..1fcab58599 100644 --- a/filter/filter-folder.c +++ b/filter/filter-folder.c @@ -175,31 +175,28 @@ static void button_clicked(GtkButton *button, FilterFolder *ff) { #ifdef SHELL const char *allowed_types[] = { "mail", NULL }; - char *def, *uri, *str; + char *def, *physical_uri, *evolution_uri, *str; + + def = ff->uri ? ff->uri : ""; - def = ff->uri?ff->uri:""; evolution_shell_client_user_select_folder (global_shell_client, _("Select Folder"), - def, allowed_types, NULL, &uri); + def, allowed_types, + &evolution_uri, + &physical_uri); - if (uri != NULL && uri[0] != '\0') { + if (physical_uri != NULL && physical_uri[0] != '\0') { g_free(ff->uri); - g_free(ff->name); - ff->uri = uri; + ff->uri = physical_uri; - str = strstr(uri, "//"); - if (str) - str = strchr(str+2, '/'); - if (str) - str++; - else - str = uri; + g_free(ff->name); + ff->name = g_strdup(g_basename (evolution_uri)); - ff->name = g_strdup(str); gtk_label_set_text((GtkLabel *)GTK_BIN(button)->child, ff->name); } else { - g_free(uri); + g_free (physical_uri); } + g_free (evolution_uri); #else GnomeDialog *gd; GtkEntry *entry; @@ -244,10 +241,10 @@ static GtkWidget *get_widget(FilterElement *fe) char *name; if (ff->name && ff->name[0]) - name = ff->name; + label = (GtkLabel *)gtk_label_new(g_basename (ff->name)); else - name = "<click to select folder>"; - label = (GtkLabel *)gtk_label_new(name); + label = (GtkLabel *)gtk_label_new(_("<click here to select a folder>")); + button = (GtkButton *)gtk_button_new(); gtk_container_add((GtkContainer *)button, (GtkWidget *)label); gtk_widget_show((GtkWidget *)button); |