[Goodies-commits] r3488 - xfvnc/trunk/xfvnc
Brian Tarricone
kelnos at xfce.org
Fri Nov 2 09:54:16 CET 2007
Author: kelnos
Date: 2007-11-02 08:54:16 +0000 (Fri, 02 Nov 2007)
New Revision: 3488
Modified:
xfvnc/trunk/xfvnc/main.c
Log:
add license header, make the cancel button in the progress dialog just cancel,
not quit the app
Modified: xfvnc/trunk/xfvnc/main.c
===================================================================
--- xfvnc/trunk/xfvnc/main.c 2007-11-02 08:44:03 UTC (rev 3487)
+++ xfvnc/trunk/xfvnc/main.c 2007-11-02 08:54:16 UTC (rev 3488)
@@ -1,3 +1,21 @@
+/*
+ * xfvnc
+ *
+ * Copyright (c) 2007 Brian Tarricone <bjt23 at cornell.edu>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License ONLY.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -95,7 +113,27 @@
progress_cancel_clicked(GtkWidget *widget,
gpointer user_data)
{
- gtk_main_quit();
+ GladeXML *gxml = user_data;
+ GtkWidget *progress_dlg, *win, *vnc, *btn;
+ guint pulse_id;
+
+ progress_dlg = glade_xml_get_widget(gxml, "progress_dlg");
+ pulse_id = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(progress_dlg),
+ "pulse-timeout-id"));
+ g_source_remove(pulse_id);
+ gtk_widget_hide(progress_dlg);
+
+ win = glade_xml_get_widget(gxml, "vnc_window");
+ vnc = g_object_get_data(G_OBJECT(win), "vnc-display");
+ g_object_unref(G_OBJECT(vnc));
+ gtk_widget_destroy(vnc);
+ g_object_set_data(G_OBJECT(win), "vnc-display", NULL);
+ gtk_widget_hide(win);
+
+ btn = glade_xml_get_widget(gxml, "btn_progress_cancel");
+ g_signal_handlers_disconnect_by_func(G_OBJECT(btn),
+ G_CALLBACK(progress_cancel_clicked),
+ gxml);
}
static void
@@ -138,6 +176,8 @@
vnc_display_open_host(VNC_DISPLAY(vnc), host, port);
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw), vnc);
gtk_widget_realize(vnc);
+ g_object_set_data(G_OBJECT(win), "vnc-display",
+ g_object_ref(G_OBJECT(vnc)));
g_signal_connect(G_OBJECT(vnc), "vnc-connected",
G_CALLBACK(vnc_connected), gxml);
g_signal_connect(G_OBJECT(vnc), "vnc-initialized",
More information about the Goodies-commits
mailing list