mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
First cut of adding a default file name
The default file name is OS specific and tries to follow the customs on each of the OSs. It can be configured through the preferences dialog. On MacOS we get a strange warning which appears to be a well documented Gtk bug on MacOS. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b681294631
commit
b73f29fea3
7 changed files with 168 additions and 6 deletions
11
main.c
11
main.c
|
@ -211,6 +211,7 @@ void renumber_dives(int nr)
|
|||
int main(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
gboolean no_filenames = TRUE;
|
||||
|
||||
output_units = SI_units;
|
||||
|
||||
|
@ -225,6 +226,7 @@ int main(int argc, char **argv)
|
|||
parse_argument(a);
|
||||
continue;
|
||||
}
|
||||
no_filenames = FALSE;
|
||||
GError *error = NULL;
|
||||
parse_file(a, &error);
|
||||
|
||||
|
@ -235,7 +237,14 @@ int main(int argc, char **argv)
|
|||
error = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (no_filenames) {
|
||||
GError *error = NULL;
|
||||
const char *filename = subsurface_default_filename();
|
||||
parse_file(filename, &error);
|
||||
/* don't report errors - this file may not exist, but make
|
||||
sure we remember this as the filename in use */
|
||||
set_filename(filename);
|
||||
}
|
||||
report_dives(imported);
|
||||
|
||||
run_ui();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue