small fixes

This commit is contained in:
Artem Anufrij 2017-11-08 23:40:54 +01:00
parent 528e9d17c0
commit f0ecf5e173
3 changed files with 6 additions and 6 deletions

View file

@ -42,7 +42,6 @@ namespace Webpin {
construct { construct {
program_name = "Webpin"; program_name = "Webpin";
exec_name = "com.github.artemanufrij.webpin"; exec_name = "com.github.artemanufrij.webpin";
application_id = "com.github.artemanufrij.webpin";
app_launcher = application_id + ".desktop"; app_launcher = application_id + ".desktop";
flags |= GLib.ApplicationFlags.HANDLES_OPEN; flags |= GLib.ApplicationFlags.HANDLES_OPEN;
@ -61,12 +60,9 @@ namespace Webpin {
protected override void activate () { protected override void activate () {
if (mainwindow != null) { if (mainwindow != null) {
mainwindow.present (); mainwindow.present ();
return; return;
} }
mainwindow = new MainWindow (); mainwindow = new MainWindow ();
mainwindow.destroy.connect (() => { mainwindow = null; });
mainwindow.set_application(this); mainwindow.set_application(this);
} }

View file

@ -79,7 +79,9 @@ namespace Webpin {
} }
return return_value; return return_value;
} set { } set {
edit_propertie ("WebpinPrimaryColor", value.to_string ()); if (value != null) {
edit_propertie ("WebpinPrimaryColor", value.to_string ());
}
} }
} }

View file

@ -313,7 +313,6 @@ namespace Webpin {
if (app_icon_valid && app_name_valid && app_url_valid) { if (app_icon_valid && app_name_valid && app_url_valid) {
var desktop_file = new DesktopFile (name, url, icon, stay_open); var desktop_file = new DesktopFile (name, url, icon, stay_open);
desktop_file.color = primary_color_button.rgba;
switch (mode) { switch (mode) {
case assistant_mode.new_app: case assistant_mode.new_app:
application_created (desktop_file.save_to_file ()); application_created (desktop_file.save_to_file ());
@ -322,6 +321,7 @@ namespace Webpin {
application_edited (desktop_file.save_to_file ()); application_edited (desktop_file.save_to_file ());
break; break;
} }
desktop_file.color = primary_color_button.rgba;
} }
} }
@ -334,6 +334,8 @@ namespace Webpin {
stay_open_when_closed.active = desktop_file.hide_on_close; stay_open_when_closed.active = desktop_file.hide_on_close;
if (desktop_file.color != null) { if (desktop_file.color != null) {
primary_color_button.set_rgba (desktop_file.color); primary_color_button.set_rgba (desktop_file.color);
} else {
primary_color_button.set_rgba ({ 222, 222, 222, 255 });
} }
update_app_icon (); update_app_icon ();
} }