-
Notifications
You must be signed in to change notification settings - Fork 9
/
showErrorPopup.js
51 lines (46 loc) · 1.92 KB
/
showErrorPopup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* LICENSE INFORMATION
*
* Desktop Icons: Neo - A desktop icons extension for GNOME with numerous features,
* customizations, and optimizations.
*
* Copyright 2021 Abdurahman Elmawi ([email protected])
*
* This project is based on Desktop Icons NG (https://gitlab.com/rastersoft/desktop-icons-ng),
* a desktop icons extension for GNOME licensed under the GPL v3.
*
* This project is free and open source software as described in the GPL v3.
*
* This project (Desktop Icons: Neo) is licensed under the GPL v3. To view the details of this license,
* visit https://www.gnu.org/licenses/gpl-3.0.html for the necessary information
* regarding this project's license.
*/
const Gtk = imports.gi.Gtk;
const Pango = imports.gi.Pango;
const DesktopIconsUtil = imports.desktopIconsUtil;
const Gettext = imports.gettext.domain('desktopicons-neo');
const _ = Gettext.gettext;
var ShowErrorPopup = class {
constructor(text, secondaryText, parentWindow, modal) {
this._window = new Gtk.MessageDialog({window_position: Gtk.WindowPosition.CENTER_ON_PARENT,
transient_for: parentWindow,
message_type: Gtk.MessageType.ERROR,
buttons: Gtk.ButtonsType.NONE,
text: text,
secondary_text: secondaryText});
DesktopIconsUtil.windowHidePagerTaskbarModal(this._window, true);
let deleteButton = this._window.add_button(_("Close"), Gtk.ResponseType.OK);
if (modal) {
deleteButton.connect('clicked', () => {
this._window.hide();
this._window.destroy();
});
this._window.show();
}
}
run() {
this._window.show();
this._window.run();
this._window.hide();
this._window.destroy();
}
};