summary refs log tree commit diff stats
path: root/src/fe-gtk/menu.c
diff options
context:
space:
mode:
authorRichardHitt <rbh00@netcom.com>2014-04-02 16:09:13 -0700
committerRichardHitt <rbh00@netcom.com>2014-04-02 16:14:45 -0700
commit0f828dd74f9ea81fe70c8a101a7aa7c40737437a (patch)
tree2e94607cdf2fc775e8e909f8a750ea513099afdf /src/fe-gtk/menu.c
parent5e8bc980e101f06b452d840569e255b01b220134 (diff)
Add marker-line functionality for scrollback, instant seek.
Fixes #662.
Diffstat (limited to 'src/fe-gtk/menu.c')
-rw-r--r--src/fe-gtk/menu.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/fe-gtk/menu.c b/src/fe-gtk/menu.c
index d0c4e95b..658f1c3e 100644
--- a/src/fe-gtk/menu.c
+++ b/src/fe-gtk/menu.c
@@ -42,6 +42,7 @@
 #include "../common/servlist.h"
 #include "../common/notify.h"
 #include "../common/util.h"
+#include "../common/text.h"
 #include "xtext.h"
 #include "ascii.h"
 #include "banlist.h"
@@ -1282,6 +1283,36 @@ menu_resetmarker (GtkWidget * wid, gpointer none)
 }
 
 static void
+menu_movetomarker (GtkWidget *wid, gpointer none)
+{
+	marker_reset_reason reason;
+	char *str;
+
+	if (!prefs.hex_text_show_marker)
+		PrintText (current_sess, _("Marker line disabled."));
+	else
+	{
+		reason = gtk_xtext_moveto_marker_pos (GTK_XTEXT (current_sess->gui->xtext));
+		switch (reason) {
+		case MARKER_WAS_NEVER_SET:
+			str = _("Marker line never set."); break;
+		case MARKER_IS_SET:
+			str = ""; break;
+		case MARKER_RESET_MANUALLY:
+			str = _("Marker line reset manually."); break;
+		case MARKER_RESET_BY_KILL:
+			str = _("Marker line reset because exceeded scrollback limit."); break;
+		case MARKER_RESET_BY_CLEAR:
+			str = _("Marker line reset by CLEAR command."); break;
+		default:
+			str = _("Marker line state unknown."); break;
+		}
+		if (str[0])
+			PrintText (current_sess, str);
+	}
+}
+
+static void
 menu_copy_selection (GtkWidget * wid, gpointer none)
 {
 	gtk_xtext_copy_selection (GTK_XTEXT (current_sess->gui->xtext));
@@ -1789,6 +1820,7 @@ static struct mymenu mymenu[] = {
 	{N_("URL Grabber..."), url_opengui, 0, M_MENUITEM, 0, 0, 1},
 	{0, 0, 0, M_SEP, 0, 0, 0},
 	{N_("Reset Marker Line"), menu_resetmarker, 0, M_MENUITEM, 0, 0, 1, GDK_KEY_m},
+	{N_("Move to Marker Line"), menu_movetomarker, 0, M_MENUITEM, 0, 0, 1, GDK_KEY_M},
 	{N_("_Copy Selection"), menu_copy_selection, 0, M_MENUITEM, 0, 0, 1, GDK_KEY_C},
 	{N_("C_lear Text"), menu_flushbuffer, GTK_STOCK_CLEAR, M_MENUSTOCK, 0, 0, 1},
 	{N_("Save Text..."), menu_savebuffer, GTK_STOCK_SAVE, M_MENUSTOCK, 0, 0, 1},