[eog: 10/11] remove eog-image-properties-dialog




commit be98582c689af68ef848c525989139cb7c71cd2c
Author: Felix Riemann <friemann gnome org>
Date:   Sat Feb 12 18:45:01 2022 +0100

    remove eog-image-properties-dialog

 data/eog-image-properties-dialog.ui | 895 -----------------------------------
 data/eog.convert                    |   1 -
 data/help-overlay.ui                |   2 +-
 data/meson.build                    |   1 -
 data/org.gnome.eog.gschema.xml.in   |   5 -
 po/POTFILES.in                      |   2 -
 src/eog-config-keys.h               |   1 -
 src/eog-properties-dialog.c         | 896 ------------------------------------
 src/eog-properties-dialog.h         |  79 ----
 src/eog-sidebar.c                   |  17 +
 src/eog-sidebar.h                   |   4 +
 src/eog-window.c                    |  87 ++--
 src/eog-window.h                    |   1 -
 src/eog.gresource.xml               |   1 -
 src/meson.build                     |   2 -
 15 files changed, 52 insertions(+), 1942 deletions(-)
---
diff --git a/data/eog.convert b/data/eog.convert
index c0f2f7bf..01ba8816 100644
--- a/data/eog.convert
+++ b/data/eog.convert
@@ -12,7 +12,6 @@ filechooser-xdg-fallback=/apps/eog/ui/filechooser_xdg_fallback
 image-gallery=/apps/eog/ui/image_collection
 image-gallery-position=/apps/eog/ui/image_collection_position
 image-gallery-resizable=/apps/eog/ui/image_collection_resizable
-propsdialog-netbook-mode=/apps/eog/ui/propsdialog_netbook_mode
 scroll-buttons=/apps/eog/ui/scroll_buttons
 sidebar=/apps/eog/ui/sidebar
 statusbar=/apps/eog/ui/statusbar
diff --git a/data/help-overlay.ui b/data/help-overlay.ui
index d47682c4..eee42fd0 100644
--- a/data/help-overlay.ui
+++ b/data/help-overlay.ui
@@ -65,7 +65,7 @@
               <object class="GtkShortcutsShortcut">
                 <property name="visible">1</property>
                 <property name="accelerator">&lt;alt&gt;Return</property>
-                <property name="title" translatable="yes" context="shortcut window">Show image properties 
dialog</property>
+                <property name="title" translatable="yes" context="shortcut window">Show image properties in 
sidebar</property>
               </object>
             </child>
             <child>
