fix #97
This commit is contained in:
parent
52657a1c1c
commit
5cd436abf2
3 changed files with 19 additions and 6 deletions
|
@ -47,6 +47,17 @@ namespace Webpin {
|
||||||
this.flags |= GLib.ApplicationFlags.HANDLES_OPEN;
|
this.flags |= GLib.ApplicationFlags.HANDLES_OPEN;
|
||||||
this.flags |= ApplicationFlags.HANDLES_COMMAND_LINE;
|
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 ();
|
create_cache_folders ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -159,7 +159,7 @@ namespace Webpin.Widgets.Views {
|
||||||
accept_button = new Gtk.Button.with_label (_ ("Save app"));
|
accept_button = new Gtk.Button.with_label (_ ("Save app"));
|
||||||
accept_button.halign = Gtk.Align.END;
|
accept_button.halign = Gtk.Align.END;
|
||||||
accept_button.get_style_context ().add_class ("suggested-action");
|
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.activate.connect (on_accept);
|
||||||
accept_button.clicked.connect (on_accept);
|
accept_button.clicked.connect (on_accept);
|
||||||
|
|
||||||
|
@ -469,17 +469,17 @@ namespace Webpin.Widgets.Views {
|
||||||
|
|
||||||
private void validate () {
|
private void validate () {
|
||||||
if (app_icon_valid && app_name_valid && app_url_valid) {
|
if (app_icon_valid && app_name_valid && app_url_valid) {
|
||||||
accept_button.set_sensitive (true);
|
accept_button.sensitive = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
accept_button.set_sensitive (false);
|
accept_button.sensitive = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reset_fields () {
|
public void reset_fields () {
|
||||||
tmp_icon_file = "";
|
tmp_icon_file = "";
|
||||||
icon_name_entry.set_text ("");
|
icon_name_entry.set_text ("");
|
||||||
app_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_url_entry.set_text ("");
|
||||||
app_name_entry.get_style_context ().remove_class ("error");
|
app_name_entry.get_style_context ().remove_class ("error");
|
||||||
app_url_entry.get_style_context ().remove_class ("error");
|
app_url_entry.get_style_context ().remove_class ("error");
|
||||||
|
|
|
@ -104,8 +104,10 @@ namespace Webpin.Windows {
|
||||||
|
|
||||||
browser.request_finished.connect (() => {
|
browser.request_finished.connect (() => {
|
||||||
spinner.active = false;
|
spinner.active = false;
|
||||||
|
if (button_back != null) {
|
||||||
button_back.sensitive = browser.can_go_back ();
|
button_back.sensitive = browser.can_go_back ();
|
||||||
button_forward.sensitive = browser.can_go_forward ();
|
button_forward.sensitive = browser.can_go_forward ();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
browser.found_website_color.connect ((color) => {
|
browser.found_website_color.connect ((color) => {
|
||||||
|
|
Loading…
Reference in a new issue