summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES2
-rw-r--r--src/Fl_File_Chooser.fl9
-rw-r--r--src/Fl_File_Chooser2.cxx3
3 files changed, 9 insertions, 5 deletions
diff --git a/CHANGES b/CHANGES
index def8ef90d..dc7ce2822 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@ CHANGES IN FLTK 1.1.8
- Documentation fixes (STR #1454, STR #1455, STR #1456,
STR #1457, STR #1458, STR #1460, STR #1481, STR #1578)
+ - Flushing file chooser preferences after every change
+ to avoid data loss (STR #1609)
- Fixed clipping in OS X Quartz offscreen buffers
(STR 1595)
- Added Fl::set_awake_cb() to set a handler for thread
diff --git a/src/Fl_File_Chooser.fl b/src/Fl_File_Chooser.fl
index e50039308..d45e63b55 100644
--- a/src/Fl_File_Chooser.fl
+++ b/src/Fl_File_Chooser.fl
@@ -33,7 +33,7 @@ comment {//
decl {\#include <FL/fl_draw.H>} {}
-class FL_EXPORT Fl_File_Chooser {open
+class FL_EXPORT Fl_File_Chooser {open selected
} {
decl {enum { SINGLE = 0, MULTI = 1, CREATE = 2, DIRECTORY = 4 };} {public
}
@@ -53,15 +53,14 @@ class FL_EXPORT Fl_File_Chooser {open
decl {void showChoiceCB();} {}
decl {void update_favorites();} {}
decl {void update_preview();} {}
- Function {Fl_File_Chooser(const char *d, const char *p, int t, const char *title)} {open
- } {
+ Function {Fl_File_Chooser(const char *d, const char *p, int t, const char *title)} {} {
Fl_Window window {
label {Choose File}
callback {fileName->value("");
fileList->deselect();
Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this);
window->hide();}
- private xywh {368 285 490 380} type Double resizable
+ private xywh {403 284 490 380} type Double resizable
code0 {if (title) window->label(title);}
code1 {\#include <stdio.h>}
code2 {\#include <stdlib.h>}
@@ -138,7 +137,7 @@ window->hide();}
// Do any callback that is registered...
if (callback_)
- (*callback_)(this, data_);} selected
+ (*callback_)(this, data_);}
private xywh {313 345 85 25}
code0 {\#include <FL/fl_ask.H>}
code1 {okButton->label(fl_ok);}
diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx
index e6ccf6347..5e9772e60 100644
--- a/src/Fl_File_Chooser2.cxx
+++ b/src/Fl_File_Chooser2.cxx
@@ -243,6 +243,7 @@ Fl_File_Chooser::favoritesButtonCB()
sprintf(menuname, "favorite%02d", v);
prefs_.set(menuname, directory_);
+ prefs_.flush();
quote_pathname(menuname, directory_, sizeof(menuname));
favoritesButton->add(menuname);
@@ -379,6 +380,7 @@ Fl_File_Chooser::favoritesCB(Fl_Widget *w)
}
update_favorites();
+ prefs_.flush();
favWindow->hide();
}
@@ -791,6 +793,7 @@ Fl_File_Chooser::preview(int e)// I - 1 = enable preview, 0 = disable preview
{
previewButton->value(e);
prefs_.set("preview", e);
+ prefs_.flush();
Fl_Group *p = previewBox->parent();
if (e) {