[niepce: 2/5] * Remove glade to use GtkBuilder. Rename a few he



commit db2ab209d64335be6dbeffa837c3dae5933b276e
Author: Hubert Figuiere <hub figuiere net>
Date:   Wed Mar 4 23:47:45 2009 -0500

    	* Remove glade to use GtkBuilder. Rename a few headers.
---
 ChangeLog                                      |    2 +
 README                                         |    4 +-
 configure.ac                                   |    4 +-
 src/fwk/toolkit/Makefile.am                    |    6 +-
 src/fwk/toolkit/application.cpp                |    4 +-
 src/fwk/toolkit/application.h                  |  104 -------------
 src/fwk/toolkit/application.hpp                |  104 +++++++++++++
 src/fwk/toolkit/frame.cpp                      |  185 ++++++++++++------------
 src/fwk/toolkit/frame.h                        |  109 --------------
 src/fwk/toolkit/frame.hpp                      |  110 ++++++++++++++
 src/fwk/toolkit/widgets/dock-item.cpp          |    2 +-
 src/niepce/Makefile.am                         |    4 +-
 src/niepce/main.cpp                            |    2 +-
 src/niepce/modules/darkroom/Makefile.am        |    2 +-
 src/niepce/modules/darkroom/darkroommodule.cpp |    2 +-
 src/niepce/ui/Makefile.am                      |    6 +-
 src/niepce/ui/imageliststore.cpp               |    4 +-
 src/niepce/ui/importdialog.cpp                 |   24 ++--
 src/niepce/ui/importdialog.hpp                 |    2 +-
 src/niepce/ui/librarymainviewcontroller.cpp    |    4 +-
 src/niepce/ui/niepceapplication.cpp            |    4 +-
 src/niepce/ui/niepceapplication.h              |   52 -------
 src/niepce/ui/niepceapplication.hpp            |   52 +++++++
 src/niepce/ui/niepcewindow.cpp                 |   13 +-
 src/niepce/ui/niepcewindow.h                   |  111 --------------
 src/niepce/ui/niepcewindow.hpp                 |  111 ++++++++++++++
 src/niepce/ui/preferences.ui                   |  160 ++++++++++++++++++++
 src/niepce/ui/selectioncontroller.cpp          |    4 +-
 src/niepce/ui/thumb-view/Makefile.am           |    2 +-
 src/niepce/ui/workspacecontroller.cpp          |    4 +-
 30 files changed, 680 insertions(+), 517 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 919cafa..9b4f64e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2009-03-04  Hubert Figuiere  <hub figuiere net>
 
+	* Remove glade to use GtkBuilder. Rename a few headers.
+
 	* List the folders to import in the import dialog.
 
 2009-03-02  Hubert Figuiere  <hub figuiere net>
diff --git a/README b/README
index 5a20d79..0175659 100644
--- a/README
+++ b/README
@@ -24,7 +24,7 @@ To build is you need the following:
 A C++ compiler
 gtk+ 2.8
 cairo 1.1
-gtkmm 2.10
+gtkmm 2.12
 gconf 2.x
 cairomm
 gnome-vfs >= 2.14
@@ -48,7 +48,7 @@ UNIX systems.
 Working on Debian
 ~~~~~~~~~~~~~~~~~
 In order to get Niepce working on Debian you should have to install:
-aptitude install libglademm-2.4-dev gconf2-dev libgnomevfs2-dev \
+aptitude install gconf2-dev libgnomevfs2-dev \
 > libexempi-dev libopenraw-dev libopenrawgnome-dev libgtkmm-2.4-dev \
 > libgoocanvas-dev
 
diff --git a/configure.ac b/configure.ac
index 1330868..acb31de 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,7 +20,7 @@ dnl all the library version.
 dnl if one is harcoded elsewhere, it is a bug
 LIBGLIBMM_VERSION=2.0
 LIBGTKMM_VERSION=2.12.0
-LIBGLADEMM_VERSION=2.6.0
+dnl LIBGLADEMM_VERSION=2.6.0
 dnl LIBGCONFMM_VERSION=2.6.0
 LIBGCONF_VERSION=2.0.0
 LIBGNOMEUI_VERSION=2.0.0
@@ -67,7 +67,7 @@ AC_LANG_COMPILER_REQUIRE
 
 PKG_CHECK_MODULES(LIBGLIBMM, [glibmm-2.4])
 PKG_CHECK_MODULES(LIBGTKMM, [gtkmm-2.4 >= $LIBGTKMM_VERSION])
-PKG_CHECK_MODULES(LIBGLADEMM, [libglademm-2.4 >= $LIBGLADEMM_VERSION])
+dnl PKG_CHECK_MODULES(LIBGLADEMM, [libglademm-2.4 >= $LIBGLADEMM_VERSION])
 dnl PKG_CHECK_MODULES(LIBGNOMEUI, [libgnomeui-2.0 >= $LIBGNOMEUI_VERSION])
 dnl PKG_CHECK_MODULES(LIBGCONFMM, [gconfmm-2.6 >= $LIBGCONFMM_VERSION])
 PKG_CHECK_MODULES(GCONF, [gconf-2.0 >= $LIBGCONF_VERSION])
diff --git a/src/fwk/toolkit/Makefile.am b/src/fwk/toolkit/Makefile.am
index ea079c4..231ae41 100644
--- a/src/fwk/toolkit/Makefile.am
+++ b/src/fwk/toolkit/Makefile.am
@@ -3,14 +3,14 @@
 
 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/ext \
 	@LIBGLIBMM_CFLAGS@ \
-	@LIBGTKMM_CFLAGS@ @LIBGLADEMM_CFLAGS@ \
+	@LIBGTKMM_CFLAGS@ \
 	@GCONF_CFLAGS@  @GNOMEVFS_CFLAGS@ @EXEMPI_CFLAGS@ \
 	$(NULL)
 
 noinst_LIBRARIES = libniepceframework.a
 
-noinst_HEADERS = configuration.h application.h \
-	frame.h controller.h goocanvas_proxy_header.h \
+noinst_HEADERS = configuration.h application.hpp \
+	frame.hpp controller.h goocanvas_proxy_header.h \
 	gconf_proxy_header.h
 
 libniepceframework_a_SOURCES = configuration.cpp \
diff --git a/src/fwk/toolkit/application.cpp b/src/fwk/toolkit/application.cpp
index b1d766c..b0a2410 100644
--- a/src/fwk/toolkit/application.cpp
+++ b/src/fwk/toolkit/application.cpp
@@ -29,8 +29,8 @@
 #include <gconf/gconf.h>
 
 #include "fwk/utils/debug.h"
