summaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2014-02-25 21:01:35 +0000
committerjstebbins <[email protected]>2014-02-25 21:01:35 +0000
commit8f312fa1ea66ec3c30cf00ec283720c5a3e07cc0 (patch)
tree02f7e20f48f208112f5098fb0bad4907f000237d /gtk
parent0d059773392af25d4e86aeda2edf595cd6c5dd92 (diff)
LinGui: add a "Reset All Titles" button
This provides a convenient way for the user to update all currently loaded titles to the current settings. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6085 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk')
-rw-r--r--gtk/src/callbacks.c13
-rw-r--r--gtk/src/ghb.ui122
-rw-r--r--gtk/src/hb-backend.c2
3 files changed, 76 insertions, 61 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index 38ed583d4..13d270f15 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -1927,6 +1927,19 @@ title_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
}
G_MODULE_EXPORT void
+title_reset_clicked_cb(GtkWidget *widget, signal_user_data_t *ud)
+{
+ int title_id, titleindex;
+ const hb_title_t *title;
+
+ title_id = ghb_settings_get_int(ud->settings, "title");
+ title = ghb_lookup_title(title_id, &titleindex);
+ (void)title; // Silence "unused variable" warning
+ load_all_titles(ud, titleindex);
+ ghb_load_settings(ud);
+}
+
+G_MODULE_EXPORT void
ptop_widget_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
gint title_id, titleindex;
diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui
index d9dbc64a4..6a7cd5ec7 100644
--- a/gtk/src/ghb.ui
+++ b/gtk/src/ghb.ui
@@ -1042,11 +1042,9 @@ Here you can adjust cropping, resolution, aspect ratio, and filters.</property>
<object class="GtkGrid" id="table7">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="hexpand">True</property>
<property name="column_spacing">5</property>
<child>
- <placeholder/>
- </child>
- <child>
<object class="GtkAlignment" id="alignment72">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -1076,23 +1074,15 @@ Here you can adjust cropping, resolution, aspect ratio, and filters.</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">5</property>
<child>
- <object class="GtkAlignment" id="alignment75">
+ <object class="GtkComboBox" id="title">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <child>
- <object class="GtkComboBox" id="title">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes">Set the title to encode.
+ <property name="halign">start</property>
+ <property name="tooltip_text" translatable="yes">Set the title to encode.
By default the longest title is chosen.
This is often the feature title of a DVD.</property>
- <property name="has_frame">False</property>
- <signal name="changed" handler="title_changed_cb" swapped="no"/>
- </object>
- </child>
+ <property name="has_frame">False</property>
+ <signal name="changed" handler="title_changed_cb" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
@@ -1100,62 +1090,72 @@ This is often the feature title of a DVD.</property>
<property name="position">0</property>
</packing>
</child>
+ </object>
+ <packing>
+ <property name="top_attach">0</property>
+ <property name="left_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="hbox44">
+ <property name="orientation">horizontal</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">end</property>
+ <property name="hexpand">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkAlignment" id="alignment73">
+ <object class="GtkLabel" id="angle_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <child>
- <object class="GtkBox" id="hbox44">
- <property name="orientation">horizontal</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="spacing">7</property>
- <child>
- <object class="GtkLabel" id="angle_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Angle:</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="angle">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="tooltip_text" translatable="yes">For multi-angle DVD's, select the desired angle to encode.</property>
- <property name="primary_icon_activatable">False</property>
- <property name="secondary_icon_activatable">False</property>
- <property name="adjustment">adjustment27</property>
- <signal name="value-changed" handler="setting_widget_changed_cb" swapped="no"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
+ <property name="label" translatable="yes">Angle:</property>
</object>
<packing>
- <property name="expand">True</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="angle">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="tooltip_text" translatable="yes">For multi-angle DVD's, select the desired angle to encode.</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="adjustment">adjustment27</property>
+ <signal name="value-changed" handler="setting_widget_changed_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkButton" id="title_reset">
+ <property name="label" translatable="yes">Reset All Titles</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip_text" translatable="yes">Apply current settings to all titles</property>
+ <property name="receives_default">True</property>
+ <property name="halign">end</property>
+ <signal name="clicked" handler="title_reset_clicked_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="top_attach">0</property>
- <property name="left_attach">1</property>
+ <property name="left_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
@@ -1287,7 +1287,7 @@ This is often the feature title of a DVD.</property>
</child>
</object>
<packing>
- <property name="expand">False</property>
+ <property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index aca268e89..c7b07481d 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -1178,6 +1178,8 @@ ghb_init_combo_box(GtkComboBox *combo)
{
gtk_cell_layout_clear(GTK_CELL_LAYOUT(combo));
cell = GTK_CELL_RENDERER(gtk_cell_renderer_text_new());
+ g_object_set(cell, "max-width-chars", 60, NULL);
+ g_object_set(cell, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), cell, TRUE);
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), cell,
"markup", 0, "sensitive", 1, NULL);