[pitivi] layer: Change name only when different



commit 6f4f8aa1369f5b4d275d8e6c99aee1d8e82bfde5
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Tue May 31 06:53:36 2016 +0200

    layer: Change name only when different
    
    Differential Revision: https://phabricator.freedesktop.org/D1030

 pitivi/timeline/layer.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/timeline/layer.py b/pitivi/timeline/layer.py
index 27b5485..46df60d 100644
--- a/pitivi/timeline/layer.py
+++ b/pitivi/timeline/layer.py
@@ -194,8 +194,13 @@ class LayerControls(Gtk.EventBox, Loggable):
         self.__updateName()
 
     def __name_focus_out_cb(self, unused_widget, unused_event):
+        current_name = self.ges_layer.ui.getName()
+        name = self.name_entry.get_text()
+        if name == current_name:
+            return
+
         with self.app.action_log.started("change layer name"):
-            self.ges_layer.ui.setName(self.name_entry.get_text())
+            self.ges_layer.ui.setName(name)
 
     def __layerPriorityChangedCb(self, unused_ges_layer, unused_pspec):
         self.__updateActions()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]