From 838e5724079f1bcbd808ae37b6ca9a2bd2109ebf Mon Sep 17 00:00:00 2001 From: AlexanderSharykin Date: Mon, 19 Jun 2017 10:54:34 +0300 Subject: [PATCH] added config verification at startup --- Screenshots/Library Commander.png | Bin 14245 -> 14196 bytes Src/LibraryCommander/App.xaml.cs | 119 ++++++++++++++++-- .../Localization/LocalizationVm.cs | 5 + Src/LibraryCommander/MainWindow.xaml | 11 +- .../Properties/AssemblyInfo.cs | 4 +- .../Properties/Resources.Designer.cs | 36 ++++++ .../Properties/Resources.resx | 12 ++ .../Properties/Resources.ru-Ru.resx | 12 ++ Src/ViewModels/ILocalizationVm.cs | 5 + 9 files changed, 182 insertions(+), 22 deletions(-) diff --git a/Screenshots/Library Commander.png b/Screenshots/Library Commander.png index f32a60641a57e5d886969331456245838d6cd744..700cfa1423db9615a67151cb4611521c2cddc790 100644 GIT binary patch literal 14196 zcmeHuc~Dc?w)epa6#=_#2UI}Y0hO_3QXs^k6-5CjKx7E0fQ*q@0!dK1p}Q4nMGP`3 z2*{KmQ<##Vv>=3t5J-SP0%8IogdmwnLXsEy-gjSjy}s|OuU^$x-ydD64EyYpb@thN zt>0Sfx7Ydkg0q9>`t9oh0MI;p=KD(ku(AyRR(xE$Ms)-dr&Fi;Qj5CeZ~{Po*vVEk zRs|k+It~D@(>0d-R;$|UZlCdp0syVwmfvcbhFUuSzOP+aP zoazM$5Q`;eifU_nduDsgYx#DJykU?-0~Q;%Nj28cMjX&uU+0sz|Z45=rw0#;{_ z7zZmlXZnuY+S;-`%R5!)Rrjs(RehbRTy>(aBa*pCe|SgsX%J!UWr!MLNdt05U;Z(*KZL-gl?SFId=eu} zj?Q!;1svPW-sOmoOSoOI`iQ`#h`kU&R{a{+qcl1vX%21$U&sSBG!(}_RrolYqCJm zL{T8W>f=_Fx2dvcW%AVAon4?`p%sYYP~=fzyb0PxxLw<>8rdSWjC*M-V!?ecT)I5= z5JZaw%+AYO?Lvp5g|vJQ_N3{#QeY`<3A^2AiDgZuL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Q$ht!rl7m=xQ~AIuVQ?yi>$IE$mbP3tf89W60~cOnz5Nf=niorU#P9)tJ=f1=&C&1=Sqk8Xj#F!K%o1&eaZ)Wxfi{4pe3(h)83^p-G-opKU}Qm&mpm87hrX^Uw1E;kZF4j zY!!soNe(aPWB0OOw0>{Y=F4Lt<=AS+`lz?I@pZQtNo!-9;m9$Y@$P%rDXmvCfPI%x zU5zMuS!<1&x0Q&y)bQ6fz|TDyjDzNXdSVlidxBLT$hzA)->g#`oG{Osdy8e|HA?mu zP7@2b2S^s`qD5xxc#_t(_jEdaa(ui3scRq0IcuN5&GLa2NcX*wG=8v9u*zJVMQXC8 zGo*=`+3|&{8a2=GJ0e;JIudCo#x$cCz zK9a-#jAa9%y~|6w8b#Q4D&-i}X@v z2=pRtK+|p|E9Bv^rWLI~bnB{o+lY9-SFyy&UHbT+t8>(Ai>M4R#2>=xsb62I`RBPu z6S!0!9`t(^Vu}VNC2=R?d~et~StH`fXKcRkN@h1#WCR&3!5Ig^{*_a84bY^?eDC(<^NWcC^!CtLRFgTB4glh<;DM~fmMgFk8qFHs9P=u+)rFHGWIzF u4ivQiUZDIR{wBcN+yBRZ&Q9%Bs2*zvnKG().Query().FirstOrDefault(); + } + catch (Exception ex) + { + var m = new MessageVm { Text = Injector.Localization.DbConnectionError }; + + // cannot get data from SQLite db + if (ex is SQLiteException || ex.InnerException is SQLiteException) + m.Text += Environment.NewLine + Injector.Localization.SQLiteError; + + ShowMessage(m); + Application.Current.Shutdown(); + return; + } + + // restore last localization from settings + if (settings != null && String.IsNullOrWhiteSpace(settings.Culture) == false) + LocalizationProvider.CurrentCulture = new CultureInfo(settings.Culture); + string library = ConfigurationManager.AppSettings["library"]; + // Storage verification + if (false == Directory.Exists(library)) + { + var m = new MessageVm + { + Text = Injector.Localization.FolderNotFound + Environment.NewLine + + library + Environment.NewLine + + Injector.Localization.StorageError + }; + + ShowMessage(m); + Application.Current.Shutdown(); + return; + } + var args = Environment.GetCommandLineArgs(); Resources.MergedDictionaries.Clear(); // apply a skin @@ -65,23 +115,13 @@ private void App_OnStartup(object sender, StartupEventArgs e) c.Register(() => new FileFormatManager { Repository = new FileFormatRepository() }); c.Register(() => new BookManager { Repository = new BookRepository() }); - c.Register(() => new SearchNavigator(library) { Repository = new BookRepository() }); + c.Register(() => new SearchNavigator(library) { Repository = new BookRepository() }); c.Register(() => new VirtualFsNavigator(library) { BookRepository = new BookRepository(), CategoryRepository = new CategoryRepository() }); Injector.Container = c; - - var settings = new EntityRepository().Query().FirstOrDefault(); - - // configurate localization - if (settings != null && String.IsNullOrWhiteSpace(settings.Culture) == false) - LocalizationProvider.CurrentCulture = new CultureInfo(settings.Culture); - else - LocalizationProvider.CurrentCulture = Thread.CurrentThread.CurrentUICulture; - BusinessLogic.Localization.Instance = new LocalizationModel(); - Injector.Localization = new LocalizationVm(); StorageManager.StoragePath = library; UsageValidator.Repository = new BookRepository(); @@ -107,6 +147,10 @@ private void App_OnStartup(object sender, StartupEventArgs e) private void App_OnExit(object sender, ExitEventArgs e) { + // app initialization was not completed. quit without changing settings + if (_commander == null) + return; + // save app setting on Exit var rep = new EntityRepository(); var settings = rep.Query().FirstOrDefault() ?? new AppSettings(); @@ -124,5 +168,58 @@ private void App_OnExit(object sender, ExitEventArgs e) rep.SaveOrUpdate(settings); } + + private void ShowMessage(MessageVm m) + { + new WpfMessageBox().ShowDialog(m); + } + + private void ShowExceptionMessage(Exception ex, string source) + { + var m = new MessageVm + { + Text = ex.Message + Environment.NewLine + Injector.Localization.LogRequest, + Yes = true, + No = true, + }; + + // request to create log file + new WpfMessageBox().ShowDialog(m); + + if (m.DialogResult.ToString() != "Yes") + return; + + try + { + File.WriteAllLines("Log " + DateTime.Now.ToString("dd-mm-yy hh-MM-ss") + ".txt", + new[] + { + source, + ex.GetType().FullName, + ex.Message, + ex.StackTrace + }); + } + catch + { + // log write failed + } + } + + private void LogTaskSchedulerUnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs arg) + { + ShowExceptionMessage(arg.Exception, "TaskScheduler.UnobservedTaskException"); + } + + private void LogUnhandledDomainException(object sender, UnhandledExceptionEventArgs arg) + { + ShowExceptionMessage(arg.ExceptionObject as Exception, "AppDomain.CurrentDomain.UnhandledException: " + String.Format("IsTerminating = {0}", arg.IsTerminating)); + } + + private void LogUnhandledDispatcherException(object sender, DispatcherUnhandledExceptionEventArgs arg) + { + ShowExceptionMessage(arg.Exception, "DispatcherUnhandledException"); + arg.Handled = true; + } } } diff --git a/Src/LibraryCommander/Localization/LocalizationVm.cs b/Src/LibraryCommander/Localization/LocalizationVm.cs index a096b06..6cb6121 100644 --- a/Src/LibraryCommander/Localization/LocalizationVm.cs +++ b/Src/LibraryCommander/Localization/LocalizationVm.cs @@ -40,5 +40,10 @@ public class LocalizationVm: LocalizationProvider, ILocalizationVm public string FileNotFound { get { return GetResource(); } } public string FolderNotFound { get { return GetResource(); } } + + public string DbConnectionError { get { return GetResource(); } } + public string SQLiteError { get { return GetResource(); } } + public string StorageError { get { return GetResource(); } } + public string LogRequest { get { return GetResource(); } } } } diff --git a/Src/LibraryCommander/MainWindow.xaml b/Src/LibraryCommander/MainWindow.xaml index fad0a43..49a74fe 100644 --- a/Src/LibraryCommander/MainWindow.xaml +++ b/Src/LibraryCommander/MainWindow.xaml @@ -200,15 +200,8 @@ - - - - - - - - - + + diff --git a/Src/LibraryCommander/Properties/AssemblyInfo.cs b/Src/LibraryCommander/Properties/AssemblyInfo.cs index f3dde1d..1bf1def 100644 --- a/Src/LibraryCommander/Properties/AssemblyInfo.cs +++ b/Src/LibraryCommander/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/Src/LibraryCommander/Properties/Resources.Designer.cs b/Src/LibraryCommander/Properties/Resources.Designer.cs index a88fa33..a8c320e 100644 --- a/Src/LibraryCommander/Properties/Resources.Designer.cs +++ b/Src/LibraryCommander/Properties/Resources.Designer.cs @@ -150,6 +150,15 @@ internal static string CycleTitle { } } + /// + /// Looks up a localized string similar to Cannot connect to database.. + /// + internal static string DbConnectionError { + get { + return ResourceManager.GetString("DbConnectionError", resourceCulture); + } + } + /// /// Looks up a localized string similar to Delete. /// @@ -380,6 +389,15 @@ internal static string LanguageUsageWarning { } } + /// + /// Looks up a localized string similar to Create log file?. + /// + internal static string LogRequest { + get { + return ResourceManager.GetString("LogRequest", resourceCulture); + } + } + /// /// Looks up a localized string similar to Home Library. /// @@ -407,6 +425,24 @@ internal static string NullError { } } + /// + /// Looks up a localized string similar to If app was launched with default settings, file Books.db is possibly missing.. + /// + internal static string SQLiteError { + get { + return ResourceManager.GetString("SQLiteError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change "library" value in application .CONFIG file (should be full path of an existing folder). + /// + internal static string StorageError { + get { + return ResourceManager.GetString("StorageError", resourceCulture); + } + } + /// /// Looks up a localized string similar to Tags cannot be empty. /// diff --git a/Src/LibraryCommander/Properties/Resources.resx b/Src/LibraryCommander/Properties/Resources.resx index 37b4a20..5280134 100644 --- a/Src/LibraryCommander/Properties/Resources.resx +++ b/Src/LibraryCommander/Properties/Resources.resx @@ -247,4 +247,16 @@ Library contains book(s) in language [{0}] + + Cannot connect to database. + + + Create log file? + + + If app was launched with default settings, file Books.db is possibly missing. + + + Change "library" value in application .CONFIG file (should be full path of an existing folder) + \ No newline at end of file diff --git a/Src/LibraryCommander/Properties/Resources.ru-Ru.resx b/Src/LibraryCommander/Properties/Resources.ru-Ru.resx index e4fe79a..438b611 100644 --- a/Src/LibraryCommander/Properties/Resources.ru-Ru.resx +++ b/Src/LibraryCommander/Properties/Resources.ru-Ru.resx @@ -313,4 +313,16 @@ В библиотеке есть книги на языке [{0}] + + Не удалось подключиться к базе данных. + + + Создать файл с информацией об ошибке? + + + Возможно отсутствует файл Books.db, если приложение было запущено с настройками по умолчанию. + + + Заполните значение поля "library" в конфигурационном файле приложения (расширение .CONFIG). Укажите полный путь к существующему каталогу, который будет использоваться для хранения документов. + \ No newline at end of file diff --git a/Src/ViewModels/ILocalizationVm.cs b/Src/ViewModels/ILocalizationVm.cs index 776da94..950a25e 100644 --- a/Src/ViewModels/ILocalizationVm.cs +++ b/Src/ViewModels/ILocalizationVm.cs @@ -32,5 +32,10 @@ public interface ILocalizationVm string Library { get; } string FileNotFound { get; } string FolderNotFound { get; } + + string DbConnectionError { get; } + string SQLiteError { get; } + string StorageError { get; } + string LogRequest { get; } } }