From f0ecf5e173358359d81f211233738e5388b97dd7 Mon Sep 17 00:00:00 2001 From: Artem Anufrij Date: Wed, 8 Nov 2017 23:40:54 +0100 Subject: [PATCH] small fixes --- src/Application.vala | 4 ---- src/Objects/DesktopFile.vala | 4 +++- src/Widgets/Assistant.vala | 4 +++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Application.vala b/src/Application.vala index 5bc25aa..1a2023a 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -42,7 +42,6 @@ namespace Webpin { construct { program_name = "Webpin"; exec_name = "com.github.artemanufrij.webpin"; - application_id = "com.github.artemanufrij.webpin"; app_launcher = application_id + ".desktop"; flags |= GLib.ApplicationFlags.HANDLES_OPEN; @@ -61,12 +60,9 @@ namespace Webpin { protected override void activate () { if (mainwindow != null) { mainwindow.present (); - return; } - mainwindow = new MainWindow (); - mainwindow.destroy.connect (() => { mainwindow = null; }); mainwindow.set_application(this); } diff --git a/src/Objects/DesktopFile.vala b/src/Objects/DesktopFile.vala index f767938..0f2e119 100644 --- a/src/Objects/DesktopFile.vala +++ b/src/Objects/DesktopFile.vala @@ -79,7 +79,9 @@ namespace Webpin { } return return_value; } set { - edit_propertie ("WebpinPrimaryColor", value.to_string ()); + if (value != null) { + edit_propertie ("WebpinPrimaryColor", value.to_string ()); + } } } diff --git a/src/Widgets/Assistant.vala b/src/Widgets/Assistant.vala index e917830..c05317f 100644 --- a/src/Widgets/Assistant.vala +++ b/src/Widgets/Assistant.vala @@ -313,7 +313,6 @@ namespace Webpin { if (app_icon_valid && app_name_valid && app_url_valid) { var desktop_file = new DesktopFile (name, url, icon, stay_open); - desktop_file.color = primary_color_button.rgba; switch (mode) { case assistant_mode.new_app: application_created (desktop_file.save_to_file ()); @@ -322,6 +321,7 @@ namespace Webpin { application_edited (desktop_file.save_to_file ()); break; } + desktop_file.color = primary_color_button.rgba; } } @@ -334,6 +334,8 @@ namespace Webpin { stay_open_when_closed.active = desktop_file.hide_on_close; if (desktop_file.color != null) { primary_color_button.set_rgba (desktop_file.color); + } else { + primary_color_button.set_rgba ({ 222, 222, 222, 255 }); } update_app_icon (); }