ghb_settings_set_string(settings, "MetaLongDescription",
title->metadata->long_description);
}
+ update_chapter_list_settings(settings);
+ ghb_set_pref_audio_settings(settings);
ghb_set_pref_subtitle_settings(ud, title, settings);
}
- update_chapter_list_settings(settings);
- ghb_set_pref_audio_settings(settings);
set_destination_settings(ud, settings);
ghb_settings_set_value(settings, "dest_dir",
load_all_titles(signal_user_data_t *ud, int titleindex)
{
gint ii, count;
- GValue *preset, *preset_path;
+ GValue *preset, *preset_path = NULL;
GValue *settings_array;
const hb_title_t *title;
settings_array = ghb_array_value_new(count);
preset = ghb_get_current_preset(ud);
- preset_path = ghb_get_current_preset_path(ud);
+ if (preset != NULL)
+ {
+ preset_path = ghb_get_current_preset_path(ud);
+ }
+ else
+ {
+ preset = ud->settings;
+ }
for (ii = 0; ii < count; ii++)
{
int index;
<property name="tooltip_text" translatable="yes">Enable maximum width limit.</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
- <signal name="toggled" handler="setting_widget_changed_cb" swapped="no"/>
+ <signal name="toggled" handler="preset_widget_changed_cb" swapped="no"/>
</object>
<packing>
<property name="top_attach">1</property>
<property name="secondary_icon_activatable">False</property>
<property name="adjustment">adjustment32</property>
<property name="snap_to_ticks">True</property>
- <signal name="value-changed" handler="setting_widget_changed_cb" swapped="no"/>
+ <signal name="value-changed" handler="preset_widget_changed_cb" swapped="no"/>
</object>
<packing>
<property name="top_attach">1</property>
<property name="tooltip_text" translatable="yes">Enable maximum height limit.</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
- <signal name="toggled" handler="setting_widget_changed_cb" swapped="no"/>
+ <signal name="toggled" handler="preset_widget_changed_cb" swapped="no"/>
</object>
<packing>
<property name="top_attach">2</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="adjustment">adjustment33</property>
- <signal name="value-changed" handler="setting_widget_changed_cb" swapped="no"/>
+ <signal name="value-changed" handler="preset_widget_changed_cb" swapped="no"/>
</object>
<packing>
<property name="top_attach">2</property>
ghb_settings_set_value(settings, "scale_width",
ghb_settings_get_value(settings, "PictureWidth"));
- ghb_settings_set_boolean(settings, "preset_modified", FALSE);
-
gboolean uses_max;
gint uses_pic;
gint vqtype;
gtk_widget_destroy(dialog);
}
+GValue*
+get_selected_path(signal_user_data_t *ud)
+{
+ GtkTreeView *treeview;
+ GtkTreeSelection *selection;
+ GtkTreeModel *store;
+ GtkTreeIter iter;
+
+ treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "presets_list"));
+ selection = gtk_tree_view_get_selection(treeview);
+ if (gtk_tree_selection_get_selected(selection, &store, &iter))
+ {
+ GtkTreePath *treepath;
+ gint *indices, len;
+ GValue *path;
+
+ treepath = gtk_tree_model_get_path(store, &iter);
+ indices = gtk_tree_path_get_indices(treepath);
+ len = gtk_tree_path_get_depth(treepath);
+
+ path = preset_path_from_indices(presetsPlist, indices, len);
+ return path;
+ }
+ return NULL;
+}
+
G_MODULE_EXPORT void
preset_export_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
{
gchar *filename;
g_debug("preset_export_clicked_cb ()");
- preset = ghb_settings_get_value (ud->settings, "preset_selection");
+ preset = get_selected_path(ud);
if (preset == NULL)
return;
count = ghb_array_len(preset);
if (count <= 0)
+ {
+ ghb_value_free(preset);
return;
+ }
name = g_value_get_string(ghb_array_get_nth(preset, count-1));
indices = ghb_preset_indices_from_path(presetsPlist, preset, &len);
if (indices == NULL)
+ {
+ ghb_value_free(preset);
return;
+ }
response = gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_hide(dialog);
}
gtk_widget_destroy(dialog);
g_free(indices);
+ ghb_value_free(preset);
}
G_MODULE_EXPORT void
gint count, *indices, len;
g_debug("presets_new_folder_clicked_cb ()");
- preset = ghb_settings_get_value(ud->settings, "preset_selection");
-
+ preset = get_selected_path(ud);
count = ghb_array_len(preset);
if (count > 0)
name = g_value_get_string(ghb_array_get_nth(preset, count-1));
ghb_value_free(dest);
}
g_free(indices);
+ ghb_value_free(preset);
}
G_MODULE_EXPORT void
gint count, *indices, len;
g_debug("presets_save_clicked_cb ()");
- preset = ghb_settings_get_value(ud->settings, "preset_selection");
-
+ preset = get_selected_path(ud);
count = ghb_array_len(preset);
if (count > 0)
name = g_value_get_string(ghb_array_get_nth(preset, count-1));
settings_save(ud, dest);
ghb_value_free(dest);
}
+ ghb_value_free(preset);
}
G_MODULE_EXPORT void
path = gtk_tree_model_get_path(store, &iter);
indices = gtk_tree_path_get_indices(path);
len = gtk_tree_path_get_depth(path);
- gtk_tree_path_free(path);
folder = ghb_presets_get_folder(presetsPlist, indices, len);
dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
gtk_tree_path_free(path);
}
}
+ gtk_tree_path_free(path);
g_free(preset);
}
}
{
GtkTreePath *treepath;
gint *indices, len;
- GValue *path;
gboolean folder;
treepath = gtk_tree_model_get_path(store, &iter);
indices = gtk_tree_path_get_indices(treepath);
len = gtk_tree_path_get_depth(treepath);
- path = preset_path_from_indices(presetsPlist, indices, len);
- ghb_settings_take_value(ud->settings, "preset_selection", path);
-
folder = ghb_presets_get_folder(presetsPlist, indices, len);
if (!folder && !ghb_settings_get_boolean(ud->settings, "preset_reload"))
{
ghb_set_preset_settings_from_indices(ud, indices, len);
+ ghb_settings_set_boolean(ud->settings, "preset_modified", FALSE);
ghb_set_current_title_settings(ud);
ghb_load_settings(ud);
}
gint *indices, len;
g_debug("presets_default_clicked_cb ()");
- preset = ghb_settings_get_value(ud->settings, "preset_selection");
+ preset = get_selected_path(ud);
indices = ghb_preset_indices_from_path(presetsPlist, preset, &len);
if (indices)
{
}
g_free(indices);
}
+ ghb_value_free(preset);
}
G_MODULE_EXPORT void
g_debug("path (%s)", path);
g_debug("text (%s)", text);
- preset = ghb_settings_get_value (ud->settings, "preset_selection");
+ preset = get_selected_path(ud);
dest = ghb_array_value_new(MAX_NESTED_PRESET);
count = ghb_array_len(preset);
ghb_array_copy(dest, preset, count-1);
{
// Already exists
g_free(indices);
+ ghb_value_free(preset);
return;
}
ghb_dict_insert(dict, g_strdup("PresetName"), ghb_string_value_new(text));
store_presets();
gtk_tree_path_free (treepath);
+ ghb_value_free(preset);
+}
+
+G_MODULE_EXPORT void
+preset_widget_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
+{
+ ghb_widget_to_setting(ud->settings, widget);
}