kopia lustrzana https://github.com/jamescoxon/dl-fldigi
Native Select Save-As dialogs
Bug fix to correct differences in returned character pointer and character pointer value from native file select and file save-as dialogs.pull/4/head
rodzic
5209286432
commit
01245fe7b5
|
@ -3008,12 +3008,11 @@ static void cb_btn_select_auditlog(Fl_Button*, void*) {
|
|||
std::string str = std::string(TempDir);
|
||||
str.append(progdefaults.fsq_audit_log);
|
||||
const char *fname = FSEL::saveas("Audit log", "*.txt\t*", str.c_str());
|
||||
|
||||
if (fname) {
|
||||
progdefaults.fsq_audit_log = fl_filename_name(fname);
|
||||
txtAuditLog->value(progdefaults.fsq_audit_log.c_str());
|
||||
progdefaults.changed = true;
|
||||
};
|
||||
if (!fname) return;
|
||||
if (!*fname) return;
|
||||
progdefaults.fsq_audit_log = fl_filename_name(fname);
|
||||
txtAuditLog->value(progdefaults.fsq_audit_log.c_str());
|
||||
progdefaults.changed = true;
|
||||
}
|
||||
|
||||
Fl_Output *txtHeardLog=(Fl_Output *)0;
|
||||
|
@ -3031,11 +3030,11 @@ static void cb_btn_select_fsq_heard_log(Fl_Button*, void*) {
|
|||
std::string str = std::string(TempDir);
|
||||
str.append(progdefaults.fsq_heard_log);
|
||||
const char *fname = FSEL::saveas("Heard log", "*.txt\t*", str.c_str());
|
||||
if (fname) {
|
||||
progdefaults.fsq_heard_log = fl_filename_name(fname);
|
||||
txtHeardLog->value(progdefaults.fsq_heard_log.c_str());
|
||||
progdefaults.changed = true;
|
||||
};
|
||||
if (!fname) return;
|
||||
if (!*fname) return;
|
||||
progdefaults.fsq_heard_log = fl_filename_name(fname);
|
||||
txtHeardLog->value(progdefaults.fsq_heard_log.c_str());
|
||||
progdefaults.changed = true;
|
||||
}
|
||||
|
||||
Fl_Button *btn_fsq_xmt_color=(Fl_Button *)0;
|
||||
|
@ -3169,12 +3168,11 @@ static void cb_btn_ifkp_select_auditlog(Fl_Button*, void*) {
|
|||
std::string str = std::string(TempDir);
|
||||
str.append(progdefaults.ifkp_audit_log);
|
||||
const char *fname = FSEL::saveas("Audit log", "*.txt\t*", str.c_str());
|
||||
|
||||
if (fname) {
|
||||
progdefaults.ifkp_audit_log = fl_filename_name(fname);
|
||||
txt_ifkp_audit_log->value(progdefaults.ifkp_audit_log.c_str());
|
||||
progdefaults.changed = true;
|
||||
};
|
||||
if (!fname) return;
|
||||
if (!*fname) return;
|
||||
progdefaults.ifkp_audit_log = fl_filename_name(fname);
|
||||
txt_ifkp_audit_log->value(progdefaults.ifkp_audit_log.c_str());
|
||||
progdefaults.changed = true;
|
||||
}
|
||||
|
||||
Fl_Output *txt_ifkp_heard_log=(Fl_Output *)0;
|
||||
|
@ -3192,11 +3190,11 @@ static void cb_btn_select_ifkp_heard_log(Fl_Button*, void*) {
|
|||
std::string str = std::string(TempDir);
|
||||
str.append(progdefaults.ifkp_heard_log);
|
||||
const char *fname = FSEL::saveas("Heard log", "*.txt\t*", str.c_str());
|
||||
if (fname) {
|
||||
progdefaults.ifkp_heard_log = fl_filename_name(fname);
|
||||
txt_ifkp_heard_log->value(progdefaults.ifkp_heard_log.c_str());
|
||||
progdefaults.changed = true;
|
||||
};
|
||||
if (!fname) return;
|
||||
if (!*fname) return;
|
||||
progdefaults.ifkp_heard_log = fl_filename_name(fname);
|
||||
txt_ifkp_heard_log->value(progdefaults.ifkp_heard_log.c_str());
|
||||
progdefaults.changed = true;
|
||||
}
|
||||
|
||||
Fl_Group *tabMT63=(Fl_Group *)0;
|
||||
|
|
|
@ -3737,12 +3737,12 @@ progdefaults.changed = true;}
|
|||
callback {std::string str = std::string(TempDir);
|
||||
str.append(progdefaults.fsq_audit_log);
|
||||
const char *fname = FSEL::saveas("Audit log", "*.txt\\t*", str.c_str());
|
||||
|
||||
if (fname) {
|
||||
progdefaults.fsq_audit_log = fl_filename_name(fname);
|
||||
txtAuditLog->value(progdefaults.fsq_audit_log.c_str());
|
||||
progdefaults.changed = true;
|
||||
}}
|
||||
if (!fname) return;
|
||||
if (!*fname) return;
|
||||
progdefaults.fsq_audit_log = fl_filename_name(fname);
|
||||
txtAuditLog->value(progdefaults.fsq_audit_log.c_str());
|
||||
progdefaults.changed = true;
|
||||
}
|
||||
xywh {509 281 70 20}
|
||||
}
|
||||
Fl_Output txtHeardLog {
|
||||
|
@ -3762,11 +3762,12 @@ progdefaults.changed = true;}
|
|||
callback {std::string str = std::string(TempDir);
|
||||
str.append(progdefaults.fsq_heard_log);
|
||||
const char *fname = FSEL::saveas("Heard log", "*.txt\\t*", str.c_str());
|
||||
if (fname) {
|
||||
progdefaults.fsq_heard_log = fl_filename_name(fname);
|
||||
txtHeardLog->value(progdefaults.fsq_heard_log.c_str());
|
||||
progdefaults.changed = true;
|
||||
}}
|
||||
if (!fname) return;
|
||||
if (!*fname) return;
|
||||
progdefaults.fsq_heard_log = fl_filename_name(fname);
|
||||
txtHeardLog->value(progdefaults.fsq_heard_log.c_str());
|
||||
progdefaults.changed = true;
|
||||
}
|
||||
xywh {509 309 70 20}
|
||||
}
|
||||
}
|
||||
|
@ -3924,12 +3925,12 @@ progdefaults.changed = true;}
|
|||
callback {std::string str = std::string(TempDir);
|
||||
str.append(progdefaults.ifkp_audit_log);
|
||||
const char *fname = FSEL::saveas("Audit log", "*.txt\\t*", str.c_str());
|
||||
|
||||
if (fname) {
|
||||
progdefaults.ifkp_audit_log = fl_filename_name(fname);
|
||||
txt_ifkp_audit_log->value(progdefaults.ifkp_audit_log.c_str());
|
||||
progdefaults.changed = true;
|
||||
}}
|
||||
if (!fname) return;
|
||||
if (!*fname) return;
|
||||
progdefaults.ifkp_audit_log = fl_filename_name(fname);
|
||||
txt_ifkp_audit_log->value(progdefaults.ifkp_audit_log.c_str());
|
||||
progdefaults.changed = true;
|
||||
}
|
||||
xywh {510 220 70 25}
|
||||
}
|
||||
Fl_Output txt_ifkp_heard_log {
|
||||
|
@ -3949,11 +3950,12 @@ progdefaults.changed = true;}
|
|||
callback {std::string str = std::string(TempDir);
|
||||
str.append(progdefaults.ifkp_heard_log);
|
||||
const char *fname = FSEL::saveas("Heard log", "*.txt\\t*", str.c_str());
|
||||
if (fname) {
|
||||
progdefaults.ifkp_heard_log = fl_filename_name(fname);
|
||||
txt_ifkp_heard_log->value(progdefaults.ifkp_heard_log.c_str());
|
||||
progdefaults.changed = true;
|
||||
}}
|
||||
if (!fname) return;
|
||||
if (!*fname) return;
|
||||
progdefaults.ifkp_heard_log = fl_filename_name(fname);
|
||||
txt_ifkp_heard_log->value(progdefaults.ifkp_heard_log.c_str());
|
||||
progdefaults.changed = true;
|
||||
}
|
||||
xywh {510 249 70 25}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9456,25 +9456,26 @@ void cb_heard_send_file(Fl_Widget *w, void *)
|
|||
deffilename.append("fsq.txt");
|
||||
|
||||
const char* p = FSEL::select( "Select send file", "*.txt", deffilename.c_str());
|
||||
if (!p) return;
|
||||
if (!*p) return;
|
||||
|
||||
if (p) {
|
||||
std::string fname = fl_filename_name(p);
|
||||
ifstream txfile(p);
|
||||
if (!txfile) return;
|
||||
stringstream text;
|
||||
char ch = txfile.get();
|
||||
while (!txfile.eof()) {
|
||||
text << ch;
|
||||
ch = txfile.get();
|
||||
}
|
||||
txfile.close();
|
||||
std::string s = fsq_selected_call.c_str();
|
||||
s.append("#[");
|
||||
s.append(fname.c_str());
|
||||
s.append("]\n");
|
||||
s.append(text.str().c_str());
|
||||
fsq_xmt(s);
|
||||
std::string fname = fl_filename_name(p);
|
||||
ifstream txfile(p);
|
||||
if (!txfile) return;
|
||||
stringstream text;
|
||||
char ch = txfile.get();
|
||||
while (!txfile.eof()) {
|
||||
text << ch;
|
||||
ch = txfile.get();
|
||||
}
|
||||
txfile.close();
|
||||
std::string s = fsq_selected_call.c_str();
|
||||
s.append("#[");
|
||||
s.append(fname.c_str());
|
||||
s.append("]\n");
|
||||
s.append(text.str().c_str());
|
||||
fsq_xmt(s);
|
||||
|
||||
}
|
||||
|
||||
void cb_heard_read_file(Fl_Widget *w, void*)
|
||||
|
|
|
@ -441,8 +441,9 @@ void cb_UseTemplate()
|
|||
{
|
||||
string templatename = ARQ_mail_out_dir;
|
||||
const char *p = FSEL::select("Load Template file", "*.tpl", templatename.c_str());
|
||||
if (p)
|
||||
readComposedFile(p);
|
||||
if (!p) return;
|
||||
if (!*p) return;
|
||||
readComposedFile(p);
|
||||
}
|
||||
|
||||
void cb_ClearComposer()
|
||||
|
@ -520,8 +521,10 @@ void SaveComposeTemplate()
|
|||
{
|
||||
string templatename = ARQ_mail_out_dir;
|
||||
const char *p = FSEL::saveas("Save Template file", "*.tpl", templatename.c_str());
|
||||
if (p)
|
||||
saveComposedText(p);
|
||||
if (!p) return;
|
||||
if (!*p) return;
|
||||
|
||||
saveComposedText(p);
|
||||
}
|
||||
|
||||
void cb_SaveComposeMail()
|
||||
|
@ -1309,7 +1312,7 @@ void sendAsciiFile()
|
|||
size_t txtsize;
|
||||
string textin = "";
|
||||
char sizemsg[40];
|
||||
if (p) {
|
||||
if (p && *p) {
|
||||
ifstream textfile;
|
||||
textfile.open(p);
|
||||
if (textfile) {
|
||||
|
@ -1361,7 +1364,7 @@ void sendImageFile()
|
|||
string b64text;
|
||||
base64 b64(true);
|
||||
char sizemsg[40];
|
||||
if (p) {
|
||||
if (p && *p) {
|
||||
ifstream textfile;
|
||||
textfile.open(p, ios::binary);
|
||||
if (textfile) {
|
||||
|
@ -1410,7 +1413,7 @@ void sendBinaryFile()
|
|||
string b64text;
|
||||
base64 b64(true);
|
||||
char sizemsg[40];
|
||||
if (p) {
|
||||
if (p && *p) {
|
||||
ifstream textfile;
|
||||
textfile.open(p, ios::binary);
|
||||
if (textfile) {
|
||||
|
|
|
@ -350,8 +350,9 @@ void cb_fsqpicTxLoad(Fl_Widget *, void *)
|
|||
{
|
||||
const char *fn =
|
||||
FSEL::select(_("Load image file"), "Image\t*.{png,,gif,jpg,jpeg}\n", PicsDir.c_str());
|
||||
if (fn)
|
||||
fsq_load_image(fn);
|
||||
if (!fn) return;
|
||||
if (!*fn) return;
|
||||
fsq_load_image(fn);
|
||||
}
|
||||
|
||||
void fsq_clear_tximage()
|
||||
|
|
|
@ -372,8 +372,9 @@ void cb_ifkppicTxLoad(Fl_Widget *, void *)
|
|||
{
|
||||
const char *fn =
|
||||
FSEL::select(_("Load image file"), "Image\t*.{png,,gif,jpg,jpeg}\n", PicsDir.c_str());
|
||||
if (fn)
|
||||
ifkp_load_image(fn);
|
||||
if (!fn) return;
|
||||
if (!*fn) return;
|
||||
ifkp_load_image(fn);
|
||||
}
|
||||
|
||||
void ifkp_clear_tximage()
|
||||
|
|
|
@ -144,8 +144,9 @@ void Export_CSV()
|
|||
filters.append("\n");
|
||||
#endif
|
||||
const char* p = FSEL::saveas( title.c_str(), filters.c_str(), "export.csv");
|
||||
if (!p)
|
||||
return;
|
||||
|
||||
if (!p) return;
|
||||
if (!*p) return;
|
||||
|
||||
for (int i = 0; i < chkExportBrowser->FLTK_nitems(); i++) {
|
||||
if (chkExportBrowser->checked(i + 1)) {
|
||||
|
@ -170,8 +171,9 @@ void Export_TXT()
|
|||
filters.append("\n");
|
||||
#endif
|
||||
const char* p = FSEL::saveas( title.c_str(), filters.c_str(), "export.txt");
|
||||
if (!p)
|
||||
return;
|
||||
|
||||
if (!p) return;
|
||||
if (!*p) return;
|
||||
|
||||
for (int i = 0; i < chkExportBrowser->FLTK_nitems(); i++) {
|
||||
if (chkExportBrowser->checked(i + 1)) {
|
||||
|
@ -201,8 +203,8 @@ void Export_ADIF()
|
|||
defname.assign("export.").append(ADIF_SUFFIX);
|
||||
const char* p = FSEL::saveas( title.c_str(), filters.c_str(), defname.c_str());
|
||||
|
||||
if (!p)
|
||||
return;
|
||||
if (!p) return;
|
||||
if (!*p) return;
|
||||
|
||||
for (int i = 0; i < chkExportBrowser->FLTK_nitems(); i++) {
|
||||
if (chkExportBrowser->checked(i + 1)) {
|
||||
|
@ -285,19 +287,20 @@ void cb_mnuOpenLogbook(Fl_Menu_* m, void* d)
|
|||
deffilename.append(fl_filename_name(logbook_filename.c_str()));
|
||||
|
||||
const char* p = FSEL::select( title.c_str(), filter.c_str(), deffilename.c_str());
|
||||
if (!p) return;
|
||||
if (!*p) return;
|
||||
|
||||
if (p) {
|
||||
saveLogbook();
|
||||
qsodb.deleteRecs();
|
||||
saveLogbook();
|
||||
qsodb.deleteRecs();
|
||||
|
||||
logbook_filename = p;
|
||||
progdefaults.logbookfilename = logbook_filename;
|
||||
progdefaults.changed = true;
|
||||
logbook_filename = p;
|
||||
progdefaults.logbookfilename = logbook_filename;
|
||||
progdefaults.changed = true;
|
||||
|
||||
adifFile.readFile (logbook_filename.c_str(), &qsodb);
|
||||
dlgLogbook->label(fl_filename_name(logbook_filename.c_str()));
|
||||
qsodb.isdirty(0);
|
||||
|
||||
adifFile.readFile (logbook_filename.c_str(), &qsodb);
|
||||
dlgLogbook->label(fl_filename_name(logbook_filename.c_str()));
|
||||
qsodb.isdirty(0);
|
||||
}
|
||||
}
|
||||
|
||||
void cb_mnuSaveLogbook(Fl_Menu_*m, void* d) {
|
||||
|
@ -312,23 +315,25 @@ void cb_mnuSaveLogbook(Fl_Menu_*m, void* d) {
|
|||
|
||||
const char* p = FSEL::saveas( title.c_str(), filter.c_str(), deffilename.c_str());
|
||||
|
||||
if (p) {
|
||||
logbook_filename = p;
|
||||
if (logbook_filename.find("." ADIF_SUFFIX) == string::npos)
|
||||
logbook_filename.append("." ADIF_SUFFIX);
|
||||
if (!p) return;
|
||||
if (!*p) return;
|
||||
|
||||
progdefaults.logbookfilename = logbook_filename;
|
||||
progdefaults.changed = true;
|
||||
logbook_filename = p;
|
||||
if (logbook_filename.find("." ADIF_SUFFIX) == string::npos)
|
||||
logbook_filename.append("." ADIF_SUFFIX);
|
||||
|
||||
dlgLogbook->label(fl_filename_name(logbook_filename.c_str()));
|
||||
progdefaults.logbookfilename = logbook_filename;
|
||||
progdefaults.changed = true;
|
||||
|
||||
cQsoDb::reverse = false;
|
||||
qsodb.SortByDate(progdefaults.sort_date_time_off);
|
||||
dlgLogbook->label(fl_filename_name(logbook_filename.c_str()));
|
||||
|
||||
cQsoDb::reverse = false;
|
||||
qsodb.SortByDate(progdefaults.sort_date_time_off);
|
||||
|
||||
qsodb.isdirty(0);
|
||||
restore_sort();
|
||||
adifFile.writeLog (logbook_filename.c_str(), &qsodb);
|
||||
|
||||
qsodb.isdirty(0);
|
||||
restore_sort();
|
||||
adifFile.writeLog (logbook_filename.c_str(), &qsodb);
|
||||
}
|
||||
}
|
||||
|
||||
int comparerecs (const void *rp1, const void *rp2) { // rp1 needle, rp2 haystack
|
||||
|
@ -507,12 +512,14 @@ void cb_mnuMergeADIF_log(Fl_Menu_* m, void* d) {
|
|||
Fl::wait();
|
||||
fl_digi_main->redraw();
|
||||
Fl::awake();
|
||||
if (p) {
|
||||
cQsoDb *mrgdb = new cQsoDb;
|
||||
adifFile.do_readfile (p, mrgdb);
|
||||
merge_recs(&qsodb, mrgdb);
|
||||
delete mrgdb;
|
||||
}
|
||||
if (!p) return;
|
||||
if (!*p) return;
|
||||
|
||||
cQsoDb *mrgdb = new cQsoDb;
|
||||
adifFile.do_readfile (p, mrgdb);
|
||||
merge_recs(&qsodb, mrgdb);
|
||||
delete mrgdb;
|
||||
|
||||
}
|
||||
|
||||
void cb_export_date_select() {
|
||||
|
@ -1479,8 +1486,9 @@ void WriteCabrillo()
|
|||
string strContest = "";
|
||||
|
||||
const char* p = FSEL::saveas( title.c_str(), filters.c_str(), "contest.txt");
|
||||
if (!p)
|
||||
return;
|
||||
|
||||
if (!p) return;
|
||||
if (!*p) return;
|
||||
|
||||
for (int i = 0; i < chkCabBrowser->FLTK_nitems(); i++) {
|
||||
if (chkCabBrowser->checked(i + 1)) {
|
||||
|
|
|
@ -357,11 +357,13 @@ void select_flmsg_pathname()
|
|||
deffilename = "/usr/local/bin/";
|
||||
const char *p = FSEL::select(_("Locate flmsg executable"), _("flmsg\t*"), deffilename.c_str());
|
||||
# endif
|
||||
if (p) {
|
||||
progdefaults.flmsg_pathname = p;
|
||||
progdefaults.changed = true;
|
||||
txt_flmsg_pathname->value(p);
|
||||
}
|
||||
if (!p) return;
|
||||
if (!*p) return;
|
||||
|
||||
progdefaults.flmsg_pathname = p;
|
||||
progdefaults.changed = true;
|
||||
txt_flmsg_pathname->value(p);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -433,7 +435,7 @@ string select_binary_pathname(string deffilename)
|
|||
const char *p = FSEL::select(_("Locate binary"), _("*"), deffilename.c_str());
|
||||
# endif
|
||||
string executable = "";
|
||||
if (p) executable = p;
|
||||
if (p && *p) executable = p;
|
||||
// do not allow recursion !!
|
||||
if (executable.find("fldigi") != string::npos) return "";
|
||||
return executable;
|
||||
|
|
|
@ -181,8 +181,9 @@ void cb_picTxLoad(Fl_Widget *, void *)
|
|||
FSEL::select(_("Load image file"), "Portable Network Graphics\t*.png\n"
|
||||
"Independent JPEG Group\t*.{jpg,jif,jpeg,jpe}\n"
|
||||
"Graphics Interchange Format\t*.gif", PicsDir.c_str());
|
||||
if (fn)
|
||||
load_image(fn);
|
||||
if (!fn) return;
|
||||
if (!*fn) return;
|
||||
load_image(fn);
|
||||
}
|
||||
|
||||
void cb_picTxClose( Fl_Widget *w, void *)
|
||||
|
|
|
@ -344,7 +344,7 @@ void cbInsertMacro(Fl_Widget *, void *)
|
|||
_("Text file to insert"),
|
||||
filters.c_str(),
|
||||
HomeDir.c_str());
|
||||
if (p) {
|
||||
if (p && *p) {
|
||||
text.insert(6, p);
|
||||
} else
|
||||
text = "";
|
||||
|
@ -354,7 +354,7 @@ void cbInsertMacro(Fl_Widget *, void *)
|
|||
_("Test text file"),
|
||||
filters.c_str(),
|
||||
HomeDir.c_str());
|
||||
if (p) {
|
||||
if (p && *p) {
|
||||
text.insert(10, p);
|
||||
} else
|
||||
text = "";
|
||||
|
@ -364,7 +364,7 @@ void cbInsertMacro(Fl_Widget *, void *)
|
|||
_("MFSK image file"),
|
||||
filters.c_str(),
|
||||
PicsDir.c_str());
|
||||
if (p) {
|
||||
if (p && *p) {
|
||||
text.insert(7, p);
|
||||
} else
|
||||
text = "";
|
||||
|
@ -374,7 +374,7 @@ void cbInsertMacro(Fl_Widget *, void *)
|
|||
_("Change to Macro file"),
|
||||
filters.c_str(),
|
||||
MacrosDir.c_str());
|
||||
if (p) {
|
||||
if (p && *p) {
|
||||
text.insert(8, p);
|
||||
} else
|
||||
text = "";
|
||||
|
@ -386,7 +386,7 @@ void cbInsertMacro(Fl_Widget *, void *)
|
|||
_("Executable file to insert"),
|
||||
filters.c_str(),
|
||||
HomeDir.c_str());
|
||||
if (p) {
|
||||
if (p && *p) {
|
||||
string exefile = p;
|
||||
exefile.append("</EXEC>");
|
||||
text.insert(6, exefile);
|
||||
|
|
|
@ -3679,10 +3679,9 @@ void MACROTEXT::openMacroFile()
|
|||
_("Open macro file"),
|
||||
_("Fldigi macro definition file\t*.{mdf}"),
|
||||
deffilename.c_str());
|
||||
if (p) {
|
||||
if (p && *p) {
|
||||
loadMacros(p);
|
||||
progStatus.LastMacroFile = p;
|
||||
// }
|
||||
showMacroSet();
|
||||
if (progdefaults.DisplayMacroFilename) {
|
||||
string Macroset;
|
||||
|
@ -3721,12 +3720,15 @@ void MACROTEXT::saveMacroFile()
|
|||
_("Save macro file"),
|
||||
_("Fldigi macro definition file\t*.{mdf}"),
|
||||
deffilename.c_str());
|
||||
if (p) {
|
||||
string sp = p;
|
||||
if (sp.rfind(".mdf") == string::npos) sp.append(".mdf");
|
||||
saveMacros(sp.c_str());
|
||||
progStatus.LastMacroFile = sp;
|
||||
}
|
||||
if (!p) return;
|
||||
if (!*p) return;
|
||||
|
||||
string sp = p;
|
||||
if (sp.empty()) return;
|
||||
if (sp.rfind(".mdf") == string::npos) sp.append(".mdf");
|
||||
saveMacros(sp.c_str());
|
||||
progStatus.LastMacroFile = sp;
|
||||
|
||||
}
|
||||
|
||||
void MACROTEXT::savecurrentMACROS(std::string &s, size_t &i, size_t endbracket)
|
||||
|
|
|
@ -1113,11 +1113,12 @@ void selectRigXmlFilename()
|
|||
string deffilename;
|
||||
deffilename = progdefaults.XmlRigFilename;
|
||||
const char *p = FSEL::select(_("Open rig xml file"), _("Fldigi rig xml definition file\t*.xml"), deffilename.c_str());
|
||||
if (p) {
|
||||
progdefaults.XmlRigFilename = p;
|
||||
txtXmlRigFilename->value(fl_filename_name(p));
|
||||
loadRigXmlFile();
|
||||
}
|
||||
if (!p) return;
|
||||
if (!*p) return;
|
||||
|
||||
progdefaults.XmlRigFilename = p;
|
||||
txtXmlRigFilename->value(fl_filename_name(p));
|
||||
loadRigXmlFile();
|
||||
}
|
||||
|
||||
void loadRigXmlFile(void)
|
||||
|
|
|
@ -159,8 +159,8 @@ void SoundBase::get_file_params(const char* def_fname, const char** fname, int*
|
|||
*fname = FSEL::select(_("Audio file"), filters.c_str(), def_fname, &fsel);
|
||||
else
|
||||
*fname = FSEL::saveas(_("Audio file"), filters.c_str(), def_fname, &fsel);
|
||||
if (!*fname)
|
||||
return;
|
||||
if (!*fname) return;
|
||||
if (!**fname) return;
|
||||
|
||||
if (fsel >= nfilt) // "Default" save-as type on OS X
|
||||
fsel = 0;
|
||||
|
|
|
@ -1244,14 +1244,16 @@ static void notify_event_cb(Fl_Widget* w, void* arg)
|
|||
static void notify_program_select_cb(Fl_Widget* w, void* arg)
|
||||
{
|
||||
const char* fn = FSEL::select(_("Run program"), "", 0, 0);
|
||||
if (fn) {
|
||||
inpNotifyActionProgram->value(fn);
|
||||
// quote program path
|
||||
inpNotifyActionProgram->position(0);
|
||||
inpNotifyActionProgram->insert("\"", 1);
|
||||
inpNotifyActionProgram->position(inpNotifyActionProgram->size());
|
||||
inpNotifyActionProgram->insert("\"", 1);
|
||||
}
|
||||
if (!fn) return;
|
||||
if (!*fn) return;
|
||||
|
||||
inpNotifyActionProgram->value(fn);
|
||||
// quote program path
|
||||
inpNotifyActionProgram->position(0);
|
||||
inpNotifyActionProgram->insert("\"", 1);
|
||||
inpNotifyActionProgram->position(inpNotifyActionProgram->size());
|
||||
inpNotifyActionProgram->insert("\"", 1);
|
||||
|
||||
}
|
||||
|
||||
// the test button callback
|
||||
|
|
|
@ -518,8 +518,10 @@ void cb_thorpicTxLoad(Fl_Widget *, void *)
|
|||
{
|
||||
const char *fn =
|
||||
FSEL::select(_("Load image file"), "Image\t*.{png,,gif,jpg,jpeg}\n", PicsDir.c_str());
|
||||
if (fn)
|
||||
thor_load_image(fn);
|
||||
if (!fn) return;
|
||||
if (!*fn) return;
|
||||
|
||||
thor_load_image(fn);
|
||||
}
|
||||
|
||||
void thor_clear_tximage()
|
||||
|
|
|
@ -88,6 +88,7 @@ void loadPalette()
|
|||
}
|
||||
const char *p = FSEL::select(_("Open palette"), _("Fldigi palette\t*.pal"), palfilename.c_str());
|
||||
if (!p) return;
|
||||
if (!*p) return;
|
||||
if ((clrfile = fopen(p, "r")) != NULL) {
|
||||
for (int i = 0; i < 9; i++) {
|
||||
if (fscanf(clrfile, "%d;%d;%d\n", &r, &g, &b) == EOF) {
|
||||
|
|
|
@ -719,14 +719,16 @@ static void wefax_cb_pic_rx_save( Fl_Widget *, void *)
|
|||
|
||||
const char *file_name = FSEL::saveas(_("Save image as:"), ffilter, dfname.c_str(), NULL);
|
||||
/// Beware that no extra comments are saved here.
|
||||
if (file_name) {
|
||||
wefax_pic_rx_picture->save_png(file_name,progdefaults.WEFAX_SaveMonochrome);
|
||||
qso_notes( "RX:", file_name );
|
||||
wefax_serviceme->qso_rec_save();
|
||||
/// Next time, image will be saved at the same place.
|
||||
default_dir_set( progdefaults.wefax_save_dir, file_name );
|
||||
add_to_files_list( file_name );
|
||||
}
|
||||
if (!file_name) return;
|
||||
if (!*file_name) return;
|
||||
|
||||
wefax_pic_rx_picture->save_png(file_name,progdefaults.WEFAX_SaveMonochrome);
|
||||
qso_notes( "RX:", file_name );
|
||||
wefax_serviceme->qso_rec_save();
|
||||
/// Next time, image will be saved at the same place.
|
||||
default_dir_set( progdefaults.wefax_save_dir, file_name );
|
||||
add_to_files_list( file_name );
|
||||
|
||||
}
|
||||
|
||||
/// Beware, might be called by another thread. Called by the GUI
|
||||
|
@ -1482,10 +1484,9 @@ static void wefax_cb_pic_tx_load(Fl_Widget *, void *)
|
|||
"Independent JPEG Group\t*.{jpg,jif,jpeg,jpe}\n"
|
||||
"Graphics Interchange Format\t*.gif",
|
||||
default_dir_get( progdefaults.wefax_load_dir ).c_str() );
|
||||
if (!fil_name) {
|
||||
LOG_WARN( " Cannot FSEL::select" );
|
||||
return ;
|
||||
};
|
||||
if (!fil_name) return;
|
||||
if (!*fil_name) return;
|
||||
|
||||
/// Next time, image will be saved at the same place.
|
||||
default_dir_set( progdefaults.wefax_load_dir, fil_name );
|
||||
wefax_load_image(fil_name);
|
||||
|
|
Ładowanie…
Reference in New Issue