[pitivi] titleeditor: Make creation and insertion a single operation



commit b6bffd327aee497907af08f0415e5b3add11ceb8
Author: Jean-FranÃois Fortin Tam <nekohayo gmail com>
Date:   Sun Sep 2 21:50:29 2012 -0400

    titleeditor: Make creation and insertion a single operation

 data/ui/titleeditor.ui |   76 +----------------------------------------------
 pitivi/titleeditor.py  |   17 ++++-------
 2 files changed, 8 insertions(+), 85 deletions(-)
---
diff --git a/data/ui/titleeditor.ui b/data/ui/titleeditor.ui
index bf393e5..1c8f698 100644
--- a/data/ui/titleeditor.ui
+++ b/data/ui/titleeditor.ui
@@ -5,7 +5,7 @@
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <child>
-      <object class="GtkInfoBar" id="infobar1">
+      <object class="GtkInfoBar" id="infobar">
         <property name="visible">True</property>
         <property name="app_paintable">True</property>
         <property name="can_focus">False</property>
@@ -45,7 +45,7 @@
             <property name="spacing">6</property>
             <child>
               <object class="GtkButton" id="create">
-                <property name="label" translatable="yes">Create text clip</property>
+                <property name="label" translatable="yes">Create and insert</property>
                 <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
@@ -77,78 +77,6 @@
       </packing>
     </child>
     <child>
-      <object class="GtkInfoBar" id="infobar2">
-        <property name="visible">True</property>
-        <property name="app_paintable">True</property>
-        <property name="can_focus">False</property>
-        <child internal-child="content_area">
-          <object class="GtkBox" id="infobar-content_area3">
-            <property name="can_focus">False</property>
-            <property name="border_width">8</property>
-            <property name="spacing">16</property>
-            <child>
-              <object class="GtkLabel" id="info_bar_label1">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Text clip not in timeline.</property>
-                <property name="wrap">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">True</property>
-            <property name="fill">True</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <action-widgets>
-          <action-widget response="0">insert</action-widget>
-        </action-widgets>
-        <child internal-child="action_area">
-          <object class="GtkButtonBox" id="infobar-action_area3">
-            <property name="can_focus">False</property>
-            <property name="border_width">5</property>
-            <property name="spacing">6</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="insert">
-                <property name="label" translatable="yes">Insert at End of Timeline</property>
-                <property name="use_action_appearance">False</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
-                <signal name="clicked" handler="_insertEndCb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <action-widgets>
-          <action-widget response="0">insert</action-widget>
-        </action-widgets>
-      </object>
-      <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">1</property>
-      </packing>
-    </child>
-    <child>
       <object class="GtkVBox" id="editing_box">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
diff --git a/pitivi/titleeditor.py b/pitivi/titleeditor.py
index 8c04aeb..4447df8 100644
--- a/pitivi/titleeditor.py
+++ b/pitivi/titleeditor.py
@@ -607,12 +607,11 @@ class TitleEditor(Loggable):
         builder = Gtk.Builder()
         builder.add_from_file(os.path.join(get_ui_dir(), "titleeditor.ui"))
         builder.connect_signals(self)
-        self.widget = builder.get_object("box1")
+        self.widget = builder.get_object("box1")  # To be used by tabsmanager
+        self.infobar = builder.get_object("infobar")
         self.editing_box = builder.get_object("editing_box")
         self.textarea = builder.get_object("textview1")
         self.markup_button = builder.get_object("markupToggle")
-        self.info_bar_create = builder.get_object("infobar1")
-        self.info_bar_insert = builder.get_object("infobar2")
 
         buttons = ["bold", "italic", "font", "font_fore_color", "back_color"]
         for button in buttons:
@@ -694,12 +693,11 @@ class TitleEditor(Loggable):
 
     def set_sensitive(self, sensitive):
         if sensitive:
-            self.info_bar_create.hide()
+            self.infobar.hide()
             self.textarea.show()
             self.editing_box.show()
         else:
-            self.info_bar_create.show()
-            self.info_bar_insert.hide()
+            self.infobar.show()
             self.textarea.hide()
             self.editing_box.hide()
 
@@ -781,12 +779,9 @@ class TitleEditor(Loggable):
         source = GES.TimelineTitleSource()
         source.set_text("")
         source.set_duration(long(Gst.SECOND * 5))
-        #Show insert infobar only if created new source
-        self.info_bar_insert.show()
         self.set_source(source, True)
-
-    def _insertEndCb(self, unused_button):
-        self.info_bar_insert.hide()
+        # TODO: insert on the current layer at the playhead position.
+        # If no space is available, create a new layer to insert to on top.
         self.app.gui.timeline_ui.insertEnd([self.source])
         self.app.gui.timeline_ui.timeline.selection.setToObj(self.source, SELECT)
         #After insertion consider as not created



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