Merge branch 'master' into gtk3

This commit is contained in:
Hombre
2016-01-11 00:54:25 +01:00
69 changed files with 1940 additions and 1001 deletions

View File

@@ -1178,34 +1178,18 @@ void MyFileChooserButton::get_preferred_width_for_height_vfunc (int width, int &
}
FileChooserLastFolderPersister::FileChooserLastFolderPersister(
Gtk::FileChooser* chooser, Glib::ustring& folderVariable) :
chooser(chooser), folderVariable(folderVariable)
void bindCurrentFolder (Gtk::FileChooser& chooser, Glib::ustring& variable)
{
assert(chooser != NULL);
chooser.signal_selection_changed ().connect ([&]()
{
const auto current_folder = chooser.get_current_folder ();
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();
}
if (!current_folder.empty ())
variable = current_folder;
});
if (!variable.empty ())
chooser.set_current_folder (variable);
}
TextOrIcon::TextOrIcon (Glib::ustring fname, Glib::ustring labelTx, Glib::ustring tooltipTx, TOITypes type)