mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-24 07:27:44 +01:00
Convert NSD from glade to gtkmm object
git-svn-id: svn://localhost/trunk/ardour2@498 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
1268a8ab5f
commit
f0c0ecf3b1
3 changed files with 350 additions and 91 deletions
|
|
@ -147,9 +147,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], string rcfile)
|
|||
|
||||
color_manager->load (color_file);
|
||||
|
||||
m_new_session_dialog = 0;
|
||||
m_new_session_dialog_ref = NewSessionDialogFactory::create();
|
||||
m_new_session_dialog_ref->get_widget_derived (NewSessionDialogFactory::top_level_widget_name(), m_new_session_dialog);
|
||||
m_new_session_dialog = new NewSessionDialog();
|
||||
editor = 0;
|
||||
mixer = 0;
|
||||
session = 0;
|
||||
|
|
@ -1746,10 +1744,10 @@ ARDOUR_UI::new_session (bool startup, std::string predetermined_path)
|
|||
std::string session_name = m_new_session_dialog->session_name();
|
||||
std::string session_path = m_new_session_dialog->session_folder();
|
||||
|
||||
/*
|
||||
XXX This is needed because session constructor wants a
|
||||
non-existant path. hopefully this will be fixed at some point.
|
||||
*/
|
||||
|
||||
//XXX This is needed because session constructor wants a
|
||||
//non-existant path. hopefully this will be fixed at some point.
|
||||
|
||||
session_path = Glib::build_filename(session_path, session_name);
|
||||
|
||||
std::string template_name = m_new_session_dialog->session_template_name();
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
|
||||
#include "i18n.h"
|
||||
#include "new_session_dialog.h"
|
||||
#include "glade_path.h"
|
||||
|
||||
#include <ardour/recent_sessions.h>
|
||||
#include <ardour/session.h>
|
||||
|
|
@ -36,47 +35,292 @@
|
|||
#include <gtkmm/stock.h>
|
||||
|
||||
|
||||
const char* NewSessionDialogFactory::s_m_top_level_widget_name = X_("NewSessionDialog");
|
||||
const char* NewSessionDialogFactory::top_level_widget_name() { return s_m_top_level_widget_name; }
|
||||
|
||||
Glib::RefPtr<Gnome::Glade::Xml>
|
||||
NewSessionDialogFactory::create()
|
||||
NewSessionDialog::NewSessionDialog()
|
||||
: ArdourDialog ("New Session Dialog")
|
||||
{
|
||||
return GladeFactory::create(GladePath::path(X_("new_session_dialog.glade")));
|
||||
}
|
||||
|
||||
|
||||
NewSessionDialog::NewSessionDialog(BaseObjectType* cobject,
|
||||
const Glib::RefPtr<Gnome::Glade::Xml>& xml)
|
||||
: Gtk::Dialog(cobject)
|
||||
{
|
||||
// look up the widgets we care about.
|
||||
xml->get_widget(X_("NewSessionDialog"), m_new_session_dialog);
|
||||
xml->get_widget(X_("SessionNameEntry"), m_name);
|
||||
xml->get_widget(X_("SessionFolderChooser"), m_folder);
|
||||
xml->get_widget(X_("SessionTemplateChooser"), m_template);
|
||||
|
||||
xml->get_widget(X_("CreateMasterBus"), m_create_master_bus);
|
||||
xml->get_widget(X_("MasterChannelCount"), m_master_bus_channel_count);
|
||||
|
||||
xml->get_widget(X_("CreateControlBus"), m_create_control_bus);
|
||||
xml->get_widget(X_("ControlChannelCount"), m_control_bus_channel_count);
|
||||
|
||||
xml->get_widget(X_("ConnectInputs"), m_connect_inputs);
|
||||
xml->get_widget(X_("LimitInputPorts"), m_limit_input_ports);
|
||||
xml->get_widget(X_("InputLimitCount"), m_input_limit_count);
|
||||
|
||||
xml->get_widget(X_("ConnectOutputs"), m_connect_outputs);
|
||||
xml->get_widget(X_("LimitOutputPorts"), m_limit_output_ports);
|
||||
xml->get_widget(X_("OutputLimitCount"), m_output_limit_count);
|
||||
xml->get_widget(X_("ConnectOutsToMaster"), m_connect_outputs_to_master);
|
||||
xml->get_widget(X_("ConnectOutsToPhysical"), m_connect_outputs_to_physical);
|
||||
|
||||
xml->get_widget(X_("OpenFilechooserButton"), m_open_filechooser);
|
||||
xml->get_widget(X_("TheNotebook"), m_notebook);
|
||||
xml->get_widget(X_("TheTreeview"), m_treeview);
|
||||
xml->get_widget(X_("OkButton"), m_okbutton);
|
||||
|
||||
session_name_label = Gtk::manage(new class Gtk::Label(_("Session Name")));
|
||||
m_name = Gtk::manage(new class Gtk::Entry());
|
||||
session_location_label = Gtk::manage(new class Gtk::Label(_("Session Location")));
|
||||
m_folder = Gtk::manage(new class Gtk::FileChooserButton(Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER));
|
||||
session_template_label = Gtk::manage(new class Gtk::Label(_("Session Template")));
|
||||
m_template = Gtk::manage(new class Gtk::FileChooserButton());
|
||||
chan_count_label = Gtk::manage(new class Gtk::Label(_("Channel Count")));
|
||||
m_create_control_bus = Gtk::manage(new class Gtk::CheckButton(_("Create Control Bus")));
|
||||
|
||||
Gtk::Adjustment *m_control_bus_channel_count_adj = Gtk::manage(new class Gtk::Adjustment(2, 0, 100, 1, 10, 10));
|
||||
m_control_bus_channel_count = Gtk::manage(new class Gtk::SpinButton(*m_control_bus_channel_count_adj, 1, 0));
|
||||
|
||||
Gtk::Adjustment *m_master_bus_channel_count_adj = Gtk::manage(new class Gtk::Adjustment(2, 0, 100, 1, 10, 10));
|
||||
m_master_bus_channel_count = Gtk::manage(new class Gtk::SpinButton(*m_master_bus_channel_count_adj, 1, 0));
|
||||
m_create_master_bus = Gtk::manage(new class Gtk::CheckButton(_("Create Master Bus")));
|
||||
advanced_table = Gtk::manage(new class Gtk::Table(2, 2, true));
|
||||
options_label = Gtk::manage(new class Gtk::Label(_("Track/Bus connection options")));
|
||||
m_connect_inputs = Gtk::manage(new class Gtk::CheckButton(_("Automatically connect inputs")));
|
||||
m_limit_input_ports = Gtk::manage(new class Gtk::CheckButton(_("Port limit")));
|
||||
|
||||
Gtk::Adjustment *m_input_limit_count_adj = Gtk::manage(new class Gtk::Adjustment(1, 0, 100, 1, 10, 10));
|
||||
m_input_limit_count = Gtk::manage(new class Gtk::SpinButton(*m_input_limit_count_adj, 1, 0));
|
||||
input_port_limit_hbox = Gtk::manage(new class Gtk::HBox(false, 0));
|
||||
input_port_hbox = Gtk::manage(new class Gtk::HBox(false, 0));
|
||||
input_table = Gtk::manage(new class Gtk::Table(2, 2, false));
|
||||
input_port_alignment = Gtk::manage(new class Gtk::Alignment(0.5, 0.5, 1, 1));
|
||||
input_label = Gtk::manage(new class Gtk::Label(_("<b>Input</b>")));
|
||||
input_frame = Gtk::manage(new class Gtk::Frame());
|
||||
m_connect_outputs = Gtk::manage(new class Gtk::CheckButton(_("Automatically connect outputs")));
|
||||
m_limit_output_ports = Gtk::manage(new class Gtk::CheckButton(_("Port limit")));
|
||||
|
||||
Gtk::Adjustment *m_output_limit_count_adj = Gtk::manage(new class Gtk::Adjustment(1, 0, 100, 1, 10, 10));
|
||||
m_output_limit_count = Gtk::manage(new class Gtk::SpinButton(*m_output_limit_count_adj, 1, 0));
|
||||
output_port_limit_hbox = Gtk::manage(new class Gtk::HBox(false, 0));
|
||||
output_port_hbox = Gtk::manage(new class Gtk::HBox(false, 0));
|
||||
|
||||
Gtk::RadioButton::Group _RadioBGroup_m_connect_outputs_to_master;
|
||||
m_connect_outputs_to_master = Gtk::manage(new class Gtk::RadioButton(_RadioBGroup_m_connect_outputs_to_master, _("Connect to Master Bus")));
|
||||
m_connect_outputs_to_physical = Gtk::manage(new class Gtk::RadioButton(_RadioBGroup_m_connect_outputs_to_master, _("Connect to physical outputs")));
|
||||
output_conn_vbox = Gtk::manage(new class Gtk::VBox(false, 0));
|
||||
output_vbox = Gtk::manage(new class Gtk::VBox(false, 0));
|
||||
output_port_alignment = Gtk::manage(new class Gtk::Alignment(0.5, 0.5, 1, 1));
|
||||
output_label = Gtk::manage(new class Gtk::Label(_("<b>Output</b>")));
|
||||
output_frame = Gtk::manage(new class Gtk::Frame());
|
||||
advanced_vbox = Gtk::manage(new class Gtk::VBox(false, 0));
|
||||
advanced_label = Gtk::manage(new class Gtk::Label(_("<b>Advanced</b>")));
|
||||
advanced_expander = Gtk::manage(new class Gtk::Expander());
|
||||
new_session_table = Gtk::manage(new class Gtk::Table(2, 2, false));
|
||||
m_open_filechooser = Gtk::manage(new class Gtk::FileChooserButton());
|
||||
open_session_hbox = Gtk::manage(new class Gtk::HBox(false, 0));
|
||||
open_session_alignment = Gtk::manage(new class Gtk::Alignment(0.5, 0.5, 1, 1));
|
||||
open_sesion_label = Gtk::manage(new class Gtk::Label(_("Open Session")));
|
||||
open_session_frame = Gtk::manage(new class Gtk::Frame());
|
||||
m_treeview = Gtk::manage(new class Gtk::TreeView());
|
||||
recent_scrolledwindow = Gtk::manage(new class Gtk::ScrolledWindow());
|
||||
recent_alignment = Gtk::manage(new class Gtk::Alignment(0.5, 0.5, 1, 1));
|
||||
recent_sesion_label = Gtk::manage(new class Gtk::Label(_("Open Recent Session")));
|
||||
recent_frame = Gtk::manage(new class Gtk::Frame());
|
||||
open_session_vbox = Gtk::manage(new class Gtk::VBox(false, 0));
|
||||
m_notebook = Gtk::manage(new class Gtk::Notebook());
|
||||
session_name_label->set_alignment(0.5,0.5);
|
||||
session_name_label->set_padding(0,0);
|
||||
session_name_label->set_justify(Gtk::JUSTIFY_LEFT);
|
||||
session_name_label->set_line_wrap(false);
|
||||
session_name_label->set_use_markup(false);
|
||||
session_name_label->set_selectable(false);
|
||||
m_name->set_visibility(true);
|
||||
m_name->set_editable(true);
|
||||
m_name->set_max_length(0);
|
||||
m_name->set_text("");
|
||||
m_name->set_has_frame(true);
|
||||
m_name->set_activates_default(false);
|
||||
session_location_label->set_alignment(0.5,0.5);
|
||||
session_location_label->set_padding(0,0);
|
||||
session_location_label->set_justify(Gtk::JUSTIFY_LEFT);
|
||||
session_location_label->set_line_wrap(false);
|
||||
session_location_label->set_use_markup(false);
|
||||
session_location_label->set_selectable(false);
|
||||
session_template_label->set_alignment(0.5,0.5);
|
||||
session_template_label->set_padding(0,0);
|
||||
session_template_label->set_justify(Gtk::JUSTIFY_LEFT);
|
||||
session_template_label->set_line_wrap(false);
|
||||
session_template_label->set_use_markup(false);
|
||||
session_template_label->set_selectable(false);
|
||||
m_create_control_bus->set_flags(Gtk::CAN_FOCUS);
|
||||
m_create_control_bus->set_relief(Gtk::RELIEF_NORMAL);
|
||||
m_create_control_bus->set_mode(true);
|
||||
m_create_control_bus->set_active(false);
|
||||
m_control_bus_channel_count->set_flags(Gtk::CAN_FOCUS);
|
||||
m_control_bus_channel_count->set_update_policy(Gtk::UPDATE_ALWAYS);
|
||||
m_control_bus_channel_count->set_numeric(true);
|
||||
m_control_bus_channel_count->set_digits(0);
|
||||
m_control_bus_channel_count->set_wrap(false);
|
||||
m_master_bus_channel_count->set_flags(Gtk::CAN_FOCUS);
|
||||
m_master_bus_channel_count->set_update_policy(Gtk::UPDATE_ALWAYS);
|
||||
m_master_bus_channel_count->set_numeric(true);
|
||||
m_master_bus_channel_count->set_digits(0);
|
||||
m_master_bus_channel_count->set_wrap(false);
|
||||
m_create_master_bus->set_flags(Gtk::CAN_FOCUS);
|
||||
m_create_master_bus->set_relief(Gtk::RELIEF_NORMAL);
|
||||
m_create_master_bus->set_mode(true);
|
||||
m_create_master_bus->set_active(true);
|
||||
advanced_table->set_row_spacings(0);
|
||||
advanced_table->set_col_spacings(0);
|
||||
advanced_table->attach(*chan_count_label, 1, 2, 0, 1, Gtk::AttachOptions(), Gtk::AttachOptions(), 0, 0);
|
||||
advanced_table->attach(*m_create_control_bus, 0, 1, 2, 3, Gtk::FILL, Gtk::AttachOptions(), 0, 0);
|
||||
advanced_table->attach(*m_control_bus_channel_count, 1, 2, 2, 3, Gtk::AttachOptions(), Gtk::AttachOptions(), 0, 0);
|
||||
advanced_table->attach(*m_master_bus_channel_count, 1, 2, 1, 2, Gtk::AttachOptions(), Gtk::AttachOptions(), 0, 0);
|
||||
advanced_table->attach(*m_create_master_bus, 0, 1, 1, 2, Gtk::FILL, Gtk::AttachOptions(), 0, 0);
|
||||
options_label->set_alignment(0.5,0.5);
|
||||
options_label->set_padding(0,0);
|
||||
options_label->set_justify(Gtk::JUSTIFY_LEFT);
|
||||
options_label->set_line_wrap(false);
|
||||
options_label->set_use_markup(false);
|
||||
options_label->set_selectable(false);
|
||||
m_connect_inputs->set_flags(Gtk::CAN_FOCUS);
|
||||
m_connect_inputs->set_relief(Gtk::RELIEF_NORMAL);
|
||||
m_connect_inputs->set_mode(true);
|
||||
m_connect_inputs->set_active(false);
|
||||
m_limit_input_ports->set_flags(Gtk::CAN_FOCUS);
|
||||
m_limit_input_ports->set_relief(Gtk::RELIEF_NORMAL);
|
||||
m_limit_input_ports->set_mode(true);
|
||||
m_limit_input_ports->set_active(false);
|
||||
m_input_limit_count->set_flags(Gtk::CAN_FOCUS);
|
||||
m_input_limit_count->set_update_policy(Gtk::UPDATE_ALWAYS);
|
||||
m_input_limit_count->set_numeric(true);
|
||||
m_input_limit_count->set_digits(0);
|
||||
m_input_limit_count->set_wrap(false);
|
||||
input_port_limit_hbox->pack_start(*m_limit_input_ports, Gtk::PACK_SHRINK, 0);
|
||||
input_port_limit_hbox->pack_start(*m_input_limit_count);
|
||||
input_port_hbox->pack_start(*m_connect_inputs, Gtk::PACK_SHRINK, 0);
|
||||
input_port_hbox->pack_start(*input_port_limit_hbox, Gtk::PACK_EXPAND_PADDING, 0);
|
||||
input_table->set_row_spacings(0);
|
||||
input_table->set_col_spacings(0);
|
||||
input_table->attach(*input_port_hbox, 0, 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
|
||||
input_port_alignment->add(*input_table);
|
||||
input_label->set_alignment(0.5,0.5);
|
||||
input_label->set_padding(0,0);
|
||||
input_label->set_justify(Gtk::JUSTIFY_LEFT);
|
||||
input_label->set_line_wrap(false);
|
||||
input_label->set_use_markup(true);
|
||||
input_label->set_selectable(false);
|
||||
input_frame->set_shadow_type(Gtk::SHADOW_NONE);
|
||||
input_frame->set_label_align(0,0.5);
|
||||
input_frame->add(*input_port_alignment);
|
||||
input_frame->set_label_widget(*input_label);
|
||||
m_connect_outputs->set_flags(Gtk::CAN_FOCUS);
|
||||
m_connect_outputs->set_relief(Gtk::RELIEF_NORMAL);
|
||||
m_connect_outputs->set_mode(true);
|
||||
m_connect_outputs->set_active(false);
|
||||
m_limit_output_ports->set_flags(Gtk::CAN_FOCUS);
|
||||
m_limit_output_ports->set_relief(Gtk::RELIEF_NORMAL);
|
||||
m_limit_output_ports->set_mode(true);
|
||||
m_limit_output_ports->set_active(false);
|
||||
m_output_limit_count->set_flags(Gtk::CAN_FOCUS);
|
||||
m_output_limit_count->set_update_policy(Gtk::UPDATE_ALWAYS);
|
||||
m_output_limit_count->set_numeric(false);
|
||||
m_output_limit_count->set_digits(0);
|
||||
m_output_limit_count->set_wrap(false);
|
||||
output_port_limit_hbox->pack_start(*m_limit_output_ports, Gtk::PACK_SHRINK, 0);
|
||||
output_port_limit_hbox->pack_start(*m_output_limit_count);
|
||||
output_port_hbox->pack_start(*m_connect_outputs, Gtk::PACK_SHRINK, 0);
|
||||
output_port_hbox->pack_start(*output_port_limit_hbox, Gtk::PACK_EXPAND_PADDING, 0);
|
||||
m_connect_outputs_to_master->set_flags(Gtk::CAN_FOCUS);
|
||||
m_connect_outputs_to_master->set_relief(Gtk::RELIEF_NORMAL);
|
||||
m_connect_outputs_to_master->set_mode(true);
|
||||
m_connect_outputs_to_master->set_active(false);
|
||||
m_connect_outputs_to_physical->set_flags(Gtk::CAN_FOCUS);
|
||||
m_connect_outputs_to_physical->set_relief(Gtk::RELIEF_NORMAL);
|
||||
m_connect_outputs_to_physical->set_mode(true);
|
||||
m_connect_outputs_to_physical->set_active(false);
|
||||
output_conn_vbox->pack_start(*m_connect_outputs_to_master, Gtk::PACK_SHRINK, 0);
|
||||
output_conn_vbox->pack_start(*m_connect_outputs_to_physical, Gtk::PACK_SHRINK, 0);
|
||||
output_vbox->pack_start(*output_port_hbox);
|
||||
output_vbox->pack_start(*output_conn_vbox);
|
||||
output_port_alignment->add(*output_vbox);
|
||||
output_label->set_alignment(0.5,0.5);
|
||||
output_label->set_padding(0,0);
|
||||
output_label->set_justify(Gtk::JUSTIFY_LEFT);
|
||||
output_label->set_line_wrap(false);
|
||||
output_label->set_use_markup(true);
|
||||
output_label->set_selectable(false);
|
||||
output_frame->set_shadow_type(Gtk::SHADOW_NONE);
|
||||
output_frame->set_label_align(0,0.5);
|
||||
output_frame->add(*output_port_alignment);
|
||||
output_frame->set_label_widget(*output_label);
|
||||
advanced_vbox->pack_start(*advanced_table, Gtk::PACK_SHRINK, 0);
|
||||
advanced_vbox->pack_start(*options_label, Gtk::PACK_SHRINK, 14);
|
||||
advanced_vbox->pack_start(*input_frame);
|
||||
advanced_vbox->pack_start(*output_frame);
|
||||
advanced_label->set_alignment(0.5,0.5);
|
||||
advanced_label->set_padding(0,0);
|
||||
advanced_label->set_justify(Gtk::JUSTIFY_LEFT);
|
||||
advanced_label->set_line_wrap(false);
|
||||
advanced_label->set_use_markup(true);
|
||||
advanced_label->set_selectable(false);
|
||||
advanced_expander->set_flags(Gtk::CAN_FOCUS);
|
||||
advanced_expander->set_border_width(10);
|
||||
advanced_expander->set_expanded(true);
|
||||
advanced_expander->set_spacing(0);
|
||||
advanced_expander->add(*advanced_vbox);
|
||||
advanced_expander->set_label_widget(*advanced_label);
|
||||
new_session_table->set_border_width(5);
|
||||
new_session_table->set_row_spacings(1);
|
||||
new_session_table->set_col_spacings(1);
|
||||
new_session_table->attach(*session_name_label, 0, 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
|
||||
new_session_table->attach(*m_name, 1, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
|
||||
new_session_table->attach(*session_location_label, 0, 1, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
|
||||
new_session_table->attach(*m_folder, 1, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
|
||||
new_session_table->attach(*session_template_label, 0, 1, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
|
||||
new_session_table->attach(*m_template, 1, 2, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
|
||||
new_session_table->attach(*advanced_expander, 0, 2, 3, 4, Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
|
||||
chan_count_label->set_alignment(0.5,0.5);
|
||||
chan_count_label->set_padding(0,0);
|
||||
chan_count_label->set_justify(Gtk::JUSTIFY_LEFT);
|
||||
chan_count_label->set_line_wrap(false);
|
||||
chan_count_label->set_use_markup(false);
|
||||
chan_count_label->set_selectable(false);
|
||||
open_session_hbox->pack_start(*m_open_filechooser);
|
||||
open_session_alignment->add(*open_session_hbox);
|
||||
open_sesion_label->set_alignment(0.5,0.5);
|
||||
open_sesion_label->set_padding(0,0);
|
||||
open_sesion_label->set_justify(Gtk::JUSTIFY_LEFT);
|
||||
open_sesion_label->set_line_wrap(false);
|
||||
open_sesion_label->set_use_markup(false);
|
||||
open_sesion_label->set_selectable(false);
|
||||
open_session_frame->set_border_width(10);
|
||||
open_session_frame->set_shadow_type(Gtk::SHADOW_IN);
|
||||
open_session_frame->set_label_align(0,0.5);
|
||||
open_session_frame->add(*open_session_alignment);
|
||||
open_session_frame->set_label_widget(*open_sesion_label);
|
||||
m_treeview->set_flags(Gtk::CAN_FOCUS);
|
||||
m_treeview->set_headers_visible(true);
|
||||
m_treeview->set_rules_hint(false);
|
||||
m_treeview->set_reorderable(false);
|
||||
m_treeview->set_enable_search(true);
|
||||
m_treeview->set_fixed_height_mode(false);
|
||||
m_treeview->set_hover_selection(false);
|
||||
m_treeview->set_hover_expand(true);
|
||||
recent_scrolledwindow->set_flags(Gtk::CAN_FOCUS);
|
||||
recent_scrolledwindow->set_border_width(10);
|
||||
recent_scrolledwindow->set_shadow_type(Gtk::SHADOW_IN);
|
||||
recent_scrolledwindow->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
|
||||
recent_scrolledwindow->property_window_placement().set_value(Gtk::CORNER_TOP_LEFT);
|
||||
recent_scrolledwindow->add(*m_treeview);
|
||||
recent_alignment->add(*recent_scrolledwindow);
|
||||
recent_sesion_label->set_alignment(0.5,0.5);
|
||||
recent_sesion_label->set_padding(0,0);
|
||||
recent_sesion_label->set_justify(Gtk::JUSTIFY_LEFT);
|
||||
recent_sesion_label->set_line_wrap(false);
|
||||
recent_sesion_label->set_use_markup(false);
|
||||
recent_sesion_label->set_selectable(false);
|
||||
recent_frame->set_border_width(10);
|
||||
recent_frame->set_shadow_type(Gtk::SHADOW_IN);
|
||||
recent_frame->set_label_align(0,0.5);
|
||||
recent_frame->add(*recent_alignment);
|
||||
recent_frame->set_label_widget(*recent_sesion_label);
|
||||
open_session_vbox->pack_start(*open_session_frame, Gtk::PACK_SHRINK, 0);
|
||||
open_session_vbox->pack_start(*recent_frame, Gtk::PACK_EXPAND_WIDGET, 5);
|
||||
m_notebook->set_flags(Gtk::CAN_FOCUS);
|
||||
m_notebook->set_show_tabs(true);
|
||||
m_notebook->set_show_border(true);
|
||||
m_notebook->set_tab_pos(Gtk::POS_TOP);
|
||||
m_notebook->set_scrollable(false);
|
||||
m_notebook->append_page(*new_session_table, _("New Session"));
|
||||
m_notebook->pages().back().set_tab_label_packing(false, true, Gtk::PACK_START);
|
||||
m_notebook->append_page(*open_session_vbox, _("Open Session"));
|
||||
m_notebook->pages().back().set_tab_label_packing(false, true, Gtk::PACK_START);
|
||||
get_vbox()->set_homogeneous(false);
|
||||
get_vbox()->set_spacing(0);
|
||||
get_vbox()->pack_start(*m_notebook, Gtk::PACK_SHRINK, 0);
|
||||
set_title(_("Create New Session"));
|
||||
//set_modal(false);
|
||||
//property_window_position().set_value(Gtk::WIN_POS_NONE);
|
||||
set_resizable(true);
|
||||
//property_destroy_with_parent().set_value(false);
|
||||
set_has_separator(true);
|
||||
add_button(Gtk::Stock::HELP, Gtk::RESPONSE_HELP);
|
||||
add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
|
||||
add_button(Gtk::Stock::CLEAR, Gtk::RESPONSE_NONE);
|
||||
add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
|
||||
show_all_children();
|
||||
|
||||
if (m_treeview) {
|
||||
recent_model = Gtk::TreeStore::create (recent_columns);
|
||||
m_treeview->set_model (recent_model);
|
||||
|
|
@ -85,6 +329,7 @@ NewSessionDialog::NewSessionDialog(BaseObjectType* cobject,
|
|||
m_treeview->get_selection()->set_mode (Gtk::SELECTION_SINGLE);
|
||||
|
||||
}
|
||||
|
||||
std::string path = ARDOUR::get_user_ardour_path() + X_("templates/");
|
||||
if (path == Glib::ustring()) {
|
||||
path = ARDOUR::get_system_data_path() + X_("templates/");
|
||||
|
|
@ -93,8 +338,8 @@ NewSessionDialog::NewSessionDialog(BaseObjectType* cobject,
|
|||
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);
|
||||
set_response_sensitive (Gtk::RESPONSE_OK, false);
|
||||
set_response_sensitive (0, false);
|
||||
m_notebook->show_all_children();
|
||||
m_notebook->set_current_page(0);
|
||||
|
||||
|
|
@ -269,10 +514,9 @@ bool
|
|||
NewSessionDialog::entry_key_release (GdkEventKey* ev)
|
||||
{
|
||||
if (m_name->get_text() != "") {
|
||||
m_new_session_dialog->set_response_sensitive (Gtk::RESPONSE_OK, true);
|
||||
m_new_session_dialog->set_response_sensitive (0, true);
|
||||
set_response_sensitive (Gtk::RESPONSE_OK, true);
|
||||
} else {
|
||||
m_new_session_dialog->set_response_sensitive (Gtk::RESPONSE_OK, false);
|
||||
set_response_sensitive (Gtk::RESPONSE_OK, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -281,24 +525,20 @@ void
|
|||
NewSessionDialog::notebook_page_changed (GtkNotebookPage* np, uint pagenum)
|
||||
{
|
||||
if (pagenum == 1) {
|
||||
m_new_session_dialog->set_response_sensitive (0, false);
|
||||
m_okbutton->set_label(_("Open"));
|
||||
m_okbutton->set_image (*(new Gtk::Image (Gtk::Stock::OPEN, Gtk::ICON_SIZE_BUTTON)));
|
||||
if (m_treeview->get_selection()->count_selected_rows() == 0) {
|
||||
m_new_session_dialog->set_response_sensitive (Gtk::RESPONSE_OK, false);
|
||||
// m_okbutton->set_label(_("Open"));
|
||||
//m_okbutton->set_image (*(new Gtk::Image (Gtk::Stock::OPEN, Gtk::ICON_SIZE_BUTTON)));
|
||||
if (m_treeview->get_selection()->count_selected_rows() == 0) {
|
||||
set_response_sensitive (Gtk::RESPONSE_OK, false);
|
||||
} else {
|
||||
m_new_session_dialog->set_response_sensitive (Gtk::RESPONSE_OK, true);
|
||||
set_response_sensitive (Gtk::RESPONSE_OK, true);
|
||||
}
|
||||
} else {
|
||||
if (m_name->get_text() != "") {
|
||||
m_new_session_dialog->set_response_sensitive (0, true);
|
||||
}
|
||||
m_okbutton->set_label(_("New"));
|
||||
m_okbutton->set_image (*(new Gtk::Image (Gtk::Stock::NEW, Gtk::ICON_SIZE_BUTTON)));
|
||||
// m_okbutton->set_label(_("New"));
|
||||
// m_okbutton->set_image (*(new Gtk::Image (Gtk::Stock::NEW, Gtk::ICON_SIZE_BUTTON)));
|
||||
if (m_name->get_text() == "") {
|
||||
m_new_session_dialog->set_response_sensitive (Gtk::RESPONSE_OK, false);
|
||||
set_response_sensitive (Gtk::RESPONSE_OK, false);
|
||||
} else {
|
||||
m_new_session_dialog->set_response_sensitive (Gtk::RESPONSE_OK, true);
|
||||
set_response_sensitive (Gtk::RESPONSE_OK, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -308,12 +548,12 @@ NewSessionDialog::treeview_selection_changed ()
|
|||
{
|
||||
if (m_treeview->get_selection()->count_selected_rows() == 0) {
|
||||
if (!m_open_filechooser->get_filename().empty()) {
|
||||
m_new_session_dialog->set_response_sensitive (Gtk::RESPONSE_OK, true);
|
||||
set_response_sensitive (Gtk::RESPONSE_OK, true);
|
||||
} else {
|
||||
m_new_session_dialog->set_response_sensitive (Gtk::RESPONSE_OK, false);
|
||||
set_response_sensitive (Gtk::RESPONSE_OK, false);
|
||||
}
|
||||
} else {
|
||||
m_new_session_dialog->set_response_sensitive (Gtk::RESPONSE_OK, true);
|
||||
set_response_sensitive (Gtk::RESPONSE_OK, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -323,7 +563,7 @@ NewSessionDialog::file_chosen ()
|
|||
m_treeview->get_selection()->unselect_all();
|
||||
|
||||
if (m_treeview->get_selection()->count_selected_rows() == 0) {
|
||||
m_new_session_dialog->set_response_sensitive (Gtk::RESPONSE_OK, true);
|
||||
set_response_sensitive (Gtk::RESPONSE_OK, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -341,7 +581,7 @@ NewSessionDialog::template_chosen ()
|
|||
void
|
||||
NewSessionDialog::recent_row_activated (const Gtk::TreePath& path, Gtk::TreeViewColumn* col)
|
||||
{
|
||||
m_new_session_dialog->response (Gtk::RESPONSE_YES);
|
||||
response (Gtk::RESPONSE_YES);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -24,17 +24,22 @@
|
|||
#define NEW_SESSION_DIALOG_H
|
||||
|
||||
#include <string>
|
||||
#include <gtkmm/dialog.h>
|
||||
#include <gtkmm/treeview.h>
|
||||
#include <gtkmm/treestore.h>
|
||||
#include <gtkmm/treepath.h>
|
||||
#include <gtkmm/scrolledwindow.h>
|
||||
#include <gtkmm/notebook.h>
|
||||
#include <gtkmm/table.h>
|
||||
#include <gtkmm/alignment.h>
|
||||
#include <gtkmm/frame.h>
|
||||
#include <gtkmm/expander.h>
|
||||
|
||||
#include <ardour/utils.h>
|
||||
|
||||
#include <glibmm/refptr.h>
|
||||
|
||||
#include "ardour_dialog.h"
|
||||
|
||||
namespace Gtk {
|
||||
class Entry;
|
||||
class FileChooserButton;
|
||||
|
|
@ -45,26 +50,11 @@ namespace Gtk {
|
|||
class Notebook;
|
||||
}
|
||||
|
||||
#include "glade_factory.h"
|
||||
|
||||
struct NewSessionDialogFactory : public GladeFactory
|
||||
{
|
||||
static GladeRef create();
|
||||
|
||||
static const char* top_level_widget_name();
|
||||
|
||||
private:
|
||||
|
||||
static const char* s_m_top_level_widget_name;
|
||||
|
||||
};
|
||||
|
||||
class NewSessionDialog : public Gtk::Dialog
|
||||
class NewSessionDialog : public ArdourDialog
|
||||
{
|
||||
public:
|
||||
|
||||
NewSessionDialog(BaseObjectType* cobject,
|
||||
const Glib::RefPtr<Gnome::Glade::Xml>& xml);
|
||||
NewSessionDialog();
|
||||
|
||||
void set_session_name(const Glib::ustring& name);
|
||||
|
||||
|
|
@ -102,8 +92,39 @@ protected:
|
|||
|
||||
void reset_name();
|
||||
void reset_template();
|
||||
|
||||
// references to widgets we care about.
|
||||
|
||||
Gtk::Label * session_name_label;
|
||||
Gtk::Label * session_location_label;
|
||||
Gtk::Label * session_template_label;
|
||||
Gtk::Label * chan_count_label;
|
||||
Gtk::Table * advanced_table;
|
||||
Gtk::Label * options_label;
|
||||
Gtk::HBox * input_port_limit_hbox;
|
||||
Gtk::HBox * input_port_hbox;
|
||||
Gtk::Table * input_table;
|
||||
Gtk::Alignment * input_port_alignment;
|
||||
Gtk::Label * input_label;
|
||||
Gtk::Frame * input_frame;
|
||||
Gtk::HBox * output_port_limit_hbox;
|
||||
Gtk::HBox * output_port_hbox;
|
||||
Gtk::VBox * output_conn_vbox;
|
||||
Gtk::VBox * output_vbox;
|
||||
Gtk::Alignment * output_port_alignment;
|
||||
Gtk::Label * output_label;
|
||||
Gtk::Frame * output_frame;
|
||||
Gtk::VBox * advanced_vbox;
|
||||
Gtk::Label * advanced_label;
|
||||
Gtk::Expander * advanced_expander;
|
||||
Gtk::Table * new_session_table;
|
||||
Gtk::HBox * open_session_hbox;
|
||||
Gtk::Alignment * open_session_alignment;
|
||||
Gtk::Label * open_sesion_label;
|
||||
Gtk::Frame * open_session_frame;
|
||||
Gtk::ScrolledWindow * recent_scrolledwindow;
|
||||
Gtk::Alignment * recent_alignment;
|
||||
Gtk::Label * recent_sesion_label;
|
||||
Gtk::Frame * recent_frame;
|
||||
Gtk::VBox * open_session_vbox;
|
||||
Gtk::Dialog* m_new_session_dialog;
|
||||
Gtk::Entry* m_name;
|
||||
Gtk::FileChooserButton* m_folder;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue