X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fxforms%2FFormPrint.C;h=9f33f36219be6d96a9b8d8a8687ee4090fda0507;hb=27652900a60fd078f161ce866ddaed21dba21eff;hp=fd5f7c776e58086751a7d431dbd6472cefd1eb81;hpb=58d99b4a97b85a750704cf84c9639b408117271c;p=lyx.git diff --git a/src/frontends/xforms/FormPrint.C b/src/frontends/xforms/FormPrint.C index fd5f7c776e..9f33f36219 100644 --- a/src/frontends/xforms/FormPrint.C +++ b/src/frontends/xforms/FormPrint.C @@ -54,7 +54,6 @@ void FormPrint::build() bc().setOK(dialog_->button_ok); bc().setApply(dialog_->button_apply); bc().setCancel(dialog_->button_cancel); - bc().refresh(); // allow controlling of input and ok/apply (de)activation fl_set_input_return(dialog_->input_printer, @@ -219,13 +218,23 @@ ButtonPolicy::SMInput FormPrint::input(FL_OBJECT * ob, long) fl_set_input(dialog_->input_file, out_name.c_str()); input(0, 0); } + + // select the file radio + if (!out_name.empty()) { + fl_set_button(dialog_->radio_file, 1); + fl_set_button(dialog_->radio_printer, 0); + } } - // it is probably legal to have no printer name since the system will - // have a default printer set. Or should have. -// if (fl_get_button(dialog_->radio_printer) -// && !strlen(fl_get_input(dialog_->input_printer))) { -// activate = ButtonPolicy::SMI_INVALID; -// } + // if we type into file, select that as a target + if (ob == dialog_->input_file && fl_get_button(dialog_->radio_printer) + && strlen(fl_get_input(dialog_->input_file))) { + fl_set_button(dialog_->radio_file, 1); + fl_set_button(dialog_->radio_printer, 0); + } else if (ob == dialog_->input_printer) { + fl_set_button(dialog_->radio_file, 0); + fl_set_button(dialog_->radio_printer, 1); + } + return activate; }