A button to refresh the sessions list

pull/46/head
Roy Vegard Ovesen 2013-04-01 11:46:39 +02:00
parent 31c14150e7
commit 31f05a7aac
1 changed files with 14 additions and 0 deletions

View File

@ -457,6 +457,7 @@ public:
Fl_Button *new_button;
Fl_Button *add_button;
Fl_Button *duplicate_button;
Fl_Button *refresh_button;
Fl_Box *session_name_box;
Fl_Tree *session_browser;
@ -525,6 +526,15 @@ public:
osc->send( (*d)->addr, "/nsm/server/duplicate", name );
}
}
else if ( w == refresh_button )
{
session_browser->clear();
MESSAGE( "Refreshing session list." );
foreach_daemon ( d )
{
osc->send( (*d)->addr, "/nsm/server/list" );
}
}
else if ( w == session_browser )
{
if ( session_browser->callback_reason() != FL_TREE_REASON_SELECTED )
@ -780,6 +790,10 @@ 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 = refresh_button = new Fl_Button( 0, 0, 80, 50, "Refresh" );
o->box( FL_UP_BOX );
o->callback( cb_handle, (void*)this );
}
{ Fl_Button *o = open_button = new Fl_Button( 0, 0, 80, 50, "&Open" );
o->shortcut( FL_CTRL | 'o' );
o->box( FL_UP_BOX );