Replace the DirBrowserRemoteInterface by slots to reduce coupling by using ad-hoc yet type-safe collaborations.

This commit is contained in:
Adam Reichold
2015-12-05 11:45:15 +01:00
parent 87016d353a
commit 4f68e370d4
9 changed files with 42 additions and 64 deletions

View File

@@ -20,30 +20,34 @@
#define _RECENTBROWSER_
#include <gtkmm.h>
#include "dirbrowserremoteinterface.h"
#include "multilangmgr.h"
#include "guiutils.h"
class RecentBrowser : public Gtk::VBox
{
public:
typedef sigc::slot<void, const Glib::ustring&> DirSelectionSlot;
private:
Gtk::ComboBoxText* recentDirs;
sigc::connection conn;
DirBrowserRemoteInterface* listener;
DirSelectionSlot selectDir;
public:
RecentBrowser ();
void setDirBrowserRemoteInterface (DirBrowserRemoteInterface* l)
{
listener = l;
}
void setDirSelector (const DirSelectionSlot& selectDir);
void selectionChanged ();
void dirSelected (const Glib::ustring& dirname, const Glib::ustring& openfile);
};
inline void RecentBrowser::setDirSelector (const RecentBrowser::DirSelectionSlot& selectDir)
{
this->selectDir = selectDir;
}
#endif