2008-10-09 [colin] 3.6.0cvs21
[claws.git] / src / gtk / about.c
index 9d0cbf29232612d30d46129377e38db56291c6db..564519a6691d1190666d7752128501bcfaa981dc 100644 (file)
 #include <glib.h>
 #include <glib/gi18n.h>
 #include <gdk/gdkkeysyms.h>
-#include <gtk/gtkwidget.h>
-#include <gtk/gtkwindow.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkvbox.h>
-#include <gtk/gtkhbox.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtkhseparator.h>
-#include <gtk/gtkscrolledwindow.h>
-#include <gtk/gtktext.h>
-#include <gtk/gtkbutton.h>
+#include <gtk/gtk.h>
 #if HAVE_SYS_UTSNAME_H
 #  include <sys/utsname.h>
 #endif
@@ -64,8 +55,6 @@ static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event);
 static gboolean about_textview_uri_clicked(GtkTextTag *tag, GObject *obj,
                                        GdkEvent *event, GtkTextIter *iter,
                                        GtkWidget *textview);
-static void about_open_link_cb(GtkWidget *widget, guint action, void *data);
-static void about_copy_link_cb(GtkWidget *widget, guint action, void *data);
 static gboolean about_textview_motion_notify(GtkWidget *widget,
                                        GdkEventMotion *event,
                                        GtkWidget *textview);
@@ -74,12 +63,6 @@ static gboolean about_textview_leave_notify(GtkWidget *widget,
                                        GtkWidget *textview);
 static void about_textview_uri_update(GtkWidget *textview, gint x, gint y);
 
-static GtkItemFactoryEntry textview_link_popup_entries[] = 
-{
-       {N_("/_Open with Web browser"), NULL, about_open_link_cb, 0, NULL},
-       {N_("/Copy this _link"),        NULL, about_copy_link_cb, 0, NULL},
-};
-
 static GtkWidget *link_popupmenu;
 
 
@@ -422,15 +405,15 @@ static GtkWidget *about_create_child_page_features(void)
        gtk_text_buffer_insert(buffer, &iter, 
                (gchar *)Q_("compface|adds support for the X-Face header\n"), -1);
 
-#if USE_ASPELL
+#if USE_ENCHANT
        gtk_text_buffer_insert_pixbuf(buffer, &iter, active_pixbuf);
 #else
        gtk_text_buffer_insert_pixbuf(buffer, &iter, inactive_pixbuf);
 #endif
-       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" GNU/aspell "), -1,
+       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" Enchant "), -1,
                                                 "bold", NULL);
        gtk_text_buffer_insert(buffer, &iter, 
-               (gchar *)Q_("GNU/aspell|adds support for spell checking\n"), -1);
+               (gchar *)Q_("Enchant|adds support for spell checking\n"), -1);
 
 #if USE_GNUTLS
        gtk_text_buffer_insert_pixbuf(buffer, &iter, active_pixbuf);
@@ -533,16 +516,6 @@ static GtkWidget *about_create_child_page_features(void)
        gtk_text_buffer_insert(buffer, &iter,
                (gchar *)Q_("NetworkManager|adds support for detection of network connection changes\n"), -1);
 
-#if USE_OPENSSL
-       gtk_text_buffer_insert_pixbuf(buffer, &iter, active_pixbuf);
-#else
-       gtk_text_buffer_insert_pixbuf(buffer, &iter, inactive_pixbuf);
-#endif
-       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" OpenSSL "), -1,
-                                                "bold", NULL);
-       gtk_text_buffer_insert(buffer, &iter, 
-               (gchar *)Q_("OpenSSL|adds support for encrypted connections to servers\n"), -1);
-
        return scrolledwin;
 }
 
@@ -610,6 +583,7 @@ static GtkWidget *about_create_child_page_license(void)
        gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, OPENSSL_URI, -1,
                "link", NULL);
        gtk_text_buffer_insert(buffer, &iter, _(").\n"), -1);
+#endif
 
        g_signal_connect(G_OBJECT(tag), "event",
                                G_CALLBACK(about_textview_uri_clicked), text);
@@ -617,7 +591,6 @@ static GtkWidget *about_create_child_page_license(void)
                         G_CALLBACK(about_textview_motion_notify), text);
        g_signal_connect(G_OBJECT(text), "leave-notify-event",
                                G_CALLBACK(about_textview_leave_notify), text);
-#endif
 
        return scrolledwin;
 }
@@ -862,19 +835,12 @@ static gboolean about_textview_uri_clicked(GtkTextTag *tag, GObject *obj,
 
        } else {
                if (bevent->button == 3 && event->type == GDK_BUTTON_PRESS) {
-                       GtkItemFactory *link_popupfactory;
-                       gint n_entries;
-
-                       n_entries = sizeof(textview_link_popup_entries) /
-                                       sizeof(textview_link_popup_entries[0]);
-                       link_popupmenu = menu_create_items(
-                                                       textview_link_popup_entries, n_entries,
-                                               "<UriPopupMenu>", &link_popupfactory,
-                                               textview);
+                       link_popupmenu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(
+                               gtk_ui_manager_get_widget(gtkut_ui_manager(), "/Menus/TextviewPopupLink")));
 
                        g_object_set_data(
                                        G_OBJECT(link_popupmenu),
-                                       "menu_button", link);
+                                       "raw_url", link);
                        gtk_menu_popup(GTK_MENU(link_popupmenu), 
                                        NULL, NULL, NULL, NULL, 
                                        bevent->button, bevent->time);
@@ -885,34 +851,6 @@ static gboolean about_textview_uri_clicked(GtkTextTag *tag, GObject *obj,
        return FALSE;
 }
 
-static void about_open_link_cb(GtkWidget *widget, guint action, void *data)
-{
-       gchar *link = g_object_get_data(G_OBJECT(link_popupmenu),
-                                          "menu_button");
-
-       if (link == NULL) {
-               return;
-       }
-
-       open_uri(link, prefs_common_get_uri_cmd());
-       g_object_set_data(G_OBJECT(link_popupmenu), "menu_button",
-                         NULL);
-}
-
-static void about_copy_link_cb(GtkWidget *widget, guint action, void *data)
-{
-       gchar *link = g_object_get_data(G_OBJECT(link_popupmenu),
-                                          "menu_button");
-
-       if (link == NULL) {
-               return;
-       }
-
-       gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_PRIMARY), link, -1);
-       gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), link, -1);
-       g_object_set_data(G_OBJECT(link_popupmenu), "menu_button", NULL);
-}
-
 static gboolean about_textview_motion_notify(GtkWidget *widget,
                                        GdkEventMotion *event,
                                        GtkWidget *textview)