| 1 | From 96fda11a53a89c6647031f2c05ef12f1a9df6a08 Mon Sep 17 00:00:00 2001
|
| 2 | From: Skylar Hill <[email protected]>
|
| 3 | Date: Tue, 31 Jan 2023 21:02:18 -0600
|
| 4 | Subject: [PATCH] Change default directory in file browser
|
| 5 |
|
| 6 | ---
|
| 7 | src/Gui_gtk/ots_gui2.c | 7 +++++--
|
| 8 | 1 file changed, 5 insertions(+), 2 deletions(-)
|
| 9 |
|
| 10 | diff --git a/src/Gui_gtk/ots_gui2.c b/src/Gui_gtk/ots_gui2.c
|
| 11 | index ff3366b..1247933 100644
|
| 12 | |
| 13 | |
| 14 | @@ -82,6 +82,7 @@ char ots_release_package[]="20.00";
|
| 15 | #include <string.h>
|
| 16 | #include <stdlib.h>
|
| 17 | #include <ctype.h>
|
| 18 | +#include <unistd.h>
|
| 19 | #include <sys/stat.h>
|
| 20 | // #include "backcompat.c"
|
| 21 | #include "gtk_utils.c" /* Include the graphics library. */
|
| 22 | @@ -109,6 +110,7 @@ char toolpath[MaxFname]="", *start_cmd;
|
| 23 | int pending_compute=0, supported_pdf_form=1;
|
| 24 | int filingstatus_mfj=1;
|
| 25 | int round_to_whole_nums=0;
|
| 26 | +char *working_dir[MaxFname+512];
|
| 27 |
|
| 28 | void pick_file( GtkWidget *wdg, void *data ); /* Prototype */
|
| 29 | void consume_leading_trailing_whitespace( char *line );
|
| 30 | @@ -2364,7 +2366,7 @@ void save_taxfile( GtkWidget *wdg, void *data )
|
| 31 | if (cpt != 0)
|
| 32 | strcpy( cpt, "_xxxx.txt" );
|
| 33 | // printf("OTS_save_taxfile: dir='%s', wc='%s', fname='%s'\n", directory_dat, wildcards_fb, filename_fb );
|
| 34 | - Browse_Files( "File to Save As:", 2048, directory_dat, wildcards_fb, filename_fb, Save_Tax_File );
|
| 35 | + Browse_Files( "File to Save As:", 2048, working_dir, wildcards_fb, filename_fb, Save_Tax_File );
|
| 36 | }
|
| 37 |
|
| 38 |
|
| 39 | @@ -3878,7 +3880,7 @@ void pick_file( GtkWidget *wdg, void *data )
|
| 40 | strcpy( wildcards_fb, ".txt" );
|
| 41 | strcpy( filename_fb, "" );
|
| 42 | // printf("OTS_pick_file: dir='%s', wc='%s', fname='%s'\n", directory_dat, wildcards_fb, filename_fb );
|
| 43 | - Browse_Files( "Select File", 2048, directory_dat, wildcards_fb, filename_fb, receive_filename );
|
| 44 | + Browse_Files( "Select File", 2048, working_dir, wildcards_fb, filename_fb, receive_filename );
|
| 45 | }
|
| 46 |
|
| 47 |
|
| 48 | @@ -4019,6 +4021,7 @@ int main(int argc, char *argv[] )
|
| 49 | invocation_path[k] = '\0';
|
| 50 | // printf("Invocation path = '%s'\n", invocation_path);
|
| 51 | set_ots_path();
|
| 52 | + getcwd(working_dir, MaxFname+512);
|
| 53 |
|
| 54 | /* Decode any command-line arguments. */
|
| 55 | argn = 1; k=1;
|
| 56 | --
|
| 57 | 2.38.1
|
| 58 |
|