@@ -55,7 +55,7 @@ public SettingWindowViewModel(Updater updater, IPortable portable)
55
55
// TODO: CurrentCulture may equal to settings.language when this is constructed
56
56
TimeFormatDisplayList = TimeFormatList . Select ( x => DateTime . Now . ToString ( x , CultureInfo . CurrentCulture ) ) . ToList ( ) ;
57
57
DateFormatDisplayList = DateFormatList . Select ( x => DateTime . Now . ToString ( x , CultureInfo . CurrentCulture ) ) . ToList ( ) ;
58
- UpdateSettingsDateTimeFormat ( ) ; // just in case something wrong
58
+ // UpdateSettingsDateTimeFormat(); // just in case something wrong
59
59
}
60
60
61
61
public Settings Settings { get ; set ; }
@@ -64,7 +64,7 @@ public async void UpdateApp()
64
64
{
65
65
await _updater . UpdateAppAsync ( App . API , false ) ;
66
66
}
67
-
67
+
68
68
public bool AutoUpdates
69
69
{
70
70
get => Settings . AutoUpdates ;
@@ -310,11 +310,11 @@ public IList<PluginStoreItemViewModel> ExternalPlugins
310
310
}
311
311
}
312
312
313
- private IList < PluginStoreItemViewModel > LabelMaker ( IList < UserPlugin > list )
313
+ private IList < PluginStoreItemViewModel > LabelMaker ( IList < UserPlugin > list )
314
314
{
315
- return list . Select ( p=> new PluginStoreItemViewModel ( p ) )
315
+ return list . Select ( p => new PluginStoreItemViewModel ( p ) )
316
316
. OrderByDescending ( p => p . Category == PluginStoreItemViewModel . NewRelease )
317
- . ThenByDescending ( p=> p . Category == PluginStoreItemViewModel . RecentlyUpdated )
317
+ . ThenByDescending ( p => p . Category == PluginStoreItemViewModel . RecentlyUpdated )
318
318
. ThenByDescending ( p => p . Category == PluginStoreItemViewModel . None )
319
319
. ThenByDescending ( p => p . Category == PluginStoreItemViewModel . Installed )
320
320
. ToList ( ) ;
@@ -348,10 +348,10 @@ private async Task RefreshExternalPluginsAsync()
348
348
349
349
internal void DisplayPluginQuery ( string queryToDisplay , PluginPair plugin , int actionKeywordPosition = 0 )
350
350
{
351
- var actionKeyword = plugin . Metadata . ActionKeywords . Count == 0
352
- ? string . Empty
351
+ var actionKeyword = plugin . Metadata . ActionKeywords . Count == 0
352
+ ? string . Empty
353
353
: plugin . Metadata . ActionKeywords [ actionKeywordPosition ] ;
354
-
354
+
355
355
App . API . ChangeQuery ( $ "{ actionKeyword } { queryToDisplay } ") ;
356
356
App . API . ShowMainWindow ( ) ;
357
357
}
@@ -476,9 +476,27 @@ public List<SearchWindowPosition> SearchWindowPositions
476
476
"dd', 'MMMM"
477
477
} ;
478
478
479
- public int TimeFormatIndex { get ; set ; } = 0 ;
479
+ private int timeFormatIndex = 0 ;
480
+ public int TimeFormatIndex
481
+ {
482
+ get => timeFormatIndex ;
483
+ set
484
+ {
485
+ timeFormatIndex = value ;
486
+ Settings . TimeFormat = TimeFormatList [ TimeFormatIndex ] ;
487
+ }
488
+ }
480
489
481
- public int DateFormatIndex { get ; set ; } = 0 ;
490
+ private int dateFormatIndex = 0 ;
491
+ public int DateFormatIndex
492
+ {
493
+ get => dateFormatIndex ;
494
+ set
495
+ {
496
+ dateFormatIndex = value ;
497
+ Settings . DateFormat = DateFormatList [ DateFormatIndex ] ;
498
+ }
499
+ }
482
500
483
501
public List < string > TimeFormatDisplayList { get ; set ; } = null ;
484
502
@@ -505,7 +523,7 @@ public void UpdateDateTimeDisplayList(int dateIndex, int timeIndex)
505
523
DateFormatDisplayList [ i ] = DateTime . Now . ToString ( DateFormatList [ i ] , CultureInfo . CurrentCulture ) ;
506
524
}
507
525
508
- UpdateSettingsDateTimeFormat ( ) ;
526
+ // UpdateSettingsDateTimeFormat();
509
527
}
510
528
511
529
public double WindowWidthSize
@@ -815,15 +833,15 @@ public string Version
815
833
}
816
834
}
817
835
public string ActivatedTimes => string . Format ( _translater . GetTranslation ( "about_activate_times" ) , Settings . ActivateTimes ) ;
818
-
836
+
819
837
public string CheckLogFolder
820
838
{
821
- get
839
+ get
822
840
{
823
841
var dirInfo = new DirectoryInfo ( Path . Combine ( DataLocation . DataDirectory ( ) , Constant . Logs , Constant . Version ) ) ;
824
842
long size = dirInfo . EnumerateFiles ( "*" , SearchOption . AllDirectories ) . Sum ( file => file . Length ) ;
825
-
826
- return _translater . GetTranslation ( "clearlogfolder" ) + " (" + FormatBytes ( size ) + ")" ;
843
+
844
+ return _translater . GetTranslation ( "clearlogfolder" ) + " (" + FormatBytes ( size ) + ")" ;
827
845
}
828
846
}
829
847
0 commit comments