@@ -11,6 +11,16 @@ const Tweener = imports.ui.tweener;
1111const Util = imports . misc . util ;
1212const Settings = imports . ui . settings ;
1313const Gettext = imports . gettext ;
14+ const Extension = imports . ui . extension ;
15+ function _require ( relPath ) {
16+ if ( Extension . getCurrentExtension ) {
17+ var Me = Extension . getCurrentExtension ( ) ;
18+ return Me . imports [ relPath ] ;
19+ } else {
20+ return require ( relPath ) ;
21+ }
22+ }
23+
1424//Mainloop:
1525const { timeout_add_seconds,
1626 timeout_add,
@@ -21,8 +31,8 @@ const { timeout_add_seconds,
2131 source_exists,
2232 source_remove,
2333 remove_all_sources
24- } = require ( "./lib/mainloopTools" ) ;
25- const { to_string } = require ( "./lib/to-string" ) ;
34+ } = _require ( "./lib/mainloopTools" ) ;
35+ const { to_string } = _require ( "./lib/to-string" ) ;
2636
2737
2838const UUID = "AlbumArt3.0@claudiux" ;
@@ -49,17 +59,18 @@ Gettext.bindtextdomain(UUID, HOME_DIR + "/.local/share/locale");
4959Gettext . bindtextdomain ( "cinnamon" , "/usr/share/locale" ) ;
5060function _ ( str ) {
5161 let customTrans = Gettext . dgettext ( UUID , str ) ;
52- if ( customTrans . length > 0 && customTrans !== str )
53- return customTrans ;
54- customTrans = Gettext . dgettext ( "cinnamon" , str ) ;
55- if ( customTrans . length > 0 && customTrans !== str )
56- return customTrans ;
57- return Gettext . gettext ( str ) ;
62+ return customTrans ;
63+ //~ if (customTrans.length > 0 && customTrans !== str)
64+ //~ return customTrans;
65+ //~ customTrans = Gettext.dgettext("cinnamon", str);
66+ //~ if (customTrans.length > 0 && customTrans !== str)
67+ //~ return customTrans;
68+ //~ return Gettext.gettext(str);
5869}
5970
6071
6172
62- class AlbumArtRadio30 extends Desklet . Desklet {
73+ var AlbumArtRadio30 = class AlbumArtRadio30 extends Desklet . Desklet {
6374 constructor ( metadata , desklet_id ) {
6475 super ( metadata , desklet_id ) ;
6576
@@ -295,14 +306,14 @@ class AlbumArtRadio30 extends Desklet.Desklet {
295306
296307 if ( ! this . isLooping ) return false ;
297308 this . _update ( ) ;
298-
309+
299310 if ( this . isLooping ) {
300311 if ( this . oldRealWidth != this . realWidth || this . oldRealHeight != this . realHeight ) {
301312 this . oldRealWidth = this . realWidth ;
302313 this . oldRealHeight = this . realHeight ;
303314 this . on_setting_changed ( ) ;
304315 }
305-
316+
306317 this . update_id = timeout_add_seconds ( this . delay , ( ) => { this . _update_loop ( ) } ) ;
307318 } else {
308319 return false ;
@@ -432,7 +443,7 @@ class AlbumArtRadio30 extends Desklet.Desklet {
432443 } else {
433444 if ( this . _bin != null ) this . _bin . set_child ( this . currentPicture ) ;
434445 }
435-
446+
436447 this . updateInProgress = false ;
437448 }
438449
0 commit comments