Commit f5979fdb authored by Andy Hertzfeld's avatar Andy Hertzfeld

made the add/remove buttons in the content browser not show up for novice


         made the add/remove buttons in the content browser not show
	 up for novice user level
parent 86e8bc64
2000-05-09 Andy Hertzfeld <andy@eazel.com>
made the add and remove buttons in the content browser not
show up for novice-level users
* libnautilus-extensions/nautilus-global-preferences.h:
defined new preference for CAN_ADD_CONTENT
* libnautilus-extensions/nautilus-global-preferences.c:
turned CAN_ADD_CONTENT off for novices, on for other levels
* src/nautilus-property-browser.c:
respect CAN_ADD_CONTENT when deciding to show the buttons
2000-05-09 John Sullivan <sullivan@eazel.com>
fixed bug 843 (Emblem checkboxes in Properties window
......
......@@ -327,6 +327,7 @@ user_level_changed_callback (gpointer user_data)
gboolean show_hidden_files = FALSE;
gboolean use_real_home = TRUE;
gboolean show_real_file_name = FALSE;
gboolean can_add_content = TRUE;
const char *user_main_directory;
......@@ -339,12 +340,14 @@ user_level_changed_callback (gpointer user_data)
show_hidden_files = FALSE;
use_real_home = FALSE;
show_real_file_name = FALSE;
can_add_content = FALSE;
break;
case NAUTILUS_USER_LEVEL_INTERMEDIATE:
show_hidden_files = FALSE;
use_real_home = TRUE;
show_real_file_name = FALSE;
can_add_content = TRUE;
break;
case NAUTILUS_USER_LEVEL_HACKER:
......@@ -352,6 +355,7 @@ user_level_changed_callback (gpointer user_data)
show_hidden_files = TRUE;
use_real_home = TRUE;
show_real_file_name = TRUE;
can_add_content = TRUE;
break;
}
......@@ -361,6 +365,10 @@ user_level_changed_callback (gpointer user_data)
nautilus_preferences_set_boolean (NAUTILUS_PREFERENCES_SHOW_REAL_FILE_NAME,
show_real_file_name);
nautilus_preferences_set_boolean (NAUTILUS_PREFERENCES_CAN_ADD_CONTENT,
can_add_content);
/* FIXME bugzilla.eazel.com 715: This call needs to be spanked to conform. Should return a strduped string */
user_main_directory = nautilus_user_main_directory ();
......
......@@ -39,11 +39,14 @@ BEGIN_GNOME_DECLS
#define NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES "/nautilus/preferences/show_hidden_files"
/* sidebar width */
#define NAUTILUS_PREFERENCES_SIDEBAR_WIDTH "/nautilus/preferences/sidebar_width"
#define NAUTILUS_PREFERENCES_SIDEBAR_WIDTH "/nautilus/preferences/sidebar_width"
/* Home URI */
#define NAUTILUS_PREFERENCES_HOME_URI "/nautilus/preferences/home_uri"
/* adding/removing from property browser */
#define NAUTILUS_PREFERENCES_CAN_ADD_CONTENT "/nautilus/preferences/can_add_content"
/* Wellknown meta views */
#define NAUTILUS_PREFERENCES_META_VIEWS_SHOW_ANNOTATIONS "/nautilus/metaviews/OAFIID:ntl_notes_view:7f04c3cb-df79-4b9a-a577-38b19ccd4185"
#define NAUTILUS_PREFERENCES_META_VIEWS_SHOW_HELP_CONTENTS "/nautilus/metaviews/OAFIID:hyperbola_navigation_tree:57542ce0-71ff-442d-a764-462c92514234"
......
......@@ -327,6 +327,7 @@ user_level_changed_callback (gpointer user_data)
gboolean show_hidden_files = FALSE;
gboolean use_real_home = TRUE;
gboolean show_real_file_name = FALSE;
gboolean can_add_content = TRUE;
const char *user_main_directory;
......@@ -339,12 +340,14 @@ user_level_changed_callback (gpointer user_data)
show_hidden_files = FALSE;
use_real_home = FALSE;
show_real_file_name = FALSE;
can_add_content = FALSE;
break;
case NAUTILUS_USER_LEVEL_INTERMEDIATE:
show_hidden_files = FALSE;
use_real_home = TRUE;
show_real_file_name = FALSE;
can_add_content = TRUE;
break;
case NAUTILUS_USER_LEVEL_HACKER:
......@@ -352,6 +355,7 @@ user_level_changed_callback (gpointer user_data)
show_hidden_files = TRUE;
use_real_home = TRUE;
show_real_file_name = TRUE;
can_add_content = TRUE;
break;
}
......@@ -361,6 +365,10 @@ user_level_changed_callback (gpointer user_data)
nautilus_preferences_set_boolean (NAUTILUS_PREFERENCES_SHOW_REAL_FILE_NAME,
show_real_file_name);
nautilus_preferences_set_boolean (NAUTILUS_PREFERENCES_CAN_ADD_CONTENT,
can_add_content);
/* FIXME bugzilla.eazel.com 715: This call needs to be spanked to conform. Should return a strduped string */
user_main_directory = nautilus_user_main_directory ();
......
......@@ -39,11 +39,14 @@ BEGIN_GNOME_DECLS
#define NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES "/nautilus/preferences/show_hidden_files"
/* sidebar width */
#define NAUTILUS_PREFERENCES_SIDEBAR_WIDTH "/nautilus/preferences/sidebar_width"
#define NAUTILUS_PREFERENCES_SIDEBAR_WIDTH "/nautilus/preferences/sidebar_width"
/* Home URI */
#define NAUTILUS_PREFERENCES_HOME_URI "/nautilus/preferences/home_uri"
/* adding/removing from property browser */
#define NAUTILUS_PREFERENCES_CAN_ADD_CONTENT "/nautilus/preferences/can_add_content"
/* Wellknown meta views */
#define NAUTILUS_PREFERENCES_META_VIEWS_SHOW_ANNOTATIONS "/nautilus/metaviews/OAFIID:ntl_notes_view:7f04c3cb-df79-4b9a-a577-38b19ccd4185"
#define NAUTILUS_PREFERENCES_META_VIEWS_SHOW_HELP_CONTENTS "/nautilus/metaviews/OAFIID:hyperbola_navigation_tree:57542ce0-71ff-442d-a764-462c92514234"
......
......@@ -42,6 +42,7 @@
#include <libnautilus-extensions/nautilus-file.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
#include <libnautilus-extensions/nautilus-glib-extensions.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-extensions/nautilus-gtk-extensions.h>
#include <libnautilus-extensions/nautilus-gtk-macros.h>
#include <libnautilus-extensions/nautilus-metadata.h>
......@@ -1312,6 +1313,7 @@ nautilus_property_browser_update_contents (NautilusPropertyBrowser *property_bro
xmlDocPtr document;
NautilusBackground *background;
GtkWidget *viewport;
gboolean show_buttons;
gint index = 0;
/* load the xml document corresponding to the path and selection */
......@@ -1376,6 +1378,8 @@ nautilus_property_browser_update_contents (NautilusPropertyBrowser *property_bro
/* update the title and button */
show_buttons = nautilus_preferences_get_boolean(NAUTILUS_PREFERENCES_CAN_ADD_CONTENT, FALSE);
if (property_browser->details->category == NULL) {
gtk_label_set_text(GTK_LABEL(property_browser->details->title_label), _("Select A Category:"));
gtk_widget_hide(property_browser->details->up_arrow);
......@@ -1397,8 +1401,11 @@ nautilus_property_browser_update_contents (NautilusPropertyBrowser *property_bro
/* enable the "add new" button and update it's name */
gtk_label_set(GTK_LABEL(property_browser->details->add_button_label), temp_str);
gtk_widget_show(property_browser->details->add_button);
if (show_buttons)
gtk_widget_show(property_browser->details->add_button);
else
gtk_widget_hide(property_browser->details->add_button);
if (property_browser->details->remove_mode) {
char *temp_category = g_strdup(property_browser->details->category);
temp_category[strlen(temp_category) - 1] = '\0'; /* strip trailing s */
......@@ -1416,7 +1423,7 @@ nautilus_property_browser_update_contents (NautilusPropertyBrowser *property_bro
g_free(temp_str);
temp_str = g_strdup_printf(_("Remove a %s"), property_browser->details->category);
if (property_browser->details->remove_mode || !property_browser->details->has_local)
if (!show_buttons || property_browser->details->remove_mode || !property_browser->details->has_local)
gtk_widget_hide(property_browser->details->remove_button);
else
gtk_widget_show(property_browser->details->remove_button);
......
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