summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS6
-rw-r--r--configure.ac5
-rw-r--r--cut-n-paste/toolbar-editor/egg-editable-toolbar.c9
-rw-r--r--data/Makefile.am23
-rw-r--r--data/org.mate.eom.gschema.xml.in138
-rw-r--r--data/org.mate.eom.gschema.xml.in.in138
-rw-r--r--po/POTFILES.in16
-rw-r--r--po/POTFILES.skip3
-rw-r--r--src/eom-thumb-nav.c20
-rw-r--r--src/eom-thumb-view.c175
10 files changed, 366 insertions, 167 deletions
diff --git a/NEWS b/NEWS
index af408cf..f2ed304 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,9 @@
+eom 1.10.2
+==========
+
+ * Fix gschema translations.
+ * GTK3 fixes and improvements.
+
eom 1.10.1
==========
diff --git a/configure.ac b/configure.ac
index 6c6be66..37c3b36 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@ AC_CONFIG_MACRO_DIR([m4])
m4_define(eom_major_version, 1)
m4_define(eom_minor_version, 10)
-m4_define(eom_micro_version, 1)
+m4_define(eom_micro_version, 2)
m4_define(eom_version, eom_major_version.eom_minor_version.eom_micro_version)
AC_INIT([eom], eom_version, [http://www.mate-desktop.org], [eom])
@@ -64,7 +64,7 @@ fi
# ***********
AM_GLIB_GNU_GETTEXT
-IT_PROG_INTLTOOL([0.40.0])
+IT_PROG_INTLTOOL([0.50.1])
GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_SUBST(GETTEXT_PACKAGE)
@@ -499,6 +499,7 @@ po/Makefile.in
data/Makefile
data/eom.pc
data/eom.desktop.in
+data/org.mate.eom.gschema.xml
data/pixmaps/Makefile
data/icons/Makefile
data/icons/16x16/Makefile
diff --git a/cut-n-paste/toolbar-editor/egg-editable-toolbar.c b/cut-n-paste/toolbar-editor/egg-editable-toolbar.c
index 006980e..b8ea050 100644
--- a/cut-n-paste/toolbar-editor/egg-editable-toolbar.c
+++ b/cut-n-paste/toolbar-editor/egg-editable-toolbar.c
@@ -549,8 +549,13 @@ action_sensitive_cb (GtkAction *action,
GParamSpec *pspec,
GtkToolItem *item)
{
- EggEditableToolbar *etoolbar = EGG_EDITABLE_TOOLBAR
- (gtk_widget_get_ancestor (GTK_WIDGET (item), EGG_TYPE_EDITABLE_TOOLBAR));
+ EggEditableToolbar *etoolbar;
+ GtkWidget *ancestor = gtk_widget_get_ancestor (GTK_WIDGET (item), EGG_TYPE_EDITABLE_TOOLBAR);
+
+ if (!ancestor)
+ return;
+
+ etoolbar = EGG_EDITABLE_TOOLBAR (ancestor);
if (etoolbar->priv->edit_mode > 0)
{
diff --git a/data/Makefile.am b/data/Makefile.am
index 9a52d83..17331e2 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -20,9 +20,6 @@ gsettings_ENUM_FILES = $(top_srcdir)/src/eom-scroll-view.h \
gsettings_SCHEMAS = org.mate.eom.gschema.xml
@GSETTINGS_RULES@
-%.gschema.xml.in: %.gschema.xml.in.in Makefile
- $(AM_V_GEN) $(SED) -e 's^\@datadir\@^$(datadir)^g' -e 's^\@GETTEXT_PACKAGE\@^$(GETTEXT_PACKAGE)^g' < $< > $@
-
convertdir = $(datadir)/MateConf/gsettings
convert_DATA = eom.convert
@@ -40,20 +37,18 @@ pkgconfig_DATA = eom.pc
gtkrcdir = $(pkgdatadir)
gtkrc_DATA = gtkrc
-EXTRA_DIST = \
+EXTRA_DIST = \
$(gtkrc_DATA) \
- $(ui_DATA) \
- $(convert_DATA) \
+ $(ui_DATA) \
+ $(convert_DATA) \
$(DESKTOP_IN_FILES) \
- $(appdata_in_files) \
- $(gsettings_SCHEMAS).in.in
+ $(appdata_in_files)
-CLEANFILES = \
- eom.appdata.xml
+CLEANFILES = \
+ $(appdata_DATA)
-DISTCLEANFILES = \
- $(DESKTOP_FILES) \
- $(gsettings_SCHEMAS_in) \
- $(gsettings_SCHEMAS)
+DISTCLEANFILES = \
+ $(DESKTOP_FILES) \
+ $(gsettings_SCHEMAS)
-include $(top_srcdir)/git.mk
diff --git a/data/org.mate.eom.gschema.xml.in b/data/org.mate.eom.gschema.xml.in
new file mode 100644
index 0000000..92c430b
--- /dev/null
+++ b/data/org.mate.eom.gschema.xml.in
@@ -0,0 +1,138 @@
+<schemalist>
+ <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.mate.eom" path="/org/mate/eom/">
+ <child name="view" schema="org.mate.eom.view"/>
+ <child name="full-screen" schema="org.mate.eom.full-screen"/>
+ <child name="ui" schema="org.mate.eom.ui"/>
+ <child name="plugins" schema="org.mate.eom.plugins"/>
+ </schema>
+ <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.mate.eom.view" path="/org/mate/eom/view/">
+ <key name="autorotate" type="b">
+ <default>true</default>
+ <summary>Automatic orientation</summary>
+ <description>Whether the image should be rotated automatically based on EXIF orientation.</description>
+ </key>
+ <key name="background-color" type="s">
+ <default>'#000000'</default>
+ <summary>Background Color</summary>
+ <description>The color that is used to fill the area behind the image. If the use-background-color key is not set, the color is determined by the active GTK+ theme instead.</description>
+ </key>
+ <key name="use-background-color" type="b">
+ <default>true</default>
+ <summary>Use a custom background color</summary>
+ <description>If this is active, the color set by the background-color key will be used to fill the area behind the image. If it is not set, the current GTK+ theme will determine the fill color.</description>
+ </key>
+ <key name="interpolate" type="b">
+ <default>true</default>
+ <summary>Interpolate Image</summary>
+ <description>Whether the image should be interpolated on zoom-out. This leads to better quality but is somewhat slower than non-interpolated images.</description>
+ </key>
+ <key name="extrapolate" type="b">
+ <default>true</default>
+ <summary>Extrapolate Image</summary>
+ <description>Whether the image should be extrapolated on zoom-in. This leads to blurry quality and is somewhat slower than non-extrapolated images.</description>
+ </key>
+ <key name="transparency" enum="org.mate.eom.EomTransparencyStyle">
+ <default>'checked'</default>
+ <summary>Transparency indicator</summary>
+ <description>Determines how transparency should be indicated. Valid values are checked, color and none. If color is chosen, then the trans-color key determines the color value used.</description>
+ </key>
+ <key name="scroll-wheel-zoom" type="b">
+ <default>true</default>
+ <summary>Scroll wheel zoom</summary>
+ <description>Whether the scroll wheel should be used for zooming.</description>
+ </key>
+ <key name="zoom-multiplier" type="d">
+ <default>0.05</default>
+ <summary>Zoom multiplier</summary>
+ <description>The multiplier to be applied when using the mouse scroll wheel for zooming. This value defines the zooming step used for each scroll event. For example, 0.05 results in a 5% zoom increment for each scroll event and 1.00 result in a 100% zoom increment.</description>
+ </key>
+ <key name="trans-color" type="s">
+ <default>'#000000'</default>
+ <summary>Transparency color</summary>
+ <description>If the transparency key has the value COLOR, then this key determines the color which is used for indicating transparency.</description>
+ </key>
+ </schema>
+ <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.mate.eom.full-screen" path="/org/mate/eom/full-screen/">
+ <key name="random" type="b">
+ <default>false</default>
+ <summary>Randomize the image sequence</summary>
+ <description>Whether the sequence of images should be shown in an random loop.</description>
+ </key>
+ <key name="loop" type="b">
+ <default>true</default>
+ <summary>Loop through the image sequence</summary>
+ <description>Whether the sequence of images should be shown in an endless loop.</description>
+ </key>
+ <key name="upscale" type="b">
+ <default>true</default>
+ <summary>Allow zoom greater than 100% initially</summary>
+ <description>If this is set to FALSE small images will not be stretched to fit into the screen initially.</description>
+ </key>
+ <key name="seconds" type="i">
+ <default>5</default>
+ <summary>Delay in seconds until showing the next image</summary>
+ <description>A value greater than 0 determines the seconds an image stays on screen until the next one is shown automatically. Zero disables the automatic browsing.</description>
+ </key>
+ </schema>
+ <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.mate.eom.ui" path="/org/mate/eom/ui/">
+ <key name="toolbar" type="b">
+ <default>true</default>
+ <summary>Show/Hide the window toolbar.</summary>
+ </key>
+ <key name="statusbar" type="b">
+ <default>true</default>
+ <summary>Show/Hide the window statusbar.</summary>
+ </key>
+ <key name="image-collection" type="b">
+ <default>false</default>
+ <summary>Show/Hide the image collection pane.</summary>
+ </key>
+ <key name="image-collection-position" enum="org.mate.eom.EomWindowCollectionPos">
+ <default>'bottom'</default>
+ <summary>Image collection pane position.</summary>
+ </key>
+ <key name="image-collection-resizable" type="b">
+ <default>false</default>
+ <summary>Whether the image collection pane should be resizable.</summary>
+ </key>
+ <key name="sidebar" type="b">
+ <default>true</default>
+ <summary>Show/Hide the window side pane.</summary>
+ </key>
+ <key name="scroll-buttons" type="b">
+ <default>true</default>
+ <summary>Show/Hide the image collection pane scroll buttons.</summary>
+ </key>
+ <key name="disable-close-confirmation" type="b">
+ <default>false</default>
+ <summary>Close main window without asking to save changes.</summary>
+ </key>
+ <key name="disable-trash-confirmation" type="b">
+ <default>false</default>
+ <summary>Trash images without asking</summary>
+ <description>If activated, Eye of MATE won't ask for confirmation when moving images to the trash. It will still ask if any of the files cannot be moved to the trash and would be deleted instead.</description>
+ </key>
+ <key name="propsdialog-netbook-mode" type="b">
+ <default>true</default>
+ <summary>Whether the metadata list in the properties dialog should have its own page.</summary>
+ <description>If activated, the detailed metadata list in the properties dialog will be moved to its own page in the dialog. This should make the dialog more usable on smaller screens, e.g. as used by netbooks. If disabled, the widget will be embedded on the "Metadata" page.</description>
+ </key>
+ <key name="external-editor" type="s">
+ <default>''</default>
+ <summary>External program to use for editing images</summary>
+ <description>The desktop file name (including the ".desktop") of the application to use for editing images (when the "Edit Image" toolbar button is clicked). Set to the empty string to disable this feature.</description>
+ </key>
+ <key name="filechooser-xdg-fallback" type="b">
+ <default>true</default>
+ <summary>Whether the file chooser should show the user's pictures folder if no images are loaded.</summary>
+ <description>If activated and no image is loaded in the active window, the file chooser will display the user's pictures folder using the XDG special user directories. If deactivated or the pictures folder has not been set up, it will show the current working directory.</description>
+ </key>
+ </schema>
+ <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.mate.eom.plugins" path="/org/mate/eom/plugins/">
+ <key name="active-plugins" type="as">
+ <default>[]</default>
+ <summary>Active plugins</summary>
+ <description>List of active plugins. It doesn't contain the "Location" of the active plugins. See the .eom-plugin file for obtaining the "Location" of a given plugin.</description>
+ </key>
+ </schema>
+</schemalist>
diff --git a/data/org.mate.eom.gschema.xml.in.in b/data/org.mate.eom.gschema.xml.in.in
deleted file mode 100644
index de8c94f..0000000
--- a/data/org.mate.eom.gschema.xml.in.in
+++ /dev/null
@@ -1,138 +0,0 @@
-<schemalist>
- <schema id="org.mate.eom" path="/org/mate/eom/">
- <child name="view" schema="org.mate.eom.view"/>
- <child name="full-screen" schema="org.mate.eom.full-screen"/>
- <child name="ui" schema="org.mate.eom.ui"/>
- <child name="plugins" schema="org.mate.eom.plugins"/>
- </schema>
- <schema id="org.mate.eom.view" path="/org/mate/eom/view/">
- <key name="autorotate" type="b">
- <default>true</default>
- <_summary>Automatic orientation</_summary>
- <_description>Whether the image should be rotated automatically based on EXIF orientation.</_description>
- </key>
- <key name="background-color" type="s">
- <default>'#000000'</default>
- <_summary>Background Color</_summary>
- <_description>The color that is used to fill the area behind the image. If the use-background-color key is not set, the color is determined by the active GTK+ theme instead.</_description>
- </key>
- <key name="use-background-color" type="b">
- <default>true</default>
- <_summary>Use a custom background color</_summary>
- <_description>If this is active, the color set by the background-color key will be used to fill the area behind the image. If it is not set, the current GTK+ theme will determine the fill color.</_description>
- </key>
- <key name="interpolate" type="b">
- <default>true</default>
- <_summary>Interpolate Image</_summary>
- <_description>Whether the image should be interpolated on zoom-out. This leads to better quality but is somewhat slower than non-interpolated images.</_description>
- </key>
- <key name="extrapolate" type="b">
- <default>true</default>
- <_summary>Extrapolate Image</_summary>
- <_description>Whether the image should be extrapolated on zoom-in. This leads to blurry quality and is somewhat slower than non-extrapolated images.</_description>
- </key>
- <key name="transparency" enum="org.mate.eom.EomTransparencyStyle">
- <default>'checked'</default>
- <_summary>Transparency indicator</_summary>
- <_description>Determines how transparency should be indicated. Valid values are checked, color and none. If color is chosen, then the trans-color key determines the color value used.</_description>
- </key>
- <key name="scroll-wheel-zoom" type="b">
- <default>true</default>
- <_summary>Scroll wheel zoom</_summary>
- <_description>Whether the scroll wheel should be used for zooming.</_description>
- </key>
- <key name="zoom-multiplier" type="d">
- <default>0.05</default>
- <_summary>Zoom multiplier</_summary>
- <_description>The multiplier to be applied when using the mouse scroll wheel for zooming. This value defines the zooming step used for each scroll event. For example, 0.05 results in a 5% zoom increment for each scroll event and 1.00 result in a 100% zoom increment.</_description>
- </key>
- <key name="trans-color" type="s">
- <default>'#000000'</default>
- <_summary>Transparency color</_summary>
- <_description>If the transparency key has the value COLOR, then this key determines the color which is used for indicating transparency.</_description>
- </key>
- </schema>
- <schema id="org.mate.eom.full-screen" path="/org/mate/eom/full-screen/">
- <key name="random" type="b">
- <default>false</default>
- <_summary>Randomize the image sequence</_summary>
- <_description>Whether the sequence of images should be shown in an random loop.</_description>
- </key>
- <key name="loop" type="b">
- <default>true</default>
- <_summary>Loop through the image sequence</_summary>
- <_description>Whether the sequence of images should be shown in an endless loop.</_description>
- </key>
- <key name="upscale" type="b">
- <default>true</default>
- <_summary>Allow zoom greater than 100% initially</_summary>
- <_description>If this is set to FALSE small images will not be stretched to fit into the screen initially.</_description>
- </key>
- <key name="seconds" type="i">
- <default>5</default>
- <_summary>Delay in seconds until showing the next image</_summary>
- <_description>A value greater than 0 determines the seconds an image stays on screen until the next one is shown automatically. Zero disables the automatic browsing.</_description>
- </key>
- </schema>
- <schema id="org.mate.eom.ui" path="/org/mate/eom/ui/">
- <key name="toolbar" type="b">
- <default>true</default>
- <_summary>Show/Hide the window toolbar.</_summary>
- </key>
- <key name="statusbar" type="b">
- <default>true</default>
- <_summary>Show/Hide the window statusbar.</_summary>
- </key>
- <key name="image-collection" type="b">
- <default>false</default>
- <_summary>Show/Hide the image collection pane.</_summary>
- </key>
- <key name="image-collection-position" enum="org.mate.eom.EomWindowCollectionPos">
- <default>'bottom'</default>
- <_summary>Image collection pane position.</_summary>
- </key>
- <key name="image-collection-resizable" type="b">
- <default>false</default>
- <_summary>Whether the image collection pane should be resizable.</_summary>
- </key>
- <key name="sidebar" type="b">
- <default>true</default>
- <_summary>Show/Hide the window side pane.</_summary>
- </key>
- <key name="scroll-buttons" type="b">
- <default>true</default>
- <_summary>Show/Hide the image collection pane scroll buttons.</_summary>
- </key>
- <key name="disable-close-confirmation" type="b">
- <default>false</default>
- <_summary>Close main window without asking to save changes.</_summary>
- </key>
- <key name="disable-trash-confirmation" type="b">
- <default>false</default>
- <_summary>Trash images without asking</_summary>
- <_description>If activated, Eye of MATE won't ask for confirmation when moving images to the trash. It will still ask if any of the files cannot be moved to the trash and would be deleted instead.</_description>
- </key>
- <key name="propsdialog-netbook-mode" type="b">
- <default>true</default>
- <_summary>Whether the metadata list in the properties dialog should have its own page.</_summary>
- <_description>If activated, the detailed metadata list in the properties dialog will be moved to its own page in the dialog. This should make the dialog more usable on smaller screens, e.g. as used by netbooks. If disabled, the widget will be embedded on the "Metadata" page.</_description>
- </key>
- <key name="external-editor" type="s">
- <default>''</default>
- <_summary>External program to use for editing images</_summary>
- <_description>The desktop file name (including the ".desktop") of the application to use for editing images (when the "Edit Image" toolbar button is clicked). Set to the empty string to disable this feature.</_description>
- </key>
- <key name="filechooser-xdg-fallback" type="b">
- <default>true</default>
- <_summary>Whether the file chooser should show the user's pictures folder if no images are loaded.</_summary>
- <_description>If activated and no image is loaded in the active window, the file chooser will display the user's pictures folder using the XDG special user directories. If deactivated or the pictures folder has not been set up, it will show the current working directory.</_description>
- </key>
- </schema>
- <schema id="org.mate.eom.plugins" path="/org/mate/eom/plugins/">
- <key name="active-plugins" type="as">
- <default>[]</default>
- <_summary>Active plugins</_summary>
- <_description>List of active plugins. It doesn't contain the "Location" of the active plugins. See the .eom-plugin file for obtaining the "Location" of a given plugin.</_description>
- </key>
- </schema>
-</schemalist>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 63c1707..bef2e1a 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -3,25 +3,26 @@
[encoding: UTF-8]
cut-n-paste/toolbar-editor/egg-editable-toolbar.c
cut-n-paste/toolbar-editor/egg-toolbar-editor.c
-plugins/fullscreen/fullscreen.eom-plugin.desktop.in
-plugins/fullscreen/eom-fullscreen-plugin.c
-plugins/reload/reload.eom-plugin.desktop.in
-plugins/reload/eom-reload-plugin.c
-plugins/statusbar-date/statusbar-date.eom-plugin.desktop.in
data/eom.appdata.xml.in
data/eom.desktop.in.in
[type: gettext/glade]data/eom-image-properties-dialog.ui
[type: gettext/glade]data/eom-multiple-save-as-dialog.ui
[type: gettext/glade]data/eom-preferences-dialog.ui
-data/org.mate.eom.gschema.xml.in.in
+[type: gettext/gsettings]data/org.mate.eom.gschema.xml.in
+plugins/fullscreen/eom-fullscreen-plugin.c
+plugins/fullscreen/fullscreen.eom-plugin.desktop.in
+plugins/reload/eom-reload-plugin.c
+plugins/reload/reload.eom-plugin.desktop.in
+plugins/statusbar-date/statusbar-date.eom-plugin.desktop.in
src/eom-application.c
src/eom-close-confirmation-dialog.c
src/eom-file-chooser.c
src/eom-image.c
src/eom-image-jpeg.c
+src/eom-error-message-area.c
src/eom-exif-details.c
src/eom-exif-util.c
-src/eom-error-message-area.c
+src/eom-plugin-manager.c
src/eom-preferences-dialog.c
src/eom-print.c
src/eom-print-image-setup.c
@@ -33,5 +34,4 @@ src/eom-uri-converter.c
src/eom-uri-converter.h
src/eom-util.c
src/eom-window.c
-src/eom-plugin-manager.c
src/main.c
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
index 474e9e3..0a43517 100644
--- a/po/POTFILES.skip
+++ b/po/POTFILES.skip
@@ -1,6 +1,3 @@
# List of source files that should *not* be translated.
# Please keep this file sorted alphabetically.
data/eom.desktop.in
-data/eom-image-properties-dialog.glade
-data/eom-multiple-save-as-dialog.glade
-data/eom-preferences-dialog.glade
diff --git a/src/eom-thumb-nav.c b/src/eom-thumb-nav.c
index 702b4c5..24c2431 100644
--- a/src/eom-thumb-nav.c
+++ b/src/eom-thumb-nav.c
@@ -545,8 +545,13 @@ eom_thumb_nav_set_mode (EomThumbNav *nav, EomThumbNavMode mode)
switch (mode)
{
case EOM_THUMB_NAV_MODE_ONE_ROW:
+#if GTK_CHECK_VERSION (3, 4, 3)
+ gtk_orientable_set_orientation (GTK_ORIENTABLE(priv->thumbview),
+ GTK_ORIENTATION_HORIZONTAL);
+#else
gtk_icon_view_set_columns (GTK_ICON_VIEW (priv->thumbview),
G_MAXINT);
+#endif
gtk_widget_set_size_request (priv->thumbview, -1, -1);
eom_thumb_view_set_item_height (EOM_THUMB_VIEW (priv->thumbview),
@@ -561,7 +566,12 @@ eom_thumb_nav_set_mode (EomThumbNav *nav, EomThumbNavMode mode)
break;
case EOM_THUMB_NAV_MODE_ONE_COLUMN:
+#if GTK_CHECK_VERSION (3, 4, 3)
+ gtk_orientable_set_orientation (GTK_ORIENTABLE(priv->thumbview),
+ GTK_ORIENTATION_VERTICAL);
+#else
gtk_icon_view_set_columns (GTK_ICON_VIEW (priv->thumbview), 1);
+#endif
gtk_widget_set_size_request (priv->thumbview, -1, -1);
eom_thumb_view_set_item_height (EOM_THUMB_VIEW (priv->thumbview),
@@ -577,7 +587,12 @@ eom_thumb_nav_set_mode (EomThumbNav *nav, EomThumbNavMode mode)
break;
case EOM_THUMB_NAV_MODE_MULTIPLE_ROWS:
+#if GTK_CHECK_VERSION (3, 4, 3)
+ gtk_orientable_set_orientation (GTK_ORIENTABLE(priv->thumbview),
+ GTK_ORIENTATION_VERTICAL);
+#else
gtk_icon_view_set_columns (GTK_ICON_VIEW (priv->thumbview), -1);
+#endif
gtk_widget_set_size_request (priv->thumbview, -1, 220);
eom_thumb_view_set_item_height (EOM_THUMB_VIEW (priv->thumbview),
@@ -593,7 +608,12 @@ eom_thumb_nav_set_mode (EomThumbNav *nav, EomThumbNavMode mode)
break;
case EOM_THUMB_NAV_MODE_MULTIPLE_COLUMNS:
+#if GTK_CHECK_VERSION (3, 4, 3)
+ gtk_orientable_set_orientation (GTK_ORIENTABLE(priv->thumbview),
+ GTK_ORIENTATION_VERTICAL);
+#else
gtk_icon_view_set_columns (GTK_ICON_VIEW (priv->thumbview), -1);
+#endif
gtk_widget_set_size_request (priv->thumbview, 230, -1);
eom_thumb_view_set_item_height (EOM_THUMB_VIEW (priv->thumbview),
diff --git a/src/eom-thumb-view.c b/src/eom-thumb-view.c
index e52886c..aba4eba 100644
--- a/src/eom-thumb-view.c
+++ b/src/eom-thumb-view.c
@@ -38,12 +38,23 @@
#include <stdlib.h>
#include <string.h>
+#if GTK_CHECK_VERSION (3, 4, 3)
+enum {
+ PROP_0,
+ PROP_ORIENTATION
+};
+#endif
+
#define EOM_THUMB_VIEW_SPACING 0
#define EOM_THUMB_VIEW_GET_PRIVATE(object) \
(G_TYPE_INSTANCE_GET_PRIVATE ((object), EOM_TYPE_THUMB_VIEW, EomThumbViewPrivate))
+#if GTK_CHECK_VERSION (3, 4, 3)
+static void eom_thumb_view_init (EomThumbView *thumbview);
+#else
G_DEFINE_TYPE (EomThumbView, eom_thumb_view, GTK_TYPE_ICON_VIEW);
+#endif
static EomImage* eom_thumb_view_get_image_from_path (EomThumbView *thumbview,
GtkTreePath *path);
@@ -51,6 +62,13 @@ static EomImage* eom_thumb_view_get_image_from_path (EomThumbView *thumbvie
static void eom_thumb_view_popup_menu (EomThumbView *widget,
GdkEventButton *event);
+#if GTK_CHECK_VERSION (3, 4, 3)
+static void eom_thumb_view_update_columns (EomThumbView *view);
+
+G_DEFINE_TYPE_WITH_CODE (EomThumbView, eom_thumb_view, GTK_TYPE_ICON_VIEW,
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, NULL));
+#endif
+
static gboolean
thumbview_on_query_tooltip_cb (GtkWidget *widget,
gint x,
@@ -81,6 +99,13 @@ struct _EomThumbViewPrivate {
GtkWidget *menu; /* a contextual menu for thumbnails */
GtkCellRenderer *pixbuf_cell;
gint visible_range_changed_id;
+
+#if GTK_CHECK_VERSION (3, 4, 3)
+ GtkOrientation orientation;
+ gint n_images;
+ gulong image_add_id;
+ gulong image_removed_id;
+#endif
};
/* Drag 'n Drop */
@@ -152,12 +177,29 @@ static void
eom_thumb_view_dispose (GObject *object)
{
EomThumbViewPrivate *priv = EOM_THUMB_VIEW (object)->priv;
+#if GTK_CHECK_VERSION (3, 4, 3)
+ GtkTreeModel *model;
+#endif
if (priv->visible_range_changed_id != 0) {
g_source_remove (priv->visible_range_changed_id);
priv->visible_range_changed_id = 0;
}
+#if GTK_CHECK_VERSION (3, 4, 3)
+ model = gtk_icon_view_get_model (GTK_ICON_VIEW (object));
+
+ if (model && priv->image_add_id != 0) {
+ g_signal_handler_disconnect (model, priv->image_add_id);
+ priv->image_add_id = 0;
+ }
+
+ if (model && priv->image_removed_id) {
+ g_signal_handler_disconnect (model, priv->image_removed_id);
+ priv->image_removed_id = 0;
+ }
+#endif
+
G_OBJECT_CLASS (eom_thumb_view_parent_class)->dispose (object);
}
@@ -189,6 +231,50 @@ eom_thumb_view_destroy (GtkObject *object)
#endif
}
+#if GTK_CHECK_VERSION (3, 4, 3)
+static void
+eom_thumb_view_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ EomThumbView *view = EOM_THUMB_VIEW (object);
+
+ switch (prop_id)
+ {
+ case PROP_ORIENTATION:
+ g_value_set_enum (value, view->priv->orientation);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+eom_thumb_view_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ EomThumbView *view = EOM_THUMB_VIEW (object);
+
+ switch (prop_id)
+ {
+ case PROP_ORIENTATION:
+ view->priv->orientation = g_value_get_enum (value);
+#if GTK_CHECK_VERSION (3, 4, 3)
+ eom_thumb_view_update_columns (view);
+#endif
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+#endif
+
static void
eom_thumb_view_class_init (EomThumbViewClass *class)
{
@@ -200,6 +286,13 @@ eom_thumb_view_class_init (EomThumbViewClass *class)
#endif
gobject_class->constructed = eom_thumb_view_constructed;
gobject_class->dispose = eom_thumb_view_dispose;
+#if GTK_CHECK_VERSION (3, 4, 3)
+ gobject_class->get_property = eom_thumb_view_get_property;
+ gobject_class->set_property = eom_thumb_view_set_property;
+
+ g_object_class_override_property (gobject_class, PROP_ORIENTATION,
+ "orientation");
+#endif
gobject_class->finalize = eom_thumb_view_finalize;
#if GTK_CHECK_VERSION(3, 0, 0)
widget_class->destroy = eom_thumb_view_destroy;
@@ -616,6 +709,10 @@ eom_thumb_view_init (EomThumbView *thumbview)
thumbview->priv = EOM_THUMB_VIEW_GET_PRIVATE (thumbview);
thumbview->priv->visible_range_changed_id = 0;
+#if GTK_CHECK_VERSION (3, 4, 3)
+ thumbview->priv->image_add_id = 0;
+ thumbview->priv->image_removed_id = 0;
+#endif
}
/**
@@ -635,6 +732,45 @@ eom_thumb_view_new (void)
return GTK_WIDGET (thumbview);
}
+#if GTK_CHECK_VERSION (3, 4, 3)
+static void
+eom_thumb_view_update_columns (EomThumbView *view)
+{
+ EomThumbViewPrivate *priv;
+
+ g_return_if_fail (EOM_IS_THUMB_VIEW (view));
+
+ priv = view->priv;
+
+ if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+ gtk_icon_view_set_columns (GTK_ICON_VIEW (view),
+ priv->n_images);
+}
+
+static void
+eom_thumb_view_row_inserted_cb (GtkTreeModel *tree_model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ EomThumbView *view)
+{
+ EomThumbViewPrivate *priv = view->priv;
+
+ priv->n_images++;
+ eom_thumb_view_update_columns (view);
+}
+
+static void
+eom_thumb_view_row_deleted_cb (GtkTreeModel *tree_model,
+ GtkTreePath *path,
+ EomThumbView *view)
+{
+ EomThumbViewPrivate *priv = view->priv;
+
+ priv->n_images--;
+ eom_thumb_view_update_columns (view);
+}
+#endif
+
/**
* eom_thumb_view_set_model:
* @thumbview: A #EomThumbView.
@@ -648,13 +784,52 @@ void
eom_thumb_view_set_model (EomThumbView *thumbview, EomListStore *store)
{
gint index;
+#if GTK_CHECK_VERSION (3, 4, 3)
+ EomThumbViewPrivate *priv;
+ GtkTreeModel *existing;
+#endif
g_return_if_fail (EOM_IS_THUMB_VIEW (thumbview));
g_return_if_fail (EOM_IS_LIST_STORE (store));
+#if GTK_CHECK_VERSION (3, 4, 3)
+ priv = thumbview->priv;
+
+ existing = gtk_icon_view_get_model (GTK_ICON_VIEW (thumbview));
+
+ if (existing != NULL) {
+ if (priv->image_add_id != 0) {
+ g_signal_handler_disconnect (existing,
+ priv->image_add_id);
+ }
+ if (priv->image_removed_id != 0) {
+ g_signal_handler_disconnect (existing,
+ priv->image_removed_id);
+
+ }
+ }
+
+ priv->image_add_id = g_signal_connect (G_OBJECT (store), "row-inserted",
+ G_CALLBACK (eom_thumb_view_row_inserted_cb),
+ thumbview);
+ priv->image_removed_id = g_signal_connect (G_OBJECT (store),
+ "row-deleted",
+ G_CALLBACK (eom_thumb_view_row_deleted_cb),
+ thumbview);
+
+ thumbview->priv->n_images = eom_list_store_length (store);
+#endif
+
index = eom_list_store_get_initial_pos (store);
+#if GTK_CHECK_VERSION (3, 4, 3)
+ gtk_icon_view_set_model (GTK_ICON_VIEW (thumbview),
+ GTK_TREE_MODEL (store));
+
+ eom_thumb_view_update_columns (thumbview);
+#else
gtk_icon_view_set_model (GTK_ICON_VIEW (thumbview), GTK_TREE_MODEL (store));
+#endif
if (index >= 0) {
GtkTreePath *path = gtk_tree_path_new_from_indices (index, -1);