Commit e06d5de1 authored by larchunix's avatar larchunix

Don't quit Remmina if the user denies closing the connection window

parent 0d7c7c65
......@@ -348,7 +348,7 @@ static void remmina_connection_window_close_all_connections(RemminaConnectionWin
}
void remmina_connection_window_delete(RemminaConnectionWindow* cnnwin)
gboolean remmina_connection_window_delete(RemminaConnectionWindow* cnnwin)
{
TRACE_CALL("remmina_connection_window_delete");
RemminaConnectionWindowPriv* priv = cnnwin->priv;
......@@ -358,7 +358,7 @@ void remmina_connection_window_delete(RemminaConnectionWindow* cnnwin)
gint i, n;
if (!REMMINA_IS_CONNECTION_WINDOW(cnnwin))
return;
return TRUE;
n = gtk_notebook_get_n_pages(notebook);
if (n > 1)
......@@ -369,7 +369,7 @@ void remmina_connection_window_delete(RemminaConnectionWindow* cnnwin)
i = gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
if (i != GTK_RESPONSE_YES)
return;
return FALSE;
}
remmina_connection_window_close_all_connections(cnnwin);
......@@ -380,6 +380,7 @@ void remmina_connection_window_delete(RemminaConnectionWindow* cnnwin)
gtk_widget_destroy(GTK_WIDGET(cnnhld->cnnwin));
cnnhld->cnnwin = NULL;
return TRUE;
}
static gboolean remmina_connection_window_delete_event(GtkWidget* widget, GdkEvent* event, gpointer data)
......
......@@ -69,7 +69,7 @@ G_GNUC_CONST;
gboolean remmina_connection_window_open_from_filename(const gchar* filename);
/* Open a new connection window for a given RemminaFile struct. The struct will be freed after the call */
void remmina_connection_window_open_from_file(RemminaFile* remminafile);
void remmina_connection_window_delete(RemminaConnectionWindow* cnnwin);
gboolean remmina_connection_window_delete(RemminaConnectionWindow* cnnwin);
GtkWidget* remmina_connection_window_open_from_file_full(RemminaFile* remminafile, GCallback disconnect_cb, gpointer data,
guint* handler);
......
......@@ -61,13 +61,21 @@ static gboolean cb_closewidget(GtkWidget *widget, gpointer data)
* it a "delete-event" signal. Simply destroying it will not close
* all network connections */
if (REMMINA_IS_CONNECTION_WINDOW(widget))
remmina_connection_window_delete(REMMINA_CONNECTION_WINDOW(widget));
return remmina_connection_window_delete(REMMINA_CONNECTION_WINDOW(widget));
return TRUE;
}
void remmina_exec_exitremmina()
{
TRACE_CALL("remmina_exec_exitremmina");
GtkWidget* widget = NULL;
widget = remmina_widget_pool_find(REMMINA_TYPE_CONNECTION_WINDOW, NULL);
/* Don't quit Remmina if the user refuses to close the connection
* window when multiple tabs are opened */
if (widget && !remmina_connection_window_delete(REMMINA_CONNECTION_WINDOW(widget)))
return;
/* Destroy all widgets, main window included */
remmina_widget_pool_foreach(cb_closewidget, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment