fixed .desktop properties
This commit is contained in:
parent
f7b4eeb2d8
commit
58674f1217
5 changed files with 25 additions and 35 deletions
|
@ -32,6 +32,14 @@
|
||||||
</screenshot>
|
</screenshot>
|
||||||
</screenshots>
|
</screenshots>
|
||||||
<releases>
|
<releases>
|
||||||
|
<release version="0.2.2" date="2017-11-18">
|
||||||
|
<description>
|
||||||
|
<p>Fix:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Custom settings in .desktop</li>
|
||||||
|
</ul>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
<release version="0.2.1" date="2017-11-18">
|
<release version="0.2.1" date="2017-11-18">
|
||||||
<description>
|
<description>
|
||||||
<p>Fix:</p>
|
<p>Fix:</p>
|
||||||
|
|
5
debian/changelog~
vendored
5
debian/changelog~
vendored
|
@ -1,5 +0,0 @@
|
||||||
com.github.artemanufrij.webpin (0.1.3) xenial; urgency=low
|
|
||||||
|
|
||||||
* Initial Release.
|
|
||||||
|
|
||||||
-- Artem Anufrij <artem.anufrij@live.de> Mon, 31 Jul 2017 04:53:39 +0100
|
|
|
@ -55,7 +55,7 @@ namespace Webpin {
|
||||||
this.file = new GLib.KeyFile();
|
this.file = new GLib.KeyFile();
|
||||||
try {
|
try {
|
||||||
file.load_from_file (info.filename, KeyFileFlags.NONE);
|
file.load_from_file (info.filename, KeyFileFlags.NONE);
|
||||||
return file.get_string ("Desktop Entry", "WebpinStayOpen") == "true";
|
return file.get_string ("Desktop Entry", "X-Webpin-StayOpen") == "true";
|
||||||
} catch (Error e) {
|
} catch (Error e) {
|
||||||
warning (e.message);
|
warning (e.message);
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ namespace Webpin {
|
||||||
this.file = new GLib.KeyFile();
|
this.file = new GLib.KeyFile();
|
||||||
try {
|
try {
|
||||||
file.load_from_file (info.filename, KeyFileFlags.NONE);
|
file.load_from_file (info.filename, KeyFileFlags.NONE);
|
||||||
var property = file.get_string ("Desktop Entry", "WebpinPrimaryColor");
|
var property = file.get_string ("Desktop Entry", "X-Webpin-PrimaryColor");
|
||||||
if (property == "" || !return_value.parse (property)) {
|
if (property == "" || !return_value.parse (property)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -81,24 +81,11 @@ namespace Webpin {
|
||||||
} set {
|
} set {
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
var color = "#%02x%02x%02x".printf ((int)(value.red * 255), (int)(value.green * 255), (int)(value.blue * 255));
|
var color = "#%02x%02x%02x".printf ((int)(value.red * 255), (int)(value.green * 255), (int)(value.blue * 255));
|
||||||
edit_propertie ("WebpinPrimaryColor", color);
|
edit_propertie ("X-Webpin-PrimaryColor", color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool mute_notifications {
|
|
||||||
get {
|
|
||||||
this.file = new GLib.KeyFile();
|
|
||||||
try {
|
|
||||||
file.load_from_file (info.filename, KeyFileFlags.NONE);
|
|
||||||
return file.get_string ("Desktop Entry", "WebpinMuteNotifications") == "true";
|
|
||||||
} catch (Error e) {
|
|
||||||
warning (e.message);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public DesktopFile (string name, string url, string icon, bool stay_open) {
|
public DesktopFile (string name, string url, string icon, bool stay_open) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.url = url.replace ("%", "%%");
|
this.url = url.replace ("%", "%%");
|
||||||
|
@ -117,7 +104,7 @@ namespace Webpin {
|
||||||
file.set_string ("Desktop Entry", "Exec", "com.github.artemanufrij.webpin " + url);
|
file.set_string ("Desktop Entry", "Exec", "com.github.artemanufrij.webpin " + url);
|
||||||
file.set_string ("Desktop Entry", "Icon", icon);
|
file.set_string ("Desktop Entry", "Icon", icon);
|
||||||
file.set_string ("Desktop Entry", "StartupWMClass", url);
|
file.set_string ("Desktop Entry", "StartupWMClass", url);
|
||||||
file.set_string ("Desktop Entry", "WebpinStayOpen", stay_open.to_string ());
|
file.set_string ("Desktop Entry", "X-Webpin-StayOpen", stay_open.to_string ());
|
||||||
}
|
}
|
||||||
|
|
||||||
public DesktopFile.from_desktopappinfo(GLib.DesktopAppInfo info) {
|
public DesktopFile.from_desktopappinfo(GLib.DesktopAppInfo info) {
|
||||||
|
|
|
@ -72,17 +72,17 @@ namespace Webpin {
|
||||||
stay_open.tooltip_text = _("Run in background when closed");
|
stay_open.tooltip_text = _("Run in background when closed");
|
||||||
stay_open.image = new Gtk.Image.from_icon_name ("view-pin-symbolic", Gtk.IconSize.MENU);
|
stay_open.image = new Gtk.Image.from_icon_name ("view-pin-symbolic", Gtk.IconSize.MENU);
|
||||||
stay_open.toggled.connect (() => {
|
stay_open.toggled.connect (() => {
|
||||||
desktop_file.edit_propertie ("WebpinStayOpen", stay_open.active.to_string ());
|
desktop_file.edit_propertie ("X-Webpin-StayOpen", stay_open.active.to_string ());
|
||||||
desktop_file.save_to_file ();
|
desktop_file.save_to_file ();
|
||||||
});
|
});
|
||||||
headerbar.pack_start (stay_open);
|
headerbar.pack_start (stay_open);
|
||||||
|
|
||||||
this.set_titlebar (headerbar);
|
this.set_titlebar (headerbar);
|
||||||
|
|
||||||
var width = desktop_file.info.get_string ("WebpinWindowWidth");
|
var width = desktop_file.info.get_string ("X-Webpin-WindowWidth");
|
||||||
var height = desktop_file.info.get_string ("WebpinWindowHeight");
|
var height = desktop_file.info.get_string ("X-Webpin-WindowHeight");
|
||||||
var state = desktop_file.info.get_string ("WebpinWindowMaximized");
|
var state = desktop_file.info.get_string ("X-Webpin-WindowMaximized");
|
||||||
var zoom = desktop_file.info.get_string ("WebpinWindowZoom");
|
var zoom = desktop_file.info.get_string ("X-Webpin-WindowZoom");
|
||||||
|
|
||||||
if (width != null && height != null) {
|
if (width != null && height != null) {
|
||||||
set_default_size (int.parse(width), int.parse(height));
|
set_default_size (int.parse(width), int.parse(height));
|
||||||
|
@ -159,11 +159,11 @@ namespace Webpin {
|
||||||
var file = web_app.get_desktop_file();
|
var file = web_app.get_desktop_file();
|
||||||
|
|
||||||
if (is_maximized) {
|
if (is_maximized) {
|
||||||
file.edit_propertie ("WebpinWindowMaximized", "max");
|
file.edit_propertie ("X-Webpin-WindowMaximized", "max");
|
||||||
} else {
|
} else {
|
||||||
file.edit_propertie ("WebpinWindowWidth", width.to_string());
|
file.edit_propertie ("X-Webpin-WindowWidth", width.to_string());
|
||||||
file.edit_propertie ("WebpinWindowHeight", height.to_string());
|
file.edit_propertie ("X-Webpin-WindowHeight", height.to_string());
|
||||||
file.edit_propertie ("WebpinWindowMaximized", "norm");
|
file.edit_propertie ("X-Webpin-WindowMaximized", "norm");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ namespace Webpin {
|
||||||
case Gdk.Key.plus:
|
case Gdk.Key.plus:
|
||||||
if (Gdk.ModifierType.CONTROL_MASK in event.state) {
|
if (Gdk.ModifierType.CONTROL_MASK in event.state) {
|
||||||
web_app.app_view.zoom_level += 0.1;
|
web_app.app_view.zoom_level += 0.1;
|
||||||
web_app.get_desktop_file().edit_propertie ("WebpinWindowZoom", web_app.app_view.zoom_level.to_string ());
|
web_app.get_desktop_file().edit_propertie ("X-Webpin-WindowZoom", web_app.app_view.zoom_level.to_string ());
|
||||||
} else {
|
} else {
|
||||||
handled = false;
|
handled = false;
|
||||||
}
|
}
|
||||||
|
@ -189,7 +189,7 @@ namespace Webpin {
|
||||||
case Gdk.Key.minus:
|
case Gdk.Key.minus:
|
||||||
if (Gdk.ModifierType.CONTROL_MASK in event.state) {
|
if (Gdk.ModifierType.CONTROL_MASK in event.state) {
|
||||||
web_app.app_view.zoom_level -= 0.1;
|
web_app.app_view.zoom_level -= 0.1;
|
||||||
web_app.get_desktop_file().edit_propertie ("WebpinWindowZoom", web_app.app_view.zoom_level.to_string ());
|
web_app.get_desktop_file().edit_propertie ("X-Webpin-WindowZoom", web_app.app_view.zoom_level.to_string ());
|
||||||
} else {
|
} else {
|
||||||
handled = false;
|
handled = false;
|
||||||
}
|
}
|
||||||
|
@ -198,7 +198,7 @@ namespace Webpin {
|
||||||
case Gdk.Key.@0:
|
case Gdk.Key.@0:
|
||||||
if (Gdk.ModifierType.CONTROL_MASK in event.state) {
|
if (Gdk.ModifierType.CONTROL_MASK in event.state) {
|
||||||
web_app.app_view.zoom_level = 1;
|
web_app.app_view.zoom_level = 1;
|
||||||
web_app.get_desktop_file().edit_propertie ("WebpinWindowZoom", web_app.app_view.zoom_level.to_string ());
|
web_app.get_desktop_file().edit_propertie ("X-Webpin-WindowZoom", web_app.app_view.zoom_level.to_string ());
|
||||||
} else {
|
} else {
|
||||||
handled = false;
|
handled = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,7 +110,7 @@ namespace Webpin {
|
||||||
icon_for_notification = GLib.Icon.new_for_string (file.icon);
|
icon_for_notification = GLib.Icon.new_for_string (file.icon);
|
||||||
} catch (Error e) {
|
} catch (Error e) {
|
||||||
warning (e.message);
|
warning (e.message);
|
||||||
icon = new Gtk.Image.from_icon_name ("artemanufrij.webpin", Gtk.IconSize.DIALOG);
|
icon = new Gtk.Image.from_icon_name ("com.github.artemanufrij.webpin", Gtk.IconSize.DIALOG);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
icon = new Gtk.Image.from_icon_name (file.icon, Gtk.IconSize.DIALOG);
|
icon = new Gtk.Image.from_icon_name (file.icon, Gtk.IconSize.DIALOG);
|
||||||
|
|
Loading…
Reference in a new issue