aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-06-21 15:27:28 -0400
committerSteven Rostedt <rostedt@goodmis.org>2010-06-21 15:27:28 -0400
commit82447a7994bbe263c4d2a89a2c276ec8a8e7675f (patch)
treec9d46a6c920d09ce4400afce7bde4d055bd69f45
parent89ddd83d85ea0640bdf9f808c6ab592e71362a88 (diff)
kernelshark: Move capture execute to dialog button
Move the execute button down with the cancel button. Reported-by: Darren Hart <dvhltc@us.ibm.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--trace-capture.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/trace-capture.c b/trace-capture.c
index 331e59d..0f5548a 100644
--- a/trace-capture.c
+++ b/trace-capture.c
@@ -868,9 +868,8 @@ file_clicked (GtkWidget *widget, gpointer data)
868 gtk_entry_set_text(GTK_ENTRY(cap->file_entry), filename); 868 gtk_entry_set_text(GTK_ENTRY(cap->file_entry), filename);
869} 869}
870 870
871static void execute_button_clicked(GtkWidget *widget, gpointer data) 871static void execute_button_clicked(struct trace_capture *cap)
872{ 872{
873 struct trace_capture *cap = data;
874 struct stat st; 873 struct stat st;
875 GtkResponseType ret; 874 GtkResponseType ret;
876 GtkWidget *dialog; 875 GtkWidget *dialog;
@@ -1340,6 +1339,7 @@ static void tracing_dialog(struct shark_info *info, const char *tracing)
1340 struct trace_capture cap; 1339 struct trace_capture cap;
1341 const gchar *file; 1340 const gchar *file;
1342 const char *command; 1341 const char *command;
1342 gint result;
1343 1343
1344 memset(&cap, 0, sizeof(cap)); 1344 memset(&cap, 0, sizeof(cap));
1345 1345
@@ -1369,8 +1369,10 @@ static void tracing_dialog(struct shark_info *info, const char *tracing)
1369 dialog = gtk_dialog_new_with_buttons("Capture", 1369 dialog = gtk_dialog_new_with_buttons("Capture",
1370 NULL, 1370 NULL,
1371 GTK_DIALOG_MODAL, 1371 GTK_DIALOG_MODAL,
1372 "Close", 1372 "Execute",
1373 GTK_RESPONSE_ACCEPT, 1373 GTK_RESPONSE_ACCEPT,
1374 GTK_STOCK_CANCEL,
1375 GTK_RESPONSE_REJECT,
1374 NULL); 1376 NULL);
1375 1377
1376 cap.main_dialog = dialog; 1378 cap.main_dialog = dialog;
@@ -1465,15 +1467,6 @@ static void tracing_dialog(struct shark_info *info, const char *tracing)
1465 cap.file_entry = entry; 1467 cap.file_entry = entry;
1466 1468
1467 1469
1468 button = gtk_button_new_with_label("Execute");
1469 gtk_box_pack_start(GTK_BOX(vbox2), button, TRUE, FALSE, 0);
1470 gtk_widget_show(button);
1471
1472 g_signal_connect (button, "clicked",
1473 G_CALLBACK (execute_button_clicked),
1474 (gpointer)&cap);
1475
1476
1477 vbox2 = gtk_vbox_new(FALSE, 0); 1470 vbox2 = gtk_vbox_new(FALSE, 0);
1478 gtk_box_pack_start(GTK_BOX(vbox), vbox2, FALSE, FALSE, 0); 1471 gtk_box_pack_start(GTK_BOX(vbox), vbox2, FALSE, FALSE, 0);
1479 gtk_widget_show(vbox2); 1472 gtk_widget_show(vbox2);
@@ -1524,7 +1517,14 @@ static void tracing_dialog(struct shark_info *info, const char *tracing)
1524 DIALOG_WIDTH, DIALOG_HEIGHT); 1517 DIALOG_WIDTH, DIALOG_HEIGHT);
1525 1518
1526 gtk_widget_show(dialog); 1519 gtk_widget_show(dialog);
1527 gtk_dialog_run(GTK_DIALOG(dialog)); 1520
1521 cont:
1522 result = gtk_dialog_run(GTK_DIALOG(dialog));
1523
1524 if (result == GTK_RESPONSE_ACCEPT) {
1525 execute_button_clicked(&cap);
1526 goto cont;
1527 }
1528 1528
1529 /* save the plugin and file to reuse if we come back */ 1529 /* save the plugin and file to reuse if we come back */
1530 update_plugin(&cap); 1530 update_plugin(&cap);