Added :quit! to force quit even when there are still running downloads.
Pass the next key press directly to gtk.
.TP
.B CTRL\-Q
-Quit the browser.
+Quit the browser if there are no running downloads.
.SS Navigation
.TP
.B o
can therefor contain '~/', '${ENV}' and '~user' pattern.
.TP
.B :q[uit]
-Close the browser.
+Close the browser. This will be refused if there are running downloads.
+.TP
+.B :q[uit]!
+Close the browser independent from an running download.
.TP
.BI :e[val] " JAVASCRIPT"
Runs the given \fIJAVASCRIPT\fP in the current page and display the evaluated
{"normal", EX_NORMAL, ex_normal, EX_FLAG_BANG|EX_FLAG_LHS},
{"nunmap", EX_NUNMAP, ex_unmap, EX_FLAG_LHS},
{"open", EX_OPEN, ex_open, EX_FLAG_RHS},
- {"quit", EX_QUIT, ex_quit, EX_FLAG_NONE},
+ {"quit", EX_QUIT, ex_quit, EX_FLAG_NONE|EX_FLAG_BANG},
#ifdef FEATURE_QUEUE
{"qunshift", EX_QUNSHIFT, ex_queue, EX_FLAG_RHS},
{"qclear", EX_QCLEAR, ex_queue, EX_FLAG_RHS},
static gboolean ex_quit(const ExArg *arg)
{
- vb_quit();
+ vb_quit(arg->bang);
return true;
}
#endif
}
-void vb_quit(void)
+void vb_quit(gboolean force)
{
+ /* if not forced quit - don't quit if there are still runinng downloads */
+ if (!force && vb.state.downloads) {
+ vb_echo_force(VB_MSG_ERROR, true, "Can't quit: there are running downloads");
+ return;
+ }
+
/* write last URL into file for recreation */
if (vb.state.uri) {
g_file_set_contents(vb.files[FILES_CLOSED], vb.state.uri, -1, NULL);
static void destroy_window_cb(GtkWidget *widget)
{
- vb_quit();
+ vb_quit(true);
}
static void scroll_cb(GtkAdjustment *adjustment)
void vb_register_add(char buf, const char *value);
const char *vb_register_get(char buf);
gboolean vb_download(WebKitWebView *view, WebKitDownload *download, const char *path);
-void vb_quit(void);
+void vb_quit(gboolean force);
#endif /* end of include guard: _MAIN_H */
static VbResult normal_quit(const NormalCmdInfo *info)
{
- vb_quit();
+ vb_quit(false);
return RESULT_COMPLETE;
}