]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormPrint.C
Yet another tweak from J�rgen.
[lyx.git] / src / frontends / xforms / FormPrint.C
index d3c6f6665a43b251719d61817c958959f1ccd8ea..9f33f36219be6d96a9b8d8a8687ee4090fda0507 100644 (file)
@@ -1,4 +1,3 @@
-// -*- C++ -*-
 /*
  * \file FormPrint.C
  * Copyright 2000-2001 The LyX Team.
@@ -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;
 }