add toolbar; connect to action signals instead of menu items directly

This commit is contained in:
Brandon Lewis 2010-07-22 11:00:15 +02:00 committed by Edward Hervey
parent 9107efb4ac
commit 7bbde00c9b
2 changed files with 69 additions and 19 deletions

View file

@ -54,9 +54,9 @@ void window_destroy_cb (GtkObject * window, App * app);
void quit_item_activate_cb (GtkMenuItem * item, App * app);
void delete_item_activate_cb (GtkMenuItem * item, App * app);
void delete_activate_cb (GtkMenuItem * item, App * app);
void add_file_item_activate_cb (GtkMenuItem * item, App * app);
void add_file_activate_cb (GtkMenuItem * item, App * app);
void app_selection_changed_cb (GtkTreeSelection * selection, App * app);
@ -90,7 +90,7 @@ quit_item_activate_cb (GtkMenuItem * item, App * app)
}
void
delete_item_activate_cb (GtkMenuItem * item, App * app)
delete_activate_cb (GtkMenuItem * item, App * app)
{
/* get a gslist of selected track objects */
GList *objects = NULL;
@ -100,7 +100,7 @@ delete_item_activate_cb (GtkMenuItem * item, App * app)
}
void
add_file_item_activate_cb (GtkMenuItem * item, App * app)
add_file_activate_cb (GtkMenuItem * item, App * app)
{
GST_DEBUG ("add file signal handler");

View file

@ -98,11 +98,11 @@
</child>
<child>
<object class="GtkImageMenuItem" id="delete_item">
<property name="label">gtk-delete</property>
<property name="visible">True</property>
<property name="use_underline">True</property>
<property name="use_action_appearance">True</property>
<property name="related_action">delete</property>
<property name="accel_path">Delete</property>
<property name="use_stock">True</property>
<signal name="activate" handler="delete_item_activate_cb"/>
</object>
</child>
</object>
@ -126,11 +126,10 @@
<property name="visible">True</property>
<child>
<object class="GtkImageMenuItem" id="add_file_item">
<property name="label" translatable="yes">Add file...</property>
<property name="visible">True</property>
<property name="image">image1</property>
<property name="use_stock">False</property>
<signal name="activate" handler="add_file_item_activate_cb"/>
<property name="use_action_appearance">True</property>
<property name="related_action">add_file</property>
<property name="use_stock">True</property>
</object>
</child>
</object>
@ -163,6 +162,51 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkToolbar" id="toolbar1">
<property name="visible">True</property>
<child>
<object class="GtkToolButton" id="add_button">
<property name="visible">True</property>
<property name="related_action">add_file</property>
<property name="use_action_appearance">True</property>
<property name="label" translatable="yes">toolbutton1</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="delete_button">
<property name="visible">True</property>
<property name="related_action">delete</property>
<property name="use_action_appearance">True</property>
<property name="label" translatable="yes">Delete</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="delete_item_activate_cb"/>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkSeparatorToolItem" id="toolbutton3">
<property name="visible">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkVPaned" id="vpaned1">
<property name="visible">True</property>
@ -321,23 +365,29 @@
</child>
</object>
<packing>
<property name="position">1</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
</object>
<object class="GtkTreeSelection" id="selection"/>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="xpad">9</property>
<property name="stock">gtk-add</property>
<property name="icon-size">1</property>
</object>
<object class="GtkSizeGroup" id="LabelSizeGroup">
<widgets>
<widget name="label_duration"/>
<widget name="label_inpoint"/>
<widget name="label_duration"/>
</widgets>
</object>
<object class="GtkAction" id="delete">
<property name="label">Delete</property>
<property name="stock_id">gtk-delete</property>
<property name="always_show_image">True</property>
<signal name="activate" handler="delete_activate_cb"/>
</object>
<object class="GtkAction" id="add_file">
<property name="label">Add File</property>
<property name="stock_id">gtk-add</property>
<property name="always_show_image">True</property>
<signal name="activate" handler="add_file_activate_cb"/>
</object>
</interface>