Update GPL boilerplate and (C)
[ardour.git] / gtk2_ardour / export_timespan_selector.cc
index 21273633832d3498117cf052d2f1489c367416bb..cfed17cf5625d5dc60df7bbe585afd7508d38d67 100644 (file)
@@ -1,22 +1,26 @@
 /*
-    Copyright (C) 2008 Paul Davis
-    Author: Sakari Bergen
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
+ * Copyright (C) 2008-2013 Sakari Bergen <sakari.bergen@beatwaves.net>
+ * Copyright (C) 2008-2017 Paul Davis <paul@linuxaudiosystems.com>
+ * Copyright (C) 2009-2011 Carl Hetherington <carl@carlh.net>
+ * Copyright (C) 2009-2012 David Robillard <d@drobilla.net>
+ * Copyright (C) 2013-2014 Colin Fletcher <colin.m.fletcher@googlemail.com>
+ * Copyright (C) 2015-2016 Tim Mayberry <mojofunk@gmail.com>
+ * Copyright (C) 2015-2019 Robin Gareus <robin@gareus.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
 
 #include <sstream>
 #include <iomanip>
@@ -246,17 +250,9 @@ ExportTimespanSelector::construct_label (ARDOUR::Location const * location) cons
                break;
        }
 
-       // label += _("from ");
-
-       // label += "<span color=\"#7fff7f\">";
        label += start;
-//     label += "</span>";
-
        label += _(" to ");
-
-//     label += "<span color=\"#7fff7f\">";
        label += end;
-//     label += "</span>";
 
        return label;
 }
@@ -413,6 +409,7 @@ ExportTimespanSelectorSingle::ExportTimespanSelectorSingle (ARDOUR::Session * se
        range_view.append_column (*label_col);
 
        range_view.append_column (_("Length"), range_cols.length);
+       range_view.append_column (_("Creation Date"), range_cols.date);
 }
 
 void
@@ -453,6 +450,11 @@ ExportTimespanSelectorSingle::fill_range_list ()
                        row[range_cols.label] = construct_label (*it);
                        row[range_cols.length] = construct_length (*it);
 
+                       Glib::DateTime gdt(Glib::DateTime::create_now_local ((*it)->timestamp()));
+                       row[range_cols.timestamp] = (*it)->timestamp();
+                       row[range_cols.date] = gdt.format ("%F %H:%M");;
+
+
                        add_range_to_selection (*it, false);
 
                        break;
@@ -504,6 +506,12 @@ ExportTimespanSelectorMultiple::ExportTimespanSelectorMultiple (ARDOUR::Session
        range_view.append_column (*label_col);
 
        range_view.append_column (_("Length"), range_cols.length);
+       range_view.append_column (_("Creation Date"), range_cols.date);
+
+       range_list->set_sort_column(5, Gtk::SORT_DESCENDING);
+       Gtk::TreeViewColumn* date_col = range_view.get_column(5); // date column
+       date_col->set_sort_column(7); // set sort as the timestamp
+
 }
 
 void
@@ -534,6 +542,11 @@ ExportTimespanSelectorMultiple::fill_range_list ()
                row[range_cols.name] = (*it)->name();
                row[range_cols.label] = construct_label (*it);
                row[range_cols.length] = construct_length (*it);
+
+               Glib::DateTime gdt(Glib::DateTime::create_now_local ((*it)->timestamp()));
+               row[range_cols.timestamp] = (*it)->timestamp();
+               row[range_cols.date] = gdt.format ("%F %H:%M");;
+
        }
 
        set_selection_from_state ();