tim mayberry's patches to fix middle-click pasting ina couple of dialogs (merged...
[ardour.git] / gtk2_ardour / new_session_dialog.cc
index 4875ff835a2aa1a3763b6a487a49166bc1e2dfbd..f024680c1e40c2663830801aecc248e4e07f3f22 100644 (file)
 #include <gtkmm/stock.h>
 #include <gdkmm/cursor.h>
 
+#include <gtkmm2ext/window_title.h>
+
+using namespace Gtkmm2ext;
+
 #include "opts.h"
 
 NewSessionDialog::NewSessionDialog()
        : ArdourDialog ("session control")
 {
-        session_name_label = Gtk::manage(new class Gtk::Label(_("Name :")));
+       session_name_label = Gtk::manage(new class Gtk::Label(_("Name :")));
        m_name = Gtk::manage(new class Gtk::Entry());
        m_name->set_text(GTK_ARDOUR::session_name);
 
@@ -338,7 +342,11 @@ NewSessionDialog::NewSessionDialog()
        get_vbox()->set_homogeneous(false);
        get_vbox()->set_spacing(0);
        get_vbox()->pack_start(*m_notebook, Gtk::PACK_SHRINK, 0);
-       set_title(_("ardour: session control"));
+
+       WindowTitle title(Glib::get_application_name());
+       title += _("Session Control");
+       set_title(title.get_string());
+
        //set_modal(false);
        //property_window_position().set_value(Gtk::WIN_POS_NONE);
        set_resizable(false);
@@ -419,7 +427,7 @@ NewSessionDialog::NewSessionDialog()
        m_limit_output_ports->signal_clicked().connect (mem_fun (*this, &NewSessionDialog::limit_outputs_clicked));
        m_create_master_bus->signal_clicked().connect (mem_fun (*this, &NewSessionDialog::master_bus_button_clicked));
        m_create_control_bus->signal_clicked().connect (mem_fun (*this, &NewSessionDialog::monitor_bus_button_clicked));
-       m_name->signal_key_release_event().connect(mem_fun (*this, &NewSessionDialog::entry_key_release));
+       m_name->signal_changed().connect(mem_fun (*this, &NewSessionDialog::on_new_session_name_entry_changed));
        m_notebook->signal_switch_page().connect (mem_fun (*this, &NewSessionDialog::notebook_page_changed));
        m_treeview->get_selection()->signal_changed().connect (mem_fun (*this, &NewSessionDialog::treeview_selection_changed));
        m_treeview->signal_row_activated().connect (mem_fun (*this, &NewSessionDialog::recent_row_activated));
@@ -567,7 +575,12 @@ int
 NewSessionDialog::get_current_page()
 {
        return m_notebook->get_current_page();
-       
+}
+
+void
+NewSessionDialog::set_current_page(int page)
+{
+       return m_notebook->set_current_page (page);
 }
 
 void
@@ -578,8 +591,8 @@ NewSessionDialog::reset_name()
        
 }
 
-bool
-NewSessionDialog::entry_key_release (GdkEventKey* ev)
+void
+NewSessionDialog::on_new_session_name_entry_changed ()
 {
        if (m_name->get_text() != "") {
                set_response_sensitive (Gtk::RESPONSE_OK, true);
@@ -587,7 +600,6 @@ NewSessionDialog::entry_key_release (GdkEventKey* ev)
        } else {
                set_response_sensitive (Gtk::RESPONSE_OK, false);
        }
-       return true;
 }
 
 void