Commit 3ad789a7 authored by Andy Hertzfeld's avatar Andy Hertzfeld
Browse files

fixed bug #683, experts shouldn't have link suffixes stripped, by creating


       fixed bug #683, experts shouldn't have link suffixes stripped, by
       creating a preference and using it
parent 26ce8487
2000-04-26 Andy Hertzfeld <andy@eazel.com>
fixed bug #683, experts shouldn't get suffix stripped from link file
* libnautilus-extensions/nautilus-global-preferences.h:
added preference for show_real_file_names
* libnautilus-extensions/nautilus-global-preferences.c:
made the user level code set show_real_file_names appropriately
* libnautilus-extensions/nautilus-link.c:
use the above preference to control suffix stripping
2000-04-26 Darin Adler <darin@eazel.com>
* libnautilus-extensions/nautilus-directory.c
......
......@@ -310,6 +310,12 @@ global_preferences_register_for_ui ()
"Help Search",
NAUTILUS_PREFERENCE_BOOLEAN,
(gconstpointer) FALSE);
/* miscellaneous */
nautilus_preferences_set_info (NAUTILUS_PREFERENCES_SHOW_REAL_FILE_NAME,
"Show entire file file",
NAUTILUS_PREFERENCE_BOOLEAN,
(gconstpointer) FALSE);
}
static void
......@@ -320,7 +326,8 @@ user_level_changed_callback (gpointer user_data)
gboolean show_hidden_files = FALSE;
gboolean use_real_home = TRUE;
gboolean show_real_file_name = FALSE;
const char *user_main_directory;
user_level = nautilus_preferences_get_enum (NAUTILUS_PREFERENCES_USER_LEVEL,
......@@ -331,22 +338,28 @@ user_level_changed_callback (gpointer user_data)
case NAUTILUS_USER_LEVEL_NOVICE:
show_hidden_files = FALSE;
use_real_home = FALSE;
show_real_file_name = FALSE;
break;
case NAUTILUS_USER_LEVEL_INTERMEDIATE:
show_hidden_files = FALSE;
use_real_home = TRUE;
show_real_file_name = FALSE;
break;
case NAUTILUS_USER_LEVEL_HACKER:
default:
show_hidden_files = TRUE;
use_real_home = TRUE;
show_real_file_name = TRUE;
break;
}
nautilus_preferences_set_boolean (NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES,
show_hidden_files);
nautilus_preferences_set_boolean (NAUTILUS_PREFERENCES_SHOW_REAL_FILE_NAME,
show_real_file_name);
/* FIXME: This call needs to be spanked to conform. Should return a strduped string */
user_main_directory = nautilus_user_main_directory ();
......
......@@ -4,18 +4,18 @@
Copyright (C) 1999, 2000 Eazel, Inc.
The Gnome Library is free software; you can redistribute it and/or
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome Library is distributed in the hope that it will be useful,
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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Gnome Library; see the file COPYING.LIB. If not,
License along with this program; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
......@@ -52,6 +52,7 @@ BEGIN_GNOME_DECLS
/* Preferences not (currently?) displayed in dialog */
#define NAUTILUS_PREFERENCES_ICON_VIEW_TEXT_ATTRIBUTE_NAMES "/nautilus/icon_view/text_attribute_names"
#define NAUTILUS_PREFERENCES_ICON_THEME "/nautilus/preferences/icon_theme"
#define NAUTILUS_PREFERENCES_SHOW_REAL_FILE_NAME "/nautilus/preferences/show_real_file_name"
/* Single/Double click preference */
#define NAUTILUS_PREFERENCES_CLICK_POLICY "/nautilus/preferences/click_policy"
......
......@@ -31,6 +31,8 @@
#include "nautilus-metadata.h"
#include "nautilus-string.h"
#include "nautilus-xml-extensions.h"
#include "nautilus-global-preferences.h"
#include "nautilus-widgets/nautilus-preferences.h"
/* given a uri, returns TRUE if it's a link file */
......@@ -106,10 +108,12 @@ nautilus_link_get_link_uri(const char *link_file_uri)
}
/* strips the suffix from the passed in string if it's a link file */
/* FIXME bugzilla.eazel.com 683: don't do this at expert user levels */
char*
nautilus_link_get_display_name(char* link_file_name)
{
if (nautilus_preferences_get_boolean(NAUTILUS_PREFERENCES_SHOW_REAL_FILE_NAME, FALSE))
return link_file_name;
if (link_file_name && nautilus_str_has_suffix(link_file_name, LINK_SUFFIX)) {
char *suffix_pos = strstr(link_file_name, LINK_SUFFIX);
if (suffix_pos)
......
......@@ -310,6 +310,12 @@ global_preferences_register_for_ui ()
"Help Search",
NAUTILUS_PREFERENCE_BOOLEAN,
(gconstpointer) FALSE);
/* miscellaneous */
nautilus_preferences_set_info (NAUTILUS_PREFERENCES_SHOW_REAL_FILE_NAME,
"Show entire file file",
NAUTILUS_PREFERENCE_BOOLEAN,
(gconstpointer) FALSE);
}
static void
......@@ -320,7 +326,8 @@ user_level_changed_callback (gpointer user_data)
gboolean show_hidden_files = FALSE;
gboolean use_real_home = TRUE;
gboolean show_real_file_name = FALSE;
const char *user_main_directory;
user_level = nautilus_preferences_get_enum (NAUTILUS_PREFERENCES_USER_LEVEL,
......@@ -331,22 +338,28 @@ user_level_changed_callback (gpointer user_data)
case NAUTILUS_USER_LEVEL_NOVICE:
show_hidden_files = FALSE;
use_real_home = FALSE;
show_real_file_name = FALSE;
break;
case NAUTILUS_USER_LEVEL_INTERMEDIATE:
show_hidden_files = FALSE;
use_real_home = TRUE;
show_real_file_name = FALSE;
break;
case NAUTILUS_USER_LEVEL_HACKER:
default:
show_hidden_files = TRUE;
use_real_home = TRUE;
show_real_file_name = TRUE;
break;
}
nautilus_preferences_set_boolean (NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES,
show_hidden_files);
nautilus_preferences_set_boolean (NAUTILUS_PREFERENCES_SHOW_REAL_FILE_NAME,
show_real_file_name);
/* FIXME: This call needs to be spanked to conform. Should return a strduped string */
user_main_directory = nautilus_user_main_directory ();
......
......@@ -4,18 +4,18 @@
Copyright (C) 1999, 2000 Eazel, Inc.
The Gnome Library is free software; you can redistribute it and/or
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome Library is distributed in the hope that it will be useful,
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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Gnome Library; see the file COPYING.LIB. If not,
License along with this program; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
......@@ -52,6 +52,7 @@ BEGIN_GNOME_DECLS
/* Preferences not (currently?) displayed in dialog */
#define NAUTILUS_PREFERENCES_ICON_VIEW_TEXT_ATTRIBUTE_NAMES "/nautilus/icon_view/text_attribute_names"
#define NAUTILUS_PREFERENCES_ICON_THEME "/nautilus/preferences/icon_theme"
#define NAUTILUS_PREFERENCES_SHOW_REAL_FILE_NAME "/nautilus/preferences/show_real_file_name"
/* Single/Double click preference */
#define NAUTILUS_PREFERENCES_CLICK_POLICY "/nautilus/preferences/click_policy"
......
......@@ -31,6 +31,8 @@
#include "nautilus-metadata.h"
#include "nautilus-string.h"
#include "nautilus-xml-extensions.h"
#include "nautilus-global-preferences.h"
#include "nautilus-widgets/nautilus-preferences.h"
/* given a uri, returns TRUE if it's a link file */
......@@ -106,10 +108,12 @@ nautilus_link_get_link_uri(const char *link_file_uri)
}
/* strips the suffix from the passed in string if it's a link file */
/* FIXME bugzilla.eazel.com 683: don't do this at expert user levels */
char*
nautilus_link_get_display_name(char* link_file_name)
{
if (nautilus_preferences_get_boolean(NAUTILUS_PREFERENCES_SHOW_REAL_FILE_NAME, FALSE))
return link_file_name;
if (link_file_name && nautilus_str_has_suffix(link_file_name, LINK_SUFFIX)) {
char *suffix_pos = strstr(link_file_name, LINK_SUFFIX);
if (suffix_pos)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment