summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Sullivan <sullivan@src.gnome.org>2001-04-05 00:31:41 +0000
committerJohn Sullivan <sullivan@src.gnome.org>2001-04-05 00:31:41 +0000
commitece4f90ba31992651faf6694eb9fd35d6c0c0edf (patch)
treecb20692293f6ec52e9721fa497500d212aeede76
parentb5e86e9692e9858a677fc2f478d51090103978ee (diff)
downloadnautilus-ece4f90ba31992651faf6694eb9fd35d6c0c0edf.tar.gz
Various little tweaky cleanups.
* src/nautilus-property-browser.c: (nautilus_property_browser_initialize), (nautilus_emblem_dialog_new), (nautilus_color_selection_dialog_new), (nautilus_property_browser_update_contents): * src/nautilus-sidebar.c: (nautilus_sidebar_initialize_class), (nautilus_sidebar_update_buttons): * src/nautilus-theme-selector.c: (nautilus_theme_selector_initialize), (exit_remove_mode): Changed code that was making buttons wider by using bracketing spaces (e.g. " Done ") to set the button padding instead. Simplified some places that were unnecessarily creating button labels explicitly to instead just use gtk_button_new_with_label. Added a few ellipses in button labels that needed them. Made the "Empty Trash" button in the sidebar check the preference to decide whether to use ellipses or not.
-rw-r--r--ChangeLog22
-rw-r--r--src/nautilus-information-panel.c10
-rw-r--r--src/nautilus-property-browser.c57
-rw-r--r--src/nautilus-sidebar.c10
-rw-r--r--src/nautilus-theme-selector.c32
5 files changed, 80 insertions, 51 deletions
diff --git a/ChangeLog b/ChangeLog
index cb5a079fe..2b639c75b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2001-04-04 John Sullivan <sullivan@eazel.com>
+
+ Various little tweaky cleanups.
+
+ * src/nautilus-property-browser.c:
+ (nautilus_property_browser_initialize),
+ (nautilus_emblem_dialog_new),
+ (nautilus_color_selection_dialog_new),
+ (nautilus_property_browser_update_contents):
+ * src/nautilus-sidebar.c: (nautilus_sidebar_initialize_class),
+ (nautilus_sidebar_update_buttons):
+ * src/nautilus-theme-selector.c:
+ (nautilus_theme_selector_initialize), (exit_remove_mode):
+ Changed code that was making buttons wider by using
+ bracketing spaces (e.g. " Done ") to set the button
+ padding instead. Simplified some places that were unnecessarily
+ creating button labels explicitly to instead just use
+ gtk_button_new_with_label. Added a few ellipses in button
+ labels that needed them. Made the "Empty Trash" button in
+ the sidebar check the preference to decide whether to use
+ ellipses or not.
+
2001-04-04 John Harper <jsh@eazel.com>
Fixed bug 7950 (After running First-Time Druid there are two
diff --git a/src/nautilus-information-panel.c b/src/nautilus-information-panel.c
index e6b335857..80c98140a 100644
--- a/src/nautilus-information-panel.c
+++ b/src/nautilus-information-panel.c
@@ -159,6 +159,8 @@ typedef enum {
TABS_PART
} SidebarPart;
+static gboolean confirm_trash_auto_value;
+
EEL_DEFINE_CLASS_BOILERPLATE (NautilusSidebar, nautilus_sidebar, GTK_TYPE_EVENT_BOX)
@@ -194,6 +196,9 @@ nautilus_sidebar_initialize_class (GtkObjectClass *object_klass)
GTK_TYPE_NONE, 1, GTK_TYPE_STRING);
gtk_object_class_add_signals (object_klass, signals, LAST_SIGNAL);
+
+ nautilus_preferences_add_auto_boolean (NAUTILUS_PREFERENCES_CONFIRM_TRASH,
+ &confirm_trash_auto_value);
}
/* utility routine to allocate the box the holds the command buttons */
@@ -1421,7 +1426,10 @@ nautilus_sidebar_update_buttons (NautilusSidebar *sidebar)
* need a framework to allow protocols to add commands buttons */
if (eel_istr_has_prefix (sidebar->details->uri, "trash:")) {
/* FIXME: We don't use spaces to pad labels! */
- temp_button = gtk_button_new_with_label (_(" Empty Trash "));
+ temp_button = gtk_button_new_with_label (confirm_trash_auto_value
+ ? _("Empty Trash...")
+ : _("Empty Trash"));
+ eel_gtk_button_set_standard_padding (GTK_BUTTON (temp_button));
gtk_box_pack_start (GTK_BOX (sidebar->details->button_box),
temp_button, FALSE, FALSE, 0);
gtk_widget_set_sensitive (temp_button, !nautilus_trash_monitor_is_empty ());
diff --git a/src/nautilus-property-browser.c b/src/nautilus-property-browser.c
index 57274812f..f4c649c05 100644
--- a/src/nautilus-property-browser.c
+++ b/src/nautilus-property-browser.c
@@ -240,7 +240,7 @@ nautilus_property_browser_initialize (GtkObject *object)
{
NautilusPropertyBrowser *property_browser;
GtkWidget* widget, *temp_box, *temp_hbox, *temp_frame;
- GtkWidget* temp_button, *temp_label;
+ GtkWidget* temp_button;
GtkWidget *viewport;
char *temp_str;
@@ -291,7 +291,7 @@ nautilus_property_browser_initialize (GtkObject *object)
/* allocate a table to hold the category selector */
property_browser->details->category_box = gtk_vbox_new (FALSE, 0);
- gtk_container_set_border_width ( GTK_CONTAINER (property_browser->details->category_box), 4);
+ gtk_container_set_border_width ( GTK_CONTAINER (property_browser->details->category_box), GNOME_PAD_SMALL);
gtk_container_add(GTK_CONTAINER(viewport), property_browser->details->category_box);
gtk_container_add (GTK_CONTAINER (property_browser->details->category_container), viewport);
gtk_widget_show (GTK_WIDGET (property_browser->details->category_box));
@@ -319,7 +319,7 @@ nautilus_property_browser_initialize (GtkObject *object)
temp_hbox = gtk_hbox_new(FALSE, 0);
gtk_widget_show(temp_hbox);
- gtk_container_set_border_width (GTK_CONTAINER (temp_hbox), 4);
+ gtk_container_set_border_width (GTK_CONTAINER (temp_hbox), GNOME_PAD_SMALL);
gtk_container_add(GTK_CONTAINER(temp_frame), temp_hbox);
@@ -349,33 +349,29 @@ nautilus_property_browser_initialize (GtkObject *object)
property_browser->details->bottom_box = gtk_hbox_new (FALSE, 0);
gtk_widget_show (property_browser->details->bottom_box);
- gtk_container_set_border_width (GTK_CONTAINER (property_browser->details->bottom_box), 4);
+ gtk_container_set_border_width (GTK_CONTAINER (property_browser->details->bottom_box), GNOME_PAD_SMALL);
gtk_box_pack_end (GTK_BOX(property_browser->details->content_container), temp_box, FALSE, FALSE, 0);
gtk_container_add (GTK_CONTAINER (temp_frame), property_browser->details->bottom_box);
/* create the "done" button */
- temp_button = gtk_button_new ();
+ temp_button = gtk_button_new_with_label (_("Done"));
+ eel_gtk_button_set_padding (GTK_BUTTON (temp_button), GNOME_PAD_SMALL);
gtk_widget_show(temp_button);
-
- /* FIXME: Using spaces to add padding is not good design. */
- temp_label = gtk_label_new (_(" Done "));
- gtk_widget_show(temp_label);
- gtk_container_add (GTK_CONTAINER(temp_button), temp_label);
- gtk_box_pack_end (GTK_BOX(property_browser->details->bottom_box), temp_button, FALSE, FALSE, 4);
+ gtk_box_pack_end (GTK_BOX(property_browser->details->bottom_box), temp_button, FALSE, FALSE, GNOME_PAD_SMALL);
gtk_signal_connect(GTK_OBJECT (temp_button), "clicked", GTK_SIGNAL_FUNC (done_button_callback), property_browser);
/* create the "add new" button */
property_browser->details->add_button = gtk_button_new ();
gtk_widget_show(property_browser->details->add_button);
- /* FIXME: Using spaces to add padding is not good design. */
- property_browser->details->add_button_label = gtk_label_new (_(" Add new... "));
+ property_browser->details->add_button_label = gtk_label_new (_("Add new..."));
gtk_widget_show(property_browser->details->add_button_label);
gtk_container_add (GTK_CONTAINER(property_browser->details->add_button),
property_browser->details->add_button_label);
+ eel_gtk_button_set_padding (GTK_BUTTON (property_browser->details->add_button), GNOME_PAD_SMALL);
gtk_box_pack_end (GTK_BOX(property_browser->details->bottom_box),
- property_browser->details->add_button, FALSE, FALSE, 4);
+ property_browser->details->add_button, FALSE, FALSE, GNOME_PAD_SMALL);
gtk_signal_connect(GTK_OBJECT (property_browser->details->add_button), "clicked",
add_new_button_callback, property_browser);
@@ -385,15 +381,16 @@ nautilus_property_browser_initialize (GtkObject *object)
gtk_widget_show(property_browser->details->remove_button);
/* FIXME: Using spaces to add padding is not good design. */
- property_browser->details->remove_button_label = gtk_label_new (_(" Remove... "));
+ property_browser->details->remove_button_label = gtk_label_new (_("Remove..."));
gtk_widget_show(property_browser->details->remove_button_label);
gtk_container_add (GTK_CONTAINER(property_browser->details->remove_button),
property_browser->details->remove_button_label);
+ eel_gtk_button_set_padding (GTK_BUTTON (property_browser->details->remove_button), GNOME_PAD_SMALL);
gtk_box_pack_end (GTK_BOX (property_browser->details->bottom_box),
property_browser->details->remove_button,
FALSE,
FALSE,
- 4);
+ GNOME_PAD_SMALL);
gtk_signal_connect (GTK_OBJECT (property_browser->details->remove_button),
"clicked",
@@ -948,11 +945,11 @@ nautilus_emblem_dialog_new (NautilusPropertyBrowser *property_browser)
widget = gtk_label_new(_("Keyword:"));
gtk_widget_show(widget);
- gtk_table_attach(GTK_TABLE(table), widget, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 4, 4);
+ gtk_table_attach(GTK_TABLE(table), widget, 0, 1, 0, 1, GTK_FILL, GTK_FILL, GNOME_PAD_SMALL, GNOME_PAD_SMALL);
property_browser->details->keyword = gtk_entry_new_with_max_length (24);
gtk_widget_show(property_browser->details->keyword);
- gtk_table_attach(GTK_TABLE(table), property_browser->details->keyword, 1, 2, 0, 1, GTK_FILL, GTK_FILL, 4, 4);
+ gtk_table_attach(GTK_TABLE(table), property_browser->details->keyword, 1, 2, 0, 1, GTK_FILL, GTK_FILL, GNOME_PAD_SMALL, GNOME_PAD_SMALL);
/* default image is the generic emblem */
g_free(property_browser->details->image_path);
@@ -961,7 +958,7 @@ nautilus_emblem_dialog_new (NautilusPropertyBrowser *property_browser)
/* set up a gnome icon entry to pick the image file */
widget = gtk_label_new(_("Image:"));
gtk_widget_show(widget);
- gtk_table_attach(GTK_TABLE(table), widget, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 4, 4);
+ gtk_table_attach(GTK_TABLE(table), widget, 0, 1, 1, 2, GTK_FILL, GTK_FILL, GNOME_PAD_SMALL, GNOME_PAD_SMALL);
property_browser->details->file_entry = gnome_icon_entry_new (NULL, _("Select an image file for the new emblem:"));
gnome_icon_entry_set_pixmap_subdir (GNOME_ICON_ENTRY(property_browser->details->file_entry),
@@ -970,7 +967,7 @@ nautilus_emblem_dialog_new (NautilusPropertyBrowser *property_browser)
property_browser->details->image_path);
gtk_widget_show(property_browser->details->file_entry);
- gtk_table_attach(GTK_TABLE(table), property_browser->details->file_entry, 1, 2, 1, 2, GTK_FILL, GTK_FILL, 4, 4);
+ gtk_table_attach(GTK_TABLE(table), property_browser->details->file_entry, 1, 2, 1, 2, GTK_FILL, GTK_FILL, GNOME_PAD_SMALL, GNOME_PAD_SMALL);
entry = gnome_icon_entry_gtk_entry (GNOME_ICON_ENTRY(property_browser->details->file_entry));
gtk_entry_set_text(GTK_ENTRY(entry), property_browser->details->image_path);
@@ -997,25 +994,25 @@ nautilus_color_selection_dialog_new (NautilusPropertyBrowser *property_browser)
widget = gtk_label_new(_("Color name:"));
gtk_widget_show(widget);
- gtk_table_attach(GTK_TABLE(table), widget, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 4, 4);
+ gtk_table_attach(GTK_TABLE(table), widget, 0, 1, 0, 1, GTK_FILL, GTK_FILL, GNOME_PAD_SMALL, GNOME_PAD_SMALL);
property_browser->details->color_name = gtk_entry_new_with_max_length (24);
gtk_widget_show(property_browser->details->color_name);
- gtk_table_attach(GTK_TABLE(table), property_browser->details->color_name, 1, 2, 0, 1, GTK_FILL, GTK_FILL, 4, 4);
+ gtk_table_attach(GTK_TABLE(table), property_browser->details->color_name, 1, 2, 0, 1, GTK_FILL, GTK_FILL, GNOME_PAD_SMALL, GNOME_PAD_SMALL);
/* default image is the generic emblem */
g_free(property_browser->details->image_path);
widget = gtk_label_new(_("Color value:"));
gtk_widget_show(widget);
- gtk_table_attach(GTK_TABLE(table), widget, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 4, 4);
+ gtk_table_attach(GTK_TABLE(table), widget, 0, 1, 1, 2, GTK_FILL, GTK_FILL, GNOME_PAD_SMALL, GNOME_PAD_SMALL);
/* set up a gnome file entry to pick the image file */
property_browser->details->color_picker = gnome_color_picker_new ();
gtk_widget_show (property_browser->details->color_picker);
gtk_widget_show(property_browser->details->color_picker);
- gtk_table_attach(GTK_TABLE(table), property_browser->details->color_picker, 1, 2, 1, 2, GTK_FILL, GTK_FILL, 4, 4);
+ gtk_table_attach(GTK_TABLE(table), property_browser->details->color_picker, 1, 2, 1, 2, GTK_FILL, GTK_FILL, GNOME_PAD_SMALL, GNOME_PAD_SMALL);
/* install the table in the dialog */
@@ -2034,13 +2031,13 @@ nautilus_property_browser_update_contents (NautilusPropertyBrowser *property_bro
/* FIXME: Using spaces to add padding is not good design. */
switch (property_browser->details->category_type) {
case NAUTILUS_PROPERTY_PATTERN:
- text = _(" Add a New Pattern ");
+ text = _("Add a New Pattern...");
break;
case NAUTILUS_PROPERTY_COLOR:
- text = _(" Add a New Color ");
+ text = _("Add a New Color...");
break;
case NAUTILUS_PROPERTY_EMBLEM:
- text = _(" Add a New Emblem ");
+ text = _("Add a New Emblem...");
break;
default:
text = NULL;
@@ -2103,13 +2100,13 @@ nautilus_property_browser_update_contents (NautilusPropertyBrowser *property_bro
/* FIXME: Using spaces to add padding is not good design. */
switch (property_browser->details->category_type) {
case NAUTILUS_PROPERTY_PATTERN:
- text = _(" Remove a Pattern ");
+ text = _("Remove a Pattern...");
break;
case NAUTILUS_PROPERTY_COLOR:
- text = _(" Remove a Color ");
+ text = _("Remove a Color...");
break;
case NAUTILUS_PROPERTY_EMBLEM:
- text = _(" Remove an Emblem ");
+ text = _("Remove an Emblem...");
break;
default:
text = NULL;
diff --git a/src/nautilus-sidebar.c b/src/nautilus-sidebar.c
index e6b335857..80c98140a 100644
--- a/src/nautilus-sidebar.c
+++ b/src/nautilus-sidebar.c
@@ -159,6 +159,8 @@ typedef enum {
TABS_PART
} SidebarPart;
+static gboolean confirm_trash_auto_value;
+
EEL_DEFINE_CLASS_BOILERPLATE (NautilusSidebar, nautilus_sidebar, GTK_TYPE_EVENT_BOX)
@@ -194,6 +196,9 @@ nautilus_sidebar_initialize_class (GtkObjectClass *object_klass)
GTK_TYPE_NONE, 1, GTK_TYPE_STRING);
gtk_object_class_add_signals (object_klass, signals, LAST_SIGNAL);
+
+ nautilus_preferences_add_auto_boolean (NAUTILUS_PREFERENCES_CONFIRM_TRASH,
+ &confirm_trash_auto_value);
}
/* utility routine to allocate the box the holds the command buttons */
@@ -1421,7 +1426,10 @@ nautilus_sidebar_update_buttons (NautilusSidebar *sidebar)
* need a framework to allow protocols to add commands buttons */
if (eel_istr_has_prefix (sidebar->details->uri, "trash:")) {
/* FIXME: We don't use spaces to pad labels! */
- temp_button = gtk_button_new_with_label (_(" Empty Trash "));
+ temp_button = gtk_button_new_with_label (confirm_trash_auto_value
+ ? _("Empty Trash...")
+ : _("Empty Trash"));
+ eel_gtk_button_set_standard_padding (GTK_BUTTON (temp_button));
gtk_box_pack_start (GTK_BOX (sidebar->details->button_box),
temp_button, FALSE, FALSE, 0);
gtk_widget_set_sensitive (temp_button, !nautilus_trash_monitor_is_empty ());
diff --git a/src/nautilus-theme-selector.c b/src/nautilus-theme-selector.c
index de1d55fb2..bb6410c52 100644
--- a/src/nautilus-theme-selector.c
+++ b/src/nautilus-theme-selector.c
@@ -56,6 +56,7 @@
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-util.h>
+#include <libgnomeui/gnome-uidefs.h>
#include <libgnomevfs/gnome-vfs-file-info.h>
#include <libgnomevfs/gnome-vfs-types.h>
#include <libgnomevfs/gnome-vfs-uri.h>
@@ -79,7 +80,6 @@ struct NautilusThemeSelectorDetails {
GtkWidget *add_button;
GtkWidget *add_button_label;
GtkWidget *remove_button;
- GtkWidget *remove_button_label;
GdkColor main_row_color;
GdkColor alt_row_color;
@@ -154,7 +154,7 @@ nautilus_theme_selector_initialize (GtkObject *object)
GtkWidget* widget, *temp_hbox;
GtkWidget *scrollwindow;
GtkWidget *bottom_box;
- GtkWidget *temp_button, *temp_label;
+ GtkWidget *temp_button;
theme_selector = NAUTILUS_THEME_SELECTOR (object);
widget = GTK_WIDGET (object);
@@ -236,42 +236,36 @@ nautilus_theme_selector_initialize (GtkObject *object)
bottom_box = gtk_hbox_new (FALSE, 0);
gtk_widget_show (bottom_box);
- gtk_container_set_border_width (GTK_CONTAINER (bottom_box), 4);
+ gtk_container_set_border_width (GTK_CONTAINER (bottom_box), GNOME_PAD_SMALL);
gtk_box_pack_end (GTK_BOX(theme_selector->details->container), bottom_box, FALSE, FALSE, 0);
/* create the done button */
- temp_button = gtk_button_new ();
+ temp_button = gtk_button_new_with_label (_("Done"));
+ eel_gtk_button_set_padding (GTK_BUTTON (temp_button), GNOME_PAD_SMALL);
gtk_widget_show(temp_button);
- /* FIXME: Using spaces to add padding is not good design. */
- temp_label = gtk_label_new (_(" Done "));
- gtk_widget_show(temp_label);
- gtk_container_add (GTK_CONTAINER(temp_button), temp_label);
- gtk_box_pack_end (GTK_BOX(bottom_box), temp_button, FALSE, FALSE, 4);
+ gtk_box_pack_end (GTK_BOX(bottom_box), temp_button, FALSE, FALSE, GNOME_PAD_SMALL);
gtk_signal_connect(GTK_OBJECT (temp_button), "clicked", GTK_SIGNAL_FUNC (done_button_callback), theme_selector);
/* create the "add new" button */
theme_selector->details->add_button = gtk_button_new ();
gtk_widget_show(theme_selector->details->add_button);
- /* FIXME: Using spaces to add padding is not good design. */
- theme_selector->details->add_button_label = gtk_label_new (_(" Add New Theme "));
+ theme_selector->details->add_button_label = gtk_label_new (_("Add New Theme..."));
gtk_widget_show(theme_selector->details->add_button_label);
gtk_container_add (GTK_CONTAINER(theme_selector->details->add_button), theme_selector->details->add_button_label);
- gtk_box_pack_end (GTK_BOX (bottom_box), theme_selector->details->add_button, FALSE, FALSE, 4);
+ eel_gtk_button_set_padding (GTK_BUTTON (theme_selector->details->add_button), GNOME_PAD_SMALL);
+ gtk_box_pack_end (GTK_BOX (bottom_box), theme_selector->details->add_button, FALSE, FALSE, GNOME_PAD_SMALL);
gtk_signal_connect(GTK_OBJECT (theme_selector->details->add_button), "clicked", GTK_SIGNAL_FUNC (add_new_theme_button_callback), theme_selector);
/* now create the "remove" button */
- theme_selector->details->remove_button = gtk_button_new();
- /* FIXME: Using spaces to add padding is not good design. */
- theme_selector->details->remove_button_label = gtk_label_new (_(" Remove Theme "));
- gtk_widget_show(theme_selector->details->remove_button_label);
- gtk_container_add (GTK_CONTAINER(theme_selector->details->remove_button), theme_selector->details->remove_button_label);
+ theme_selector->details->remove_button = gtk_button_new_with_label (_("Remove Theme..."));
+ eel_gtk_button_set_padding (GTK_BUTTON (theme_selector->details->remove_button), GNOME_PAD_SMALL);
gtk_box_pack_end (GTK_BOX (bottom_box),
theme_selector->details->remove_button,
FALSE,
FALSE,
- 4);
+ GNOME_PAD_SMALL);
gtk_signal_connect (GTK_OBJECT (theme_selector->details->remove_button),
"clicked",
@@ -534,7 +528,7 @@ exit_remove_mode (NautilusThemeSelector *theme_selector)
set_help_label (theme_selector, FALSE);
/* change the add button label back to it's normal state */
- gtk_label_set_text (GTK_LABEL (theme_selector->details->add_button_label), _("Add New Theme"));
+ gtk_label_set_text (GTK_LABEL (theme_selector->details->add_button_label), _("Add New Theme..."));
populate_list_with_themes (theme_selector);
}