From c5e51eea3fdd9fbb25bbf424febdaa65f0ada265 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Thu, 25 Apr 2002 16:40:59 +0000 Subject: [PATCH] r1420: Allow duplicate windows with different sym_paths. Don't quit while Options is open. --- ROX-Filer/src/filer.c | 11 +++++------ ROX-Filer/src/menu.c | 19 ++++++++++++++++++- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/ROX-Filer/src/filer.c b/ROX-Filer/src/filer.c index 4e99fda7..ce8c5278 100644 --- a/ROX-Filer/src/filer.c +++ b/ROX-Filer/src/filer.c @@ -89,7 +89,7 @@ static void update_display(Directory *dir, static void set_scanning_display(FilerWindow *filer_window, gboolean scanning); static gboolean may_rescan(FilerWindow *filer_window, gboolean warning); static gboolean minibuffer_show_cb(FilerWindow *filer_window); -static FilerWindow *find_filer_window(char *real_path, FilerWindow *diff); +static FilerWindow *find_filer_window(const char *sym_path, FilerWindow *diff); static gint coll_button_release(GtkWidget *widget, GdkEventButton *event, FilerWindow *filer_window); @@ -1145,7 +1145,7 @@ void filer_change_to(FilerWindow *filer_window, { FilerWindow *fw; - fw = find_filer_window(real_path, filer_window); + fw = find_filer_window(sym_path, filer_window); if (fw) gtk_widget_destroy(fw->window); } @@ -1282,7 +1282,7 @@ FilerWindow *filer_opendir(const char *path, FilerWindow *src_win) { FilerWindow *same_dir_window; - same_dir_window = find_filer_window(real_path, NULL); + same_dir_window = find_filer_window(path, NULL); if (same_dir_window) { @@ -1628,9 +1628,8 @@ void full_refresh(void) /* See whether a filer window with a given path already exists * and is different from diff. - * XXX: real_path or sym_path? */ -static FilerWindow *find_filer_window(char *real_path, FilerWindow *diff) +static FilerWindow *find_filer_window(const char *sym_path, FilerWindow *diff) { GList *next = all_filer_windows; @@ -1639,7 +1638,7 @@ static FilerWindow *find_filer_window(char *real_path, FilerWindow *diff) FilerWindow *filer_window = (FilerWindow *) next->data; if (filer_window != diff && - strcmp(real_path, filer_window->real_path) == 0) + strcmp(sym_path, filer_window->sym_path) == 0) { return filer_window; } diff --git a/ROX-Filer/src/menu.c b/ROX-Filer/src/menu.c index abe6e0db..24a68a05 100644 --- a/ROX-Filer/src/menu.c +++ b/ROX-Filer/src/menu.c @@ -117,6 +117,7 @@ static void new_file_type(gchar *templ); static void do_send_to(gchar *templ); static void show_send_to_menu(GList *paths, GdkEvent *event); static GList *set_keys_button(Option *option, xmlNode *node, guchar *label); +static void options_closed(GtkWindow *options, gpointer unused); /* Note that for most of these callbacks none of the arguments are used. */ @@ -1188,7 +1189,16 @@ static void invert_selection(gpointer data, guint action, GtkWidget *widget) void menu_show_options(gpointer data, guint action, GtkWidget *widget) { - options_show(); + GtkWidget *win; + + win = options_show(); + + if (win) + { + number_of_windows++; + g_signal_connect(win, "destroy", + G_CALLBACK(options_closed), NULL); + } } static gboolean new_directory_cb(GObject *savebox, @@ -1833,3 +1843,10 @@ static GList *set_keys_button(Option *option, xmlNode *node, guchar *label) return g_list_append(NULL, align); } + +static void options_closed(GtkWindow *options, gpointer unused) +{ + if (--number_of_windows == 0) + gtk_main_quit(); +} + -- 2.11.4.GIT