Skip to content

Commit

Permalink
Hide the time of saved session file by default unless the debugging m…
Browse files Browse the repository at this point in the history
…ode is enabled. Part of: #70
  • Loading branch information
nlpsuge committed Feb 25, 2023
1 parent f3f8dff commit 507f858
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
11 changes: 9 additions & 2 deletions saveSession.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

const { Shell, Gio, GLib, Meta } = imports.gi;

const Main = imports.ui.main;

const ByteArray = imports.byteArray;

const ExtensionUtils = imports.misc.extensionUtils;
Expand All @@ -20,7 +22,8 @@ const SubprocessUtils = Me.imports.utils.subprocessUtils;

var SaveSession = class {

constructor() {
constructor(notifyUser) {
this._notifyUser = notifyUser;
this._log = new Log.Log();

this._saveSessionIdleId = null;
Expand Down Expand Up @@ -447,7 +450,11 @@ var SaveSession = class {
try {
success = sessionFile.replace_contents_finish(asyncResult);
if (success) {
this._log.info(`Session saved to ${sessionFile.get_path()}!`);
const savedMsg = `Session ${sessionConfig.session_name} saved to ${sessionFile.get_path()}!`;
Log.Log.getDefault().info(`${savedMsg}`);
if (this._notifyUser) {
Main.notify(`Another Window Session Manager`, savedMsg);
}
resolve(success);
// TODO Notification
return;
Expand Down
2 changes: 1 addition & 1 deletion ui/popupMenuButtonItems.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ class PopupMenuButtonItemSave extends PopupMenuButtonItem {
this._addYesAndNoButtons();

this._log = new Log.Log();
this._saveSession = new SaveSession.SaveSession();
this._saveSession = new SaveSession.SaveSession(true);

this._timeline = this.createTimeLine();

Expand Down
7 changes: 4 additions & 3 deletions ui/sessionItemButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class SessionItemButtons extends GObject.Object {
this.sessionItem = sessionItem;

// TODO Nullify created object?
this._saveSession = new SaveSession.SaveSession();
this._saveSession = new SaveSession.SaveSession(true);
this._moveSession = new MoveSession.MoveSession();
this._closeSession = new CloseSession.CloseSession();

Expand All @@ -46,8 +46,6 @@ class SessionItemButtons extends GObject.Object {

addButtons() {
this._addTags();

this._addSeparator();

const saveButton = this._addButton('save-symbolic.svg');
new Tooltip.Tooltip({
Expand Down Expand Up @@ -175,6 +173,8 @@ class SessionItemButtons extends GObject.Object {
}

_addTags() {
if (Log.Log.getDefault().isDebug()) return;

// TODO Make the modification time align left

let button = new St.Button({
Expand All @@ -187,6 +187,7 @@ class SessionItemButtons extends GObject.Object {
}
this.sessionItem.actor.add_child(button);

this._addSeparator();
}

_addSeparator() {
Expand Down

0 comments on commit 507f858

Please sign in to comment.