13
0

New session dialog defaults to the 'best' templates directory, clearing template file now works.

git-svn-id: svn://localhost/trunk/ardour2@496 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Nick Mainsbridge 2006-05-11 09:25:51 +00:00
parent 3732decd72
commit 62198e9c27
3 changed files with 22 additions and 4 deletions

View File

@ -1,6 +1,6 @@
#export G_DEBUG=fatal_criticals
export ARDOUR_PATH=./glade:./pixmaps:.:..
export ARDOUR_PATH=./glade:./pixmaps:`pwd`:`cd ../ && pwd`
export LD_LIBRARY_PATH=../libs/ardour:../libs/midi++2:../libs/pbd3:../libs/soundtouch:../libs/gtkmm2ext:../libs/sigc++2:../libs/glibmm2:../libs/gtkmm2/atk:../libs/gtkmm2/pango:../libs/gtkmm2/gdk:../libs/gtkmm2/gtk:../libs/libgnomecanvasmm:../libs/libglademm:$LD_LIBRARY_PATH

View File

@ -86,9 +86,14 @@ NewSessionDialog::NewSessionDialog(BaseObjectType* cobject,
}
std::string path = ARDOUR::find_config_file (X_("templates"));
if (path != "") {
m_template->set_current_folder (path);
}
m_template->set_show_hidden (true);
m_new_session_dialog->set_response_sensitive (Gtk::RESPONSE_OK, false);
m_new_session_dialog->set_response_sensitive (0, false);
m_new_session_dialog->set_default_response (Gtk::RESPONSE_OK);
m_notebook->show_all_children();
m_notebook->set_current_page(0);
@ -105,6 +110,7 @@ NewSessionDialog::NewSessionDialog(BaseObjectType* cobject,
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));
m_open_filechooser->signal_selection_changed ().connect (mem_fun (*this, &NewSessionDialog::file_chosen));
m_template->signal_selection_changed ().connect (mem_fun (*this, &NewSessionDialog::template_chosen));
}
void
@ -253,6 +259,7 @@ void
NewSessionDialog::reset_name()
{
m_name->set_text(Glib::ustring());
m_new_session_dialog->set_response_sensitive (Gtk::RESPONSE_OK, false);
}
@ -318,17 +325,27 @@ NewSessionDialog::file_chosen ()
}
}
void
NewSessionDialog::template_chosen ()
{
if (m_template->get_filename() != "" ) {;
m_new_session_dialog->set_response_sensitive (0, true);
} else {
m_new_session_dialog->set_response_sensitive (0, false);
}
}
void
NewSessionDialog::recent_row_activated (const Gtk::TreePath& path, Gtk::TreeViewColumn* col)
{
m_new_session_dialog->response (Gtk::RESPONSE_YES);
}
/// @todo
void
NewSessionDialog::reset_template()
{
m_template->set_filename("");
}
void

View File

@ -156,6 +156,7 @@ protected:
void notebook_page_changed (GtkNotebookPage*, uint);
void treeview_selection_changed ();
void file_chosen ();
void template_chosen ();
void recent_row_activated (const Gtk::TreePath&, Gtk::TreeViewColumn*);