Add a stock icon to the "Add bookmark" button.

2003-11-03  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (create_shortcuts_tree): Add a stock
	icon to the "Add bookmark" button.

	* gtk/gtkfilesystemunix.c: Mark missing strings for translation.
	* gtk/gtkfilesystemmodel.c: Likewise.
	* gtk/gtkfilechooser.c: Likewise.
	* gtk/gtkfilechooserdefault.c: Likewise.

Mon Nov  3 20:56:28 2003  Matthias Clasen  <maclas@gmx.de>
This commit is contained in:
Federico Mena Quintero 2003-11-03 20:24:04 +00:00 committed by Federico Mena Quintero
parent b31a2ece5c
commit 3dbad630ac
9 changed files with 102 additions and 36 deletions

View File

@ -1,3 +1,13 @@
2003-11-03 Federico Mena Quintero <federico@ximian.com>
* gtk/gtkfilechooserdefault.c (create_shortcuts_tree): Add a stock
icon to the "Add bookmark" button.
* gtk/gtkfilesystemunix.c: Mark missing strings for translation.
* gtk/gtkfilesystemmodel.c: Likewise.
* gtk/gtkfilechooser.c: Likewise.
* gtk/gtkfilechooserdefault.c: Likewise.
Mon Nov 3 20:56:28 2003 Matthias Clasen <maclas@gmx.de>
* gdk/gdk.c:

View File

@ -1,3 +1,13 @@
2003-11-03 Federico Mena Quintero <federico@ximian.com>
* gtk/gtkfilechooserdefault.c (create_shortcuts_tree): Add a stock
icon to the "Add bookmark" button.
* gtk/gtkfilesystemunix.c: Mark missing strings for translation.
* gtk/gtkfilesystemmodel.c: Likewise.
* gtk/gtkfilechooser.c: Likewise.
* gtk/gtkfilechooserdefault.c: Likewise.
Mon Nov 3 20:56:28 2003 Matthias Clasen <maclas@gmx.de>
* gdk/gdk.c:

View File

@ -1,3 +1,13 @@
2003-11-03 Federico Mena Quintero <federico@ximian.com>
* gtk/gtkfilechooserdefault.c (create_shortcuts_tree): Add a stock
icon to the "Add bookmark" button.
* gtk/gtkfilesystemunix.c: Mark missing strings for translation.
* gtk/gtkfilesystemmodel.c: Likewise.
* gtk/gtkfilechooser.c: Likewise.
* gtk/gtkfilechooserdefault.c: Likewise.
Mon Nov 3 20:56:28 2003 Matthias Clasen <maclas@gmx.de>
* gdk/gdk.c:

View File

@ -1,3 +1,13 @@
2003-11-03 Federico Mena Quintero <federico@ximian.com>
* gtk/gtkfilechooserdefault.c (create_shortcuts_tree): Add a stock
icon to the "Add bookmark" button.
* gtk/gtkfilesystemunix.c: Mark missing strings for translation.
* gtk/gtkfilesystemmodel.c: Likewise.
* gtk/gtkfilechooser.c: Likewise.
* gtk/gtkfilechooserdefault.c: Likewise.
Mon Nov 3 20:56:28 2003 Matthias Clasen <maclas@gmx.de>
* gdk/gdk.c:

View File

@ -1,3 +1,13 @@
2003-11-03 Federico Mena Quintero <federico@ximian.com>
* gtk/gtkfilechooserdefault.c (create_shortcuts_tree): Add a stock
icon to the "Add bookmark" button.
* gtk/gtkfilesystemunix.c: Mark missing strings for translation.
* gtk/gtkfilesystemmodel.c: Likewise.
* gtk/gtkfilechooser.c: Likewise.
* gtk/gtkfilechooserdefault.c: Likewise.
Mon Nov 3 20:56:28 2003 Matthias Clasen <maclas@gmx.de>
* gdk/gdk.c:

View File

