aboutsummaryrefslogtreecommitdiff
path: root/src/reproject.c
diff options
context:
space:
mode:
authortaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-10-20 20:50:40 +0000
committertaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-10-20 20:50:40 +0000
commite0b68705e87eaddd4168b2bb4b44a8a7a1a0d75c (patch)
treecac8334edf40f7a367506ef9b865bd0517b4ac81 /src/reproject.c
parent8da2c5e601cbd6472e54d8148baffdccd231f89d (diff)
Don't open a second reprojection window
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@163 bf6ca9ba-c028-0410-8290-897cf20841d1
Diffstat (limited to 'src/reproject.c')
-rw-r--r--src/reproject.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/reproject.c b/src/reproject.c
index 79657a1..2c84326 100644
--- a/src/reproject.c
+++ b/src/reproject.c
@@ -201,11 +201,21 @@ static gint reproject_clicked(GtkWidget *widget, GdkEventButton *event, ControlC
}
+static gint reproject_closed(GtkWidget *widget, ControlContext *ctx) {
+ ctx->reproject_id = NULL;
+ return 0;
+}
+
void reproject_open(ControlContext *ctx) {
size_t j;
ImageFeatureList *flist;
+ if ( ctx->reproject_id ) {
+ displaywindow_error("Reprojection window is already open.", ctx->dw);
+ return;
+ }
+
if ( !ctx->cell ) {
printf("RP: No current cell\n");
displaywindow_error("No reciprocal unit cell has been specified.", ctx->dw);
@@ -224,6 +234,8 @@ void reproject_open(ControlContext *ctx) {
ctx->reproject_id = imagedisplay_open_with_message(ctx->images->images[ctx->reproject_cur_image], "Current Image", "Click to change image",
IMAGEDISPLAY_SHOW_CENTRE | IMAGEDISPLAY_SHOW_TILT_AXIS, G_CALLBACK(reproject_clicked), ctx);
+ g_signal_connect(GTK_OBJECT(ctx->reproject_id->drawingarea), "destroy", G_CALLBACK(reproject_closed), ctx);
+
flist = reproject_get_reflections(&ctx->images->images[ctx->reproject_cur_image], ctx->cell_lattice, ctx);
for ( j=0; j<flist->n_features; j++ ) {
imagedisplay_mark_circle(ctx->reproject_id, flist->features[j].x, flist->features[j].y);