Skip to content
Permalink
Browse files

metadata-sidebar: add the details button again

  • Loading branch information...
raveit65 committed Jul 24, 2018
1 parent 6b0c2ae commit a29a5d12245c7dde8c8e3e1bb430e9414b2b1cba
Showing with 47 additions and 2 deletions.
  1. +15 −2 data/metadata-sidebar.ui
  2. +32 −0 src/eom-metadata-sidebar.c
@@ -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>

@@ -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 */
}


0 comments on commit a29a5d1

Please sign in to comment.
You can’t perform that action at this time.