overview: Drop unused ShellInfo object
This object isn't used anymore and it's really easy to create a new system notification via the appropriate notification source. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3387>
This commit is contained in:

committed by
Marge Bot

parent
ab4f80b8ae
commit
7a874334ef
@ -16,9 +16,7 @@ export const ANIMATION_TIME = 250;
|
|||||||
import * as DND from './dnd.js';
|
import * as DND from './dnd.js';
|
||||||
import * as LayoutManager from './layout.js';
|
import * as LayoutManager from './layout.js';
|
||||||
import * as Main from './main.js';
|
import * as Main from './main.js';
|
||||||
import * as MessageTray from './messageTray.js';
|
|
||||||
import * as OverviewControls from './overviewControls.js';
|
import * as OverviewControls from './overviewControls.js';
|
||||||
import * as Params from '../misc/params.js';
|
|
||||||
import * as SwipeTracker from './swipeTracker.js';
|
import * as SwipeTracker from './swipeTracker.js';
|
||||||
import * as WindowManager from './windowManager.js';
|
import * as WindowManager from './windowManager.js';
|
||||||
import * as WorkspaceThumbnail from './workspaceThumbnail.js';
|
import * as WorkspaceThumbnail from './workspaceThumbnail.js';
|
||||||
@ -27,36 +25,6 @@ const DND_WINDOW_SWITCH_TIMEOUT = 750;
|
|||||||
|
|
||||||
const OVERVIEW_ACTIVATION_TIMEOUT = 0.5;
|
const OVERVIEW_ACTIVATION_TIMEOUT = 0.5;
|
||||||
|
|
||||||
class ShellInfo {
|
|
||||||
setMessage(title, options) {
|
|
||||||
options = Params.parse(options, {
|
|
||||||
undoCallback: null,
|
|
||||||
forFeedback: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
const source = MessageTray.getSystemSource();
|
|
||||||
let undoCallback = options.undoCallback;
|
|
||||||
let forFeedback = options.forFeedback;
|
|
||||||
|
|
||||||
if (!this._notification) {
|
|
||||||
this._notification = new MessageTray.Notification({
|
|
||||||
source,
|
|
||||||
isTransient: true,
|
|
||||||
forFeedback,
|
|
||||||
});
|
|
||||||
this._notification.connect('destroy', () => delete this._notification);
|
|
||||||
}
|
|
||||||
this._notification.set({title});
|
|
||||||
|
|
||||||
this._notification.clearActions();
|
|
||||||
|
|
||||||
if (undoCallback)
|
|
||||||
this._notification.addAction(_('Undo'), () => undoCallback());
|
|
||||||
|
|
||||||
source.addNotification(this._notification);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const OverviewActor = GObject.registerClass(
|
const OverviewActor = GObject.registerClass(
|
||||||
class OverviewActor extends St.BoxLayout {
|
class OverviewActor extends St.BoxLayout {
|
||||||
_init() {
|
_init() {
|
||||||
@ -252,8 +220,6 @@ export class Overview extends Signals.EventEmitter {
|
|||||||
this._overview._delegate = this;
|
this._overview._delegate = this;
|
||||||
Main.layoutManager.overviewGroup.add_child(this._overview);
|
Main.layoutManager.overviewGroup.add_child(this._overview);
|
||||||
|
|
||||||
this._shellInfo = new ShellInfo();
|
|
||||||
|
|
||||||
Main.layoutManager.connect('monitors-changed', this._relayout.bind(this));
|
Main.layoutManager.connect('monitors-changed', this._relayout.bind(this));
|
||||||
this._relayout();
|
this._relayout();
|
||||||
|
|
||||||
@ -275,18 +241,6 @@ export class Overview extends Signals.EventEmitter {
|
|||||||
this._swipeTracker = swipeTracker;
|
this._swipeTracker = swipeTracker;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// options:
|
|
||||||
// - undoCallback (function): the callback to be called if undo support is needed
|
|
||||||
// - forFeedback (boolean): whether the message is for direct feedback of a user action
|
|
||||||
//
|
|
||||||
setMessage(text, options) {
|
|
||||||
if (this.isDummy)
|
|
||||||
return;
|
|
||||||
|
|
||||||
this._shellInfo.setMessage(text, options);
|
|
||||||
}
|
|
||||||
|
|
||||||
_changeShownState(state) {
|
_changeShownState(state) {
|
||||||
const {allowedTransitions} =
|
const {allowedTransitions} =
|
||||||
OVERVIEW_SHOWN_TRANSITIONS[this._shownState];
|
OVERVIEW_SHOWN_TRANSITIONS[this._shownState];
|
||||||
|
Reference in New Issue
Block a user