Removed none used vb_clear_input function.
text = gtk_clipboard_wait_for_text(SECONDARY_CLIPBOARD());
}
if (text) {
- /* TODO is this the rigth place to switch the focus */
- gtk_widget_grab_focus(GTK_WIDGET(vb.gui.webview));
- vb_echo(VB_MSG_NORMAL, FALSE, "Yanked: %s", text);
+ vb_echo_force(VB_MSG_NORMAL, "Yanked: %s", text);
g_free(text);
return TRUE;
}
if (a.s) {
vb_set_clipboard(&a);
- /* TODO is this the rigth place to switch the focus */
- gtk_widget_grab_focus(GTK_WIDGET(vb.gui.webview));
- vb_echo(VB_MSG_NORMAL, FALSE, "Yanked: %s", a.s);
+ vb_echo_force(VB_MSG_NORMAL, "Yanked: %s", a.s);
g_free(a.s);
return TRUE;
vb.hints.change_handler = vb.hints.keypress_handler = 0;
- /* clear the input box - TODO move this to a better place */
- gtk_widget_grab_focus(GTK_WIDGET(vb.gui.webview));
- gtk_entry_set_text(GTK_ENTRY(vb.gui.inputbox), "");
+ /* clear the input box */
+ vb_echo_force(VB_MSG_NORMAL, FALSE, "");
}
}
static void vb_set_status(const StatusType status);
static void vb_destroy_client();
-void vb_clean_input()
+void vb_echo_force(const MessageType type, const char *error, ...)
{
- /* move focus from input box to clean it */
- gtk_widget_grab_focus(GTK_WIDGET(vb.gui.webview));
- vb_echo(VB_MSG_NORMAL, FALSE, "");
+ char message[255];
+ va_list arg_list;
+
+ va_start(arg_list, error);
+ vsnprintf(message, 255, error, arg_list);
+ va_end(arg_list);
+
+ vb_update_input_style(type);
+ gtk_entry_set_text(GTK_ENTRY(vb.gui.inputbox), message);
}
void vb_echo(const MessageType type, gboolean hide, const char *error, ...)
{
+ char message[255];
va_list arg_list;
va_start(arg_list, error);
- char message[255];
vsnprintf(message, 255, error, arg_list);
va_end(arg_list);
extern VbCore core;
/* functions */
-void vb_clean_input(void);
+void vb_echo_force(const MessageType type, const char *error, ...);
void vb_echo(const MessageType type, gboolean hide, const char *error, ...);
gboolean vb_eval_script(WebKitWebFrame* frame, char* script, char* file, char** value);
gboolean vb_load_uri(const Arg* arg);