diff --git a/data/meson.build b/data/meson.build
index 05c92b9a..976bce7f 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -4,7 +4,6 @@ resource_data = files(
   'pixmaps/thumbnail-frame.png',
   'eog-details-dialog.ui',
   'eog-gear-menu.ui',
-  'eog-image-properties-dialog.ui',
   'eog-multiple-save-as-dialog.ui',
   'eog-preferences-dialog.ui',
   'eog-remote-presenter.ui',
diff --git a/data/org.gnome.eog.gschema.xml.in b/data/org.gnome.eog.gschema.xml.in
index 0359a232..2bd77161 100644
--- a/data/org.gnome.eog.gschema.xml.in
+++ b/data/org.gnome.eog.gschema.xml.in
@@ -108,11 +108,6 @@
       <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>
-    <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>
   </schema>
   <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.eog.plugins" path="/org/gnome/eog/plugins/">
     <key name="active-plugins" type="as">
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 06f002a4..67f4d06c 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -3,7 +3,6 @@
 data/eog.appdata.xml.in
 data/eog-gear-menu.ui
 data/eog-details-dialog.ui
-data/eog-image-properties-dialog.ui
 data/eog-multiple-save-as-dialog.ui
 data/eog-preferences-dialog.ui
 data/eog-remote-presenter.ui
@@ -32,7 +31,6 @@ src/eog-metadata-sidebar.c
 src/eog-preferences-dialog.c
 src/eog-print.c
 src/eog-print-image-setup.c
-src/eog-properties-dialog.c
 src/eog-remote-presenter.c
 src/eog-save-as-dialog-helper.c
 src/eog-scroll-view.c
diff --git a/src/eog-config-keys.h b/src/eog-config-keys.h
index f171138d..12b5cc80 100644
--- a/src/eog-config-keys.h
+++ b/src/eog-config-keys.h
@@ -63,7 +63,6 @@
 #define EOG_CONF_UI_DISABLE_CLOSE_CONFIRMATION  "disable-close-confirmation"
 #define EOG_CONF_UI_DISABLE_TRASH_CONFIRMATION "disable-trash-confirmation"
 #define EOG_CONF_UI_FILECHOOSER_XDG_FALLBACK   "filechooser-xdg-fallback"
-#define EOG_CONF_UI_PROPSDIALOG_NETBOOK_MODE   "propsdialog-netbook-mode"
 
 #define EOG_CONF_PLUGINS_ACTIVE_PLUGINS         "active-plugins"
 
diff --git a/src/eog-sidebar.c b/src/eog-sidebar.c
index 1d753c6f..1e2489ca 100644
--- a/src/eog-sidebar.c
+++ b/src/eog-sidebar.c
@@ -133,6 +133,23 @@ eog_sidebar_set_page (EogSidebar   *eog_sidebar,
        g_object_notify (G_OBJECT (eog_sidebar), "current-page");
 }
 
+gint
+eog_sidebar_get_page_nr (EogSidebar *eog_sidebar)
+{
+       GtkNotebook *notebook = GTK_NOTEBOOK (eog_sidebar->priv->notebook);
+
+       return gtk_notebook_get_current_page (notebook);
+}
+
+void
+eog_sidebar_set_page_nr (EogSidebar   *eog_sidebar,
+                        gint          index)
+{
+       GtkNotebook *notebook = GTK_NOTEBOOK (eog_sidebar->priv->notebook);
+
+       gtk_notebook_set_current_page (notebook, index);
+}
+
 static GtkWidget *
 eog_sidebar_get_current_page (EogSidebar *sidebar)
 {
diff --git a/src/eog-sidebar.h b/src/eog-sidebar.h
index 7abaface..099d9c83 100644
--- a/src/eog-sidebar.h
+++ b/src/eog-sidebar.h
@@ -71,6 +71,10 @@ void       eog_sidebar_remove_page  (EogSidebar  *eog_sidebar,
 void       eog_sidebar_set_page     (EogSidebar  *eog_sidebar,
                                     GtkWidget   *main_widget);
 
+gint       eog_sidebar_get_page_nr  (EogSidebar  *eog_sidebar);
+void       eog_sidebar_set_page_nr  (EogSidebar  *eog_sidebar,
+                                    gint         index);
+
 gint       eog_sidebar_get_n_pages  (EogSidebar  *eog_sidebar);
 
 gboolean   eog_sidebar_is_empty     (EogSidebar  *eog_sidebar);
diff --git a/src/eog-window.c b/src/eog-window.c
index 9d00a665..94697be2 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -40,7 +40,6 @@
 #include "eog-sidebar.h"
 #include "eog-statusbar.h"
 #include "eog-preferences-dialog.h"
-#include "eog-properties-dialog.h"
 #include "eog-remote-presenter.h"
 #include "eog-print.h"
 #include "eog-error-message-area.h"
@@ -139,7 +138,6 @@ struct _EogWindowPrivate {
         GtkWidget           *nav;
        GtkWidget           *message_area;
        GtkWidget           *remote_presenter;
-       GtkWidget           *properties_dlg;
 
        GtkBuilder          *gear_menu_builder;
 
@@ -882,11 +880,6 @@ image_thumb_changed_cb (EogImage *image, gpointer data)
        if (thumb != NULL) {
                gtk_window_set_icon (GTK_WINDOW (window), thumb);
 
-               if (window->priv->properties_dlg != NULL) {
-                       eog_properties_dialog_update (EOG_PROPERTIES_DIALOG (priv->properties_dlg),
-                                                     image);
-               }
-
                if (window->priv->remote_presenter != NULL) {
                        eog_remote_presenter_update (EOG_REMOTE_PRESENTER (priv->remote_presenter),
                                                      image);
@@ -2523,6 +2516,35 @@ eog_window_action_about (GSimpleAction *action,
        eog_window_show_about_dialog (EOG_WINDOW (user_data));
 }
 
+static void
+eog_window_action_toggle_properties (GSimpleAction *action,
+                                    GVariant      *variant,
+                                    gpointer       user_data)
+{
+       static gint PROPERTIES_PAGE = 0;
+
+       EogWindow *window;
+       EogWindowPrivate *priv;
+       gboolean was_visible;
+
+       g_return_if_fail (EOG_IS_WINDOW (user_data));
+
+       window = EOG_WINDOW (user_data);
+       priv = window->priv;
+
+       if (priv->mode != EOG_WINDOW_MODE_NORMAL &&
+            priv->mode != EOG_WINDOW_MODE_FULLSCREEN) return;
+
+       was_visible = gtk_widget_get_visible (priv->sidebar) &&
+                     eog_sidebar_get_page_nr (EOG_SIDEBAR (priv->sidebar)) == PROPERTIES_PAGE;
+
+       if  (!was_visible) {
+               eog_sidebar_set_page_nr (EOG_SIDEBAR (priv->sidebar), PROPERTIES_PAGE);
+       }
+       gtk_widget_set_visible (priv->sidebar, !was_visible);
+       g_settings_set_boolean (priv->ui_settings, EOG_CONF_UI_SIDEBAR, !was_visible);
+}
+
 static void
 eog_window_action_show_hide_bar (GSimpleAction *action,
                                 GVariant      *state,
@@ -3036,43 +3058,6 @@ eog_window_action_print (GSimpleAction *action,
        eog_window_print (window);
 }
 
-/**
- * eog_window_get_properties_dialog:
- * @window: a #EogWindow
- *
- * Gets the @window property dialog. The widget will be built on the first call to this function.
- *
- * Returns: (transfer none): a #GtkWidget.
- */
-
-GtkWidget*
-eog_window_get_properties_dialog (EogWindow *window)
-{
-       EogWindowPrivate *priv;
-
-       g_return_val_if_fail (EOG_IS_WINDOW (window), NULL);
-
-       priv = window->priv;
-
-       if (priv->properties_dlg == NULL) {
-               priv->properties_dlg =
-                       eog_properties_dialog_new (GTK_WINDOW (window),
-                                                  EOG_THUMB_VIEW (priv->thumbview),
-                                                  "win.go-next",
-                                                  "win.go-previous");
-
-               eog_properties_dialog_update (EOG_PROPERTIES_DIALOG (priv->properties_dlg),
-                                             priv->image);
-               g_settings_bind (priv->ui_settings,
-                                EOG_CONF_UI_PROPSDIALOG_NETBOOK_MODE,
-                                priv->properties_dlg, "netbook-mode",
-                                G_SETTINGS_BIND_GET);
-       }
-
-       return priv->properties_dlg;
-}
-
-
 /**
  * eog_window_get_remote_presenter:
  * @window: a #EogWindow
@@ -3104,18 +3089,6 @@ eog_window_get_remote_presenter (EogWindow *window)
        return priv->remote_presenter;
 }
 
-static void
-eog_window_action_properties (GSimpleAction *action,
-                             GVariant      *variant,
-                             gpointer       user_data)
-{
-       EogWindow *window = EOG_WINDOW (user_data);
-       GtkWidget *dialog;
-
-       dialog = eog_window_get_properties_dialog (window);
-       gtk_widget_show (dialog);
-}
-
 static void
 eog_window_action_show_remote (GSimpleAction *action,
                               GVariant      *variant,
@@ -4026,7 +3999,7 @@ static const GActionEntry window_actions[] = {
        { "close",         eog_window_action_close_window },
        { "close-all",     eog_window_action_close_all_windows },
        { "print",         eog_window_action_print },
-       { "properties",    eog_window_action_properties },
+       { "properties",    eog_window_action_toggle_properties },
        { "show-remote",   eog_window_action_show_remote },
        { "set-wallpaper", eog_window_action_wallpaper },
        { "preferences",   eog_window_action_preferences },
diff --git a/src/eog-window.h b/src/eog-window.h
index 61b8b520..1370a52e 100644
--- a/src/eog-window.h
+++ b/src/eog-window.h
@@ -130,7 +130,6 @@ gboolean      eog_window_is_not_initializing (const EogWindow *window);
 
 void          eog_window_reload_image (EogWindow *window);
 GtkWidget    *eog_window_get_remote_presenter (EogWindow *window);
-GtkWidget    *eog_window_get_properties_dialog (EogWindow *window);
 
 void          eog_window_show_about_dialog (EogWindow    *window);
 void          eog_window_show_preferences_dialog (EogWindow *window);
diff --git a/src/eog.gresource.xml b/src/eog.gresource.xml
index 7f4d578e..d57ee45f 100644
--- a/src/eog.gresource.xml
+++ b/src/eog.gresource.xml
@@ -4,7 +4,6 @@
     <file>eog.css</file>
     <file compressed="true" preprocess="xml-stripblanks">eog-gear-menu.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">eog-details-dialog.ui</file>
-    <file compressed="true" preprocess="xml-stripblanks">eog-image-properties-dialog.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">eog-multiple-save-as-dialog.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">eog-preferences-dialog.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">eog-remote-presenter.ui</file>
diff --git a/src/meson.build b/src/meson.build
index cc0311c9..cc9d3856 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -31,7 +31,6 @@ headers = enum_headers + files(
   'eog-job-scheduler.h',
   'eog-jobs.h',
   'eog-list-store.h',
-  'eog-properties-dialog.h',
   'eog-remote-presenter.h',
   'eog-sidebar.h',
   'eog-statusbar.h',
@@ -68,7 +67,6 @@ sources = files(
   'eog-print.c',
   'eog-print-image-setup.c',
   'eog-print-preview.c',
-  'eog-properties-dialog.c',
   'eog-remote-presenter.c',
   'eog-save-as-dialog-helper.c',
   'eog-scroll-view.c',


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