summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2018-07-24 09:41:19 +0200
committerraveit65 <[email protected]>2018-08-01 12:20:45 +0200
commita29a5d12245c7dde8c8e3e1bb430e9414b2b1cba (patch)
tree4c9c5e3ed7e9ee71ff9324fdc8eb1c3b886fec8a
parent6b0c2aed7e1e904cb23e13a8a3ec171102907dd9 (diff)
downloadeom-a29a5d12245c7dde8c8e3e1bb430e9414b2b1cba.tar.bz2
eom-a29a5d12245c7dde8c8e3e1bb430e9414b2b1cba.tar.xz
metadata-sidebar: add the details button again
-rw-r--r--data/metadata-sidebar.ui17
-rw-r--r--src/eom-metadata-sidebar.c32
2 files changed, 47 insertions, 2 deletions
diff --git a/data/metadata-sidebar.ui b/data/metadata-sidebar.ui
index 2cb7d89..59633bc 100644
--- a/data/metadata-sidebar.ui
+++ b/data/metadata-sidebar.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.1 -->
+<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<template class="EomMetadataSidebar" parent="GtkScrolledWindow">
@@ -401,10 +401,23 @@
<property name="top_attach">6</property>
</packing>
</child>
+ <child>
+ <object class="GtkButton" id="details_button">
+ <property name="label" translatable="yes">Details</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="halign">center</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">12</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
</object>
</child>
</object>
</child>
</template>
</interface>
-
diff --git a/src/eom-metadata-sidebar.c b/src/eom-metadata-sidebar.c
index b5bfed3..5c0e33a 100644
--- a/src/eom-metadata-sidebar.c
+++ b/src/eom-metadata-sidebar.c
@@ -83,6 +83,10 @@ struct _EomMetadataSidebarPrivate {
GtkWidget *date_label;
GtkWidget *time_label;
#endif
+
+#if HAVE_METADATA
+ GtkWidget *details_button;
+#endif
};
G_DEFINE_TYPE_WITH_PRIVATE(EomMetadataSidebar, eom_metadata_sidebar, GTK_TYPE_SCROLLED_WINDOW)
@@ -289,6 +293,24 @@ _folder_label_clicked_cb (GtkLabel *label, const gchar *uri, gpointer user_data)
g_object_unref (file);
}
+#ifdef HAVE_METADATA
+static void
+_details_button_clicked_cb (GtkButton *button, gpointer user_data)
+{
+ EomMetadataSidebarPrivate *priv = EOM_METADATA_SIDEBAR(user_data)->priv;
+ EomDialog *dlg;
+
+ g_return_if_fail (priv->parent_window != NULL);
+
+ dlg = eom_window_get_properties_dialog (
+ EOM_WINDOW (priv->parent_window));
+ g_return_if_fail (dlg != NULL);
+ eom_properties_dialog_set_page (EOM_PROPERTIES_DIALOG (dlg),
+ EOM_PROPERTIES_DIALOG_PAGE_DETAILS);
+ eom_dialog_show (dlg);
+}
+#endif /* HAVE_METADATA */
+
static void
eom_metadata_sidebar_set_parent_window (EomMetadataSidebar *sidebar,
EomWindow *window)
@@ -322,6 +344,11 @@ eom_metadata_sidebar_init (EomMetadataSidebar *sidebar)
g_signal_connect (priv->folder_label, "activate-link",
G_CALLBACK (_folder_label_clicked_cb), sidebar);
+
+#if HAVE_METADATA
+ g_signal_connect (priv->details_button, "clicked",
+ G_CALLBACK (_details_button_clicked_cb), sidebar);
+#endif /* HAVE_METADATA */
}
static void
@@ -437,6 +464,11 @@ eom_metadata_sidebar_class_init (EomMetadataSidebarClass *klass)
gtk_widget_class_bind_template_child_private (widget_class,
EomMetadataSidebar,
time_label);
+#if HAVE_METADATA
+ gtk_widget_class_bind_template_child_private (widget_class,
+ EomMetadataSidebar,
+ details_button);
+#endif /* HAVE_METADATA */
}