Updating branch refs/heads/master
         to 1592b6de9aea22296e32ff9c2d5a56910e69a865 (commit)
       from c983114f440474090940b02ad37c758de206591a (commit)

commit 1592b6de9aea22296e32ff9c2d5a56910e69a865
Author: Landry Breuil <lan...@xfce.org>
Date:   Sun Dec 30 17:59:40 2012 +0100

    Bring up-to-date with 2012 xfce standards.
    
    - port to libxfce4ui
    - build as a module
    - dont force -O0
    - use 'exo-open --launch WebBrowser' & g_spawn_command_line_async() instead
    of 'xfbrowser4' & exec_command()
    - use system-search icon for desktop file/dialog icon

 configure.ac.in                                    |   11 ++++---
 src/Makefile.am                                    |   31 +++++++------------
 src/smartbookmark.c                                |   24 ++++++---------
 ...mark.desktop.in.in => smartbookmark.desktop.in} |    4 +-
 4 files changed, 29 insertions(+), 41 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index 6bfddf2..0db20e8 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -16,17 +16,18 @@ AM_MAINTAINER_MODE()
 dnl check for basic programs
 AC_PROG_CC()
 AC_PROG_INSTALL()
-AC_PROG_LIBTOOL()
 AC_PROG_INTLTOOL()
 
+dnl Initialize libtool
+LT_PREREQ([2.2.6])
+LT_INIT([disable-static])
+
 dnl Check for i18n support
 XDT_I18N([@LINGUAS@])
 
 dnl Check for required packages
-XDT_CHECK_LIBX11_REQUIRE()
-XDT_CHECK_PACKAGE([GDK], [gdk-2.0], [2.0])
-XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.2])
-XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.3.20])
+XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.8.0])
+XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.8.0])
 
 XDT_FEATURE_DEBUG()
 
diff --git a/src/Makefile.am b/src/Makefile.am
index 406421e..47eb803 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,42 +1,35 @@
-plugindir = $(libdir)/xfce4/panel-plugins
+plugindir = $(libdir)/xfce4/panel/plugins
 
 plugin_LTLIBRARIES =                                                   \
        libsmartbookmark.la
 
 libsmartbookmark_la_LDFLAGS =                                                  
\
-       -O0             \
        -avoid-version                                                  \
        -module                                         \
+       -no-undefined \
+       -export-symbols-regex '^xfce_panel_module_(preinit|init|construct)' \
+       $(PLATFORM_LDFLAGS)
+
+libsmartbookmark_la_LIBADD = \
        @LIBXFCE4PANEL_LIBS@ \
-       @LIBXFCEGUI4_LIBS@      \
-       @GDK_LIBS@
+       @LIBXFCE4UI_LIBS@
 
 libsmartbookmark_la_SOURCES =                                                  
\
        smartbookmark.c
 
 
 libsmartbookmark_la_CFLAGS =    \
-       -O0             \
        -I$(top_srcdir) \
-       @LIBXFCEGUI4_CFLAGS@ \
+       @LIBXFCE4UI_CFLAGS@ \
        @LIBXFCE4PANEL_CFLAGS@ \
-       @GDK_CFLAGS@    \
        -DPACKAGE_LOCALE_DIR=\"$(localedir)\"
 
-desktop_in_in_files = smartbookmark.desktop.in.in
-desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in)
+desktop_in_files = smartbookmark.desktop.in
 
-desktopdir = $(datadir)/xfce4/panel-plugins
+desktopdir = $(datadir)/xfce4/panel/plugins
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
 @INTLTOOL_DESKTOP_RULE@
 
-EXTRA_DIST =                           \
-       $(desktop_in_in_files)
-
-DISTCLEANFILES =                       \
-       $(desktop_DATA) $(desktop_in_files)
+EXTRA_DIST = $(desktop_in_files)
 
-# get full path into .desktop file
-%.desktop.in: %.desktop.in.in
-       sed -e "s^@INTERNAL_PLUGIN_PATH@^$(libdir)/xfce4/panel-plugins^" \
-               $< > $@
+DISTCLEANFILES = $(desktop_DATA)
diff --git a/src/smartbookmark.c b/src/smartbookmark.c
index 17db33e..ca284b1 100644
--- a/src/smartbookmark.c
+++ b/src/smartbookmark.c
@@ -40,7 +40,7 @@
 #include <gdk/gdkx.h>
 
 #include <libxfce4util/libxfce4util.h>
