This commit is contained in:
Artem Anufrij 2019-07-16 19:36:51 +02:00
parent 52657a1c1c
commit 5cd436abf2
3 changed files with 19 additions and 6 deletions

View file

@ -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 = {"<Control>q", "0"};
set_accels_for_action ("app.quit", accel_quit);
action_quit.activate.connect (
() => {
if (mainwindow != null) {
mainwindow.destroy ();
}
});
create_cache_folders ();
}

View file

@ -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");

View file

@ -104,8 +104,10 @@ namespace Webpin.Windows {
browser.request_finished.connect (() => {
spinner.active = false;
if (button_back != null) {
button_back.sensitive = browser.can_go_back ();
button_forward.sensitive = browser.can_go_forward ();
}
});
browser.found_website_color.connect ((color) => {