Skip to content
This repository was archived by the owner on Mar 11, 2024. It is now read-only.

Commit 1b12aee

Browse files
BlobCodesvixalien
authored andcommitted
Reformat code
1 parent ef358ff commit 1b12aee

File tree

1 file changed

+64
-64
lines changed

1 file changed

+64
-64
lines changed

src/application.ts

+64-64
Original file line numberDiff line numberDiff line change
@@ -8,75 +8,75 @@ import { Window } from "./window.js";
88
export const Settings = new Gio.Settings({ schema: pkg.name });
99

1010
export class Application extends Adw.Application {
11-
private window?: Window;
12-
13-
static {
14-
GObject.registerClass(this);
15-
}
16-
17-
constructor() {
18-
super({
19-
application_id: pkg.name,
20-
resource_base_path: "/com/vixalien/decibels",
21-
flags: Gio.ApplicationFlags.HANDLES_OPEN,
22-
});
23-
24-
const quit_action = new Gio.SimpleAction({ name: "quit" });
25-
quit_action.connect("activate", () => {
26-
this.quit();
27-
});
28-
29-
this.add_action(quit_action);
30-
this.set_accels_for_action("app.quit", ["<Control>q"]);
31-
32-
this.set_accels_for_action("win.open-file", ["<Control>o"]);
33-
34-
const show_about_action = new Gio.SimpleAction({ name: "about" });
35-
show_about_action.connect("activate", () => {
36-
const aboutWindow = Adw.AboutWindow.new_from_appdata(
37-
"/com/vixalien/decibels/com.vixalien.decibels.metainfo.xml",
38-
// remove commit tag
39-
pkg.version.split("-")[0],
40-
);
41-
aboutWindow.set_version(pkg.version);
42-
aboutWindow.set_developers([
43-
"Angelo Verlain https://vixalien.com",
44-
"David Keller https://gitlab.com/BlobCodes"
45-
]);
46-
aboutWindow.set_artists(["kramo https://kramo.hu"]);
47-
aboutWindow.set_designers(["Allan Day"]);
48-
aboutWindow.set_transient_for(this.get_active_window());
49-
/* Translators: Replace "translator-credits" with your names, one name per line */
50-
aboutWindow.set_translator_credits(_("translator-credits"));
51-
52-
aboutWindow.present();
53-
});
54-
55-
this.add_action(show_about_action);
56-
57-
Gio._promisify(Gtk.UriLauncher.prototype, "launch", "launch_finish");
11+
private window?: Window;
12+
13+
static {
14+
GObject.registerClass(this);
15+
}
16+
17+
constructor() {
18+
super({
19+
application_id: pkg.name,
20+
resource_base_path: "/com/vixalien/decibels",
21+
flags: Gio.ApplicationFlags.HANDLES_OPEN,
22+
});
23+
24+
const quit_action = new Gio.SimpleAction({ name: "quit" });
25+
quit_action.connect("activate", () => {
26+
this.quit();
27+
});
28+
29+
this.add_action(quit_action);
30+
this.set_accels_for_action("app.quit", ["<Control>q"]);
31+
32+
this.set_accels_for_action("win.open-file", ["<Control>o"]);
33+
34+
const show_about_action = new Gio.SimpleAction({ name: "about" });
35+
show_about_action.connect("activate", () => {
36+
const aboutWindow = Adw.AboutWindow.new_from_appdata(
37+
"/com/vixalien/decibels/com.vixalien.decibels.metainfo.xml",
38+
// remove commit tag
39+
pkg.version.split("-")[0],
40+
);
41+
aboutWindow.set_version(pkg.version);
42+
aboutWindow.set_developers([
43+
"Angelo Verlain https://vixalien.com",
44+
"David Keller https://gitlab.com/BlobCodes",
45+
]);
46+
aboutWindow.set_artists(["kramo https://kramo.hu"]);
47+
aboutWindow.set_designers(["Allan Day"]);
48+
aboutWindow.set_transient_for(this.get_active_window());
49+
/* Translators: Replace "translator-credits" with your names, one name per line */
50+
aboutWindow.set_translator_credits(_("translator-credits"));
51+
52+
aboutWindow.present();
53+
});
54+
55+
this.add_action(show_about_action);
56+
57+
Gio._promisify(Gtk.UriLauncher.prototype, "launch", "launch_finish");
58+
}
59+
60+
private present_main_window(): void {
61+
if (!this.window) {
62+
this.window = new Window({ application: this });
63+
if (pkg.name.endsWith("Devel")) this.window.add_css_class("devel");
5864
}
5965

60-
private present_main_window(): void {
61-
if (!this.window) {
62-
this.window = new Window({ application: this });
63-
if (pkg.name.endsWith("Devel")) this.window.add_css_class("devel");
64-
}
66+
this.window.present();
67+
}
6568

66-
this.window.present();
67-
}
68-
69-
vfunc_activate(): void {
70-
this.present_main_window();
71-
}
69+
vfunc_activate(): void {
70+
this.present_main_window();
71+
}
7272

73-
vfunc_open(files: Gio.FilePrototype[], hint: string): void {
74-
this.present_main_window();
73+
vfunc_open(files: Gio.FilePrototype[], hint: string): void {
74+
this.present_main_window();
7575

76-
const window = this.get_active_window();
76+
const window = this.get_active_window();
7777

78-
if (window && window instanceof Window && files.length > 0) {
79-
window.load_file(files[0]);
80-
}
78+
if (window && window instanceof Window && files.length > 0) {
79+
window.load_file(files[0]);
8180
}
81+
}
8282
}

0 commit comments

Comments
 (0)