From 2b355d5c86aba02aa015e95c2cfa3cea4d49fa6a Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Tue, 27 Sep 2016 13:24:05 +0300 Subject: [PATCH] Closes #119: win32: Show preferences if one of the paths doesn't exist. --- src/MainWindow.vala | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/MainWindow.vala b/src/MainWindow.vala index f8f55b0..c5f2b01 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -35,6 +35,10 @@ namespace LAview.Desktop { subprocess_dialog = new SubprocessDialog (application, window); about_dialog = new AboutDialogWindow (application, window); + #if (WINDOWS) + check_paths (); + #endif + fill_liststore_templates (); application.app_menu = builder.get_object ("menubar") as MenuModel; @@ -386,5 +390,15 @@ namespace LAview.Desktop { public void action_quit_activate (Gtk.Action action) { window.destroy(); } + + void check_paths () { + bool all_paths_exist = true; + string[] paths1 = {AppCore.core.lyx_path, AppCore.core.latexmk_pl_path, AppCore.core.perl_path}; + foreach (var path in paths1) { + if (!File.new_for_path(path).query_exists()) + all_paths_exist = false; + } + if (!all_paths_exist) pref_dialog.show_all (); + } } }