diff options
-rw-r--r-- | data/displaywindow.ui | 1 | ||||
-rw-r--r-- | src/displaywindow.c | 43 | ||||
-rw-r--r-- | src/indexamajig.c | 1 |
3 files changed, 45 insertions, 0 deletions
diff --git a/data/displaywindow.ui b/data/displaywindow.ui index 8097d706..a435c754 100644 --- a/data/displaywindow.ui +++ b/data/displaywindow.ui @@ -16,6 +16,7 @@ <menu name="tools" action="ToolsAction"> <menuitem name="numbers" action="NumbersAction" /> + <menuitem name="peaks" action="PeaksAction" /> </menu> <menu name="help" action="HelpAction"> diff --git a/src/displaywindow.c b/src/displaywindow.c index 49c094ec..ebcaddd6 100644 --- a/src/displaywindow.c +++ b/src/displaywindow.c @@ -399,6 +399,27 @@ static gint displaywindow_set_boostint(GtkWidget *widget, DisplayWindow *dw) } +static gint displaywindow_peaklist_response(GtkWidget *d, gint response, + DisplayWindow *dw) +{ + if ( response == GTK_RESPONSE_ACCEPT ) { + + char *filename; + + filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(d)); + + load_features_from_file(dw->image); + + g_free(filename); + + } + + gtk_widget_destroy(d); + + return 0; +} + + static gint displaywindow_about(GtkWidget *widget, DisplayWindow *dw) { GtkWidget *window; @@ -435,6 +456,26 @@ static gint displaywindow_about(GtkWidget *widget, DisplayWindow *dw) } +static gint displaywindow_peak_overlay(GtkWidget *widget, DisplayWindow *dw) +{ + GtkWidget *d; + + d = gtk_file_chooser_dialog_new("Choose Peak List", + GTK_WINDOW(dw->window), + GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, + NULL); + + g_signal_connect(G_OBJECT(d), "response", + G_CALLBACK(displaywindow_peaklist_response), dw); + + gtk_widget_show_all(d); + + return 0; +} + + static gint displaywindow_set_colscale(GtkWidget *widget, DisplayWindow *dw) { dw->show_col_scale = 1 - dw->show_col_scale; @@ -592,6 +633,8 @@ static void displaywindow_addmenubar(DisplayWindow *dw, GtkWidget *vbox) { "ToolsAction", NULL, "_Tools", NULL, NULL, NULL }, { "NumbersAction", NULL, "View Numbers...", "F2", NULL, G_CALLBACK(displaywindow_show_numbers) }, + { "PeaksAction", NULL, "Peak Position Overlay...", NULL, NULL, + G_CALLBACK(displaywindow_peak_overlay) }, { "HelpAction", NULL, "_Help", NULL, NULL, NULL }, { "AboutAction", GTK_STOCK_ABOUT, "_About hdfsee...", diff --git a/src/indexamajig.c b/src/indexamajig.c index 76ed6ed6..952433dd 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -176,6 +176,7 @@ static int image_fom(struct image *image) n_valid = 0; for ( i=0; i<n_peaks; i++ ) { if ( peaks[i].invalid ) continue; + printf("%i %i\n", peaks[i].x, peaks[i].y); n_valid++; } |