Skip to content

Commit

Permalink
Merge branch 'manualpick_autosave' into ver5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
scheres committed Nov 28, 2023
2 parents 99af75a + b8cbd4f commit 8f1883a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src/displayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1982,7 +1982,10 @@ int pickerViewerCanvas::handle(int ev)
else if ( strcmp(m->label(), "Help") == 0 )
printHelp();
else if ( strcmp(m->label(), "Quit (CTRL-q)") == 0 )
exit(0);
{
saveCoordinates(false);
exit(0);
}
redraw();
return 1; // (tells caller we handled this event)
}
Expand Down
14 changes: 9 additions & 5 deletions src/manualpicker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ int manualpickerGuiWindow::fill()
{
color(GUI_BACKGROUND_COLOR);

this->callback(cb_closing);

Fl_Menu_Bar *menubar = new Fl_Menu_Bar(0, 0, w(), 25);
if (do_allow_save)
Expand Down Expand Up @@ -580,15 +581,22 @@ void manualpickerGuiWindow::cb_menubar_quit(Fl_Widget* w, void* v)

void manualpickerGuiWindow::cb_menubar_quit_i()
{
cb_menubar_save_i();
cb_menubar_recount_i();
exit(0);
}

void manualpickerGuiWindow::cb_closing(Fl_Widget* w, void* v)
{
manualpickerGuiWindow* T=(manualpickerGuiWindow*)w;
T->cb_menubar_quit_i();
}

void manualpickerGuiWindow::cb_menubar_recount(Fl_Widget* w, void* v)
{
manualpickerGuiWindow* T=(manualpickerGuiWindow*)v;
T->cb_menubar_recount_i();
}

void manualpickerGuiWindow::cb_menubar_recount_i()
{

Expand Down Expand Up @@ -781,10 +789,6 @@ void ManualPicker::initialise()
global_lowpass = new_nyquist;
std::cout << " Set low-pass filter to " << global_lowpass << " due to downscaling of " << global_micscale << std::endl;
}

std::cerr << " NOTE: in order to write the new list of coordinate STAR files, you need to re-count the particles or quite this program through the File menu. Do NOT kill the program using the operating system's window manager!" << std::endl;


}

void ManualPicker::run()
Expand Down
2 changes: 2 additions & 0 deletions src/manualpicker.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ class manualpickerGuiWindow : public Fl_Window
static void cb_menubar_quit(Fl_Widget*, void*);
inline void cb_menubar_quit_i();

static void cb_closing(Fl_Widget*, void*);

static void cb_menubar_recount(Fl_Widget*, void*);
inline void cb_menubar_recount_i();

Expand Down

0 comments on commit 8f1883a

Please sign in to comment.