[chronojump] Import: Fixed message not shown when user needs to update Chronojump



commit d557c44d5cd80cf98bc74ccf79afd6fca1df5a29
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Feb 5 13:19:53 2021 +0100

    Import: Fixed message not shown when user needs to update Chronojump

 src/chronojumpImporter.cs | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/src/chronojumpImporter.cs b/src/chronojumpImporter.cs
index bc1a1ff0..3a75da57 100644
--- a/src/chronojumpImporter.cs
+++ b/src/chronojumpImporter.cs
@@ -148,7 +148,7 @@ LogB.Information("import A ");
                                var dir = new DirectoryInfo(@tempImportDir);
                                dir.Delete(true); //recursive delete
                        } catch {
-                               return new Result (false, "Could not delete directory: " + tempImportDir);
+                               return new Result (false, "", "Could not delete directory: " + tempImportDir);
                        }
                }
 LogB.Information("import B ");
@@ -183,7 +183,7 @@ LogB.Information("import H ");
                Result sourceDatabaseVersion = getDatabaseVersionFromFile (temporarySourceFile);
                Result destinationDatabaseVersion = getDatabaseVersionFromFile (destinationFile);
 
-LogB.Information("import A ");
+LogB.Information("import I ");
                if (! sourceDatabaseVersion.success)
                        return sourceDatabaseVersion;
 
@@ -196,10 +196,13 @@ LogB.Information("import A ");
                //3 check version of database to be imported
 
                MessageToPulsebar = "Checking version";
-               if (destinationDatabaseVersionNum < sourceDatabaseVersionNum) {
-                       return new Result (false, Catalog.GetString ("Trying to import a newer database 
version than this Chronojump\n" +
+               if (destinationDatabaseVersionNum < sourceDatabaseVersionNum)
+               {
+                       MessageToPulsebar = Catalog.GetString("Please update Chronojump");
+                       return new Result (false, "", Catalog.GetString ("Trying to import a newer database 
version than this Chronojump\n" +
                                "Please, update the running Chronojump."));
-               } else if (destinationDatabaseVersionNum > sourceDatabaseVersionNum) {
+               } else if (destinationDatabaseVersionNum > sourceDatabaseVersionNum)
+               {
                        LogB.Debug ("chronojump-importer version before update: ", 
sourceDatabaseVersion.output);
                        MessageToPulsebar = "Updating database";
                        updateDatabase (temporarySourceFile);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]