@ -21,10 +21,9 @@
#include "gtkfilechooser.h"
#include "gtkfilechooserprivate.h"
#include "gtkfilesystem.h"
#include "gtkintl.h"
#include "gtktypebuiltins.h"
#define _(str) (str)
static void gtk_file_chooser_class_init (gpointer g_iface);
static GtkFilePath *gtk_file_chooser_get_path (GtkFileChooser *chooser);
@ -1440,7 +1439,7 @@ gtk_file_chooser_add_shortcut_folder (GtkFileChooser *chooser,
g_set_error (error,
GTK_FILE_CHOOSER_ERROR,
GTK_FILE_CHOOSER_ERROR_BAD_FILENAME,
"Invalid filename: %s",
_("Invalid filename: %s"),
folder);
return FALSE;
}
@ -1484,7 +1483,7 @@ gtk_file_chooser_remove_shortcut_folder (GtkFileChooser *chooser,
g_set_error (error,
GTK_FILE_CHOOSER_ERROR,
GTK_FILE_CHOOSER_ERROR_BAD_FILENAME,
"Invalid filename: %s",
_("Invalid filename: %s"),
folder);
return FALSE;
}
@ -1559,7 +1558,7 @@ gtk_file_chooser_add_shortcut_folder_uri (GtkFileChooser *chooser,
g_set_error (error,
GTK_FILE_CHOOSER_ERROR,
GTK_FILE_CHOOSER_ERROR_BAD_FILENAME,
"Invalid filename: %s",
_("Invalid filename: %s"),
uri);
return FALSE;
}
@ -1603,7 +1602,7 @@ gtk_file_chooser_remove_shortcut_folder_uri (GtkFileChooser *chooser,
g_set_error (error,
GTK_FILE_CHOOSER_ERROR,
GTK_FILE_CHOOSER_ERROR_BAD_FILENAME,
"Invalid filename: %s",
_("Invalid filename: %s"),
uri);
return FALSE;
}

View File

