From cb8f50891e804f3768fa3475fb77de961a441498 Mon Sep 17 00:00:00 2001 From: jstebbins Date: Thu, 25 Sep 2008 16:26:49 +0000 Subject: LinGui: Work around a silly treeview formatting bug. If the window hasn't been shown yet, the width request doesn't fully do it's job and cell formatting gets munged. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1762 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- gtk/src/callbacks.c | 57 ++++++++++++++++++++++++++++++++++--------------- gtk/src/ghb.ui | 2 +- gtk/src/main.c | 7 ++++++ gtk/src/resource_data.h | 4 ++-- gtk/src/resources.plist | 2 +- 5 files changed, 51 insertions(+), 21 deletions(-) (limited to 'gtk') diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index 708f5686d..7b8896e26 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -2411,8 +2411,8 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) info = g_strdup_printf ( "%s " - "(Title %d, Chapters %d through %d, %d Video %s)" - " --> %s", + "(Title %d, Chapters %d through %d, %d Video %s)" + " --> %s", vol_name, title+1, start_chapter, end_chapter, pass2 ? 2:1, pass2 ? "Passes":"Pass", basename ); @@ -2456,20 +2456,24 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) markers = ghb_settings_get_boolean(settings, "chapter_markers"); if (preset_modified) - g_string_append_printf(str, "Customized Preset Based On: %s\n", - preset); + g_string_append_printf(str, + "Customized Preset Based On: %s\n", + preset); else - g_string_append_printf(str, "Preset: %s\n", preset); + g_string_append_printf(str, + "Preset: %s\n", + preset); if (markers) { g_string_append_printf(str, - "Format: %s Container, Chapter Markers\n", container); + "Format: %s Container, Chapter Markers\n", + container); } else { g_string_append_printf(str, - "Format: %s Container\n", container); + "Format: %s Container\n", container); } if (mux == HB_MUX_MP4) { @@ -2480,17 +2484,18 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) large = ghb_settings_get_boolean(settings, "large_mp4"); if (http || ipod || large) { - g_string_append_printf(str, "MP4 Options:"); + g_string_append_printf(str, "MP4 Options:"); if (ipod) g_string_append_printf(str, " - iPod Atom"); if (http) g_string_append_printf(str, " - Http Optimized"); if (large) g_string_append_printf(str, " - 64 Bit"); - g_string_append_printf(str, "\n"); + g_string_append_printf(str, "\n"); } } - g_string_append_printf(str, "Destination: %s\n", dest); + g_string_append_printf(str, + "Destination: %s\n", dest); width = ghb_settings_get_int(settings, "scale_width"); height = ghb_settings_get_int(settings, "scale_height"); @@ -2571,17 +2576,24 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) source_width = ghb_settings_get_int(settings, "source_width"); source_height = ghb_settings_get_int(settings, "source_height"); g_string_append_printf(str, - "Picture: Source: %d x %d, Output %d x %d %s\n", + "Picture: Source: %d x %d, Output %d x %d %s\n", source_width, source_height, width, height, aspect_desc); gboolean decomb; + gboolean filters = FALSE; decomb = ghb_settings_get_boolean(settings, "decomb"); - g_string_append_printf(str, "Filters:"); + g_string_append_printf(str, "Filters:"); if (ghb_settings_get_boolean(settings, "detelecine")) + { g_string_append_printf(str, " - Detelecine"); + filters = TRUE; + } if (decomb) + { g_string_append_printf(str, " - Decomb"); + filters = TRUE; + } else { gint deint = ghb_settings_combo_int(settings, @@ -2591,6 +2603,7 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) const gchar *opt = ghb_settings_combo_option(settings, tweaks ? "tweak_deinterlace":"deinterlace"); g_string_append_printf(str, " - Deinterlace: %s", opt); + filters = TRUE; } } gint denoise = ghb_settings_combo_int(settings, @@ -2600,27 +2613,37 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) const gchar *opt = ghb_settings_combo_option(settings, tweaks ? "tweak_denoise":"denoise"); g_string_append_printf(str, " - Denoise: %s", opt); + filters = TRUE; } gint deblock = ghb_settings_get_int(settings, "deblock"); if (deblock >= 5) + { g_string_append_printf(str, " - Deblock (%d)", deblock); + filters = TRUE; + } if (ghb_settings_get_boolean(settings, "grayscale")) + { g_string_append_printf(str, " - Grayscale"); - g_string_append_printf(str, "\n"); + filters = TRUE; + } + if (!filters) + g_string_append_printf(str, " None"); + g_string_append_printf(str, "\n"); g_string_append_printf(str, - "Video: %s, Framerate: %s, %s %d%s\n", + "Video: %s, Framerate: %s, %s %d%s\n", vcodec, fps, vq_desc, vqvalue, vq_units); turbo = ghb_settings_get_boolean(settings, "turbo"); if (turbo) { - g_string_append_printf(str, "Turbo: On\n"); + g_string_append_printf(str, "Turbo: On\n"); } if (strcmp(vcodec_abbr, "x264") == 0) { gchar *x264opts = ghb_build_x264opts_string(settings); - g_string_append_printf(str, "x264 Options: %s\n", x264opts); + g_string_append_printf(str, + "x264 Options: %s\n", x264opts); g_free(x264opts); } // Add the audios @@ -2648,7 +2671,7 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) track = ghb_settings_get_string(asettings, "audio_track_long"); mix = ghb_settings_combo_option(asettings, "audio_mix"); g_string_append_printf(str, - "Audio: %s, Encoder: %s, Mixdown: %s, SampleRate: %s, Bitrate: %s", + "Audio: %s, Encoder: %s, Mixdown: %s, SampleRate: %s, Bitrate: %s", track, acodec, mix, samplerate, bitrate); if (ii < count-1) g_string_append_printf(str, "\n"); diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui index 18b2a7676..3353255ef 100644 --- a/gtk/src/ghb.ui +++ b/gtk/src/ghb.ui @@ -3958,7 +3958,7 @@ this setting. GTK_POLICY_AUTOMATIC - 1024 + 900 300 True True diff --git a/gtk/src/main.c b/gtk/src/main.c index c03c15032..94e538672 100644 --- a/gtk/src/main.c +++ b/gtk/src/main.c @@ -281,6 +281,13 @@ bind_queue_tree_model (signal_user_data_t *ud) textcell); g_signal_connect(treeview, "drag_data_received", queue_drag_cb, ud); g_signal_connect(treeview, "drag_motion", queue_drag_motion_cb, ud); + + // Work around silly treeview display bug. If the treeview + // hasn't been shown yet, the width request doesn't seem + // to work right. Cells get badly formatted. + GtkWidget *widget = GHB_WIDGET (ud->builder, "queue_window"); + gtk_widget_show (widget); + gtk_widget_hide (widget); } extern void audio_list_selection_changed_cb(void); diff --git a/gtk/src/resource_data.h b/gtk/src/resource_data.h index d517271d1..75866dd03 100644 --- a/gtk/src/resource_data.h +++ b/gtk/src/resource_data.h @@ -6495,8 +6495,8 @@ " <child>\n" " <object class="GtkTreeView" id="queue_l" "ist">\n" -" <property name="width_request">1024<" -"/property>\n" +" <property name="width_request">900</" +"property>\n" " <property name="height_request">300<" "/property>\n" " <property name="visible">True</prope" diff --git a/gtk/src/resources.plist b/gtk/src/resources.plist index c32e361f9..adbc6527a 100644 --- a/gtk/src/resources.plist +++ b/gtk/src/resources.plist @@ -3963,7 +3963,7 @@ this setting.</property> <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> <child> <object class="GtkTreeView" id="queue_list"> - <property name="width_request">1024</property> + <property name="width_request">900</property> <property name="height_request">300</property> <property name="visible">True</property> <property name="can_focus">True</property> -- cgit v1.2.3