-#include <libxfcegui4/dialogs.h>
+#include <libxfce4ui/libxfce4ui.h>
 #include <libxfce4panel/xfce-panel-plugin.h>
 
 /*
@@ -71,19 +71,18 @@ typedef struct {
 
 static void
 smartbookmark_construct(XfcePanelPlugin *plugin);
-XFCE_PANEL_PLUGIN_REGISTER_INTERNAL(smartbookmark_construct);
+XFCE_PANEL_PLUGIN_REGISTER(smartbookmark_construct);
 
 static gboolean do_search(const char *url, const char *keyword)
 {
     DBG ("Do search");
     gchar *execute;
     gboolean success;
-    execute = g_strconcat("xfbrowser4  \"", url, NULL);//works better for me
-    //execute = g_strconcat("x-www-browser \"", url, NULL);
+    execute = g_strconcat("exo-open --launch WebBrowser \"", url, NULL);
     execute = g_strconcat(execute, keyword, NULL);
     execute = g_strconcat(execute, "\"", NULL);
 
-    success = exec_command(execute);
+    success = g_spawn_command_line_async(execute, NULL);
     g_free(execute);
 
     return success;
@@ -285,21 +284,16 @@ static void search_create_options(XfcePanelPlugin 
*plugin, t_search *search)
     xfce_panel_plugin_block_menu(plugin);
     GtkWidget *urllabel, *textlabel, *sizelabel;
     DBG ("search_create_options");
-    search->opt_dialog  = gtk_dialog_new_with_buttons(_("Preferences"),
+    search->opt_dialog  = 
xfce_titled_dialog_new_with_buttons(_("Smartbookmark"),
                                              NULL, GTK_DIALOG_NO_SEPARATOR,
                                              GTK_STOCK_CLOSE, GTK_RESPONSE_OK,
                                              NULL);
     
+    xfce_titled_dialog_set_subtitle (XFCE_TITLED_DIALOG (search->opt_dialog), 
_("Preferences"));
+    gtk_window_set_icon_name  (GTK_WINDOW (search->opt_dialog), 
"system-search");
+
     gtk_container_set_border_width(GTK_CONTAINER (search->opt_dialog), 2);
     
-    /* header */
-    header = xfce_create_header(NULL, _("Smartbookmark"));
-    gtk_widget_set_size_request(GTK_BIN(header)->child, 200, 32);
-    gtk_container_set_border_width(GTK_CONTAINER(header), 6);
-    gtk_widget_show(header);
-    gtk_box_pack_start(GTK_BOX(GTK_DIALOG(search->opt_dialog)->vbox), header,
-                        FALSE, TRUE, 0);
-
     vbox = gtk_vbox_new(FALSE, 0);
     gtk_widget_show(vbox);
     gtk_container_add(GTK_CONTAINER(GTK_DIALOG(search->opt_dialog)->vbox), 
vbox);
@@ -330,7 +324,7 @@ static void search_create_options(XfcePanelPlugin *plugin, 
t_search *search)
     gtk_box_pack_start(GTK_BOX(hbox), sizelabel, FALSE, FALSE, 5);
 
     /* size spinner */
-    GtkObject* spinner_adj = gtk_adjustment_new (search->size, 2.0, 10.0, 1.0, 
5.0, 5.0);
+    GtkObject* spinner_adj = gtk_adjustment_new (search->size, 2.0, 10.0, 1.0, 
5.0, 0);
     search->size_spinner = gtk_spin_button_new(GTK_ADJUSTMENT(spinner_adj), 
1.0, 0);
     gtk_box_pack_start(GTK_BOX(hbox), search->size_spinner, FALSE, FALSE, 0);
     gtk_widget_show(search->size_spinner);
diff --git a/src/smartbookmark.desktop.in.in b/src/smartbookmark.desktop.in
similarity index 75%
rename from src/smartbookmark.desktop.in.in
rename to src/smartbookmark.desktop.in
index 515bf05..21d37f9 100644
--- a/src/smartbookmark.desktop.in.in
+++ b/src/smartbookmark.desktop.in
@@ -2,6 +2,6 @@
 Type=X-XFCE-PanelPlugin
 _Name=SmartBookmark
 _Comment=Query websites from the Xfce panel
-Icon=gtk-preferences
+Icon=system-search
 X-XFCE-Module=smartbookmark
-X-XFCE-Unique=false
+X-XFCE-Internal=FALSE
_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits

Reply via email to