Tell the user why Insert/Remove Time failed, rather than fail silently.
authorBen Loftis <ben@harrisonconsoles.com>
Fri, 23 Feb 2018 20:37:32 +0000 (14:37 -0600)
committerBen Loftis <ben@harrisonconsoles.com>
Fri, 23 Feb 2018 20:37:32 +0000 (14:37 -0600)
gtk2_ardour/editor_ops.cc

index 7173e267e65425d2c89c42df53689ccb7a5845a1..7ba7e944521ede1628347b04fd81447e12e6d782 100644 (file)
@@ -7588,9 +7588,21 @@ void
 Editor::do_insert_time ()
 {
        if (selection->tracks.empty()) {
+               MessageDialog msg (_("You must first select some tracks to Insert Time."),
+                                  true, MESSAGE_INFO, BUTTONS_OK, true);
+               msg.set_position (WIN_POS_MOUSE);
+               msg.run ();
                return;
        }
 
+       if (Config->get_edit_mode() == Lock) {
+               MessageDialog msg (_("You cannot insert time in Lock Edit mode."),
+                                  true, MESSAGE_INFO, BUTTONS_OK, true);
+               msg.set_position (WIN_POS_MOUSE);
+               msg.run ();
+               return;
+       }
+       
        InsertRemoveTimeDialog d (*this);
        int response = d.run ();
 
@@ -7751,6 +7763,18 @@ void
 Editor::do_remove_time ()
 {
        if (selection->tracks.empty()) {
+               MessageDialog msg (_("You must first select some tracks to Remove Time."),
+                                  true, MESSAGE_INFO, BUTTONS_OK, true);
+               msg.set_position (WIN_POS_MOUSE);
+               msg.run ();
+               return;
+       }
+
+       if (Config->get_edit_mode() == Lock) {
+               MessageDialog msg (_("You cannot remove time in Lock Edit mode."),
+                                  true, MESSAGE_INFO, BUTTONS_OK, true);
+               msg.set_position (WIN_POS_MOUSE);
+               msg.run ();
                return;
        }