inline-display, scrollbars and fixed aspect ratio = fun
[ardour.git] / gtk2_ardour / editor_regions.cc
index ef6adb844a23fcde0855bb6d1efae30112cd211f..63b96f1e64c3288b56638461842f5cbad8faf752 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "gtkmm2ext/choice.h"
 #include "gtkmm2ext/treeutils.h"
+#include "gtkmm2ext/utils.h"
 
 #include "audio_clock.h"
 #include "editor.h"
@@ -48,6 +49,7 @@
 #include "editor_regions.h"
 #include "editor_drag.h"
 #include "main_clock.h"
+#include "tooltips.h"
 #include "ui_config.h"
 
 #include "i18n.h"
@@ -123,18 +125,18 @@ EditorRegions::EditorRegions (Editor* e)
                { 10, S_("Opaque|O"),  _("Region opaque (blocks regions below it from being heard)?") },
                { -1, 0, 0 }
        };
-       
+
        for (int i = 0; ci[i].index >= 0; ++i) {
                col = _display.get_column (ci[i].index);
                l = manage (new Label (ci[i].label));
-               ARDOUR_UI::instance()->set_tip (*l, ci[i].tooltip);
+               set_tooltip (*l, ci[i].tooltip);
                col->set_widget (*l);
                l->show ();
 
                if (ci[i].index > 6) {
                        col->set_expand (false);
                        col->set_alignment (ALIGN_CENTER);
-               } 
+               }
        }
 
        _display.set_headers_visible (true);
@@ -186,6 +188,7 @@ EditorRegions::EditorRegions (Editor* e)
 
        _display.get_selection()->set_mode (SELECTION_MULTIPLE);
        _display.add_object_drag (_columns.region.index(), "regions");
+       _display.set_drag_column (_columns.name.index());
 
        /* setup DnD handling */
 
@@ -389,14 +392,14 @@ EditorRegions::add_region (boost::shared_ptr<Region> region)
                row[_columns.property_toggles_visible] = false;
 
                if (missing_source) {
-                       row[_columns.path] = _("(MISSING) ") + region->source()->name();
+                       row[_columns.path] = _("(MISSING) ") + Gtkmm2ext::markup_escape_text (region->source()->name());
 
                } else {
                        boost::shared_ptr<FileSource> fs = boost::dynamic_pointer_cast<FileSource>(region->source());
                        if (fs) {
-                               row[_columns.path] = fs->path();
+                               row[_columns.path] = Gtkmm2ext::markup_escape_text (fs->path());
                        } else {
-                               row[_columns.path] = region->source()->name();
+                               row[_columns.path] = Gtkmm2ext::markup_escape_text (region->source()->name());
                        }
                }
 
@@ -432,7 +435,7 @@ EditorRegions::add_region (boost::shared_ptr<Region> region)
                        */
 
                        row = *(_model->insert (subrows.end()));
-                       
+
                } else {
                        row = *(_model->append());
                }
@@ -568,7 +571,7 @@ EditorRegions::selection_changed ()
                                        _change_connection.block (false);
                                }
                        }
-                       
+
                }
        } else {
                _editor->get_selection().clear_regions ();
@@ -948,9 +951,9 @@ void
 EditorRegions::populate_row_name (boost::shared_ptr<Region> region, TreeModel::Row const &row)
 {
        if (region->n_channels() > 1) {
-               row[_columns.name] = string_compose("%1  [%2]", region->name(), region->n_channels());
+               row[_columns.name] = string_compose("%1  [%2]", Gtkmm2ext::markup_escape_text (region->name()), region->n_channels());
        } else {
-               row[_columns.name] = region->name();
+               row[_columns.name] = Gtkmm2ext::markup_escape_text (region->name());
        }
 }
 
@@ -958,9 +961,9 @@ void
 EditorRegions::populate_row_source (boost::shared_ptr<Region> region, TreeModel::Row const &row)
 {
         if (boost::dynamic_pointer_cast<SilentFileSource>(region->source())) {
-               row[_columns.path] = _("MISSING ") + region->source()->name();
+               row[_columns.path] = _("MISSING ") + Gtkmm2ext::markup_escape_text (region->source()->name());
        } else {
-               row[_columns.path] = region->source()->name();
+               row[_columns.path] = Gtkmm2ext::markup_escape_text (region->source()->name());
        }
 }
 
@@ -1246,7 +1249,7 @@ EditorRegions::drag_data_received (const RefPtr<Gdk::DragContext>& context,
                framepos_t pos = 0;
                bool copy = ((context->get_actions() & (Gdk::ACTION_COPY | Gdk::ACTION_LINK | Gdk::ACTION_MOVE)) == Gdk::ACTION_COPY);
 
-               if (Profile->get_sae() || UIConfiguration::instance().get_only_copy_imported_files() || copy) {
+               if (UIConfiguration::instance().get_only_copy_imported_files() || copy) {
                        _editor->do_import (paths, Editing::ImportDistinctFiles, Editing::ImportAsRegion, SrcBest, pos);
                } else {
                        _editor->do_embed (paths, Editing::ImportDistinctFiles, ImportAsRegion, pos);