progressing Open Session Dialog (adding double click on recent session name)

[git-p4: depot-paths = "//Abdaw/dev_main/tracks/": change = 457732]
This commit is contained in:
Valeriy Kamyshniy 2014-05-06 09:04:39 -05:00
parent d853c93aee
commit c6b6ee9278
4 changed files with 29 additions and 13 deletions

View file

@ -84,6 +84,7 @@ void SessionDialog::init()
_system_configuration_button.signal_clicked.connect (sigc::mem_fun (*this, &SessionDialog::on_system_configuration));
for (size_t i = 0; i < MAX_RECENT_SESSION_COUNTS; i++) {
_recent_session_button[i]->signal_clicked.connect (sigc::mem_fun (*this, &SessionDialog::on_recent_session ));
_recent_session_button[i]->signal_double_clicked.connect (sigc::mem_fun (*this, &SessionDialog::on_recent_session_double_click ));
}
redisplay_system_configuration ();
redisplay_recent_sessions();
@ -310,6 +311,18 @@ SessionDialog::on_recent_session (WavesButton* clicked_button)
_open_selected_button.set_sensitive (_selection_type == RecentSession);
}
void
SessionDialog::on_recent_session_double_click (WavesButton*)
{
// we suppose the first click, occurred prior to the second in the
// double click sequence has been processed correctly and now
// the job is just to respond with ok
hide();
response (Gtk::RESPONSE_ACCEPT);
}
void
SessionDialog::on_system_configuration (WavesButton* clicked_button)
{

View file

@ -77,6 +77,7 @@
void on_open_saved_session (WavesButton*);
void on_new_session (WavesButton*);
void on_recent_session (WavesButton*);
void on_recent_session_double_click (WavesButton*);
void on_system_configuration (WavesButton*);
bool on_delete_event (GdkEventAny*);

View file

@ -275,11 +275,12 @@ WavesButton::on_size_request (Gtk::Requisition* req)
req->width += _corner_radius;
}
bool
WavesButton::on_button_press_event (GdkEventButton *ev)
{
if (ev->type == GDK_2BUTTON_PRESS) {
signal_double_clicked (this);
} else {
_pushed = true;
queue_draw ();
if (binding_proxy.button_press_handler (ev)) {
@ -291,7 +292,7 @@ WavesButton::on_button_press_event (GdkEventButton *ev)
return true;
}
}
}
return false;
}

View file

@ -50,8 +50,6 @@ class WavesButton : public CairoWidget , public Gtkmm2ext::Activatable
void set_border_color(const char*);
Glib::RefPtr<Pango::Layout> layout() const { return _layout; }
sigc::signal1<void, WavesButton*> signal_clicked;
boost::shared_ptr<PBD::Controllable> get_controllable() { return binding_proxy.get_controllable(); }
void set_controllable (boost::shared_ptr<PBD::Controllable> c);
void watch ();
@ -61,6 +59,9 @@ class WavesButton : public CairoWidget , public Gtkmm2ext::Activatable
bool on_button_press_event (GdkEventButton*);
bool on_button_release_event (GdkEventButton*);
sigc::signal1<void, WavesButton*> signal_clicked;
sigc::signal1<void, WavesButton*> signal_double_clicked;
protected:
void render (cairo_t *);
void on_size_request (Gtk::Requisition* req);