libmbca r9 - trunk/src
- From: kaijanma svn gnome org
- To: svn-commits-list gnome org
- Subject: libmbca r9 - trunk/src
- Date: Fri, 8 Aug 2008 08:55:20 +0000 (UTC)
Author: kaijanma
Date: Fri Aug 8 08:55:19 2008
New Revision: 9
URL: http://svn.gnome.org/viewvc/libmbca?rev=9&view=rev
Log:
implemented mbca_assistant_abort ()
Modified:
trunk/src/mbca_assistant.c
trunk/src/test_mbca.c
Modified: trunk/src/mbca_assistant.c
==============================================================================
--- trunk/src/mbca_assistant.c (original)
+++ trunk/src/mbca_assistant.c Fri Aug 8 08:55:19 2008
@@ -1291,7 +1291,8 @@
return;
}
- /** @todo implement */
+ gtk_widget_hide (GTK_WIDGET (assistant->priv->assistant));
+ mbca_assistant_cancel_cb(NULL, assistant);
}
void
@@ -1327,6 +1328,8 @@
MBCAAssistant* assistant = user_data;
MBCAAssistantPrivate* priv = assistant->priv;
+ priv->btrescan_enabled = FALSE; /* make sure scan thread goes silent */
+
priv->state = MBCA_STATE_ABORTED;
mbca_assistant_close_cb (button, user_data);
}
@@ -1358,7 +1361,7 @@
if (page_number == PAGE_BLUETOOTH)
{
priv->btrescan_enabled = TRUE;
- /* check also mbca_bluetooth_radiobutton_clicked_cb () */
+ /* also take a look at mbca_bluetooth_radiobutton_clicked_cb () */
}
else
{
Modified: trunk/src/test_mbca.c
==============================================================================
--- trunk/src/test_mbca.c (original)
+++ trunk/src/test_mbca.c Fri Aug 8 08:55:19 2008
@@ -171,6 +171,23 @@
"/dev/ttyS0", "9600");
}
+void
+abort_button_clicked_cb (GtkWidget* button, gpointer user_data)
+{
+ GSList** assistants = user_data;
+ GSList* iter;
+
+ iter = *assistants;
+ while (iter) {
+ MBCAAssistant* assistant = iter->data;
+
+ /* state_changed_cb will remove the assistant from the list so we
+ * let's take the next assistant before that */
+ iter = iter->next;
+
+ mbca_assistant_abort (assistant);
+ }
+}
static GtkWindow*
create_gui ()
@@ -181,6 +198,7 @@
GtkWidget* full_button;
GtkWidget* preset_button;
+ GtkWidget* abort_button;
GtkWidget* quit_button;
GSList* assistants = NULL;
@@ -205,13 +223,20 @@
gtk_box_pack_start (GTK_BOX(vbox), gtk_vseparator_new(), FALSE, FALSE, 0);
+ abort_button = gtk_button_new_with_label ("Abort");
+ gtk_box_pack_start (GTK_BOX(vbox), abort_button, FALSE, FALSE, 0);
+
+ gtk_box_pack_start (GTK_BOX(vbox), gtk_vseparator_new(), FALSE, FALSE, 0);
+
quit_button = gtk_button_new_with_label ("Quit");
gtk_box_pack_start (GTK_BOX(vbox), quit_button, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (full_button), "clicked",
G_CALLBACK (full_button_clicked_cb), &assistants);
g_signal_connect (G_OBJECT (preset_button), "clicked",
- G_CALLBACK (preset_button_clicked_cb), &assistants);
+ G_CALLBACK (preset_button_clicked_cb), &assistants);
+ g_signal_connect (G_OBJECT (abort_button), "clicked",
+ G_CALLBACK (abort_button_clicked_cb), &assistants);
g_signal_connect (G_OBJECT (quit_button), "clicked",
G_CALLBACK (gtk_main_quit), NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]