Skip to content

Commit

Permalink
[slider@mohammad-sn] Prevent loading in Cinnamon 4+ (#757)
Browse files Browse the repository at this point in the history
* This extension has been very broken for many years. The changes here just prevent the extension from breaking the desktop by refusing to operate when the Cinnamon major version is 4 or higher. If the extension is ever fixed the code can be removed.
  • Loading branch information
klangman authored Sep 27, 2024
1 parent edfb868 commit 53e862a
Show file tree
Hide file tree
Showing 14 changed files with 261 additions and 332 deletions.
29 changes: 29 additions & 0 deletions slider@mohammad-sn/files/slider@mohammad-sn/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,24 @@ const ExpoThumbnail = imports.ui.expoThumbnail;
const Overview = imports.ui.overview;
const Workspace = imports.ui.workspace;
const Expo = imports.ui.expo;
const Config = imports.misc.config;
const MessageTray = imports.ui.messageTray;
const Gettext = imports.gettext;
const GLib = imports.gi.GLib;

const majorVersion = parseInt(Config.PACKAGE_VERSION.split(".")[0]);

const UUID = "slider@mohammad-sn";

Gettext.bindtextdomain(UUID, GLib.get_home_dir() + "/.local/share/locale");

function _(text) {
let locText = Gettext.dgettext(UUID, text);
if (locText == text) {
locText = window._(text);
}
return locText;
}

let newSlider = null;
let TIME = 0.5;
Expand Down Expand Up @@ -72,6 +90,7 @@ function Slider(metadata) {

Slider.prototype = {
_init: function(metadata) {
this.meta = metadata;
if (global.window_manager.switchWorkspaceId) this.oid = global.window_manager.switchWorkspaceId;
else this.oid = this._guessHandlerID();

Expand Down Expand Up @@ -109,6 +128,16 @@ Slider.prototype = {
},

enable: function() {
if (majorVersion >= 4) {
let source = new MessageTray.Source(this.meta.name);
let notification = new MessageTray.Notification(source, _("ERROR") + ": " + _("Slider was NOT enabled"),
_("This extension is currently incompatible with your version of Cinnamon."),
{icon: new St.Icon({icon_name: "dialog-warning", icon_type: St.IconType.FULLCOLOR, icon_size: source.ICON_SIZE })}
);
Main.messageTray.add(source);
source.notify(notification);
return;
}
if (this.oid) {
global.window_manager.disconnect(this.oid);
this.id = global.window_manager.connect('switch-workspace', Lang.bind(Main.wm, mySwitcher));
Expand Down
19 changes: 16 additions & 3 deletions slider@mohammad-sn/files/slider@mohammad-sn/po/ca.po
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SOME DESCRIPTIVE TITLE.
# SLIDER
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Odyssey <[email protected]>, 2024
Expand All @@ -7,8 +7,9 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-03-02 21:59+0000\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
"extensions/issues\n"
"POT-Creation-Date: 2024-09-26 21:42-0400\n"
"PO-Revision-Date: 2024-07-25 18:25+0200\n"
"Last-Translator: Odyssey <[email protected]>\n"
"Language-Team: \n"
Expand All @@ -18,6 +19,18 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.4.2\n"

#. extension.js:133
msgid "ERROR"
msgstr ""

#. extension.js:133
msgid "Slider was NOT enabled"
msgstr ""

#. extension.js:134
msgid "This extension is currently incompatible with your version of Cinnamon."
msgstr ""

#. metadata.json->description
msgid "Yet another nice transition effect for ws switching."
msgstr "Un altre efecte de transició bonic per canviar d'espai de treball."
Expand Down
111 changes: 17 additions & 94 deletions slider@mohammad-sn/files/slider@mohammad-sn/po/da.po
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# SOME DESCRIPTIVE TITLE.
# SLIDER
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# mohammad-sn, 2017
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-03-02 21:59+0000\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
"extensions/issues\n"
"POT-Creation-Date: 2024-09-26 21:42-0400\n"
"PO-Revision-Date: 2021-03-02 23:01+0100\n"
"Last-Translator: Alan Mortensen <[email protected]>\n"
"Language-Team: \n"
Expand All @@ -18,6 +19,18 @@ msgstr ""
"X-Generator: Poedit 2.3\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. extension.js:133
msgid "ERROR"
msgstr ""

#. extension.js:133
msgid "Slider was NOT enabled"
msgstr ""

#. extension.js:134
msgid "This extension is currently incompatible with your version of Cinnamon."
msgstr ""

#. metadata.json->description
msgid "Yet another nice transition effect for ws switching."
msgstr "Endnu en fin overgangseffekt til skift af arbejdsområde."
Expand Down Expand Up @@ -53,93 +66,3 @@ msgstr "Baggrundens zoomniveau:"
#. settings-schema.json->vertical-position->description
msgid "Background Vertical Position:"
msgstr "Baggrundens lodrette placering:"

#~ msgid "easeInOutBounce"
#~ msgstr "easeInOutBounce"

#~ msgid "easeInOutExpo"
#~ msgstr "easeInOutExpo"

#~ msgid "easeOutCubic"
#~ msgstr "easeOutCubic"

#~ msgid "easeInOutCubic"
#~ msgstr "easeInOutCubic"

#~ msgid "easeInOutCirc"
#~ msgstr "easeInOutCirc"

#~ msgid "easeInQuart"
#~ msgstr "easeInQuart"

#~ msgid "easeInBounce"
#~ msgstr "easeInBounce"

#~ msgid "easeOutQuad"
#~ msgstr "easeOutQuad"

#~ msgid "easeInQuint"
#~ msgstr "easeInQuint"

#~ msgid "easeOutElastic"
#~ msgstr "easeOutElastic"

#~ msgid "easeOutQuint"
#~ msgstr "easeOutQuint"

#~ msgid "easeInOutElastic"
#~ msgstr "easeInOutElastic"

#~ msgid "easeInExpo"
#~ msgstr "easeInExpo"

#~ msgid "easeInOutSine"
#~ msgstr "easeInOutSine"

#~ msgid "easeInOutQuad"
#~ msgstr "easeInOutQuad"

#~ msgid "easeInQuad"
#~ msgstr "easeInQuad"

#~ msgid "easeOutSine"
#~ msgstr "easeOutSine"

#~ msgid "easeOutExpo"
#~ msgstr "easeOutExpo"

#~ msgid "easeOutBounce"
#~ msgstr "easeOutBounce"

#~ msgid "easeOutBack"
#~ msgstr "easeOutBack"

#~ msgid "easeInOutQuint"
#~ msgstr "easeInOutQuint"

#~ msgid "easeOutCirc"
#~ msgstr "easeOutCirc"

#~ msgid "easeInCirc"
#~ msgstr "easeInCirc"

#~ msgid "easeInElastic"
#~ msgstr "easeInElastic"

#~ msgid "easeInBack"
#~ msgstr "easeInBack"

#~ msgid "easeInSine"
#~ msgstr "easeInSine"

#~ msgid "easeOutQuart"
#~ msgstr "easeOutQuart"

#~ msgid "easeInOutQuart"
#~ msgstr "easeInOutQuart"

#~ msgid "easeInCubic"
#~ msgstr "easeInCubic"

#~ msgid "easeInOutBack"
#~ msgstr "easeInOutBack"
111 changes: 17 additions & 94 deletions slider@mohammad-sn/files/slider@mohammad-sn/po/de.po
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# SOME DESCRIPTIVE TITLE.
# SLIDER
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# mohammad-sn, 2017
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-03-02 21:59+0000\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
"extensions/issues\n"
"POT-Creation-Date: 2024-09-26 21:42-0400\n"
"PO-Revision-Date: 2021-03-02 23:00+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
Expand All @@ -18,6 +19,18 @@ msgstr ""
"X-Generator: Poedit 2.3\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. extension.js:133
msgid "ERROR"
msgstr ""

#. extension.js:133
msgid "Slider was NOT enabled"
msgstr ""

#. extension.js:134
msgid "This extension is currently incompatible with your version of Cinnamon."
msgstr ""

#. metadata.json->description
msgid "Yet another nice transition effect for ws switching."
msgstr "Ein schöner Übergangseffekt beim Wechsel der Arbeitsflächen."
Expand Down Expand Up @@ -53,93 +66,3 @@ msgstr "Hintergrund vergrößern um:"
#. settings-schema.json->vertical-position->description
msgid "Background Vertical Position:"
msgstr "Vertikale Position des Hintergrundes:"

#~ msgid "easeInOutBounce"
#~ msgstr "easeInOutBounce"

#~ msgid "easeInOutExpo"
#~ msgstr "easeInOutExpo"

#~ msgid "easeOutCubic"
#~ msgstr "easeOutCubic"

#~ msgid "easeInOutCubic"
#~ msgstr "easeInOutCubic"

#~ msgid "easeInOutCirc"
#~ msgstr "easeInOutCirc"

#~ msgid "easeInQuart"
#~ msgstr "easeInQuart"

#~ msgid "easeInBounce"
#~ msgstr "easeInBounce"

#~ msgid "easeOutQuad"
#~ msgstr "easeOutQuad"

#~ msgid "easeInQuint"
#~ msgstr "easeInQuint"

#~ msgid "easeOutElastic"
#~ msgstr "easeOutElastic"

#~ msgid "easeOutQuint"
#~ msgstr "easeOutQuint"

#~ msgid "easeInOutElastic"
#~ msgstr "easeInOutElastic"

#~ msgid "easeInExpo"
#~ msgstr "easeInExpo"

#~ msgid "easeInOutSine"
#~ msgstr "easeInOutSine"

#~ msgid "easeInOutQuad"
#~ msgstr "easeInOutQuad"

#~ msgid "easeInQuad"
#~ msgstr "easeInQuad"

#~ msgid "easeOutSine"
#~ msgstr "easeOutSine"

#~ msgid "easeOutExpo"
#~ msgstr "easeOutExpo"

#~ msgid "easeOutBounce"
#~ msgstr "easeOutBounce"

#~ msgid "easeOutBack"
#~ msgstr "easeOutBack"

#~ msgid "easeInOutQuint"
#~ msgstr "easeInOutQuint"

#~ msgid "easeOutCirc"
#~ msgstr "easeOutCirc"

#~ msgid "easeInCirc"
#~ msgstr "easeInCirc"

#~ msgid "easeInElastic"
#~ msgstr "easeInElastic"

#~ msgid "easeInBack"
#~ msgstr "easeInBack"

#~ msgid "easeInSine"
#~ msgstr "easeInSine"

#~ msgid "easeOutQuart"
#~ msgstr "easeOutQuart"

#~ msgid "easeInOutQuart"
#~ msgstr "easeInOutQuart"

#~ msgid "easeInCubic"
#~ msgstr "easeInCubic"

#~ msgid "easeInOutBack"
#~ msgstr "easeInOutBack"
21 changes: 17 additions & 4 deletions slider@mohammad-sn/files/slider@mohammad-sn/po/es.po
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# SOME DESCRIPTIVE TITLE.
# SLIDER
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# mohammad-sn, 2017
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-03-02 21:59+0000\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
"extensions/issues\n"
"POT-Creation-Date: 2024-09-26 21:42-0400\n"
"PO-Revision-Date: 2023-11-03 12:02-0300\n"
"Last-Translator: \n"
"Language-Team: \n"
Expand All @@ -17,6 +18,18 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.4\n"

#. extension.js:133
msgid "ERROR"
msgstr ""

#. extension.js:133
msgid "Slider was NOT enabled"
msgstr ""

#. extension.js:134
msgid "This extension is currently incompatible with your version of Cinnamon."
msgstr ""

#. metadata.json->description
msgid "Yet another nice transition effect for ws switching."
msgstr "Otro bonito efecto de transición para cambiar de espacio de trabajo."
Expand Down
Loading

0 comments on commit 53e862a

Please sign in to comment.