From 9b32010f347ccda4d231f0ef4dc29cd47c6b8e9c Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sun, 22 Dec 2002 18:48:20 +0000 Subject: [PATCH] r2227: Changes menus for new details stuff. --- ROX-Filer/Options.xml | 1 - ROX-Filer/src/display.c | 35 +------------------ ROX-Filer/src/filer.c | 2 +- ROX-Filer/src/global.h | 1 - ROX-Filer/src/menu.c | 92 +++++++++++++++++++++++++++++++++---------------- ROX-Filer/src/remote.c | 2 +- 6 files changed, 65 insertions(+), 68 deletions(-) diff --git a/ROX-Filer/Options.xml b/ROX-Filer/Options.xml index 13c86c34..5a46498c 100644 --- a/ROX-Filer/Options.xml +++ b/ROX-Filer/Options.xml @@ -59,7 +59,6 @@ - diff --git a/ROX-Filer/src/display.c b/ROX-Filer/src/display.c index 11a51bff..ee38190d 100644 --- a/ROX-Filer/src/display.c +++ b/ROX-Filer/src/display.c @@ -474,37 +474,6 @@ static char *details(FilerWindow *filer_window, DirItem *item) if (scanned && item->lstat_errno) buf = g_strdup_printf(_("lstat(2) failed: %s"), g_strerror(item->lstat_errno)); - else if (filer_window->details_type == DETAILS_SUMMARY) - { - gchar *time; - - if (!scanned) - return g_strdup("XXXX ---,---,---/--" -#ifdef S_ISVTX - "-" -#endif - " 12345678 12345678 " - "1234M 00:00:00 01 Mmm Yyyy"); - - time = pretty_time(&item->mtime); - - buf = g_strdup_printf("%s %s %-8.8s %-8.8s %s %s", - item->flags & ITEM_FLAG_APPDIR? "App " : - S_ISDIR(m) ? "Dir " : - S_ISCHR(m) ? "Char" : - S_ISBLK(m) ? "Blck" : - S_ISLNK(m) ? "Link" : - S_ISSOCK(m) ? "Sock" : - S_ISFIFO(m) ? "Pipe" : - S_ISDOOR(m) ? "Door" : - "File", - pretty_permissions(m), - user_name(item->uid), - group_name(item->gid), - format_size_aligned(item->size), - time); - g_free(time); - } else if (filer_window->details_type == DETAILS_TYPE) { MIME_type *type = item->mime_type; @@ -622,9 +591,7 @@ void display_update_view(FilerWindow *filer_window, view->details_width = w / PANGO_SCALE; view->details_height = h / PANGO_SCALE; - if (filer_window->details_type == DETAILS_SUMMARY) - perm_offset = 5; - else if (filer_window->details_type == DETAILS_PERMISSIONS) + if (filer_window->details_type == DETAILS_PERMISSIONS) perm_offset = 0; if (perm_offset > -1) { diff --git a/ROX-Filer/src/filer.c b/ROX-Filer/src/filer.c index a08545ea..3d8e7e97 100644 --- a/ROX-Filer/src/filer.c +++ b/ROX-Filer/src/filer.c @@ -1165,7 +1165,7 @@ FilerWindow *filer_opendir(const char *path, FilerWindow *src_win, filer_window->temp_item_selected = FALSE; filer_window->flags = (FilerFlags) 0; - filer_window->details_type = DETAILS_SUMMARY; + filer_window->details_type = DETAILS_TIMES; filer_window->display_style = UNKNOWN_STYLE; filer_window->thumb_queue = NULL; filer_window->max_thumbs = 0; diff --git a/ROX-Filer/src/global.h b/ROX-Filer/src/global.h index df66e294..aa951665 100644 --- a/ROX-Filer/src/global.h +++ b/ROX-Filer/src/global.h @@ -116,7 +116,6 @@ typedef enum { /* Values used in options, must start at 0 */ typedef enum { /* Values used in options, must start at 0 */ DETAILS_NONE = 0, - DETAILS_SUMMARY = 1, DETAILS_SIZE = 2, DETAILS_PERMISSIONS = 3, DETAILS_TYPE = 4, diff --git a/ROX-Filer/src/menu.c b/ROX-Filer/src/menu.c index 5c96345d..6f36a543 100644 --- a/ROX-Filer/src/menu.c +++ b/ROX-Filer/src/menu.c @@ -122,10 +122,11 @@ static GList *set_keys_button(Option *option, xmlNode *node, guchar *label); /* Note that for most of these callbacks none of the arguments are used. */ +static void view_type(gpointer data, guint action, GtkWidget *widget); + /* (action used in these three - DetailsType) */ -static void huge_with(gpointer data, guint action, GtkWidget *widget); -static void large_with(gpointer data, guint action, GtkWidget *widget); -static void small_with(gpointer data, guint action, GtkWidget *widget); +static void change_size(gpointer data, guint action, GtkWidget *widget); +static void set_with(gpointer data, guint action, GtkWidget *widget); static void sort_name(gpointer data, guint action, GtkWidget *widget); static void sort_type(gpointer data, guint action, GtkWidget *widget); @@ -175,27 +176,16 @@ static GtkWidget *filer_follow_sym; /* Follow symbolic links item */ static GtkItemFactoryEntry filer_menu_def[] = { {N_("Display"), NULL, NULL, 0, ""}, -{">" N_("Huge Icons"), NULL, huge_with, DETAILS_NONE, NULL}, -{">" N_("Large Icons"), NULL, large_with, DETAILS_NONE, NULL}, -{">" N_("Small Icons"), NULL, small_with, DETAILS_NONE, NULL}, -{">" N_("Huge, With..."), NULL, NULL, 0, ""}, -{">>" N_("Summary"), NULL, huge_with, DETAILS_SUMMARY, NULL}, -{">>" N_("Sizes"), NULL, huge_with, DETAILS_SIZE, NULL}, -{">>" N_("Permissions"), NULL, huge_with, DETAILS_PERMISSIONS, NULL}, -{">>" N_("Type"), NULL, huge_with, DETAILS_TYPE, NULL}, -{">>" N_("Times"), NULL, huge_with, DETAILS_TIMES, NULL}, -{">" N_("Large, With..."), NULL, NULL, 0, ""}, -{">>" N_("Summary"), NULL, large_with, DETAILS_SUMMARY, NULL}, -{">>" N_("Sizes"), NULL, large_with, DETAILS_SIZE, NULL}, -{">>" N_("Permissions"), NULL, large_with, DETAILS_PERMISSIONS, NULL}, -{">>" N_("Type"), NULL, large_with, DETAILS_TYPE, NULL}, -{">>" N_("Times"), NULL, large_with, DETAILS_TIMES, NULL}, -{">" N_("Small, With..."), NULL, NULL, 0, ""}, -{">>" N_("Summary"), NULL, small_with, DETAILS_SUMMARY, NULL}, -{">>" N_("Sizes"), NULL, small_with, DETAILS_SIZE, NULL}, -{">>" N_("Permissions"), NULL, small_with, DETAILS_PERMISSIONS, NULL}, -{">>" N_("Type"), NULL, small_with, DETAILS_TYPE, NULL}, -{">>" N_("Times"), NULL, small_with, DETAILS_TIMES, NULL}, +{">" N_("Icons View"), NULL, view_type, VIEW_TYPE_COLLECTION, NULL}, +{">" N_("Icons, With..."), NULL, NULL, 0, ""}, +{">>" N_("Sizes"), NULL, set_with, DETAILS_SIZE, NULL}, +{">>" N_("Permissions"), NULL, set_with, DETAILS_PERMISSIONS, NULL}, +{">>" N_("Type"), NULL, set_with, DETAILS_TYPE, NULL}, +{">>" N_("Times"), NULL, set_with, DETAILS_TIMES, NULL}, +{">" N_("Details View"), NULL, view_type, VIEW_TYPE_DETAILS, NULL}, +{">", NULL, NULL, 0, ""}, +{">" N_("Bigger Icons"), NULL, change_size, 1, NULL}, +{">" N_("Smaller Icons"), NULL, change_size, -1, NULL}, {">", NULL, NULL, 0, ""}, {">" N_("Sort by Name"), NULL, sort_name, 0, NULL}, {">" N_("Sort by Type"), NULL, sort_type, 0, NULL}, @@ -869,19 +859,61 @@ void menu_show_shift_action(GtkWidget *menu_item, DirItem *item, gboolean next) /* Actions */ -static void huge_with(gpointer data, guint action, GtkWidget *widget) +static void view_type(gpointer data, guint action, GtkWidget *widget) { - display_set_layout(window_with_focus, HUGE_ICONS, action); + ViewType view_type = (ViewType) action; + + g_return_if_fail(window_with_focus != NULL); + + if (view_type == VIEW_TYPE_COLLECTION) + display_set_layout(window_with_focus, + window_with_focus->display_style, DETAILS_NONE); + + filer_set_view_type(window_with_focus, (ViewType) action); } -static void large_with(gpointer data, guint action, GtkWidget *widget) +static void change_size(gpointer data, guint action, GtkWidget *widget) { - display_set_layout(window_with_focus, LARGE_ICONS, action); + DisplayStyle size; + DetailsType type; + + g_return_if_fail(window_with_focus != NULL); + + type = window_with_focus->details_type; + size = window_with_focus->display_style; + + if (action == 1) + { + if (size == SMALL_ICONS) + size = LARGE_ICONS; + else if (size == LARGE_ICONS) + size = HUGE_ICONS; + else + return; + } + else if (action == -1) + { + if (size == LARGE_ICONS) + size = SMALL_ICONS; + else if (size == HUGE_ICONS) + size = LARGE_ICONS; + else + return; + } + + display_set_layout(window_with_focus, size, type); } -static void small_with(gpointer data, guint action, GtkWidget *widget) +static void set_with(gpointer data, guint action, GtkWidget *widget) { - display_set_layout(window_with_focus, SMALL_ICONS, action); + DisplayStyle size; + + g_return_if_fail(window_with_focus != NULL); + + size = window_with_focus->display_style; + + filer_set_view_type(window_with_focus, VIEW_TYPE_COLLECTION); + display_set_layout(window_with_focus, size, action); } static void sort_name(gpointer data, guint action, GtkWidget *widget) diff --git a/ROX-Filer/src/remote.c b/ROX-Filer/src/remote.c index 6055a506..4e06af6e 100644 --- a/ROX-Filer/src/remote.c +++ b/ROX-Filer/src/remote.c @@ -599,7 +599,7 @@ static xmlNodePtr rpc_OpenDir(GList *args) DetailsType dt; dt = !g_strcasecmp(details, "None") ? DETAILS_NONE : - !g_strcasecmp(details, "Summary") ? DETAILS_SUMMARY : + !g_strcasecmp(details, "Summary") ? DETAILS_NONE : !g_strcasecmp(details, "Size") ? DETAILS_SIZE : !g_strcasecmp(details, "Type") ? DETAILS_TYPE : !g_strcasecmp(details, "Times") ? DETAILS_TIMES : -- 2.11.4.GIT