Commit e60f2abe authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington

add preload of the gconf cache, to hopefully avoid a zillion round trips

2002-01-04  Havoc Pennington  <hp@pobox.com>

	* libnautilus-private/nautilus-global-preferences.c
	(nautilus_global_preferences_init): add preload of the gconf
	cache, to hopefully avoid a zillion round trips to gconfd on
	startup.

	* test/test.c (test_window_new): remove weird gtk_window_set_policy

	* test/test-nautilus-preferences-display.c: remove user level
	stuff

	* test/test-nautilus-preferences-change.c: remove user level stuff

	* libnautilus-private/nautilus-global-preferences.c: the default
	click policy was SPEED_TRADEOFF_LOCAL_ONLY, fix

	* libnautilus-private/nautilus.schemas: add schemas file,
	incomplete, needs to be finished and installed

	* libnautilus-private/nautilus-global-preferences.c: strip out
	user levels

	* src/nautilus-shell-ui.xml: strip out user level menu

	* src/nautilus-window-menus.c: strip out user level menu
parent d84dbfa0
2002-01-04 Havoc Pennington <hp@pobox.com>
* libnautilus-private/nautilus-global-preferences.c
(nautilus_global_preferences_init): add preload of the gconf
cache, to hopefully avoid a zillion round trips to gconfd on
startup.
* test/test.c (test_window_new): remove weird gtk_window_set_policy
* test/test-nautilus-preferences-display.c: remove user level
stuff
* test/test-nautilus-preferences-change.c: remove user level stuff
* libnautilus-private/nautilus-global-preferences.c: the default
click policy was SPEED_TRADEOFF_LOCAL_ONLY, fix
* libnautilus-private/nautilus.schemas: add schemas file,
incomplete, needs to be finished and installed
* libnautilus-private/nautilus-global-preferences.c: strip out
user levels
* src/nautilus-shell-ui.xml: strip out user level menu
* src/nautilus-window-menus.c: strip out user level menu
2002-01-04 Darin Adler <darin@bentspoon.com>
* libnautilus-private/nautilus-icon-container.c:
......
<gconfschemafile>
<schemalist>
<!-- Keep the defaults in sync with the emergency fallbacks
in nautilus-global-preferences.c -->
<!-- General preferences -->
<schema>
<key>/schemas/apps/nautilus/preferences/show_hidden_files</key>
<applyto>/apps/nautilus/preferences/show_hidden_files</applyto>
<owner>nautilus</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Whether to show dotfiles</short>
<long>
If set to true, then hidden files (dotfiles) are shown in
the file manager.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/nautilus/preferences/show_backup_files</key>
<applyto>/apps/nautilus/preferences/show_backup_files</applyto>
<owner>nautilus</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Whether to show backup files</short>
<long>
If set to true, then backup files such as those created
by Emacs are displayed. Currently, only files ending in
a tilde (~) are considered backup files.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/nautilus/preferences/confirm_trash</key>
<applyto>/apps/nautilus/preferences/confirm_trash</applyto>
<owner>nautilus</owner>
<type>bool</type>
<default>true</default>
<locale name="C">
<short>Whether to ask for confirmation when moving files to trash</short>
<long>
If set to true, then Nautilus will ask for confirmation when
you attempt to put files in the trash.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/nautilus/preferences/enable_delete</key>
<applyto>/apps/nautilus/preferences/enable_delete</applyto>
<owner>nautilus</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Whether to enable immediate deletion</short>
<long>
If set to true, then Nautilus will have a feature allowing
you to delete a file immediately and in-place, instead of moving it
to the trash. This feature can be dangerous, so use caution.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/nautilus/preferences/show_icon_text</key>
<applyto>/apps/nautilus/preferences/show_icon_text</applyto>
<owner>nautilus</owner>
<type>string</type>
<default>local_only</default>
<locale name="C">
<short>When to show preview text in icons</short>
<long>
Speed tradeoff for when to show a preview of text file contents
in the file's icon.
If set to "always" then always show previews,
even if the directory is on a remote server.
If set to "local_only" then only show previews for local filesystems.
If set to "never" then never bother to read preview data.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/nautilus/preferences/show_directory_item_counts</key>
<applyto>/apps/nautilus/preferences/show_directory_item_counts</applyto>
<owner>nautilus</owner>
<type>string</type>
<default>local_only</default>
<locale name="C">
<short>When to show number of items in a directory</short>
<long>
Speed tradeoff for when to show the number of items in a
directory. If set to "always" then always show item counts,
even if the directory is on a remote server.
If set to "local_only" then only show counts for local filesystems.
If set to "never" then never bother to compute item counts.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/nautilus/preferences/click_policy</key>
<applyto>/apps/nautilus/preferences/click_policy</applyto>
<owner>nautilus</owner>
<type>string</type>
<default>double</default>
<locale name="C">
<short>Type of click used to launch/open files</short>
<long>
Possible values are "single" to launch files on a single click,
or "double" to launch them on a double click.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/nautilus/preferences/executable_text_activation</key>
<applyto>/apps/nautilus/preferences/executable_text_activation</applyto>
<owner>nautilus</owner>
<type>string</type>
<default>ask</default>
<locale name="C">
<short>What to do with executable text files when activated</short>
<long>
What to do with executable text files when they are activated
(single or double clicked).
Possible values are "launch" to launch them as programs,
"ask" to ask what to do via a dialog, and "display" to display
them as text files.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/nautilus/preferences/theme</key>
<applyto>/apps/nautilus/preferences/theme</applyto>
<owner>nautilus</owner>
<type>string</type>
<default>default</default>
<locale name="C">
<short>Current Nautilus theme</short>
<long>
Name of the Nautilus theme to use.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/nautilus/preferences/show_image_thumbnails</key>
<applyto>/apps/nautilus/preferences/show_image_thumbnails</applyto>
<owner>nautilus</owner>
<type>string</type>
<default>local_only</default>
<locale name="C">
<short>When to show thumbnails of image files</short>
<long>
Speed tradeoff for when to show a image files as a thumbnail.
If set to "always" then always thumbnail,
even if the directory is on a remote server.
If set to "local_only" then only show thumbnails for local filesystems.
If set to "never" then never bother to thumbnail images,
just use a generic icon.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/nautilus/preferences/thumbnail_limit</key>
<applyto>/apps/nautilus/preferences/thumbnail_limit</applyto>
<owner>nautilus</owner>
<type>int</type>
<default>3145728</default>
<locale name="C">
<short>Maximum image size for thumbnailing</short>
<long>
Images over this size (in bytes) won't be
thumbnailed. The purpose of this setting is to
avoid thumbnailing large images that may
take a long time to load or use lots of memory.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/nautilus/preferences/use_public_metadata</key>
<applyto>/apps/nautilus/preferences/use_public_metadata</applyto>
<owner>nautilus</owner>
<type>string</type>
<default>local_only</default>
<locale name="C">
<short>Whether to store metadata in each directory, or in a single global location</short>
<long>
Nautilus records information about each directory you visit, such
as its background color, emblems, zoom level, and so on.
This information can be stored in one location in your home
directory, or it can be stored in each directory in hidden files.
The advantages of storing per-directory are that it's more robust
(can't be deleted in one go) and that for folders used by
multiple users, the metadata will be shared. So for example
all users can see emblems applied to files.
If this setting is "local_only", for local filesystems metadata
will be stored per-directory, and for remote connections
it will be stored in the user's home directory. If it's "never"
then all metadata will go in the user's home directory; if it's
"always" then all metadata will go in the directory being described.
(However, for read-only directories, metadata always goes in the
user's home directory.)
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/nautilus/preferences/smooth_graphics_mode</key>
<applyto>/apps/nautilus/preferences/smooth_graphics_mode</applyto>
<owner>nautilus</owner>
<type>bool</type>
<default>true</default>
<locale name="C">
<short>Whether to use smooth (antialiased) graphics</short>
<long>
If toggled on, smooth out jagged graphics, possibly
using more resources.
</long>
</locale>
</schema>
</schemalist>
</gconfschemafile>
......@@ -119,13 +119,6 @@ static void schedule_refresh_bookmarks_menu (Naut
static void edit_bookmarks (NautilusWindow *window);
static void add_bookmark_for_current_location (NautilusWindow *window);
/* User level things */
static guint convert_verb_to_user_level (const char *verb);
static const char * convert_user_level_to_path (guint user_level);
static void switch_to_user_level (NautilusWindow *window,
int new_user_level);
#define NAUTILUS_MENU_PATH_NOVICE_ITEM "/menu/Preferences/User Levels Placeholder/Switch to Beginner Level"
#define NAUTILUS_MENU_PATH_INTERMEDIATE_ITEM "/menu/Preferences/User Levels Placeholder/Switch to Intermediate Level"
#define NAUTILUS_MENU_PATH_EXPERT_ITEM "/menu/Preferences/User Levels Placeholder/Switch to Advanced Level"
......@@ -694,89 +687,6 @@ help_menu_nautilus_feedback_callback (BonoboUIComponent *component,
CUSTOMER_FEEDBACK_URI);
}
/* utility routine to return an image corresponding to the passed-in user level */
static char *
get_user_level_icon_name (int user_level, gboolean is_selected)
{
const char *image_name;
char *full_image_name;
switch (user_level) {
case EEL_USER_LEVEL_NOVICE:
image_name = "novice";
break;
case EEL_USER_LEVEL_ADVANCED:
image_name = "expert";
break;
case EEL_USER_LEVEL_INTERMEDIATE:
default:
image_name = "intermediate";
break;
}
if (is_selected) {
full_image_name = g_strdup_printf ("nautilus/%s-selected.png", image_name);
} else {
full_image_name = g_strdup_printf ("nautilus/%s.png", image_name);
}
return full_image_name;
}
/* handle user level changes */
static void
switch_to_user_level (NautilusWindow *window, int new_user_level)
{
char *old_user_level_icon_name;
int old_user_level;
char *new_user_level_icon_name_selected;
if (window->details->shell_ui == NULL) {
return;
}
old_user_level = eel_preferences_get_user_level ();
if (new_user_level == old_user_level) {
return;
}
eel_preferences_set_user_level (new_user_level);
nautilus_window_ui_freeze (window);
bonobo_ui_component_freeze (window->details->shell_ui, NULL);
/* change the item icons to reflect the new user level */
old_user_level_icon_name = get_user_level_icon_name (old_user_level, FALSE);
nautilus_bonobo_set_icon (window->details->shell_ui,
convert_user_level_to_path (old_user_level),
old_user_level_icon_name);
g_free (old_user_level_icon_name);
new_user_level_icon_name_selected = get_user_level_icon_name (new_user_level, TRUE);
nautilus_bonobo_set_icon (window->details->shell_ui,
convert_user_level_to_path (new_user_level),
new_user_level_icon_name_selected);
g_free (new_user_level_icon_name_selected);
bonobo_ui_component_thaw (window->details->shell_ui, NULL);
nautilus_window_ui_thaw (window);
}
static void
user_level_menu_item_callback (BonoboUIComponent *component,
gpointer user_data,
const char *verb)
{
NautilusWindow *window;
window = NAUTILUS_WINDOW (user_data);
switch_to_user_level (window, convert_verb_to_user_level (verb));
}
static void
remove_bookmarks_for_uri_if_yes (GtkDialog *dialog, int response, gpointer callback_data)
{
......@@ -1203,54 +1113,6 @@ nautilus_window_initialize_go_menu (NautilusWindow *window)
GTK_OBJECT (window));
}
static void
update_user_level_menu_item (NautilusWindow *window,
const char *menu_path,
guint item_user_level)
{
guint current_user_level;
char *icon_name;
if (window->details->shell_ui == NULL) {
return;
}
current_user_level = eel_preferences_get_user_level ();
icon_name = get_user_level_icon_name (item_user_level, current_user_level == item_user_level);
nautilus_window_ui_freeze (window);
nautilus_bonobo_set_icon (window->details->shell_ui,
menu_path,
icon_name);
g_free (icon_name);
nautilus_window_ui_thaw (window);
}
static void
user_level_changed_callback (gpointer callback_data)
{
NautilusWindow *window;
g_return_if_fail (NAUTILUS_IS_WINDOW (callback_data));
window = NAUTILUS_WINDOW (callback_data);
update_user_level_menu_item (window,
NAUTILUS_MENU_PATH_NOVICE_ITEM,
EEL_USER_LEVEL_NOVICE);
update_user_level_menu_item (window,
NAUTILUS_MENU_PATH_INTERMEDIATE_ITEM,
EEL_USER_LEVEL_INTERMEDIATE);
update_user_level_menu_item (window,
NAUTILUS_MENU_PATH_EXPERT_ITEM,
EEL_USER_LEVEL_ADVANCED);
}
/**
* nautilus_window_initialize_menus
*
......@@ -1302,12 +1164,7 @@ nautilus_window_initialize_menus_part_1 (NautilusWindow *window)
BONOBO_UI_VERB ("Nautilus Quick Reference", help_menu_nautilus_quick_reference_callback),
BONOBO_UI_VERB ("Nautilus Release Notes", help_menu_nautilus_release_notes_callback),
BONOBO_UI_VERB ("Nautilus Feedback", help_menu_nautilus_feedback_callback),
BONOBO_UI_VERB ("Switch to Beginner Level", user_level_menu_item_callback),
BONOBO_UI_VERB ("Switch to Intermediate Level", user_level_menu_item_callback),
BONOBO_UI_VERB ("Switch to Advanced Level", user_level_menu_item_callback),
BONOBO_UI_VERB ("User Level Customization", user_level_customize_callback),
BONOBO_UI_VERB ("Stop", stop_button_callback),
BONOBO_UI_VERB_END
......@@ -1321,14 +1178,6 @@ nautilus_window_initialize_menus_part_1 (NautilusWindow *window)
nautilus_window_update_show_hide_menu_items (window);
/* Keep track of user level changes to update the user level menu item icons */
eel_preferences_add_callback_while_alive ("user_level",
user_level_changed_callback,
window,
G_OBJECT (window));
/* Update the user level menu items for the first time */
user_level_changed_callback (window);
/* Register to catch Bonobo UI events so we can notice View As changes */
g_signal_connect (window->details->shell_ui, "ui_event",
G_CALLBACK (nautilus_window_handle_ui_event_callback), window);
......@@ -1520,35 +1369,3 @@ schedule_refresh_go_menu (NautilusWindow *window)
}
static guint
convert_verb_to_user_level (const char *verb)
{
g_assert (verb != NULL);
if (strcmp (verb, SWITCH_TO_BEGINNER_VERB) == 0) {
return EEL_USER_LEVEL_NOVICE;
} else if (strcmp (verb, SWITCH_TO_INTERMEDIATE_VERB) == 0) {
return EEL_USER_LEVEL_INTERMEDIATE;
} else if (strcmp (verb, SWITCH_TO_ADVANCED_VERB) == 0) {
return EEL_USER_LEVEL_ADVANCED;
}
g_assert_not_reached ();
return EEL_USER_LEVEL_NOVICE;
}
static const char *
convert_user_level_to_path (guint user_level)
{
switch (user_level) {
case EEL_USER_LEVEL_NOVICE:
return NAUTILUS_MENU_PATH_NOVICE_ITEM;
case EEL_USER_LEVEL_INTERMEDIATE:
return NAUTILUS_MENU_PATH_INTERMEDIATE_ITEM;
case EEL_USER_LEVEL_ADVANCED:
return NAUTILUS_MENU_PATH_EXPERT_ITEM;
}
g_assert_not_reached ();
return NAUTILUS_MENU_PATH_NOVICE_ITEM;
}
......@@ -124,6 +124,11 @@
<separator/>
<menuitem name="User Level Customization"
_label="P_references..."
_tip="Edit Nautilus preferences"
verb="User Level Customization"/>
<menuitem name="Customize"
_label="_Backgrounds and Emblems..."
_tip="Display patterns, colors, and emblems that can be used to customize appearance"
......@@ -253,29 +258,6 @@
verb="Report Profiling"/>
</submenu>
<submenu name="Preferences" _label="_Preferences">
<placeholder name="User Levels Placeholder" delimit="none">
<menuitem name="Switch to Beginner Level"
_label=" _Beginner"
_tip="Use preferences appropriate for beginners"
verb="" pixtype="filename"/>
<menuitem name="Switch to Intermediate Level"
_label=" _Intermediate"
_tip="Use preferences appropriate for most people"
verb="" pixtype="filename"/>
<menuitem name="Switch to Advanced Level"
_label=" _Advanced"
_tip="Use preferences appropriate for experts"
verb="" pixtype="filename"/>
</placeholder>
<separator/>
<menuitem name="User Level Customization"
_label="_Edit Preferences..."
_tip="Edit various Nautilus preferences"
verb="User Level Customization"/>
</submenu>
<submenu name="Help" _label="_Help">
<menuitem name="Nautilus Manual"
_label="Nautilus User _Manual"
......
......@@ -119,13 +119,6 @@ static void schedule_refresh_bookmarks_menu (Naut
static void edit_bookmarks (NautilusWindow *window);
static void add_bookmark_for_current_location (NautilusWindow *window);
/* User level things */
static guint convert_verb_to_user_level (const char *verb);
static const char * convert_user_level_to_path (guint user_level);
static void switch_to_user_level (NautilusWindow *window,
int new_user_level);
#define NAUTILUS_MENU_PATH_NOVICE_ITEM "/menu/Preferences/User Levels Placeholder/Switch to Beginner Level"
#define NAUTILUS_MENU_PATH_INTERMEDIATE_ITEM "/menu/Preferences/User Levels Placeholder/Switch to Intermediate Level"
#define NAUTILUS_MENU_PATH_EXPERT_ITEM "/menu/Preferences/User Levels Placeholder/Switch to Advanced Level"
......@@ -694,89 +687,6 @@ help_menu_nautilus_feedback_callback (BonoboUIComponent *component,
CUSTOMER_FEEDBACK_URI);
}
/* utility routine to return an image corresponding to the passed-in user level */
static char *
get_user_level_icon_name (int user_level, gboolean is_selected)
{
const char *image_name;
char *full_image_name;
switch (user_level) {
case EEL_USER_LEVEL_NOVICE:
image_name = "novice";
break;
case EEL_USER_LEVEL_ADVANCED:
image_name = "expert";
break;
case EEL_USER_LEVEL_INTERMEDIATE:
default:
image_name = "intermediate";
break;
}
if (is_selected) {
full_image_name = g_strdup_printf ("nautilus/%s-selected.png", image_name);
} else {
full_image_name = g_strdup_printf ("nautilus/%s.png", image_name);
}
return full_image_name;
}
/* handle user level changes */
static void
switch_to_user_level (NautilusWindow *window, int new_user_level)
{
char *old_user_level_icon_name;
int old_user_level;
char *new_user_level_icon_name_selected;
if (window->details->shell_ui == NULL) {
return;
}
old_user_level = eel_preferences_get_user_level ();
if (new_user_level == old_user_level) {
return;
}
eel_preferences_set_user_level (new_user_level);
nautilus_window_ui_freeze (window);
bonobo_ui_component_freeze (window->details->shell_ui, NULL);
/* change the item icons to reflect the new user level */
old_user_level_icon_name = get_user_level_icon_name (old_user_level, FALSE);
nautilus_bonobo_set_icon (window->details->shell_ui,
convert_user_level_to_path (old_user_level),
old_user_level_icon_name);
g_free (old_user_level_icon_name);
new_user_level_icon_name_selected = get_user_level_icon_name (new_user_level, TRUE);
nautilus_bonobo_set_icon (window->details->shell_ui,
convert_user_level_to_path (new_user_level),
new_user_level_icon_name_selected);
g_free (new_user_level_icon_name_selected);
bonobo_ui_component_thaw (window->details->shell_ui, NULL);
nautilus_window_ui_thaw (window);
}
static void
user_level_menu_item_callback (BonoboUIComponent *component,
gpointer user_data,
const char *verb)
{
NautilusWindow *window;
window = NAUTILUS_WINDOW (user_data);
switch_to_user_level (window, convert_verb_to_user_level (verb));
}
static void
remove_bookmarks_for_uri_if_yes (GtkDialog *dialog, int response, gpointer callback_data)
{
......@@ -1203,54 +1113,6 @@ nautilus_window_initialize_go_menu (NautilusWindow *window)
GTK_OBJECT (window));
}
static void
update_user_level_menu_item (NautilusWindow *window,
const char *menu_path,
guint item_user_level)
{
guint current_user_level;
char *icon_name;
if (window->details->shell_ui == NULL) {
return;
}
current_user_level = eel_preferences_get_user_level ();
icon_name = get_user_level_icon_name (item_user_level, current_user_level == item_user_level);
nautilus_window_ui_freeze (window);
nautilus_bonobo_set_icon (window->details->shell_ui,
menu_path,
icon_name);
g_free (icon_name);
nautilus_window_ui_thaw (window);
}
static void
user_level_changed_callback (gpointer callback_data)
{
NautilusWindow *window;
g_return_if_fail (NAUTILUS_IS_WINDOW (callback_data));
window = NAUTILUS_WINDOW (callback_data);
update_user_level_menu_item (window,
NAUTILUS_MENU_PATH_NOVICE_ITEM,
EEL_USER_LEVEL_NOVICE);
update_user_level_menu_item (window,
NAUTILUS_MENU_PATH_INTERMEDIATE_ITEM,
EEL_USER_LEVEL_INTERMEDIATE);
update_user_level_menu_item (window,
NAUTILUS_MENU_PATH_EXPERT_ITEM,
EEL_USER_LEVEL_ADVANCED);
}
/**
* nautilus_window_initialize_menus
*
......@@ -1302,12 +1164,7 @@ nautilus_window_initialize_menus_part_1 (NautilusWindow *window)
BONOBO_UI_VERB ("Nautilus Quick Reference", help_menu_nautilus_quick_reference_callback),
BONOBO_UI_VERB ("Nautilus Release Notes", help_menu_nautilus_release_notes_callback),
BONOBO_UI_VERB ("Nautilus Feedback", help_menu_nautilus_feedback_callback),
BONOBO_UI_VERB ("Switch to Beginner Level", user_level_menu_item_callback),
BONOBO_UI_VERB ("Switch to Intermediate Level", user_level_menu_item_callback),
BONOBO_UI_VERB ("Switch to Advanced Level", user_level_menu_item_callback),
BONOBO_UI_VERB ("User Level Customization", user_level_customize_callback),
BONOBO_UI_VERB ("Stop", stop_button_callback),
BONOBO_UI_VERB_END
......@@ -1321,14 +1178,6 @@ nautilus_window_initialize_menus_part_1 (NautilusWindow *window)
nautilus_window_update_show_hide_menu_items (window);
/* Keep track of user level changes to update the user level menu item icons */
eel_preferences_add_callback_while_alive ("user_level",
user_level_changed_callback,
window,
G_OBJECT (window));
/* Update the user level menu items for the first time */
user_level_changed_callback (window);
/* Register to catch Bonobo UI events so we can notice View As changes */
g_signal_connect (window->details->shell_ui, "ui_event",
G_CALLBACK (nautilus_window_handle_ui_event_callback), window);
......@@ -1520,35 +1369,3 @@ schedule_refresh_go_menu (NautilusWindow *window)
}
static guint
convert_verb_to_user_level (const char *verb)
{
g_assert (verb != NULL);
if (strcmp (verb, SWITCH_TO_BEGINNER_VERB) == 0) {
return EEL_USER_LEVEL_NOVICE;
} else if (strcmp (verb, SWITCH_TO_INTERMEDIATE_VERB) == 0) {
return EEL_USER_LEVEL_INTERMEDIATE;
} else if (strcmp (verb, SWITCH_TO_ADVANCED_VERB) == 0) {
return EEL_USER_LEVEL_ADVANCED;
}
g_assert_not_reached ();
return EEL_USER_LEVEL_NOVICE;
}
static const char *
convert_user_level_to_path (guint user_level)
{
switch (user_level) {