summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-25 00:53:58 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-25 00:53:58 +0000
commit511ebb94c4cdb6c8ef345945ae12d232d51cb901 (patch)
treec1186ac64b5409159f6b905621e1354fa6cf37cb
parent0ee508a026ccca02c64da906773a0ebc88048f6c (diff)
downloadchromium_src-511ebb94c4cdb6c8ef345945ae12d232d51cb901.zip
chromium_src-511ebb94c4cdb6c8ef345945ae12d232d51cb901.tar.gz
chromium_src-511ebb94c4cdb6c8ef345945ae12d232d51cb901.tar.bz2
Make some default file dialog titles for linux.
Seems Windows only lets you set some text inside the dialog above the tree view, and not in the titlebar. BUG=16890 TEST=should be obvious Review URL: http://codereview.chromium.org/159326 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21600 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/generated_resources.grd16
-rw-r--r--chrome/browser/gtk/dialogs_gtk.cc15
-rw-r--r--chrome/browser/gtk/options/advanced_contents_gtk.cc6
3 files changed, 29 insertions, 8 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 4e03557..1c35f17 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -3193,9 +3193,12 @@ each locale. -->
<message name="IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_BUTTON" desc="The label of the 'Browse...' button">
Br&amp;owse...
</message>
- <message name="IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_TITLE" desc="In the 'Browse For Folder' dialog, this is the text that appears above the directory selector.">
+ <message name="IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_TITLE" desc="In the 'Browse For Folder' dialog on Windows, this is the text that appears above the directory selector.">
Download location:
</message>
+ <message name="IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_WINDOW_TITLE" desc="In the 'Browse For Folder' dialog on Linux, this is the text that appears in the window's title bar.">
+ Download Location
+ </message>
<message name="IDS_OPTIONS_DOWNLOADLOCATION_ASKFORSAVELOCATION" desc="The 'Ask for save location before downloading' checkbox label">
Ask where to save each file before downloading
</message>
@@ -4231,6 +4234,17 @@ each locale. -->
</message> <!-- os == 'darwin' -->
</if>
+ <!-- File chooser dialog default titles (only used on Linux) -->
+ <message name="IDS_SAVE_AS_DIALOG_TITLE" desc="The default title for the Save As file chooser dialog.">
+ Save File
+ </message>
+ <message name="IDS_OPEN_FILE_DIALOG_TITLE" desc="The default title for the Open File file chooser dialog (single file).">
+ Open File
+ </message>
+ <message name="IDS_OPEN_FILES_DIALOG_TITLE" desc="The default title for the Open File file chooser dialog (multiple files).">
+ Open Files
+ </message>
+
</messages>
</release>
</grit>
diff --git a/chrome/browser/gtk/dialogs_gtk.cc b/chrome/browser/gtk/dialogs_gtk.cc
index 1283d4d..c3f8bf7 100644
--- a/chrome/browser/gtk/dialogs_gtk.cc
+++ b/chrome/browser/gtk/dialogs_gtk.cc
@@ -303,9 +303,12 @@ void SelectFileDialogImpl::FileNotSelected(GtkWidget* dialog) {
GtkWidget* SelectFileDialogImpl::CreateFileOpenDialog(const std::string& title,
gfx::NativeWindow parent) {
+ std::string title_string = !title.empty() ? title :
+ l10n_util::GetStringUTF8(IDS_OPEN_FILE_DIALOG_TITLE);
+
// TODO(estade): do we want to set the open directory to some sort of default?
GtkWidget* dialog =
- gtk_file_chooser_dialog_new(title.c_str(), parent,
+ gtk_file_chooser_dialog_new(title_string.c_str(), parent,
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
@@ -324,9 +327,12 @@ GtkWidget* SelectFileDialogImpl::CreateFileOpenDialog(const std::string& title,
GtkWidget* SelectFileDialogImpl::CreateMultiFileOpenDialog(
const std::string& title, gfx::NativeWindow parent) {
+ std::string title_string = !title.empty() ? title :
+ l10n_util::GetStringUTF8(IDS_OPEN_FILES_DIALOG_TITLE);
+
// TODO(estade): do we want to set the open directory to some sort of default?
GtkWidget* dialog =
- gtk_file_chooser_dialog_new(title.c_str(), parent,
+ gtk_file_chooser_dialog_new(title_string.c_str(), parent,
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
@@ -345,8 +351,11 @@ GtkWidget* SelectFileDialogImpl::CreateMultiFileOpenDialog(
GtkWidget* SelectFileDialogImpl::CreateSaveAsDialog(const std::string& title,
const FilePath& default_path, gfx::NativeWindow parent) {
+ std::string title_string = !title.empty() ? title :
+ l10n_util::GetStringUTF8(IDS_SAVE_AS_DIALOG_TITLE);
+
GtkWidget* dialog =
- gtk_file_chooser_dialog_new(title.c_str(), parent,
+ gtk_file_chooser_dialog_new(title_string.c_str(), parent,
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
diff --git a/chrome/browser/gtk/options/advanced_contents_gtk.cc b/chrome/browser/gtk/options/advanced_contents_gtk.cc
index fdae7b7..23be335 100644
--- a/chrome/browser/gtk/options/advanced_contents_gtk.cc
+++ b/chrome/browser/gtk/options/advanced_contents_gtk.cc
@@ -112,10 +112,8 @@ DownloadSection::DownloadSection(Profile* profile)
// Download location options.
download_location_button_ = gtk_file_chooser_button_new(
- // TODO(mattm): There doesn't seem to be a reasonable localized string for
- // the chooser title? (Though no other file choosers have a title either,
- // bug 16890.)
- "",
+ l10n_util::GetStringUTF8(
+ IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_WINDOW_TITLE).c_str(),
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
g_signal_connect(download_location_button_, "selection-changed",
G_CALLBACK(OnDownloadLocationChanged), this);