1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-29 04:45:57 -04:00

paste texts are themeable now.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3171 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2003-11-17 14:09:15 +00:00 committed by cras
parent 8c717cd73b
commit f02d35a8de
3 changed files with 27 additions and 9 deletions

View File

@ -19,6 +19,7 @@
*/ */
#include "module.h" #include "module.h"
#include "module-formats.h"
#include "signals.h" #include "signals.h"
#include "misc.h" #include "misc.h"
#include "settings.h" #include "settings.h"
@ -226,6 +227,7 @@ static void paste_flush(int send)
static gboolean paste_timeout(gpointer data) static gboolean paste_timeout(gpointer data)
{ {
GTimeVal now; GTimeVal now;
char *str;
int diff; int diff;
if (paste_state == 0) { if (paste_state == 0) {
@ -249,13 +251,17 @@ static gboolean paste_timeout(gpointer data)
} else if (!paste_prompt) { } else if (!paste_prompt) {
paste_prompt = TRUE; paste_prompt = TRUE;
paste_old_prompt = g_strdup(active_entry->prompt); paste_old_prompt = g_strdup(active_entry->prompt);
printtext_window(active_win, MSGLEVEL_CLIENTNOTICE, printformat_window(active_win, MSGLEVEL_CLIENTNOTICE,
"Pasting %u lines to %s. Press Ctrl-O if you wish to do this or Ctrl-C to cancel.", TXT_PASTE_WARNING,
paste_line_count, paste_line_count,
active_win->active == NULL ? "window" : active_win->active == NULL ? "window" :
active_win->active->visible_name); active_win->active->visible_name);
gui_entry_set_prompt(active_entry, "Hit Ctrl-O to paste, Ctrl-C to abort?");
str = format_get_text(MODULE_NAME, active_win, NULL, NULL,
TXT_PASTE_PROMPT, 0, 0);
gui_entry_set_prompt(active_entry, str);
gui_entry_set_text(active_entry, ""); gui_entry_set_text(active_entry, "");
g_free(str);
} }
return TRUE; return TRUE;
} }

View File

@ -65,12 +65,17 @@ FORMAT_REC gui_text_formats[] =
{ "statusbar_info_item_footer", "", 0 }, { "statusbar_info_item_footer", "", 0 },
{ "statusbar_info_item_name", "%# : $[35]0 $[9]1 $2", 3, { 0, 1, 0 } }, { "statusbar_info_item_name", "%# : $[35]0 $[9]1 $2", 3, { 0, 1, 0 } },
{ "statusbar_not_found", "Statusbar doesn't exist: $0", 1, { 0 } }, { "statusbar_not_found", "Statusbar doesn't exist: $0", 1, { 0 } },
{ "statusbar_not_found", "Statusbar doesn't exist: $0", 1, { 0 } },
{ "statusbar_item_not_found", "Statusbar item doesn't exist: $0", 1, { 0 } }, { "statusbar_item_not_found", "Statusbar item doesn't exist: $0", 1, { 0 } },
{ "statusbar_unknown_command", "Unknown statusbar command: $0", 1, { 0 } }, { "statusbar_unknown_command", "Unknown statusbar command: $0", 1, { 0 } },
{ "statusbar_unknown_type", "Statusbar type must be 'window' or 'root'", 1, { 0 } }, { "statusbar_unknown_type", "Statusbar type must be 'window' or 'root'", 1, { 0 } },
{ "statusbar_unknown_placement", "Statusbar placement must be 'top' or 'bottom'", 1, { 0 } }, { "statusbar_unknown_placement", "Statusbar placement must be 'top' or 'bottom'", 1, { 0 } },
{ "statusbar_unknown_visibility", "Statusbar visibility must be 'always', 'active' or 'inactive'", 1, { 0 } }, { "statusbar_unknown_visibility", "Statusbar visibility must be 'always', 'active' or 'inactive'", 1, { 0 } },
/* ---- */
{ NULL, "Pasting", 0 },
{ "paste_warning", "Pasting lines to. Press Ctrl-O if you wish to do this or Ctrl-C to cancel.", 2, { 1, 0 } },
{ "paste_prompt", "Hit Ctrl-O to paste, Ctrl-C to abort?", 0 },
{ NULL, NULL, 0 } { NULL, NULL, 0 }
}; };

View File

@ -44,7 +44,14 @@ enum {
TXT_STATUSBAR_UNKNOWN_COMMAND, TXT_STATUSBAR_UNKNOWN_COMMAND,
TXT_STATUSBAR_UNKNOWN_TYPE, TXT_STATUSBAR_UNKNOWN_TYPE,
TXT_STATUSBAR_UNKNOWN_PLACEMENT, TXT_STATUSBAR_UNKNOWN_PLACEMENT,
TXT_STATUSBAR_UNKNOWN_VISIBILITY TXT_STATUSBAR_UNKNOWN_VISIBILITY,
TXT_FILL_4,
TXT_PASTE_WARNING,
TXT_PASTE_PROMPT,
TXT_COUNT
}; };
extern FORMAT_REC gui_text_formats[]; extern FORMAT_REC gui_text_formats[TXT_COUNT+1];