Skip to content

Commit

Permalink
release 1.2.1 for flatpak
Browse files Browse the repository at this point in the history
  • Loading branch information
DevAlien committed Aug 21, 2020
1 parent 9193758 commit b5f8357
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 11 deletions.
10 changes: 10 additions & 0 deletions data/com.github.devalien.workspaces.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@
</content_rating>

<releases>
<release version="1.2.1" date="2020-08-21">
<description>
<p>Bug Fixes</p>
<ul>
<li>Fixed shortcut for flatpak</li>
<li>Fixed load apps for flatpak</li>
</ul>
</description>
</release>

<release version="1.2.0" date="2020-08-21">
<description>
<p>Features</p>
Expand Down
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
com.github.devalien.workspaces (1.2.1) RELEASED; urgency=low

* Fixed shortcut for flatpak. *
* Fixed load apps for flatpak. *

-- Goncalo Margalho <g@margalho.info> Mon, 21 Aug 2020 12:20:20 +0200

com.github.devalien.workspaces (1.2.0) RELEASED; urgency=low

* Added default shortcut to launch the app and a way to modify it. *
Expand Down
20 changes: 16 additions & 4 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class Workspaces.Application : Gtk.Application {
public const string APP_VERSION = "1.2.0";
public const string APP_ID = "com.github.devalien.workspaces";
public const string SHOW_WORKSPACES_CMD = APP_ID;
public const string FLATPAK_SHOW_WORKSPACES_CMD = "flatpak run " + APP_ID;
private const string SHOW_WORKSPACES_SHORTCUT = "<Control><Alt>w";

private bool show_quick_launch = false;
Expand Down Expand Up @@ -195,15 +196,26 @@ public class Workspaces.Application : Gtk.Application {
private void set_default_shortcut () {
CustomShortcutSettings.init ();
foreach (var shortcut in CustomShortcutSettings.list_custom_shortcuts ()) {
if (shortcut.command == SHOW_WORKSPACES_CMD) {
CustomShortcutSettings.edit_shortcut (shortcut.relocatable_schema, SHOW_WORKSPACES_SHORTCUT);
return;
if (is_flatpak ()) {
if (shortcut.command == FLATPAK_SHOW_WORKSPACES_CMD) {
CustomShortcutSettings.edit_shortcut (shortcut.relocatable_schema, SHOW_WORKSPACES_SHORTCUT);
return;
}
} else {
if (shortcut.command == SHOW_WORKSPACES_CMD) {
CustomShortcutSettings.edit_shortcut (shortcut.relocatable_schema, SHOW_WORKSPACES_SHORTCUT);
return;
}
}
}
var shortcut = CustomShortcutSettings.create_shortcut ();
if (shortcut != null) {
CustomShortcutSettings.edit_shortcut (shortcut, SHOW_WORKSPACES_SHORTCUT);
CustomShortcutSettings.edit_command (shortcut, SHOW_WORKSPACES_CMD);
if (is_flatpak ()) {
CustomShortcutSettings.edit_command (shortcut, FLATPAK_SHOW_WORKSPACES_CMD);
} else {
CustomShortcutSettings.edit_command (shortcut, SHOW_WORKSPACES_CMD);
}
}
}

Expand Down
25 changes: 21 additions & 4 deletions src/Dialogs/Preferences.vala
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,34 @@ public class Workspaces.Dialogs.Preferences : Gtk.Dialog {

CustomShortcutSettings.init ();
foreach (var shortcut in CustomShortcutSettings.list_custom_shortcuts ()) {
if (shortcut.command == Workspaces.Application.SHOW_WORKSPACES_CMD) {
accel = shortcut.shortcut;
accel_path = shortcut.relocatable_schema;
if (is_flatpak ()) {
if (shortcut.command == Workspaces.Application.FLATPAK_SHOW_WORKSPACES_CMD) {
accel = shortcut.shortcut;
accel_path = shortcut.relocatable_schema;
}
} else {
if (shortcut.command == Workspaces.Application.SHOW_WORKSPACES_CMD) {
accel = shortcut.shortcut;
accel_path = shortcut.relocatable_schema;
}
}
}

var paste_shortcut_label = create_label (_ ("Open Workspaces Shortcut:"));
var paste_shortcut_entry = new Workspaces.Widgets.ShortcutEntry (accel);
paste_shortcut_entry.shortcut_changed.connect ((new_shortcut) => {
if (accel_path != null) {
if (accel_path != null && accel_path != "") {
CustomShortcutSettings.edit_shortcut (accel_path, new_shortcut);
} else {
var shortcut = CustomShortcutSettings.create_shortcut ();
if (shortcut != null) {
CustomShortcutSettings.edit_shortcut (shortcut, new_shortcut);
if (is_flatpak ()) {
CustomShortcutSettings.edit_command (shortcut, Workspaces.Application.FLATPAK_SHOW_WORKSPACES_CMD);
} else {
CustomShortcutSettings.edit_command (shortcut, Workspaces.Application.SHOW_WORKSPACES_CMD);
}
}
}
});
if (first_run) {
Expand Down
13 changes: 10 additions & 3 deletions src/PreferencesWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,16 @@ public class Workspaces.PreferencesWindow : Gtk.ApplicationWindow {

CustomShortcutSettings.init ();
foreach (var shortcut in CustomShortcutSettings.list_custom_shortcuts ()) {
if (shortcut.command == Workspaces.Application.SHOW_WORKSPACES_CMD) {
accel = shortcut.shortcut;
accel_path = shortcut.relocatable_schema;
if (is_flatpak ()) {
if (shortcut.command == Workspaces.Application.FLATPAK_SHOW_WORKSPACES_CMD) {
accel = shortcut.shortcut;
accel_path = shortcut.relocatable_schema;
}
} else {
if (shortcut.command == Workspaces.Application.SHOW_WORKSPACES_CMD) {
accel = shortcut.shortcut;
accel_path = shortcut.relocatable_schema;
}
}
}

Expand Down

0 comments on commit b5f8357

Please sign in to comment.