[Xfce4-commits] [panel-plugins/xfce4-calculator-plugin] 01/01: Port to libxfce4ui.

noreply at xfce.org noreply at xfce.org
Mon Aug 3 23:28:10 CEST 2015


This is an automated email from the git hooks/post-receive script.

roland pushed a commit to branch master
in repository panel-plugins/xfce4-calculator-plugin.

commit d4d5cdc758e3b19b1f9c03faf1f58e7a1f8cdfc9
Author: Roland Kuebert <roland.kuebert at gmail.com>
Date:   Mon Aug 3 23:28:05 2015 +0200

    Port to libxfce4ui.
---
 configure.in.in           |    6 +++---
 panel-plugin/Makefile.am  |    4 ++--
 panel-plugin/calculator.c |   39 +++++++++++++++++++++++++++++++++++----
 3 files changed, 40 insertions(+), 9 deletions(-)

diff --git a/configure.in.in b/configure.in.in
index 3306c72..c4d5584 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -68,9 +68,9 @@ dnl ***********************************
 dnl *** Check for required packages ***
 dnl ***********************************
 XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.6.0])
-XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.3.99.2])
-XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.3.99.2])
-XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.3.99.2])
+XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.8.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.8.0])
+XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.8.0])
 
 dnl ***********************************
 dnl *** Check for debugging support ***
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index 5365428..3865199 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -35,13 +35,13 @@ calctest_SOURCES =							\
 
 xfce4_calculator_plugin_CFLAGS =					\
 	$(LIBXFCE4UTIL_CFLAGS)						\
-	$(LIBXFCEGUI4_CFLAGS)						\
+	$(LIBXFCE4UI_CFLAGS)						\
 	$(LIBXFCE4PANEL_CFLAGS)						\
 	$(PLATFORM_CFLAGS)
 
 xfce4_calculator_plugin_LDADD =						\
 	$(LIBXFCE4UTIL_LIBS)						\
-	$(LIBXFCEGUI4_LIBS)						\
+	$(LIBXFCE4UI_LIBS)						\
 	$(LIBXFCE4PANEL_LIBS)
 
 calctest_CFLAGS = $(xfce4_calculator_plugin_CFLAGS)
diff --git a/panel-plugin/calculator.c b/panel-plugin/calculator.c
index 335c705..9aeecab 100644
--- a/panel-plugin/calculator.c
+++ b/panel-plugin/calculator.c
@@ -26,7 +26,7 @@
 #include <locale.h>
 #include <gtk/gtk.h>
 #include <libxfce4util/libxfce4util.h>
-#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4ui/libxfce4ui.h>
 #include <libxfce4panel/xfce-panel-plugin.h>
 #include <libxfce4panel/xfce-hvbox.h>
 #include "parsetree.h"
@@ -145,7 +145,7 @@ static void entry_enter_cb(GtkEntry *entry, CalcPlugin *calc)
     input = gtk_entry_get_text(entry);
     parsetree = build_parse_tree(input, &err);
     if (err) {
-        xfce_err("Calculator error: %s", err->message);
+		xfce_dialog_show_error (NULL, NULL, "Calculator error: %s", err->message);
         g_error_free(err);
         free_parsetree(parsetree);
         return;
@@ -374,7 +374,7 @@ static void calc_configure(XfcePanelPlugin *plugin, CalcPlugin *calc)
                      G_CALLBACK(calc_dialog_response), calc);
 
 
-	frame = xfce_create_framebox(_("Appearance"), &bin);
+	frame = xfce_gtk_frame_box_new (_("Appearance"), &bin);
 
 	gtk_container_set_border_width(GTK_CONTAINER(frame), 6);
 	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), frame, TRUE, TRUE, 0);
@@ -397,7 +397,7 @@ static void calc_configure(XfcePanelPlugin *plugin, CalcPlugin *calc)
                      G_CALLBACK(calc_plugin_size_changed), calc);
 
 
-    frame = xfce_create_framebox (_("History"), &bin);
+    frame = xfce_gtk_frame_box_new (_("History"), &bin);
 
     gtk_container_set_border_width(GTK_CONTAINER (frame), 6);
     gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), frame, TRUE, TRUE, 0);
@@ -422,6 +422,31 @@ static void calc_configure(XfcePanelPlugin *plugin, CalcPlugin *calc)
 
 }
 
+void calc_about (XfcePanelPlugin *plugin)
+{
+       GdkPixbuf *icon;
+   const gchar *authors[] = {
+      "Erik Edelmann <erik.edelmann at iki.fi>",
+      "Adrian Dimitrov <enzo_01 at abv.bg>", NULL };
+   icon = xfce_panel_pixbuf_from_source("xfce4-calculator-plugin", NULL, 32);
+   gtk_show_about_dialog(NULL,
+      "logo", icon,
+      "license", xfce_get_license_text (XFCE_LICENSE_TEXT_GPL),
+      "version", PACKAGE_VERSION,
+      "program-name", PACKAGE_NAME,
+      "comments", _("Calculator for XFCE panel"),
+      "website", "https://github.com/erike/xfce4-calculator-plugin",
+      "copyright", _("Copyright (c) 2003-2015\n"),
+      "authors", authors, NULL);
+
+   if(icon)
+      g_object_unref(G_OBJECT(icon));
+
+}
+
+
+
+
 
 static void calc_construct(XfcePanelPlugin *plugin)
 {
@@ -453,6 +478,12 @@ static void calc_construct(XfcePanelPlugin *plugin)
     g_signal_connect(G_OBJECT(plugin), "configure-plugin",
                      G_CALLBACK(calc_configure), calc);
 
+	/* Show the about menu item and connect signal */
+	xfce_panel_plugin_menu_show_about (plugin);
+	g_signal_connect (G_OBJECT (plugin), "about",
+		G_CALLBACK (calc_about), calc);
+
+
 
     // Add controls for choosing angle unit to the menu.
     degrees = gtk_radio_menu_item_new_with_label(

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list