NO-OP: mark various state property names as explicitly non-translated
[ardour.git] / gtk2_ardour / session_dialog.cc
index 8fb64c01ecdda87326b848deeea3a5a3057d3686..8ad6e2d38834a64ba6a2cc830fa9fa99b5747e70 100644 (file)
@@ -221,8 +221,11 @@ SessionDialog::meta_master_bus_profile (std::string script_path) const
                err = lua.do_file (script_path);
        } catch (luabridge::LuaException const& e) {
                err = -1;
+       }  catch (...) {
+               err = -1;
        }
 
+
        if (err) {
                return UINT32_MAX;
        }
@@ -237,7 +240,7 @@ SessionDialog::meta_master_bus_profile (std::string script_path) const
        }
 
        LuaScriptInfo::ScriptType type = LuaScriptInfo::str2type (nfo["type"].cast<std::string>());
-       if (type != LuaScriptInfo::SessionSetup) {
+       if (type != LuaScriptInfo::SessionInit) {
                return UINT32_MAX;
        }
 
@@ -262,6 +265,11 @@ SessionDialog::master_channel_count ()
 bool
 SessionDialog::use_session_template () const
 {
+       if (!back_button->sensitive () && !new_only) {
+               /* open session -- not create a new one */
+               return false;
+       }
+
        if (!load_template_override.empty()) {
                return true;
        }
@@ -366,7 +374,11 @@ SessionDialog::setup_recent_sessions ()
        recent_session_display.set_model (recent_session_model);
        recent_session_display.append_column (_("Session Name"), recent_session_columns.visible_name);
        recent_session_display.append_column (_("Sample Rate"), recent_session_columns.sample_rate);
+#ifdef MIXBUS
+       recent_session_display.append_column (_("Created With"), recent_session_columns.created_with);
+#else
        recent_session_display.append_column (_("File Resolution"), recent_session_columns.disk_format);
+#endif
        recent_session_display.append_column (_("Last Modified"), recent_session_columns.time_formatted);
        recent_session_display.set_headers_visible (true);
        recent_session_display.get_selection()->set_mode (SELECTION_SINGLE);
@@ -561,12 +573,25 @@ SessionDialog::populate_session_templates ()
 
        template_model->clear ();
 
-       //Add any Lua scripts (factory templates) found in the scripts folder
-       LuaScriptList& ms (LuaScripting::instance ().scripts (LuaScriptInfo::SessionSetup));
+       /* Add Lua Scripts dedicated to session-setup */
+       LuaScriptList& ms (LuaScripting::instance ().scripts (LuaScriptInfo::SessionInit));
        for (LuaScriptList::const_iterator s = ms.begin(); s != ms.end(); ++s) {
-               TreeModel::Row row;
-               row = *(template_model->append ());
-               row[session_template_columns.name] = "Meta: " + (*s)->name;
+               TreeModel::Row row = *(template_model->append ());
+               row[session_template_columns.name] = (*s)->name;
+               row[session_template_columns.path] = "urn:ardour:" + (*s)->path;
+               row[session_template_columns.description] = (*s)->description;
+               row[session_template_columns.created_with_short] = _("{Factory Template}");
+               row[session_template_columns.created_with_long] = _("{Factory Template}");
+       }
+
+       /* Add Lua Action Scripts which can also be used for session-setup */
+       LuaScriptList& as (LuaScripting::instance ().scripts (LuaScriptInfo::EditorAction));
+       for (LuaScriptList::const_iterator s = as.begin(); s != as.end(); ++s) {
+               if (!((*s)->subtype & LuaScriptInfo::SessionSetup)) {
+                       continue;
+               }
+               TreeModel::Row row = *(template_model->append ());
+               row[session_template_columns.name] = (*s)->name;
                row[session_template_columns.path] = "urn:ardour:" + (*s)->path;
                row[session_template_columns.description] = (*s)->description;
                row[session_template_columns.created_with_short] = _("{Factory Template}");
@@ -592,8 +617,8 @@ SessionDialog::populate_session_templates ()
        row[session_template_columns.name] = (_("Empty Template"));
        row[session_template_columns.path] = string();
        row[session_template_columns.description] = _("An empty session with factory default settings.");
-       row[session_template_columns.created_with_short] = _("{Factory Template}");
-       row[session_template_columns.created_with_long] = _("{Factory Template}");
+       row[session_template_columns.created_with_short] = _("");
+       row[session_template_columns.created_with_long] = _("");
 
        //auto-select the first item in the list
        Gtk::TreeModel::Row first = template_model->children()[0];
@@ -666,22 +691,22 @@ SessionDialog::setup_new_session_page ()
                Gtk::ScrolledWindow *template_scroller = manage (new Gtk::ScrolledWindow());
                template_scroller->set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
                template_scroller->add (template_chooser);
-       
+
                Gtk::ScrolledWindow *desc_scroller = manage (new Gtk::ScrolledWindow());
                desc_scroller->set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
                desc_scroller->add (template_desc);
 
-        template_hbox->pack_start (*template_scroller, true, true);
+               template_hbox->pack_start (*template_scroller, true, true);
 
-        template_desc_frame.set_name (X_("TextHighlightFrame"));
-        template_desc_frame.add (*desc_scroller);
+               template_desc_frame.set_name (X_("TextHighlightFrame"));
+               template_desc_frame.add (*desc_scroller);
                template_hbox->pack_start (template_desc_frame, true, true);
        }
 
        //template_desc is the textview that displays the currently selected template's description
        template_desc.set_editable (false);
        template_desc.set_wrap_mode (Gtk::WRAP_WORD);
-       template_desc.set_size_request(300,50);
+       template_desc.set_size_request (300,400);
        template_desc.set_name (X_("TextOnBackground"));
        template_desc.set_border_width (6);
 
@@ -698,13 +723,6 @@ SessionDialog::setup_new_session_page ()
        template_chooser.get_selection()->signal_changed().connect (sigc::mem_fun (*this, &SessionDialog::template_row_selected));
        template_chooser.set_sensitive (true);
 
-       /* --- */
-
-       setup_more_options_box ();
-       more_new_session_options_button.add (more_options_vbox);
-
-       /* --- */
-
        session_new_vbox.pack_start (*template_hbox, true, true);
        session_new_vbox.pack_start (*folder_box, false, true);
        session_new_vbox.pack_start (*name_hbox, false, true);
@@ -849,6 +867,7 @@ SessionDialog::redisplay_recent_sessions ()
                        row[recent_session_columns.tip] = Gtkmm2ext::markup_escape_text (dirname);
                } else {
                        row[recent_session_columns.tip] = Gtkmm2ext::markup_escape_text (dirname + "\n" + string_compose (_("Last modified with: %1"), program_version));
+                       row[recent_session_columns.created_with] = program_version;
                }
 
                ++session_snapshot_count;