From: John Stebbins Date: Fri, 22 Dec 2017 17:13:25 +0000 (-0800) Subject: LinGui: Some GUI consistency changes X-Git-Tag: 1.1.0~169 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c578a25c03876623ab61729bc4c66293e1d35d57;p=handbrake LinGui: Some GUI consistency changes Bold "Title:", "Angle:", "Duration:" Add "Range:" Change "through" to "-" --- diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index a02751a06..eac27e8b9 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -592,7 +592,7 @@ set_destination_settings(signal_user_data_t *ud, GhbValue *settings) // If auto-naming is disabled, this will be the default filename. GString *str = g_string_new(""); const gchar *vol_name; - vol_name = ghb_dict_get_string(settings, "volume_label"); + vol_name = ghb_dict_get_string(settings, "volume"); g_string_append_printf(str, "%s", vol_name); g_string_append_printf(str, ".%s", extension); filename = g_string_free(str, FALSE); @@ -610,7 +610,7 @@ set_destination_settings(signal_user_data_t *ud, GhbValue *settings) if (!strncmp(p, "{source}", strlen("{source}"))) { const gchar *vol_name; - vol_name = ghb_dict_get_string(settings, "volume_label"); + vol_name = ghb_dict_get_string(settings, "volume"); g_string_append_printf(str, "%s", vol_name); p += strlen("{source}"); } @@ -847,18 +847,18 @@ update_source_label(signal_user_data_t *ud, const gchar *source) label = get_file_label(filename); } g_free(filename); - GtkWidget *widget = GHB_WIDGET (ud->builder, "volume_label"); + GtkWidget *widget = GHB_WIDGET (ud->builder, "source_label"); if (label != NULL) { gtk_label_set_text (GTK_LABEL(widget), label); - ghb_dict_set_string(ud->globals, "volume_label", label); + ghb_dict_set_string(ud->globals, "volume", label); g_free(label); } else { label = _("No Title Found"); gtk_label_set_text (GTK_LABEL(widget), label); - ghb_dict_set_string(ud->globals, "volume_label", label); + ghb_dict_set_string(ud->globals, "volume", label); return FALSE; } return TRUE; @@ -2169,6 +2169,7 @@ ghb_set_title_settings(signal_user_data_t *ud, GhbValue *settings) if (title != NULL) { GhbValue *job_dict; + char * source_name; job_dict = hb_preset_job_init(ghb_scan_handle(), title_id, settings); ghb_dict_set(settings, "Job", job_dict); @@ -2182,23 +2183,9 @@ ghb_set_title_settings(signal_user_data_t *ud, GhbValue *settings) ghb_dict_set_int(settings, "source_width", title->geometry.width); ghb_dict_set_int(settings, "source_height", title->geometry.height); ghb_dict_set_string(settings, "source", title->path); - if (title->type == HB_STREAM_TYPE || title->type == HB_FF_STREAM_TYPE) - { - if (title->name != NULL && title->name[0] != 0) - { - ghb_dict_set_string(settings, "volume_label", title->name); - } - else - { - gchar *label = _("No Title Found"); - ghb_dict_set_string(settings, "volume_label", label); - } - } - else - { - ghb_dict_set(settings, "volume_label", ghb_value_dup( - ghb_dict_get_value(ud->globals, "volume_label"))); - } + source_name = ghb_create_source_label(title); + ghb_dict_set_string(settings, "source_label", source_name); + ghb_dict_set_string(settings, "volume", source_name); int crop[4]; @@ -2269,6 +2256,11 @@ ghb_set_title_settings(signal_user_data_t *ud, GhbValue *settings) } ghb_sanitize_audio_track_settings(settings); } + else + { + ghb_dict_set_string(settings, "source_label", _("No Title Found")); + ghb_dict_set_string(settings, "volume", _("New Video")); + } set_destination_settings(ud, settings); ghb_dict_set(settings, "dest_dir", ghb_value_dup( @@ -2340,13 +2332,18 @@ static gboolean update_preview = FALSE; G_MODULE_EXPORT void title_changed_cb(GtkWidget *widget, signal_user_data_t *ud) { - gint title_id, titleindex, count; + gint title_id, titleindex, count; const hb_title_t * title; + GtkLabel * title_label; + const char * opt; - g_debug("title_changed_cb ()"); title_id = ghb_widget_int(widget); title = ghb_lookup_title(title_id, &titleindex); + opt = ghb_create_title_label(title); + title_label = GTK_LABEL(GHB_WIDGET(ud->builder, "title_label")); + gtk_label_set_markup(title_label, opt); + count = ghb_array_len(ud->settings_array); int idx = (titleindex >= 0 && titleindex < count) ? titleindex : 0; if (ghb_dict_get_bool(ud->prefs, "SyncTitleSettings")) @@ -3683,7 +3680,7 @@ ghb_backend_events(signal_user_data_t *ud) ghb_update_ui_combo_box(ud, "title", NULL, FALSE); load_all_titles(ud, titleindex); - label = GTK_LABEL(GHB_WIDGET (ud->builder, "volume_label")); + label = GTK_LABEL(GHB_WIDGET (ud->builder, "source_label")); ghb_clear_scan_state(GHB_STATE_SCANDONE); // Are there really any titles. @@ -4502,8 +4499,6 @@ ghb_hbfd(signal_user_data_t *ud, gboolean hbfd) widget = GHB_WIDGET(ud->builder, "show_activity"); gtk_widget_set_visible(widget, !hbfd); - widget = GHB_WIDGET(ud->builder, "chapter_box"); - gtk_widget_set_visible(widget, !hbfd); widget = GHB_WIDGET(ud->builder, "container_box"); gtk_widget_set_visible(widget, !hbfd); widget = GHB_WIDGET(ud->builder, "SettingsStackSwitcher"); diff --git a/gtk/src/ghb.m4 b/gtk/src/ghb.m4 index e026744a9..88ceb5d1a 100644 --- a/gtk/src/ghb.m4 +++ b/gtk/src/ghb.m4 @@ -1025,6 +1025,7 @@ libx264 authors: True False True + GTK_ALIGN_FILL GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK @@ -1169,14 +1170,32 @@ Activity - - horizontal + True False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True + 5 + True + GTK_ALIGN_FILL 12 12 - 6 + 2 + + + True + left + 0 + False + <b>Source:</b> + True + + + 0 + 0 + 1 + 1 + + horizontal @@ -1185,20 +1204,7 @@ Activity 6 GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - True - False - <b>Source:</b> - True - - - False - True - 0 - - - - + True 60 False @@ -1230,9 +1236,10 @@ Activity - True - True - 0 + 0 + 1 + 1 + 1 @@ -1241,6 +1248,8 @@ Activity False False 6 + True + GTK_ALIGN_FILL GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK @@ -1275,38 +1284,23 @@ Activity - True - True - 1 + 0 + 1 + 1 + 1 - - - False - True - 1 - - - - - True - False - True - 5 - True - GTK_ALIGN_FILL - 12 - 12 - 2 True + left + 0 False - end - Title: + True + <b>Title:</b> - 0 + 1 0 1 1 @@ -1318,19 +1312,46 @@ Activity True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - GTK_ALIGN_FILL + False + start 5 True GTK_ALIGN_CENTER False + False start + 100 + 1 + False Set the title to encode. By default the longest title is chosen. This is often the feature title of a DVD. False + + + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + GTK_SHADOW_ETCHED_IN + + + 30 + 30 + end + True + False + 6 + 6 + start + 0.0 + True + <small>No Titles</small> + + + + @@ -1344,7 +1365,9 @@ This is often the feature title of a DVD. False False end - Angle: + True + 6 + <b>Angle:</b> False @@ -1371,23 +1394,21 @@ This is often the feature title of a DVD. 2 - - - 0 - 1 - 1 - 1 - - - - - start - center - horizontal - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 5 + + + True + False + end + True + 6 + <b>Range:</b> + + + False + False + 3 + + True @@ -1399,12 +1420,12 @@ This is often the feature title of a DVD. False True - 0 + 4 - 10 + 11 True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK @@ -1420,24 +1441,24 @@ This is often the feature title of a DVD. False True - 1 + 5 True False - through + - False True - 2 + 6 - 10 + 11 True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK @@ -1453,49 +1474,7 @@ This is often the feature title of a DVD. False True - 3 - - - - - horizontal - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 7 - - - True - False - start - Duration: - - - False - True - 0 - - - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - start - hh:mm:ss - 8 - - - False - True - 1 - - - - - False - True - 4 + 7 @@ -1506,120 +1485,123 @@ This is often the feature title of a DVD. 1 - - - False - True - 2 - - - - - start - center - horizontal - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 12 - 12 - 6 - 5 True + left + 0 False <b>Preset:</b> True - False - True - 0 + 2 + 0 + 1 + 1 - + + start + center + horizontal True False - right + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 12 + 6 + 5 - - horizontal + True False + right - - True - False - 50 - 0 - Choose Preset - True - - - True - True - 0 - - - - + + horizontal True False - pan-end-symbolic + + + True + False + 50 + 0 + Choose Preset + True + + + True + True + 0 + + + + + True + False + pan-end-symbolic + + + False + True + 1 + + - - False - True - 1 - + + False + True + 1 + + + + + True + False + 10 + + True + + + True + True + 2 + + + + + Reload + True + True + Reload the encoding settings for the currently selected preset. + Modifications will be discarded. + True + end + app.preset-reload + + + False + True + 3 + - False - True - 1 - - - - - True - False - 10 - - True - - - True - True - 2 - - - - - Reload - True - True - Reload the encoding settings for the currently selected preset. -Modifications will be discarded. - True - end - app.preset-reload - - - False - True - 3 + 2 + 1 + 1 + 1 False True - 3 + 1 @@ -1782,6 +1764,44 @@ sync for broken players that do not honor MP4 edit lists. 1 + + + True + False + 0 + 0 + start + True + 12 + <b>Duration:</b> + + + 4 + 0 + 1 + 1 + + + + + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + start + 0 + 0 + False + hh:mm:ss + 12 + 8 + + + 4 + 1 + 1 + 1 + + True @@ -1794,7 +1814,7 @@ sync for broken players that do not honor MP4 edit lists. True - 4 + 5 0 1 1 @@ -1816,7 +1836,7 @@ sync for broken players that do not honor MP4 edit lists. True - 4 + 5 1 1 8 @@ -1834,7 +1854,7 @@ sync for broken players that do not honor MP4 edit lists. 12 - 12 + 13 0 1 1 @@ -1856,7 +1876,7 @@ sync for broken players that do not honor MP4 edit lists. True - 12 + 13 1 1 4 @@ -7009,7 +7029,7 @@ This file may be reloaded at a later time to edit your jobs and re-encode.end 6 True - <b>Destination:</b> + <b>Save As:</b> 0 diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index 126146cd3..310db858e 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -1335,9 +1335,9 @@ 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, "max-width-chars", 80, NULL); g_object_set(cell, "ellipsize", PANGO_ELLIPSIZE_END, NULL); - gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), cell, TRUE); + gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), cell, FALSE); gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), cell, "markup", 0, "sensitive", 1, NULL); } @@ -2050,17 +2050,52 @@ language_opts_set(signal_user_data_t *ud, const gchar *name, } } +gchar* +ghb_create_source_label(const hb_title_t * title) +{ + char * volname; + char * source; + + if (title != NULL && title->name != NULL && title->name[0] != 0) + { + volname = strdup(title->name); + if (title->type == HB_DVD_TYPE) + { + ghb_sanitize_volname(volname); + } + if (title->type == HB_BD_TYPE) + { + source = g_strdup_printf(_("%s - (%05d.MPLS)"), + volname, title->playlist); + g_free(volname); + } + else + { + source = volname; + } + } + else + { + source = g_strdup(_("No Title Found")); + } + return source; +} + gchar* ghb_create_title_label(const hb_title_t *title) { gchar *label; + if (title == NULL) + { + return g_strdup(_("No Title Found")); + } if (title->type == HB_STREAM_TYPE || title->type == HB_FF_STREAM_TYPE) { if (title->duration != 0) { char *tmp; - tmp = g_strdup_printf (_("%d - %02dh%02dm%02ds - %s"), + tmp = g_strdup_printf (_("%3d - %02dh%02dm%02ds - %s"), title->index, title->hours, title->minutes, title->seconds, title->name); label = g_markup_escape_text(tmp, -1); @@ -2069,7 +2104,7 @@ ghb_create_title_label(const hb_title_t *title) else { char *tmp; - tmp = g_strdup_printf ("%d - %s", + tmp = g_strdup_printf ("%3d - %s", title->index, title->name); label = g_markup_escape_text(tmp, -1); g_free(tmp); @@ -2079,28 +2114,20 @@ ghb_create_title_label(const hb_title_t *title) { if (title->duration != 0) { - label = g_strdup_printf(_("%d (%05d.MPLS) - %02dh%02dm%02ds"), - title->index, title->playlist, title->hours, - title->minutes, title->seconds); + label = g_strdup_printf(_("%3d - %02dh%02dm%02ds - (%05d.MPLS)"), + title->index, title->hours, title->minutes, + title->seconds, title->playlist); } else { - label = g_strdup_printf(_("%d (%05d.MPLS) - Unknown Length"), + label = g_strdup_printf(_("%3d - (%05d.MPLS)"), title->index, title->playlist); } } else { - if (title->duration != 0) - { - label = g_strdup_printf(_("%d - %02dh%02dm%02ds"), - title->index, title->hours, title->minutes, title->seconds); - } - else - { - label = g_strdup_printf(_("%d - Unknown Length"), - title->index); - } + label = g_strdup_printf(_("%3d - %02dh%02dm%02ds"), + title->index, title->hours, title->minutes, title->seconds); } return label; } @@ -4707,8 +4734,8 @@ ghb_get_preview_image( return preview; } -static void -sanitize_volname(gchar *name) +void +ghb_sanitize_volname(gchar *name) { gchar *a, *b; @@ -4740,7 +4767,7 @@ ghb_dvd_volname(const gchar *device) if (name != NULL && name[0] != 0) { name = g_strdup(name); - sanitize_volname(name); + ghb_sanitize_volname(name); return name; } return NULL; diff --git a/gtk/src/hb-backend.h b/gtk/src/hb-backend.h index d3c1410b5..e6b5c4883 100644 --- a/gtk/src/hb-backend.h +++ b/gtk/src/hb-backend.h @@ -230,5 +230,7 @@ char * ghb_get_display_aspect_string(int disp_width, int disp_height); hb_handle_t* ghb_scan_handle(void); hb_handle_t* ghb_queue_handle(void); hb_handle_t* ghb_live_handle(void); +void ghb_sanitize_volname(gchar *name); +gchar* ghb_create_source_label(const hb_title_t * title); #endif // _HBBACKEND_H_ diff --git a/gtk/src/internal_defaults.json b/gtk/src/internal_defaults.json index 91027d825..967a80c31 100644 --- a/gtk/src/internal_defaults.json +++ b/gtk/src/internal_defaults.json @@ -3,7 +3,7 @@ "SkipDiskFreeCheck": false, "show_preview": false, "scan_source": "", - "volume_label": "New Video" + "volume": "New Video" }, "OneTimeInitialization": { "title": "none" @@ -53,7 +53,7 @@ "start_point": 1.0, "start_frame": -1, "title_selected": false, - "volume_label": "New Video", + "source_label": "New Video", "chapter_list": [], "vquality_type_bitrate": false, "vquality_type_constant": false, diff --git a/gtk/src/main.c b/gtk/src/main.c index 6fc69d8e4..5046f0e4c 100644 --- a/gtk/src/main.c +++ b/gtk/src/main.c @@ -794,6 +794,12 @@ const gchar *MyCSS = background: @black; \n\ background-color: @gray32; \n\ color: @white; \n\ +} \n\ + \n\ +entry \n\ +{ \n\ + margin: 0px 0px 0px 0px; \n\ + padding: 0px 0px 0px 0px; \n\ } \n\ " #if GTK_CHECK_VERSION(3, 20, 0) diff --git a/gtk/src/makedeps.py b/gtk/src/makedeps.py index e78b39fd8..4dae9d0e0 100644 --- a/gtk/src/makedeps.py +++ b/gtk/src/makedeps.py @@ -11,7 +11,7 @@ dep_map = ( DepEntry("title", "start_point", "none", True, False), DepEntry("title", "end_point", "none", True, False), DepEntry("title", "angle", "none", True, False), - DepEntry("title", "angle_label", "1", True, False), + DepEntry("title", "angle_label", "none", True, False), DepEntry("angle_count", "angle", "1", True, True), DepEntry("angle_count", "angle_label", "1", True, True), DepEntry("vquality_type_bitrate", "VideoAvgBitrate", "1", False, False), diff --git a/gtk/src/presets.c b/gtk/src/presets.c index 9a650e3de..3978e444c 100644 --- a/gtk/src/presets.c +++ b/gtk/src/presets.c @@ -2706,6 +2706,7 @@ presets_list_selection_changed_cb(GtkTreeSelection *selection, signal_user_data_ { GtkLabel * label; GSimpleAction * action; + GtkWidget * widget; set_preset_menu_button_label(ud, path); label = GTK_LABEL(GHB_WIDGET(ud->builder, @@ -2714,6 +2715,8 @@ presets_list_selection_changed_cb(GtkTreeSelection *selection, signal_user_data_ action = G_SIMPLE_ACTION(g_action_map_lookup_action( G_ACTION_MAP(ud->app), "preset-reload")); g_simple_action_set_enabled(action, FALSE); + widget = GHB_WIDGET(ud->builder, "preset_selection_reload"); + gtk_widget_set_visible(widget, FALSE); } free(path); } @@ -2726,6 +2729,7 @@ ghb_clear_presets_selection(signal_user_data_t *ud) GtkTreeSelection * selection; GtkLabel * label; GSimpleAction * action; + GtkWidget * widget; if (ud->dont_clear_presets) return; treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "presets_list")); @@ -2740,6 +2744,8 @@ ghb_clear_presets_selection(signal_user_data_t *ud) action = G_SIMPLE_ACTION(g_action_map_lookup_action(G_ACTION_MAP(ud->app), "preset-reload")); g_simple_action_set_enabled(action, TRUE); + widget = GHB_WIDGET(ud->builder, "preset_selection_reload"); + gtk_widget_set_visible(widget, TRUE); } G_MODULE_EXPORT void