cty.dat confusion

* remove ambiguity of whether to locate the folder which
    contains "cty.dat", or the file itself.
pull/1/head
David Freese 2014-11-07 07:15:45 -06:00
rodzic ac1befb8dc
commit 1fb74a1daf
3 zmienionych plików z 12 dodań i 5 usunięć

Wyświetl plik

@ -5880,8 +5880,8 @@ Fl_Double_Window* ConfigureDialog() {
btnRSTdefault->callback((Fl_Callback*)cb_btnRSTdefault);
o->value(progdefaults.RSTdefault);
} // Fl_Check_Button* btnRSTdefault
{ Fl_Input2* o = txt_cty_dat_pathname = new Fl_Input2(189, 180, 346, 24, _("cty.dat pathname"));
txt_cty_dat_pathname->tooltip(_("Enter full path-filename for cty.dat"));
{ Fl_Input2* o = txt_cty_dat_pathname = new Fl_Input2(189, 180, 346, 24, _("cty.dat folder"));
txt_cty_dat_pathname->tooltip(_("Enter full path-name for cty.dat folder"));
txt_cty_dat_pathname->box(FL_DOWN_BOX);
txt_cty_dat_pathname->color(FL_BACKGROUND2_COLOR);
txt_cty_dat_pathname->selection_color(FL_SELECTION_COLOR);

Wyświetl plik

@ -949,10 +949,10 @@ progdefaults.changed = true;}
code0 {o->value(progdefaults.RSTdefault);}
}
Fl_Input txt_cty_dat_pathname {
label {cty.dat pathname}
label {cty.dat folder}
callback {progdefaults.cty_dat_pathname = o->value();
progdefaults.changed = true;}
tooltip {Enter full path-filename for cty.dat} xywh {189 180 346 24} when 1
tooltip {Enter full path-name for cty.dat folder} xywh {189 180 346 24} when 1
code0 {o->value(progdefaults.cty_dat_pathname.c_str());}
code1 {\#include "dxcc.h"}
class Fl_Input2

Wyświetl plik

@ -329,9 +329,16 @@ void default_cty_dat_pathname()
void select_cty_dat_pathname()
{
string deffilename = progdefaults.cty_dat_pathname;
const char *p = FSEL::select(_("Locate cty.dat"), _("cty.dat\t*"), deffilename.c_str());
const char *p = FSEL::select(_("Locate cty.dat folder"), _("cty.dat\t*"), deffilename.c_str());
if (p) {
string nupath = p;
size_t ptr;
//crappy win32 again
ptr = nupath.find("\\");
while (ptr != string::npos) {
nupath[ptr] = '/';
ptr = nupath.find("\\");
}
size_t endslash = nupath.rfind("/");
if ((endslash != string::npos) && (endslash != (nupath.length()-1)))
nupath.erase(endslash + 1);