/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2007 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2013 Hiroyuki Yamamoto and the Claws Mail team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
+#include "claws-features.h"
#endif
#include "defs.h"
#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
#include "codeconv.h"
#include "menu.h"
#include "textview.h"
+#include "main.h"
+
+extern SessionStats session_stats;
+static GtkTextBuffer *stats_text_buffer;
static GtkWidget *window;
static gchar* uri_hover = NULL;
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);
static gboolean about_textview_leave_notify(GtkWidget *widget,
GdkEventCrossing *event,
GtkWidget *textview);
+static void about_size_allocate_cb(GtkWidget *widget,
+ GtkAllocation *allocation);
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 void about_update_stats(void);
static GtkWidget *link_popupmenu;
{
if (!window)
about_create();
- else
+ else {
+ about_update_stats();
gtk_window_present(GTK_WINDOW(window));
+ }
+
}
static GtkWidget *about_create_child_page_info(void)
"website:\n"), -1);
gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, HOMEPAGE_URI, -1,
"link", NULL);
+ gtk_text_buffer_insert(buffer, &iter, _("\n\n"
+ "For support and discussion subscribe to the Claws Mail "
+ "users' mailing list:\n"),-1);
+ gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, USERS_ML_URI, -1,
+ "link", NULL);
gtk_text_buffer_insert(buffer, &iter, _("\n\n"
"Claws Mail is free software released "
- "under the GPL license. If you wish to donate "
+ "under the GPL. If you wish to donate "
"to the Claws Mail project you can do "
"so at:\n"), -1);
gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, DONATE_URI, -1,
gtk_text_buffer_create_tag(buffer, "underlined-list-title",
"underline", PANGO_UNDERLINE_SINGLE,
NULL);
-
+#ifdef GENERIC_UMPC
+ gtk_text_buffer_insert(buffer, &iter, _(
+ "\n\nCopyright (C) 1999-2013\nThe Claws Mail Team\n"
+ " and Hiroyuki Yamamoto"), -1);
+#endif
gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (_("\n\nSystem Information\n")), -1,
"underlined-list-title", NULL);
buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text));
gtk_text_buffer_get_iter_at_offset(buffer, &iter, 0);
- /* init formatting tag: indentation for list items */
+ /* init formatting tag: indentation for list items */
gtk_text_buffer_create_tag(buffer, "indented-list-item",
"indent", 8,
NULL);
gtk_text_buffer_create_tag(buffer, "bold", "weight", PANGO_WEIGHT_BOLD,
NULL);
- stock_pixbuf_gdk(window, STOCK_PIXMAP_ACTIVE, &active_pixbuf);
- stock_pixbuf_gdk(window, STOCK_PIXMAP_INACTIVE, &inactive_pixbuf);
+ stock_pixbuf_gdk(window, STOCK_PIXMAP_CHECKBOX_ON, &active_pixbuf);
+ stock_pixbuf_gdk(window, STOCK_PIXMAP_CHECKBOX_OFF, &inactive_pixbuf);
-#if INET6
+#if HAVE_LIBCOMPFACE
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, (" IPv6 "), -1,
+ gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" compface "), -1,
"bold", NULL);
gtk_text_buffer_insert(buffer, &iter,
- (gchar *)Q_("IPv6|adds support for IPv6 addresses, the new internet "
- "addressing protocol\n"), -1);
+ (gchar *)C_("compface", "adds support for the X-Face header\n"), -1);
-#if HAVE_ICONV
+#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, (" iconv "), -1,
+ gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" Enchant "), -1,
"bold", NULL);
gtk_text_buffer_insert(buffer, &iter,
- (gchar *)Q_("iconv|allows converting to and from different character sets\n"), -1);
+ (gchar *)C_("Enchant", "adds support for spell checking\n"), -1);
-#if HAVE_LIBCOMPFACE
+#if USE_GNUTLS
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, (" compface "), -1,
+ gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" GnuTLS "), -1,
"bold", NULL);
gtk_text_buffer_insert(buffer, &iter,
- (gchar *)Q_("compface|adds support for the X-Face header\n"), -1);
+ (gchar *)C_("GnuTLS", "adds support for encrypted connections to servers\n"), -1);
-#if USE_OPENSSL
+#if INET6
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,
+ gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" IPv6 "), -1,
"bold", NULL);
gtk_text_buffer_insert(buffer, &iter,
- (gchar *)Q_("OpenSSL|adds support for encrypted connections to servers\n"), -1);
+ (gchar *)C_("IPv6", "adds support for IPv6 addresses, the new Internet "
+ "addressing protocol\n"), -1);
-#if USE_LDAP
+#if HAVE_ICONV
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, (" LDAP "), -1,
+ gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" iconv "), -1,
"bold", NULL);
gtk_text_buffer_insert(buffer, &iter,
- (gchar *)Q_("LDAP|adds support for LDAP shared addressbooks\n"), -1);
+ (gchar *)C_("iconv", "allows converting to and from different character sets\n"), -1);
#if USE_JPILOT
gtk_text_buffer_insert_pixbuf(buffer, &iter, active_pixbuf);
gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" JPilot "), -1,
"bold", NULL);
gtk_text_buffer_insert(buffer, &iter,
- (gchar *)Q_("JPilot|adds support for PalmOS addressbooks\n"), -1);
+ (gchar *)C_("JPilot", "adds support for PalmOS addressbooks\n"), -1);
-#if USE_ASPELL
+#if USE_LDAP
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, (" LDAP "), -1,
"bold", NULL);
gtk_text_buffer_insert(buffer, &iter,
- (gchar *)Q_("GNU/aspell|adds support for spell checking\n"), -1);
+ (gchar *)C_("LDAP", "adds support for LDAP shared addressbooks\n"), -1);
#if HAVE_LIBETPAN
gtk_text_buffer_insert_pixbuf(buffer, &iter, active_pixbuf);
gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" libetpan "), -1,
"bold", NULL);
gtk_text_buffer_insert(buffer, &iter,
- (gchar *)Q_("libetpan|adds support for IMAP servers\n"), -1);
+ (gchar *)C_("libetpan", "adds support for IMAP and NNTP servers\n"), -1);
-#if USE_GNOMEPRINT
+#if HAVE_LIBSM
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, (" libgnomeprint "), -1,
+ gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" libSM "), -1,
"bold", NULL);
gtk_text_buffer_insert(buffer, &iter,
- (gchar *)Q_("libgnomeprint|adds support for a complete print dialog\n"), -1);
+ (gchar *)C_("libSM", "adds support for session handling\n"), -1);
-#if HAVE_LIBSM
+#if HAVE_NETWORKMANAGER_SUPPORT
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, (" libSM "), -1,
+ gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" NetworkManager "), -1,
"bold", NULL);
- gtk_text_buffer_insert(buffer, &iter,
- (gchar *)Q_("libSM|adds support for session handling\n"), -1);
+ gtk_text_buffer_insert(buffer, &iter,
+ (gchar *)C_("NetworkManager", "adds support for detection of network connection changes\n"), -1);
return scrolledwin;
}
gtk_text_buffer_insert(buffer, &iter,
_("This program is free software; you can redistribute it and/or modify "
"it under the terms of the GNU General Public License as published by "
- "the Free Software Foundation; either version 2, or (at your option) "
+ "the Free Software Foundation; either version 3, or (at your option) "
"any later version.\n\n"), -1);
gtk_text_buffer_insert(buffer, &iter,
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. "
"See the GNU General Public License for more details.\n\n"), -1);
- gtk_text_buffer_insert(buffer, &iter,
- _("You should have received a copy of the GNU General Public License "
- "along with this program; if not, write to the Free Software "
- "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, "
- "MA 02110-1301, USA.\n\n"), -1);
-#ifdef USE_OPENSSL
/* textview link style (based upon main prefs) */
gtkut_convert_int_to_gdk_color(prefs_common.uri_col,
(GdkColor*)&uri_color);
NULL);
gtk_text_buffer_insert(buffer, &iter,
- _("This product includes software developed by the OpenSSL Project "
- "for use in the OpenSSL Toolkit ("), -1);
- gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, OPENSSL_URI, -1,
+ _("You should have received a copy of the GNU General Public License "
+ "along with this program. If not, see <"), -1);
+ gtk_text_buffer_insert_with_tags_by_name(buffer, &iter,
+ "http://www.gnu.org/licenses/", -1,
"link", NULL);
- gtk_text_buffer_insert(buffer, &iter, _(").\n"), -1);
+ gtk_text_buffer_insert(buffer, &iter, _(">. \n\n"), -1);
g_signal_connect(G_OBJECT(tag), "event",
G_CALLBACK(about_textview_uri_clicked), text);
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;
}
return scrolledwin;
}
+static GtkWidget *about_create_child_page_session_stats(void)
+{
+ GtkWidget *scrolledwin;
+ GtkWidget *text;
+ GtkTextIter iter;
+
+ scrolledwin = gtk_scrolled_window_new(NULL, NULL);
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwin),
+ GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+ gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledwin),
+ GTK_SHADOW_IN);
+ text = gtk_text_view_new();
+ gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE);
+ gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
+ gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text), 6);
+ gtk_text_view_set_right_margin(GTK_TEXT_VIEW(text), 6);
+ gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(text), FALSE);
+ gtk_container_add(GTK_CONTAINER(scrolledwin), text);
+
+ stats_text_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text));
+
+ gtk_text_buffer_get_iter_at_offset(stats_text_buffer, &iter, 0);
+ gtk_text_buffer_create_tag(stats_text_buffer, "indented-list-item",
+ "indent", 8,
+ NULL);
+ gtk_text_buffer_create_tag(stats_text_buffer, "underlined-list-title",
+ "underline", PANGO_UNDERLINE_SINGLE,
+ NULL);
+ gtk_text_buffer_create_tag(stats_text_buffer, "bold", "weight", PANGO_WEIGHT_BOLD,
+ NULL);
+
+ about_update_stats();
+
+ return scrolledwin;
+}
+
+static void about_update_stats(void)
+{
+ if (stats_text_buffer != NULL)
+ {
+ GtkTextIter start, end, iter;
+ gchar buf[1024];
+
+ gtk_text_buffer_get_start_iter(stats_text_buffer, &start);
+ gtk_text_buffer_get_end_iter(stats_text_buffer, &end);
+ gtk_text_buffer_delete(stats_text_buffer, &start, &end);
+
+ gtk_text_buffer_get_iter_at_offset(stats_text_buffer, &iter, 0);
+
+ gtk_text_buffer_insert_with_tags_by_name(stats_text_buffer, &iter,
+ (_("Session statistics\n")), -1,
+ "underlined-list-title", NULL);
+
+ if (prefs_common.date_format) {
+ struct tm *lt;
+ gint len = 100;
+ gchar date[len];
+
+ lt = localtime(&session_stats.time_started);
+ fast_strftime(date, len, prefs_common.date_format, lt);
+ g_snprintf(buf, sizeof(buf), _("Started: %s\n"),
+ lt ? date : ctime(&session_stats.time_started));
+ } else
+ g_snprintf(buf, sizeof(buf), _("Started: %s\n"),
+ ctime(&session_stats.time_started));
+ gtk_text_buffer_insert_with_tags_by_name(stats_text_buffer, &iter, buf, -1,
+ "indented-list-item", NULL);
+
+ gtk_text_buffer_insert(stats_text_buffer, &iter, "\n", 1);
+ gtk_text_buffer_insert_with_tags_by_name(stats_text_buffer, &iter,
+ (_("Incoming traffic\n")), -1,
+ "underlined-list-title", NULL);
+
+ g_snprintf(buf, sizeof(buf), _("Received messages: %d\n"),
+ session_stats.received);
+ gtk_text_buffer_insert_with_tags_by_name(stats_text_buffer, &iter, buf, -1,
+ "indented-list-item", "bold", NULL);
+
+ gtk_text_buffer_insert(stats_text_buffer, &iter, "\n", 1);
+ gtk_text_buffer_insert_with_tags_by_name(stats_text_buffer, &iter,
+ (_("Outgoing traffic\n")), -1,
+ "underlined-list-title", NULL);
+
+ g_snprintf(buf, sizeof(buf), _("New/redirected messages: %d\n"),
+ session_stats.sent);
+ gtk_text_buffer_insert_with_tags_by_name(stats_text_buffer, &iter, buf, -1,
+ "indented-list-item", NULL);
+
+ g_snprintf(buf, sizeof(buf), _("Replied messages: %d\n"),
+ session_stats.replied);
+ gtk_text_buffer_insert_with_tags_by_name(stats_text_buffer, &iter, buf, -1,
+ "indented-list-item", NULL);
+
+ g_snprintf(buf, sizeof(buf), _("Forwarded messages: %d\n"),
+ session_stats.forwarded);
+ gtk_text_buffer_insert_with_tags_by_name(stats_text_buffer, &iter, buf, -1,
+ "indented-list-item", NULL);
+
+ g_snprintf(buf, sizeof(buf), _("Total outgoing messages: %d\n"),
+ (session_stats.sent + session_stats.replied +
+ session_stats.forwarded));
+ gtk_text_buffer_insert_with_tags_by_name(stats_text_buffer, &iter, buf, -1,
+ "indented-list-item", "bold", NULL);
+ }
+}
+
static void about_create(void)
{
GtkWidget *vbox1;
GtkWidget *close_button;
static GdkGeometry geometry;
+ stats_text_buffer = NULL;
+
window = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "about");
+ gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER_ALWAYS);
gtk_window_set_title(GTK_WINDOW(window), _("About Claws Mail"));
gtk_container_set_border_width(GTK_CONTAINER(window), 8);
gtk_widget_set_size_request(window, -1, -1);
+ g_signal_connect(G_OBJECT(window), "size_allocate",
+ G_CALLBACK(about_size_allocate_cb), NULL);
+ g_signal_connect(G_OBJECT(window), "size_allocate",
+ G_CALLBACK(about_size_allocate_cb), NULL);
g_signal_connect(G_OBJECT(window), "delete_event",
G_CALLBACK(gtk_widget_hide_on_delete), NULL);
g_signal_connect(G_OBJECT(window), "key_press_event",
G_CALLBACK(key_pressed), NULL);
- gtk_widget_realize(window);
-
+
if (!geometry.min_width) {
geometry.min_width = 450;
geometry.min_height = 500;
gtk_window_set_geometry_hints(GTK_WINDOW(window), NULL, &geometry,
GDK_HINT_MIN_SIZE);
+ gtk_window_set_default_size(GTK_WINDOW(window), prefs_common.aboutwin_width,
+ prefs_common.aboutwin_height);
+
+ gtk_widget_realize(window);
vbox1 = gtk_vbox_new(FALSE, 8);
gtk_container_add(GTK_CONTAINER(window), vbox1);
gtk_box_pack_start(GTK_BOX(vbox2), label, FALSE, FALSE, 0);
markup = g_markup_printf_escaped
("<span weight=\"bold\" size=\"xx-large\">Claws Mail</span>\nversion %s",
- VERSION);
+ VERSION_GIT_FULL);
gtk_label_set_markup(GTK_LABEL(label), markup);
g_free(markup);
button = gtkut_get_link_btn(window, HOMEPAGE_URI, " "HOMEPAGE_URI" ");
gtk_box_pack_start(GTK_BOX(vbox2), button, FALSE, FALSE, 0);
-
+#ifndef GENERIC_UMPC
label = gtk_label_new
- (_("Copyright (C) 1999-2007\nHiroyuki Yamamoto <hiro-y@kcn.ne.jp>\n"
- "and the Claws Mail team"));
+ (_("Copyright (C) 1999-2013\nThe Claws Mail Team\n"
+ "and Hiroyuki Yamamoto"));
gtk_label_set_selectable(GTK_LABEL(label), TRUE);
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER);
gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
gtk_box_pack_start(GTK_BOX(vbox2), label, FALSE, FALSE, 0);
-
+#endif
notebook = gtk_notebook_new();
gtk_widget_set_size_request(notebook, -1, 220);
gtk_widget_show(notebook);
gtk_label_new_with_mnemonic(_("_Release Notes")));
}
+ if ((scrolledwin = about_create_child_page_session_stats()) != NULL) {
+ gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
+ scrolledwin,
+ gtk_label_new_with_mnemonic(_("_Statistics")));
+ }
+
gtk_box_pack_start(GTK_BOX(vbox1), notebook, TRUE, TRUE, 0);
gtkut_stock_button_set_create(&confirm_area, &close_button, GTK_STOCK_CLOSE,
static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event)
{
- if (event && event->keyval == GDK_Escape)
+ if (event && event->keyval == GDK_KEY_Escape)
gtk_widget_hide(window);
return FALSE;
}
+static void about_size_allocate_cb(GtkWidget *widget,
+ GtkAllocation *allocation)
+{
+ cm_return_if_fail(allocation != NULL);
+
+ prefs_common.aboutwin_width = allocation->width;
+ prefs_common.aboutwin_height = allocation->height;
+}
+
+
static gboolean about_textview_uri_clicked(GtkTextTag *tag, GObject *obj,
GdkEvent *event, GtkTextIter *iter,
GtkWidget *textview)
}
/* open link and do *not* return TRUE so that
further gtk processing of the signal is done */
- open_uri(link, prefs_common.uri_cmd);
+ open_uri(link, prefs_common_get_uri_cmd());
} 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);
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.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)
{
about_textview_uri_update(textview, event->x, event->y);
- gdk_window_get_pointer(widget->window, NULL, NULL, NULL);
+ gdk_window_get_pointer(gtk_widget_get_window(widget), NULL, NULL, NULL);
return FALSE;
}