commit 22e0870e107cc11d57e47843d244befce155ef4f
parent 4dbd069185cc8c671bbd348615461f1b8f28b4ba
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date: Tue, 18 May 2010 19:54:59 +1000
Show the name of open file in the title (issue 5)
Diffstat:
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/spek-window.vala b/src/spek-window.vala
@@ -97,11 +97,18 @@ namespace Spek {
show_all ();
if (file_name != null) {
- cur_dir = Path.get_dirname (file_name);
- spectrogram.open (file_name);
+ open_file (file_name);
}
}
+ private void open_file (string file_name) {
+ cur_dir = Path.get_dirname (file_name);
+ spectrogram.open (file_name);
+
+ // Note to translators: window title, %s is replaced with the file name
+ title = _("Spek - %s").printf (Path.get_basename (file_name));
+ }
+
private void on_open_clicked () {
var chooser = new FileChooserDialog (
_("Open File"), this, FileChooserAction.OPEN,
@@ -114,9 +121,7 @@ namespace Spek {
chooser.add_filter (filter_audio);
chooser.set_filter (filter_audio);
if (chooser.run () == ResponseType.ACCEPT) {
- var file_name = chooser.get_filename ();
- cur_dir = Path.get_dirname (file_name);
- spectrogram.open (file_name);
+ open_file (chooser.get_filename ());
}
chooser.destroy ();
}