31#include <glib/gi18n.h>
32#include <glib/gstdio.h>
42 if(!
err.lock_acquired)
52 " Sorry, Ansel could not be started because the database is locked.\n"
54 " How to solve this problem?\n"
56 " 1 - If another Ansel instance is already running, \n"
57 " click \"Quit\" and either use that instance or close it before trying to start Ansel again. \n"
58 " (process ID <i><b>%d</b></i> created the database lock files)\n"
60 " 2 - If you cannot find any running instance of Ansel, try restarting your session or your computer. \n"
61 " This will close all running programs and should release any database locks. \n"
63 " 3 - If you have already tried the above steps, or you are certain that no other instances of Ansel are running, \n"
64 " this likely means the previous instance ended unexpectedly. \n"
65 " Click the \"Delete database lock files\" button to remove <i>data.db.lock</i> and <i>library.db.lock</i>. \n"
66 " Ansel will then attempt to load the database again. \n"
68 " <i><u>Caution!</u> Do not delete these files without first undertaking the above checks, \n"
69 " otherwise you risk generating serious inconsistencies in your database.</i>\n"),
74 _(
"Quit"),
_(
"Retry"),
_(
"Delete database lock files and try again"));
88 _(
"\n<u>Caution!</u> Are you sure you want to delete the database lock files?\n"
89 "This action should only be performed if you are certain no other Ansel instances are running.\n"),
_(
"Quit"),
_(
"Yes"));
98 _(
"\nThe database lock files have been deleted successfully.\n"),
107 _(
"\nAt least one lock file could not be removed.\n"
108 "You may try to manually delete the files <i>data.db.lock</i> and <i>library.db.lock</i>\n"
130 "<span style='italic'>%s</span>\n"
131 "\nthis might take a long time in case of a large database\n\n"
132 "do you want to proceed or quit now to do a backup\n"),
137 _(
"close Ansel"),
_(
"upgrade database"));
150 later_info =
_(
"click later to be asked on next startup");
152 later_info =
_(
"click later to be asked when closing Ansel");
154 later_info =
_(
"click later to be asked next time when closing Ansel");
159 "there's <span style='italic'>%s</span> to be freed"
161 "do you want to proceed now?\n\n"
163 "you can always change maintenance preferences in core options"),
168 _(
"later"),
_(
"yes"));
183 const char *
const dbfilename = context->
dbfilename;
184 const char *
const quick_check = context->
quick_check;
200 "This happens if you don't have permissions to write on the filesystem\n"
201 "or if you have restored a write-protected backup snapshot.\n\n"
202 "Please change the filesystem access permissions for:\n\n"
203 "\t<span style='italic'>%s</span>"),
209 if(snapshot_available)
216 label_options =
_(
"do you want to close Ansel now to manually restore\n"
217 "the database from a backup, attempt an automatic restore\n"
218 "from the most recent snapshot or delete the corrupted database\n"
219 "and start with a new one?");
227 label_options =
_(
"do you want to close Ansel now to manually restore\n"
228 "the database from a backup or delete the corrupted database\n"
229 "and start with a new one?");
236 "<span style='italic'>%s</span>\n"
238 "it seems that the database is corrupted.\n"
static void error(char *msg)
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
void dt_database_take_error(dt_database_error_t *error)
void dt_database_error_free(dt_database_error_t *error)
void dt_database_set_prompt_handler(dt_database_prompt_handler_t handler)
int dt_database_delete_lock_files(const char *dbfilename)
@ DT_DATABASE_RESPONSE_CLOSE
@ DT_DATABASE_RESPONSE_PROCEED
@ DT_DATABASE_RESPONSE_RESTORE
@ DT_DATABASE_RESPONSE_DELETE
@ DT_DATABASE_PROMPT_UPGRADE
@ DT_DATABASE_PROMPT_MAINTENANCE
@ DT_DATABASE_PROMPT_READONLY
static dt_database_response_t _prompt_upgrade(const dt_database_prompt_context_t *context)
void dt_database_gui_register_handlers(void)
gboolean dt_database_show_error(void)
static dt_database_response_t _database_prompt(const dt_database_prompt_context_t *context)
static dt_database_response_t _prompt_maintenance(const dt_database_prompt_context_t *context)
int dt_gui_show_standalone_three_choice_dialog(const char *title, const char *markup, const char *first_text, const char *second_text, const char *third_text)
gboolean dt_gui_show_standalone_yes_no_dialog(const char *title, const char *markup, const char *no_text, const char *yes_text)
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
dt_database_prompt_t prompt
guint64 reclaimable_bytes
gboolean snapshot_available