@ -35,6 +35,7 @@
#include "gtkhpaned.h"
#include "gtkicontheme.h"
#include "gtkimage.h"
#include "gtkintl.h"
#include "gtklabel.h"
#include "gtkmenuitem.h"
#include "gtkmessagedialog.h"
@ -494,7 +495,7 @@ shortcuts_append_home (GtkFileChooserDefault *impl)
char *label;
name = g_get_user_name ();
label = g_strdup_printf ("%s's Home", name);
label = g_strdup_printf (_("%s's Home"), name);
home = g_get_home_dir ();
home_path = gtk_file_system_filename_to_path (impl->file_system, home);
@ -514,7 +515,7 @@ shortcuts_append_desktop (GtkFileChooserDefault *impl)
/* FIXME: What is the Right Way of finding the desktop directory? */
name = g_build_filename (g_get_home_dir (), "Desktop", NULL);
name = g_build_filename (g_get_home_dir (), _("Desktop"), NULL);
path = gtk_file_system_filename_to_path (impl->file_system, name);
g_free (name);
@ -640,7 +641,7 @@ toolbar_up_cb (GtkToolButton *button,
else
{
error_dialog (impl,
"Could not go to the parent folder:\n%s",
_("Could not go to the parent folder:\n%s"),
error);
g_error_free (error);
}
@ -709,7 +710,7 @@ create_filter (GtkFileChooserDefault *impl)
gtk_container_add (GTK_CONTAINER (impl->filter_alignment), hbox);
gtk_widget_show (hbox);
label = gtk_label_new_with_mnemonic ("Files of _type:");
label = gtk_label_new_with_mnemonic (_("Files of _type:"));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
@ -765,7 +766,7 @@ create_folder_tree (GtkFileChooserDefault *impl)
/* Column */
gtk_tree_view_insert_column_with_data_func (GTK_TREE_VIEW (impl->tree), 0,
"File name",
_("File name"),
gtk_cell_renderer_text_new (),
tree_name_data_func, impl, NULL);
gtk_tree_view_set_search_column (GTK_TREE_VIEW (impl->tree),
@ -868,6 +869,8 @@ create_shortcuts_tree (GtkFileChooserDefault *impl)
{
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *hbox2;
GtkWidget *widget;
GtkTreeSelection *selection;
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
@ -910,7 +913,7 @@ create_shortcuts_tree (GtkFileChooserDefault *impl)
/* Column */
column = gtk_tree_view_column_new ();
gtk_tree_view_column_set_title (column, "Folder");
gtk_tree_view_column_set_title (column, _("Folder"));
renderer = gtk_cell_renderer_pixbuf_new ();
gtk_tree_view_column_pack_start (column, renderer, FALSE);
@ -932,22 +935,34 @@ create_shortcuts_tree (GtkFileChooserDefault *impl)
gtk_box_pack_end (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
impl->add_bookmark_button = gtk_button_new_with_label ("Add bookmark");
/* "Add bookmark" */
impl->add_bookmark_button = gtk_button_new ();
hbox2 = gtk_hbox_new (FALSE, 2);
gtk_container_add (GTK_CONTAINER (impl->add_bookmark_button), hbox2);
widget = gtk_image_new_from_stock (GTK_STOCK_ADD, GTK_ICON_SIZE_BUTTON);
gtk_box_pack_start (GTK_BOX (hbox2), widget, FALSE, FALSE, 0);
widget = gtk_label_new (_("Add bookmark"));
gtk_box_pack_start (GTK_BOX (hbox2), widget, FALSE, FALSE, 0);
gtk_widget_show_all (impl->add_bookmark_button);
g_signal_connect (impl->add_bookmark_button, "clicked",
G_CALLBACK (add_bookmark_button_clicked_cb), impl);
gtk_box_pack_start (GTK_BOX (hbox), impl->add_bookmark_button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), impl->add_bookmark_button, FALSE, FALSE, 0);
gtk_widget_set_sensitive (impl->add_bookmark_button, FALSE);
gtk_widget_show (impl->add_bookmark_button);
/* "Remove bookmark" */
impl->remove_bookmark_button = gtk_button_new ();
g_signal_connect (impl->remove_bookmark_button, "clicked",
G_CALLBACK (remove_bookmark_button_clicked_cb), impl);
image = gtk_image_new_from_stock (GTK_STOCK_DELETE, GTK_ICON_SIZE_BUTTON);
gtk_container_add (GTK_CONTAINER (impl->remove_bookmark_button), image);
gtk_widget_show (image);
gtk_widget_set_sensitive (impl->remove_bookmark_button, FALSE);
gtk_box_pack_start (GTK_BOX (hbox), impl->remove_bookmark_button, FALSE, FALSE, 0);
gtk_widget_show (impl->remove_bookmark_button);
gtk_widget_show_all (impl->remove_bookmark_button);
return vbox;
}
@ -986,7 +1001,7 @@ create_file_list (GtkFileChooserDefault *impl)
/* Filename column */
column = gtk_tree_view_column_new ();
gtk_tree_view_column_set_title (column, "File name");
gtk_tree_view_column_set_title (column, _("File name"));
gtk_tree_view_column_set_sort_column_id (column, FILE_LIST_COL_NAME);
renderer = gtk_cell_renderer_pixbuf_new ();
@ -1004,7 +1019,7 @@ create_file_list (GtkFileChooserDefault *impl)
/* Size column */
column = gtk_tree_view_column_new ();
gtk_tree_view_column_set_title (column, "Size");
gtk_tree_view_column_set_title (column, _("Size"));
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_column_pack_start (column, renderer, TRUE);
@ -1016,7 +1031,7 @@ create_file_list (GtkFileChooserDefault *impl)
/* Modification time column */
column = gtk_tree_view_column_new ();
gtk_tree_view_column_set_title (column, "Modified");
gtk_tree_view_column_set_title (column, _("Modified"));
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_column_pack_start (column, renderer, TRUE);
@ -1037,7 +1052,7 @@ create_filename_entry (GtkFileChooserDefault *impl)
hbox = gtk_hbox_new (FALSE, 6);
gtk_widget_show (hbox);
label = gtk_label_new_with_mnemonic ("_Location:");
label = gtk_label_new_with_mnemonic (_("_Location:"));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
@ -1140,7 +1155,7 @@ gtk_file_chooser_default_constructor (GType type,
/* Preview */
impl->preview_frame = gtk_frame_new ("Preview");
impl->preview_frame = gtk_frame_new (_("Preview"));
gtk_table_attach (GTK_TABLE (table), impl->preview_frame,
1, 2, 0, 2,
0, GTK_EXPAND | GTK_FILL,
@ -1886,7 +1901,7 @@ gtk_file_chooser_default_remove_shortcut_folder (GtkFileChooser *chooser,
g_set_error (error,
GTK_FILE_CHOOSER_ERROR,
GTK_FILE_CHOOSER_ERROR_NONEXISTENT,
"shortcut %s does not exist",
_("shortcut %s does not exist"),
gtk_file_path_get_string (path));
return FALSE;
@ -2357,13 +2372,13 @@ list_size_data_func (GtkTreeViewColumn *tree_column,
return;
if (size < (gint64)1024)
str = g_strdup_printf ("%d bytes", (gint)size);
str = g_strdup_printf (_("%d bytes"), (gint)size);
else if (size < (gint64)1024*1024)
str = g_strdup_printf ("%.1f K", size / (1024.));
str = g_strdup_printf (_("%.1f K"), size / (1024.));
else if (size < (gint64)1024*1024*1024)
str = g_strdup_printf ("%.1f M", size / (1024.*1024.));
str = g_strdup_printf (_("%.1f M"), size / (1024.*1024.));
else
str = g_strdup_printf ("%.1f G", size / (1024.*1024.*1024.));
str = g_strdup_printf (_("%.1f G"), size / (1024.*1024.*1024.));
g_object_set (cell,
"text", str,
@ -2403,7 +2418,7 @@ list_mtime_data_func (GtkTreeViewColumn *tree_column,
if (tm.tm_mday == now_tm.tm_mday
&& tm.tm_mon == now_tm.tm_mon
&& tm.tm_year == now_tm.tm_year)
strcpy (buf, "Today");
strcpy (buf, _("Today"));
else
{
int i;
@ -2423,10 +2438,10 @@ list_mtime_data_func (GtkTreeViewColumn *tree_column,
&& tm.tm_year == then_tm.tm_year)
{
if (i == 1)
strcpy (buf, "Yesterday");
strcpy (buf, _("Yesterday"));
else
if (strftime (buf, sizeof (buf), "%A", &tm) == 0)
strcpy (buf, "Unknown");
strcpy (buf, _("Unknown"));
break;
}
@ -2436,8 +2451,8 @@ list_mtime_data_func (GtkTreeViewColumn *tree_column,
if (i == 7)
{
if (strftime (buf, sizeof (buf), "%d/%b/%Y", &tm) == 0)
strcpy (buf, "Unknown");
if (strftime (buf, sizeof (buf), _("%d/%b/%Y"), &tm) == 0)
strcpy (buf, _("Unknown"));
}
}

View File

@ -22,6 +22,7 @@
#include "gtkfilesystemmodel.h"
#include "gtkfilesystem.h"
#include "gtkintl.h"
#include "gtktreemodel.h"
typedef struct _GtkFileSystemModelClass GtkFileSystemModelClass;
@ -1013,7 +1014,7 @@ file_model_node_get_info (GtkFileSystemModel *model,
if (node->is_dummy)
{
node->info = gtk_file_info_new ();
gtk_file_info_set_display_name (node->info, "(Empty)");
gtk_file_info_set_display_name (node->info, _("(Empty)"));
}
else if (node->parent || model->root_folder)
{

View File

@ -20,6 +20,7 @@
#include "gtkfilesystem.h"
#include "gtkfilesystemunix.h"
#include "gtkintl.h"
#define XDG_PREFIX _gtk_xdg
#include "xdgmime/xdgmime.h"
@ -295,7 +296,7 @@ gtk_file_system_unix_create_folder (GtkFileSystem *file_system,
g_set_error (error,
GTK_FILE_SYSTEM_ERROR,
GTK_FILE_SYSTEM_ERROR_NONEXISTENT,
"error creating directory '%s': %s",
_("error creating directory '%s': %s"),
filename_utf8 ? filename_utf8 : "???",
g_strerror (errno));
g_free (filename_utf8);
@ -553,7 +554,7 @@ gtk_file_system_unix_add_bookmark (GtkFileSystem *file_system,
g_set_error (error,
GTK_FILE_SYSTEM_ERROR,
GTK_FILE_SYSTEM_ERROR_FAILED,
"This file system does not support bookmarks");
_("This file system does not support bookmarks"));
return FALSE;
}
@ -566,7 +567,7 @@ gtk_file_system_unix_remove_bookmark (GtkFileSystem *file_system,
g_set_error (error,
GTK_FILE_SYSTEM_ERROR,
GTK_FILE_SYSTEM_ERROR_FAILED,
"This file system does not support bookmarks");
_("This file system does not support bookmarks"));
return FALSE;
}
@ -737,7 +738,7 @@ filename_get_info (const gchar *filename,
g_set_error (error,
GTK_FILE_SYSTEM_ERROR,
GTK_FILE_SYSTEM_ERROR_NONEXISTENT,
"error getting information for '%s': %s",
_("error getting information for '%s': %s"),
filename_utf8 ? filename_utf8 : "???",
g_strerror (errno));
g_free (filename_utf8);