diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2012-09-09 09:06:44 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2012-09-09 17:38:01 -0700 |
commit | b73f29fea3ae88a06d8f773a6d48510520c127f0 (patch) | |
tree | d04166fd6e2fde7d716fe69cbfe35330e79cd1b9 /main.c | |
parent | b6812946319080699f6071656f09d402d23d3e46 (diff) | |
download | subsurface-b73f29fea3ae88a06d8f773a6d48510520c127f0.tar.gz |
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>
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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(); |