-#include "application.h"
-#include "frame.h"
+#include "application.hpp"
+#include "frame.hpp"
 
 
 namespace framework {
diff --git a/src/fwk/toolkit/application.h b/src/fwk/toolkit/application.h
deleted file mode 100644
index 5faf857..0000000
--- a/src/fwk/toolkit/application.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * niepce - framework/application.h
- *
- * Copyright (C) 2007-2008 Hubert Figuiere
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-
-#ifndef _FRAMEWORK_APPLICATION_H_
-#define _FRAMEWORK_APPLICATION_H_
-
-#include <boost/function.hpp>
-
-#include <glibmm/refptr.h>
-#include <gtkmm/uimanager.h>
-#include <gtkmm/icontheme.h>
-
-#include "fwk/toolkit/configuration.h"
-#include "fwk/toolkit/frame.h"
-#include "fwk/toolkit/undo.h"
-
-
-namespace framework {
-
-class Application 
-    : public Controller
-{
-public:
-    typedef boost::shared_ptr<Application> Ptr;
-    typedef std::pair<Glib::ustring, std::string> ThemeDesc;
-
-    virtual ~Application();
-
-    virtual Glib::ustring get_rc_path();
-    virtual int get_use_custom_theme() const;
-    virtual void set_use_custom_theme(int theme_idx);
-    const std::vector<ThemeDesc> & get_available_themes() const
-        {
-            return m_themes;
-        }
-
-    virtual Frame::Ptr makeMainFrame() = 0;
-
-    Configuration & config()
-        { return m_config; }
-    Glib::RefPtr<Gtk::UIManager> uiManager()
-        { 
-            if(!m_refUIManager) {
-                m_refUIManager = Gtk::UIManager::create();
-            }
-            return m_refUIManager; 
-        }
-
-    virtual Gtk::Widget * buildWidget();
-    virtual void quit();
-    void about();
-    virtual void add(const Controller::Ptr & sub);
-    virtual void terminate();
-
-    Glib::RefPtr<Gtk::IconTheme> getIconTheme() const;
-
-    static Application::Ptr app();
-    static int main(boost::function<Application::Ptr (void)> constructor, 
-                    int argc, char **argv);
-
-    UndoHistory & undo_history()
-        { return m_undo; }
-protected:
-    Application(const char *);
-    static Application::Ptr m_application; 
-    virtual void on_about();
-    void register_theme(const Glib::ustring & label,
-                        const std::string &path);
-private:
-    Configuration                m_config;
-    Glib::RefPtr<Gtk::UIManager> m_refUIManager;
-    UndoHistory                  m_undo;
-    std::vector<ThemeDesc>       m_themes;
-};
-
-}
-
-#endif
-/*
-  Local Variables:
-  mode:c++
-  c-file-style:"stroustrup"
-  c-file-offsets:((innamespace . 0))
-  indent-tabs-mode:nil
-  fill-column:80
-  End:
-*/
diff --git a/src/fwk/toolkit/application.hpp b/src/fwk/toolkit/application.hpp
new file mode 100644
index 0000000..444cbc4
--- /dev/null
+++ b/src/fwk/toolkit/application.hpp
@@ -0,0 +1,104 @@
+/*
+ * niepce - framework/application.h
+ *
+ * Copyright (C) 2007-2008 Hubert Figuiere
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _FRAMEWORK_APPLICATION_H_
+#define _FRAMEWORK_APPLICATION_H_
+
+#include <boost/function.hpp>
+
+#include <glibmm/refptr.h>
+#include <gtkmm/uimanager.h>
+#include <gtkmm/icontheme.h>
+
+#include "fwk/toolkit/configuration.h"
+#include "fwk/toolkit/frame.hpp"
+#include "fwk/toolkit/undo.h"
+
+
+namespace framework {
+
+class Application 
+    : public Controller
+{
+public:
+    typedef boost::shared_ptr<Application> Ptr;
+    typedef std::pair<Glib::ustring, std::string> ThemeDesc;
+
+    virtual ~Application();
+
+    virtual Glib::ustring get_rc_path();
+    virtual int get_use_custom_theme() const;
+    virtual void set_use_custom_theme(int theme_idx);
+    const std::vector<ThemeDesc> & get_available_themes() const
+        {
+            return m_themes;
+        }
+
+    virtual Frame::Ptr makeMainFrame() = 0;
+
+    Configuration & config()
+        { return m_config; }
+    Glib::RefPtr<Gtk::UIManager> uiManager()
+        { 
+            if(!m_refUIManager) {
+                m_refUIManager = Gtk::UIManager::create();
+            }
+            return m_refUIManager; 
+        }
+
+    virtual Gtk::Widget * buildWidget();
+    virtual void quit();
+    void about();
+    virtual void add(const Controller::Ptr & sub);
+    virtual void terminate();
+
+    Glib::RefPtr<Gtk::IconTheme> getIconTheme() const;
+
+    static Application::Ptr app();
+    static int main(boost::function<Application::Ptr (void)> constructor, 
+                    int argc, char **argv);
+
+    UndoHistory & undo_history()
+        { return m_undo; }
+protected:
+    Application(const char *);
+    static Application::Ptr m_application; 
+    virtual void on_about();
+    void register_theme(const Glib::ustring & label,
+                        const std::string &path);
+private:
+    Configuration                m_config;
+    Glib::RefPtr<Gtk::UIManager> m_refUIManager;
+    UndoHistory                  m_undo;
+    std::vector<ThemeDesc>       m_themes;
+};
+
+}
+
+#endif
+/*
+  Local Variables:
+  mode:c++
+  c-file-style:"stroustrup"
+  c-file-offsets:((innamespace . 0))
+  indent-tabs-mode:nil
+  fill-column:80
+  End:
+*/
diff --git a/src/fwk/toolkit/frame.cpp b/src/fwk/toolkit/frame.cpp
index f49d144..6044480 100644
--- a/src/fwk/toolkit/frame.cpp
+++ b/src/fwk/toolkit/frame.cpp
@@ -26,56 +26,56 @@
 #include "fwk/utils/debug.h"
 #include "fwk/utils/boost.h"
 #include "fwk/utils/geometry.h"
-#include "frame.h"
-#include "application.h"
+#include "frame.hpp"
+#include "application.hpp"
 
 
 
 namespace framework {
 
-	Frame::Frame(const std::string & layout_cfg_key)
+Frame::Frame(const std::string & layout_cfg_key)
 		: m_window(new Gtk::Window()),
-		  m_glade(NULL),
+		  m_builder(NULL),
 		  m_layout_cfg_key(layout_cfg_key)
-	{
+{
 		connectSignals();
 		frameRectFromConfig();
-	}
+}
 
 
-	Frame::Frame(const std::string & gladeFile, 
-				 const Glib::ustring & widgetName,
-				 const std::string & layout_cfg_key)
+Frame::Frame(const std::string & gladeFile, 
+             const Glib::ustring & widgetName,
+             const std::string & layout_cfg_key)
 		: m_window(NULL),
-		  m_glade(Gnome::Glade::Xml::create(gladeFile)),
+		  m_builder(Gtk::Builder::create_from_file(gladeFile)),
 		  m_layout_cfg_key(layout_cfg_key)
-	{
-		if (m_glade) {
-			m_window = static_cast<Gtk::Window*>(m_glade->get_widget(widgetName));
-			connectSignals();
-			frameRectFromConfig();
+{
+		if (m_builder) {
+        m_builder->get_widget(widgetName, m_window);
+        connectSignals();
+        frameRectFromConfig();
 		}
-	}
+}
 
 
-	void Frame::connectSignals()
-	{
+void Frame::connectSignals()
+{
 		m_window->signal_delete_event().connect(
-			sigc::hide(sigc::mem_fun(this, &Frame::_close)));
+        sigc::hide(sigc::mem_fun(this, &Frame::_close)));
 		m_window->signal_hide().connect(
-			sigc::retype_return<void>(sigc::mem_fun(this, &Frame::_close)));
-	}
+        sigc::retype_return<void>(sigc::mem_fun(this, &Frame::_close)));
+}
 
-	Frame::~Frame()
-	{
+Frame::~Frame()
+{
 		frameRectToConfig();
-        DBG_OUT("destroy Frame");
-        delete m_window;
-	}
+    DBG_OUT("destroy Frame");
+    delete m_window;
+}
 
 
-	void Frame::set_icon_from_theme(const Glib::ustring & name)
-	{
+void Frame::set_icon_from_theme(const Glib::ustring & name)
+{
 		using Glib::RefPtr;
 		using Gtk::IconTheme;
 		using std::vector;
@@ -87,101 +87,102 @@ namespace framework {
 		list< RefPtr <Gdk::Pixbuf> > icons;
 
 		for_each(icon_sizes.begin(), icon_sizes.end(),
-				 // store the icon
-				 bind(&std::list< RefPtr<Gdk::Pixbuf> >::push_back, 
-					  boost::ref(icons), 
-					  // load the icon
-					  bind( &IconTheme::load_icon, 
-							boost::ref(icon_theme), 
-							boost::ref(name), _1, 
-							Gtk::ICON_LOOKUP_USE_BUILTIN)));
+             // store the icon
+             bind(&std::list< RefPtr<Gdk::Pixbuf> >::push_back, 
+                  boost::ref(icons), 
+                  // load the icon
+                  bind( &IconTheme::load_icon, 
+                        boost::ref(icon_theme), 
+                        boost::ref(name), _1, 
+                        Gtk::ICON_LOOKUP_USE_BUILTIN)));
 		gtkWindow().set_icon_list(icons);
-	}
+}
 
-	void Frame::set_title(const std::string & title)
-	{
+void Frame::set_title(const std::string & title)
+{
 		gtkWindow().set_title(Glib::ustring(title));
-	}
+}
 
-	int Frame::show_modal_dialog(Gtk::Dialog & dlg)
-	{
+int Frame::show_modal_dialog(Gtk::Dialog & dlg)
+{
 		int result;
 		dlg.set_transient_for(*m_window);
 		dlg.set_default_response(Gtk::RESPONSE_CLOSE);
 		result = dlg.run();
 		dlg.hide();
 		return result;
-	}
-
-	int Frame::show_modal_dialog(const char *gladefile,
-								 const char *widgetname,
-								 boost::function<void (const Glib::RefPtr<Gnome::Glade::Xml> &, Gtk::Dialog *)> setup)
-	{
-		Glib::RefPtr<Gnome::Glade::Xml> refXml 
-            = Gnome::Glade::Xml::create(gladefile);
+}
+
+int Frame::show_modal_dialog(const char *gladefile,
+                             const char *widgetname,
+                             boost::function<void (const Glib::RefPtr<Gtk::Builder> &, 
+                                                   Gtk::Dialog *)> setup)
+{
+		Glib::RefPtr<Gtk::Builder> dialogBuilder 
+        = Gtk::Builder::create_from_file(gladefile);
 		Gtk::Dialog *dlg = NULL;
 
-		dlg = refXml->get_widget(widgetname, dlg);
+		dialogBuilder->get_widget(widgetname, dlg);
 		if(setup) {
-			setup(refXml, dlg);
+        setup(dialogBuilder, dlg);
 		}
 		return show_modal_dialog(*dlg);
-	}
+}
 
-    void Frame::toggle_tools_visible()
-    {
-        if(m_hide_tools_action->get_active()) {
-            signal_hide_tools.emit();   
-        }
-        else {
-            signal_show_tools.emit();
-        }
+void Frame::toggle_tools_visible()
+{
+    if(m_hide_tools_action->get_active()) {
+        signal_hide_tools.emit();   
     }
+    else {
+        signal_show_tools.emit();
+    }
+}
 
 
-	bool Frame::_close()
-	{
+bool Frame::_close()
+{
 		if(Controller::Ptr parent = m_parent.lock()) {
-			parent->remove(shared_from_this());
+        parent->remove(shared_from_this());
 		}
 		return false;
-	}
+}
 
-	void Frame::frameRectFromConfig()
-	{
+void Frame::frameRectFromConfig()
+{
 		DBG_OUT("loading frame rect (%s)", m_layout_cfg_key.c_str());
 		if(!m_layout_cfg_key.empty()) {
-			Configuration & cfg = Application::app()->config();
-			std::string val;
-			val = cfg.getValue(m_layout_cfg_key, "");
-			if(!val.empty()) {
-				try {
-					utils::Rect r(val);
-					m_window->move(r.x(), r.y());
-					m_window->resize(r.w(), r.h());				
-				}
-				catch(std::bad_cast)
-				{
-					ERR_OUT("wrong value in configuration: %s", val.c_str());
-				}
-			}
+        Configuration & cfg = Application::app()->config();
+        std::string val;
+        val = cfg.getValue(m_layout_cfg_key, "");
+        if(!val.empty()) {
+            try {
+                utils::Rect r(val);
+                m_window->move(r.x(), r.y());
+                m_window->resize(r.w(), r.h());				
+            }
+            catch(std::bad_cast)
+            {
+                ERR_OUT("wrong value in configuration: %s", val.c_str());
+            }
+        }
 		}
-	}
+}
 
 
-	void Frame::frameRectToConfig()
-	{
+void Frame::frameRectToConfig()
+{
 		DBG_OUT("saving frame rect (%s)", m_layout_cfg_key.c_str());
 		if(!m_layout_cfg_key.empty()) {
-			Configuration & cfg = Application::app()->config();
-			int x, y, w, h;
-			x = y = w = h = 0;
-			m_window->get_position(x, y);
-			m_window->get_size(w, h);
-			utils::Rect r(x, y, w, h);
-			cfg.setValue(m_layout_cfg_key, r.to_string());
+        Configuration & cfg = Application::app()->config();
+        int x, y, w, h;
+        x = y = w = h = 0;
+        m_window->get_position(x, y);
+        m_window->get_size(w, h);
+        utils::Rect r(x, y, w, h);
+        cfg.setValue(m_layout_cfg_key, r.to_string());
 		}
-	}
+}
 
 /*
   Local Variables:
diff --git a/src/fwk/toolkit/frame.h b/src/fwk/toolkit/frame.h
deleted file mode 100644
index 7cdbbfc..0000000
--- a/src/fwk/toolkit/frame.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * niepce - framework/frame.h
- *
- * Copyright (C) 2007-2008 Hubert Figuiere
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-
-#ifndef _FRAMEWORK_FRAME_H_
-#define _FRAMEWORK_FRAME_H_
-
-#include <string>
-#include <boost/function.hpp>
-
-#include <sigc++/signal.h>
-#include <libglademm/xml.h>
-#include <gtkmm/toggleaction.h>
-
-#include "fwk/toolkit/controller.h"
-
-namespace Gtk {
-	class Dialog;
-}
-
-namespace framework {
-
-	class Frame 
-		: public Controller
-	{
-	public:
-		typedef boost::shared_ptr<Frame> Ptr;
-
-		Frame(const std::string & gladeFile, const Glib::ustring & widgetName,
-			  const std::string & layout_cfg_key = "");
-		Frame(const std::string & layout_cfg_key = "");
-		~Frame();
-
-		Gtk::Window & gtkWindow()
-			{
-				return *m_window; 
-			}
-		Glib::RefPtr<Gnome::Glade::Xml> & glade()
-			{ return m_glade; }
-
-		/** set the title of the window.
-		 * @param title the title of the window.
-		 * 
-		 * override to provide you own hooks - behaviour.
-		 */
-		virtual void set_title(const std::string & title);
-		/** set the window icon from the theme 
-		 * @param name the icon name in the theme
-		 */
-		void set_icon_from_theme(const Glib::ustring & name);
-
-		/** show a model dialog
-		 * @param dlg the dialog to show.
-		 * @return the result from Dialog::run()
-		 */
-		int show_modal_dialog(Gtk::Dialog & dlg);
-		int show_modal_dialog(const char *gladefile,
-							  const char *widgetname,
-							  boost::function<void (const Glib::RefPtr<Gnome::Glade::Xml> &, Gtk::Dialog *)> setup = NULL);
-
-        
-        void toggle_tools_visible();
-
-        sigc::signal<void> signal_hide_tools;
-        sigc::signal<void> signal_show_tools;
-	protected:
-		/** close signal handler */
-		virtual bool _close();
-        Glib::RefPtr<Gtk::ToggleAction> m_hide_tools_action;
-
-	private:
-		void connectSignals();
-		void frameRectFromConfig();
-		void frameRectToConfig();
-
-		Gtk::Window *m_window;
-		Glib::RefPtr<Gnome::Glade::Xml> m_glade;
-		std::string m_layout_cfg_key;
-	};
-
-}
-
-
-/*
-  Local Variables:
-  mode:c++
-  c-file-style:"stroustrup"
-  c-file-offsets:((innamespace . 0))
-  indent-tabs-mode:nil
-  fill-column:80
-  End:
-*/
-#endif
diff --git a/src/fwk/toolkit/frame.hpp b/src/fwk/toolkit/frame.hpp
new file mode 100644
index 0000000..6c5fd44
--- /dev/null
+++ b/src/fwk/toolkit/frame.hpp
@@ -0,0 +1,110 @@
+/*
+ * niepce - framework/frame.h
+ *
+ * Copyright (C) 2007-2008 Hubert Figuiere
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _FRAMEWORK_FRAME_H_
+#define _FRAMEWORK_FRAME_H_
+
+#include <string>
+#include <boost/function.hpp>
+
+#include <sigc++/signal.h>
+#include <gtkmm/toggleaction.h>
+#include <gtkmm/builder.h>
+
+#include "fwk/toolkit/controller.h"
+
+namespace Gtk {
+	class Dialog;
+}
+
+namespace framework {
+
+class Frame 
+		: public Controller
+{
+public:
+		typedef boost::shared_ptr<Frame> Ptr;
+
+		Frame(const std::string & gladeFile, const Glib::ustring & widgetName,
+          const std::string & layout_cfg_key = "");
+		Frame(const std::string & layout_cfg_key = "");
+		~Frame();
+
+		Gtk::Window & gtkWindow()
+        {
+            return *m_window; 
+        }
+    Glib::RefPtr<Gtk::Builder> & builder()
+        { return m_builder; }
+
+		/** set the title of the window.
+		 * @param title the title of the window.
+		 * 
+		 * override to provide you own hooks - behaviour.
+		 */
+		virtual void set_title(const std::string & title);
+		/** set the window icon from the theme 
+		 * @param name the icon name in the theme
+		 */
+		void set_icon_from_theme(const Glib::ustring & name);
+
+		/** show a model dialog
+		 * @param dlg the dialog to show.
+		 * @return the result from Dialog::run()
+		 */
+		int show_modal_dialog(Gtk::Dialog & dlg);
+		int show_modal_dialog(const char *gladefile,
+                          const char *widgetname,
+                          boost::function<void (const Glib::RefPtr<Gtk::Builder> &, 
+                                                Gtk::Dialog *)> setup = NULL);
+
+        
+    void toggle_tools_visible();
+
+    sigc::signal<void> signal_hide_tools;
+    sigc::signal<void> signal_show_tools;
+protected:
+		/** close signal handler */
+		virtual bool _close();
+    Glib::RefPtr<Gtk::ToggleAction> m_hide_tools_action;
+
+private:
+		void connectSignals();
+		void frameRectFromConfig();
+		void frameRectToConfig();
+
+		Gtk::Window *m_window;
+    Glib::RefPtr<Gtk::Builder> m_builder;
+		std::string m_layout_cfg_key;
+};
+
+}
+
+
+/*
+  Local Variables:
+  mode:c++
+  c-file-style:"stroustrup"
+  c-file-offsets:((innamespace . 0))
+  indent-tabs-mode:nil
+  fill-column:80
+  End:
+*/
+#endif
diff --git a/src/fwk/toolkit/widgets/dock-item.cpp b/src/fwk/toolkit/widgets/dock-item.cpp
index 3e80465..0023929 100644
--- a/src/fwk/toolkit/widgets/dock-item.cpp
+++ b/src/fwk/toolkit/widgets/dock-item.cpp
@@ -20,7 +20,7 @@
 //#include "inkscape.h"
 //#include "prefs-utils.h"
 #include "fwk/toolkit/widgets/dock.h"
