Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix on Gnome 42 #1

Merged
merged 8 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"extension": "datetime-format",
"domain": "Daniel-Khodabakhsh.github.com",
"description": "Allow users to customise the datetime format on the clock panel and lock screen.",
"gnomeShellVersions": ["40.0"],
"gnomeShellVersions": [
"40.0",
"42.0"
],
"url": "https://github.com/Daniel-Khodabakhsh/datetime-format"
}
4 changes: 2 additions & 2 deletions src/EditWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/// @param {Settings} settings - Settings object.
/// @param {Object} language - Language map.
///
const Class = function (parent, gladeFile, settings, language) {
var Class = function (parent, gladeFile, settings, language) {
const GLib = imports.gi.GLib;
const Utilities = imports.misc.extensionUtils.getCurrentExtension().imports.Utilities;

Expand Down Expand Up @@ -108,7 +108,7 @@ const Class = function (parent, gladeFile, settings, language) {
///
this.showWindow = function (formatTarget, formatTargetObject, updateParentPreview, name) {
title.set_text(name + " - " + language.format);
window.set_transient_for(parent.get_parent().get_parent());
window.set_transient_for(parent.get_root());
formatEntry.set_text(settings.getFormat(formatTarget));
formatEntry.select_region(0, -1);
formatEntry.grab_focus();
Expand Down
4 changes: 2 additions & 2 deletions src/FormatTarget.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/// @param {Settings} settings - Settings object.
/// @param {EditWindow} editWindow - Edit window to show when the settings button is pressed.
///
const create = function (container, formatTarget, builder, settings, editWindow) {
var create = function (container, formatTarget, builder, settings, editWindow) {
const GLib = imports.gi.GLib;
const extension = imports.misc.extensionUtils.getCurrentExtension();
const formatTargetObject = extension.imports.formatTargets[formatTarget];
Expand Down Expand Up @@ -59,5 +59,5 @@ const create = function (container, formatTarget, builder, settings, editWindow)
editWindow.showWindow(formatTarget, formatTargetObject, updatePreview, name);
});

container.append(builder.get_object("formatTargetBox"), false, true, 0);
container.append(builder.get_object("formatTargetBox"));
};
4 changes: 2 additions & 2 deletions src/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
///
/// Settings constructor.
///
const Class = function () {
var Class = function () {
const Gio = imports.gi.Gio;
const extension = imports.misc.extensionUtils.getCurrentExtension();

Expand Down Expand Up @@ -64,4 +64,4 @@ const Class = function () {
this.setToggle = function (formatTarget, value) {
settings.set_boolean(toggleKey(formatTarget), value);
};
};
};
6 changes: 3 additions & 3 deletions src/formatTargets/DateMenuDate.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const name = {
var name = {
en: "Date Menu: Date",
fr: "Menu de date: Date",
ja: "日付メニュー:日付"
};

const defaultFormat = "%B %e %Y";
var defaultFormat = "%B %e %Y";

let dateLabel;
let dateTimeDisplay;
Expand All @@ -28,4 +28,4 @@ function disable() {

function update(format) {
dateTimeDisplay.set_text(format);
}
}
6 changes: 3 additions & 3 deletions src/formatTargets/DateMenuDay.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const name = {
var name = {
en: "Date Menu: Day",
fr: "Menu de date: Jour",
ja: "日付メニュー:日"
};

const defaultFormat = "%A";
var defaultFormat = "%A";

let dayLabel;
let dateTimeDisplay;
Expand All @@ -29,4 +29,4 @@ function disable() {

function update(format) {
dateTimeDisplay.set_text(format);
}
}
6 changes: 3 additions & 3 deletions src/formatTargets/StatusBar.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const name = {
var name = {
en: "Status Bar",
fr: "Barre d'état",
ja: "ステータスバー"
};

const defaultFormat = "%c";
var defaultFormat = "%c";

let clockDisplay;
let dateTimeDisplay;
Expand All @@ -28,4 +28,4 @@ function disable() {

function update(format) {
dateTimeDisplay.set_text(format);
}
}
3 changes: 2 additions & 1 deletion src/prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

const Gtk = imports.gi.Gtk;
const GLib = imports.gi.GLib;
const ByteArray = imports.byteArray;
const extension = imports.misc.extensionUtils.getCurrentExtension();
const Utilities = extension.imports.Utilities;

Expand Down Expand Up @@ -83,7 +84,7 @@ function fileExists(file) {
/// @return {string} File contents.
///
function readFile(file) {
return String(GLib.file_get_contents(filePath(file))[1]);
return ByteArray.toString(GLib.file_get_contents(filePath(file))[1]);
}

///
Expand Down