[gnome-video-arcade] Replace GvaLinkButton with GtkLabel's hyperlink feature.



commit 780108f698f8e6e18536a2ecc4de150cd2a09383
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sat Mar 6 16:08:21 2010 -0500

    Replace GvaLinkButton with GtkLabel's hyperlink feature.

 docs/reference/Makefile.am                     |    1 -
 docs/reference/gnome-video-arcade-docs.sgml    |    1 -
 docs/reference/gnome-video-arcade-sections.txt |   17 ----
 docs/reference/gnome-video-arcade.types        |    2 -
 docs/reference/tmpl/gva-link-button.sgml       |   34 -------
 maint/Makefile.am                              |    2 -
 maint/gva.xml                                  |    3 -
 maint/widget-gva-link-button.png               |  Bin 150 -> 0 bytes
 src/Makefile.am                                |    2 -
 src/gva-link-button.c                          |  122 ------------------------
 src/gva-link-button.h                          |   76 ---------------
 src/gva-properties.c                           |   38 ++++----
 12 files changed, 17 insertions(+), 281 deletions(-)
---
diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
index 89d62c5..4999116 100644
--- a/docs/reference/Makefile.am
+++ b/docs/reference/Makefile.am
@@ -100,7 +100,6 @@ GTKDOC_LIBS=							\
 	$(top_builddir)/src/gva-game-store.o			\
 	$(top_builddir)/src/gva-history.o			\
 	$(top_builddir)/src/gva-input-file.o			\
-	$(top_builddir)/src/gva-link-button.o			\
 	$(top_builddir)/src/gva-main.o				\
 	$(top_builddir)/src/gva-mame-common.o			\
 	$(top_builddir)/src/gva-mame-process.o			\
diff --git a/docs/reference/gnome-video-arcade-docs.sgml b/docs/reference/gnome-video-arcade-docs.sgml
index f0503c8..0675353 100644
--- a/docs/reference/gnome-video-arcade-docs.sgml
+++ b/docs/reference/gnome-video-arcade-docs.sgml
@@ -43,7 +43,6 @@
     <xi:include href="xml/gva-column-manager.xml"/>
     <xi:include href="xml/gva-game-store.xml"/>
     <xi:include href="xml/gva-input-file.xml"/>
-    <xi:include href="xml/gva-link-button.xml"/>
     <xi:include href="xml/gva-mame-process.xml"/>
     <xi:include href="xml/gva-music-button.xml"/>
     <xi:include href="xml/gva-mute-button.xml"/>
diff --git a/docs/reference/gnome-video-arcade-sections.txt b/docs/reference/gnome-video-arcade-sections.txt
index d1fad94..0c35ca6 100644
--- a/docs/reference/gnome-video-arcade-sections.txt
+++ b/docs/reference/gnome-video-arcade-sections.txt
@@ -156,23 +156,6 @@ gva_input_file_get_type
 </SECTION>
 
 <SECTION>
-<FILE>gva-link-button</FILE>
-<TITLE>GvaLinkButton</TITLE>
-GvaLinkButton
-gva_link_button_new
-<SUBSECTION Standard>
-GVA_LINK_BUTTON
-GVA_IS_LINK_BUTTON
-GVA_TYPE_LINK_BUTTON
-GVA_LINK_BUTTON_CLASS
-GVA_IS_LINK_BUTTON_CLASS
-GVA_LINK_BUTTON_GET_CLASS
-GvaLinkButtonClass
-<SUBSECTION Private>
-gva_link_button_get_type
-</SECTION>
-
-<SECTION>
 <FILE>gva-history</FILE>
 gva_history_init
 gva_history_lookup
diff --git a/docs/reference/gnome-video-arcade.types b/docs/reference/gnome-video-arcade.types
index 8811992..7d004bf 100644
--- a/docs/reference/gnome-video-arcade.types
+++ b/docs/reference/gnome-video-arcade.types
@@ -2,7 +2,6 @@
 #include <gva-column-manager.h>
 #include <gva-game-store.h>
 #include <gva-input-file.h>
-#include <gva-link-button.h>
 #include <gva-mame-process.h>
 #include <gva-music-button.h>
 #include <gva-mute-button.h>
@@ -13,7 +12,6 @@ gva_cell_renderer_pixbuf_get_type
 gva_column_manager_get_type
 gva_game_store_get_type
 gva_input_file_get_type
-gva_link_button_get_type
 gva_mame_process_get_type
 gva_music_button_get_type
 gva_mute_button_get_type