-#include "fwk/toolkit/application.h"
+#include "fwk/toolkit/application.hpp"
 //#include "widgets/icon.h"
 
 
diff --git a/src/niepce/Makefile.am b/src/niepce/Makefile.am
index 9801313..b7877cd 100644
--- a/src/niepce/Makefile.am
+++ b/src/niepce/Makefile.am
@@ -7,7 +7,7 @@ INCLUDES = -DDATADIR=\"$(datadir)\" \
 
 bin_PROGRAMS = niepce
 
-niepce_CPPFLAGS = @LIBGTKMM_CFLAGS@ @LIBGLADEMM_CFLAGS@	@GCONF_CFLAGS@
+niepce_CPPFLAGS = @LIBGTKMM_CFLAGS@ @GCONF_CFLAGS@
 niepce_LDFLAGS = -Wl,--as-needed @BOOST_FILESYSTEM_LDFLAGS@ \
 	@BOOST_THREAD_LDFLAGS@ @BOOST_SIGNALS_LDFLAGS@
 niepce_LDADD = \
@@ -23,7 +23,7 @@ niepce_LDADD = \
 	$(top_builddir)/src/ncr/libncr.a \
 	$(top_builddir)/src/ext/libgdl/libgdl.a \
 	@LIBGLIBMM_LIBS@ \
