diff options
| author | Manolo Gouy <Manolo> | 2010-03-26 18:10:39 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2010-03-26 18:10:39 +0000 |
| commit | f766b7930d4a656d3e29e7f4300f52f3b3244d03 (patch) | |
| tree | f31675559c69f5bb2c55c9c3241c25717bd248fb /src | |
| parent | 44d22726b6dac2f9e3908e9710fbc0aa533f8355 (diff) | |
PostScrit print dialog: memorize page size and orientation user's preferences
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7342 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_PS_Printer.cxx | 3 | ||||
| -rw-r--r-- | src/print_panel.cxx | 15 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/Fl_PS_Printer.cxx b/src/Fl_PS_Printer.cxx index c776e70b8..eb9268e4c 100644 --- a/src/Fl_PS_Printer.cxx +++ b/src/Fl_PS_Printer.cxx @@ -392,7 +392,6 @@ static const char * prolog_3 = // prolog relevant only if lang_level >2 // end prolog - Fl_PSfile_Device::Fl_PSfile_Device(void) { close_cmd_ = 0; @@ -1257,6 +1256,7 @@ int Fl_Printer::start_job(int pages, int *firstpage, int *lastpage) { // first test version for print dialog + print_prefs = new Fl_Preferences(Fl_Preferences::USER, "fltk.org", "print_support"); if (!print_panel) make_print_panel(); print_load(); print_selection->deactivate(); @@ -1266,6 +1266,7 @@ int Fl_Printer::start_job(int pages, int *firstpage, int *lastpage) { { char tmp[10]; snprintf(tmp, sizeof(tmp), "%d", pages); print_to->value(tmp); } print_panel->show(); // this is modal while (print_panel->shown()) Fl::wait(); + delete print_prefs; if (!print_start) // user clicked cancel return 1; diff --git a/src/print_panel.cxx b/src/print_panel.cxx index 866488615..e5721a3c8 100644 --- a/src/print_panel.cxx +++ b/src/print_panel.cxx @@ -48,7 +48,7 @@ #include <FL/Fl_Preferences.H> #include <FL/Fl_Int_Input.H> -// extern Fl_Preferences fluid_prefs; +static Fl_Preferences *print_prefs; static Fl_Double_Window *print_panel=(Fl_Double_Window *)0; static Fl_Group *print_panel_controls=(Fl_Group *)0; @@ -230,13 +230,13 @@ static void cb_Save(Fl_Return_Button*, void*) { const char *printer = (const char *)print_choice->menu()[print_choice->value()].user_data(); snprintf(name, sizeof(name), "%s/page_size", printer); - // fluid_prefs.set(name, print_page_size->value()); + print_prefs->set(name, print_page_size->value()); snprintf(name, sizeof(name), "%s/output_mode", printer); for (val = 0; val < 4; val ++) { if (print_output_mode[val]->value()) break; } - // fluid_prefs.set(name, val); // FIXME -- save prefs + print_prefs->set(name, val); } static void cb_Cancel1(Fl_Button*, void*) { @@ -583,15 +583,14 @@ void print_update_status() { print_status->label(status); char name[1024]; - // int val; - int val = 0; // FIXME -- see below: read preferences ! + int val; snprintf(name, sizeof(name), "%s/page_size", printer); - // fluid_prefs.get(name, val, 0); - print_page_size->value(1); // FIXME + print_prefs->get(name, val, 1); + print_page_size->value(val); snprintf(name, sizeof(name), "%s/output_mode", printer); - // fluid_prefs.get(name, val, 0); + print_prefs->get(name, val, 0); print_output_mode[val]->setonly(); } |