diff --git a/maint/Makefile.am b/maint/Makefile.am
index d573cd2..caaf2f3 100644
--- a/maint/Makefile.am
+++ b/maint/Makefile.am
@@ -5,7 +5,6 @@ gladecatalogdir = `$(PKG_CONFIG) --variable=catalogdir gladeui-1.0`
 
 gladepixmap_DATA = \
 	widget-gva-column-manager.png \
-	widget-gva-link-button.png \
 	widget-gva-mute-button.png
 gladepixmapdir = `$(PKG_CONFIG) --variable=pixmapdir gladeui-1.0`/hicolor/22x22/actions
 
@@ -18,7 +17,6 @@ libgladegva_la_CFLAGS = \
 
 libgladegva_la_SOURCES = \
 	$(top_srcdir)/src/gva-column-manager.c \
-	$(top_srcdir)/src/gva-link-button.c \
 	$(top_srcdir)/src/gva-music-button.c \
 	$(top_srcdir)/src/gva-mute-button.c
 
diff --git a/maint/gva.xml b/maint/gva.xml
index 14d46ba..0bba748 100644
--- a/maint/gva.xml
+++ b/maint/gva.xml
@@ -8,8 +8,6 @@
       </properties>
     </glade-widget-class>
 
-    <glade-widget-class name="GvaLinkButton" generic-name="link-button" title="Link Button"/>
-
     <glade-widget-class name="GvaMusicButton" generic-name="music-button" title="Music Button">
       <properties>
         <property id="game"/>
@@ -26,7 +24,6 @@
 
   <glade-widget-group name="gva-widgets" title="GNOME Video Arcade">
     <glade-widget-class-ref name="GvaColumnManager"/>
-    <glade-widget-class-ref name="GvaLinkButton"/>
     <glade-widget-class-ref name="GvaMusicButton"/>
     <glade-widget-class-ref name="GvaMuteButton"/>
   </glade-widget-group>
diff --git a/src/Makefile.am b/src/Makefile.am
index f17f72c..f39f0b5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -48,8 +48,6 @@ gnome_video_arcade_SOURCES = \
 	gva-history.h			\
 	gva-input-file.c		\
 	gva-input-file.h		\
-	gva-link-button.c		\
-	gva-link-button.h		\
 	gva-main.c			\
 	gva-main.h			\
 	gva-mame-common.c		\
diff --git a/src/gva-properties.c b/src/gva-properties.c
index 2a469df..dc49174 100644
--- a/src/gva-properties.c
+++ b/src/gva-properties.c
@@ -25,7 +25,6 @@
 #include "gva-error.h"
 #include "gva-game-store.h"
 #include "gva-history.h"
-#include "gva-link-button.h"
 #include "gva-music-button.h"
 #include "gva-preferences.h"
 #include "gva-tree-view.h"
@@ -115,19 +114,11 @@ properties_scroll_to_top (void)
 }
 
 static void
-properties_label_clicked_cb (GvaLinkButton *button,
-                             const gchar *game)
+properties_link_clicked_cb (GtkLabel *label,
+                            const gchar *game)
 {
-        GdkEvent *event;
         GtkWidget *widget;
 
-        /* Force the cursor back to normal before the button is destroyed.
-         * XXX We're passing the wrong type of event here, but it should be
-         *     okay for this particular case. */
-        event = gtk_get_current_event ();
-        g_signal_emit_by_name (button, "leave-notify-event", event);
-        gdk_event_free (event);
-
         widget = GVA_WIDGET_PROPERTIES_TECHNICAL_SCROLLED_WINDOW;
         gtk_widget_grab_focus (widget);
 
@@ -143,22 +134,27 @@ properties_add_game_label (GtkBox *box,
 {
         GtkWidget *widget;
 
+        widget = gtk_label_new (NULL);
+        gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
+
         if (available)
         {
-                widget = gva_link_button_new (description);
-                gtk_button_set_alignment (GTK_BUTTON (widget), 0.0, 0.5);
-                gtk_widget_set_tooltip_text (widget, _("Show this game"));
+                gchar *markup;
+
+                markup = g_markup_printf_escaped (
+                        "<a href=\"%s\" title=\"%s\">%s</a>",
+                        game, _("Show this game"), description);
+
+                gtk_label_set_markup (GTK_LABEL (widget), markup);
 
                 g_signal_connect (
-                        widget, "clicked",
-                        G_CALLBACK (properties_label_clicked_cb),
-                        (gpointer) g_intern_string (game));
+                        widget, "activate-link",
+                        G_CALLBACK (properties_link_clicked_cb), NULL);
+
+                g_free (markup);
         }
         else
-        {
-                widget = gtk_label_new (description);
-                gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
-        }
+                gtk_label_set_text (GTK_LABEL (widget), description);
 
         gtk_box_pack_start (box, widget, FALSE, FALSE, 0);
         gtk_widget_show (widget);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]