Commit 5dc2f301 authored by GitLab CI's avatar GitLab CI

Merge remote-tracking branch 'upstream/master' into master-build

* upstream/master:
  LinGui: add double-click edit to audio and subtitle lists
parents 657788be 84707dba
Pipeline #66650396 passed with stages
in 62 minutes and 40 seconds
......@@ -1428,19 +1428,15 @@ audio_add_all_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
ghb_update_summary_info(ud);
}
G_MODULE_EXPORT void
audio_edit_clicked_cb(GtkWidget *widget, gchar *path, signal_user_data_t *ud)
static void
audio_edit(GtkTreeView *tv, GtkTreePath *tp, signal_user_data_t *ud)
{
GtkTreeView *tv;
GtkTreePath *tp;
GtkTreeModel *tm;
GtkTreeSelection *ts;
GtkTreeIter ti;
tv = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "audio_list_view"));
ts = gtk_tree_view_get_selection(tv);
tm = gtk_tree_view_get_model(tv);
tp = gtk_tree_path_new_from_string (path);
if (gtk_tree_path_get_depth(tp) > 1) return;
if (gtk_tree_model_get_iter(tm, &ti, tp))
{
......@@ -1474,6 +1470,24 @@ audio_edit_clicked_cb(GtkWidget *widget, gchar *path, signal_user_data_t *ud)
}
}
G_MODULE_EXPORT void
audio_edit_clicked_cb(GtkWidget *widget, gchar *path, signal_user_data_t *ud)
{
GtkTreeView *tv;
GtkTreePath *tp;
tv = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "audio_list_view"));
tp = gtk_tree_path_new_from_string (path);
audio_edit(tv, tp, ud);
}
G_MODULE_EXPORT void
audio_row_activated_cb(GtkTreeView *tv, GtkTreePath *tp,
GtkTreeViewColumn *col, signal_user_data_t *ud)
{
audio_edit(tv, tp, ud);
}
G_MODULE_EXPORT void
audio_remove_clicked_cb(GtkWidget *widget, gchar *path, signal_user_data_t *ud)
{
......
......@@ -4196,6 +4196,7 @@ filter_output([
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1"/>
</child>
<signal name="row-activated" handler="audio_row_activated_cb" swapped="no"/>
</object>
</child>
</object>
......@@ -5008,6 +5009,7 @@ filter_output([
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection2"/>
</child>
<signal name="row-activated" handler="subtitle_row_activated_cb" swapped="no"/>
</object>
</child>
</object>
......
......@@ -1673,19 +1673,15 @@ void ghb_init_subtitle_defaults_ui(signal_user_data_t *ud)
ghb_init_lang_list_model(tv);
}
G_MODULE_EXPORT void
subtitle_edit_clicked_cb(GtkWidget *widget, gchar *path, signal_user_data_t *ud)
static void
subtitle_edit(GtkTreeView *tv, GtkTreePath *tp, signal_user_data_t *ud)
{
GtkTreeView *tv;
GtkTreePath *tp;
GtkTreeModel *tm;
GtkTreeSelection *ts;
GtkTreeIter ti;
tv = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "subtitle_list_view"));
ts = gtk_tree_view_get_selection(tv);
tm = gtk_tree_view_get_model(tv);
tp = gtk_tree_path_new_from_string (path);
if (gtk_tree_path_get_depth(tp) > 1) return;
if (gtk_tree_model_get_iter(tm, &ti, tp))
{
......@@ -1720,6 +1716,24 @@ subtitle_edit_clicked_cb(GtkWidget *widget, gchar *path, signal_user_data_t *ud)
}
}
G_MODULE_EXPORT void
subtitle_edit_clicked_cb(GtkWidget *widget, gchar *path, signal_user_data_t *ud)
{
GtkTreeView *tv;
GtkTreePath *tp;
tv = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "subtitle_list_view"));
tp = gtk_tree_path_new_from_string (path);
subtitle_edit(tv, tp, ud);
}
G_MODULE_EXPORT void
subtitle_row_activated_cb(GtkTreeView *tv, GtkTreePath *tp,
GtkTreeViewColumn *col, signal_user_data_t *ud)
{
subtitle_edit(tv, tp, ud);
}
G_MODULE_EXPORT void
subtitle_remove_clicked_cb(GtkWidget *widget, gchar *path, signal_user_data_t *ud)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment