Skip to content

Commit

Permalink
Finalized v17
Browse files Browse the repository at this point in the history
  • Loading branch information
sakithb committed Sep 14, 2021
1 parent 92b2ce4 commit e7643be
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 1,766 deletions.
1,232 changes: 0 additions & 1,232 deletions #prefs3.ui#

This file was deleted.

469 changes: 0 additions & 469 deletions main.js

This file was deleted.

3 changes: 1 addition & 2 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"development": true,
"description": "Show controls for the current playing media in the panel",
"name": "Media Controls",
"settings-schema": "org.gnome.shell.extensions.mediacontrols",
Expand All @@ -9,5 +8,5 @@
],
"url": "https://github.com/cliffniff/media-controls",
"uuid": "[email protected]",
"version": 16
"version": 17
}
11 changes: 7 additions & 4 deletions player.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,11 +599,11 @@ const Player = GObject.registerClass(
}
} catch (error) {
if (
error.toString().includes("Expected type") ||
error.toString().includes("Error opening file")
!(
error.toString().includes("Expected type") ||
error.toString().includes("Error opening file")
)
) {
log("[MediaControls] Failed to retrieve icon.");
} else {
logError(error);
}
return null;
Expand Down Expand Up @@ -697,6 +697,9 @@ const Player = GObject.registerClass(
}

destroy() {
this._extension = null;
this._playerProxy = null;
this._otherProxy = null;
super.destroy();
}

Expand Down
4 changes: 4 additions & 0 deletions prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,12 @@ const addToBacklistListBox = (app) => {
);

deleteButton.visible = true;
deleteButton.app = app;

deleteButton.connect("clicked", (widget) => {
let currentBacklistApps = settings.get_strv("backlist-apps");
currentBacklistApps.splice(currentBacklistApps.indexOf(widget.app), 1);
settings.set_strv("backlist-apps", currentBacklistApps);
widgetBacklistBox.remove(widget.get_parent().get_parent());
});

Expand Down
37 changes: 26 additions & 11 deletions prefs3.ui
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ ex. track name, artist</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="label" translatable="yes">What's new in v15?</property>
<property name="label" translatable="yes">What's new in v17?</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="scale" value="1.25"/>
Expand Down Expand Up @@ -612,8 +612,10 @@ ex. track name, artist</property>
<property name="halign">start</property>
<property name="margin-top">8</property>
<property name="margin-bottom">8</property>
<property name="label" translatable="yes">&lt;b&gt;Seperator characters&lt;/b&gt;</property>
<property name="use-markup">True</property>
<property name="label" translatable="yes">Seperator characters</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
Expand Down Expand Up @@ -856,8 +858,10 @@ ex. track name, artist</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">&lt;b&gt;Show/hide elements&lt;/b&gt;</property>
<property name="use-markup">True</property>
<property name="label" translatable="yes">how/hide elements</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
Expand Down Expand Up @@ -967,8 +971,10 @@ ex. track name, artist</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">&lt;b&gt;Element order&lt;/b&gt;</property>
<property name="use-markup">True</property>
<property name="label" translatable="yes">Element order</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
Expand Down Expand Up @@ -1055,8 +1061,10 @@ ex. track name, artist</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">&lt;b&gt;Mouse actions&lt;/b&gt;</property>
<property name="use-markup">True</property>
<property name="label" translatable="yes">Mouse actions</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
Expand All @@ -1069,8 +1077,10 @@ ex. track name, artist</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="label" translatable="yes">&lt;b&gt;Cache images&lt;/b&gt;</property>
<property name="use-markup">True</property>
<property name="label" translatable="yes">Cache images</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
Expand Down Expand Up @@ -1178,6 +1188,9 @@ ex. track name, artist</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Blacklist players</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
Expand All @@ -1198,6 +1211,8 @@ ex. track name, artist</property>
<object class="GtkEntry" id="backlist-entry">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="secondary-icon-name">list-add</property>
<property name="input-hints">GTK_INPUT_HINT_LOWERCASE | GTK_INPUT_HINT_NONE</property>
<signal name="activate" handler="on_backlist_entry_changed" swapped="no"/>
</object>
<packing>
Expand Down
37 changes: 26 additions & 11 deletions prefs4.ui
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ ex. track name, artist</property>
<object class="GtkLabel">
<property name="halign">start</property>
<property name="valign">center</property>
<property name="label" translatable="yes">What&apos;s new in v15?</property>
<property name="label" translatable="yes">What&apos;s new in v17?</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
<attribute name="scale" value="1.25"></attribute>
Expand Down Expand Up @@ -477,8 +477,10 @@ ex. track name, artist</property>
<property name="halign">start</property>
<property name="margin-top">8</property>
<property name="margin-bottom">8</property>
<property name="label" translatable="yes">&lt;b&gt;Seperator characters&lt;/b&gt;</property>
<property name="use-markup">1</property>
<property name="label" translatable="yes">Seperator characters</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
<layout>
<property name="column">0</property>
<property name="row">5</property>
Expand Down Expand Up @@ -688,8 +690,10 @@ ex. track name, artist</property>
<child>
<object class="GtkLabel">
<property name="halign">start</property>
<property name="label" translatable="yes">&lt;b&gt;Show/hide elements&lt;/b&gt;</property>
<property name="use-markup">1</property>
<property name="label" translatable="yes">how/hide elements</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
<layout>
<property name="column">0</property>
<property name="row">0</property>
Expand Down Expand Up @@ -778,8 +782,10 @@ ex. track name, artist</property>
<child>
<object class="GtkLabel">
<property name="halign">start</property>
<property name="label" translatable="yes">&lt;b&gt;Element order&lt;/b&gt;</property>
<property name="use-markup">1</property>
<property name="label" translatable="yes">Element order</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
<layout>
<property name="column">0</property>
<property name="row">2</property>
Expand Down Expand Up @@ -849,8 +855,10 @@ ex. track name, artist</property>
<child>
<object class="GtkLabel">
<property name="halign">start</property>
<property name="label" translatable="yes">&lt;b&gt;Mouse actions&lt;/b&gt;</property>
<property name="use-markup">1</property>
<property name="label" translatable="yes">Mouse actions</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
<layout>
<property name="column">0</property>
<property name="row">0</property>
Expand All @@ -861,8 +869,10 @@ ex. track name, artist</property>
<object class="GtkLabel">
<property name="halign">start</property>
<property name="valign">center</property>
<property name="label" translatable="yes">&lt;b&gt;Cache images&lt;/b&gt;</property>
<property name="use-markup">1</property>
<property name="label" translatable="yes">Cache images</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
<layout>
<property name="column">0</property>
<property name="row">5</property>
Expand Down Expand Up @@ -954,6 +964,9 @@ ex. track name, artist</property>
<object class="GtkLabel">
<property name="halign">start</property>
<property name="label" translatable="yes">Blacklist players</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
<layout>
<property name="column">0</property>
<property name="row">2</property>
Expand All @@ -971,6 +984,8 @@ ex. track name, artist</property>
<child>
<object class="GtkEntry" id="backlist-entry">
<property name="focusable">1</property>
<property name="secondary-icon-name">list-add</property>
<property name="input-hints">GTK_INPUT_HINT_LOWERCASE | GTK_INPUT_HINT_NONE</property>
<signal name="activate" handler="on_backlist_entry_changed" swapped="no"/>
<layout>
<property name="column">0</property>
Expand Down
6 changes: 6 additions & 0 deletions settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Settings {
this.elementOrder = this._settings.get_strv("element-order");
this.trackLabel = this._settings.get_strv("track-label");
this.cacheImages = this._settings.get_boolean("cache-images");
this.blacklistApps = this._settings.get_strv("backlist-apps");
}

connectSignals() {
Expand Down Expand Up @@ -124,6 +125,10 @@ class Settings {
this._onCacheImagesChanged = this._settings.connect("changed::cache-images", () => {
this.cacheImages = this._settings.get_boolean("cache-images");
});

this._onBacklistAppsChanged = this._settings.connect("changed::backlist-apps", () => {
this.blacklistApps = this._settings.get_strv("backlist-apps");
});
}

disconnectSignals() {
Expand All @@ -145,5 +150,6 @@ class Settings {
this._settings.disconnect(this._onElementOrderChanged);
this._settings.disconnect(this._onTrackLabelChanged);
this._settings.disconnect(this._onCacheImagesChanged);
this._settings.disconnect(this._onBacklistAppsChanged);
}
}
Loading

0 comments on commit e7643be

Please sign in to comment.