Skip to content
Snippets Groups Projects
Commit 8e70442f authored by deuce's avatar deuce
Browse files

Maintain the scaling factor in the .ini file.

parent a2e3285f
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,9 @@
#include <dirwrap.h>
#include "ciolib.h"
#ifdef HAS_VSTAT
#include "bitmap_con.h"
#endif
#include "cterm.h"
#include "allfonts.h"
......@@ -1067,6 +1070,10 @@ void load_settings(struct syncterm_settings *set)
set->backlines=iniReadInteger(inifile,"SyncTERM","ScrollBackLines",2000);
get_syncterm_filename(set->list_path, sizeof(set->list_path), SYNCTERM_PATH_LIST, FALSE);
iniReadString(inifile, "SyncTERM", "ListPath", set->list_path, set->list_path);
set->scaling_factor=iniReadInteger(inifile,"SyncTERM","ScalingFactor",0);
#ifdef HAS_VSTAT
vstat.scaling=set->scaling_factor;
#endif
/* Modem settings */
iniReadString(inifile, "SyncTERM", "ModemInit", "AT&F&C1&D2", set->mdm.init_string);
......@@ -1383,6 +1390,28 @@ int main(int argc, char **argv)
last_bbs=strdup(bbs->name);
bbs=NULL;
}
// Save changed settings
#ifdef HAS_VSTAT
if(vstat.scaling > 0 && vstat.scaling != settings.scaling_factor) {
char inipath[MAX_PATH+1];
FILE *inifile;
str_list_t inicontents;
get_syncterm_filename(inipath, sizeof(inipath), SYNCTERM_PATH_INI, FALSE);
if((inifile=fopen(inipath,"r"))!=NULL) {
inicontents=iniReadFile(inifile);
fclose(inifile);
}
else {
inicontents=strListInit();
}
iniSetInteger(&inicontents,"SyncTERM","ScalingFactor",vstat.scaling,&ini_style);
if((inifile=fopen(inipath,"w"))!=NULL) {
iniWriteFile(inifile,inicontents);
fclose(inifile);
}
}
#endif
uifcbail();
#ifdef _WINSOCKAPI_
if(WSAInitialized && WSACleanup()!=0)
......
......@@ -56,6 +56,7 @@ struct syncterm_settings {
struct modem_settings mdm;
char TERM[INI_MAX_VALUE_LEN+1];
char list_path[MAX_PATH+1];
int scaling_factor;
};
extern char *inpath;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment