[bijiben] Do not use egg list box
- From: Pierre-Yves Luyten <pyluyten src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [bijiben] Do not use egg list box
- Date: Fri, 21 Jun 2013 23:13:17 +0000 (UTC)
commit f2c7322896f8eed09a043d0644bcfedeb109dd9f
Author: Yosef Or Boczko <yosefor3 walla com>
Date: Sat Jun 22 00:05:51 2013 +0200
Do not use egg list box
Port Import Dialog to GtkListBox
.gitmodules | 3 -
Makefile.am | 2 +-
autogen.sh | 7 ---
configure.ac | 17 +-------
egg-list-box | 1 -
m4/ax_config_dir.m4 | 109 -----------------------------------------------
po/POTFILES.skip | 1 -
src/bjb-import-dialog.c | 52 ++++++++++++----------
8 files changed, 30 insertions(+), 162 deletions(-)
---
diff --git a/.gitmodules b/.gitmodules
index ee3430a..bfd964e 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,6 +1,3 @@
[submodule "libgd"]
path = libgd
url = git://git.gnome.org/libgd
-[submodule "egg-list-box"]
- path = egg-list-box
- url = git://git.gnome.org/egg-list-box
diff --git a/Makefile.am b/Makefile.am
index 3ffbfaa..58879ac 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
ACLOCAL_AMFLAGS = -I m4 -I libgd ${ACLOCAL_FLAGS}
-SUBDIRS = egg-list-box libgd src data po help
+SUBDIRS = libgd src data po help
bijibendoc = \
README\
diff --git a/autogen.sh b/autogen.sh
index 6bb9a7e..898f955 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -21,11 +21,4 @@ which gnome-autogen.sh || {
git submodule update --init --recursive
-# egg-list-box
-
-cd egg-list-box
-sh autogen.sh --no-configure
-cd ..
-
-
REQUIRED_AUTOMAKE_VERSION=1.9 . gnome-autogen.sh
diff --git a/configure.ac b/configure.ac
index d35976f..2f662fa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,27 +35,12 @@ IT_PROG_INTLTOOL([0.35.0])
AM_PROG_LIBTOOL
-
-# EggListBox submodule
-prev_top_build_prefix=$ac_top_build_prefix
-prev_ac_configure_args=$ac_configure_args
-AX_CONFIG_DIR([egg-list-box])
-ac_top_build_prefix=$prev_top_build_prefix
-ac_configure_args=$prev_ac_configure_args
-
-export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:"$ac_top_build_prefix"egg-list-box
-
-
-
-
-
GLIB_REQUIRED_VERSION=2.28
-GTK_REQUIRED_VERSION=3.7.7
+GTK_REQUIRED_VERSION=3.9.3
PKG_CHECK_MODULES(BIJIBEN,
[ clutter-gtk-1.0
- egg-list-box
gio-unix-2.0
glib-2.0 >= $GLIB_REQUIRED_VERSION
goa-1.0
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
index 1492519..aa95c49 100644
--- a/po/POTFILES.skip
+++ b/po/POTFILES.skip
@@ -1,3 +1,2 @@
-egg-list-box/egg-flow-box.c
data/bijiben.desktop.in
libgd/libgd/gd-header-bar.c
diff --git a/src/bjb-import-dialog.c b/src/bjb-import-dialog.c
index 661859c..ccb5df8 100644
--- a/src/bjb-import-dialog.c
+++ b/src/bjb-import-dialog.c
@@ -29,7 +29,6 @@
#include "config.h"
#include <glib/gi18n.h>
-#include <egg-list-box.h>
#include "bjb-bijiben.h"
#include "bjb-import-dialog.h"
@@ -66,7 +65,7 @@ struct BjbImportDialogPrivate_
{
GtkApplication *bijiben;
- EggListBox *box;
+ GtkListBox *box;
/* Select spec. foder */
@@ -167,23 +166,22 @@ child_toggle_new ()
}
-/* toggle_child
+/* row_activated
* When an item is activated
* Check for the location
* Show or delete the visible toggle
* Add or remove location from import paths */
static void
-toggle_child (EggListBox *list_box,
- GtkWidget *selected,
- BjbImportDialog *self)
+toggle_widget (BjbImportDialog *self,
+ GObject *widget)
{
BjbImportDialogPrivate *priv = self->priv;
ImportDialogChild *child;
GtkStyleContext *context;
GList *keys;
- child = g_object_get_qdata (G_OBJECT (selected), application_quark ());
+ child = g_object_get_qdata (widget, application_quark ());
if (!child->selected && child->location == NULL)
return;
@@ -227,18 +225,24 @@ toggle_child (EggListBox *list_box,
static void
-separator_func (GtkWidget** separator,
- GtkWidget* child,
- GtkWidget* before,
- void* user_data)
+on_row_activated_cb (GtkListBox *list_box,
+ GtkListBoxRow *row,
+ gpointer user_data)
{
- if (*separator == NULL && before != NULL)
- {
- *separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
+ toggle_widget (user_data, G_OBJECT (gtk_bin_get_child (GTK_BIN (row))));
+}
- g_object_ref_sink (*separator);
- gtk_widget_show (*separator);
- }
+
+static void
+header_func (GtkListBoxRow *row,
+ GtkListBoxRow *before_row,
+ gpointer user_data)
+{
+ if (before_row != NULL && gtk_list_box_row_get_header (row) != NULL)
+ gtk_list_box_row_set_header (row, gtk_separator_new (GTK_ORIENTATION_HORIZONTAL));
+
+ else
+ gtk_list_box_row_set_header (row, NULL);
}
@@ -271,7 +275,7 @@ on_file_set_cb (GtkWidget *chooser,
if (GTK_IS_WIDGET (dialog->priv->custom->toggle))
gtk_widget_destroy (dialog->priv->custom->toggle);
- toggle_child (dialog->priv->box, dialog->priv->custom->overlay, dialog);
+ toggle_widget (dialog, G_OBJECT (dialog->priv->custom->overlay));
return;
}
@@ -420,13 +424,13 @@ bjb_import_dialog_constructed (GObject *obj)
/* Dialog locations to import */
- priv->box = egg_list_box_new ();
- egg_list_box_set_selection_mode (priv->box, GTK_SELECTION_NONE);
- egg_list_box_set_activate_on_single_click (priv->box, TRUE);
- egg_list_box_set_separator_funcs (priv->box, separator_func, NULL, NULL);
+ priv->box = GTK_LIST_BOX (gtk_list_box_new ());
+ gtk_list_box_set_selection_mode (priv->box, GTK_SELECTION_NONE);
+ gtk_list_box_set_activate_on_single_click (priv->box, TRUE);
+ gtk_list_box_set_header_func (priv->box, (GtkListBoxUpdateHeaderFunc) header_func, NULL, NULL);
gtk_box_pack_start (GTK_BOX (area), GTK_WIDGET (priv->box) , TRUE, FALSE, 6);
- g_signal_connect (priv->box, "child-activated",
- G_CALLBACK (toggle_child), self);
+ g_signal_connect (priv->box, "row-activated",
+ G_CALLBACK (on_row_activated_cb), self);
/* Tomboy Gnote ~/.local/share are conditional
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]