Solving issue 872: "RT file-open/save windows should remember last used dir", on behalf of Johannes Wienke

This commit is contained in:
natureh
2012-06-02 14:48:35 +02:00
parent 842e446060
commit f78cadf4d1
23 changed files with 973 additions and 817 deletions

View File

@@ -22,6 +22,8 @@
#include "../rtengine/utils.h"
#include "rtimage.h"
#include <assert.h>
using namespace std;
bool removeIfThere (Gtk::Container* cont, Gtk::Widget* w, bool increference) {
@@ -402,6 +404,33 @@ bool MyFileChooserButton::on_scroll_event (GdkEventScroll* event) {
return false;
}
FileChooserLastFolderPersister::FileChooserLastFolderPersister(
Gtk::FileChooser* chooser, Glib::ustring& folderVariable) :
chooser(chooser), folderVariable(folderVariable) {
assert(chooser != NULL);
selectionChangedConnetion = chooser->signal_selection_changed().connect(
sigc::mem_fun(*this,
&FileChooserLastFolderPersister::selectionChanged));
if (!folderVariable.empty()) {
chooser->set_current_folder(folderVariable);
}
}
FileChooserLastFolderPersister::~FileChooserLastFolderPersister() {
}
void FileChooserLastFolderPersister::selectionChanged() {
if (!chooser->get_current_folder().empty()) {
folderVariable = chooser->get_current_folder();
}
}
TextOrIcon::TextOrIcon (Glib::ustring fname, Glib::ustring labelTx, Glib::ustring tooltipTx, TOITypes type) {
imgIcon = 0;