-	@LIBGTKMM_LIBS@ @LIBGLADEMM_LIBS@ @SQLITE3_LIBS@ \
+	@LIBGTKMM_LIBS@ @SQLITE3_LIBS@ \
 	@GNOMEVFS_LIBS@ @GCONF_LIBS@ @BOOST_THREAD_LIBS@ \
 	@BOOST_FILESYSTEM_LIBS@  @BOOST_SIGNALS_LIBS@ \
 	@GOOCANVASMM_LIBS@ @BABL_LIBS@ \
diff --git a/src/niepce/main.cpp b/src/niepce/main.cpp
index 6173567..6947a13 100644
--- a/src/niepce/main.cpp
+++ b/src/niepce/main.cpp
@@ -25,7 +25,7 @@
 
 #include "fwk/utils/exempi.h"
 #include "xmp.h"
-#include "ui/niepceapplication.h"
+#include "ui/niepceapplication.hpp"
 
 namespace bfs = boost::filesystem;
 using utils::ExempiManager;
diff --git a/src/niepce/modules/darkroom/Makefile.am b/src/niepce/modules/darkroom/Makefile.am
index 827b245..a5b52c6 100644
--- a/src/niepce/modules/darkroom/Makefile.am
+++ b/src/niepce/modules/darkroom/Makefile.am
@@ -4,7 +4,7 @@ INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/niepce -I$(top_srcdir)/src/ex
 	-DGLADEDIR=\"$(gladedir)\" \
 	-DDATADIR=\"$(datadir)\" \
 	@LIBGLIBMM_CFLAGS@ \
-	@LIBGTKMM_CFLAGS@ @LIBGLADEMM_CFLAGS@ \
+	@LIBGTKMM_CFLAGS@ \
 	@GNOMEVFS_CFLAGS@ @GCONF_CFLAGS@ \
 	@GOOCANVASMM_CFLAGS@  \
 	@GEGLMM_CFLAGS@ @EXEMPI_CFLAGS@ @OPENRAW_CFLAGS@
