Skip to content

Commit

Permalink
remove the unlock mode, after the discussion with the gnome devs
Browse files Browse the repository at this point in the history
  • Loading branch information
omid committed Jun 14, 2024
1 parent b9202db commit 909284b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 40 deletions.
21 changes: 11 additions & 10 deletions PersianCalendar@oxygenws.com/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const PersianCalendar = GObject.registerClass(
this._events = new Events(this._settings, this._str);
this._openPreferences = () => this._extension.openPreferences();

this.event_hooks = [];
this.eventHooks = [];
super._init(0.0);

this.label = new St.Label({
Expand All @@ -56,12 +56,12 @@ const PersianCalendar = GObject.registerClass(
if (this._settings.get_boolean('custom-color')) {
this.label.set_style(`color:${this._settings.get_string('color')}`);
}
this.event_hooks.push(this._settings.connect('changed::color', () => {
this.eventHooks.push(this._settings.connect('changed::color', () => {
if (this._settings.get_boolean('custom-color')) {
this.label.set_style(`color:${this._settings.get_string('color')}`);
}
}));
this.event_hooks.push(this._settings.connect('changed::custom-color', () => {
this.eventHooks.push(this._settings.connect('changed::custom-color', () => {
if (this._settings.get_boolean('custom-color')) {
this.label.set_style(`color:${this._settings.get_string('color')}`);
} else {
Expand All @@ -70,17 +70,17 @@ const PersianCalendar = GObject.registerClass(
}));

///
this.event_hooks.push(this._settings.connect('changed::widget-format', () => this._updateDate(true, true)));
this.eventHooks.push(this._settings.connect('changed::widget-format', () => this._updateDate(true, true)));

this.event_hooks.push(this._settings.connect('changed::position', () => {
this.eventHooks.push(this._settings.connect('changed::position', () => {
this.reload();
}));

this.event_hooks.push(this._settings.connect('changed::language', () => {
this.eventHooks.push(this._settings.connect('changed::language', () => {
this.reload();
}));

this.event_hooks.push(this._settings.connect('changed::index', () => {
this.eventHooks.push(this._settings.connect('changed::index', () => {
this.reload();
}));

Expand Down Expand Up @@ -124,7 +124,8 @@ const PersianCalendar = GObject.registerClass(
});
this.menu.addMenuItem(this._actionButtonsPart);
this._genActionButtonsPart();
this.event_hooks.push(Main.sessionMode.connect('updated', () => this._genActionButtonsPart()));
// uncomment this in case you want to have `unlock-dialog` session mode
// this.eventHooks.push(Main.sessionMode.connect('updated', () => this._genActionButtonsPart()));

this.menu.connect('open-state-changed', (isOpen) => {
if (isOpen) {
Expand Down Expand Up @@ -530,7 +531,7 @@ const PersianCalendar = GObject.registerClass(

disable() {
let ext = this._extension;
ext._indicator.event_hooks.forEach(id => ext._settings.disconnect(id));
ext._indicator.eventHooks.forEach(id => ext._settings.disconnect(id));
ext._indicator.destroy();
GLib.source_remove(ext._timer);
ext._gettext.unload_locale();
Expand Down Expand Up @@ -575,7 +576,7 @@ export default class PersianCalendarExtension extends Extension {
}

disable() {
this._indicator.event_hooks.forEach(id => this._settings.disconnect(id));
this._indicator.eventHooks.forEach(id => this._settings.disconnect(id));
this._indicator.destroy();
GLib.source_remove(this._timer);
this._gettext.unload_locale();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-14 12:56+0200\n"
"POT-Creation-Date: 2024-06-14 15:17+0200\n"
"PO-Revision-Date: 2022-04-02 12:52+0430\n"
"Last-Translator: eshagh <eshagh094@gmail.com>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -433,56 +433,56 @@ msgid "Zihajje"
msgstr "ذیحجه"

#. Add date conversion button
#: PersianCalendar@oxygenws.com/extension.js:260
#: PersianCalendar@oxygenws.com/extension.js:261
msgid "Date conversion"
msgstr "تبدیل تاریخ"

#: PersianCalendar@oxygenws.com/extension.js:281
#: PersianCalendar@oxygenws.com/extension.js:282
msgid "from Persian"
msgstr "از هـ.خورشیدی"

#: PersianCalendar@oxygenws.com/extension.js:293
#: PersianCalendar@oxygenws.com/extension.js:294
msgid "from Gregorian"
msgstr "از میلادی"

#: PersianCalendar@oxygenws.com/extension.js:305
#: PersianCalendar@oxygenws.com/extension.js:306
msgid "from Hijri"
msgstr "از هـ.قمری"

#: PersianCalendar@oxygenws.com/extension.js:328
#: PersianCalendar@oxygenws.com/extension.js:329
msgid "year"
msgstr "سال"

#: PersianCalendar@oxygenws.com/extension.js:337
#: PersianCalendar@oxygenws.com/extension.js:338
msgid "month"
msgstr "ماه"

#: PersianCalendar@oxygenws.com/extension.js:346
#: PersianCalendar@oxygenws.com/extension.js:347
msgid "day"
msgstr "روز"

#: PersianCalendar@oxygenws.com/extension.js:481
#: PersianCalendar@oxygenws.com/extension.js:482
#, javascript-format
msgid "%d month and 1 day left to Nowruz %d"
msgid_plural "%d months and 1 day left to Nowruz %d"
msgstr[0] "%d ماه و ۱ روز مانده به نوروز %d"
msgstr[1] "%d ماه و ۱ روز مانده به نوروز %d"

#: PersianCalendar@oxygenws.com/extension.js:487
#: PersianCalendar@oxygenws.com/extension.js:488
#, javascript-format
msgid "%d month and %d days left to Nowruz %d"
msgid_plural "%d months and %d days left to Nowruz %d"
msgstr[0] "%d ماه و %d روز مانده به نوروز %d"
msgstr[1] "%d ماه و %d روز مانده به نوروز %d"

#: PersianCalendar@oxygenws.com/extension.js:495
#: PersianCalendar@oxygenws.com/extension.js:496
#, javascript-format
msgid "%d day left to Nowruz %d"
msgid_plural "%d days left to Nowruz %d"
msgstr[0] "%d روز مانده به نوروز %d"
msgstr[1] "%d روز مانده به نوروز %d"

#: PersianCalendar@oxygenws.com/extension.js:501
#: PersianCalendar@oxygenws.com/extension.js:502
msgid "Happy New Year"
msgstr "سال نو مبارک"

Expand Down
24 changes: 12 additions & 12 deletions PersianCalendar@oxygenws.com/locale/persian-calendar.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-14 13:02+0200\n"
"POT-Creation-Date: 2024-06-14 15:17+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -433,56 +433,56 @@ msgid "Zihajje"
msgstr ""

#. Add date conversion button
#: PersianCalendar@oxygenws.com/extension.js:260
#: PersianCalendar@oxygenws.com/extension.js:261
msgid "Date conversion"
msgstr ""

#: PersianCalendar@oxygenws.com/extension.js:281
#: PersianCalendar@oxygenws.com/extension.js:282
msgid "from Persian"
msgstr ""

#: PersianCalendar@oxygenws.com/extension.js:293
#: PersianCalendar@oxygenws.com/extension.js:294
msgid "from Gregorian"
msgstr ""

#: PersianCalendar@oxygenws.com/extension.js:305
#: PersianCalendar@oxygenws.com/extension.js:306
msgid "from Hijri"
msgstr ""

#: PersianCalendar@oxygenws.com/extension.js:328
#: PersianCalendar@oxygenws.com/extension.js:329
msgid "year"
msgstr ""

#: PersianCalendar@oxygenws.com/extension.js:337
#: PersianCalendar@oxygenws.com/extension.js:338
msgid "month"
msgstr ""

#: PersianCalendar@oxygenws.com/extension.js:346
#: PersianCalendar@oxygenws.com/extension.js:347
msgid "day"
msgstr ""

#: PersianCalendar@oxygenws.com/extension.js:481
#: PersianCalendar@oxygenws.com/extension.js:482
#, javascript-format
msgid "%d month and 1 day left to Nowruz %d"
msgid_plural "%d months and 1 day left to Nowruz %d"
msgstr[0] ""
msgstr[1] ""

#: PersianCalendar@oxygenws.com/extension.js:487
#: PersianCalendar@oxygenws.com/extension.js:488
#, javascript-format
msgid "%d month and %d days left to Nowruz %d"
msgid_plural "%d months and %d days left to Nowruz %d"
msgstr[0] ""
msgstr[1] ""

#: PersianCalendar@oxygenws.com/extension.js:495
#: PersianCalendar@oxygenws.com/extension.js:496
#, javascript-format
msgid "%d day left to Nowruz %d"
msgid_plural "%d days left to Nowruz %d"
msgstr[0] ""
msgstr[1] ""

#: PersianCalendar@oxygenws.com/extension.js:501
#: PersianCalendar@oxygenws.com/extension.js:502
msgid "Happy New Year"
msgstr ""

Expand Down
7 changes: 1 addition & 6 deletions PersianCalendar@oxygenws.com/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,5 @@
],
"url": "https://github.com/omid/Persian-Calendar-for-Gnome-Shell",
"uuid": "PersianCalendar@oxygenws.com",
"session-modes": [
"user",
"unlock-dialog",
"gdm"
],
"version": 113
"version": 114
}

0 comments on commit 909284b

Please sign in to comment.