The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Fix overwrite dialog

These changes was commited to the Birdfont repository Tue, 03 Nov 2015 20:00:36 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Tue, 03 Nov 2015 20:00:36 +0000 (21:00 +0100)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Tue, 03 Nov 2015 20:00:36 +0000 (21:00 +0100)
commit bb3aab6a43542acf9f0e4fe80b2b9c3c0ac7444f
tree 4cb890ae6a9897ab1a66cd9e15a94ce3a15ba645
parent ec47384c91e7b5a12bc7aa5e2ec2b94ff810f625
Fix overwrite dialog

libbirdfont/OverwriteBfFile.vala
libbirdfont/QuestionDialog.vala
libbirdfont/SaveCallback.vala
--- a/libbirdfont/OverwriteBfFile.vala +++ b/libbirdfont/OverwriteBfFile.vala @@ -26,16 +26,19 @@ replace = new Button (t_("Replace")); replace.action.connect (() => { - save_callback.save (); MainWindow.hide_dialog (); + save_callback.save (); }); + add_button (replace); cancel = new Button (t_("Cancel")); cancel.action.connect (() => { + save_callback.is_done = true; MainWindow.hide_dialog (); }); + add_button (cancel); } } }
--- a/libbirdfont/QuestionDialog.vala +++ b/libbirdfont/QuestionDialog.vala @@ -35,6 +35,8 @@ question.set_text (message); this.height = height; + + buttons = new Gee.ArrayList<Button> (); } public void add_button (Button button) {
--- a/libbirdfont/SaveCallback.vala +++ b/libbirdfont/SaveCallback.vala @@ -45,8 +45,8 @@ #if MAC save (); #else - if (f.has_suffix (".bf")) { - f = f.replace (".bf", ""); + if (!f.has_suffix (".bf")) { + f = @"$f.bf"; } file_name = @"$(f)";