- main_vbox.set_border_width (12);
- main_vbox.set_border_width (12);
- main_vbox.set_spacing (7);
- main_vbox.pack_start (sr_frame, false, false);
- main_vbox.pack_start (notebook, false, false);
- main_vbox.pack_start (file_selector.button_box, false, false);
-
- add (main_vbox);
-
-// template_selector.shift_made.connect (
-// mem_fun(*this, &NewSessionDialog::mix_template_shift));
-// template_selector.control_made.connect (
-// mem_fun(*this, &NewSessionDialog::mix_template_control));
-
- file_selector.cancel_button.signal_clicked().connect (bind (mem_fun(*this, &ArdourDialog::stop), -1));
- file_selector.op_button.signal_clicked().connect (bind (mem_fun(*this, &ArdourDialog::stop), 0));
- file_selector.Expanded.connect (mem_fun(*this, &NewSessionDialog::file_selector_expansion));
-
- delete_event.connect (mem_fun(*this, &ArdourDialog::wm_close_event));
- show.connect (mem_fun(*this, &NewSessionDialog::fixup_at_show));
-
- file_selector.entry_label.set_name ("NewSessionMainLabel");
- file_selector.where_label.set_name ("NewSessionMainLabel");
- template_label->set_name ("NewSessionIOLabel");
- input_label.set_name ("NewSessionIOLabel");
- output_label.set_name ("NewSessionIOLabel");
- sr_label1.set_name ("NewSessionSR1Label");
- sr_label2.set_name ("NewSessionSR2Label");
-
- if (given_path.empty()) {
- Session::FavoriteDirs favs;
- Session::read_favorite_dirs (favs);
- file_selector.set_favorites (favs);
+ recent_sesion_label->set_padding(0,0);
+ recent_sesion_label->set_line_wrap(false);
+ recent_sesion_label->set_selectable(false);
+ recent_frame->set_border_width(12);
+ recent_frame->set_shadow_type(Gtk::SHADOW_NONE);
+ recent_frame->add(*recent_scrolledwindow);
+ recent_frame->set_label_widget(*recent_sesion_label);
+ open_session_vbox->pack_start(*recent_frame, Gtk::PACK_EXPAND_WIDGET, 0);
+ open_session_vbox->pack_start(*open_session_hbox, Gtk::PACK_SHRINK, 12);
+ m_notebook->set_flags(Gtk::CAN_FOCUS);
+ m_notebook->set_scrollable(true);
+ get_vbox()->set_homogeneous(false);
+ get_vbox()->set_spacing(0);
+ get_vbox()->pack_start(*m_notebook, Gtk::PACK_SHRINK, 0);
+
+ /*
+ icon setting is done again in the editor (for the whole app),
+ but its all chickens and eggs at this point.
+ */
+
+ list<Glib::RefPtr<Gdk::Pixbuf> > window_icons;
+ Glib::RefPtr<Gdk::Pixbuf> icon;
+
+ if ((icon = ::get_icon ("ardour_icon_16px")) != 0) {
+ window_icons.push_back (icon);
+ }
+ if ((icon = ::get_icon ("ardour_icon_22px")) != 0) {
+ window_icons.push_back (icon);
+ }
+ if ((icon = ::get_icon ("ardour_icon_32px")) != 0) {
+ window_icons.push_back (icon);
+ }
+ if ((icon = ::get_icon ("ardour_icon_48px")) != 0) {
+ window_icons.push_back (icon);
+ }
+ if (!window_icons.empty()) {
+ set_icon_list (window_icons);
+ }
+
+ WindowTitle title(Glib::get_application_name());
+ title += _("Session Control");
+ set_title(title.get_string());
+
+ set_position (Gtk::WIN_POS_MOUSE);
+ set_resizable(false);
+ set_has_separator(false);
+ quit_or_cancel_button = add_button(Gtk::Stock::QUIT, Gtk::RESPONSE_CANCEL);
+ add_button(Gtk::Stock::CLEAR, Gtk::RESPONSE_NONE);
+ m_okbutton = add_button(Gtk::Stock::NEW, Gtk::RESPONSE_OK);
+
+ recent_model = Gtk::TreeStore::create (recent_columns);
+ m_treeview->set_model (recent_model);
+ m_treeview->append_column (_("Recent sessions"), recent_columns.visible_name);
+ m_treeview->set_headers_visible (false);
+ m_treeview->get_selection()->set_mode (Gtk::SELECTION_SINGLE);
+
+ if (is_directory (user_template_directory ()))
+ {
+ m_template->set_current_folder (user_template_directory().to_string());
+ }
+ else if (is_directory (system_template_directory ()))
+ {
+ m_template->set_current_folder (system_template_directory().to_string());
+ }
+
+ if (is_directory (system_template_directory ()))
+ {
+ m_template->add_shortcut_folder (system_template_directory().to_string());
+ }
+
+ m_template->set_title(_("select template"));
+ Gtk::FileFilter* session_filter = manage (new (Gtk::FileFilter));
+ session_filter->add_pattern(X_("*.ardour"));
+ session_filter->add_pattern(X_("*.ardour.bak"));
+ m_open_filechooser->set_filter (*session_filter);
+ m_open_filechooser->set_current_folder(getenv ("HOME"));
+ m_open_filechooser->set_title(_("select session file"));
+
+ Gtk::FileFilter* template_filter = manage (new (Gtk::FileFilter));
+ template_filter->add_pattern(X_("*.template"));
+ m_template->set_filter (*template_filter);
+
+ m_folder->set_current_folder(getenv ("HOME"));
+ m_folder->set_title(_("select directory"));
+
+ m_notebook->set_current_page(0);
+ m_notebook->show();
+ m_notebook->show_all_children();
+
+ engine_page_session_folder = X_("");
+ engine_page_session_name = X_("");
+
+ set_default_response (Gtk::RESPONSE_OK);
+ if (!ARDOUR_COMMAND_LINE::session_name.length()) {
+ set_response_sensitive (Gtk::RESPONSE_OK, false);
+ set_response_sensitive (Gtk::RESPONSE_NONE, false);