diff --git a/src/niepce/modules/darkroom/darkroommodule.cpp b/src/niepce/modules/darkroom/darkroommodule.cpp
index 30d1017..b09081c 100644
--- a/src/niepce/modules/darkroom/darkroommodule.cpp
+++ b/src/niepce/modules/darkroom/darkroommodule.cpp
@@ -22,7 +22,7 @@
 #include <gtkmm/stock.h>
 
 #include "fwk/utils/debug.h"
-#include "fwk/toolkit/application.h"
+#include "fwk/toolkit/application.hpp"
 #include "fwk/toolkit/configdatabinder.h"
 #include "fwk/toolkit/widgets/dock.h"
 #include "ncr/ncr.h"
diff --git a/src/niepce/ui/Makefile.am b/src/niepce/ui/Makefile.am
index 321de72..eebf7a9 100644
--- a/src/niepce/ui/Makefile.am
+++ b/src/niepce/ui/Makefile.am
@@ -2,7 +2,7 @@
 
 DIST_SUBDIRS = thumb-view
 
-gladefiles = preferences.glade \
+gladefiles = preferences.ui \
 	importdialog.ui
 
 gladedir = @datarootdir@/niepce/glade/
@@ -13,7 +13,7 @@ INCLUDES = -I$(top_srcdir)/src/ -I$(srcdir)/.. -I$(srcdir)/thumb-view \
 	-DGLADEDIR=\"$(gladedir)\" \
 	-DDATADIR=\"$(datadir)\" \
 	@LIBGLIBMM_CFLAGS@ \
-	@LIBGTKMM_CFLAGS@ @LIBGLADEMM_CFLAGS@ \
+	@LIBGTKMM_CFLAGS@ \
 	@GNOMEVFS_CFLAGS@ @GCONF_CFLAGS@ \
 	@GOOCANVASMM_CFLAGS@ \
 	@EXEMPI_CFLAGS@
@@ -24,7 +24,7 @@ noinst_LIBRARIES = libniepceui.a
 
 libniepceui_a_CPPFLAGS = 
 libniepceui_a_SOURCES = niepcewindow.h niepcewindow.cpp \
-	niepceapplication.h niepceapplication.cpp \
+	niepceapplication.hpp niepceapplication.cpp \
 	librarymainview.h librarymainview.cpp \
 	librarycellrenderer.h librarycellrenderer.cpp \
 	librarymainviewcontroller.h librarymainviewcontroller.cpp \
diff --git a/src/niepce/ui/imageliststore.cpp b/src/niepce/ui/imageliststore.cpp
index 6833530..1da880a 100644
--- a/src/niepce/ui/imageliststore.cpp
+++ b/src/niepce/ui/imageliststore.cpp
@@ -21,12 +21,12 @@
 
 #include "imageliststore.h"
 #include "fwk/utils/debug.h"
-#include "fwk/toolkit/application.h"
+#include "fwk/toolkit/application.hpp"
 #include "fwk/toolkit/gdkutils.h"
 #include "niepce/notifications.h"
 #include "engine/db/library.h"
 #include "engine/library/thumbnailnotification.h"
