Skip to content

Commit a29a5d1

Browse files
author
raveit65
committed
metadata-sidebar: add the details button again
1 parent 6b0c2ae commit a29a5d1

File tree

2 files changed

+47
-2
lines changed

2 files changed

+47
-2
lines changed

data/metadata-sidebar.ui

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!-- Generated with glade 3.18.1 -->
2+
<!-- Generated with glade 3.22.1 -->
33
<interface>
44
<requires lib="gtk+" version="3.20"/>
55
<template class="EomMetadataSidebar" parent="GtkScrolledWindow">
@@ -401,10 +401,23 @@
401401
<property name="top_attach">6</property>
402402
</packing>
403403
</child>
404+
<child>
405+
<object class="GtkButton" id="details_button">
406+
<property name="label" translatable="yes">Details</property>
407+
<property name="visible">True</property>
408+
<property name="can_focus">True</property>
409+
<property name="receives_default">True</property>
410+
<property name="halign">center</property>
411+
</object>
412+
<packing>
413+
<property name="left_attach">0</property>
414+
<property name="top_attach">12</property>
415+
<property name="width">2</property>
416+
</packing>
417+
</child>
404418
</object>
405419
</child>
406420
</object>
407421
</child>
408422
</template>
409423
</interface>
410-

src/eom-metadata-sidebar.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ struct _EomMetadataSidebarPrivate {
8383
GtkWidget *date_label;
8484
GtkWidget *time_label;
8585
#endif
86+
87+
#if HAVE_METADATA
88+
GtkWidget *details_button;
89+
#endif
8690
};
8791

8892
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)
289293
g_object_unref (file);
290294
}
291295

296+
#ifdef HAVE_METADATA
297+
static void
298+
_details_button_clicked_cb (GtkButton *button, gpointer user_data)
299+
{
300+
EomMetadataSidebarPrivate *priv = EOM_METADATA_SIDEBAR(user_data)->priv;
301+
EomDialog *dlg;
302+
303+
g_return_if_fail (priv->parent_window != NULL);
304+
305+
dlg = eom_window_get_properties_dialog (
306+
EOM_WINDOW (priv->parent_window));
307+
g_return_if_fail (dlg != NULL);
308+
eom_properties_dialog_set_page (EOM_PROPERTIES_DIALOG (dlg),
309+
EOM_PROPERTIES_DIALOG_PAGE_DETAILS);
310+
eom_dialog_show (dlg);
311+
}
312+
#endif /* HAVE_METADATA */
313+
292314
static void
293315
eom_metadata_sidebar_set_parent_window (EomMetadataSidebar *sidebar,
294316
EomWindow *window)
@@ -322,6 +344,11 @@ eom_metadata_sidebar_init (EomMetadataSidebar *sidebar)
322344

323345
g_signal_connect (priv->folder_label, "activate-link",
324346
G_CALLBACK (_folder_label_clicked_cb), sidebar);
347+
348+
#if HAVE_METADATA
349+
g_signal_connect (priv->details_button, "clicked",
350+
G_CALLBACK (_details_button_clicked_cb), sidebar);
351+
#endif /* HAVE_METADATA */
325352
}
326353

327354
static void
@@ -437,6 +464,11 @@ eom_metadata_sidebar_class_init (EomMetadataSidebarClass *klass)
437464
gtk_widget_class_bind_template_child_private (widget_class,
438465
EomMetadataSidebar,
439466
time_label);
467+
#if HAVE_METADATA
468+
gtk_widget_class_bind_template_child_private (widget_class,
469+
EomMetadataSidebar,
470+
details_button);
471+
#endif /* HAVE_METADATA */
440472
}
441473

442474

0 commit comments

Comments
 (0)