diff -Naur /src/Makefile/src/Makefile --- /src/Makefile 2023-01-29 22:11:51.000000000 -0500 +++/src/Makefile 2023-05-16 22:45:33.001299519 -0400 @@ -9,7 +9,7 @@ # This ensures we get the header files for GTK 2.4 with0launch: - 0launch --source --main=/ROX-Filer/build --wrapper='make -C' ../ROX-Filer-src.xml + 0launch --source --main=/arox/build --wrapper='make -C' ../arox-src.xml clean: cd ${BUILDDIR} && ${MAKE} clean diff -Naur /src/Makefile.in/src/Makefile.in --- /src/Makefile.in 2023-01-29 22:11:51.000000000 -0500 +++/src/Makefile.in 2023-06-06 22:55:41.106779279 -0400 @@ -19,7 +19,7 @@ ############ Things to change for different programs -PROG = ROX-Filer +PROG = arox SRCS = abox.c action.c appinfo.c appmenu.c bind.c bookmarks.c \ bulk_rename.c cell_icon.c choices.c collection.c dir.c \ @@ -29,7 +29,7 @@ modechange.c mount.c options.c panel.c pinboard.c pixmaps.c \ remote.c run.c sc.c session.c support.c \ tasklist.c toolbar.c type.c usericons.c view_collection.c \ - view_details.c view_iface.c wrapped.c xml.c xtypes.c \ + view_details.c view_iface.c wrapped.c xml.c \ xdgmime.c xdgmimeglob.c xdgmimeint.c xdgmimemagic.c xdgmimeparent.c xdgmimealias.c xdgmimecache.c OBJECTS = abox.o action.o appinfo.o appmenu.o bind.o bookmarks.o \ @@ -40,7 +40,7 @@ modechange.o mount.o options.o panel.o pinboard.o pixmaps.o \ remote.o run.o sc.o session.o support.o \ tasklist.o toolbar.o type.o usericons.o view_collection.o \ - view_details.o view_iface.o wrapped.o xml.o xtypes.o \ + view_details.o view_iface.o wrapped.o xml.o \ xdgmime.o xdgmimeglob.o xdgmimeint.o xdgmimemagic.o xdgmimeparent.o xdgmimealias.o xdgmimecache.o ############ Things to keep the same @@ -49,9 +49,9 @@ ${CC} -o "${PROG}" ${OBJECTS} ${LDFLAGS} mv "${PROG}" "${PLATFORM_DIR}" -(cd "${PLATFORM_DIR}" && \ - objcopy --only-keep-debug ROX-Filer ROX-Filer.dbg && \ + objcopy --only-keep-debug arox arox.dbg && \ # strip ROX-Filer && \ - objcopy --add-gnu-debuglink=ROX-Filer.dbg ROX-Filer) + objcopy --add-gnu-debuglink=arox.dbg arox) clean: rm -f *.o Makefile.bak diff -Naur /src/abox.c/src/abox.c --- /src/abox.c 2023-01-29 22:11:51.000000000 -0500 +++/src/abox.c 2023-06-03 01:21:53.742863841 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free diff -Naur /src/abox.h/src/abox.h --- /src/abox.h 2023-01-29 22:11:51.000000000 -0500 +++/src/abox.h 2023-06-03 01:32:42.515802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef __ABOX_H__ diff -Naur /src/action.c/src/action.c --- /src/action.c 2023-01-29 22:11:51.000000000 -0500 +++/src/action.c 2023-06-06 23:09:23.234701909 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -50,16 +50,10 @@ #include "icon.h" #include "mount.h" #include "type.h" -#include "xtypes.h" #include "log.h" -#if defined(HAVE_GETXATTR) -# define ATTR_MAN_PAGE N_("See the attr(5) man page for full details.") -#elif defined(HAVE_ATTROPEN) -# define ATTR_MAN_PAGE N_("See the fsattr(5) man page for full details.") -#else # define ATTR_MAN_PAGE N_("You do not appear to have OS support.") -#endif + /* Parent->Child messages are one character each: * @@ -1375,12 +1369,6 @@ comment); } - if (xtype_set(path, type_change)) - { - send_error(); - return; - } - send_check_path(path); } else if (S_ISDIR(info.st_mode)) @@ -1608,7 +1596,6 @@ { /* (just been created then) */ lchown(safe_dest, info.st_uid, info.st_gid); - xattr_copy(safe_path, safe_dest); send_check_path(safe_dest); } diff -Naur /src/action.h/src/action.h --- /src/action.h 2023-01-29 22:11:51.000000000 -0500 +++/src/action.h 2023-06-03 01:32:42.515802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _ACTION_H diff -Naur /src/appinfo.c/src/appinfo.c --- /src/appinfo.c 2023-01-29 22:11:51.000000000 -0500 +++/src/appinfo.c 2023-06-03 01:22:42.078859292 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free diff -Naur /src/appinfo.h/src/appinfo.h --- /src/appinfo.h 2023-01-29 22:11:51.000000000 -0500 +++/src/appinfo.h 2023-06-03 01:32:42.515802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _APPINFO_H diff -Naur /src/appmenu.c/src/appmenu.c --- /src/appmenu.c 2023-01-29 22:11:51.000000000 -0500 +++/src/appmenu.c 2023-06-03 01:22:49.886858558 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -307,7 +307,7 @@ leaf = g_strconcat(".", type->media_type ?: "all", type->subtype ? "_" : NULL, type->subtype, NULL); - path = choices_find_xdg_path_save(leaf, "SendTo", SITE, TRUE); + path = choices_find_xdg_path_save(leaf, "SendTo", TRUE); g_free(leaf); mkdir(path, 0755); @@ -328,11 +328,6 @@ widgets = g_list_reverse(widgets); current_items = g_list_concat(widgets, current_items); - item = gtk_menu_item_new_with_label(_("Customise Menu...")); - current_items = g_list_prepend(current_items, item); - g_signal_connect(item, "activate", G_CALLBACK(customise_type), type); - - gtk_widget_show(item); } static inline gboolean is_dir(const char *dir) diff -Naur /src/appmenu.h/src/appmenu.h --- /src/appmenu.h 2023-01-29 22:11:51.000000000 -0500 +++/src/appmenu.h 2023-06-03 01:32:42.515802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard * * This file by Diego Zamboni */ diff -Naur /src/bind.c/src/bind.c --- /src/bind.c 2023-01-29 22:11:51.000000000 -0500 +++/src/bind.c 2023-06-03 01:22:56.846857903 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free diff -Naur /src/bind.h/src/bind.h --- /src/bind.h 2023-01-29 22:11:51.000000000 -0500 +++/src/bind.h 2023-06-03 01:32:42.516802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _BIND_H diff -Naur /src/bookmarks.c/src/bookmarks.c --- /src/bookmarks.c 2023-01-29 22:11:51.000000000 -0500 +++/src/bookmarks.c 2023-06-07 14:25:13.193773272 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -519,7 +519,7 @@ gchar *path; /* Update the bookmarks, if possible */ - path = choices_find_xdg_path_load("Bookmarks.xml", PROJECT, SITE); + path = choices_find_xdg_path_load("Bookmarks.xml", APPNAME); if (path) { XMLwrapper *wrapper; @@ -577,8 +577,7 @@ { guchar *save_path; - save_path = choices_find_xdg_path_save("Bookmarks.xml", PROJECT, SITE, - TRUE); + save_path = choices_find_xdg_path_save("Bookmarks.xml", NULL, TRUE); if (save_path) { save_xml_file(bookmarks->doc, save_path); diff -Naur /src/bookmarks.h/src/bookmarks.h --- /src/bookmarks.h 2023-01-29 22:11:51.000000000 -0500 +++/src/bookmarks.h 2023-06-03 01:32:42.516802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _BOOKMARKS_H diff -Naur /src/build/src/build --- /src/build 2023-01-29 22:11:51.000000000 -0500 +++/src/build 2023-05-16 22:52:39.065259422 -0400 @@ -1,29 +1,29 @@ #!/bin/sh -# This script is called by ROX-Filer-src.xml. It builds the filer +# This script is called by arox-src.xml. It builds the filer # against the GTK 2.4 headers, using the gtk-2.4 compatibility environment. # This should already exist for releases, but is needed for Git checkouts -if [ ! -f "$SRCDIR/ROX-Filer/src/configure" ]; then - (cd "$SRCDIR/ROX-Filer/src" && autoconf) || exit 1 +if [ ! -f "$SRCDIR/arox/src/configure" ]; then + (cd "$SRCDIR/arox/src" && autoconf) || exit 1 fi # This should already exist for releases, but is needed for Git checkouts if [ ! -f "$SRCDIR/rox.1" ]; then - (make -C "$SRCDIR/ROX-Filer/src/Docs") || exit 1 + (make -C "$SRCDIR/arox/src/Docs") || exit 1 fi if [ ! -f Makefile ]; then - "$SRCDIR/ROX-Filer/src/configure" "$@" || exit 1 + "$SRCDIR/arox/src/configure" "$@" || exit 1 fi -[ -d "$DISTDIR/ROX-Filer" ] || mkdir "$DISTDIR/ROX-Filer" || exit 1 +[ -d "$DISTDIR/arox" ] || mkdir "$DISTDIR/arox" || exit 1 -make "PLATFORM_DIR=$DISTDIR/ROX-Filer"|| exit 1 +make "PLATFORM_DIR=$DISTDIR/arox"|| exit 1 (cd "$SRCDIR" && cp -r Choices README README-es rox.xml rox.1 "$DISTDIR") || exit 1 -(cd "$SRCDIR/ROX-Filer" && cp -r .DirIcon Help images Messages ROX AppInfo.xml AppRun Options.xml style.css subclasses Templates.ui "$DISTDIR/ROX-Filer") || exit 1 +(cd "$SRCDIR/arox" && cp -r .DirIcon Help images Messages ROX AppInfo.xml AppRun Options.xml style.css subclasses Templates.ui "$DISTDIR/arox") || exit 1 find "$DISTDIR" -name '.svn' -type d |xargs rm -rf # Remove debugging symbols, if any -rm -f "$DISTDIR/ROX-Filer/ROX-Filer.dbg" +rm -f "$DISTDIR/arox/arox.dbg" diff -Naur /src/bulk_rename.c/src/bulk_rename.c --- /src/bulk_rename.c 2023-01-29 22:11:51.000000000 -0500 +++/src/bulk_rename.c 2023-06-03 01:23:10.886856581 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free diff -Naur /src/bulk_rename.h/src/bulk_rename.h --- /src/bulk_rename.h 2023-01-29 22:11:51.000000000 -0500 +++/src/bulk_rename.h 2023-06-03 01:32:42.516802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _BULK_RENAME_H diff -Naur /src/cell_icon.c/src/cell_icon.c --- /src/cell_icon.c 2023-01-29 22:11:51.000000000 -0500 +++/src/cell_icon.c 2023-06-03 01:23:17.822855929 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free diff -Naur /src/cell_icon.h/src/cell_icon.h --- /src/cell_icon.h 2023-01-29 22:11:51.000000000 -0500 +++/src/cell_icon.h 2023-06-03 01:32:42.516802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _CELL_ICON_H diff -Naur /src/choices.c/src/choices.c --- /src/choices.c 2023-01-29 22:11:51.000000000 -0500 +++/src/choices.c 2023-06-07 14:29:30.209749084 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -33,28 +33,10 @@ #include "choices.h" static gboolean saving_disabled = TRUE; -static gchar **dir_list = NULL; -static gchar **xdg_dir_list = NULL; -static int xdg_dir_count= 0 ; - -static struct migration { - const char *dir; - const char *site; - int symlink; -} to_migrate[]={ - {"ROX-Filer", SITE, TRUE}, - {"SendTo", SITE, TRUE}, - {"Templates", SITE, TRUE}, - {"MIME-types", SITE, TRUE}, - {"MIME-icons", SITE, TRUE}, - {"MIME-thumb", SITE, TRUE}, - - {NULL, NULL, 0} -}; +static GSList *dirs; /* Static prototypes */ static gboolean exists(char *path); -static void migrate_choices(void); /**************************************************************** * EXTERNAL INTERFACE * @@ -68,95 +50,15 @@ */ void choices_init(void) { - char *choices; - const char *env; - char **dirs; - int i, n; - - g_return_if_fail(dir_list == NULL); - - /* Initialize old system */ - choices = getenv("CHOICESPATH"); - - if (choices) - { - if (*choices != ':' && *choices != '\0') - saving_disabled = FALSE; - - while (*choices == ':') - choices++; - - if (*choices == '\0') - { - dir_list = g_new(char *, 1); - dir_list[0] = NULL; - } - else - dir_list = g_strsplit(choices, ":", 0); - } - else - { - saving_disabled = FALSE; - - dir_list = g_new(gchar *, 4); - dir_list[0] = g_build_filename(g_get_home_dir(), "Choices", - NULL); - dir_list[1] = g_strdup("/usr/local/share/Choices"); - dir_list[2] = g_strdup("/usr/share/Choices"); - dir_list[3] = NULL; - } + saving_disabled = FALSE; - /* Initialize new system */ - env = getenv("XDG_CONFIG_DIRS"); - if (!env) - env = "/etc/xdg"; - dirs = g_strsplit(env, ":", 0); - g_return_if_fail(dirs != NULL); - for (n = 0; dirs[n]; n++) - ; - for (i = n; i > 0; i--) - dirs[i] = dirs[i - 1]; - env = getenv("XDG_CONFIG_HOME"); - if (env) - dirs[0] = g_strdup(env); - else - dirs[0] = g_build_filename(g_get_home_dir(), ".config", NULL); + char *dir = g_build_filename(g_get_user_config_dir(), NULL); + if (!g_file_test(dir, G_FILE_TEST_EXISTS)) + g_mkdir_with_parents(dir, 0700); - xdg_dir_list = dirs; - xdg_dir_count = n + 1; - -#if 0 - { - gchar **cdir = dir_list; - - for(i=0; i "/usr/local/share/Choices/ROX-Filer/menus". - * - * The return values may be NULL - use built-in defaults. - * g_free() the result. - */ -static gchar *choices_find_path_load(const char *leaf, const char *dir) -{ - gchar **cdir = dir_list; - - g_return_val_if_fail(dir_list != NULL, NULL); - - for (; *cdir; cdir++) - { - gchar *path; - - path = g_build_filename(*cdir, dir, leaf, NULL); - - if (exists(path)) - return path; - - g_free(path); - } - - return NULL; -} - /* Get the pathname of a choices file to load, using the XDG paths. Eg: * * choices_find_xdg_path_load("menus", "ROX-Filer", "rox.sourceforge.net") @@ -209,23 +82,16 @@ * The return values may be NULL - use built-in defaults. * g_free() the result. */ -gchar *choices_find_xdg_path_load(const char *leaf, const char *dir, - const char *site) +gchar *choices_find_xdg_path_load(const char *leaf, const char *dir) { - int i; - - g_return_val_if_fail(dir_list != NULL, NULL); - - for (i=0; inext) { gchar *path; - if(site) - path = g_build_filename(xdg_dir_list[i], site, - dir, leaf, NULL); + if(dir) + path = g_build_filename(d->data, dir, leaf, NULL); else - path = g_build_filename(xdg_dir_list[i], dir, - leaf, NULL); + path = g_build_filename(d->data, leaf, NULL); if (exists(path)) return path; @@ -233,45 +99,9 @@ g_free(path); } - return choices_find_path_load(leaf, dir); + return NULL; } -/* Returns the pathname of a file to save to, or NULL if saving is - * disabled. If 'create' is TRUE then intermediate directories will - * be created (set this to FALSE if you just want to find out where - * a saved file would go without actually altering the filesystem). - * - * g_free() the result. - */ -static gchar *choices_find_path_save(const char *leaf, const char *dir, - gboolean create) -{ - gchar *path, *retval; - - g_return_val_if_fail(dir_list != NULL, NULL); - - if (saving_disabled) - return NULL; - - if (create && !exists(dir_list[0])) - { - if (mkdir(dir_list[0], 0777)) - g_warning("mkdir(%s): %s\n", dir_list[0], - g_strerror(errno)); - } - - path = g_build_filename(dir_list[0], dir, NULL); - if (create && !exists(path)) - { - if (mkdir(path, 0777)) - g_warning("mkdir(%s): %s\n", path, g_strerror(errno)); - } - - retval = g_build_filename(path, leaf, NULL); - g_free(path); - - return retval; -} /* Returns the pathname of a file to save to, or NULL if saving is * disabled. If 'create' is TRUE then intermediate directories will @@ -281,42 +111,18 @@ * g_free() the result. */ gchar *choices_find_xdg_path_save(const char *leaf, const char *dir, - const char *site, gboolean create) + gboolean create) { - gchar *path, *retval, *tmp; - - g_return_val_if_fail(xdg_dir_list != NULL, NULL); - - if (create && !exists(xdg_dir_list[0])) - { - if (mkdir(xdg_dir_list[0], 0777)) - g_warning("mkdir(%s): %s\n", xdg_dir_list[0], - g_strerror(errno)); - } + if (saving_disabled) return NULL; - if(site) - { - path = g_build_filename(xdg_dir_list[0], site, NULL); - if (create && !exists(path)) - { - if (mkdir(path, 0777)) - g_warning("mkdir(%s): %s\n", path, - g_strerror(errno)); - } - tmp=path; - } else { - tmp=g_strdup(xdg_dir_list[0]); - } - - path = g_build_filename(tmp, dir, NULL); - g_free(tmp); + char *path = g_build_filename(dirs->data, dir, NULL); if (create && !exists(path)) { if (mkdir(path, 0777)) g_warning("mkdir(%s): %s\n", path, g_strerror(errno)); } - retval = g_build_filename(path, leaf, NULL); + char *retval = g_build_filename(path, leaf, NULL); g_free(path); return retval; @@ -331,25 +137,13 @@ * * Free the list using choices_free_list(). */ -GPtrArray *choices_list_xdg_dirs(char *dir, char *site) +GPtrArray *choices_list_xdg_dirs(char *dir) { - GPtrArray *list; - int i; + GPtrArray *list = g_ptr_array_new(); - g_return_val_if_fail(xdg_dir_list != NULL, NULL); - - list = g_ptr_array_new(); - - for (i=0; inext) { - guchar *path; - - if(site) - path = g_build_filename(xdg_dir_list[i], site, - dir, NULL); - else - path = g_build_filename(xdg_dir_list[i], dir, NULL); - + guchar *path = g_build_filename(d->data, dir, NULL); if (exists(path)) g_ptr_array_add(list, path); else @@ -371,76 +165,3 @@ return stat(path, &info) == 0; } - -#include -#include - -static void migrate_choices(void) -{ - gchar *opath, *npath; - int failed=0; - int i; - gchar *src, *dest; - gboolean migrated_something = FALSE; - - npath=choices_find_xdg_path_save("...", PROJECT, SITE, FALSE); - opath=choices_find_path_save("...", PROJECT,FALSE); - - /* - dest=choices_find_xdg_path_save(".", PROJECT, SITE, TRUE); - g_free(dest); - */ - - for(i=0; to_migrate[i].dir; i++) { - src=g_build_filename(dir_list[0], to_migrate[i].dir, NULL); - dest=choices_find_xdg_path_save(NULL, NULL, - to_migrate[i].site, TRUE); - g_free(dest); - dest=choices_find_xdg_path_save(NULL, - to_migrate[i].dir, - to_migrate[i].site, - FALSE); - errno=0; - if(exists(src)) { - if(rename(src, dest)==0) { - if(to_migrate[i].symlink) - symlink(dest, src); - migrated_something = TRUE; - } else { - g_warning("rename(%s, %s): %s\n", - src, dest, - g_strerror(errno)); - failed++; - } - } else if(to_migrate[i].symlink) { - /* - if(!exists(dir_list[0])) { - if (mkdir(dir_list[0], 0777)) - g_warning("mkdir(%s): %s\n", - dir_list[0], - g_strerror(errno)); - } - symlink(dest, src); - */ - } - g_free(src); - g_free(dest); - } - - if (migrated_something) - { - gchar *failed_msg = NULL; - if (failed) - failed_msg = g_strdup_printf(_("%d directories could not be migrated"), - failed); - info_message(_("Choices have been moved from \n" - "%s\n " - "to the new location \n" - "%s\n%s"), - opath, npath, failed_msg ? failed_msg : ""); - g_free(failed_msg); - } - - g_free(opath); - g_free(npath); -} diff -Naur /src/choices.h/src/choices.h --- /src/choices.h 2023-01-29 22:11:51.000000000 -0500 +++/src/choices.h 2023-06-03 01:32:42.516802786 -0400 @@ -1,5 +1,5 @@ /* - * By Thomas Leonard, . + * based upon ROX-Filer by Thomas Leonard */ #ifndef _CHOICES_H @@ -9,11 +9,9 @@ void choices_migrate (void); void choices_free_list (GPtrArray *list); -gchar *choices_find_xdg_path_load(const char *leaf, const char *dir, - const char *site); -gchar *choices_find_xdg_path_save(const char *leaf, const char *dir, - const char *site, gboolean create); -GPtrArray *choices_list_xdg_dirs(char *dir, char *site); +gchar *choices_find_xdg_path_load(const char *leaf, const char *dir); +gchar *choices_find_xdg_path_save(const char *leaf, const char *dir, gboolean create); +GPtrArray *choices_list_xdg_dirs(char *dir); #endif /* _CHOICES_H */ diff -Naur /src/collection.c/src/collection.c --- /src/collection.c 2023-01-29 22:11:51.000000000 -0500 +++/src/collection.c 2023-06-03 01:23:31.678854625 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * The collection widget provides an area for displaying a collection of * objects (such as files). It allows the user to choose a selection of @@ -34,8 +34,8 @@ #include "filer.h" #include "options.h" -#define MIN_WIDTH 80 -#define MIN_HEIGHT 60 +#define MIN_WIDTH 140 +#define MIN_HEIGHT 80 #define MINIMUM_ITEMS 16 #define MAX_WINKS 7 /* Should be an odd number */ diff -Naur /src/config.h.in/src/config.h.in --- /src/config.h.in 2023-01-29 22:11:51.000000000 -0500 +++/src/config.h.in 2023-06-07 14:42:03.834678161 -0400 @@ -1,7 +1,7 @@ /* The configure script will auto-generate config.h from config.h.in */ -#define PROJECT "ROX-Filer" -#define VERSION "Unknown" +#define APPNAME "arox" +#define VERSION "20230607" #define GTK_VERSION "Unknown" #undef STDC_HEADERS @@ -31,11 +31,6 @@ #undef HAVE_MMAP -#undef HAVE_GETXATTR -#undef HAVE_ATTROPEN -#undef HAVE_SYS_XATTR_H -#undef HAVE_ATTR_XATTR_H - /* Enable extensions - used for dnotify support */ #ifndef _GNU_SOURCE # define _GNU_SOURCE diff -Naur /src/dir.c/src/dir.c --- /src/dir.c 2023-01-29 22:11:51.000000000 -0500 +++/src/dir.c 2023-06-03 01:23:50.102852891 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) diff -Naur /src/dir.h/src/dir.h --- /src/dir.h 2023-01-29 22:11:51.000000000 -0500 +++/src/dir.h 2023-06-03 01:13:46.854909662 -0400 @@ -1,5 +1,5 @@ /* - * ROX-Filer, filer for the ROX desktop project + * Arox - filer/thumbnail viewer for Absolute Linux * Thomas Leonard, */ diff -Naur /src/diritem.c/src/diritem.c --- /src/diritem.c 2023-01-29 22:11:51.000000000 -0500 +++/src/diritem.c 2023-06-06 23:10:35.970695063 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -43,7 +43,6 @@ #include "options.h" #include "fscache.h" #include "pixmaps.h" -#include "xtypes.h" #define RECENT_DELAY (5 * 60) /* Time in seconds to consider a file recent */ #define ABOUT_NOW(time) (diritem_recent_time - time < RECENT_DELAY) @@ -129,9 +128,6 @@ if (ABOUT_NOW(item->mtime) || ABOUT_NOW(item->ctime)) item->flags |= ITEM_FLAG_RECENT; - if (xattr_have(path)) - item->flags |= ITEM_FLAG_HAS_XATTR; - if (item->label) { g_mutex_lock(&m_diritems); @@ -140,7 +136,7 @@ retitem->label = NULL; g_mutex_unlock(&m_diritems); } - item->label = xlabel_get(path); +// item->label = xlabel_get(path); if (S_ISLNK(info.st_mode)) { diff -Naur /src/diritem.h/src/diritem.h --- /src/diritem.h 2023-01-29 22:11:51.000000000 -0500 +++/src/diritem.h 2023-06-06 22:53:00.937794352 -0400 @@ -1,5 +1,5 @@ /* - * ROX-Filer, filer for the ROX desktop project + * Arox - filer/thumbnail viewer for Absolute Linux * Thomas Leonard, */ @@ -32,7 +32,6 @@ ITEM_FLAG_GONE = 0x4000, ITEM_FLAG_CAPS = 0x400, - ITEM_FLAG_HAS_XATTR = 0x800, /* Has extended attributes set */ } ItemFlags; struct _DirItem diff -Naur /src/display.c/src/display.c --- /src/display.c 2023-01-29 22:11:51.000000000 -0500 +++/src/display.c 2023-06-08 00:23:11.929396747 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -54,7 +54,6 @@ #include "dir.h" #include "diritem.h" #include "view_iface.h" -#include "xtypes.h" /* Options bits */ static Option o_display_caps_first; @@ -87,7 +86,6 @@ Option o_display_inherit_options; static Option o_filer_change_size_num; Option o_vertical_order_small, o_vertical_order_large; -Option o_xattr_show; Option o_view_alpha; Option o_use_background_colour; Option o_background_colour; @@ -107,7 +105,7 @@ void display_init() { option_add_int(&o_display_caps_first, "display_caps_first", FALSE); - option_add_int(&o_display_dirs_first, "display_dirs_first", FALSE); + option_add_int(&o_display_dirs_first, "display_dirs_first", TRUE); option_add_int(&o_display_newly_first, "display_newly_first", FALSE); option_add_int(&o_display_inherit_options, @@ -115,11 +113,10 @@ option_add_int(&o_display_sort_by, "display_sort_by", SORT_NAME); option_add_int(&o_display_show_hidden, "display_show_hidden", TRUE); option_add_int(&o_enable_dot_hidden_file, "enable_dot_hidden_file", FALSE); - option_add_int(&o_xattr_show, "xattr_show", TRUE); option_add_string(&o_time_format, "time_format", COMPACT_TIME_FORMAT); option_add_int(&o_huge_size, "huge_size", HUGE_SIZE); - option_add_int(&o_display_size, "display_icon_size", AUTO_SIZE_ICONS); + option_add_int(&o_display_size, "display_icon_size", SMALL_ICONS); option_add_int(&o_display_details, "display_details", DETAILS_NONE); option_add_int(&o_filer_change_size_num, "filer_change_size_num", 90); @@ -128,18 +125,18 @@ option_add_int(&o_wrap_by_char, "wrap_by_char", FALSE); option_add_int(&o_small_width, "display_small_width", 160); - option_add_int(&o_view_alpha, "view_alpha", 22); + option_add_int(&o_view_alpha, "view_alpha", 0); - option_add_int(&o_vertical_order_small, "vertical_order_small", TRUE); + option_add_int(&o_vertical_order_small, "vertical_order_small", FALSE); option_add_int(&o_vertical_order_large, "vertical_order_large", FALSE); option_add_int(&o_display_show_headers, "display_show_headers", TRUE); option_add_int(&o_display_show_full_type, "display_show_full_type", FALSE); - option_add_int(&o_display_show_thumbs, "display_show_thumbs", FALSE); - option_add_int(&o_display_show_dir_thumbs, "display_show_dir_thumbs", TRUE); + option_add_int(&o_display_show_thumbs, "display_show_thumbs", TRUE); + option_add_int(&o_display_show_dir_thumbs, "display_show_dir_thumbs", FALSE); - option_add_int(&o_use_background_colour, "use_background_colour", FALSE); - option_add_string(&o_background_colour, "background_colour", "#000000"); + option_add_int(&o_use_background_colour, "use_background_colour", TRUE); + option_add_string(&o_background_colour, "background_colour", "#EDE4CA"); option_add_int(&o_display_less_clickable_cols, "display_less_clickable_cols", FALSE); option_add_int(&o_display_name_width, "display_name_width", 0); @@ -409,11 +406,6 @@ draw_mini_emblem_on_icon(cr, style, ROX_STOCK_SYMLINK, &image_x, area->y, area->height, NULL); } - if ((item->flags & ITEM_FLAG_HAS_XATTR) && o_xattr_show.int_value) - { - draw_mini_emblem_on_icon(cr, style, ROX_STOCK_XATTR, - &image_x, area->y, area->height, item->label); - } } else if (area->width <= ICON_WIDTH && area->height <= ICON_HEIGHT) { @@ -430,11 +422,6 @@ draw_emblem_on_icon(window, style, ROX_STOCK_SYMLINK, &image_x, area->y + 2, NULL); } - if ((item->flags & ITEM_FLAG_HAS_XATTR) && o_xattr_show.int_value) - { - draw_emblem_on_icon(window, style, ROX_STOCK_XATTR, - &image_x, area->y + 2, item->label); - } } else { @@ -455,11 +442,6 @@ draw_emblem_on_icon(window, style, ROX_STOCK_SYMLINK, &image_x, emb_y + height / 19, NULL); } - if ((item->flags & ITEM_FLAG_HAS_XATTR) && o_xattr_show.int_value) - { - draw_emblem_on_icon(window, style, ROX_STOCK_XATTR, - &image_x, emb_y + height / 19, item->label); - } } cairo_destroy(cr); @@ -909,7 +891,6 @@ o_display_show_full_type.has_changed || o_vertical_order_small.has_changed || o_vertical_order_large.has_changed || - o_xattr_show.has_changed || o_view_alpha.has_changed || o_use_background_colour.has_changed || o_background_colour.has_changed || diff -Naur /src/display.h/src/display.h --- /src/display.h 2023-01-29 22:11:51.000000000 -0500 +++/src/display.h 2023-06-03 01:32:42.516802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _DISPLAY_H diff -Naur /src/dnd.c/src/dnd.c --- /src/dnd.c 2023-01-29 22:11:51.000000000 -0500 +++/src/dnd.c 2023-06-03 01:24:07.838851222 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free diff -Naur /src/dnd.h/src/dnd.h --- /src/dnd.h 2023-01-29 22:11:51.000000000 -0500 +++/src/dnd.h 2023-06-03 01:32:42.516802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _DND_H diff -Naur /src/dropbox.c/src/dropbox.c --- /src/dropbox.c 2023-01-29 22:11:51.000000000 -0500 +++/src/dropbox.c 2023-06-03 01:24:17.542850308 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free diff -Naur /src/dropbox.h/src/dropbox.h --- /src/dropbox.h 2023-01-29 22:11:51.000000000 -0500 +++/src/dropbox.h 2023-06-03 01:32:42.516802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef __DROP_BOX_H__ diff -Naur /src/filer.c/src/filer.c --- /src/filer.c 2023-01-29 22:11:51.000000000 -0500 +++/src/filer.c 2023-06-06 23:48:01.986483692 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -65,7 +65,6 @@ #include "view_details.h" #include "action.h" #include "bookmarks.h" -#include "xtypes.h" #include "usericons.h" static XMLwrapper *groups = NULL; @@ -235,14 +234,14 @@ { option_add_int(&o_filer_size_limit, "filer_size_limit", 60); option_add_int(&o_filer_width_limit, "filer_width_limit", 0); - option_add_int(&o_filer_auto_resize, "filer_auto_resize", RESIZE_ALWAYS); + option_add_int(&o_filer_auto_resize, "filer_auto_resize", RESIZE_STYLE); - option_add_int(&o_unique_filer_windows, "filer_unique_windows", 1); + option_add_int(&o_unique_filer_windows, "filer_unique_windows", 0); option_add_int(&o_short_flag_names, "filer_short_flag_names", TRUE); option_add_int(&o_filer_view_type, "filer_view_type", VIEW_TYPE_COLLECTION); option_add_int(&o_window_link, "window_link", 1); option_add_int(&o_scroll_speed, "scroll_speed", 6); - option_add_int(&o_hide_root_msg, "hide_root_msg", FALSE); + option_add_int(&o_hide_root_msg, "hide_root_msg", TRUE); option_add_int(&o_right_gap, "right_gap", 0); option_add_int(&o_bottom_gap, "bottom_gap", 0); @@ -594,7 +593,8 @@ gtk_widget_queue_draw(GTK_WIDGET(view)); } - GdkColor *tmpc = xlabel_get(fw->sym_path); +// GdkColor *tmpc = xlabel_get(fw->sym_path); + GdkColor *tmpc = NULL; if ((!tmpc) != (!fw->dir_colour) || (tmpc && fw->dir_colour && !gdk_color_equal(tmpc, fw->dir_colour))) gtk_widget_queue_draw(GTK_WIDGET(view)); @@ -1396,7 +1396,7 @@ gchar *path; /* Update the groups, if possible */ - path = choices_find_xdg_path_load("Groups.xml", PROJECT, SITE); + path = choices_find_xdg_path_load("Groups.xml", APPNAME); if (path) { XMLwrapper *wrapper; @@ -1467,8 +1467,7 @@ while ((item = iter.next(&iter))) xmlNewTextChild(group, NULL, "item", item->leafname); - save_path = choices_find_xdg_path_save("Groups.xml", PROJECT, SITE, - TRUE); + save_path = choices_find_xdg_path_save("Groups.xml", APPNAME, TRUE); if (save_path) { save_xml_file(groups->doc, save_path); @@ -2224,7 +2223,7 @@ if (wm_class) gtk_window_set_wmclass(GTK_WINDOW(filer_window->window), - wm_class, PROJECT); + wm_class, APPNAME); if (small_height == 0) { @@ -3995,30 +3994,6 @@ return file_hidden; } - /*** Test disabled for now. The flags aren't set on the first pass... - */ -#if 0 - /* Most files will not have extended attributes, so this should - * be quick. */ - if(!o_xattr_ignore.int_value && (item->flags & ITEM_FLAG_HAS_XATTR)) { - gchar *path, *val; - int len; - gboolean hidden=FALSE; - - path=g_build_filename(dir, item->leafname, NULL); - val=xattr_get(path, XATTR_HIDDEN, &len); - if(val) { - hidden=atoi(val) || (strcmp(val, "true")==0); - g_free(val); - } - g_free(path); - - if(hidden) - return TRUE; - } -#endif - - /* Otherwise not hidden */ return FALSE; } @@ -4226,7 +4201,7 @@ unmount_prompt_actions = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); - path = choices_find_xdg_path_load("Mounts", PROJECT, SITE); + path = choices_find_xdg_path_load("Mounts", APPNAME); if (!path) return; if (!g_file_get_contents(path, &buffer, &len, NULL)) @@ -4268,7 +4243,7 @@ if (!*pfp) { gchar *spath = choices_find_xdg_path_save("Mounts", - PROJECT, SITE, TRUE); + APPNAME, TRUE); if (!spath) return; @@ -4298,7 +4273,7 @@ gchar *path; XMLwrapper *settings_doc=NULL; - path=choices_find_xdg_path_load("Settings.xml", PROJECT, SITE); + path=choices_find_xdg_path_load("Settings.xml", APPNAME); if(path) { settings_doc=xml_new(path); g_free(path); @@ -4414,7 +4389,7 @@ { gchar *path; - path=choices_find_xdg_path_save("Settings.xml", PROJECT, SITE, TRUE); + path=choices_find_xdg_path_save("Settings.xml", APPNAME, TRUE); if(path) { xmlDocPtr doc = xmlNewDoc("1.0"); xmlDocSetRootElement(doc, xmlNewDocNode(doc, NULL, diff -Naur /src/filer.h/src/filer.h --- /src/filer.h 2023-01-29 22:11:51.000000000 -0500 +++/src/filer.h 2023-06-03 01:32:42.516802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _FILER_H diff -Naur /src/find.c/src/find.c --- /src/find.c 2023-01-29 22:11:51.000000000 -0500 +++/src/find.c 2023-06-03 01:24:30.118849125 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free diff -Naur /src/find.h/src/find.h --- /src/find.h 2023-01-29 22:11:51.000000000 -0500 +++/src/find.h 2023-06-03 01:32:42.516802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #include diff -Naur /src/fscache.c/src/fscache.c --- /src/fscache.c 2023-01-29 22:11:51.000000000 -0500 +++/src/fscache.c 2023-06-03 01:24:37.910848392 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * A cache object holds stat details about files in a hash table, along * with user-specified data. When you want to read in a file try to diff -Naur /src/fscache.h/src/fscache.h --- /src/fscache.h 2023-01-29 22:11:51.000000000 -0500 +++/src/fscache.h 2023-06-03 01:13:46.857909662 -0400 @@ -1,5 +1,5 @@ /* - * ROX-Filer, filer for the ROX desktop project + * Arox - filer/thumbnail viewer for Absolute Linux * Thomas Leonard, */ diff -Naur /src/global.h/src/global.h --- /src/global.h 2023-01-29 22:11:51.000000000 -0500 +++/src/global.h 2023-06-07 20:57:09.365560180 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox, file manager for Absolute Linux - based upon ROX-Filer, + * based upon ROX-Filer by Thomas Leonard */ /* global.h is included by most of the other source files, just after @@ -187,15 +187,28 @@ #define SITE "rox.sourceforge.net" /* Stock icons */ -#define ROX_STOCK_SHOW_DETAILS "rox-show-details" -#define ROX_STOCK_SHOW_HIDDEN "rox-show-hidden" +#define ROX_STOCK_BOOKMARKS "arox-bookmarks" +#define ROX_STOCK_COMPRESS "arox-compress" +#define ROX_STOCK_COPY "arox-copy" +#define ROX_STOCK_COPYHERE "arox-copy-here" +#define ROX_STOCK_COUNT "arox-count" +#define ROX_STOCK_DELETE "arox-delete" +#define ROX_STOCK_FIND "arox-find" +#define ROX_STOCK_HOME "arox-home" +#define ROX_STOCK_ICON "arox-icon" +#define ROX_STOCK_LINK "arox-link" #define ROX_STOCK_MOUNT "rox-mount" #define ROX_STOCK_MOUNTED "rox-mounted" -#define ROX_STOCK_XATTR "rox-xattr" +#define ROX_STOCK_PERMISSIONS "arox-permissions" +#define ROX_STOCK_PROPERTIES "arox-properties" +#define ROX_STOCK_REFRESH "arox-refresh" +#define ROX_STOCK_RENAME "arox-rename" +#define ROX_STOCK_RESIZE "arox-resize" +#define ROX_STOCK_SENDTO "arox-send-to" +#define ROX_STOCK_SHOW_DETAILS "arox-show-details" +#define ROX_STOCK_SHOW_HIDDEN "arox-show-hidden" #define ROX_STOCK_SYMLINK "rox-symlink" - -/* Re-use an existing icon for a slightly different purpose */ -#define ROX_STOCK_BOOKMARKS GTK_STOCK_JUMP_TO +#define ROX_STOCK_TERMINAL "arox-terminal" #define D(f, ...) g_print("#"#f"\n", __VA_ARGS__); #define DD(a) g_print("#"#a"\n"); diff -Naur /src/gtksavebox.c/src/gtksavebox.c --- /src/gtksavebox.c 2023-01-29 22:11:51.000000000 -0500 +++/src/gtksavebox.c 2023-06-03 01:24:46.750847560 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free diff -Naur /src/gtksavebox.h/src/gtksavebox.h --- /src/gtksavebox.h 2023-01-29 22:11:51.000000000 -0500 +++/src/gtksavebox.h 2023-06-03 01:32:42.517802786 -0400 @@ -1,6 +1,6 @@ /* * SaveBox widget for the ROX desktop project - * By Thomas Leonard, . + * based upon ROX-Filer by Thomas Leonard */ #ifndef __GTK_SAVEBOX_H__ diff -Naur /src/gui_support.c/src/gui_support.c --- /src/gui_support.c 2023-01-29 22:11:51.000000000 -0500 +++/src/gui_support.c 2023-06-03 01:24:53.822846894 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -967,7 +967,7 @@ */ gboolean confirm(const gchar *message, const gchar *stock, const gchar *action) { - return get_choice(PROJECT, message, 2, + return get_choice(APPNAME, message, 2, GTK_STOCK_CANCEL, NULL, stock, action) == 1; } diff -Naur /src/gui_support.h/src/gui_support.h --- /src/gui_support.h 2023-01-29 22:11:51.000000000 -0500 +++/src/gui_support.h 2023-06-03 01:32:42.517802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _GUI_SUPPORT_H diff -Naur /src/i18n.c/src/i18n.c --- /src/i18n.c 2023-01-29 22:11:51.000000000 -0500 +++/src/i18n.c 2023-06-03 01:25:00.958846223 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free diff -Naur /src/i18n.h/src/i18n.h --- /src/i18n.h 2023-01-29 22:11:51.000000000 -0500 +++/src/i18n.h 2023-06-03 01:32:42.517802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ extern char *current_lang; diff -Naur /src/icon.c/src/icon.c --- /src/icon.c 2023-01-29 22:11:51.000000000 -0500 +++/src/icon.c 2023-06-03 11:04:25.827315182 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -126,6 +126,8 @@ ACTION_LOCATION, }; +static void show_about_dialog(); + /**************************************************************** * EXTERNAL INTERFACE * ****************************************************************/ @@ -1384,12 +1386,12 @@ if (icon_menu) return; icon_menu = menu_start("", NULL); - menu_start(N_("ROX-Filer"), icon_menu); + menu_start(N_("Arox"), icon_menu); #define adi menu_add_item #define ads menu_add_stock - ads(N_("About ROX-Filer..."), menu_rox_help, HELP_ABOUT , GTK_STOCK_DIALOG_INFO); + adi(N_("About "APPNAME"..."), show_about_dialog, GTK_STOCK_DIALOG_INFO); ads(N_("Show Help Files" ), menu_rox_help, HELP_DIR , GTK_STOCK_HELP); adi(N_("Manual" ), menu_rox_help, HELP_MANUAL); menu_add_separator(); @@ -1426,3 +1428,29 @@ gtk_widget_show_all(icon_menu); } +static void show_about_dialog() +{ + GtkWidget *about_dialog; + gchar *artists[] = {_("Several additional icons created or edited\nby Paul Sherman "), NULL}; + gchar *authors[] = {_("A Rox-Filer adaptation \nwritten for use in Absolute Linux by Paul Sherman.\n\nA third-generation fork of Rox-Filer, \n Rox-Filer - \nhttp://rox.sourceforge.net/desktop/ROX-Filer\n\n literocks (dimkr) - \n http://github.com/dimkr/literocks/commits/master\n\n literocks (jun7) - \nhttp://github.com/jun7/literocks\n\nArox (part of Absolute Linux) - \n https://www.absolutelinux.org"), NULL}; + + about_dialog = gtk_about_dialog_new (); + gtk_window_set_icon_name (GTK_WINDOW (about_dialog), "arox"); + g_object_set (about_dialog, + "artists", artists, + "authors", authors, + "comments", "\n\nFile Manager / Thumbnail Viewer\n\n", + "copyright", "Copyright (c) 2019-2023\nPaul Sherman", + "logo-icon-name", APPNAME, + "program-name", APPNAME, + "version", VERSION, + NULL); + gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(about_dialog), "https://www.absolutelinux.org"); + gtk_about_dialog_set_website_label(GTK_ABOUT_DIALOG(about_dialog), "Absolute Linux Homepage"); + gtk_about_dialog_set_license(GTK_ABOUT_DIALOG(about_dialog), "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. \n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. \n\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA"); + gtk_about_dialog_set_wrap_license(GTK_ABOUT_DIALOG(about_dialog), TRUE); + + + gtk_dialog_run (GTK_DIALOG (about_dialog)); + gtk_widget_destroy (about_dialog); +} diff -Naur /src/icon.h/src/icon.h --- /src/icon.h 2023-01-29 22:11:51.000000000 -0500 +++/src/icon.h 2023-06-03 01:32:42.517802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _ICON_H diff -Naur /src/infobox.c/src/infobox.c --- /src/infobox.c 2023-01-29 22:11:51.000000000 -0500 +++/src/infobox.c 2023-06-06 22:56:35.881774124 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -44,7 +44,6 @@ #include "xml.h" #include "mount.h" #include "pixmaps.h" -#include "xtypes.h" #include "filer.h" typedef struct _FileStatus FileStatus; @@ -661,14 +660,6 @@ if (item->mime_type) add_row(store, "", mime_type_comment(item->mime_type)); - if (xattr_supported(NULL)) { - add_row(store, _("Extended attributes:"), - (item->flags & ITEM_FLAG_HAS_XATTR) - ? _("Present") - : xattr_supported(path) ? _("None") - : _("Not supported")); - } - if (item->flags & ITEM_FLAG_SYMLINK) { GtkTreeIter iter; diff -Naur /src/infobox.h/src/infobox.h --- /src/infobox.h 2023-01-29 22:11:51.000000000 -0500 +++/src/infobox.h 2023-06-03 01:32:42.517802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _INFOBOX_H diff -Naur /src/log.c/src/log.c --- /src/log.c 2023-01-29 22:11:51.000000000 -0500 +++/src/log.c 2023-06-03 01:25:21.678844273 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2007, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free diff -Naur /src/log.h/src/log.h --- /src/log.h 2023-01-29 22:11:51.000000000 -0500 +++/src/log.h 2023-06-03 01:32:42.517802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _LOG_H diff -Naur /src/main.c/src/main.c --- /src/main.c 2023-01-29 22:11:51.000000000 -0500 +++/src/main.c 2023-06-06 23:07:46.546711008 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -72,7 +72,6 @@ #include "panel.h" #include "session.h" #include "minibuffer.h" -#include "xtypes.h" #include "bulk_rename.h" #include "gtksavebox.h" @@ -92,19 +91,19 @@ const char *home_dir, *app_dir; #define COPYING \ - N_("Copyright (C) 2005 Thomas Leonard.\n" \ - "ROX-Filer comes with ABSOLUTELY NO WARRANTY,\n" \ + N_("Arox, based on ROX-Filer, which is \nCopyright (C) 2005 Thomas Leonard.\n" \ + "Arox by Paul Sherman.\nArox comes with ABSOLUTELY NO WARRANTY,\n" \ "to the extent permitted by law.\n" \ - "You may redistribute copies of ROX-Filer\n" \ + "You may redistribute copies of arox\n" \ "under the terms of the GNU General Public License.\n" \ "For more information about these matters, " \ "see the file named COPYING.\n") #ifdef HAVE_GETOPT_LONG -# define USAGE N_("Try `ROX-Filer/AppRun --help' for more information.\n") +# define USAGE N_("Try `arox/AppRun --help' for more information.\n") # define SHORT_ONLY_WARNING "" #else -# define USAGE N_("Try `ROX-Filer/AppRun -h' for more information.\n") +# define USAGE N_("Try `arox/AppRun -h' for more information.\n") # define SHORT_ONLY_WARNING \ _("NOTE: Your system does not support long options - \n" \ "you must use the short versions instead.\n\n") @@ -112,7 +111,7 @@ #define BUGS_TO "" -#define HELP N_("Usage: ROX-Filer/AppRun [OPTION]... [FILE]...\n" \ +#define HELP N_("Usage: arox/AppRun [OPTION]... [FILE]...\n" \ "Open each directory or file listed, or the current working\n" \ "directory if no arguments are given.\n\n" \ " -b, --border=PANEL open PANEL as a border panel\n" \ @@ -282,7 +281,7 @@ home_dir = g_get_home_dir(); home_dir_len = strlen(home_dir); - app_dir = g_strdup(getenv("APP_DIR")); + app_dir = "/usr/libexec/arox"; /* Get internationalisation up and running. This requires the * choices system, to discover the user's preferred language. @@ -290,7 +289,6 @@ choices_init(); options_init(); i18n_init(); - xattr_init(); if (!app_dir) { @@ -330,7 +328,7 @@ * compiled OK. Do this test before gtk_init so that * we don't need an X server to install. */ - g_print("ROX-Filer %s\n", VERSION); + g_print("arox %s\n", VERSION); g_print(_(COPYING)); show_features(); return EXIT_SUCCESS; @@ -406,7 +404,7 @@ "instead.")); break; case 'v': - g_print("ROX-Filer %s\n", VERSION); + g_print("arox %s\n", VERSION); g_print("%s", _(COPYING)); show_features(); return EXIT_SUCCESS; @@ -642,7 +640,7 @@ g_free(client_id); /* See if we need to migrate the Choices directories*/ - choices_migrate(); +// choices_migrate(); /* Finally, execute the request */ reply = run_soap(rpc); @@ -710,8 +708,6 @@ #endif ); - g_print("%s... %s\n", _("Extended attribute support"), - xattr_supported(NULL)? _("Yes"): _("No")); } static void soap_add(xmlNodePtr body, @@ -842,7 +838,7 @@ char *line = NULL; gsize term; char *filename = choices_find_xdg_path_load("panels", - "ROX-Filer", "rox.sourceforge.net"); + "arox"); if (filename) fp = g_io_channel_new_file(filename, "r", &err); @@ -968,9 +964,9 @@ /* Default to saving in current filer window */ if(window_with_focus) - filename=make_path(window_with_focus->sym_path, "rox"); + filename=make_path(window_with_focus->sym_path, "arox"); else - filename="rox"; + filename="arox"; image = type_to_icon(application_x_shellscript); /* Create a save box to save the script */ @@ -1004,7 +1000,7 @@ NULL); gtk_widget_set_tooltip_text(button, - _("Click to save a script to run ROX-Filer.\n" + _("Click to save a script to run arox.\n" "If you are using Zero Install you should use 0alias " "instead.")); diff -Naur /src/main.h/src/main.h --- /src/main.h 2023-01-29 22:11:51.000000000 -0500 +++/src/main.h 2023-06-03 01:32:42.517802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _MAIN_H diff -Naur /src/makedist/src/makedist --- /src/makedist 2023-01-29 22:11:51.000000000 -0500 +++/src/makedist 2023-05-16 22:44:37.033304786 -0400 @@ -4,9 +4,9 @@ system "cvs rel ."; -open(VER, "ROX-Filer/AppRun --version 2>&1 |") or die "open(): $!"; +open(VER, "arox/AppRun --version 2>&1 |") or die "open(): $!"; while () { - last if /^ROX-Filer/; + last if /^arox/; } close(VER); @@ -33,8 +33,8 @@ system "cvs -dtal197\@cvs.sourceforge.net:/cvsroot/rox export -r Release-$dash rox"; #system "cvs -d:pserver:anonymous\@cvs.sourceforge.net:/cvsroot/rox export -r Release-$a-$b-$c rox"; -system "cd rox/ROX-Filer/src; autoconf; cd Docs; make"; -system "cp -r ~/Projects/rox/ROX-Filer/Messages/*.gmo rox/ROX-Filer/Messages"; +system "cd rox/arox/src; autoconf; cd Docs; make"; +system "cp -r ~/Projects/rox/arox/Messages/*.gmo rox/arox/Messages"; system "mv rox/* ."; rmdir "rox"; diff -Naur /src/menu.c/src/menu.c --- /src/menu.c 2023-01-29 22:11:51.000000000 -0500 +++/src/menu.c 2023-06-07 23:18:18.752763131 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -53,7 +53,6 @@ #include "choices.h" #include "gtksavebox.h" #include "mount.h" -#include "minibuffer.h" #include "i18n.h" #include "pinboard.h" #include "dir.h" @@ -66,8 +65,6 @@ #include "bookmarks.h" #include "panel.h" #include "bulk_rename.h" -#include "xtypes.h" -#include "log.h" #include "dnd.h" typedef enum { @@ -75,6 +72,7 @@ FILE_RENAME_ITEM, FILE_LINK_ITEM, FILE_OPEN_FILE, + COPY_PATH, FILE_PROPERTIES, FILE_RUN_ACTION, FILE_SET_ICON, @@ -83,12 +81,9 @@ FILE_USAGE, FILE_CHMOD_ITEMS, FILE_FIND, - FILE_SET_TYPE, + FILE_COMPRESS_ITEM, FILE_COPY_TO_CLIPBOARD, FILE_CUT_TO_CLIPBOARD, -#if defined(HAVE_GETXATTR) || defined(HAVE_ATTROPEN) - FILE_XATTRS, -#endif } FileOp; typedef void (*ActionFn)(GList *paths, @@ -119,7 +114,9 @@ static void save_menus(void); static void menu_closed(GtkWidget *widget); -static void shade_file_menu_items(gboolean shaded); +static void shade_file_menu_itemsOne(); +static void shade_file_menu_itemsNone(); +static void shade_file_menu_itemsMulti(); static void savebox_show(const gchar *action, const gchar *path, MaskedPixmap *image, SaveCb callback, GdkDragAction dnd_action); @@ -150,58 +147,45 @@ static void set_sort(gpointer data, guint action, GtkWidget *widget); static void reverse_sort(gpointer data, guint action, GtkWidget *widget); -static void filter_directories(gpointer data, guint action, GtkWidget *widget); static void hidden(gpointer data, guint action, GtkWidget *widget); -static void only_dirs(gpointer data, guint action, GtkWidget *widget); static void show_thumbs(gpointer data, guint action, GtkWidget *widget); static void refresh(gpointer data, guint action, GtkWidget *widget); static void refresh_thumbs(gpointer data, guint action, GtkWidget *widget); -static void save_settings(gpointer data, guint action, GtkWidget *widget); -static void save_settings_parent(gpointer data, guint action, GtkWidget *widget); static void file_op(gpointer data, FileOp action, GtkWidget *widget); static void select_all(gpointer data, guint action, GtkWidget *widget); static void clear_selection(gpointer data, guint action, GtkWidget *widget); -static void invert_selection(gpointer data, guint action, GtkWidget *widget); static void new_directory(gpointer data, guint action, GtkWidget *widget); static void new_file(gpointer data, guint action, GtkWidget *widget); static void customise_new(gpointer data); static GList *add_sendto_shared(GtkWidget *menu, const gchar *type, const gchar *subtype, CallbackFn swapped_func); -static void customise_directory_menu(gpointer data); static void xterm_here(gpointer data, guint action, GtkWidget *widget); +static void find_from_here(gpointer data, guint action, GtkWidget *widget); static void open_parent_same(gpointer data, guint action, GtkWidget *widget); static void open_parent(gpointer data, guint action, GtkWidget *widget); -static void home_directory(gpointer data, guint action, GtkWidget *widget); -static void show_bookmarks(gpointer data, guint action, GtkWidget *widget); -static void show_log(gpointer data, guint action, GtkWidget *widget); -static void new_window(gpointer data, guint action, GtkWidget *widget); -/* static void new_user(gpointer data, guint action, GtkWidget *widget); */ static void close_window(gpointer data, guint action, GtkWidget *widget); static void follow_symlinks(gpointer data, guint action, GtkWidget *widget); /* (action used in this - MiniType) */ static void mini_buffer(gpointer data, guint action, GtkWidget *widget); -static void resize(gpointer data, guint action, GtkWidget *widget); /* clipboard */ static void clipboard_get(GtkClipboard *clipboard, GtkSelectionData *selection_data, guint info, gpointer user_data); static void clipboard_clear(GtkClipboard *clipboard, gpointer user_data); static void paste_from_clipboard(gpointer data, guint action, GtkWidget *widget); +static void show_about_dialog(); + #define MENUS_NAME "menus2" static GtkWidget *filer_menu = NULL; /* The popup filer menu */ static GtkWidget *filer_file_item; /* The File '' label */ static GtkWidget *filer_file_menu; /* The File '' menu */ static GtkWidget *file_shift_item; /* Shift Open label */ -static GtkWidget *filer_auto_size_menu; /* The Automatic item */ static GtkWidget *filer_hidden_menu; /* The Show Hidden item */ -static GtkWidget *filer_files_only_menu; -static GtkWidget *filer_dirs_only_menu; -static GtkWidget *filer_filter_dirs_menu;/* The Filter Dirs item */ /* The Sort items */ static GtkWidget *filer_sort_name_menu; @@ -216,13 +200,7 @@ static GtkWidget *filer_reverse_menu; /* The Reversed item */ static GtkWidget *filer_thumb_menu; /* The Show Thumbs item */ -static GtkWidget *filer_new_window; /* The New Window item */ static GtkWidget *filer_new_menu; /* The New submenu */ -static GtkWidget *filer_follow_sym; /* Follow symbolic links item */ -static GtkWidget *filer_set_type; /* Set type item */ -#if defined(HAVE_GETXATTR) || defined(HAVE_ATTROPEN) -static GtkWidget *filer_xattrs; /* Extended attributes item */ -#endif //working buffers static GtkWidget *current; @@ -313,7 +291,7 @@ void menu_init(void) { - char *menurc = choices_find_xdg_path_load(MENUS_NAME, PROJECT, SITE); + char *menurc = choices_find_xdg_path_load(MENUS_NAME, APPNAME); if (menurc) { gtk_accel_map_load(menurc); @@ -377,17 +355,46 @@ } /* Shade items that only work on single files */ -static void shade_file_menu_items(gboolean shaded) +static void shade_file_menu_itemsOne() { - menu_set_items_shaded(filer_file_menu, shaded, 2, 1); /* Duplicate... */ - menu_set_items_shaded(filer_file_menu, shaded, 4, 1); /* Link... */ - menu_set_items_shaded(filer_file_menu, shaded, 7, 1); /* Shift Open */ - menu_set_items_shaded(filer_file_menu, shaded, 10, 2); /* Set Run Action... + Set Icon... */ -#if defined(HAVE_GETXATTR) || defined(HAVE_ATTROPEN) - menu_set_items_shaded(filer_file_menu, shaded, 12, 1); /* Extended Attributes... */ -#endif + menu_set_items_shaded(filer_file_menu, FALSE, 1, 1); /* Copy Here... */ + menu_set_items_shaded(filer_file_menu, FALSE, 3, 1); /* Link... */ + menu_set_items_shaded(filer_file_menu, FALSE, 4, 1); /* Compress... */ + menu_set_items_shaded(filer_file_menu, FALSE, 8, 1); /* Send To... */ + menu_set_items_shaded(filer_file_menu, FALSE, 9, 1); /* Set Run Action... */ + menu_set_items_shaded(filer_file_menu, FALSE, 10, 1); /* Set Icon... */ + menu_set_items_shaded(filer_file_menu, FALSE, 12, 1); /* Copy Path... */ + menu_set_items_shaded(filer_file_menu, FALSE, 13, 1); /* Properties... */ + menu_set_items_shaded(filer_file_menu, FALSE, 15, 1); /* Permissions... */ } +/* Shade items that only work on single files */ +static void shade_file_menu_itemsNone() +{ + menu_set_items_shaded(filer_file_menu, FALSE, 1, 1); /* Copy Here... */ + menu_set_items_shaded(filer_file_menu, FALSE, 3, 1); /* Link... */ + menu_set_items_shaded(filer_file_menu, FALSE, 4, 1); /* Compress... */ + menu_set_items_shaded(filer_file_menu, TRUE, 8, 1); /* Send To... */ + menu_set_items_shaded(filer_file_menu, TRUE, 9, 1); /* Set Run Action... */ + menu_set_items_shaded(filer_file_menu, TRUE, 10, 1); /* Set Icon... */ + menu_set_items_shaded(filer_file_menu, FALSE, 12, 1); /* Copy Path... */ + menu_set_items_shaded(filer_file_menu, FALSE, 13, 1); /* Properties... */ + menu_set_items_shaded(filer_file_menu, FALSE, 15, 1); /* Permissions... */ + +} +/* Shade items that only work on single files */ +static void shade_file_menu_itemsMulti() +{ + menu_set_items_shaded(filer_file_menu, TRUE, 1, 1); /* Copy Here... */ + menu_set_items_shaded(filer_file_menu, TRUE, 3, 1); /* Link... */ + menu_set_items_shaded(filer_file_menu, TRUE, 4, 1); /* Compress... */ + menu_set_items_shaded(filer_file_menu, TRUE, 8, 1); /* Send To... */ + menu_set_items_shaded(filer_file_menu, TRUE, 9, 1); /* Set Run Action... */ + menu_set_items_shaded(filer_file_menu, TRUE, 10, 1); /* Set Icon... */ + menu_set_items_shaded(filer_file_menu, TRUE, 12, 1); /* Copy Path... */ + menu_set_items_shaded(filer_file_menu, TRUE, 13, 1); /* Properties... */ + menu_set_items_shaded(filer_file_menu, TRUE, 15, 1); /* Permissions... */ +} /* 'data' is an array of three ints: * [ pointer_x, pointer_y, item_under_pointer ] */ @@ -600,7 +607,7 @@ widgets = NULL; } - templ_dname = choices_find_xdg_path_load("Templates", "", SITE); + templ_dname = choices_find_xdg_path_load("Templates", ""); if (templ_dname) { widgets = menu_from_dir(filer_new_menu, templ_dname, @@ -652,8 +659,6 @@ sta(GDK_KEY_plus, 0); ads(N_("Smaller Icons"), change_size, -1, GTK_STOCK_ZOOM_OUT); sta(GDK_KEY_minus, 0); - adt(N_("Automatic"), change_size_auto, 0, &filer_auto_size_menu); - sta(GDK_KEY_equal, 0); add_separator(); @@ -674,58 +679,45 @@ adt(N_("Show Hidden"), hidden, 0, &filer_hidden_menu); sta(GDK_KEY_h, GDK_CONTROL_MASK); - adt(N_("Show Only Files" ), only_dirs, 0, &filer_files_only_menu); - adt(N_("Show Only Directories" ), only_dirs, 1, &filer_dirs_only_menu); - adi(N_("Filter Files..." ), mini_buffer, MINI_FILTER); - adi(N_("Temp Filter..." ), mini_buffer, MINI_TEMP_FILTER); - adt(N_("Filter Directories With Files"), filter_directories, 0, &filer_filter_dirs_menu); adt(N_("Show Thumbnails" ), show_thumbs , 0, &filer_thumb_menu); ads(N_("Refresh" ), refresh , 0, GTK_STOCK_REFRESH); ads(N_("Refresh Thumbs" ), refresh_thumbs, 0, GTK_STOCK_REFRESH); - adi(N_("Save Display Settings..." ), save_settings, 0); - adi(N_("Save Display Settings to parent ..."), save_settings_parent, 0); - filer_file_menu = start_menu("File", filer_menu); filer_file_item = GTK_BIN(current)->child; - ads(N_("Copy"), file_op, FILE_COPY_TO_CLIPBOARD, GTK_STOCK_COPY); + ads(N_("Copy"), file_op, FILE_COPY_TO_CLIPBOARD, ROX_STOCK_COPY); sta(GDK_KEY_c, GDK_CONTROL_MASK); - ads(N_("Cut" ), file_op, FILE_CUT_TO_CLIPBOARD, GTK_STOCK_CUT); - sta(GDK_KEY_x, GDK_CONTROL_MASK); - ads(N_("Duplicate..."), file_op, FILE_DUPLICATE_ITEM, GTK_STOCK_COPY); - sta(GDK_KEY_d, GDK_CONTROL_MASK); - adi(N_("Rename..."), file_op, FILE_RENAME_ITEM); - adi(N_("Link..." ), file_op, FILE_LINK_ITEM); - ads(N_("Delete" ), file_op, FILE_DELETE, GTK_STOCK_DELETE); + ads(N_("Copy Here"), file_op, FILE_DUPLICATE_ITEM, ROX_STOCK_COPYHERE); + sta(GDK_KEY_d, GDK_CONTROL_MASK); + ads(N_("Rename..."), file_op, FILE_RENAME_ITEM, ROX_STOCK_RENAME); + ads(N_("Link..." ), file_op, FILE_LINK_ITEM, ROX_STOCK_LINK); + ads(N_("Compress..."), file_op, FILE_COMPRESS_ITEM, ROX_STOCK_COMPRESS); + ads(N_("Delete" ), file_op, FILE_DELETE, ROX_STOCK_DELETE); sta(GDK_KEY_Delete, 0); add_separator(); file_shift_item = adi(N_("Shift Open"), file_op, FILE_OPEN_FILE); - adi(N_("Send To..."), file_op, FILE_SEND_TO); - - add_separator(); - + ads(N_("Send To..."), file_op, FILE_SEND_TO, ROX_STOCK_SENDTO ); ads(N_("Set Run Action..."), file_op, FILE_RUN_ACTION, GTK_STOCK_EXECUTE); sta(GDK_KEY_asterisk, 0); - adi(N_("Set Icon..." ), file_op, FILE_SET_ICON); -#if defined(HAVE_GETXATTR) || defined(HAVE_ATTROPEN) - filer_xattrs = - ads(N_("Extended attributes..."), file_op, FILE_XATTRS, ROX_STOCK_XATTR); -#endif - ads(N_("Properties" ), file_op, FILE_PROPERTIES, GTK_STOCK_PROPERTIES); - sta(GDK_KEY_p, GDK_CONTROL_MASK); - adi(N_("Count" ), file_op, FILE_USAGE); - filer_set_type = - adi(N_("Set Type..."), file_op, FILE_SET_TYPE); - adi(N_("Permissions"), file_op, FILE_CHMOD_ITEMS); + ads(N_("Set Icon..." ), file_op, FILE_SET_ICON, ROX_STOCK_ICON); + + add_separator(); + + ads("Copy Path" , file_op, COPY_PATH, GTK_STOCK_PASTE); + sta(GDK_KEY_F5, 0); + ads(N_("Properties" ), file_op, FILE_PROPERTIES, ROX_STOCK_PROPERTIES); + sta(GDK_KEY_p, GDK_CONTROL_MASK); + ads(N_("Count" ), file_op, FILE_USAGE, ROX_STOCK_COUNT); + ads(N_("Permissions"), file_op, FILE_CHMOD_ITEMS,ROX_STOCK_PERMISSIONS); add_separator(); - ads(N_("Find"), file_op, FILE_FIND, GTK_STOCK_FIND); + ads(N_("Find"), find_from_here, FILE_FIND, ROX_STOCK_FIND); sta(GDK_KEY_f, GDK_CONTROL_MASK); start_menu(N_("Select"), filer_menu); @@ -733,13 +725,6 @@ adi(N_("Select All" ), select_all, 0); sta(GDK_KEY_a, GDK_CONTROL_MASK); adi(N_("Clear Selection" ), clear_selection, 0); - adi(N_("Invert Selection" ), invert_selection, 0); - adi(N_("Select by Name..."), mini_buffer, MINI_SELECT_BY_NAME); - sta(GDK_KEY_period, 0); - adi(N_("Reg Select..." ), mini_buffer, MINI_REG_SELECT); - sta(GDK_KEY_asciicircum, 0); - adi(N_("Select If..." ), mini_buffer, MINI_SELECT_IF); - sta(GDK_KEY_question, GDK_SHIFT_MASK); start_menu(NULL, filer_menu); ads(N_("Options..."), menu_show_options, 0, GTK_STOCK_PREFERENCES); @@ -750,48 +735,29 @@ ads(N_("Directory" ), new_directory, 0, GTK_STOCK_DIRECTORY); ads(N_("Blank file" ), new_file , 0, GTK_STOCK_NEW); - adi(N_("Customise Menu..."), customise_new, 0); - start_menu(N_("Window"), filer_menu); ads(N_("Parent, New Window" ), open_parent , 0, GTK_STOCK_GO_UP); adi(N_("Parent, Same Window" ), open_parent_same, 0); - filer_new_window = - adi(N_("New Window" ), new_window , 0); - ads(N_("Home Directory" ), home_directory , 0, GTK_STOCK_HOME); - sta(GDK_KEY_Home, GDK_CONTROL_MASK); - ads(N_("Show Bookmarks" ), show_bookmarks , 0, ROX_STOCK_BOOKMARKS); - sta(GDK_KEY_b, GDK_CONTROL_MASK); - ads(N_("Show Log" ), show_log , 0, GTK_STOCK_INFO); - filer_follow_sym = - adi(N_("Follow Symbolic Links"), follow_symlinks , 0); - adi(N_("Resize Window" ), resize , 0); - sta(GDK_KEY_e, GDK_CONTROL_MASK); ads(N_("Close Window" ), close_window , 0, GTK_STOCK_CLOSE); sta(GDK_KEY_q, GDK_CONTROL_MASK); add_separator(); - adi(N_("Enter Path..." ), mini_buffer, MINI_PATH); - sta(GDK_KEY_slash, 0); - adi(N_("Shell Command..." ), mini_buffer, MINI_SHELL); - sta(GDK_KEY_exclam, GDK_SHIFT_MASK); - adi(N_("Terminal Here" ), xterm_here , FALSE); - sta(GDK_KEY_grave, 0); + adi(N_("Terminal Here" ), xterm_here, FALSE); + sta(GDK_KEY_F4, 0); adi(N_("Switch to Terminal"), xterm_here , TRUE); start_menu(N_("Help"), filer_menu); - adi(N_("About ROX-Filer..."), menu_rox_help, HELP_ABOUT); - ads(N_("Show Help Files" ), menu_rox_help, HELP_DIR, GTK_STOCK_HELP); - sta(GDK_KEY_F1, 0); + //adi(N_("Arox Properties..."), menu_rox_help, HELP_ABOUT); + adi(N_("About "APPNAME"..."), show_about_dialog, 0); + adi(N_("Show Help Files" ), menu_rox_help, 0); adi(N_("Manual"), menu_rox_help, HELP_MANUAL); start_menu(NULL, filer_menu); - adi(N_("Customise Dir Menu..."), customise_directory_menu, 0); - g_signal_connect(filer_menu, "selection-done", G_CALLBACK(menu_closed), NULL); @@ -933,15 +899,6 @@ gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(filer_hidden_menu), filer_window->show_hidden); - gtk_check_menu_item_set_active( - GTK_CHECK_MENU_ITEM(filer_files_only_menu), - filer_window->files_only); - gtk_check_menu_item_set_active( - GTK_CHECK_MENU_ITEM(filer_dirs_only_menu), - filer_window->dirs_only); - gtk_check_menu_item_set_active( - GTK_CHECK_MENU_ITEM(filer_filter_dirs_menu), - filer_window->filter_directories); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(filer_sort_name_menu ), filer_window->sort_type == SORT_NAME ); @@ -965,23 +922,20 @@ gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(filer_reverse_menu), filer_window->sort_order != GTK_SORT_ASCENDING); - gtk_check_menu_item_set_active( - GTK_CHECK_MENU_ITEM(filer_auto_size_menu), - filer_window->display_style_wanted == AUTO_SIZE_ICONS); buffer = g_string_new(NULL); switch (n_selected) { case 0: g_string_assign(buffer, _("Next Click")); - shade_file_menu_items(FALSE); + shade_file_menu_itemsNone(); break; case 1: item = filer_selected_item(filer_window); if (item->base_type == TYPE_UNKNOWN) dir_update_item(filer_window->directory, item->leafname); - shade_file_menu_items(FALSE); + shade_file_menu_itemsOne(); file_item = filer_selected_item(filer_window); g_string_printf(buffer, _("%s '%s'"), basetype_name(file_item), @@ -991,10 +945,10 @@ : _("(bad utf-8)")); if (!can_set_run_action(file_item)) menu_set_items_shaded(filer_file_menu, - TRUE, 10, 1); + TRUE, 9, 1); break; default: - shade_file_menu_items(TRUE); + shade_file_menu_itemsMulti(); g_string_printf(buffer, _("%d items"), n_selected); break; @@ -1016,17 +970,6 @@ update_new_files_menu(); update_directory_menu(); - gtk_widget_set_sensitive(filer_new_window, - !o_unique_filer_windows.int_value); - gtk_widget_set_sensitive(filer_follow_sym, - strcmp(filer_window->sym_path, filer_window->real_path) != 0); - gtk_widget_set_sensitive(filer_set_type, - xattr_supported(filer_window->real_path)); -#if defined(HAVE_GETXATTR) || defined(HAVE_ATTROPEN) - gtk_widget_set_sensitive(filer_xattrs, - xattr_supported(filer_window->real_path) && n_selected <= 1); -#endif - if (n_selected && o_menu_quick.int_value) popup_menu = (state & GDK_CONTROL_MASK) ? filer_menu @@ -1094,13 +1037,13 @@ shift_action = N_("Open unmounted"); } else if (item->flags & ITEM_FLAG_SYMLINK) - shift_action = N_("Show Target"); + shift_action = N_("Show Target"); else if (item->base_type == TYPE_DIRECTORY) - shift_action = N_("Look Inside"); + shift_action = N_("Look Inside"); else if (item->base_type == TYPE_FILE) - shift_action = N_("Open As Text"); + shift_action = N_("Open As Text"); } - gtk_label_set_text(GTK_LABEL(menu_item), + gtk_label_set_markup(GTK_LABEL(menu_item), shift_action ? _(shift_action) : _("Shift Open")); gtk_widget_set_sensitive(menu_item, shift_action != NULL || next); @@ -1210,37 +1153,6 @@ display_set_hidden(window_with_focus, !window_with_focus->show_hidden); } -static void only_dirs(gpointer data, guint action, GtkWidget *widget) -{ - if (updating_menu) - return; - - g_return_if_fail(window_with_focus != NULL); - FilerWindow *fw = window_with_focus; - - if (action) //dir - { - fw->dirs_only = !fw->dirs_only; - fw->files_only = FALSE; - } - else //faile - { - fw->dirs_only = FALSE; - fw->files_only = !fw->files_only; - } - display_update_hidden(fw); -} - -static void filter_directories(gpointer data, guint action, GtkWidget *widget) -{ - if (updating_menu) - return; - - g_return_if_fail(window_with_focus != NULL); - - display_set_filter_directories(window_with_focus, - !window_with_focus->filter_directories); -} static void show_thumbs(gpointer data, guint action, GtkWidget *widget) { @@ -1266,20 +1178,6 @@ filer_refresh_thumbs(window_with_focus); } -static void save_settings(gpointer data, guint action, GtkWidget *widget) -{ - g_return_if_fail(window_with_focus != NULL); - - filer_save_settings(window_with_focus, FALSE); -} - -static void save_settings_parent(gpointer data, guint action, GtkWidget *widget) -{ - g_return_if_fail(window_with_focus != NULL); - - filer_save_settings(window_with_focus, TRUE); -} - static void delete(FilerWindow *filer_window) { GList *paths; @@ -1304,30 +1202,6 @@ destroy_glist(&paths); } -static void set_type_items(FilerWindow *filer_window) -{ - GList *paths, *p; - int npass=0, nfail=0; - - paths = filer_selected_items(filer_window); - for(p=paths; p; p=g_list_next(p)) { - if(xattr_supported((const char *) p->data)) - npass++; - else - nfail++; - } - if(npass==0) - report_error(_("Extended attributes, used to store types, are not supported for this " - "file or files.\n" - "This may be due to lack of support from the filesystem or the C library, " - "or it may simply be that the filesystem needs to be mounted with " - "the right mount option ('user_xattr' on Linux).")); - else if(nfail>0) - report_error(_("Setting type not supported for some of these files")); - if(npass>0) - action_settype(paths, FALSE, NULL); - destroy_glist(&paths); -} static void find(FilerWindow *filer_window) { @@ -1608,21 +1482,6 @@ view_clear_selection(window_with_focus->view); } -static gboolean invert_cb(ViewIter *iter, gpointer data) -{ - return !view_get_selected((ViewIface *) data, iter); -} - -static void invert_selection(gpointer data, guint action, GtkWidget *widget) -{ - g_return_if_fail(window_with_focus != NULL); - - window_with_focus->temp_item_selected = FALSE; - - view_select_if(window_with_focus->view, invert_cb, - window_with_focus->view); -} - void menu_show_options(gpointer data, guint action, GtkWidget *widget) { GtkWidget *win; @@ -1772,7 +1631,7 @@ /* We can work out the template path from the initial name */ base = g_path_get_basename(initial); oleaf = base; - templ_dname = choices_find_xdg_path_load("Templates", "", SITE); + templ_dname = choices_find_xdg_path_load("Templates", ""); if (!templ_dname) { report_error( @@ -1831,23 +1690,6 @@ g_free(base); } -static void customise_directory_menu(gpointer data) -{ - char *path; - char *leaf = g_strconcat(".", inode_directory->media_type, NULL); - - path = choices_find_xdg_path_save(leaf, "SendTo", SITE, TRUE); - g_free(leaf); - - mkdir(path, 0755); - filer_opendir(path, NULL, NULL, FALSE); - g_free(path); - - info_message( - _("Symlink any programs you want into this directory. \n\n" - "Tip: Directories and `Set Icon' may make it more usefull.")); -} - void show_menu_new(FilerWindow *filer_window) { window_with_focus = filer_window; @@ -1865,17 +1707,17 @@ dirs = g_string_new(NULL); - path = choices_list_xdg_dirs("", SITE); + path = choices_list_xdg_dirs(""); for (i = 0; i < path->len; i++) { guchar *old = (guchar *) path->pdata[i]; g_string_append(dirs, old); - g_string_append(dirs, "/SendTo\n"); + g_string_append(dirs, "/arox/SendTo\n"); } choices_free_list(path); - save = choices_find_xdg_path_save("", "SendTo", SITE, TRUE); + save = choices_find_xdg_path_save("", "arox/SendTo", TRUE); if (save) mkdir(save, 0777); @@ -1913,7 +1755,7 @@ dirs = g_string_new(NULL); - path = choices_list_xdg_dirs("", SITE); + path = choices_list_xdg_dirs(""); for (i = 0; i < path->len; i++) { guchar *old = (guchar *) path->pdata[i]; @@ -1923,7 +1765,7 @@ } choices_free_list(path); - save = choices_find_xdg_path_save("", "Templates", SITE, TRUE); + save = choices_find_xdg_path_save("", "Templates", TRUE); if (save) mkdir(save, 0777); @@ -1956,13 +1798,13 @@ int i; if (subtype) - searchdir = g_strdup_printf("SendTo/.%s_%s", type, subtype); + searchdir = g_strdup_printf("arox/SendTo/.%s_%s", type, subtype); else if (type) - searchdir = g_strdup_printf("SendTo/.%s", type); + searchdir = g_strdup_printf("arox/SendTo/.%s", type); else - searchdir = g_strdup("SendTo"); + searchdir = g_strdup("arox/SendTo"); - paths = choices_list_xdg_dirs(searchdir, SITE); + paths = choices_list_xdg_dirs(searchdir); g_free(searchdir); for (i = 0; i < paths->len; i++) @@ -2103,12 +1945,6 @@ g_list_free(widgets); } - item = gtk_menu_item_new_with_label(_("Customise Dir menu...")); - g_signal_connect_swapped(item, "activate", - G_CALLBACK(customise_directory_menu), NULL); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); - - g_signal_connect(menu, "selection-done", G_CALLBACK(menu_closed), NULL); popup_menu = menu; @@ -2137,25 +1973,13 @@ gtk_widget_destroy(window_with_focus->window); } -static void home_directory(gpointer data, guint action, GtkWidget *widget) +static void find_from_here(gpointer data, guint action, GtkWidget *widget) { - g_return_if_fail(window_with_focus != NULL); - - filer_change_to(window_with_focus, home_dir, NULL); -} - -static void show_bookmarks(gpointer data, guint action, GtkWidget *widget) -{ - g_return_if_fail(window_with_focus != NULL); - - bookmarks_show_menu(window_with_focus, NULL); -} - -static void show_log(gpointer data, guint action, GtkWidget *widget) -{ - g_return_if_fail(window_with_focus != NULL); - - log_show_window(); + g_return_if_fail(window_with_focus != NULL); + char* disp_path = window_with_focus->sym_path; + char* cmd = g_strdup_printf( "/usr/local/bin/ff.py \'%s\'", disp_path ); + g_spawn_command_line_async( cmd, NULL ); + g_free( cmd ); } static void follow_symlinks(gpointer data, guint action, GtkWidget *widget) @@ -2184,27 +2008,6 @@ change_to_parent(window_with_focus); } -static void resize(gpointer data, guint action, GtkWidget *widget) -{ - g_return_if_fail(window_with_focus != NULL); - - view_autosize(window_with_focus->view, TRUE); -} - -static void new_window(gpointer data, guint action, GtkWidget *widget) -{ - g_return_if_fail(window_with_focus != NULL); - - if (o_unique_filer_windows.int_value) - { - report_error(_("You can't open a second view onto " - "this directory because the `Unique Windows' option " - "is turned on in the Options window.")); - } - else - filer_opendir(window_with_focus->sym_path, window_with_focus, NULL, FALSE); -} - static void close_window(gpointer data, guint action, GtkWidget *widget) { g_return_if_fail(window_with_focus != NULL); @@ -2214,19 +2017,6 @@ gtk_widget_destroy(window_with_focus->window); } -static void mini_buffer(gpointer data, guint action, GtkWidget *widget) -{ - MiniType type = (MiniType) action; - - g_return_if_fail(window_with_focus != NULL); - - /* Item needs to remain selected... */ - if (type == MINI_SHELL) - window_with_focus->temp_item_selected = FALSE; - - minibuffer_show(window_with_focus, type, 0); -} - void menu_rox_help(gpointer data, guint action, GtkWidget *widget) { if (action == HELP_ABOUT) @@ -2236,26 +2026,8 @@ else if (action == HELP_MANUAL) { gchar *manual = NULL; - - if (current_lang) - { - manual = g_strconcat(app_dir, "/Help/Manual-", - current_lang, ".html", NULL); - if (!file_exists(manual) && strchr(current_lang, '_')) - { - /* Try again without the territory */ - strcpy(strrchr(manual, '_'), ".html"); - } - if (!file_exists(manual)) - null_g_free(&manual); - } - - if (!manual) - manual = g_strconcat(app_dir, - "/Help/Manual.html", NULL); - + manual = g_strconcat("/usr/doc/arox/arox_manual.html", NULL); run_by_path(manual); - g_free(manual); } else @@ -2280,7 +2052,7 @@ static void save_menus(void) { - char *menurc = choices_find_xdg_path_save(MENUS_NAME, PROJECT, SITE, TRUE); + char *menurc = choices_find_xdg_path_save(MENUS_NAME, APPNAME, TRUE); if (menurc) { gtk_accel_map_save(menurc); @@ -2461,26 +2233,18 @@ case FILE_LINK_ITEM: prompt = _("Symlink ... ?"); break; + case FILE_COMPRESS_ITEM: + prompt = _("Compress ... ?"); + break; case FILE_OPEN_FILE: prompt = _("Shift Open ... ?"); break; + case COPY_PATH: + prompt = _("Copy what path ... ?"); + break; case FILE_PROPERTIES: prompt = _("Properties of ... ?"); break; -#if defined(HAVE_GETXATTR) || defined(HAVE_ATTROPEN) - case FILE_XATTRS: - prompt = _("Extended attributes of ... ?"); - break; -#endif - case FILE_SET_TYPE: - prompt = _("Set type of ... ?"); - break; - case FILE_RUN_ACTION: - prompt = _("Set run action for ... ?"); - break; - case FILE_SET_ICON: - prompt = _("Set icon for ... ?"); - break; case FILE_SEND_TO: prompt = _("Send ... to ... ?"); break; @@ -2490,6 +2254,12 @@ case FILE_USAGE: prompt = _("Count the size of ... ?"); break; + case FILE_RUN_ACTION: + prompt = _("Set run action for ... ?"); + break; + case FILE_SET_ICON: + prompt = _("Set icon for ... ?"); + break; case FILE_CHMOD_ITEMS: prompt = _("Set permissions on ... ?"); break; @@ -2523,16 +2293,25 @@ usage(window_with_focus); return; case FILE_CHMOD_ITEMS: + if (n_selected > 1) + { + report_error(_("You cannot do this to more than " + "one item at a time")); + return; + } chmod_items(window_with_focus); return; - case FILE_SET_TYPE: - set_type_items(window_with_focus); - return; case FILE_FIND: find(window_with_focus); return; case FILE_PROPERTIES: { + if (n_selected > 1) + { + report_error(_("You cannot do this to more than " + "one item at a time")); + return; + } GList *items; items = filer_selected_items(window_with_focus); @@ -2609,32 +2388,74 @@ _("Duplicate"), copy_cb, GDK_ACTION_COPY); break; + + case COPY_PATH: + if (n_selected > 1) + { + report_error(_("You cannot do this to more than " + "one item at a time")); + return; + } + gtk_clipboard_clear(gtk_clipboard_get(GDK_SELECTION_PRIMARY)); + gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_PRIMARY), path, strlen(path)); + gtk_clipboard_clear(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD)); + gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), path, strlen(path)); + gtk_clipboard_store(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD)); + break; + case FILE_RENAME_ITEM: src_dest_action_item(path, di_image(item), _("Rename"), rename_cb, GDK_ACTION_MOVE); break; + + case FILE_COMPRESS_ITEM: + ; + printf("%s \n", path); + const char* open_cmd = "/usr/local/bin/atool-compress"; + + if (n_selected > 1) + { + GList *items = NULL; + ViewIter iter; + + view_get_iter(window_with_focus->view, &iter, VIEW_ITER_SELECTED); + while ((item = iter.next(&iter))) + items = g_list_prepend(items, item->leafname); + items = g_list_reverse(items); + + char* cmd = g_strdup_printf( "%s \'%s\'", open_cmd, items ); + g_list_free(items); + break; + } + else + ; + char* cmd = g_strdup_printf( "%s \'%s\'", open_cmd, path ); + g_spawn_command_line_async( cmd, NULL ); + g_free( cmd ); + break; + case FILE_LINK_ITEM: src_dest_action_item(path, di_image(item), _("Symlink"), link_cb, GDK_ACTION_LINK); break; + case FILE_OPEN_FILE: filer_openitem(window_with_focus, &iter, OPEN_SAME_WINDOW | OPEN_SHIFT); break; + case FILE_RUN_ACTION: run_action(item); break; + case FILE_SET_ICON: - icon_set_handler_dialog(item, path); - break; -#if defined(HAVE_GETXATTR) || defined(HAVE_ATTROPEN) - case FILE_XATTRS: - if(access(path, R_OK) == 0) - xattrs_browser(item, path); - break; -#endif + if (n_selected < 1) + return; + icon_set_handler_dialog(item, path); + break; + default: g_warning("Unknown action!"); return; @@ -2683,3 +2504,30 @@ return g_list_append(NULL, align); } + +static void show_about_dialog() +{ + GtkWidget *about_dialog; + gchar *artists[] = {_("Several additional icons created or edited\nby Paul Sherman "), NULL}; + gchar *authors[] = {_("A Rox-Filer adaptation \nwritten for use in Absolute Linux by Paul Sherman.\n\nA third-generation fork of Rox-Filer, \n Rox-Filer - \nhttp://rox.sourceforge.net/desktop/ROX-Filer\n\n literocks (dimkr) - \n http://github.com/dimkr/literocks/commits/master\n\n literocks (jun7) - \nhttp://github.com/jun7/literocks\n\nArox (part of Absolute Linux) - \n https://www.absolutelinux.org"), NULL}; + + about_dialog = gtk_about_dialog_new (); + gtk_window_set_icon_name (GTK_WINDOW (about_dialog), "arox"); + g_object_set (about_dialog, + "artists", artists, + "authors", authors, + "comments", "\n\nFile Manager / Thumbnail Viewer\n\n", + "copyright", "Copyright (c) 2019-2023\nPaul Sherman", + "logo-icon-name", APPNAME, + "program-name", APPNAME, + "version", VERSION, + NULL); + gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(about_dialog), "https://www.absolutelinux.org"); + gtk_about_dialog_set_website_label(GTK_ABOUT_DIALOG(about_dialog), "Absolute Linux Homepage"); + gtk_about_dialog_set_license(GTK_ABOUT_DIALOG(about_dialog), "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. \n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. \n\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA"); + gtk_about_dialog_set_wrap_license(GTK_ABOUT_DIALOG(about_dialog), TRUE); + + + gtk_dialog_run (GTK_DIALOG (about_dialog)); + gtk_widget_destroy (about_dialog); +} diff -Naur /src/menu.h/src/menu.h --- /src/menu.h 2023-01-29 22:11:51.000000000 -0500 +++/src/menu.h 2023-06-03 01:32:42.517802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _MENU_H diff -Naur /src/minibuffer.c/src/minibuffer.c --- /src/minibuffer.c 2023-01-29 22:11:51.000000000 -0500 +++/src/minibuffer.c 2023-06-03 01:25:42.158842345 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free diff -Naur /src/minibuffer.h/src/minibuffer.h --- /src/minibuffer.h 2023-01-29 22:11:51.000000000 -0500 +++/src/minibuffer.h 2023-06-03 01:32:42.517802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _MINIBUFFER_H diff -Naur /src/modechange.c/src/modechange.c --- /src/modechange.c 2023-01-29 22:11:51.000000000 -0500 +++/src/modechange.c 2023-06-03 01:25:49.350841668 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free diff -Naur /src/modechange.h/src/modechange.h --- /src/modechange.h 2023-01-29 22:11:51.000000000 -0500 +++/src/modechange.h 2023-06-03 01:32:42.517802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard * * This rest of this file was taken from GNU FileUtils, with minor * modifications. diff -Naur /src/mount.c/src/mount.c --- /src/mount.c 2023-01-29 22:11:51.000000000 -0500 +++/src/mount.c 2023-06-03 01:25:56.142841029 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free diff -Naur /src/mount.h/src/mount.h --- /src/mount.h 2023-01-29 22:11:51.000000000 -0500 +++/src/mount.h 2023-06-03 01:32:42.517802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _MOUNT_H diff -Naur /src/my_vfs.h/src/my_vfs.h --- /src/my_vfs.h 2023-01-29 22:11:51.000000000 -0500 +++/src/my_vfs.h 2023-06-03 01:32:42.517802786 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _MY_VFS_H diff -Naur /src/options.c/src/options.c --- /src/options.c 2023-01-29 22:11:51.000000000 -0500 +++/src/options.c 2023-06-03 01:26:08.734839844 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -165,7 +165,7 @@ option_hash = g_hash_table_new(g_str_hash, g_str_equal); widget_builder = g_hash_table_new(g_str_hash, g_str_equal); - path = choices_find_xdg_path_load("Options", PROJECT, SITE); + path = choices_find_xdg_path_load("Options", APPNAME); if (path) { /* Load in all the options set in the filer, storing them @@ -569,7 +569,7 @@ gtk_widget_destroy(GTK_WIDGET(current_fontsel_box)); current_fontsel_box = GTK_FONT_SELECTION_DIALOG( - gtk_font_selection_dialog_new(PROJECT)); + gtk_font_selection_dialog_new(APPNAME)); gtk_window_set_position(GTK_WINDOW(current_fontsel_box), GTK_WIN_POS_MOUSE); @@ -990,7 +990,7 @@ gtk_widget_grab_default(button); gtk_widget_grab_focus(button); - save_path = choices_find_xdg_path_save("...", PROJECT, SITE, FALSE); + save_path = choices_find_xdg_path_save("...", APPNAME, FALSE); if (save_path) { string = g_strdup_printf(_("Choices will be saved as:\n%s"), @@ -1144,7 +1144,7 @@ GList *next; guchar *save, *save_new; - save = choices_find_xdg_path_save("Options", PROJECT, SITE, TRUE); + save = choices_find_xdg_path_save("Options", APPNAME, TRUE); if (!save) goto out; diff -Naur /src/options.h/src/options.h --- /src/options.h 2023-01-29 22:11:51.000000000 -0500 +++/src/options.h 2023-06-03 01:32:42.518802785 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _OPTIONS_H diff -Naur /src/panel.c/src/panel.c --- /src/panel.c 2023-01-29 22:11:51.000000000 -0500 +++/src/panel.c 2023-06-06 22:51:00.842805654 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -308,7 +308,7 @@ static void save_panels(void) { char *filename = choices_find_xdg_path_save("panels", - "ROX-Filer", "rox.sourceforge.net", TRUE); + "arox", TRUE); char *tmp = g_strconcat(filename, ".new", NULL); FILE *fp = fopen(tmp, "w"); @@ -378,7 +378,7 @@ guchar *leaf; leaf = g_strconcat("pan_", name, NULL); - load_path = choices_find_xdg_path_load(leaf, PROJECT, SITE); + load_path = choices_find_xdg_path_load(leaf, APPNAME); g_free(leaf); } @@ -459,7 +459,7 @@ panel_update_geometry(panel); gtk_window_set_resizable(GTK_WINDOW(panel->window), FALSE); - gtk_window_set_wmclass(GTK_WINDOW(panel->window), "ROX-Panel", PROJECT); + gtk_window_set_wmclass(GTK_WINDOW(panel->window), "ROX-Panel", APPNAME); gtk_widget_set_name(panel->window, "rox-panel"); gtk_widget_set_events(panel->window, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | @@ -1128,11 +1128,6 @@ : ROX_STOCK_MOUNT, &image_x, image_y+2, NULL); } - if ((icon->item->flags & ITEM_FLAG_HAS_XATTR) && o_xattr_show.int_value) - { - draw_emblem_on_icon(widget->window, widget->style, - ROX_STOCK_XATTR, &image_x, image_y + 2, icon->item->label); - } return FALSE; } @@ -1621,7 +1616,7 @@ guchar *leaf; leaf = g_strconcat("pan_", panel->name, NULL); - save = choices_find_xdg_path_save(leaf, PROJECT, SITE, TRUE); + save = choices_find_xdg_path_save(leaf, APPNAME, TRUE); g_free(leaf); } diff -Naur /src/panel.h/src/panel.h --- /src/panel.h 2023-01-29 22:11:51.000000000 -0500 +++/src/panel.h 2023-06-03 01:32:42.518802785 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _PANEL_H diff -Naur /src/pinboard.c/src/pinboard.c --- /src/pinboard.c 2023-01-29 22:11:51.000000000 -0500 +++/src/pinboard.c 2023-06-03 10:59:40.798342006 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -318,7 +318,7 @@ guchar *leaf; leaf = g_strconcat("pb_", name, NULL); - path = choices_find_xdg_path_load(leaf, PROJECT, SITE); + path = choices_find_xdg_path_load(leaf, APPNAME); g_free(leaf); } @@ -729,10 +729,10 @@ else delayed_error(_("You can only set the backdrop to an image " "or to a program which knows how to " - "manage ROX-Filer's backdrop.\n\n" + "manage Arox's backdrop.\n\n" "Programmers: the application's AppInfo.xml " "must contain the CanSetBackdrop element, as " - "described in ROX-Filer's manual.")); + "described in Arox's manual.")); } /* Open a dialog box allowing the user to set the backdrop */ @@ -805,6 +805,13 @@ gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK); gtk_widget_show_all(dialog); + + + const char* open_cmd = "arox /usr/share/wallpapers"; + char* cmd = g_strdup_printf( "%s", open_cmd ); + g_spawn_command_line_async( cmd, NULL ); + g_free( cmd ); + } /* Also used by tasklist.c */ @@ -1645,7 +1652,7 @@ guchar *leaf; leaf = g_strconcat("pb_", current_pinboard->name, NULL); - save = choices_find_xdg_path_save(leaf, PROJECT, SITE, TRUE); + save = choices_find_xdg_path_save(leaf, APPNAME, TRUE); g_free(leaf); } @@ -2278,7 +2285,7 @@ pinboard->fixed = gtk_fixed_new(); gtk_container_add(GTK_CONTAINER(win), pinboard->fixed); - gtk_window_set_wmclass(GTK_WINDOW(win), "ROX-Pinboard", PROJECT); + gtk_window_set_wmclass(GTK_WINDOW(win), "ROX-Pinboard", APPNAME); gtk_widget_set_size_request(win, screen_width, screen_height); gtk_widget_realize(win); diff -Naur /src/pinboard.h/src/pinboard.h --- /src/pinboard.h 2023-01-29 22:11:51.000000000 -0500 +++/src/pinboard.h 2023-06-03 01:32:42.518802785 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _PINBOARD_H diff -Naur /src/pixmaps.c/src/pixmaps.c --- /src/pixmaps.c 2023-01-29 22:11:51.000000000 -0500 +++/src/pixmaps.c 2023-06-07 20:58:27.102552864 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -112,12 +112,28 @@ static guint next_order = 0; static const char *stocks[] = { - ROX_STOCK_SHOW_DETAILS, - ROX_STOCK_SHOW_HIDDEN, + ROX_STOCK_BOOKMARKS, + ROX_STOCK_COMPRESS, + ROX_STOCK_COPY, + ROX_STOCK_COPYHERE, + ROX_STOCK_COUNT, + ROX_STOCK_DELETE, + ROX_STOCK_FIND, + ROX_STOCK_HOME, + ROX_STOCK_ICON, + ROX_STOCK_LINK, ROX_STOCK_MOUNT, ROX_STOCK_MOUNTED, + ROX_STOCK_PERMISSIONS, + ROX_STOCK_PROPERTIES, + ROX_STOCK_REFRESH, + ROX_STOCK_RENAME, + ROX_STOCK_RESIZE, + ROX_STOCK_SENDTO, + ROX_STOCK_SHOW_DETAILS, + ROX_STOCK_SHOW_HIDDEN, ROX_STOCK_SYMLINK, - ROX_STOCK_XATTR, + ROX_STOCK_TERMINAL }; /* Static prototypes */ @@ -182,7 +198,7 @@ option_add_int(&o_pixmap_thumb_file_size, "thumb_file_size", PIXMAP_THUMB_SIZE); // option_add_int(&o_purge_time, "purge_time", PIXMAP_PURGE_TIME); option_add_int(&o_purge_time, "purge_time", 0); - option_add_int(&o_jpeg_thumbs, "jpeg_thumbs", TRUE); + option_add_int(&o_jpeg_thumbs, "jpeg_thumbs", FALSE); option_add_int(&o_purge_days, "purge_days", 90); option_add_notify(options_changed); @@ -633,7 +649,7 @@ "tEXt::Thumb::Size", ssize, "tEXt::Thumb::MTime", smtime, "tEXt::Thumb::URI", uri, - "tEXt::Software", PROJECT, + "tEXt::Software", APPNAME, NULL); } umask(old_mask); @@ -707,15 +723,14 @@ return NULL; leaf = g_strconcat(type->media_type, "_", type->subtype, NULL); - path = choices_find_xdg_path_load(leaf, "MIME-thumb", SITE); + path = choices_find_xdg_path_load(leaf, "MIME-thumb"); g_free(leaf); if (path && g_file_test(path, G_FILE_TEST_IS_EXECUTABLE)) { return path; } - path = choices_find_xdg_path_load(type->media_type, "MIME-thumb", - SITE); + path = choices_find_xdg_path_load(type->media_type, "MIME-thumb"); if (path && g_file_test(path, G_FILE_TEST_IS_EXECUTABLE)) { return path; diff -Naur /src/pixmaps.h/src/pixmaps.h --- /src/pixmaps.h 2023-01-29 22:11:51.000000000 -0500 +++/src/pixmaps.h 2023-06-03 01:32:42.518802785 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _PIXMAP_H diff -Naur /src/remote.c/src/remote.c --- /src/remote.c 2023-01-29 22:11:51.000000000 -0500 +++/src/remote.c 2023-06-03 01:26:34.630837407 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free diff -Naur /src/remote.h/src/remote.h --- /src/remote.h 2023-01-29 22:11:51.000000000 -0500 +++/src/remote.h 2023-06-03 01:32:42.518802785 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _REMOTE_H diff -Naur /src/run.c/src/run.c --- /src/run.c 2023-01-29 22:11:51.000000000 -0500 +++/src/run.c 2023-06-03 01:26:40.486836856 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -428,7 +428,7 @@ *errmsg=g_strdup_printf(_("Non-local URL %s"), uri); } - } else if((cmd=choices_find_xdg_path_load(scheme, "URI", SITE))) { + } else if((cmd=choices_find_xdg_path_load(scheme, "URI"))) { DirItem *item; item=diritem_new(scheme); diff -Naur /src/run.h/src/run.h --- /src/run.h 2023-01-29 22:11:51.000000000 -0500 +++/src/run.h 2023-06-03 01:32:42.518802785 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _RUN_H diff -Naur /src/sc.c/src/sc.c --- /src/sc.c 2023-01-29 22:11:51.000000000 -0500 +++/src/sc.c 2023-06-03 01:26:48.022836147 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free diff -Naur /src/sc.h/src/sc.h --- /src/sc.h 2023-01-29 22:11:51.000000000 -0500 +++/src/sc.h 2023-06-03 01:32:42.518802785 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ /* sc.h - XSMP client support */ diff -Naur /src/session.c/src/session.c --- /src/session.c 2023-01-29 22:11:51.000000000 -0500 +++/src/session.c 2023-06-03 01:26:54.135835572 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free diff -Naur /src/session.h/src/session.h --- /src/session.h 2023-01-29 22:11:51.000000000 -0500 +++/src/session.h 2023-06-03 01:32:42.518802785 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ /* session.h - XSMP client support */ diff -Naur /src/support.c/src/support.c --- /src/support.c 2023-01-29 22:11:51.000000000 -0500 +++/src/support.c 2023-06-03 01:27:00.574834966 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free diff -Naur /src/support.h/src/support.h --- /src/support.h 2023-01-29 22:11:51.000000000 -0500 +++/src/support.h 2023-06-03 01:32:42.518802785 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _SUPPORT_H diff -Naur /src/tasklist.c/src/tasklist.c --- /src/tasklist.c 2023-01-29 22:11:51.000000000 -0500 +++/src/tasklist.c 2023-06-03 01:27:06.910834369 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free diff -Naur /src/tasklist.h/src/tasklist.h --- /src/tasklist.h 2023-01-29 22:11:51.000000000 -0500 +++/src/tasklist.h 2023-06-03 01:32:42.518802785 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _TASKLIST_H diff -Naur /src/toolbar.c/src/toolbar.c --- /src/toolbar.c 2023-01-29 22:11:51.000000000 -0500 +++/src/toolbar.c 2023-06-06 23:26:55.338602896 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -69,29 +69,20 @@ : button_i != 1) /* Static prototypes */ +static void toolbar_terminal_clicked(GtkWidget *widget, FilerWindow *filer_window); + static void toolbar_close_clicked(GtkWidget *widget, FilerWindow *filer_window); static void toolbar_up_clicked(GtkWidget *widget, FilerWindow *filer_window); static void toolbar_home_clicked(GtkWidget *widget, FilerWindow *filer_window); static void toolbar_bookmarks_clicked(GtkWidget *widget, FilerWindow *filer_window); -static void toolbar_help_clicked(GtkWidget *widget, FilerWindow *filer_window); -static void toolbar_settings_clicked(GtkWidget *widget, FilerWindow *filer_window); static void toolbar_refresh_clicked(GtkWidget *widget, FilerWindow *filer_window); static void toolbar_size_clicked(GtkWidget *widget, FilerWindow *filer_window); -static void toolbar_autosize_clicked(GtkWidget *widget, FilerWindow *filer_window); static void toolbar_details_clicked(GtkWidget *widget, FilerWindow *filer_window); static void toolbar_hidden_clicked(GtkWidget *widget, FilerWindow *filer_window); -static void toolbar_dirs_clicked(GtkWidget *widget, - FilerWindow *filer_window); -static void toolbar_select_clicked(GtkWidget *widget, - FilerWindow *filer_window); -static void toolbar_new_clicked(GtkWidget *widget, - FilerWindow *filer_window); -static void toolbar_sort_clicked(GtkWidget *widget, - FilerWindow *filer_window); static GtkWidget *add_button(GtkWidget *bar, Tool *tool, FilerWindow *filer_window); static void create_toolbar(GtkWidget *bar, FilerWindow *filer_window); @@ -113,9 +104,6 @@ static GList *build_tool_options(Option *option, xmlNode *node, guchar *label); static Tool all_tools[] = { - {N_("Close"), GTK_STOCK_CLOSE, N_("Close filer window"), - toolbar_close_clicked, DROP_NONE, FALSE, - FALSE}, {N_("Up"), GTK_STOCK_GO_UP, N_("Change to parent directory\n" " Right: Open parent directory\n" @@ -124,8 +112,7 @@ FALSE}, {N_("Home"), GTK_STOCK_HOME, N_("Change to home directory\n" - " Right: Open home directory\n" - " Middle: Change to first bookmark"), + " Right: Open home directory\n"), toolbar_home_clicked, DROP_TO_HOME, TRUE, FALSE}, @@ -135,73 +122,32 @@ toolbar_bookmarks_clicked, DROP_BOOKMARK, FALSE, TRUE}, - {N_("Scan"), GTK_STOCK_REFRESH, N_("Rescan directory contents\n" - " Middle: Delete/re-create thumbnail cache"), - toolbar_refresh_clicked, DROP_NONE, TRUE, - FALSE}, - - {N_("Size┼"), GTK_STOCK_ZOOM_IN, N_("Change icon size\n" - " Right: Change to smaller\n" - " Middle: Change to Auto Size\n" - " Scroll: Temporary huge zoom\n" - "Current size:\n" - " ┘ : Huge\n" - " ┤ : Large\n" - " ┐ : Small\n" - " ┌, ├ : Auto"), + {N_("Icon size"), ROX_STOCK_RESIZE, N_("Change icon size\n" + " Left: Larger\n" + " Right: smaller"), toolbar_size_clicked, DROP_NONE, TRUE, FALSE}, - {N_("Auto"), GTK_STOCK_ZOOM_FIT, N_("Automatic size mode"), - toolbar_autosize_clicked, DROP_NONE, TRUE, - FALSE}, - {N_("List"), ROX_STOCK_SHOW_DETAILS, N_("Show extra details\n" " Right: Rotate Icons with details\n" " Middle: Return to normal Icons View"), toolbar_details_clicked, DROP_NONE, TRUE, FALSE}, - {N_("Sort"), GTK_STOCK_SORT_ASCENDING, N_("Change sort criteria"), - toolbar_sort_clicked, DROP_NONE, FALSE, - FALSE}, - {N_("Hide"), ROX_STOCK_SHOW_HIDDEN, N_("Left: Show/hide hidden files\n" "Right: Show/hide thumbnails"), toolbar_hidden_clicked, DROP_NONE, TRUE, FALSE}, - - {N_("Dirs"), GTK_STOCK_DIRECTORY, N_("Left: Show only directories\n" - "Right: Show only files"), - toolbar_dirs_clicked, DROP_NONE, FALSE, - FALSE}, - - {N_("Select"), GTK_STOCK_SELECT_ALL, N_("Left: Select all\n" - "Right: Invert selection"), - toolbar_select_clicked, DROP_NONE, FALSE, - FALSE}, - - {N_("New"), GTK_STOCK_ADD, N_("Left: New Directory\n" - "Middle: New Blank file\n" - "Right: Menu"), - toolbar_new_clicked, DROP_NONE, FALSE, - FALSE}, - - {N_("○"), GTK_STOCK_SAVE, N_("Save Current Display Settings...\n" - " Right: for parent/* \n" - " Middle: Clear to default settings\n" - "Under:\n" - " ▽: No settings\n" - " ▼: Own settings\n" - " ▶: Parent settings\n" - " ▷: Far parent settings" - ), - toolbar_settings_clicked, DROP_NONE, TRUE, + + {N_("Terninal"), ROX_STOCK_TERMINAL, N_("Open Location in Terminal"), + toolbar_terminal_clicked, DROP_NONE, TRUE, FALSE}, + + {N_("Scan"), ROX_STOCK_REFRESH, N_("Refresh directory contents\n" + " Middle: Delete/re-create thumbnail cache"), + toolbar_refresh_clicked, DROP_NONE, TRUE, + FALSE}, - {N_("Help"), GTK_STOCK_HELP, N_("Show ROX-Filer help"), - toolbar_help_clicked, DROP_NONE, TRUE, - FALSE}, }; @@ -211,15 +157,9 @@ void toolbar_init(void) { - option_add_int(&o_toolbar, "toolbar_type", TOOLBAR_TEXT); + option_add_int(&o_toolbar, "toolbar_type", TOOLBAR_NORMAL); option_add_int(&o_toolbar_info, "toolbar_show_info", 1); option_add_string(&o_toolbar_disable, "toolbar_disable", - GTK_STOCK_CLOSE "," - GTK_STOCK_ZOOM_FIT "," - GTK_STOCK_SORT_ASCENDING "," - ROX_STOCK_SHOW_HIDDEN "," - GTK_STOCK_DIRECTORY "," - GTK_STOCK_SELECT_ALL "," GTK_STOCK_HELP); option_add_int(&o_toolbar_min_width, "toolbar_min_width", 1); option_add_notify(option_notify); @@ -381,29 +321,6 @@ return ret; } -static void toolbar_help_clicked(GtkWidget *widget, FilerWindow *filer_window) -{ - if (get_release() != 1) - menu_rox_help(NULL, HELP_MANUAL, NULL); - else - filer_opendir(make_path(app_dir, "Help"), NULL, NULL, FALSE); -} - -static void toolbar_settings_clicked(GtkWidget *widget, FilerWindow *fw) -{ - gint eb = get_release(); - - if (eb == 1) - filer_save_settings(fw, FALSE); - else if (eb == 2) - { - filer_clear_settings(fw); - display_update_hidden(fw); - } - else - filer_save_settings(fw, TRUE); -} - static void toolbar_refresh_clicked(GtkWidget *widget, FilerWindow *filer_window) { @@ -423,13 +340,7 @@ { gint eb = get_release(); - if (eb == 2) - { - gchar *staticret = bookmarks_get_top(); - if (staticret) - filer_change_to(filer_window, staticret, NULL); - } - else if (NEW_WIN_BUTTON(eb)) + if (NEW_WIN_BUTTON(eb)) { filer_opendir(home_dir, filer_window, NULL, FALSE); } @@ -501,12 +412,6 @@ } } -static void toolbar_autosize_clicked(GtkWidget *widget, FilerWindow *filer_window) -{ - display_set_layout(filer_window, AUTO_SIZE_ICONS, filer_window->details_type, - TRUE); -} - static void toolbar_size_clicked(GtkWidget *widget, FilerWindow *filer_window) { gint eb = get_release(); @@ -518,69 +423,6 @@ display_change_size(filer_window, eb == 1); } -static void toolbar_sort_clicked(GtkWidget *widget, - FilerWindow *filer_window) -{ - gint eb = get_release(); - int i, current, next; - gboolean adjust; - GtkSortType dir; - gchar *tip; - - static const SortType sorts[]={ - SORT_NAME, SORT_TYPE, SORT_DATEC, SORT_SIZE, - SORT_PERM, SORT_OWNER, SORT_GROUP, - }; - - static const int nsorts = G_N_ELEMENTS(sorts); - - static const char *sort_names[] = { - N_("Sort by name"), N_("Sort by type"), N_("Sort by date"), N_("Sort by size"), - N_("Sort by permissions"), N_("Sort by owner"), N_("Sort by group"), - }; - - adjust = (eb != 1) && eb != 0; - - current = -1; - dir = filer_window->sort_order; - for (i=0; i < nsorts; i++) - { - if (filer_window->sort_type == sorts[i]) - { - current = i; - break; - } - } - - if (current == -1 || eb == 2) { - next = 0; - dir = GTK_SORT_ASCENDING; - } - else if (adjust) { - next = current - 1; - if (next < 0) { - next = nsorts - 1; - dir = (dir == GTK_SORT_ASCENDING) - ? GTK_SORT_DESCENDING : GTK_SORT_ASCENDING; - } - } - else { - next = current + 1; - if (next >= nsorts) { - next = 0; - dir = (dir == GTK_SORT_ASCENDING) - ? GTK_SORT_DESCENDING : GTK_SORT_ASCENDING; - } - } - - display_set_sort_type(filer_window, sorts[next], dir); - tip = g_strconcat(_(sort_names[next]), ", ", - dir == GTK_SORT_ASCENDING - ? _("ascending") : _("descending"), - NULL); - tooltip_show(tip); - g_free(tip); -} static void toolbar_details_clicked(GtkWidget *widget, FilerWindow *filer_window) @@ -655,46 +497,11 @@ } } -static void toolbar_dirs_clicked(GtkWidget *widget, - FilerWindow *filer_window) -{ - switch (get_release()) - { - case 1: - filer_window->dirs_only = !filer_window->dirs_only; - filer_window->files_only = FALSE; - break; - case 2: - filer_window->dirs_only = FALSE; - filer_window->files_only = FALSE; - break; - default: - filer_window->dirs_only = FALSE; - filer_window->files_only = !filer_window->files_only; - } - display_update_hidden(filer_window); -} - static gboolean invert_cb(ViewIter *iter, gpointer data) { return !view_get_selected((ViewIface *) data, iter); } -static void toolbar_select_clicked(GtkWidget *widget, FilerWindow *filer_window) -{ - gint eb = get_release(); - - if (eb != 0) - { - if (eb == 1) - view_select_all(filer_window->view); - else - view_select_if(filer_window->view, invert_cb, - filer_window->view); - } - filer_window->temp_item_selected = FALSE; -} - static int pressx; static int pressy; static int pressbtn; @@ -842,23 +649,6 @@ return TRUE; } -static void toolbar_new_clicked(GtkWidget *widget, FilerWindow *filer_window) -{ - GdkEvent *event; - - event = get_current_event(GDK_BUTTON_RELEASE); - if (event->type == GDK_BUTTON_RELEASE) - { - if (((GdkEventButton *) event)->button == 1) - show_new_directory(filer_window); - else if (((GdkEventButton *) event)->button == 2) - show_new_file(filer_window); - else - show_menu_new(filer_window); - } - gdk_event_free(event); -} - /* If filer_window is NULL, the toolbar is for the options window */ static void create_toolbar(GtkWidget *bar, FilerWindow *filer_window) { @@ -1102,8 +892,6 @@ g_signal_connect(button, "scroll_event", G_CALLBACK(toolbar_button_scroll), NULL); - if (tool->clicked == toolbar_settings_clicked) - filer_window->toolbar_settings_text = GTK_LABEL(label); } else { @@ -1288,3 +1076,20 @@ return g_list_append(NULL, option->widget); } + +static void toolbar_terminal_clicked(GtkWidget *widget, FilerWindow *filer_window) +{ + GdkEvent *event; + + event = get_current_event(GDK_BUTTON_RELEASE); + if (event->type == GDK_BUTTON_RELEASE && ((GdkEventButton *) event)->button == 1) + { + const char* open_cmd = "xterm -e"; + char* cmd1 = g_strdup_printf( "cd \'%s\' && /bin/bash", filer_window->sym_path ); + char* cmd = g_strdup_printf( "%s \'%s\'", open_cmd, cmd1 ); + g_spawn_command_line_async( cmd, NULL ); + g_free( cmd1 ); + g_free( cmd ); + } + gdk_event_free(event); +} diff -Naur /src/toolbar.h/src/toolbar.h --- /src/toolbar.h 2023-01-29 22:11:51.000000000 -0500 +++/src/toolbar.h 2023-06-03 01:32:42.518802785 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _TOOLBAR_H diff -Naur /src/type.c/src/type.c --- /src/type.c 2023-01-29 22:11:51.000000000 -0500 +++/src/type.c 2023-06-07 14:12:30.393845058 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -58,7 +58,6 @@ #include "xml.h" #include "dropbox.h" #include "xdgmime.h" -#include "xtypes.h" #include "run.h" #include "view_iface.h" @@ -67,17 +66,17 @@ /* Colours for file types (same order as base types) */ static gchar *opt_type_colours[][2] = { - {"display_err_colour", "#ff0000"}, - {"display_unkn_colour", "#ffe700"}, - {"display_dir_colour", "#61fffe"}, + {"display_err_colour", "#FFB226"}, + {"display_unkn_colour", "#3333aa"}, + {"display_dir_colour", "#000000"}, {"display_pipe_colour", "#dccbff"}, - {"display_sock_colour", "#ff90ff"}, - {"display_file_colour", "#ffffff"}, - {"display_cdev_colour", "#ffc488"}, - {"display_bdev_colour", "#ffe9cf"}, + {"display_sock_colour", "#7080A7"}, + {"display_file_colour", "#333333"}, + {"display_cdev_colour", "#AB7650"}, + {"display_bdev_colour", "#AB5087"}, {"display_door_colour", "#ff00ff"}, - {"display_exec_colour", "#75ff66"}, - {"display_adir_colour", "#00e100"} + {"display_exec_colour", "#cc0000"}, + {"display_adir_colour", "#009900"} }; #define NUM_TYPE_COLOURS\ (sizeof(opt_type_colours) / sizeof(opt_type_colours[0])) @@ -316,11 +315,6 @@ MIME_type *mime_type = NULL; const char *type_name; - /* Check for extended attribute first */ - mime_type = xtype_get(path); - if (mime_type) - return mime_type; - /* Try name and contents next */ g_mutex_lock(&m_xdg); type_name = xdg_mime_get_mime_type_for_file(path, NULL); @@ -342,16 +336,16 @@ char *target; if (type == NULL) - open = choices_find_xdg_path_load("all", "MIME-types", SITE); + open = choices_find_xdg_path_load("all", "arox/MIME-types"); else { type_name = g_strconcat(type->media_type, "_", type->subtype, NULL); - open = choices_find_xdg_path_load(type_name, "MIME-types", SITE); + open = choices_find_xdg_path_load(type_name, "arox/MIME-types"); g_free(type_name); if (!open) open = choices_find_xdg_path_load(type->media_type, - "MIME-types", SITE); + "arox/MIME-types"); } if (!open) @@ -506,7 +500,7 @@ again: type_name = g_strconcat(type->media_type, "_", type->subtype, ".png", NULL); - path = choices_find_xdg_path_load(type_name, "MIME-icons", SITE); + path = choices_find_xdg_path_load(type_name, "MIME-icons"); g_free(type_name); if (path) { @@ -672,15 +666,14 @@ { case SET_MEDIA: return choices_find_xdg_path_load(type->media_type, - "MIME-types", SITE); + "arox/MIME-types"); case SET_TYPE: { gchar *tmp, *handler; tmp = g_strconcat(type->media_type, "_", type->subtype, NULL); handler = choices_find_xdg_path_load(tmp, - "MIME-types", - SITE); + "arox/MIME-types"); g_free(tmp); return handler; } @@ -1071,7 +1064,7 @@ type_name = g_strconcat(type->media_type, "_", type->subtype, NULL); - path = choices_find_xdg_path_save("", PROJECT, SITE, FALSE); + path = choices_find_xdg_path_save("", APPNAME, FALSE); if (!path) { report_error( @@ -1080,9 +1073,9 @@ } g_free(path); - path = choices_find_xdg_path_save(type_name, "MIME-types", SITE, TRUE); + path = choices_find_xdg_path_save(type_name, "arox/MIME-types", TRUE); - if (!remove_handler_with_confirm(path)) + if (!remove_handler_with_confirm(path)) null_g_free(&path); out: g_free(type_name); diff -Naur /src/type.h/src/type.h --- /src/type.h 2023-01-29 22:11:51.000000000 -0500 +++/src/type.h 2023-06-03 01:32:42.518802785 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef _TYPE_H diff -Naur /src/usericons.c/src/usericons.c --- /src/usericons.c 2023-01-29 22:11:51.000000000 -0500 +++/src/usericons.c 2023-06-07 14:35:31.105715121 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -86,7 +86,7 @@ if (!glob_icons) glob_icons = g_hash_table_new(g_str_hash, g_str_equal); - path = choices_find_xdg_path_load("globicons", PROJECT, SITE); + path = choices_find_xdg_path_load("arox/globicons", NULL); if (!path) return; /* Nothing to load */ @@ -376,8 +376,7 @@ char *path, *type; type = g_strconcat(mime_type->media_type, ".png", NULL); - path = choices_find_xdg_path_load(type, "MIME-icons", - SITE); + path = choices_find_xdg_path_load(type, "MIME-icons"); g_free(type); drop_box_set_path(drop_box, path); g_free(path); @@ -389,8 +388,7 @@ type = g_strconcat(mime_type->media_type, "_", mime_type->subtype, ".png", NULL); - path = choices_find_xdg_path_load(type, "MIME-icons", - SITE); + path = choices_find_xdg_path_load(type, "MIME-icons"); g_free(type); drop_box_set_path(drop_box, path); g_free(path); @@ -443,7 +441,7 @@ gchar *save = NULL, *save_new = NULL; xmlDocPtr doc = NULL; - save = choices_find_xdg_path_save("globicons", PROJECT, SITE, TRUE); + save = choices_find_xdg_path_save("globicons", APPNAME, TRUE); if (!save) return; /* Saving is disabled */ @@ -607,7 +605,7 @@ leaf = g_strconcat(type->media_type, "_", type->subtype, ".png", NULL); - target = choices_find_xdg_path_save(leaf, "MIME-icons", SITE, TRUE); + target = choices_find_xdg_path_save(leaf, "MIME-icons", TRUE); g_free(leaf); if (!target) @@ -650,7 +648,7 @@ gdk_pixbuf_save(pic->src_pixbuf, dest, "png", &error, - "tEXt::Software", PROJECT, + "tEXt::Software", APPNAME, NULL); g_object_unref(pic); diff -Naur /src/usericons.h/src/usericons.h --- /src/usericons.h 2023-01-29 22:11:51.000000000 -0500 +++/src/usericons.h 2023-06-03 01:32:42.518802785 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard * * Diego Zamboni, Feb 7, 2001 */ diff -Naur /src/view_collection.c/src/view_collection.c --- /src/view_collection.c 2023-01-29 22:11:51.000000000 -0500 +++/src/view_collection.c 2023-06-03 01:27:36.334831600 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free diff -Naur /src/view_collection.h/src/view_collection.h --- /src/view_collection.h 2023-01-29 22:11:51.000000000 -0500 +++/src/view_collection.h 2023-06-03 01:32:42.518802785 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef __VIEW_COLLECTION_H__ diff -Naur /src/view_details.c/src/view_details.c --- /src/view_details.c 2023-01-29 22:11:51.000000000 -0500 +++/src/view_details.c 2023-06-03 01:27:42.518831018 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -1100,7 +1100,7 @@ break; } - char *path = choices_find_xdg_path_save("column_order", PROJECT, SITE, FALSE); + char *path = choices_find_xdg_path_save("column_order", APPNAME, FALSE); if (path) { g_file_set_contents(path, colorder, COL_ITEM, NULL); @@ -1137,7 +1137,7 @@ if (!colorder_loaded) { colorder_loaded = TRUE; - char *path = choices_find_xdg_path_load("column_order", PROJECT, SITE); + char *path = choices_find_xdg_path_load("column_order", APPNAME); if (path) { gchar *buffer = NULL; diff -Naur /src/view_details.h/src/view_details.h --- /src/view_details.h 2023-01-29 22:11:51.000000000 -0500 +++/src/view_details.h 2023-06-03 01:32:42.519802785 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef __VIEW_DETAILS_H__ diff -Naur /src/view_iface.c/src/view_iface.c --- /src/view_iface.c 2023-01-29 22:11:51.000000000 -0500 +++/src/view_iface.c 2023-06-03 01:27:49.110830398 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free diff -Naur /src/view_iface.h/src/view_iface.h --- /src/view_iface.h 2023-01-29 22:11:51.000000000 -0500 +++/src/view_iface.h 2023-06-03 01:32:42.519802785 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef __VIEW_IFACE_H__ diff -Naur /src/wrapped.c/src/wrapped.c --- /src/wrapped.c 2023-01-29 22:11:51.000000000 -0500 +++/src/wrapped.c 2023-06-03 01:27:59.126829455 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free diff -Naur /src/wrapped.h/src/wrapped.h --- /src/wrapped.h 2023-01-29 22:11:51.000000000 -0500 +++/src/wrapped.h 2023-06-03 01:32:42.519802785 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef __WRAPPED_H__ diff -Naur /src/xml.c/src/xml.c --- /src/xml.c 2023-01-29 22:11:51.000000000 -0500 +++/src/xml.c 2023-06-03 01:29:01.454823590 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). + * Arox - filer/thumbnail viewer for Absolute Linux + * (c) 2019-2023 by Paul Sherman - Based on ROX-Filer by Thomas Leonard (c) 2006 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free diff -Naur /src/xml.h/src/xml.h --- /src/xml.h 2023-01-29 22:11:51.000000000 -0500 +++/src/xml.h 2023-06-03 01:32:42.519802785 -0400 @@ -1,6 +1,6 @@ /* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . + * Arox - filer/thumbnail viewer for Absolute Linux + * based upon ROX-Filer by Thomas Leonard */ #ifndef __XML_H__ diff -Naur /src/xtypes.c/src/xtypes.c --- /src/xtypes.c 2023-01-29 22:11:51.000000000 -0500 +++/src/xtypes.c 1969-12-31 19:00:00.000000000 -0500 @@ -1,874 +0,0 @@ -/* - * ROX-Filer, filer for the ROX desktop project - * Copyright (C) 2006, Thomas Leonard and others (see changelog for details). - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -/* - * xtypes.c - Extended filesystem attribute support for MIME types - */ - -#include "config.h" -#include -#include -#include - -#include -#include -#include -#include - -#include - -#include "global.h" -#include "type.h" -#include "xtypes.h" -#include "options.h" - -#include "diritem.h" -#include "pixmaps.h" -#include "support.h" -#include "gui_support.h" -#include "run.h" - -Option o_xattr_ignore; - -#define RETURN_IF_IGNORED(val) if(o_xattr_ignore.int_value) return (val) - -#if defined(HAVE_GETXATTR) -/* Linux implementation */ - -#include - -static int (*dyn_setxattr)(const char *path, const char *name, - const void *value, size_t size, int flags) = NULL; -static ssize_t (*dyn_getxattr)(const char *path, const char *name, - void *value, size_t size) = NULL; -static ssize_t (*dyn_listxattr)(const char *path, char *list, - size_t size) = NULL; -static int (*dyn_removexattr)(const char *path, - const char *name) = NULL; - -void xattr_init(void) -{ - void *libc; - - libc = dlopen("libc.so.6", RTLD_LAZY | RTLD_NOLOAD); - if (!libc) - { - /* Try a different name for uClib support */ - libc = dlopen("libc.so", RTLD_LAZY | RTLD_NOLOAD); - } - - if (!libc) - return; /* Give up on xattr support */ - - dyn_setxattr = (void *) dlsym(libc, "setxattr"); - dyn_getxattr = (void *) dlsym(libc, "getxattr"); - dyn_listxattr = (void *) dlsym(libc, "listxattr"); - dyn_removexattr = (void *) dlsym(libc, "removexattr"); - - option_add_int(&o_xattr_ignore, "xattr_ignore", FALSE); -} - -int xattr_supported(const char *path) -{ - char buf[1]; - ssize_t nent; - - RETURN_IF_IGNORED(FALSE); - - if (!dyn_getxattr) - return FALSE; - - if(path) { - errno=0; - nent=dyn_getxattr(path, XATTR_MIME_TYPE, buf, sizeof(buf)); - - if(nent<0 && errno==ENOTSUP) - return FALSE; - } - - return TRUE; -} - -int xattr_have(const char *path) -{ - static char buf[128]; - ssize_t nent; - - RETURN_IF_IGNORED(FALSE); - - if (!dyn_listxattr) - return FALSE; - - errno=0; - nent=dyn_listxattr(path, buf, sizeof(buf)); - - if(nent<0 && errno==ERANGE) - return TRUE; - - return (nent>0); -} - -gchar *xattr_get(const char *path, const char *attr, int *len) -{ - ssize_t size; - gchar *buf; - - RETURN_IF_IGNORED(NULL); - - if (!dyn_getxattr) - return NULL; - - size = dyn_getxattr(path, attr, "", 0); - if (size > 0) - { - int new_size; - - buf = g_new(gchar, size + 1); - new_size = dyn_getxattr(path, attr, buf, size); - - if(size == new_size) - { - buf[size] = '\0'; - - if(len) - *len=(int) size; - - return buf; - } - - g_free(buf); - } - - return NULL; - -} - -/* 0 on success */ -int xattr_set(const char *path, const char *attr, - const char *value, int value_len) -{ - if(o_xattr_ignore.int_value) - { - errno = ENOSYS; - return 1; - } - - if (!dyn_setxattr) - { - errno = ENOSYS; - return 1; /* Set attr failed */ - } - - if(value && value_len<0) - value_len = strlen(value); - - return dyn_setxattr(path, attr, value, value_len, 0); -} - -/* 0 on success */ -int xattr_rem(const char *path, const char *attr) -{ - if(o_xattr_ignore.int_value) - { - errno = ENOSYS; - return 1; - } - - if(!dyn_setxattr) - { - errno = ENOSYS; - return 1; - } - - return dyn_removexattr(path, attr); -} - -#elif defined(HAVE_ATTROPEN) - -/* Solaris 9 implementation */ - -void xattr_init(void) -{ - option_add_int(&o_xattr_ignore, "xattr_ignore", FALSE); -} - -int xattr_supported(const char *path) -{ - RETURN_IF_IGNORED(FALSE); -#ifdef _PC_XATTR_ENABLED - if(!path) - return TRUE; - - return pathconf(path, _PC_XATTR_ENABLED); -#else - return FALSE; -#endif -} - -int xattr_have(const char *path) -{ - RETURN_IF_IGNORED(FALSE); -#ifdef _PC_XATTR_EXISTS - return pathconf(path, _PC_XATTR_EXISTS)>0; -#else - return FALSE; -#endif -} - -#define MAX_ATTR_SIZE BUFSIZ -gchar *xattr_get(const char *path, const char *attr, int *len) -{ - int fd; - char *buf=NULL; - int nb; - - RETURN_IF_IGNORED(NULL); - -#ifdef _PC_XATTR_EXISTS - if(!pathconf(path, _PC_XATTR_EXISTS)) - return NULL; -#endif - - fd=attropen(path, attr, O_RDONLY); - - if(fd>=0) { - buf = g_new(gchar, MAX_ATTR_SIZE); - nb=read(fd, buf, MAX_ATTR_SIZE); - if(nb>0) { - buf[nb]=0; - } - close(fd); - - if(len) - *len=nb; - } - - return buf; -} - -int xattr_set(const char *path, const char *attr, - const char *value, int value_len) -{ - int fd; - int nb; - - if(o_xattr_ignore.int_value) - { - errno = ENOSYS; - return 1; - } - - if(value && value_len<0) - value_len = strlen(value); - - fd=attropen(path, attr, O_WRONLY|O_CREAT, 0644); - if(fd>0) { - - nb=write(fd, value, value_len); - if(nb==value_len) - ftruncate(fd, (off_t) nb); - - close(fd); - - if(nb>0) - return 0; - } - - return 1; /* Set type failed */ -} - -int xattr_rem(const char *path, const char *attr) -{ - int fd; - int er; - - if(o_xattr_ignore.int_value) - { - errno = ENOSYS; - return 1; - } - - fd=attropen(path, ".", O_WRONLY); - if(fd>0) { - - er=unlinkat(fd, attr, 0); - close(fd); - - if(er<0) - return 0; - } - - return 1; -} - -#else -/* No extended attributes available */ - -void xattr_init(void) -{ -} - -int xattr_supported(const char *path) -{ - return FALSE; -} - -int xattr_have(const char *path) -{ - return FALSE; -} - -gchar *xattr_get(const char *path, const char *attr, int *len) -{ - /* Fall back to non-extended */ - return NULL; -} - -int xattr_set(const char *path, const char *attr, - const char *value, int value_len) -{ - errno = ENOSYS; - return 1; /* Set type failed */ -} - -int xattr_rem(const char *path, const char *attr) -{ - errno = ENOSYS; - return 1; -} -#endif - -MIME_type *xtype_get(const char *path) -{ - MIME_type *type = NULL; - gchar *buf; - char *nl; - - buf = xattr_get(path, XATTR_MIME_TYPE, NULL); - - if(buf) - { - nl = strchr(buf, '\n'); - if(nl) - *nl = 0; - type = mime_type_lookup(buf); - g_free(buf); - } - return type; -} - -int xtype_set(const char *path, const MIME_type *type) -{ - int res; - gchar *ttext; - - if(o_xattr_ignore.int_value) - { - errno = ENOSYS; - return 1; - } - - ttext = g_strdup_printf("%s/%s", type->media_type, type->subtype); - res = xattr_set(path, XATTR_MIME_TYPE, ttext, -1); - g_free(ttext); - - return res; -} - -/* Label support */ -GdkColor *xlabel_get(const char *path) -{ - GdkColor *col = NULL; - gchar *buf; - char *nl; - - buf = xattr_get(path, XATTR_LABEL, NULL); - - if(buf) - { - nl = strchr(buf, '\n'); - if(nl) - *nl = 0; - col = g_new(GdkColor, 1); - if(gdk_color_parse(buf, col) == FALSE) { - g_free(col); - col = NULL; - } - g_free(buf); - } - return col; -} - -/* Extended attributes browser */ -#if defined(HAVE_GETXATTR) /* Linux-only for now */ - -enum -{ - COLUMN_NAME, - COLUMN_VALUE, - COLUMN_EDNAM, - COLUMN_EDVAL, - COLUMN_RMABL -}; - -enum -{ - MODE_CREATE, - MODE_REPLACE, - MODE_REMOVE -}; - -typedef struct -{ - gchar *name; - gchar *value; - int mode; - int user; -} -XAttr; - -GArray* xattr_list(const char *path) -{ - ssize_t len; - gchar *list; - gchar *l; - GArray *xarr; - XAttr at; - - xarr = g_array_sized_new(FALSE,FALSE,sizeof(XAttr),0); - - len = dyn_listxattr(path, NULL, 0); - if(len <= 0) - return xarr; - - list = g_new(gchar, len); - len = dyn_listxattr(path, list, len); - if(len < 0) - return xarr; - - for(l=list;l != list + len;l = strchr(l,'\0')+1) { - if(*l == '\0') - continue; - - if(g_regex_match_simple("^user\\.",l,0,0) == TRUE) - at.user = 1; - else - at.user = 0; - - at.name = g_strdup_printf("%s",l); - at.value = xattr_get(path, at.name, NULL); - if(at.value == NULL) - at.value = g_strdup(""); - - g_array_append_vals(xarr, &at, 1); - } - - g_free(list); - - return xarr; -} - - -void xattr_copy(const char *src_path, const char *dest_path) { - if (!dyn_listxattr || o_xattr_ignore.int_value) return; - - GArray *arr = xattr_list(src_path); - - int i; - for(i = 0; i < arr->len; i++) { - XAttr at = g_array_index(arr, XAttr, i); - xattr_set(dest_path, at.name, at.value, -1); - - g_free(at.name); - g_free(at.value); - } - - g_array_free(arr, TRUE); -} - - -GArray* compare_arrays(GArray *old, GArray *new) -{ - gint i,j; - gboolean flag; - GArray *A; - XAttr at; - - A = g_array_sized_new(FALSE,FALSE,sizeof(XAttr),0); - - /* Inefficient, good for small number of xattrs */ - for(i=0;ilen;i++) { - if(g_array_index(new, XAttr, i).user == 0) - continue; - flag = FALSE; - at.name = g_array_index(new, XAttr, i).name; - for(j=0;jlen;j++) { - if(g_strcmp0(at.name,g_array_index(old, XAttr, j).name) == 0) { - flag = TRUE; - if(g_strcmp0(g_array_index(new, XAttr, i).value, - g_array_index(old, XAttr, j).value) != 0) { - at.value = g_array_index(new, XAttr, i).value; - at.mode = MODE_REPLACE; - g_array_append_vals(A, &at, 1); - } - g_array_remove_index(old, j); - break; - } - } - if(flag == FALSE) { - at.value = g_array_index(new, XAttr, i).value; - at.mode = MODE_CREATE; - g_array_append_vals(A, &at, 1); - } - } - - for(j=0;jlen;j++) { - if(g_array_index(old, XAttr, j).user == 0) - continue; - at.name = g_array_index(old, XAttr, j).name; - at.mode = MODE_REMOVE; - g_array_append_vals(A, &at, 1); - } - - return A; -} - -GArray* copy_array(GArray *A) -{ - gint i; - GArray *B; - guint len = A->len; - XAttr at; - - B = g_array_sized_new(FALSE,FALSE,sizeof(XAttr),len); - for(i=0;ilen;i++) { - if(g_array_index(arr,XAttr,i).user == 1) - { - edit = TRUE; - rmable = TRUE; - } - else - { - edit = FALSE; - rmable = FALSE; - } - - name = g_array_index(arr,XAttr,i).name; - value = g_array_index(arr,XAttr,i).value; - u8nam = to_utf8(name); - u8val = to_utf8(value); - if(!g_utf8_validate(value,-1,NULL)) - edit = FALSE; - - gtk_list_store_append(model,&iter); - gtk_list_store_set(model,&iter,COLUMN_NAME,u8nam,COLUMN_VALUE,u8val, - COLUMN_EDNAM,FALSE,COLUMN_EDVAL,edit,COLUMN_RMABL,rmable,-1); - g_free(u8nam); - g_free(u8val); - } - return GTK_TREE_MODEL(model); -} - -static void dialog_response(GtkWidget *dialog, gint response, gpointer data) -{ - switch(response) { - case GTK_RESPONSE_CLOSE: { - g_array_free(((gpointer *)data)[1],TRUE); - g_array_free(((gpointer *)data)[3],TRUE); - g_free(((gpointer *)data)[4]); - g_free(data); - gtk_widget_destroy(dialog); - } - break; - - case GTK_RESPONSE_APPLY: { - GArray *arr = (GArray *)((gpointer *)data)[1]; - GArray *arr_old = (GArray *)((gpointer *)data)[3]; - GArray *changes; - gchar *rp, *path = (gchar *)((gpointer *)data)[4]; - GtkTreeView *tree = (GtkTreeView *)((gpointer *)data)[2]; - gint i, mod; - /*g_print("OLD\n");*/ - /*for(i=0;ilen;i++)*/ - /*g_print("%s: %s %d\n",*/ - /*g_array_index(arr_old, XAttr, i).name,*/ - /*g_array_index(arr_old, XAttr, i).value,*/ - /*g_array_index(arr_old, XAttr, i).user); */ - /*g_print("NEW\n");*/ - /*for(i=0;ilen;i++)*/ - /*g_print("%s: %s %d\n",*/ - /*g_array_index(arr, XAttr, i).name,*/ - /*g_array_index(arr, XAttr, i).value,*/ - /*g_array_index(arr, XAttr, i).user); */ - /*g_print("CHANGES\n");*/ - changes = compare_arrays(arr_old, arr); - for(i=0;ilen;i++) { - /*g_print("%s %d\n",g_array_index(changes,XAttr,i).name,g_array_index(changes,XAttr,i).mode);*/ - mod = g_array_index(changes,XAttr,i).mode; - switch(mod) { - case MODE_CREATE: - case MODE_REPLACE: - xattr_set(path,g_array_index(changes,XAttr,i).name,g_array_index(changes,XAttr,i).value,-1); - break; - case MODE_REMOVE: - xattr_rem(path,g_array_index(changes,XAttr,i).name); - break; - default: - break; - } - } - - rp = pathdup(path); - if (changes->len > 0 && strcmp(rp, path)) - /* When a symlink file is changed, - * in actuality, changed file is lenked file, not the symlink file. - * So without this, no update runs. */ - examine(path); - - g_free(rp); - g_array_free(arr,TRUE); - g_array_free(arr_old,TRUE); - g_array_free(changes,TRUE); - arr = xattr_list(path); - arr_old = copy_array(arr); - ((gpointer *)data)[1] = arr; - ((gpointer *)data)[3] = arr_old; - ((gpointer *)data)[0] = create_model(arr); - gtk_tree_view_set_model(tree, (GtkTreeModel *)((gpointer *)data)[0]); - } - break; - } -} - -static void add_item(GtkWidget *button, gpointer data) -{ - XAttr item; - GtkTreeIter iter; - GtkTreeModel *model = (GtkTreeModel *)((gpointer *)data)[0]; - GArray *arr = (GArray *)((gpointer *)data)[1]; - - item.name = g_strdup("user."); - item.value = g_strdup(""); - item.user = 1; - g_array_append_vals(arr,&item,1); - - gtk_list_store_append(GTK_LIST_STORE(model),&iter); - gtk_list_store_set(GTK_LIST_STORE(model),&iter, - COLUMN_NAME,item.name,COLUMN_VALUE,item.value,COLUMN_EDNAM,TRUE, - COLUMN_EDVAL,TRUE,COLUMN_RMABL,TRUE,-1); -} - -static void remove_item(GtkWidget *button, gpointer data) -{ - GtkTreeIter iter; - GtkTreeView *treeview = (GtkTreeView *)((gpointer *)data)[2]; - GtkTreeModel *model = gtk_tree_view_get_model(treeview); - GtkTreeSelection *selection = gtk_tree_view_get_selection(treeview); - GArray *arr = (GArray *)((gpointer *)data)[1]; - - if (gtk_tree_selection_get_selected(selection, NULL, &iter)) { - gint i; - GtkTreePath *path; - gboolean rmable; - - gtk_tree_model_get(model, &iter, COLUMN_RMABL, &rmable, -1); - if(rmable == TRUE) { - path = gtk_tree_model_get_path(model, &iter); - i = gtk_tree_path_get_indices(path)[0]; - gtk_list_store_remove(GTK_LIST_STORE(model), &iter); - - g_array_remove_index(arr,i); - - gtk_tree_path_free(path); - } - } -} - -static void cell_edited(GtkCellRendererText *cell, const gchar *path_string, const gchar *new_text, gpointer data) -{ - GArray *arr = (GArray *)((gpointer *)data)[1]; - GtkTreeModel *model = (GtkTreeModel *)((gpointer *)data)[0]; - GtkTreePath *path = gtk_tree_path_new_from_string(path_string); - GtkTreeIter iter; - - gint column = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(cell), "column")); - - gtk_tree_model_get_iter(model, &iter, path); - - switch (column) { - case COLUMN_NAME: - { - gint i; - gchar *old_text, *ascii; - - gtk_tree_model_get(model, &iter, column, &old_text, -1); - g_free(old_text); - - i = gtk_tree_path_get_indices(path)[0]; - g_free(g_array_index(arr, XAttr, i).name); - ascii = g_str_to_ascii(new_text,"C"); - if(g_regex_match_simple("^user\\.",ascii,0,0) == TRUE) - g_array_index(arr, XAttr, i).name = g_strdup(ascii); - else - g_array_index(arr, XAttr, i).name = g_strdup_printf("user.%s",ascii); - g_free(ascii); - - gtk_list_store_set(GTK_LIST_STORE(model), &iter, column, - g_array_index(arr, XAttr, i).name, -1); - - } - break; - - case COLUMN_VALUE: - { - gint i; - gchar *old_text; - - gtk_tree_model_get(model, &iter, column, &old_text, -1); - g_free(old_text); - - i = gtk_tree_path_get_indices(path)[0]; - g_free(g_array_index(arr, XAttr, i).value); - g_array_index(arr, XAttr, i).value = g_strdup(new_text); - - gtk_list_store_set(GTK_LIST_STORE(model), &iter, column, - g_array_index(arr, XAttr, i).value, -1); - } - break; - } - - gtk_tree_path_free(path); -} - -void xattrs_browser(DirItem *item, const guchar *path) -{ - GtkDialog *dialog; - GtkWidget *content, *hbox, *name; - GtkWidget *sw; - GtkWidget *tree; - GtkWidget *but; - GtkTreeModel *mod; - GArray *arr, *arr_old; - GtkCellRenderer *ren; - gpointer *data; - - g_return_if_fail(item != NULL && path != NULL); - - data = g_new(gpointer, 5); - arr = xattr_list(path); - arr_old = copy_array(arr); /* keep original attribute list */ - - dialog = GTK_DIALOG(gtk_dialog_new()); - gtk_window_set_title(GTK_WINDOW(dialog), _("Extended attributes")); - gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_MOUSE); - gtk_window_set_default_size(GTK_WINDOW(dialog),500,390); - - content = gtk_dialog_get_content_area(dialog); - - hbox = gtk_hbox_new(FALSE,4); - gtk_box_pack_start(GTK_BOX(content), hbox, FALSE, TRUE, 4); - gtk_box_pack_start(GTK_BOX(hbox), - gtk_image_new_from_pixbuf(di_image(item)->pixbuf), - FALSE, FALSE, 4); - - if (g_utf8_validate(item->leafname, -1, NULL)) - name = gtk_label_new(item->leafname); - else - { - guchar *u8; - - u8 = to_utf8(item->leafname); - name = gtk_label_new(u8); - g_free(u8); - } - gtk_label_set_line_wrap(GTK_LABEL(name), TRUE); - gtk_label_set_line_wrap_mode(GTK_LABEL(name), PANGO_WRAP_WORD_CHAR); - gtk_box_pack_start(GTK_BOX(hbox), name, FALSE, TRUE, 4); - - make_heading(name, PANGO_SCALE_X_LARGE); - - sw = gtk_scrolled_window_new(NULL,NULL); - gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), - GTK_SHADOW_ETCHED_IN); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), - GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC); - gtk_box_pack_start(GTK_BOX(content),sw,TRUE,TRUE,0); - - mod = create_model(arr); - tree = gtk_tree_view_new_with_model(mod); - /* wrapper for variable passing */ - data[0] = mod; data[1] = arr; data[2] = tree; data[3] = arr_old; data[4] = g_strdup(path); - gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(tree),TRUE); - gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)), - GTK_SELECTION_SINGLE); - /* add columns */ - ren = gtk_cell_renderer_text_new(); - g_signal_connect(ren, "edited", G_CALLBACK(cell_edited), data); - g_object_set_data(G_OBJECT(ren),"column",GINT_TO_POINTER(0)); - gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(tree),-1, - "Name",ren,"text",COLUMN_NAME,"editable",COLUMN_EDNAM,"sensitive",COLUMN_EDNAM,NULL); - ren = gtk_cell_renderer_text_new(); - g_signal_connect(ren, "edited", G_CALLBACK(cell_edited), data); - g_object_set_data(G_OBJECT(ren),"column",GINT_TO_POINTER(1)); - gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(tree),-1, - "Value",ren,"text",COLUMN_VALUE,"editable",COLUMN_EDVAL,"sensitive",COLUMN_EDVAL,NULL); - g_object_unref(mod); - gtk_container_add(GTK_CONTAINER(sw),tree); - - hbox = gtk_hbox_new(FALSE,4); - but = gtk_button_new_from_stock(GTK_STOCK_ADD); - g_signal_connect(but, "clicked", G_CALLBACK(add_item), data); - gtk_box_pack_start(GTK_BOX(hbox),but,FALSE,FALSE,0); - but = gtk_button_new_from_stock(GTK_STOCK_REMOVE); - g_signal_connect(but, "clicked", G_CALLBACK(remove_item), data); - gtk_box_pack_start(GTK_BOX(hbox),but,FALSE,FALSE,0); - gtk_box_pack_start(GTK_BOX(content),hbox,FALSE,FALSE,0); - - gtk_dialog_add_button(dialog,GTK_STOCK_APPLY,GTK_RESPONSE_APPLY); - gtk_dialog_add_button(dialog,GTK_STOCK_CLOSE,GTK_RESPONSE_CLOSE); - g_signal_connect(dialog, "response", G_CALLBACK(dialog_response), data); - gtk_dialog_set_default_response(dialog, GTK_RESPONSE_OK); - gtk_widget_show_all(GTK_WIDGET(dialog)); -} -#endif diff -Naur /src/xtypes.h/src/xtypes.h --- /src/xtypes.h 2023-01-29 22:11:51.000000000 -0500 +++/src/xtypes.h 1969-12-31 19:00:00.000000000 -0500 @@ -1,45 +0,0 @@ -/* - * ROX-Filer, filer for the ROX desktop project - * By Thomas Leonard, . - * - * Extended filesystem attribute support, particularly for MIME types - */ - -#ifndef _XTYPES_H -#define _XTYPES_H - -/* Know attribute names */ -#define XATTR_MIME_TYPE "user.mime_type" -#define XATTR_HIDDEN "user.hidden" -#define XATTR_LABEL "user.label" - -/* If set, do not use extended attributes */ -extern Option o_xattr_ignore; /* Set up in xattr_init() */ - -/* Prototypes */ -void xattr_init(void); - -/* path may be NULL to test for support in libc */ -int xattr_supported(const char *path); - -int xattr_have(const char *path); -gchar *xattr_get(const char *path, const char *attr, int *len); -int xattr_set(const char *path, const char *attr, - const char *value, int value_len); -int xattr_rem(const char *path, - const char *attr); -void xattr_copy(const char *src_path, const char *dest_path); - -MIME_type *xtype_get(const char *path); -int xtype_set(const char *path, const MIME_type *type); - -/* Label support */ -GdkColor *xlabel_get(const char *); - -/* Xattr browser */ -void xattrs_browser(DirItem *, const guchar *); -GArray* xattr_list(const char *); -GArray* copy_array(GArray *); -GArray* compare_arrays(GArray *,GArray *); - -#endif