mirror of
https://github.com/alexkay/spek.git
synced 2025-04-19 18:07:37 +03:00
Show the name of open file in the title (issue 5)
This commit is contained in:
parent
4dbd069185
commit
22e0870e10
@ -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 ();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user