From dafaebb0def192fd4963e8eacfcd43ae77e8f820 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Tue, 14 May 2013 21:34:27 -0700 Subject: [PATCH] NSM: Add quit button/keybinding. --- session-manager/src/session-manager.C | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/session-manager/src/session-manager.C b/session-manager/src/session-manager.C index a3f65cf..37d02b0 100644 --- a/session-manager/src/session-manager.C +++ b/session-manager/src/session-manager.C @@ -515,6 +515,7 @@ public: Fl_Button *new_button; Fl_Button *add_button; Fl_Button *duplicate_button; + Fl_Button *quit_button; Fl_Button *refresh_button; Fl_Box *session_name_box; @@ -603,6 +604,10 @@ public: osc->send( (*d)->addr, "/nsm/server/duplicate", name ); } } + else if ( w == quit_button ) + { + window()->do_callback( window(), this ); + } else if ( w == refresh_button ) { session_browser->clear(); @@ -870,6 +875,11 @@ public: { Fl_Pack *o = buttons_pack = new Fl_Pack( X, Y, W, 30 ); o->type( Fl_Pack::HORIZONTAL ); o->box( FL_NO_BOX ); + { Fl_Button *o = quit_button = new Fl_Button( 0, 0, 80, 50, "&Quit" ); + o->shortcut( FL_CTRL | 'q' ); + o->box( FL_UP_BOX ); + o->callback( cb_handle, (void*)this ); + } { Fl_Button *o = refresh_button = new Fl_Button( 0, 0, 80, 50, "&Refresh" ); o->shortcut( FL_CTRL | 'r' ); o->box( FL_UP_BOX );