static gboolean hide_message();
static void set_status(const StatusType status);
static void inputbox_print(gboolean force, const MessageType type, gboolean hide, const char *message);
-static void destroy_client();
void vb_echo_force(const MessageType type, gboolean hide, const char *error, ...)
{
static void destroy_window_cb(GtkWidget *widget)
{
- destroy_client();
+ const char *uri = GET_URI();
+ /* write last URL into file for recreation */
+ if (uri) {
+ g_file_set_contents(vb.files[FILES_CLOSED], uri, -1, NULL);
+ }
+
+ completion_clean();
+
+ webkit_web_view_stop_loading(vb.gui.webview);
+ gtk_widget_destroy(GTK_WIDGET(vb.gui.webview));
+ gtk_widget_destroy(GTK_WIDGET(vb.gui.scroll));
+ gtk_widget_destroy(GTK_WIDGET(vb.gui.box));
+ gtk_widget_destroy(GTK_WIDGET(vb.gui.window));
+
+ command_cleanup();
+ setting_cleanup();
+ keybind_cleanup();
+ shortcut_cleanup();
+ history_cleanup();
+
+ for (int i = 0; i < FILES_LAST; i++) {
+ g_free(vb.files[i]);
+ }
+
+ gtk_main_quit();
}
static void inputbox_activate_cb(GtkEntry *entry)
vb_update_statusbar();
}
-static void destroy_client()
-{
- const char *uri = GET_URI();
- /* write last URL into file for recreation */
- if (uri) {
- g_file_set_contents(vb.files[FILES_CLOSED], uri, -1, NULL);
- }
-
- completion_clean();
-
- webkit_web_view_stop_loading(vb.gui.webview);
- gtk_widget_destroy(GTK_WIDGET(vb.gui.webview));
- gtk_widget_destroy(GTK_WIDGET(vb.gui.scroll));
- gtk_widget_destroy(GTK_WIDGET(vb.gui.box));
- gtk_widget_destroy(GTK_WIDGET(vb.gui.window));
-
- command_cleanup();
- setting_cleanup();
- keybind_cleanup();
- shortcut_cleanup();
- history_cleanup();
-
- for (int i = 0; i < FILES_LAST; i++) {
- g_free(vb.files[i]);
- }
-
- gtk_main_quit();
-}
-
int main(int argc, char *argv[])
{
static char *winid = NULL;