diff --git a/src/Application.vala b/src/Application.vala index a495267..9577ff2 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -47,6 +47,17 @@ namespace Webpin { this.flags |= GLib.ApplicationFlags.HANDLES_OPEN; this.flags |= ApplicationFlags.HANDLES_COMMAND_LINE; + var action_quit = new SimpleAction ("quit", null); + add_action (action_quit); + string[] accel_quit = {"q", "0"}; + set_accels_for_action ("app.quit", accel_quit); + action_quit.activate.connect ( + () => { + if (mainwindow != null) { + mainwindow.destroy (); + } + }); + create_cache_folders (); } diff --git a/src/Widgets/Views/Editor.vala b/src/Widgets/Views/Editor.vala index fe56dbb..97e396d 100644 --- a/src/Widgets/Views/Editor.vala +++ b/src/Widgets/Views/Editor.vala @@ -159,7 +159,7 @@ namespace Webpin.Widgets.Views { accept_button = new Gtk.Button.with_label (_ ("Save app")); accept_button.halign = Gtk.Align.END; accept_button.get_style_context ().add_class ("suggested-action"); - accept_button.set_sensitive (false); + accept_button.sensitive = false; accept_button.activate.connect (on_accept); accept_button.clicked.connect (on_accept); @@ -469,17 +469,17 @@ namespace Webpin.Widgets.Views { private void validate () { if (app_icon_valid && app_name_valid && app_url_valid) { - accept_button.set_sensitive (true); + accept_button.sensitive = true; return; } - accept_button.set_sensitive (false); + accept_button.sensitive = false; } public void reset_fields () { tmp_icon_file = ""; icon_name_entry.set_text (""); app_name_entry.set_text (""); - app_name_entry.set_sensitive (true); + app_name_entry.sensitive = true; app_url_entry.set_text (""); app_name_entry.get_style_context ().remove_class ("error"); app_url_entry.get_style_context ().remove_class ("error"); diff --git a/src/Windows/WebApp.vala b/src/Windows/WebApp.vala index c21806f..90f9514 100644 --- a/src/Windows/WebApp.vala +++ b/src/Windows/WebApp.vala @@ -104,8 +104,10 @@ namespace Webpin.Windows { browser.request_finished.connect (() => { spinner.active = false; - button_back.sensitive = browser.can_go_back (); - button_forward.sensitive = browser.can_go_forward (); + if (button_back != null) { + button_back.sensitive = browser.can_go_back (); + button_forward.sensitive = browser.can_go_forward (); + } }); browser.found_website_color.connect ((color) => {