Commit bc167f1a authored by John Sullivan's avatar John Sullivan
Browse files

Finished task 174 (make "Open in new window" preference

	sensible)

	* libnautilus-extensions/nautilus-global-preferences.c:
	(global_preferences_create_dialog),
	(global_preferences_register_for_ui): Consolidated "Window
	Options" pane & "Click Policy" pane into new "Directory
	Views" pane, to make it clear that these preferences apply
	just to directory views. Also removed unimplemented "use
	existing window for same location" preference that is not
	in our plans. Tweaked wording a little.

	* libnautilus-extensions/nautilus-global-preferences.h:
	* libnautilus-extensions/nautilus-icon-canvas-item.c:
	(in_single_click_mode): New function, checks preference.
	(draw_or_measure_label_text): Don't draw underlines on icons
	if we're not in single-click mode.
parent e3252a4a
2000-05-19 John Sullivan <sullivan@eazel.com>
Finished task 174 (make "Open in new window" preference
sensible)
* libnautilus-extensions/nautilus-global-preferences.c:
(global_preferences_create_dialog),
(global_preferences_register_for_ui): Consolidated "Window
Options" pane & "Click Policy" pane into new "Directory
Views" pane, to make it clear that these preferences apply
just to directory views. Also removed unimplemented "use
existing window for same location" preference that is not
in our plans. Tweaked wording a little.
* libnautilus-extensions/nautilus-global-preferences.h:
* libnautilus-extensions/nautilus-icon-canvas-item.c:
(in_single_click_mode): New function, checks preference.
(draw_or_measure_label_text): Don't draw underlines on icons
if we're not in single-click mode.
2000-05-19 John Sullivan <sullivan@eazel.com>
A few tweaks to this new class inspired by Darin's
......
......@@ -60,9 +60,8 @@ global_preferences_create_dialog (void)
GtkWidget *prefs_dialog;
NautilusPreferencesBox *preference_box;
GtkWidget *user_level_pane;
GtkWidget *window_options_pane;
GtkWidget *directory_views_pane;
GtkWidget *meta_view_pane;
GtkWidget *icon_view_pane;
/*
* In the soon to come star trek future, the following widgetry
......@@ -89,24 +88,27 @@ global_preferences_create_dialog (void)
NAUTILUS_PREFERENCES_USER_LEVEL,
NAUTILUS_PREFERENCE_ITEM_ENUM);
/*
* Window options pane
* Directory Views pane
*/
window_options_pane = nautilus_preferences_box_add_pane (preference_box,
"Window Options",
"Window Options Something");
directory_views_pane = nautilus_preferences_box_add_pane (preference_box,
"Directory Views",
"Directory Views Something");
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (window_options_pane), "Basic window options");
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (directory_views_pane), "Window Behavior");
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (window_options_pane),
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (directory_views_pane),
0,
NAUTILUS_PREFERENCES_WINDOW_ALWAYS_NEW,
NAUTILUS_PREFERENCE_ITEM_BOOLEAN);
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (window_options_pane),
0,
NAUTILUS_PREFERENCES_WINDOW_SEARCH_EXISTING,
NAUTILUS_PREFERENCE_ITEM_BOOLEAN);
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (directory_views_pane), "Click Behavior");
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (directory_views_pane),
1,
NAUTILUS_PREFERENCES_CLICK_POLICY,
NAUTILUS_PREFERENCE_ITEM_ENUM);
/*
* Meta view pane
*/
......@@ -146,20 +148,6 @@ global_preferences_create_dialog (void)
NAUTILUS_PREFERENCES_META_VIEWS_SHOW_WEB_SEARCH,
NAUTILUS_PREFERENCE_ITEM_BOOLEAN);
/*
* Clicking pane
*/
icon_view_pane = nautilus_preferences_box_add_pane (preference_box,
"Click Policy",
"Click Policy something");
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (icon_view_pane), "Click Policy");
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (icon_view_pane),
0,
NAUTILUS_PREFERENCES_CLICK_POLICY,
NAUTILUS_PREFERENCE_ITEM_ENUM);
return prefs_dialog;
}
......@@ -232,16 +220,10 @@ global_preferences_register_for_ui ()
/* Window create new */
nautilus_preferences_set_info (NAUTILUS_PREFERENCES_WINDOW_ALWAYS_NEW,
"Create new window for each new page",
"Open each item in a new window",
NAUTILUS_PREFERENCE_BOOLEAN,
(gconstpointer) FALSE);
/* Window seatch existing */
nautilus_preferences_set_info (NAUTILUS_PREFERENCES_WINDOW_SEARCH_EXISTING,
"Do not open more than one window with the same page",
NAUTILUS_PREFERENCE_BOOLEAN,
(gconstpointer) FALSE);
/* Click activation type */
nautilus_preferences_set_info (NAUTILUS_PREFERENCES_CLICK_POLICY,
"Click policy",
......@@ -250,12 +232,12 @@ global_preferences_register_for_ui ()
nautilus_preferences_enum_add_entry (NAUTILUS_PREFERENCES_CLICK_POLICY,
"single",
"Single Click",
"Activate items with a single click",
NAUTILUS_CLICK_POLICY_SINGLE);
nautilus_preferences_enum_add_entry (NAUTILUS_PREFERENCES_CLICK_POLICY,
"double",
"Double Click",
"Activate items with a double click",
NAUTILUS_CLICK_POLICY_DOUBLE);
/* User level */
......
......@@ -33,7 +33,6 @@ BEGIN_GNOME_DECLS
/* Window options */
#define NAUTILUS_PREFERENCES_WINDOW_ALWAYS_NEW "/nautilus/preferences/window_always_new"
#define NAUTILUS_PREFERENCES_WINDOW_SEARCH_EXISTING "/nautilus/preferences/window_search_existing"
/* Show hidden files */
#define NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES "/nautilus/preferences/show_hidden_files"
......
......@@ -38,6 +38,7 @@
#include "nautilus-glib-extensions.h"
#include "nautilus-gdk-extensions.h"
#include "nautilus-gdk-pixbuf-extensions.h"
#include "nautilus-global-preferences.h"
#include "nautilus-gtk-macros.h"
#include "nautilus-gnome-extensions.h"
#include "nautilus-graphic-effects.h"
......@@ -560,6 +561,16 @@ gnome_icon_underline_text (GnomeIconTextInfo *text_info,
}
}
static gboolean
in_single_click_mode ()
{
/* Perhaps this should be computed elsewhere and passed in. */
return nautilus_preferences_get_enum
(NAUTILUS_PREFERENCES_CLICK_POLICY, NAUTILUS_CLICK_POLICY_SINGLE) ==
NAUTILUS_CLICK_POLICY_SINGLE;
}
/* Draw the text in a box, using gnomelib routines. */
static void
draw_or_measure_label_text (NautilusIconCanvasItem *item,
......@@ -666,8 +677,8 @@ draw_or_measure_label_text (NautilusIconCanvasItem *item,
GTK_JUSTIFY_CENTER);
}
/* if it's prelit, underline the text */
if (details->is_prelit) {
/* if it's prelit, and we're in click-to-activate mode, underline the text */
if (details->is_prelit && in_single_click_mode ()) {
gnome_icon_underline_text
(icon_text_info, drawable, gc,
text_left + 1, icon_bottom + height_so_far);
......
......@@ -60,9 +60,8 @@ global_preferences_create_dialog (void)
GtkWidget *prefs_dialog;
NautilusPreferencesBox *preference_box;
GtkWidget *user_level_pane;
GtkWidget *window_options_pane;
GtkWidget *directory_views_pane;
GtkWidget *meta_view_pane;
GtkWidget *icon_view_pane;
/*
* In the soon to come star trek future, the following widgetry
......@@ -89,24 +88,27 @@ global_preferences_create_dialog (void)
NAUTILUS_PREFERENCES_USER_LEVEL,
NAUTILUS_PREFERENCE_ITEM_ENUM);
/*
* Window options pane
* Directory Views pane
*/
window_options_pane = nautilus_preferences_box_add_pane (preference_box,
"Window Options",
"Window Options Something");
directory_views_pane = nautilus_preferences_box_add_pane (preference_box,
"Directory Views",
"Directory Views Something");
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (window_options_pane), "Basic window options");
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (directory_views_pane), "Window Behavior");
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (window_options_pane),
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (directory_views_pane),
0,
NAUTILUS_PREFERENCES_WINDOW_ALWAYS_NEW,
NAUTILUS_PREFERENCE_ITEM_BOOLEAN);
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (window_options_pane),
0,
NAUTILUS_PREFERENCES_WINDOW_SEARCH_EXISTING,
NAUTILUS_PREFERENCE_ITEM_BOOLEAN);
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (directory_views_pane), "Click Behavior");
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (directory_views_pane),
1,
NAUTILUS_PREFERENCES_CLICK_POLICY,
NAUTILUS_PREFERENCE_ITEM_ENUM);
/*
* Meta view pane
*/
......@@ -146,20 +148,6 @@ global_preferences_create_dialog (void)
NAUTILUS_PREFERENCES_META_VIEWS_SHOW_WEB_SEARCH,
NAUTILUS_PREFERENCE_ITEM_BOOLEAN);
/*
* Clicking pane
*/
icon_view_pane = nautilus_preferences_box_add_pane (preference_box,
"Click Policy",
"Click Policy something");
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (icon_view_pane), "Click Policy");
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (icon_view_pane),
0,
NAUTILUS_PREFERENCES_CLICK_POLICY,
NAUTILUS_PREFERENCE_ITEM_ENUM);
return prefs_dialog;
}
......@@ -232,16 +220,10 @@ global_preferences_register_for_ui ()
/* Window create new */
nautilus_preferences_set_info (NAUTILUS_PREFERENCES_WINDOW_ALWAYS_NEW,
"Create new window for each new page",
"Open each item in a new window",
NAUTILUS_PREFERENCE_BOOLEAN,
(gconstpointer) FALSE);
/* Window seatch existing */
nautilus_preferences_set_info (NAUTILUS_PREFERENCES_WINDOW_SEARCH_EXISTING,
"Do not open more than one window with the same page",
NAUTILUS_PREFERENCE_BOOLEAN,
(gconstpointer) FALSE);
/* Click activation type */
nautilus_preferences_set_info (NAUTILUS_PREFERENCES_CLICK_POLICY,
"Click policy",
......@@ -250,12 +232,12 @@ global_preferences_register_for_ui ()
nautilus_preferences_enum_add_entry (NAUTILUS_PREFERENCES_CLICK_POLICY,
"single",
"Single Click",
"Activate items with a single click",
NAUTILUS_CLICK_POLICY_SINGLE);
nautilus_preferences_enum_add_entry (NAUTILUS_PREFERENCES_CLICK_POLICY,
"double",
"Double Click",
"Activate items with a double click",
NAUTILUS_CLICK_POLICY_DOUBLE);
/* User level */
......
......@@ -33,7 +33,6 @@ BEGIN_GNOME_DECLS
/* Window options */
#define NAUTILUS_PREFERENCES_WINDOW_ALWAYS_NEW "/nautilus/preferences/window_always_new"
#define NAUTILUS_PREFERENCES_WINDOW_SEARCH_EXISTING "/nautilus/preferences/window_search_existing"
/* Show hidden files */
#define NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES "/nautilus/preferences/show_hidden_files"
......
......@@ -38,6 +38,7 @@
#include "nautilus-glib-extensions.h"
#include "nautilus-gdk-extensions.h"
#include "nautilus-gdk-pixbuf-extensions.h"
#include "nautilus-global-preferences.h"
#include "nautilus-gtk-macros.h"
#include "nautilus-gnome-extensions.h"
#include "nautilus-graphic-effects.h"
......@@ -560,6 +561,16 @@ gnome_icon_underline_text (GnomeIconTextInfo *text_info,
}
}
static gboolean
in_single_click_mode ()
{
/* Perhaps this should be computed elsewhere and passed in. */
return nautilus_preferences_get_enum
(NAUTILUS_PREFERENCES_CLICK_POLICY, NAUTILUS_CLICK_POLICY_SINGLE) ==
NAUTILUS_CLICK_POLICY_SINGLE;
}
/* Draw the text in a box, using gnomelib routines. */
static void
draw_or_measure_label_text (NautilusIconCanvasItem *item,
......@@ -666,8 +677,8 @@ draw_or_measure_label_text (NautilusIconCanvasItem *item,
GTK_JUSTIFY_CENTER);
}
/* if it's prelit, underline the text */
if (details->is_prelit) {
/* if it's prelit, and we're in click-to-activate mode, underline the text */
if (details->is_prelit && in_single_click_mode ()) {
gnome_icon_underline_text
(icon_text_info, drawable, gc,
text_left + 1, icon_bottom + height_so_far);
......
Supports Markdown
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