-#include "niepcewindow.h"
+#include "niepcewindow.hpp"
 
 namespace ui {
 
diff --git a/src/niepce/ui/importdialog.cpp b/src/niepce/ui/importdialog.cpp
index 6fb72c1..1222ceb 100644
--- a/src/niepce/ui/importdialog.cpp
+++ b/src/niepce/ui/importdialog.cpp
@@ -30,7 +30,7 @@
 
 #include "fwk/utils/debug.h"
 #include "fwk/toolkit/configuration.h"
-#include "fwk/toolkit/application.h"
+#include "fwk/toolkit/application.hpp"
 #include "importdialog.hpp"
 
 using framework::Configuration;
@@ -39,7 +39,8 @@ using framework::Application;
 namespace ui {
 
 ImportDialog::ImportDialog()
-	: m_date_tz_combo(NULL),
+    : framework::Frame(GLADEDIR"importdialog.ui", "importDialog"),
+    m_date_tz_combo(NULL),
 	  m_ufraw_import_check(NULL),
 	  m_rawstudio_import_check(NULL),
 	  m_directory_name(NULL),
@@ -50,21 +51,18 @@ ImportDialog::ImportDialog()
 
 Gtk::Widget * ImportDialog::buildWidget()
 {
-    Glib::RefPtr<Gtk::Builder> builder = Gtk::Builder::create_from_file(GLADEDIR"importdialog.ui");
-    Gtk::Dialog *dlg = NULL;
-    builder->get_widget("importDialog", dlg);
-
+    Glib::RefPtr<Gtk::Builder> _builder = builder();
     Gtk::Button *select_directories = NULL;
-    builder->get_widget("select_directories", select_directories);
+    _builder->get_widget("select_directories", select_directories);
     select_directories->signal_clicked().connect(
         sigc::mem_fun(*this, &ImportDialog::do_select_directories));
-    builder->get_widget("date_tz_combo", m_date_tz_combo);
-    builder->get_widget("ufraw_import_check", m_ufraw_import_check);
-    builder->get_widget("rawstudio_import_check", m_rawstudio_import_check);
-    builder->get_widget("directory_name", m_directory_name);
-    builder->get_widget("folderList", m_folderList);
+    _builder->get_widget("date_tz_combo", m_date_tz_combo);
+    _builder->get_widget("ufraw_import_check", m_ufraw_import_check);
+    _builder->get_widget("rawstudio_import_check", m_rawstudio_import_check);
+    _builder->get_widget("directory_name", m_directory_name);
+    _builder->get_widget("folderList", m_folderList);
     m_folderListModel.inject(*m_folderList);
-    return dlg;
+    return &gtkWindow();
 }
 
 
diff --git a/src/niepce/ui/importdialog.hpp b/src/niepce/ui/importdialog.hpp
index f4dfe18..59c6523 100644
--- a/src/niepce/ui/importdialog.hpp
+++ b/src/niepce/ui/importdialog.hpp
@@ -29,7 +29,7 @@
 #include <glibmm/refptr.h>
 
 #include "fwk/toolkit/gtkutils.hpp"
-#include "fwk/toolkit/frame.h"
+#include "fwk/toolkit/frame.hpp"
 
 namespace Gtk {
 	class Dialog;
diff --git a/src/niepce/ui/librarymainviewcontroller.cpp b/src/niepce/ui/librarymainviewcontroller.cpp
index 7b5277a..dd2f3e3 100644
--- a/src/niepce/ui/librarymainviewcontroller.cpp
+++ b/src/niepce/ui/librarymainviewcontroller.cpp
@@ -29,10 +29,10 @@
 #include "fwk/utils/debug.h"
 #include "niepce/notifications.h"
 #include "engine/db/library.h"
-#include "fwk/toolkit/application.h"
+#include "fwk/toolkit/application.hpp"
 #include "fwk/toolkit/widgets/dock.h"
 #include "librarymainviewcontroller.h"
-#include "niepcewindow.h"
+#include "niepcewindow.hpp"
 #include "metadatapanecontroller.h"
 #include "librarycellrenderer.h"
 
diff --git a/src/niepce/ui/niepceapplication.cpp b/src/niepce/ui/niepceapplication.cpp
index 62a2032..1488e94 100644
--- a/src/niepce/ui/niepceapplication.cpp
+++ b/src/niepce/ui/niepceapplication.cpp
@@ -23,8 +23,8 @@
 #include <gtkmm/aboutdialog.h>
 
 #include "niepce/stock.h"
-#include "niepceapplication.h"
-#include "niepcewindow.h"
+#include "niepceapplication.hpp"
+#include "niepcewindow.hpp"
 
 using framework::Frame;
 using framework::Application;
diff --git a/src/niepce/ui/niepceapplication.h b/src/niepce/ui/niepceapplication.h
deleted file mode 100644
index 2eacd0e..0000000
--- a/src/niepce/ui/niepceapplication.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef _UI_NIEPCEAPPLICATION_H_
-#define _UI_NIEPCEAPPLICATION_H_
-
-/*
- * niepce - ui/niepceapplication.h
- *
- * Copyright (C) 2007-2008 Hubert Figuiere
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-
-#include "fwk/toolkit/application.h"
-
-namespace ui {
-
-	class NiepceApplication
-		: public framework::Application
-	{
-	public:
-		static framework::Application::Ptr create();
-
-		virtual framework::Frame::Ptr makeMainFrame();
-	protected:
-		NiepceApplication();
-		virtual void on_about();
-	};
-
-}
-
-/*
-  Local Variables:
-  mode:c++
-  c-file-style:"stroustrup"
-  c-file-offsets:((innamespace . 0))
-  indent-tabs-mode:nil
-  fill-column:99
-  End:
-*/
-
-#endif
diff --git a/src/niepce/ui/niepceapplication.hpp b/src/niepce/ui/niepceapplication.hpp
new file mode 100644
index 0000000..bcd6199
--- /dev/null
+++ b/src/niepce/ui/niepceapplication.hpp
@@ -0,0 +1,52 @@
+#ifndef _UI_NIEPCEAPPLICATION_H_
+#define _UI_NIEPCEAPPLICATION_H_
+
+/*
+ * niepce - ui/niepceapplication.h
+ *
+ * Copyright (C) 2007-2008 Hubert Figuiere
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include "fwk/toolkit/application.hpp"
+
+namespace ui {
+
+	class NiepceApplication
+		: public framework::Application
+	{
+	public:
+		static framework::Application::Ptr create();
+
+		virtual framework::Frame::Ptr makeMainFrame();
+	protected:
+		NiepceApplication();
+		virtual void on_about();
+	};
+
+}
+
+/*
+  Local Variables:
+  mode:c++
+  c-file-style:"stroustrup"
+  c-file-offsets:((innamespace . 0))
+  indent-tabs-mode:nil
+  fill-column:99
+  End:
+*/
+
+#endif
diff --git a/src/niepce/ui/niepcewindow.cpp b/src/niepce/ui/niepcewindow.cpp
index c669a0f..2da5d3b 100644
--- a/src/niepce/ui/niepcewindow.cpp
+++ b/src/niepce/ui/niepcewindow.cpp
@@ -37,14 +37,14 @@
 #include "fwk/utils/boost.h"
 #include "engine/db/library.h"
 #include "libraryclient/libraryclient.h"
-#include "fwk/toolkit/application.h"
+#include "fwk/toolkit/application.hpp"
 #include "fwk/toolkit/configuration.h"
 #include "fwk/toolkit/notificationcenter.h"
 #include "fwk/toolkit/configdatabinder.h"
 #include "fwk/toolkit/undo.h"
 
 #include "eog-thumb-view.h"
-#include "niepcewindow.h"
+#include "niepcewindow.hpp"
 #include "librarymainviewcontroller.h"
 #include "importdialog.hpp"
 #include "selectioncontroller.h"
@@ -477,7 +477,8 @@ void NiepceWindow::on_open_library()
 }
 
 
-void NiepceWindow::preference_dialog_setup(const Glib::RefPtr<Gnome::Glade::Xml> & xml, Gtk::Dialog * dialog)
+void NiepceWindow::preference_dialog_setup(const Glib::RefPtr<Gtk::Builder> & xml, 
+                                           Gtk::Dialog * dialog)
 {
     Gtk::ComboBox * theme_combo = NULL;
     Gtk::CheckButton * reopen_checkbutton = NULL;
@@ -486,7 +487,7 @@ void NiepceWindow::preference_dialog_setup(const Glib::RefPtr<Gnome::Glade::Xml>
     dialog->signal_hide().connect(boost::bind(&utils::DataBinderPool::destroy, 
                                               binder_pool));
 		
-    theme_combo = xml->get_widget("theme_combo", theme_combo);
+    xml->get_widget("theme_combo", theme_combo);
  
 // Why are ComboBox so complicated to use?
 //    class Columns : 
@@ -515,7 +516,7 @@ void NiepceWindow::preference_dialog_setup(const Glib::RefPtr<Gnome::Glade::Xml>
                     framework::Application::app(),
                     theme_combo->property_active()));
 
-    reopen_checkbutton = xml->get_widget("reopen_checkbutton", reopen_checkbutton);
+    xml->get_widget("reopen_checkbutton", reopen_checkbutton);
     binder_pool->add_binder(new framework::ConfigDataBinder<bool>(
                                 reopen_checkbutton->property_active(),
                                 framework::Application::app()->config(),
@@ -526,7 +527,7 @@ void NiepceWindow::preference_dialog_setup(const Glib::RefPtr<Gnome::Glade::Xml>
 void NiepceWindow::on_preferences()
 {
     DBG_OUT("on_preferences");
-    show_modal_dialog(GLADEDIR"preferences.glade", "preferences",
+    show_modal_dialog(GLADEDIR"preferences.ui", "preferences",
                       boost::bind(&NiepceWindow::preference_dialog_setup,
                                   this, _1, _2));
     DBG_OUT("end on_preferences");
diff --git a/src/niepce/ui/niepcewindow.h b/src/niepce/ui/niepcewindow.h
deleted file mode 100644
index e39f2f1..0000000
--- a/src/niepce/ui/niepcewindow.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * niepce - ui/niepcewindow.h
- *
- * Copyright (C) 2007-2008 Hubert Figuiere
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-
-#ifndef _UI_NIEPCEWINDOW_H_
-#define _UI_NIEPCEWINDOW_H_
-
-#include <boost/scoped_ptr.hpp>
-#include <boost/signals.hpp>
-
-#include <gtkmm/treemodel.h>
-#include <gtkmm/box.h>
-#include <gtkmm/menubar.h>
-#include <gtkmm/statusbar.h>
-#include <gtkmm/paned.h>
-
-#include "fwk/toolkit/frame.h"
-#include "fwk/toolkit/notificationcenter.h"
-#include "fwk/toolkit/configdatabinder.h"
-#include "libraryclient/libraryclient.h"
-#include "ui/librarymainviewcontroller.h"
-#include "ui/workspacecontroller.h"
-#include "ui/selectioncontroller.h"
-#include "ui/filmstripcontroller.h"
-
-namespace framework {
-	class NotificatioCenter;
-}
-
-namespace ui {
-
-class NiepceWindow
-    : public framework::Frame
-{
-public:
-    NiepceWindow();
-    virtual ~NiepceWindow();
-
-
-    virtual void set_title(const std::string & title);
-
-    libraryclient::LibraryClient::Ptr getLibraryClient()
-        { return m_libClient; }
-protected:
-    virtual Gtk::Widget * buildWidget();
-
-private:
-    void undo_state(const Glib::RefPtr<Gtk::Action> & action);
-    void redo_state(const Glib::RefPtr<Gtk::Action> & action);
-
-    void on_action_file_import();
-
-    void on_action_file_quit();
-    void on_action_file_open();
-    void on_open_library();
-
-    void preference_dialog_setup(const Glib::RefPtr<Gnome::Glade::Xml> &,
-                                 Gtk::Dialog *);
-    void on_preferences();
-
-    void init_ui();
-    void init_actions();
-
-    void open_library(const std::string & libMoniker);
-		
-    framework::NotificationCenter::Ptr  m_lib_notifcenter;
-
-    Gtk::VBox                      m_vbox;
-    Gtk::HPaned                    m_hbox;
-    LibraryMainViewController::Ptr m_mainviewctrl; // the main views stacked.
-    WorkspaceController::Ptr       m_workspacectrl;
-    FilmStripController::Ptr       m_filmstrip;
-    ui::SelectionController::Ptr   m_selection_controller;
-    Gtk::Statusbar                 m_statusBar;
-    Glib::RefPtr<Gtk::ActionGroup> m_refActionGroup;
-    libraryclient::LibraryClient::Ptr m_libClient;
-    // connections
-    boost::signals::scoped_connection m_undostate_conn;
-    boost::signals::scoped_connection m_redostate_conn;
-};
-
-}
-
-
-#endif
-
-/*
-  Local Variables:
-  mode:c++
-  c-file-style:"stroustrup"
-  c-file-offsets:((innamespace . 0))
-  indent-tabs-mode:nil
-  fill-column:99
-  End:
-*/
diff --git a/src/niepce/ui/niepcewindow.hpp b/src/niepce/ui/niepcewindow.hpp
new file mode 100644
index 0000000..bc77388
--- /dev/null
+++ b/src/niepce/ui/niepcewindow.hpp
@@ -0,0 +1,111 @@
+/*
+ * niepce - ui/niepcewindow.h
+ *
+ * Copyright (C) 2007-2008 Hubert Figuiere
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _UI_NIEPCEWINDOW_H_
+#define _UI_NIEPCEWINDOW_H_
+
+#include <boost/scoped_ptr.hpp>
+#include <boost/signals.hpp>
+
+#include <gtkmm/treemodel.h>
+#include <gtkmm/box.h>
+#include <gtkmm/menubar.h>
+#include <gtkmm/statusbar.h>
+#include <gtkmm/paned.h>
+
+#include "fwk/toolkit/frame.hpp"
+#include "fwk/toolkit/notificationcenter.h"
+#include "fwk/toolkit/configdatabinder.h"
+#include "libraryclient/libraryclient.h"
+#include "ui/librarymainviewcontroller.h"
+#include "ui/workspacecontroller.h"
+#include "ui/selectioncontroller.h"
+#include "ui/filmstripcontroller.h"
+
+namespace framework {
+	class NotificatioCenter;
+}
+
+namespace ui {
+
+class NiepceWindow
+    : public framework::Frame
+{
+public:
+    NiepceWindow();
+    virtual ~NiepceWindow();
+
+
+    virtual void set_title(const std::string & title);
+
+    libraryclient::LibraryClient::Ptr getLibraryClient()
+        { return m_libClient; }
+protected:
+    virtual Gtk::Widget * buildWidget();
+
+private:
+    void undo_state(const Glib::RefPtr<Gtk::Action> & action);
+    void redo_state(const Glib::RefPtr<Gtk::Action> & action);
+
+    void on_action_file_import();
+
+    void on_action_file_quit();
+    void on_action_file_open();
+    void on_open_library();
+
+    void preference_dialog_setup(const Glib::RefPtr<Gtk::Builder> &,
+                                 Gtk::Dialog *);
+    void on_preferences();
+
+    void init_ui();
+    void init_actions();
+
+    void open_library(const std::string & libMoniker);
+		
+    framework::NotificationCenter::Ptr  m_lib_notifcenter;
+
+    Gtk::VBox                      m_vbox;
+    Gtk::HPaned                    m_hbox;
+    LibraryMainViewController::Ptr m_mainviewctrl; // the main views stacked.
+    WorkspaceController::Ptr       m_workspacectrl;
+    FilmStripController::Ptr       m_filmstrip;
+    ui::SelectionController::Ptr   m_selection_controller;
+    Gtk::Statusbar                 m_statusBar;
+    Glib::RefPtr<Gtk::ActionGroup> m_refActionGroup;
+    libraryclient::LibraryClient::Ptr m_libClient;
+    // connections
+    boost::signals::scoped_connection m_undostate_conn;
+    boost::signals::scoped_connection m_redostate_conn;
+};
+
+}
+
+
+#endif
+
+/*
+  Local Variables:
+  mode:c++
+  c-file-style:"stroustrup"
+  c-file-offsets:((innamespace . 0))
+  indent-tabs-mode:nil
+  fill-column:99
+  End:
+*/
diff --git a/src/niepce/ui/preferences.ui b/src/niepce/ui/preferences.ui
new file mode 100644
index 0000000..da19af1
--- /dev/null
+++ b/src/niepce/ui/preferences.ui
@@ -0,0 +1,160 @@
+<?xml version="1.0"?>
+<!--*- mode: xml -*-->
+<interface>
+  <object class="GtkListStore" id="model1">
+    <columns>
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0">System</col>
+      </row>
+      <row>
+        <col id="0">Dark</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkDialog" id="preferences">
+    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+    <property name="border_width">5</property>
+    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox1">
+        <property name="visible">True</property>
+        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+        <property name="spacing">2</property>
+        <child>
+          <object class="GtkNotebook" id="notebook1">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <child>
+              <object class="GtkTable" id="table2">
+                <property name="visible">True</property>
+                <property name="border_width">12</property>
+                <property name="n_rows">2</property>
+                <property name="n_columns">2</property>
+                <property name="column_spacing">12</property>
+                <property name="row_spacing">12</property>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="reopen_checkbutton">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="label" translatable="yes">_Reopen Library</property>
+                    <property name="use_underline">True</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="right_attach">2</property>
+                    <property name="y_options"/>
+                  </packing>
+                </child>
+              </object>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">_General</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkTable" id="table1">
+                <property name="visible">True</property>
+                <property name="border_width">12</property>
+                <property name="n_rows">1</property>
+                <property name="n_columns">2</property>
+                <property name="column_spacing">12</property>
+                <property name="row_spacing">12</property>
+                <child>
+                  <object class="GtkComboBox" id="theme_combo">
+                    <property name="visible">True</property>
+                    <property name="model">model1</property>
+                    <child>
+                      <object class="GtkCellRendererText" id="renderer1"/>
+                      <attributes>
+                        <attribute name="text">0</attribute>
+                      </attributes>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="y_options">GTK_FILL</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label3">
+                    <property name="visible">True</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">_Theme:	</property>
+                    <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">theme_combo</property>
+                  </object>
+                  <packing>
+                    <property name="x_options">GTK_FILL</property>
+                    <property name="y_options"/>
+                  </packing>
+                </child>
+              </object>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="label2">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">_User Interface</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="position">1</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area1">
+            <property name="visible">True</property>
+            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <object class="GtkButton" id="button1">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="label">gtk-close</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">reopen_checkbutton</action-widget>
+      <action-widget response="0">button1</action-widget>
+    </action-widgets>
+  </object>
+</interface>
diff --git a/src/niepce/ui/selectioncontroller.cpp b/src/niepce/ui/selectioncontroller.cpp
index 9f76ce2..056a9a9 100644
--- a/src/niepce/ui/selectioncontroller.cpp
+++ b/src/niepce/ui/selectioncontroller.cpp
@@ -26,10 +26,10 @@
 #include "fwk/utils/debug.h"
 #include "fwk/toolkit/undo.h"
 #include "fwk/toolkit/command.h"
-#include "fwk/toolkit/application.h"
+#include "fwk/toolkit/application.hpp"
 #include "engine/db/metadata.h"
 #include "libraryclient/libraryclient.h"
-#include "niepcewindow.h"
+#include "niepcewindow.hpp"
 #include "selectioncontroller.h"
 
 namespace ui {
diff --git a/src/niepce/ui/thumb-view/Makefile.am b/src/niepce/ui/thumb-view/Makefile.am
index 35dbd71..3b52a09 100644
--- a/src/niepce/ui/thumb-view/Makefile.am
+++ b/src/niepce/ui/thumb-view/Makefile.am
@@ -6,7 +6,7 @@ noinst_LTLIBRARIES = libthumbview.la
 
 noinst_HEADERS = eog-thumb-nav.h eog-thumb-view.h 
 
-libthumbview_la_CPPFLAGS =  @LIBGTKMM_CFLAGS@ @LIBGLADEMM_CFLAGS@ \
+libthumbview_la_CPPFLAGS =  @LIBGTKMM_CFLAGS@ \
 	@GNOMEVFS_CFLAGS@
 
 libthumbview_la_SOURCES = eog-thumb-nav.cpp eog-thumb-view.cpp
diff --git a/src/niepce/ui/workspacecontroller.cpp b/src/niepce/ui/workspacecontroller.cpp
index a8d9624..82a956c 100644
--- a/src/niepce/ui/workspacecontroller.cpp
+++ b/src/niepce/ui/workspacecontroller.cpp
@@ -29,8 +29,8 @@
 #include "niepce/notifications.h"
 #include "engine/db/library.h" // FIXME uh oh. this shouldn't be
 #include "libraryclient/libraryclient.h"
-#include "fwk/toolkit/application.h"
-#include "niepcewindow.h"
+#include "fwk/toolkit/application.hpp"
+#include "niepcewindow.hpp"
 #include "workspacecontroller.h"
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]