Skip to content
This repository has been archived by the owner on Oct 16, 2022. It is now read-only.

Commit

Permalink
#225 Fixed: Filters: 'Cancel' button when adding a folder does not work.
Browse files Browse the repository at this point in the history
  • Loading branch information
teejee2008 committed Jun 24, 2018
1 parent b260c8d commit 6ab93e4
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/Gtk/ExcludeBox.vala
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,8 @@ class ExcludeBox : Gtk.Box{
}

private SList<string> browse_files(){

var list = new SList<string>();

var dialog = new Gtk.FileChooserDialog(
_("Select file(s)"), parent_window,
Expand All @@ -412,14 +414,20 @@ class ExcludeBox : Gtk.Box{
dialog.set_modal (true);
dialog.set_select_multiple (true);

dialog.run();
var list = dialog.get_filenames();
dialog.destroy ();
var resp = dialog.run();

if (resp != Gtk.ResponseType.CANCEL){
list = dialog.get_filenames();
}

dialog.destroy();

return list;
}

private SList<string> browse_folder(){

var list = new SList<string>();

var dialog = new Gtk.FileChooserDialog(
_("Select directory"), parent_window,
Expand All @@ -433,9 +441,13 @@ class ExcludeBox : Gtk.Box{
dialog.set_modal (true);
dialog.set_select_multiple (false);

dialog.run();
var list = dialog.get_filenames();
dialog.destroy ();
var resp = dialog.run();

if (resp != Gtk.ResponseType.CANCEL){
list = dialog.get_filenames();
}

dialog.destroy();

return list;
}
Expand Down

0 comments on commit 6ab93e4

Please sign in to comment.