@@ -8,75 +8,75 @@ import { Window } from "./window.js";
8
8
export const Settings = new Gio . Settings ( { schema : pkg . name } ) ;
9
9
10
10
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" ) ;
58
64
}
59
65
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
+ }
65
68
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
+ }
72
72
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 ( ) ;
75
75
76
- const window = this . get_active_window ( ) ;
76
+ const window = this . get_active_window ( ) ;
77
77
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 ] ) ;
81
80
}
81
+ }
82
82
}
0 commit comments