From a6466e2dac330bd601fccd44b537427e6932bc9d Mon Sep 17 00:00:00 2001 From: nemu Date: Fri, 29 Oct 2010 05:29:49 +0000 Subject: [PATCH] hanging musrt0's should be eliminated now (MUSR-153) --- ChangeLog | 1 + src/classes/PMusrT0.cpp | 16 +++++++++++++++- src/include/PMusrT0.h | 1 + src/musrt0.cpp | 2 +- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2ddcdf8e..f6891071 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,6 +22,7 @@ NEW integration of a few external musrfit plug-ins into the standard build proce NEW default estimates for 'data' and 'background' entries in RUN blocks NEW directory with some msr- and data-files for quick testing of new musrfit installations NEW option to musrt0: the key 'T' will set the t0 cursor to the maximum of the histogram +FIXED hanging musrt0's should be eliminated now (MUSR-153) FIXED wrong WARNING message for use_fit_ranges FIXED bug in event handling leading to crash for non-muSR when switching between view and difference view FIXED chisq/maxLH lables in the statistics block are properly handled now (MUSR-148) diff --git a/src/classes/PMusrT0.cpp b/src/classes/PMusrT0.cpp index ad381912..2240a40b 100644 --- a/src/classes/PMusrT0.cpp +++ b/src/classes/PMusrT0.cpp @@ -511,6 +511,7 @@ PMusrT0::PMusrT0(PMusrT0Data &data) : fMusrT0Data(data) fMainCanvas->Connect("ProcessedEvent(Int_t,Int_t,Int_t,TObject*)", "PMusrT0", this, "HandleCmdKey(Int_t,Int_t,Int_t,TObject*)"); + fMainCanvas->Connect("Closed()", "PMusrT0", this, "Quit()"); if (fMusrT0Data.GetCmdTag() != PMUSRT0_GET_T0) fDataAndBkgEnabled = true; @@ -592,7 +593,7 @@ PMusrT0::~PMusrT0() delete fLastDataLine; fLastDataLine = 0; } - if (fMainCanvas) { + if (fMainCanvas && (fStatus != 2)) { delete fMainCanvas; fMainCanvas = 0; } @@ -665,6 +666,19 @@ void PMusrT0::HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected) } } +//-------------------------------------------------------------------------- +// Quit (public) +//-------------------------------------------------------------------------- +/** + *

Slot called when the canvas is closed via the close icon (cross top right corner). + * It is emitting a global quit singal. + */ +void PMusrT0::Quit() +{ + fStatus = 2; // will quit globally + Done(0); +} + //-------------------------------------------------------------------------- // SetMsrHandler //-------------------------------------------------------------------------- diff --git a/src/include/PMusrT0.h b/src/include/PMusrT0.h index a0da3ced..52015a5d 100644 --- a/src/include/PMusrT0.h +++ b/src/include/PMusrT0.h @@ -126,6 +126,7 @@ class PMusrT0 : public TObject, public TQObject virtual void Done(Int_t status=0); // *SIGNAL* virtual void HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected); // SLOT + virtual void Quit(); // SLOT #ifndef __MAKECINT__ virtual void SetMsrHandler(PMsrHandler *msrHandler); diff --git a/src/musrt0.cpp b/src/musrt0.cpp index d952922e..20f60af2 100644 --- a/src/musrt0.cpp +++ b/src/musrt0.cpp @@ -111,7 +111,7 @@ Bool_t musrt0_item(TApplication &app, PMsrHandler *msrHandler, PMusrT0Data &data app.Run(true); // true needed that Run will return after quit Bool_t result = true; - if (musrT0->GetStatus() == 1) + if (musrT0->GetStatus() >= 1) result = false; else result = true;