[niepce/gtk3: 1/6] First shot at building for Gtkmm 3.0 Remove gconf and replace by GKeyFile
- From: Hubert FiguiÃre <hub src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [niepce/gtk3: 1/6] First shot at building for Gtkmm 3.0 Remove gconf and replace by GKeyFile
- Date: Wed, 7 Dec 2011 06:38:40 +0000 (UTC)
commit 7e255017c638dc173d7daf32131f089984a4d625
Author: Hub Figuiere <hub figuiere net>
Date: Fri Nov 11 22:24:42 2011 -0800
First shot at building for Gtkmm 3.0
Remove gconf and replace by GKeyFile
camerawire/configure.ac | 7 +-
camerawire/src/Makefile.am | 4 +-
configure.ac | 12 +-
src/ext/libview/header.cc | 6 +-
src/ext/libview/header.hh | 2 +-
src/fwk/toolkit/Makefile.am | 2 +-
src/fwk/toolkit/application.cpp | 15 +--
src/fwk/toolkit/configuration.cpp | 78 +++++-------
src/fwk/toolkit/configuration.hpp | 27 ++--
src/fwk/toolkit/dialog.cpp | 2 +-
src/fwk/toolkit/frame.cpp | 4 +-
src/fwk/toolkit/gdkutils.cpp | 2 +
src/fwk/toolkit/widgets/editablehscale.cpp | 12 +-
src/fwk/toolkit/widgets/editablehscale.hpp | 6 +-
src/fwk/toolkit/widgets/ratinglabel.cpp | 28 ++--
src/fwk/toolkit/widgets/ratinglabel.hpp | 7 +-
src/niepce/Makefile.am | 4 +-
src/niepce/modules/darkroom/Makefile.am | 1 -
src/niepce/modules/darkroom/imagecanvas.cpp | 5 +-
src/niepce/stock.cpp | 4 +-
src/niepce/ui/Makefile.am | 1 -
src/niepce/ui/dialogs/editlabels.ui | 92 +++++++++------
src/niepce/ui/dialogs/importdialog.ui | 171 +++++++++++++++++----------
src/niepce/ui/dialogs/preferences.ui | 80 +++++++------
src/niepce/ui/filmstripcontroller.cpp | 2 +-
src/niepce/ui/gridviewmodule.cpp | 40 +++++--
src/niepce/ui/gridviewmodule.hpp | 1 +
src/niepce/ui/librarycellrenderer.cpp | 68 ++++-------
src/niepce/ui/librarycellrenderer.hpp | 19 +--
src/niepce/ui/moduleshell.cpp | 4 +-
src/niepce/ui/thumb-view/eog-thumb-nav.cpp | 16 ++--
src/niepce/ui/thumbstripview.cpp | 20 ++--
32 files changed, 395 insertions(+), 347 deletions(-)
---
diff --git a/camerawire/configure.ac b/camerawire/configure.ac
index 649ea6a..4037985 100644
--- a/camerawire/configure.ac
+++ b/camerawire/configure.ac
@@ -22,8 +22,7 @@ dnl all the library version.
dnl if one is harcoded elsewhere, it is a bug
LIBGIOMM_VERSION=2.16
LIBGLIBMM_VERSION=2.4
-LIBGTKMM_VERSION=2.12.0
-LIBGCONF_VERSION=2.0.0
+LIBGTKMM_VERSION=3.0
LIBGNOMEUI_VERSION=2.0.0
EXEMPI_VERSION=2.0.0
GEGL_VERSION=0.0.22
@@ -66,9 +65,7 @@ AC_LANG_CPLUSPLUS
AC_LANG_COMPILER_REQUIRE
PKG_CHECK_MODULES(LIBGLIBMM, [glibmm-2.4 >= $LIBGLIBMM_VERSION giomm-2.4 >= $LIBGIOMM_VERSION gthread-2.0])
-PKG_CHECK_MODULES(LIBGTKMM, [gtkmm-2.4 >= $LIBGTKMM_VERSION])
-dnl PKG_CHECK_MODULES(LIBGCONFMM, [gconfmm-2.6 >= $LIBGCONFMM_VERSION])
-PKG_CHECK_MODULES(GCONF, [gconf-2.0 >= $LIBGCONF_VERSION])
+PKG_CHECK_MODULES(LIBGTKMM, [gtkmm-3.0 >= $LIBGTKMM_VERSION])
PKG_CHECK_MODULES(EXEMPI, [exempi-2.0 >= $EXEMPI_VERSION])
PKG_CHECK_MODULES(LIBXML2, [libxml-2.0 >= $LIBXML2_VERSION])
PKG_CHECK_MODULES(BABL, babl)
diff --git a/camerawire/src/Makefile.am b/camerawire/src/Makefile.am
index f7d8438..ea52b28 100644
--- a/camerawire/src/Makefile.am
+++ b/camerawire/src/Makefile.am
@@ -7,7 +7,7 @@ bin_PROGRAMS = camerawire
INCLUDES = -DDATADIR=\"$(datadir)\" \
-I$(top_srcdir)/../src/ -I$(top_srcdir)/src \
- @LIBGLIBMM_CFLAGS@ @LIBGTKMM_CFLAGS@ @GCONF_CFLAGS@ \
+ @LIBGLIBMM_CFLAGS@ @LIBGTKMM_CFLAGS@ \
@GPHOTO_CFLAGS@
@@ -17,7 +17,7 @@ camerawire_SOURCES = \
main.cpp
camerawire_LDADD = @LIBGLIBMM_LIBS@ @LIBGTKMM_LIBS@ \
- @GCONF_LIBS@ @GPHOTO_LIBS@ \
+ @GPHOTO_LIBS@ \
$(top_builddir)/../src/fwk/toolkit/libniepceframework.a \
$(top_builddir)/../src/fwk/utils/libniepceutils.a \
$(top_builddir)/../src/fwk/base/libfwkbase.a \
diff --git a/configure.ac b/configure.ac
index c7dc0bb..b6f26ce 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,8 +21,7 @@ dnl all the library version.
dnl if one is harcoded elsewhere, it is a bug
LIBGIOMM_VERSION=2.16
LIBGLIBMM_VERSION=2.4
-LIBGTKMM_VERSION=2.12.0
-LIBGCONF_VERSION=2.0.0
+LIBGTKMM_VERSION=3.0
LIBGNOMEUI_VERSION=2.0.0
EXEMPI_VERSION=2.0.0
SQLITE_VERSION=3.0
@@ -66,9 +65,7 @@ AC_LANG_CPLUSPLUS
AC_LANG_COMPILER_REQUIRE
PKG_CHECK_MODULES(LIBGLIBMM, [glibmm-2.4 >= $LIBGLIBMM_VERSION giomm-2.4 >= $LIBGIOMM_VERSION gthread-2.0])
-PKG_CHECK_MODULES(LIBGTKMM, [gtkmm-2.4 >= $LIBGTKMM_VERSION])
-dnl PKG_CHECK_MODULES(LIBGCONFMM, [gconfmm-2.6 >= $LIBGCONFMM_VERSION])
-PKG_CHECK_MODULES(GCONF, [gconf-2.0 >= $LIBGCONF_VERSION])
+PKG_CHECK_MODULES(LIBGTKMM, [gtkmm-3.0 >= $LIBGTKMM_VERSION])
PKG_CHECK_MODULES(SQLITE3, [sqlite3 >= $SQLITE_VERSION])
PKG_CHECK_MODULES(EXEMPI, [exempi-2.0 >= $EXEMPI_VERSION])
PKG_CHECK_MODULES(LIBXML2, [libxml-2.0 >= $LIBXML2_VERSION])
@@ -97,11 +94,12 @@ BOOST_SMART_PTR
BOOST_TEST([s])
AC_LANG_PUSH(C++)
+dnl -Wmissing-noreturn -Wshadow
if test "$GCC" = "yes"; then
NIEPCE_BUILD_CONFIG="$NIEPCE_BUILD_CONFIG gcc-options="
for option in -Wall -Wextra -Wsign-compare -Wpointer-arith \
- -Wchar-subscripts -Wwrite-strings -Wmissing-noreturn \
- -Wunused -Wpointer-arith -Wshadow -fshow-column ; do
+ -Wchar-subscripts -Wwrite-strings \
+ -Wunused -Wpointer-arith -fshow-column ; do
SAVE_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $option"
NIEPCE_BUILD_CONFIG="$NIEPCE_BUILD_CONFIG$option "
diff --git a/src/ext/libview/header.cc b/src/ext/libview/header.cc
index 5098a0a..e83bb7f 100644
--- a/src/ext/libview/header.cc
+++ b/src/ext/libview/header.cc
@@ -155,11 +155,13 @@ Header::SetAlignment(Alignment align) // IN: The new alignment
*/
void
-Header::on_style_changed(const Glib::RefPtr<Gtk::Style> &oldStyle) // IN
+Header::on_style_updated() // IN
{
- Gtk::MenuItem::on_style_changed(oldStyle);
+ Gtk::MenuItem::on_style_updated();
+#if GTKMM2
mLabel.set_style(get_style());
+#endif
}
diff --git a/src/ext/libview/header.hh b/src/ext/libview/header.hh
index df04c1e..5f46815 100644
--- a/src/ext/libview/header.hh
+++ b/src/ext/libview/header.hh
@@ -50,7 +50,7 @@ public:
void SetAlignment(Alignment align);
protected:
- void on_style_changed(const Glib::RefPtr<Gtk::Style> &oldStyle);
+ void on_style_updated();
private:
Gtk::Label mLabel;
diff --git a/src/fwk/toolkit/Makefile.am b/src/fwk/toolkit/Makefile.am
index e31bfe2..807f4bf 100644
--- a/src/fwk/toolkit/Makefile.am
+++ b/src/fwk/toolkit/Makefile.am
@@ -6,7 +6,7 @@ INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/ext \
-DDATADIR=\"$(datadir)\" \
@LIBGLIBMM_CFLAGS@ \
@LIBGTKMM_CFLAGS@ \
- @GCONF_CFLAGS@ @EXEMPI_CFLAGS@ \
+ @EXEMPI_CFLAGS@ \
$(NULL)
noinst_LIBRARIES = libniepceframework.a
diff --git a/src/fwk/toolkit/application.cpp b/src/fwk/toolkit/application.cpp
index c7a8334..f4c4f0d 100644
--- a/src/fwk/toolkit/application.cpp
+++ b/src/fwk/toolkit/application.cpp
@@ -1,3 +1,4 @@
+
/*
* niepce - framework/application.cpp
*
@@ -24,8 +25,6 @@
#include <glibmm/i18n.h>
#include <gtkmm/main.h>
#include <gtkmm/aboutdialog.h>
-#include <gtkmm/rc.h>
-#include <gconf/gconf.h>
#include "fwk/base/debug.hpp"
#include "fwk/utils/boost.hpp"
@@ -40,7 +39,7 @@ namespace fwk {
Application::Ptr Application::m_application;
Application::Application(const char * name)
- : m_config(Glib::ustring("/apps/") + name)
+ : m_config(name)
, m_refUIManager(Gtk::UIManager::create())
, m_module_manager(new ModuleManager())
{
@@ -108,12 +107,10 @@ void Application::register_theme(const Glib::ustring & label,
int Application::main(boost::function<Application::Ptr (void)> constructor,
int argc, char **argv)
{
- // TODO fix error check
- gconf_init(argc, argv, NULL);
-
Gtk::Main kit(argc, argv);
Application::Ptr app = constructor();
+#if GTKMM2
DBG_OUT("use_custon_theme %d", app->get_use_custom_theme());
if(app->get_use_custom_theme() != -1) {
std::string rcpath = app->get_rc_path();
@@ -121,12 +118,12 @@ int Application::main(boost::function<Application::Ptr (void)> constructor,
Gtk::RC rc(rcpath);
}
}
+#endif
- kit.signal_run().connect(sigc::mem_fun(*app,
- &Application::_ready));
Frame::Ptr window(app->makeMainFrame());
app->add(window);
-
+ // signal_run() is gone in Gtkmm3. Call directly. Should work.
+ app->_ready();
Gtk::Main::run(window->gtkWindow());
return 0;
diff --git a/src/fwk/toolkit/configuration.cpp b/src/fwk/toolkit/configuration.cpp
index c9e86f1..8620587 100644
--- a/src/fwk/toolkit/configuration.cpp
+++ b/src/fwk/toolkit/configuration.cpp
@@ -20,18 +20,35 @@
#include <memory>
-#include <gconf/gconf-client.h>
+#include <glibmm/miscutils.h>
+#include <glibmm/fileutils.h>
#include "fwk/base/debug.hpp"
+#include "fwk/utils/pathutils.hpp"
#include "configuration.hpp"
+//
+// NOTE: this does not use GSettings because GSettings is broken by design.
+// like abort() on many simple things that it does not like
+// missing keys, missing schema.
+// This is non negotiable
+//
namespace fwk {
-Configuration::Configuration(const Glib::ustring & root)
- : m_gconf(gconf_client_get_default()),
- m_root(root)
+Configuration::Configuration(const Glib::ustring & file)
+ : m_root("main")
{
+ m_filename = Glib::build_filename(Glib::get_user_config_dir(),
+ file);
+ m_filename = Glib::build_filename(m_filename, "config");
+ fwk::ensure_path_for_file(m_filename);
+ try {
+ m_keyfile.load_from_file(m_filename);
+ }
+ catch(...) {
+ DBG_OUT("conf file %s not found - will be created", m_filename.c_str());
+ }
}
@@ -39,63 +56,34 @@ Configuration::~Configuration()
{
}
+void Configuration::save()
+{
+ Glib::file_set_contents(m_filename, m_keyfile.to_data());
+}
bool Configuration::hasKey(const Glib::ustring & key) const
{
- //
- bool found = true;
-
- GConfValue * v = gconf_client_get(m_gconf,
- Glib::ustring(m_root + "/" + key).c_str(),
- NULL);
- found = (v != NULL);
- if(v) {
- gconf_value_free(v);
- }
- else {
- DBG_OUT("key %s not found", key.c_str());
- }
-
- return found;
+ //
+ return m_keyfile.has_group(m_root) && m_keyfile.has_key(m_root, key);
}
const Glib::ustring Configuration::getValue(const Glib::ustring & key,
const Glib::ustring & def) const
{
- Glib::ustring value;
- GError *err = NULL;
- gchar* v = gconf_client_get_string(m_gconf,
- Glib::ustring(m_root + "/" + key).c_str(),
- &err);
-
- if(!v) {
- value = def;
- if(err) {
- DBG_OUT("Exception raised: %s", err->message);
- g_error_free(err);
- }
- }
- else {
- value = v;
- g_free(v);
+ bool has_key = hasKey(key);
+ if(!has_key) {
+ return def;
}
- return value;
+ return m_keyfile.get_string(m_root, key);
}
void Configuration::setValue(const Glib::ustring & key,
const Glib::ustring & value)
{
- GError *err = NULL;
- gboolean ret = gconf_client_set_string(m_gconf,
- Glib::ustring(m_root + "/" + key).c_str(),
- value.c_str(), &err);
-
- if(ret && err) {
- DBG_OUT("Exception raised: %s", err->message);
- g_error_free(err);
- }
+ m_keyfile.set_string(m_root, key, value);
+ save();
}
}
diff --git a/src/fwk/toolkit/configuration.hpp b/src/fwk/toolkit/configuration.hpp
index d76f7b3..e6f0328 100644
--- a/src/fwk/toolkit/configuration.hpp
+++ b/src/fwk/toolkit/configuration.hpp
@@ -21,28 +21,29 @@
#ifndef _FRAMEWORK_CONFIGURATION_H_
#define _FRAMEWORK_CONFIGURATION_H_
-#include <gconf/gconf-client.h>
-
#include <glibmm/ustring.h>
-#include <glibmm/refptr.h>
-
+#include <glibmm/keyfile.h>
namespace fwk {
class Configuration
{
public:
- Configuration(const Glib::ustring & root);
- ~Configuration();
-
- bool hasKey(const Glib::ustring & key) const;
- const Glib::ustring getValue(const Glib::ustring & key,
+ Configuration(const Glib::ustring & file);
+ ~Configuration();
+
+ bool hasKey(const Glib::ustring & key) const;
+ const Glib::ustring getValue(const Glib::ustring & key,
const Glib::ustring & def) const;
-
- void setValue(const Glib::ustring & key, const Glib::ustring & value);
+
+ void setValue(const Glib::ustring & key, const Glib::ustring & value);
private:
- GConfClient * m_gconf;
- Glib::ustring m_root;
+
+ void save();
+
+ Glib::ustring m_filename;
+ Glib::KeyFile m_keyfile;
+ Glib::ustring m_root;
};
}
diff --git a/src/fwk/toolkit/dialog.cpp b/src/fwk/toolkit/dialog.cpp
index b4445ad..3609414 100644
--- a/src/fwk/toolkit/dialog.cpp
+++ b/src/fwk/toolkit/dialog.cpp
@@ -30,7 +30,7 @@ namespace fwk {
void Dialog::add_header(const std::string & label)
{
- Gtk::VBox * vbox;
+ Gtk::Box * vbox;
builder()->get_widget("dialog-vbox1", vbox);
std::string markup = str(boost::format("<span size=\"x-large\">%1%</span>") % label);
diff --git a/src/fwk/toolkit/frame.cpp b/src/fwk/toolkit/frame.cpp
index 6c32cb6..516ff01 100644
--- a/src/fwk/toolkit/frame.cpp
+++ b/src/fwk/toolkit/frame.cpp
@@ -86,11 +86,11 @@ void Frame::set_icon_from_theme(const Glib::ustring & name)
RefPtr< IconTheme > icon_theme(Application::app()->getIconTheme());
vector<int> icon_sizes(icon_theme->get_icon_sizes(name));
- list< RefPtr <Gdk::Pixbuf> > icons;
+ vector< RefPtr <Gdk::Pixbuf> > icons;
for_each(icon_sizes.begin(), icon_sizes.end(),
// store the icon
- bind(&std::list< RefPtr<Gdk::Pixbuf> >::push_back,
+ bind(&std::vector< RefPtr<Gdk::Pixbuf> >::push_back,
boost::ref(icons),
// load the icon
bind( &IconTheme::load_icon,
diff --git a/src/fwk/toolkit/gdkutils.cpp b/src/fwk/toolkit/gdkutils.cpp
index e432e42..229a645 100644
--- a/src/fwk/toolkit/gdkutils.cpp
+++ b/src/fwk/toolkit/gdkutils.cpp
@@ -17,6 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <gdkmm/color.h>
+
#include "fwk/base/debug.hpp"
#include "gdkutils.hpp"
diff --git a/src/fwk/toolkit/widgets/editablehscale.cpp b/src/fwk/toolkit/widgets/editablehscale.cpp
index d63c903..1187ddf 100644
--- a/src/fwk/toolkit/widgets/editablehscale.cpp
+++ b/src/fwk/toolkit/widgets/editablehscale.cpp
@@ -29,7 +29,7 @@ namespace fwk {
EditableHScale::EditableHScale(double min, double max, double step)
: m_icon(NULL),
- m_adj(0, min, max, step),
+ m_adj(Gtk::Adjustment::create(0, min, max, step)),
m_scale(m_adj), m_entry(m_adj),
m_dirty(false)
{
@@ -40,7 +40,7 @@ EditableHScale::EditableHScale(double min, double max, double step)
EditableHScale::EditableHScale(const std::string & icon_path,
double min, double max, double step)
: m_icon(Gtk::manage(new Gtk::Image(icon_path))),
- m_adj(0, min, max, step),
+ m_adj(Gtk::Adjustment::create(0, min, max, step)),
m_scale(m_adj), m_entry(m_adj),
m_dirty(false)
{
@@ -67,7 +67,7 @@ void EditableHScale::_init()
.connect(sigc::mem_fun(*this, &EditableHScale::on_button_press_event));
pack_start(m_entry, Gtk::PACK_SHRINK);
- m_adj.signal_value_changed()
+ m_adj->signal_value_changed()
.connect(sigc::mem_fun(*this, &EditableHScale::on_adj_value_changed));
add_events(Gdk::BUTTON_RELEASE_MASK);
}
@@ -83,8 +83,8 @@ bool EditableHScale::on_button_press_event(GdkEventButton *_event)
Gtk::Widget::on_button_release_event(_event);
if(m_dirty) {
m_dirty = false;
- DBG_OUT("value_change.emit(%f)", m_adj.get_value());
- m_sig_value_changed.emit(m_adj.get_value());
+ DBG_OUT("value_change.emit(%f)", m_adj->get_value());
+ m_sig_value_changed.emit(m_adj->get_value());
}
return false;
}
@@ -94,7 +94,7 @@ bool EditableHScale::on_button_press_event(GdkEventButton *_event)
void EditableHScale::on_adj_value_changed()
{
m_dirty = true;
- m_sig_value_changing.emit(m_adj.get_value());
+ m_sig_value_changing.emit(m_adj->get_value());
}
diff --git a/src/fwk/toolkit/widgets/editablehscale.hpp b/src/fwk/toolkit/widgets/editablehscale.hpp
index ae06a8c..664854e 100644
--- a/src/fwk/toolkit/widgets/editablehscale.hpp
+++ b/src/fwk/toolkit/widgets/editablehscale.hpp
@@ -38,9 +38,7 @@ public:
EditableHScale(const std::string & icon_name,
double min, double max, double step);
- Gtk::Adjustment & get_adjustment()
- { return m_adj; }
- const Gtk::Adjustment & get_adjustment() const
+ const Glib::RefPtr<Gtk::Adjustment> & get_adjustment() const
{ return m_adj; }
sigc::signal<void,double> & signal_value_changed();
@@ -55,7 +53,7 @@ private:
void _init();
Gtk::Image *m_icon;
- Gtk::Adjustment m_adj;
+ Glib::RefPtr<Gtk::Adjustment> m_adj;
Gtk::HScale m_scale;
Gtk::SpinButton m_entry;
bool m_dirty;
diff --git a/src/fwk/toolkit/widgets/ratinglabel.cpp b/src/fwk/toolkit/widgets/ratinglabel.cpp
index 252277c..8d73a39 100644
--- a/src/fwk/toolkit/widgets/ratinglabel.cpp
+++ b/src/fwk/toolkit/widgets/ratinglabel.cpp
@@ -149,25 +149,25 @@ bool RatingLabel::on_button_press_event (GdkEventButton* e)
}
-void RatingLabel::on_size_request(Gtk::Requisition* requisition)
+void RatingLabel::get_preferred_width_vfunc (int& minimum_width, int& natural_width) const
{
- *requisition = Gtk::Requisition();
const Cairo::RefPtr<Cairo::ImageSurface> & star = get_star();
- requisition->width = star->get_width() * 5;
- requisition->height = star->get_height();
- // DBG_OUT("size request is %d %d", requisition->width, requisition->height);
+ minimum_width = natural_width = star->get_width() * 5;
}
-bool RatingLabel::on_expose_event(GdkEventExpose * /*evt*/)
+void RatingLabel::get_preferred_height_vfunc (int& minimum_height, int& natural_height) const
{
- if (is_drawable()) {
- const Gtk::Allocation& allocation = get_allocation();
- double x, y;
- x = 0;
- y = allocation.get_height();
- Cairo::RefPtr< Cairo::Context > cr = get_window()->create_cairo_context();
- draw_rating(cr , m_rating, get_star(), get_unstar(), x, y);
- }
+ const Cairo::RefPtr<Cairo::ImageSurface> & star = get_star();
+ minimum_height = natural_height = star->get_height();
+}
+
+bool RatingLabel::on_draw(const Cairo::RefPtr< Cairo::Context > &cr)
+{
+ const Cairo::RefPtr<Cairo::ImageSurface> & star = get_star();
+ double x, y;
+ x = 0;
+ y = star->get_height();
+ draw_rating(cr , m_rating, star, get_unstar(), x, y);
return true;
}
diff --git a/src/fwk/toolkit/widgets/ratinglabel.hpp b/src/fwk/toolkit/widgets/ratinglabel.hpp
index 51f8445..93b71bb 100644
--- a/src/fwk/toolkit/widgets/ratinglabel.hpp
+++ b/src/fwk/toolkit/widgets/ratinglabel.hpp
@@ -55,10 +55,11 @@ public:
protected:
virtual void on_realize();
virtual bool on_button_press_event (GdkEventButton* event);
-
- virtual void on_size_request (Gtk::Requisition* requisition);
- virtual bool on_expose_event (GdkEventExpose *event);
+ virtual bool on_draw(const Cairo::RefPtr< Cairo::Context > &cr);
virtual void on_state_changed (Gtk::StateType previous_state);
+
+ virtual void get_preferred_width_vfunc (int& minimum_width, int& natural_width) const;
+ virtual void get_preferred_height_vfunc (int& minimum_height, int& natural_height) const;
private:
int m_rating;
bool m_is_editable;
diff --git a/src/niepce/Makefile.am b/src/niepce/Makefile.am
index e35ea31..00598ce 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@ @GCONF_CFLAGS@ \
+niepce_CPPFLAGS = @LIBGTKMM_CFLAGS@ \
-DNIEPCE_LOCALEDIR=\"@NIEPCE_LOCALEDIR \"
niepce_LDFLAGS =
@@ -27,7 +27,7 @@ niepce_LDADD = \
$(top_builddir)/src/ext/libview/libview.a \
@LIBGLIBMM_LIBS@ \
@LIBGTKMM_LIBS@ @SQLITE3_LIBS@ \
- @GCONF_LIBS@ @BABL_LIBS@ \
+ @BABL_LIBS@ \
@GEGLMM_LIBS@ @OPENRAW_LIBS@ @EXEMPI_LIBS@
diff --git a/src/niepce/modules/darkroom/Makefile.am b/src/niepce/modules/darkroom/Makefile.am
index 7501228..fc850a3 100644
--- a/src/niepce/modules/darkroom/Makefile.am
+++ b/src/niepce/modules/darkroom/Makefile.am
@@ -5,7 +5,6 @@ INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/niepce -I$(top_srcdir)/src/ex
-DDATADIR=\"$(datadir)\" \
@LIBGLIBMM_CFLAGS@ \
@LIBGTKMM_CFLAGS@ \
- @GCONF_CFLAGS@ \
@GEGLMM_CFLAGS@ @EXEMPI_CFLAGS@ @OPENRAW_CFLAGS@
diff --git a/src/niepce/modules/darkroom/imagecanvas.cpp b/src/niepce/modules/darkroom/imagecanvas.cpp
index e0d644a..d62f83a 100644
--- a/src/niepce/modules/darkroom/imagecanvas.cpp
+++ b/src/niepce/modules/darkroom/imagecanvas.cpp
@@ -18,6 +18,7 @@
*/
#include <cairomm/context.h>
+#include <gdkmm.h>
#include "fwk/base/debug.hpp"
@@ -133,8 +134,8 @@ bool ImageCanvas::on_expose_event(GdkEventExpose *ev)
// paint the background
sc->rectangle(0, 0, canvas_w, canvas_h);
- Gdk::Cairo::set_source_color(sc,
- get_style()->get_bg(Gtk::STATE_NORMAL));
+ Gdk::RGBA color = get_style_context()->get_background_color(Gtk::STATE_FLAG_NORMAL);
+ Gdk::Cairo::set_source_rgba(sc, color);
sc->fill();
diff --git a/src/niepce/stock.cpp b/src/niepce/stock.cpp
index 6389434..12add45 100644
--- a/src/niepce/stock.cpp
+++ b/src/niepce/stock.cpp
@@ -44,10 +44,10 @@ void registerStockItems()
try {
Gtk::Stock::add(Gtk::StockItem(ROTATE_LEFT, _("Rotate L_eft"), Gdk::ModifierType(0), '['));
- icon_factory->add(ROTATE_LEFT, Gtk::IconSet(
+ icon_factory->add(ROTATE_LEFT, Gtk::IconSet::create(
Gdk::Pixbuf::create_from_file(DATADIR"/niepce/pixmaps/niepce-rotate-left.png")));
Gtk::Stock::add(Gtk::StockItem(ROTATE_RIGHT, _("Rotate R_ight"), Gdk::ModifierType(0), ']'));
- icon_factory->add(ROTATE_RIGHT, Gtk::IconSet(
+ icon_factory->add(ROTATE_RIGHT, Gtk::IconSet::create(
Gdk::Pixbuf::create_from_file(DATADIR"/niepce/pixmaps/niepce-rotate-right.png")));
}
catch(const Glib::Exception &e)
diff --git a/src/niepce/ui/Makefile.am b/src/niepce/ui/Makefile.am
index 0c8b50a..36eff05 100644
--- a/src/niepce/ui/Makefile.am
+++ b/src/niepce/ui/Makefile.am
@@ -16,7 +16,6 @@ INCLUDES = -I$(top_srcdir)/src/ -I$(srcdir)/.. -I$(srcdir)/thumb-view \
-DDATADIR=\"$(datadir)\" \
@LIBGLIBMM_CFLAGS@ \
@LIBGTKMM_CFLAGS@ \
- @GCONF_CFLAGS@ \
@EXEMPI_CFLAGS@
EXTRA_DIST = $(gladefiles)
diff --git a/src/niepce/ui/dialogs/editlabels.ui b/src/niepce/ui/dialogs/editlabels.ui
index 37ee135..9cf39e0 100644
--- a/src/niepce/ui/dialogs/editlabels.ui
+++ b/src/niepce/ui/dialogs/editlabels.ui
@@ -1,31 +1,65 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 2.12 -->
- <!-- interface-naming-policy toplevel-contextual -->
<object class="GtkDialog" id="editLabels">
+ <property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="type_hint">normal</property>
- <property name="has_separator">False</property>
<child internal-child="vbox">
- <object class="GtkVBox" id="dialog-vbox1">
+ <object class="GtkBox" id="dialog-vbox1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkButton" id="button1">
+ <property name="label">gtk-close</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
<child>
<placeholder/>
</child>
<child>
<object class="GtkFrame" id="frame1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
<object class="GtkTable" id="table2">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="n_rows">5</property>
<property name="n_columns">3</property>
<property name="column_spacing">8</property>
@@ -33,6 +67,7 @@
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Label _6</property>
<property name="use_underline">True</property>
@@ -46,6 +81,7 @@
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Label _7</property>
<property name="use_underline">True</property>
@@ -61,6 +97,7 @@
<child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Label _8</property>
<property name="use_underline">True</property>
@@ -76,6 +113,7 @@
<child>
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Label _9</property>
<property name="use_markup">True</property>
@@ -93,7 +131,7 @@
<object class="GtkEntry" id="value1">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="invisible_char">●</property>
+ <property name="invisible_char">â</property>
</object>
<packing>
<property name="left_attach">2</property>
@@ -104,7 +142,7 @@
<object class="GtkEntry" id="value2">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="invisible_char">●</property>
+ <property name="invisible_char">â</property>
</object>
<packing>
<property name="left_attach">2</property>
@@ -117,7 +155,7 @@
<object class="GtkEntry" id="value3">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="invisible_char">●</property>
+ <property name="invisible_char">â</property>
</object>
<packing>
<property name="left_attach">2</property>
@@ -130,7 +168,7 @@
<object class="GtkEntry" id="value4">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="invisible_char">●</property>
+ <property name="invisible_char">â</property>
</object>
<packing>
<property name="left_attach">2</property>
@@ -142,6 +180,7 @@
<child>
<object class="GtkLabel" id="label5">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Label _10</property>
<property name="use_underline">True</property>
@@ -158,7 +197,7 @@
<object class="GtkEntry" id="value5">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="invisible_char">•</property>
+ <property name="invisible_char">â</property>
</object>
<packing>
<property name="left_attach">2</property>
@@ -172,6 +211,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
<property name="color">#000000000000</property>
</object>
</child>
@@ -180,6 +220,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
<property name="color">#000000000000</property>
</object>
<packing>
@@ -192,6 +233,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
<property name="color">#000000000000</property>
</object>
<packing>
@@ -204,6 +246,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
<property name="color">#000000000000</property>
</object>
<packing>
@@ -216,6 +259,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
<property name="color">#000000000000</property>
</object>
<packing>
@@ -230,6 +274,7 @@
<child type="label">
<object class="GtkLabel" id="dialog_title">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes"><b>Labels</b></property>
<property name="use_markup">True</property>
</object>
@@ -237,38 +282,11 @@
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">2</property>
</packing>
</child>
- <child internal-child="action_area">
- <object class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <object class="GtkButton" id="button1">
- <property name="label">gtk-close</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
</object>
</child>
<action-widgets>
diff --git a/src/niepce/ui/dialogs/importdialog.ui b/src/niepce/ui/dialogs/importdialog.ui
index e6d7758..995713a 100644
--- a/src/niepce/ui/dialogs/importdialog.ui
+++ b/src/niepce/ui/dialogs/importdialog.ui
@@ -1,22 +1,8 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 2.12 -->
- <!-- interface-naming-policy toplevel-contextual -->
- <object class="GtkListStore" id="model1">
- <columns>
- <!-- column-name gchararray -->
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0">Date is local</col>
- </row>
- <row>
- <col id="0">Date is UTC</col>
- </row>
- </data>
- </object>
<object class="GtkDialog" id="importDialog">
+ <property name="can_focus">False</property>
<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="title" translatable="yes">Import</property>
@@ -24,28 +10,76 @@
<property name="default_width">600</property>
<property name="default_height">600</property>
<property name="type_hint">dialog</property>
- <property name="has_separator">False</property>
<child internal-child="vbox">
- <object class="GtkVBox" id="dialog-vbox1">
+ <object class="GtkBox" id="dialog-vbox1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</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">end</property>
+ <child>
+ <object class="GtkButton" id="button3">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button4">
+ <property name="label" translatable="yes">_Import</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
<child>
<placeholder/>
</child>
<child>
<object class="GtkVBox" id="vbox2">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="can_focus">False</property>
<property name="spacing">8</property>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">8</property>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">_Directory:</property>
<property name="use_underline">True</property>
</object>
@@ -58,10 +92,13 @@
<child>
<object class="GtkLabel" id="directory_name">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
@@ -72,21 +109,25 @@
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="use_action_appearance">False</property>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Images to import</property>
<property name="use_underline">True</property>
@@ -110,24 +151,33 @@
<property name="can_focus">True</property>
<property name="headers_visible">False</property>
<property name="headers_clickable">False</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="treeview-selection1"/>
+ </child>
</object>
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox2">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="label6">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Destination _Folder</property>
<property name="use_underline">True</property>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
@@ -138,15 +188,18 @@
<object class="GtkEntry" id="destinationFolder">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="invisible_char">•</property>
+ <property name="invisible_char">â</property>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
@@ -158,7 +211,7 @@
<child>
<object class="GtkVBox" id="vbox3">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="can_focus">False</property>
<child>
<object class="GtkCheckButton" id="ufraw_import_check">
<property name="label" translatable="yes">Import _UFRaw</property>
@@ -166,10 +219,12 @@
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
+ <property name="expand">True</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
@@ -181,10 +236,12 @@
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
+ <property name="expand">True</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
@@ -192,19 +249,21 @@
<child>
<object class="GtkFrame" id="date_frame">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label_xalign">0</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="orientation">vertical</property>
<property name="spacing">4</property>
<child>
<object class="GtkComboBox" id="date_tz_combo">
<property name="visible">True</property>
<property name="sensitive">False</property>
+ <property name="can_focus">False</property>
<property name="model">model1</property>
<property name="active">0</property>
<child>
@@ -215,18 +274,23 @@
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label5">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">You can still change this after importing the pictures.</property>
<property name="wrap">True</property>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
@@ -235,6 +299,7 @@
<child type="label">
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes"><b>Date:</b></property>
<property name="use_markup">True</property>
@@ -242,6 +307,8 @@
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="padding">4</property>
<property name="position">2</property>
</packing>
@@ -251,6 +318,7 @@
<child type="label">
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">_Options</property>
<property name="use_underline">True</property>
</object>
@@ -258,55 +326,16 @@
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
</object>
<packing>
- <property name="pack_type">end</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <object class="GtkHButtonBox" id="dialog-action_area2">
- <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">end</property>
- <child>
- <object class="GtkButton" id="button3">
- <property name="label">gtk-cancel</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button4">
- <property name="label" translatable="yes">_Import</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="pack_type">end</property>
- <property name="position">0</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
@@ -316,4 +345,18 @@
<action-widget response="0">button4</action-widget>
</action-widgets>
</object>
+ <object class="GtkListStore" id="model1">
+ <columns>
+ <!-- column-name gchararray -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0">Date is local</col>
+ </row>
+ <row>
+ <col id="0">Date is UTC</col>
+ </row>
+ </data>
+ </object>
</interface>
diff --git a/src/niepce/ui/dialogs/preferences.ui b/src/niepce/ui/dialogs/preferences.ui
index 57c2d9d..3fe2f76 100644
--- a/src/niepce/ui/dialogs/preferences.ui
+++ b/src/niepce/ui/dialogs/preferences.ui
@@ -1,21 +1,54 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 2.12 -->
- <!-- interface-naming-policy toplevel-contextual -->
<object class="GtkDialog" id="preferences">
+ <property name="can_focus">False</property>
<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">center-on-parent</property>
<property name="default_width">400</property>
<property name="default_height">300</property>
<property name="type_hint">dialog</property>
- <property name="has_separator">False</property>
<child internal-child="vbox">
- <object class="GtkVBox" id="dialog-vbox1">
+ <object class="GtkBox" id="dialog-vbox1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</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">end</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkButton" id="button1">
+ <property name="label">gtk-close</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
<child>
<placeholder/>
</child>
@@ -26,6 +59,7 @@
<child>
<object class="GtkTable" id="table2">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="border_width">12</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
@@ -37,6 +71,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -56,6 +91,7 @@
<child type="tab">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">_General</property>
<property name="use_underline">True</property>
</object>
@@ -66,6 +102,7 @@
<child>
<object class="GtkTable" id="table1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="border_width">12</property>
<property name="n_columns">2</property>
<property name="column_spacing">12</property>
@@ -73,6 +110,7 @@
<child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Theme: </property>
<property name="use_underline">True</property>
@@ -86,6 +124,7 @@
<child>
<object class="GtkComboBox" id="theme_combo">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="active">0</property>
</object>
<packing>
@@ -102,6 +141,7 @@
<child type="tab">
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">_User Interface</property>
<property name="use_underline">True</property>
</object>
@@ -112,40 +152,12 @@
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">2</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">end</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <object class="GtkButton" id="button1">
- <property name="label">gtk-close</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
</object>
</child>
<action-widgets>
diff --git a/src/niepce/ui/filmstripcontroller.cpp b/src/niepce/ui/filmstripcontroller.cpp
index a44137e..0f052f9 100644
--- a/src/niepce/ui/filmstripcontroller.cpp
+++ b/src/niepce/ui/filmstripcontroller.cpp
@@ -60,7 +60,7 @@ eng::library_id_t FilmStripController::get_selected()
{
eng::library_id_t id = 0;
DBG_OUT("get selected in filmstrip");
- Gtk::IconView::ArrayHandle_TreePaths paths = m_thumbview->get_selected_items();
+ std::vector<Gtk::TreePath> paths = m_thumbview->get_selected_items();
if(!paths.empty()) {
Gtk::TreePath path(*(paths.begin()));
DBG_OUT("found path %s", path.to_string().c_str());
diff --git a/src/niepce/ui/gridviewmodule.cpp b/src/niepce/ui/gridviewmodule.cpp
index 841b170..20b60b1 100644
--- a/src/niepce/ui/gridviewmodule.cpp
+++ b/src/niepce/ui/gridviewmodule.cpp
@@ -107,20 +107,18 @@ Gtk::Widget * GridViewModule::buildWidget(const Glib::RefPtr<Gtk::UIManager> & m
m_librarylistview.property_spacing() = 0;
m_librarylistview.property_margin() = 0;
+ m_librarylistview.signal_button_press_event()
+ .connect(sigc::mem_fun(*this, &GridViewModule::on_librarylistview_click));
+
// the main cell
LibraryCellRenderer * libcell = Gtk::manage(new LibraryCellRenderer(m_uidataprovider));
libcell->signal_rating_changed.connect(sigc::mem_fun(*this, &GridViewModule::on_rating_changed));
- GtkCellLayout *cl = GTK_CELL_LAYOUT(m_librarylistview.gobj());
- DBG_ASSERT(cl, "No cell layout");
- gtk_cell_layout_pack_start(cl, GTK_CELL_RENDERER(libcell->gobj()),
- FALSE);
- gtk_cell_layout_add_attribute(cl,
- GTK_CELL_RENDERER(libcell->gobj()),
- "pixbuf", m_model->columns().m_pix.index());
- gtk_cell_layout_add_attribute(cl,
- GTK_CELL_RENDERER(libcell->gobj()),
- "libfile", m_model->columns().m_libfile.index());
+ m_librarylistview.pack_start(*libcell, FALSE);
+ m_librarylistview.add_attribute(*libcell, "pixbuf",
+ m_model->columns().m_pix.index());
+ m_librarylistview.add_attribute(*libcell, "libfile",
+ m_model->columns().m_libfile.index());
m_scrollview.add(m_librarylistview);
m_scrollview.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
@@ -160,7 +158,7 @@ eng::library_id_t GridViewModule::get_selected()
eng::library_id_t id = 0;
Glib::RefPtr<Gtk::TreeSelection> selection;
- Gtk::IconView::ArrayHandle_TreePaths paths = m_librarylistview.get_selected_items();
+ std::vector<Gtk::TreePath> paths = m_librarylistview.get_selected_items();
if(!paths.empty()) {
Gtk::TreePath path(*(paths.begin()));
DBG_OUT("found path %s", path.to_string().c_str());
@@ -202,6 +200,26 @@ void GridViewModule::on_rating_changed(int /*id*/, int rating)
m_shell.get_selection_controller()->set_rating(rating);
}
+bool GridViewModule::on_librarylistview_click(GdkEventButton *e)
+{
+ double x, y;
+ int bx, by;
+ bx = by = 0;
+ x = e->x;
+ y = e->y;
+ Gtk::TreeModel::Path path;
+ Gtk::CellRenderer * renderer = NULL;
+ DBG_OUT("click (%f, %f)", x, y);
+ m_librarylistview.convert_widget_to_bin_window_coords(x, y, bx, by);
+ if(m_librarylistview.get_item_at_pos(bx, by, path, renderer)){
+ DBG_OUT("found an item");
+
+ return true;
+ }
+ return false;
+}
+
+
}
/*
Local Variables:
diff --git a/src/niepce/ui/gridviewmodule.hpp b/src/niepce/ui/gridviewmodule.hpp
index fd415c3..b7ccdff 100644
--- a/src/niepce/ui/gridviewmodule.hpp
+++ b/src/niepce/ui/gridviewmodule.hpp
@@ -77,6 +77,7 @@ protected:
private:
void on_metadata_changed(const fwk::PropertyBag &, const fwk::PropertyBag & old);
void on_rating_changed(int id, int rating);
+ bool on_librarylistview_click(GdkEventButton *e);
const IModuleShell & m_shell;
Glib::RefPtr<ImageListStore> m_model;
diff --git a/src/niepce/ui/librarycellrenderer.cpp b/src/niepce/ui/librarycellrenderer.cpp
index e9e83ff..f8b6f17 100644
--- a/src/niepce/ui/librarycellrenderer.cpp
+++ b/src/niepce/ui/librarycellrenderer.cpp
@@ -20,6 +20,9 @@
#include <stdint.h>
+#include <gdkmm.h>
+#include <gtkmm.h>
+
#include "fwk/base/debug.hpp"
#include "fwk/toolkit/widgets/ratinglabel.hpp"
#include "fwk/toolkit/gdkutils.hpp"
@@ -183,69 +186,54 @@ void drawLabel(const Cairo::RefPtr<Cairo::Context> & cr,
}
-
void
-LibraryCellRenderer::get_size_vfunc(Gtk::Widget& /*widget*/,
- const Gdk::Rectangle* /*cell_area*/,
- int* x_offset, int* y_offset,
- int* width, int* height) const
+LibraryCellRenderer::get_preferred_width_vfunc(Gtk::Widget& /*widget*/, int& minimum_width, int& natural_width) const
{
- if(x_offset) {
- *x_offset = 0;
- }
- if(y_offset) {
- *y_offset = 0;
- }
-
- if(width || height) {
- // TODO this should just be a property
- //
- Glib::RefPtr<Gdk::Pixbuf> pixbuf = property_pixbuf();
- int maxdim = m_size + pad() * 2;
-
- if(width) {
- *width = maxdim;
- }
- if(height) {
- *height = maxdim;
- }
- }
+ Glib::RefPtr<Gdk::Pixbuf> pixbuf = property_pixbuf();
+ int maxdim = m_size + pad() * 2;
+ minimum_width = natural_width = maxdim;
}
+void
+LibraryCellRenderer::get_preferred_height_vfunc(Gtk::Widget& /*widget*/, int& minimum_height, int& natural_height) const
+{
+ Glib::RefPtr<Gdk::Pixbuf> pixbuf = property_pixbuf();
+ int maxdim = m_size + pad() * 2;
+ minimum_height = natural_height = maxdim;
+}
void
-LibraryCellRenderer::render_vfunc(const Glib::RefPtr<Gdk::Drawable>& window,
+LibraryCellRenderer::render_vfunc(const Cairo::RefPtr<Cairo::Context>& cr,
Gtk::Widget& widget,
const Gdk::Rectangle& /*background_area*/,
const Gdk::Rectangle& cell_area,
- const Gdk::Rectangle& /*expose_area*/,
Gtk::CellRendererState flags)
{
unsigned int xpad = Gtk::CellRenderer::property_xpad();
unsigned int ypad = Gtk::CellRenderer::property_ypad();
- Cairo::RefPtr<Cairo::Context> cr = window->create_cairo_context();
GdkRectangle r = *(cell_area.gobj());
r.x += xpad;
r.y += ypad;
eng::LibFile::Ptr file = m_libfileproperty.get_value();
- Gdk::Color color;
+ Glib::RefPtr<Gtk::StyleContext> style_context = widget.get_style_context();
+ Gdk::RGBA color;
if(flags & Gtk::CELL_RENDERER_SELECTED) {
- color = widget.get_style()->get_bg(Gtk::STATE_SELECTED);
+ color = style_context->get_background_color(Gtk::STATE_FLAG_SELECTED);
}
else {
- color = widget.get_style()->get_bg(Gtk::STATE_NORMAL);
+ color = style_context->get_background_color(Gtk::STATE_FLAG_NORMAL);
}
- Gdk::Cairo::set_source_color(cr, color);
+ Gdk::Cairo::set_source_rgba(cr, color);
cr->rectangle(r.x, r.y, r.width, r.height);
cr->fill();
if(m_drawborder) {
- color = widget.get_style()->get_dark(Gtk::STATE_SELECTED);
- Gdk::Cairo::set_source_color(cr, color);
+ color = style_context->get_border_color(Gtk::STATE_FLAG_SELECTED);
+ Gdk::Cairo::set_source_rgba(cr, color);
cr->set_line_width(1.0);
cr->rectangle(r.x, r.y, r.width, r.height);
cr->stroke();
@@ -306,21 +294,16 @@ LibraryCellRenderer::render_vfunc(const Glib::RefPtr<Gdk::Drawable>& window,
bool
-LibraryCellRenderer::activate_vfunc(GdkEvent *event,
- Gtk::Widget & /*widget*/,
- const Glib::ustring & /*path*/,
- const Gdk::Rectangle& /*background_area*/,
- const Gdk::Rectangle& cell_area,
- Gtk::CellRendererState /*flags*/)
+LibraryCellRenderer::on_click(GdkEventButton *event, const GdkRectangle & cell_area)
{
- DBG_OUT("activated. Event type of %d", event->type);
+ DBG_OUT("On click. Event type of %d", event->type);
if(event->type == GDK_BUTTON_PRESS) {
GdkEventButton *bevt = (GdkEventButton*)event;
// hit test with the rating region
unsigned int xpad = Gtk::CellRenderer::property_xpad();
unsigned int ypad = Gtk::CellRenderer::property_ypad();
- GdkRectangle r = *(cell_area.gobj());
+ GdkRectangle r = cell_area;
r.x += xpad;
r.y += ypad;
@@ -355,7 +338,6 @@ LibraryCellRenderer::activate_vfunc(GdkEvent *event,
return false;
}
-
Glib::PropertyProxy_ReadOnly<eng::LibFile::Ptr>
LibraryCellRenderer::property_libfile() const
{
diff --git a/src/niepce/ui/librarycellrenderer.hpp b/src/niepce/ui/librarycellrenderer.hpp
index ae9126d..6ed54e0 100644
--- a/src/niepce/ui/librarycellrenderer.hpp
+++ b/src/niepce/ui/librarycellrenderer.hpp
@@ -40,22 +40,17 @@ class LibraryCellRenderer
public:
LibraryCellRenderer(libraryclient::UIDataProvider *provider);
- virtual void get_size_vfunc(Gtk::Widget& widget,
- const Gdk::Rectangle* cell_area,
- int* x_offset, int* y_offset,
- int* width, int* height) const;
- virtual void render_vfunc(const Glib::RefPtr<Gdk::Drawable>& window,
+ virtual void get_preferred_width_vfunc(Gtk::Widget& widget, int& minimum_width, int& natural_width) const;
+ virtual void get_preferred_height_vfunc(Gtk::Widget& widget, int& minimum_height, int& natural_height) const;
+
+ virtual void render_vfunc(const Cairo::RefPtr<Cairo::Context>& cr,
Gtk::Widget& widget,
const Gdk::Rectangle& background_area,
const Gdk::Rectangle& cell_area,
- const Gdk::Rectangle& expose_area,
Gtk::CellRendererState flags);
- virtual bool activate_vfunc(GdkEvent *event,
- Gtk::Widget & widget,
- const Glib::ustring & path,
- const Gdk::Rectangle& background_area,
- const Gdk::Rectangle& cell_area,
- Gtk::CellRendererState flags);
+ /** call when the cell is clicked */
+ bool on_click(GdkEventButton *event, const GdkRectangle & cell_area);
+
void set_size(int _size)
{ m_size = _size; }
int size() const
diff --git a/src/niepce/ui/moduleshell.cpp b/src/niepce/ui/moduleshell.cpp
index ce6e6fb..b476b64 100644
--- a/src/niepce/ui/moduleshell.cpp
+++ b/src/niepce/ui/moduleshell.cpp
@@ -59,11 +59,11 @@ Gtk::Widget * ModuleShell::buildWidget(const Glib::RefPtr<Gtk::UIManager> & mana
m_actionGroup->add(Gtk::Action::create("MenuImage", _("_Image")));
m_actionGroup->add(Gtk::Action::create("PrevImage", Gtk::Stock::GO_BACK),
- Gtk::AccelKey(GDK_Left, Gdk::ModifierType(0)),
+ Gtk::AccelKey(GDK_KEY_Left, Gdk::ModifierType(0)),
sigc::mem_fun(*m_selection_controller,
&SelectionController::select_previous));
m_actionGroup->add(Gtk::Action::create("NextImage", Gtk::Stock::GO_FORWARD),
- Gtk::AccelKey(GDK_Right, Gdk::ModifierType(0)),
+ Gtk::AccelKey(GDK_KEY_Right, Gdk::ModifierType(0)),
sigc::mem_fun(*m_selection_controller,
&SelectionController::select_next));
diff --git a/src/niepce/ui/thumb-view/eog-thumb-nav.cpp b/src/niepce/ui/thumb-view/eog-thumb-nav.cpp
index c384ff9..b2ff328 100644
--- a/src/niepce/ui/thumb-view/eog-thumb-nav.cpp
+++ b/src/niepce/ui/thumb-view/eog-thumb-nav.cpp
@@ -404,8 +404,8 @@ eog_thumb_nav_set_show_buttons (EogThumbNav *nav, gboolean show_buttons)
gtk_widget_show_all (nav->priv->button_left);
gtk_widget_show_all (nav->priv->button_right);
} else {
- gtk_widget_hide_all (nav->priv->button_left);
- gtk_widget_hide_all (nav->priv->button_right);
+ gtk_widget_hide (nav->priv->button_left);
+ gtk_widget_hide (nav->priv->button_right);
}
}
@@ -454,8 +454,8 @@ eog_thumb_nav_set_mode (EogThumbNav *nav, EogThumbNavMode mode)
GTK_POLICY_NEVER,
GTK_POLICY_ALWAYS);
- gtk_widget_hide_all (priv->button_left);
- gtk_widget_hide_all (priv->button_right);
+ gtk_widget_hide (priv->button_left);
+ gtk_widget_hide (priv->button_right);
break;
@@ -469,8 +469,8 @@ eog_thumb_nav_set_mode (EogThumbNav *nav, EogThumbNavMode mode)
GTK_POLICY_NEVER,
GTK_POLICY_ALWAYS);
- gtk_widget_hide_all (priv->button_left);
- gtk_widget_hide_all (priv->button_right);
+ gtk_widget_hide (priv->button_left);
+ gtk_widget_hide (priv->button_right);
break;
@@ -484,8 +484,8 @@ eog_thumb_nav_set_mode (EogThumbNav *nav, EogThumbNavMode mode)
GTK_POLICY_NEVER,
GTK_POLICY_ALWAYS);
- gtk_widget_hide_all (priv->button_left);
- gtk_widget_hide_all (priv->button_right);
+ gtk_widget_hide (priv->button_left);
+ gtk_widget_hide (priv->button_right);
break;
}
diff --git a/src/niepce/ui/thumbstripview.cpp b/src/niepce/ui/thumbstripview.cpp
index a2f3d44..fce3259 100644
--- a/src/niepce/ui/thumbstripview.cpp
+++ b/src/niepce/ui/thumbstripview.cpp
@@ -24,6 +24,7 @@
#include <string>
#include <glibmm/i18n.h>
+#include <gdkmm.h>
#include <gtkmm/adjustment.h>
#include <gtkmm/scrolledwindow.h>
@@ -86,21 +87,16 @@ ThumbStripView::ThumbStripView(const Glib::RefPtr<ui::ImageListStore> & store)
m_renderer = new ThumbStripCell();
- GtkCellLayout *cl = GTK_CELL_LAYOUT(gobj());
- DBG_ASSERT(cl, "No cell layout");
- gtk_cell_layout_pack_start(cl, GTK_CELL_RENDERER(m_renderer->gobj()),
- FALSE);
+ pack_start(*m_renderer, FALSE);
m_renderer->property_follow_state() = true;
m_renderer->property_height() = 100;
m_renderer->property_yalign() = 0.5;
m_renderer->property_xalign() = 0.5;
- gtk_cell_layout_set_attributes (cl, GTK_CELL_RENDERER(m_renderer->gobj()),
- "pixbuf",
- ui::ImageListStore::Columns::STRIP_THUMB_INDEX,
- "libfile",
- ui::ImageListStore::Columns::FILE_INDEX,
- NULL);
+ add_attribute(*m_renderer, "pixbuf",
+ ui::ImageListStore::Columns::STRIP_THUMB_INDEX);
+ add_attribute(*m_renderer, "libfile",
+ ui::ImageListStore::Columns::FILE_INDEX);
set_selection_mode(Gtk::SELECTION_MULTIPLE);
set_column_spacing(THUMB_STRIP_VIEW_SPACING);
@@ -220,8 +216,8 @@ void
ThumbStripView::on_parent_set (Gtk::Widget */*old_parent*/)
{
Gtk::ScrolledWindow *sw;
- Gtk::Adjustment *hadjustment;
- Gtk::Adjustment *vadjustment;
+ Glib::RefPtr<Gtk::Adjustment> hadjustment;
+ Glib::RefPtr<Gtk::Adjustment> vadjustment;
Gtk::Widget *parent = get_parent ();
sw = dynamic_cast<Gtk::ScrolledWindow*>(parent);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]