@@ -299,8 +299,8 @@ class SpicesUpdate extends IconApplet {
299
299
//~ logDebug("currentTime = "+currentTime);
300
300
const difference = parseInt ( currentTime - jsonModifTime ) ;
301
301
//~ logDebug("difference = "+difference);
302
- if ( difference > 720 ) {
303
- // the cache is older than 12 minutes (720 seconds)
302
+ if ( difference > 900 ) {
303
+ // the cache is older than 15 minutes (900 seconds)
304
304
is_to_download = true ;
305
305
break
306
306
}
@@ -888,8 +888,10 @@ class SpicesUpdate extends IconApplet {
888
888
} // End of _set_main_label
889
889
890
890
on_frequency_changed ( ) {
891
- source_remove ( this . loopId ) ;
892
- this . loopId = null ;
891
+ if ( this . loopId != null ) {
892
+ source_remove ( this . loopId ) ;
893
+ this . loopId = null ;
894
+ }
893
895
894
896
//~ let coeff = QUICK() ? 720 : 3600;
895
897
this . refreshInterval = 3600 * this . general_frequency ;
@@ -1549,7 +1551,7 @@ class SpicesUpdate extends IconApplet {
1549
1551
} else {
1550
1552
clearInterval ( id ) ;
1551
1553
}
1552
- } , ( type && this . new_Spices [ type ] && ( this . new_Spices [ type ] . length > 0 ) ) ? this . new_Spices [ type ] . length * 12000 : 12000 ) ;
1554
+ } , ( type && this . new_Spices [ type ] && ( this . new_Spices [ type ] . length > 0 ) ) ? this . new_Spices [ type ] . length * 15000 : 15000 ) ;
1553
1555
} // End of _on_forget_new_spices_pressed
1554
1556
1555
1557
download_image ( type , uuid ) {
@@ -1725,13 +1727,15 @@ class SpicesUpdate extends IconApplet {
1725
1727
} // End of monitor_png_directory
1726
1728
1727
1729
_on_pngDir_changed ( type ) {
1728
- clearTimeout ( this . timeoutId ) ;
1729
- this . timeoutId = null ;
1730
- this . timeoutId = setTimeout ( ( ) => {
1730
+ if ( this . timeoutId != null ) {
1731
+ clearTimeout ( this . timeoutId ) ;
1732
+ this . timeoutId = null ;
1733
+ }
1734
+ this . timeoutId = setTimeout ( ( ) => {
1731
1735
clearTimeout ( this . timeoutId ) ;
1732
1736
this . _on_refresh_pressed ( ) ;
1733
1737
this . timeoutId = null ;
1734
- } , 12000 ) ;
1738
+ } , 15000 ) ;
1735
1739
} // End of _on_pngDir_changed
1736
1740
1737
1741
monitor_metadatajson ( type , uuid ) {
@@ -1772,7 +1776,7 @@ class SpicesUpdate extends IconApplet {
1772
1776
clearTimeout ( this . timeoutId ) ;
1773
1777
this . _on_refresh_pressed ( ) ;
1774
1778
this . timeoutId = null ;
1775
- } , 12000 ) ;
1779
+ } , 15000 ) ;
1776
1780
}
1777
1781
} // End of _on_metadatajson_changed
1778
1782
@@ -1864,7 +1868,7 @@ class SpicesUpdate extends IconApplet {
1864
1868
this . menu . addMenuItem ( menuitemHead1 ) ;
1865
1869
this . menu . addMenuItem ( new PopupSeparatorMenuItem ( ) ) ;
1866
1870
1867
- if ( this . dependenciesMet ) {
1871
+ if ( this . dependenciesMet && ! this . isLooping ) {
1868
1872
// Refresh button
1869
1873
let refreshButton = new PopupIconMenuItem ( _ ( "Refresh" ) , "emblem-synchronizing-symbolic" , IconType . SYMBOLIC ) ;
1870
1874
refreshButton . connect ( "activate" , ( event ) => this . _on_refresh_pressed ( ) ) ;
@@ -2169,7 +2173,7 @@ class SpicesUpdate extends IconApplet {
2169
2173
if ( this . old_watch_message [ type ] . length > 0 ) this . tooltip_contents += "\n\u2604 %s" . format ( this . _clean_str ( this . old_watch_message [ type ] . replace ( / , / gi, "\n\t" ) ) ) ;
2170
2174
}
2171
2175
}
2172
- if ( ! tooltip_was_modified ) {
2176
+ if ( ! tooltip_was_modified && ! this . isLooping ) {
2173
2177
this . tooltip_contents += "\n%s" . format ( _ ( "Middle-Click to Refresh" ) ) ;
2174
2178
}
2175
2179
this . numberLabel . text = "" + ( this . nb_to_update + this . nb_to_watch ) ;
@@ -2180,7 +2184,8 @@ class SpicesUpdate extends IconApplet {
2180
2184
this . isProcessing = false ;
2181
2185
this . set_icon_color ( ) ;
2182
2186
} else {
2183
- this . tooltip_contents = "<b>" + this . default_tooltip + "</b>" + "\n%s" . format ( _ ( "Middle-Click to Refresh" ) ) ;
2187
+ this . tooltip_contents = "<b>" + this . default_tooltip + "</b>"
2188
+ if ( ! this . isLooping ) this . tooltip_contents += "\n%s" . format ( _ ( "Middle-Click to Refresh" ) ) ;
2184
2189
this . numberLabel . text = "" ;
2185
2190
this . isProcessing = false ;
2186
2191
this . set_icon_color ( ) ;
@@ -2232,9 +2237,10 @@ class SpicesUpdate extends IconApplet {
2232
2237
//~ logDebug("ONE MORE LOOP requested, but already looping");
2233
2238
this . isLooping = false ;
2234
2239
2235
- if ( this . loopId != null )
2240
+ if ( this . loopId != null ) {
2236
2241
source_remove ( this . loopId ) ;
2237
- this . loopId = null ;
2242
+ this . loopId = null ;
2243
+ }
2238
2244
2239
2245
this . loopId = timeout_add_seconds ( 10 , ( ) => this . updateLoop ( ) ) ;
2240
2246
//logDebug("updateLoop: Next in 10 sec.");
@@ -2244,8 +2250,10 @@ class SpicesUpdate extends IconApplet {
2244
2250
}
2245
2251
// logDebug("updateLoop: ONE MORE LOOP!");
2246
2252
this . isLooping = true ;
2247
- source_remove ( this . loopId ) ;
2248
- this . loopId = null ;
2253
+ if ( this . loopId != null ) {
2254
+ source_remove ( this . loopId ) ;
2255
+ this . loopId = null ;
2256
+ }
2249
2257
2250
2258
this . check_dependencies ( ) ;
2251
2259
@@ -2371,7 +2379,7 @@ class SpicesUpdate extends IconApplet {
2371
2379
this . do_rotation = false ;
2372
2380
if ( this . new_loop_requested === true ) {
2373
2381
this . new_loop_requested = false ;
2374
- this . refreshInterval = 12 ; // 12 seconds
2382
+ this . refreshInterval = 15 ; // 15 seconds
2375
2383
}
2376
2384
//// One more loop !
2377
2385
//this.loopId = timeout_add_seconds(this.refreshInterval, () => this.updateLoop());
@@ -2424,7 +2432,8 @@ class SpicesUpdate extends IconApplet {
2424
2432
_onButtonPressEvent ( actor , event ) {
2425
2433
if ( event . get_button ( ) == 2 ) {
2426
2434
if ( ( this . nb_to_update + this . nb_to_watch ) === 0 ) {
2427
- this . _on_refresh_pressed ( ) ;
2435
+ if ( ! this . isLooping )
2436
+ this . _on_refresh_pressed ( ) ;
2428
2437
} else {
2429
2438
this . open_each_download_tab ( ) ;
2430
2439
}
@@ -2450,12 +2459,14 @@ class SpicesUpdate extends IconApplet {
2450
2459
this . disable_system_auto_update ( ) ;
2451
2460
this . isLoopingForRefreshCache = false ;
2452
2461
let stoId = setTimeout ( ( ) => {
2453
- if ( stoId )
2462
+ if ( stoId ) {
2454
2463
clearTimeout ( stoId ) ;
2464
+ stoId = null ;
2465
+ }
2455
2466
if ( this . applet_running )
2456
2467
this . loopRefreshId = timeout_add_seconds ( 907 , ( ) => this . _loop_refresh_cache ( ) ) ;
2457
2468
this . _loop_refresh_cache ( ) ;
2458
- stoId = null ;
2469
+
2459
2470
} , 60000 ) ; // Wait 60 seconds for mintupdate to run correctly.
2460
2471
2461
2472
// Events:
@@ -2491,21 +2502,21 @@ class SpicesUpdate extends IconApplet {
2491
2502
}
2492
2503
2493
2504
on_applet_removed_from_panel ( ) {
2494
- this . on_applet_reloaded ( ) ;
2505
+ //~ this.on_applet_reloaded();
2495
2506
2496
2507
for ( let type of TYPES ) {
2497
2508
this . monitorsPngId [ type ] = 0 ;
2498
2509
this . cache [ type ] = "{}" ;
2499
2510
//~ this.oldCache[type] = "{}";
2500
2511
}
2501
2512
2502
- if ( this . settings ) {
2503
- try {
2504
- this . settings . finalize ( ) ;
2505
- } catch ( e ) {
2506
- logError ( e )
2507
- }
2508
- }
2513
+ //~ if (this.settings) {
2514
+ //~ try {
2515
+ //~ this.settings.finalize();
2516
+ //~ } catch(e) {
2517
+ //~ logError(e)
2518
+ //~ }
2519
+ //~ }
2509
2520
2510
2521
if ( Tweener . getTweenCount ( this . actor ) > 0 )
2511
2522
Tweener . removeTweens ( this . actor ) ;
0 commit comments