commit 7cb84a4d7910b3a017227ecbcfb812d80b530238
Author: david.sorber <david.sorber@jacobs.com>
Date:   Mon Mar 18 15:14:26 2024 -0400

    Update catalog decode status message.

diff --git a/src/Catalog.h b/src/Catalog.h
index 71c8459..9adf832 100644
--- a/src/Catalog.h
+++ b/src/Catalog.h
@@ -53,10 +53,10 @@ public:
                 return "decrypt: incomplete header";
 
             case ERR_DECRYPT_CORRUPTED_CHUNK:
-                return "decrypt: corrupted chunk";
+                return "decrypt: corrupted chunk (check password)";
 
             case ERR_DECRYPT_PREMATURE_END:
-                return "decrypt: premature end of file";
+                return "decrypt: premature end of file (file likely corrupted)";
 
             default:
                 return "unknown error";
diff --git a/src/main.cc b/src/main.cc
index c187a33..1a338c7 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -31,7 +31,7 @@
 #endif
 
 const std::string APP_NAME("pwmgr");
-const std::string VERSION("v0.1.1");
+const std::string VERSION("v0.1.2");
 const std::string DEFAULT_FILEPATH("/home/dsorber/Documents/chicken_soup/chicken_soup.txt.enc");
 
 const std::string BOLD{"\033[1m"};
@@ -47,9 +47,10 @@ const uint32_t BUFFER_SIZE{2048};
 
 #define ERROR_MSG       BOLD << RED << "ERROR: " << ENDC
 
-
 Catalog catalog;
 
+const char* STR_EMPTY = "";
+const char* STR_LOADING = "Loading...";
 
 static ImGuiInputTextFlags MULTILINE_TEXT_FLAGS =
         ImGuiInputTextFlags_AllowTabInput | ImGuiInputTextFlags_ReadOnly;
@@ -174,10 +175,10 @@ int main(int argc, char** argv)
     bool done = false;
     bool dataLoaded = false;
     bool loading = false;
-    bool showOptionsWin = false;
     char filterBuffer[128]{};
     char filePathBuffer[BUFFER_SIZE]{};
     std::memcpy(filePathBuffer, DEFAULT_FILEPATH.data(), DEFAULT_FILEPATH.size());
+    const char* statusText = STR_EMPTY;
 
     char passwdBuffer[BUFFER_SIZE]{};
     while (! done)
@@ -267,12 +268,15 @@ int main(int argc, char** argv)
                 if (ImGui::Button("Load"))
                 {
                     loading = true;
+                    statusText = STR_LOADING;
                 }
                 ImGui::SameLine();
 
+                ImGui::Text(statusText);
+
                 if (loading)
                 {
-                    ImGui::Text("Loading...");
+
 
                     // Load the catalog from the encrypted file
                     int rc = catalog.load(filePathBuffer,
@@ -291,9 +295,12 @@ int main(int argc, char** argv)
                     }
                     else
                     {
-                        // Display error
+                        // Display error to terminal and status
                         std::cerr << ERROR_MSG << Catalog::errToString(rc) << std::endl;
+                        statusText = Catalog::errToString(rc);
                     }
+
+                    loading = false;
                 }
 
             }
