<property name="action-name">app.preset-save</property>
</object>
</child>
+ <child>
+ <object class="GtkMenuItem" id="presets_window_save_as">
+ <property name="label" translatable="yes">Save _As</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="action-name">app.preset-save-as</property>
+ </object>
+ </child>
<child>
<object class="GtkMenuItem" id="presets_window_remove">
<property name="label" translatable="yes">_Delete</property>
<property name="action-name">app.preset-save</property>
</object>
</child>
+ <child>
+ <object class="GtkMenuItem" id="presets_save_as">
+ <property name="label" translatable="yes">Save _As</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="action-name">app.preset-save-as</property>
+ </object>
+ </child>
<child>
<object class="GtkMenuItem" id="presets_remove">
<property name="label" translatable="yes">_Delete</property>
<property name="can_focus">False</property>
<property name="width-chars">10</property>
<property name="label" translatable="yes"></property>
+ <property name="label" translatable="yes"><u><i>Modified</i></u></property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
+ <child>
+ <object class="GtkButton" id="preset_save_new">
+ <property name="label" translatable="yes">Save New Preset</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip_text" translatable="yes">Reload the encoding settings for the currently selected preset.
+ Modifications will be discarded.</property>
+ <property name="receives_default">True</property>
+ <property name="halign">end</property>
+ <property name="action-name">app.preset-save-as</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="top_attach">2</property>
G_MODULE_EXPORT void
preset_save_action_cb(GSimpleAction *action, GVariant *param, gpointer ud);
G_MODULE_EXPORT void
+preset_save_as_action_cb(GSimpleAction *action, GVariant *param, gpointer ud);
+G_MODULE_EXPORT void
preset_remove_action_cb(GSimpleAction *action, GVariant *param, gpointer ud);
G_MODULE_EXPORT void
preset_default_action_cb(GSimpleAction *action, GVariant *param, gpointer ud);
{ "show-activity", NULL,
NULL, "false", show_activity_action_cb },
{ "preset-save", preset_save_action_cb },
+ { "preset-save-as", preset_save_as_action_cb },
{ "preset-remove", preset_remove_action_cb },
{ "preset-default", preset_default_action_cb },
{ "preset-export", preset_export_action_cb },
hb_value_free(&dict);
}
-G_MODULE_EXPORT void
-preset_save_action_cb(GSimpleAction *action, GVariant *param,
- signal_user_data_t *ud)
+static void preset_save_action(signal_user_data_t *ud, gboolean as)
{
const char * category = NULL;
const gchar * name;
int width, height;
gboolean autoscale;
GtkWidget * dialog;
+ GtkWidget * widget;
GtkEntry * entry;
GtkTextView * tv;
GhbValue * dict;
dialog = GHB_WIDGET(ud->builder, "preset_save_dialog");
entry = GTK_ENTRY(GHB_WIDGET(ud->builder, "PresetName"));
gtk_entry_set_text(entry, name);
+
+ widget = GHB_WIDGET(ud->builder, "PresetName");
+ gtk_widget_set_sensitive(widget, as);
+ widget = GHB_WIDGET(ud->builder, "PresetCategory");
+ gtk_widget_set_sensitive(widget, as);
+
response = gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_hide(dialog);
if (response == GTK_RESPONSE_OK)
}
}
+G_MODULE_EXPORT void
+preset_save_action_cb(GSimpleAction *action, GVariant *param,
+ signal_user_data_t *ud)
+{
+ preset_save_action(ud, FALSE);
+}
+
+G_MODULE_EXPORT void
+preset_save_as_action_cb(GSimpleAction *action, GVariant *param,
+ signal_user_data_t *ud)
+{
+ preset_save_action(ud, TRUE);
+}
+
static void
preset_save_set_ok_sensitive(signal_user_data_t *ud)
{
}
if (!ghb_dict_get_bool(dict, "Folder"))
{
- GtkLabel * label;
GSimpleAction * action;
GtkWidget * widget;
set_preset_menu_button_label(ud, path);
- label = GTK_LABEL(GHB_WIDGET(ud->builder,
- "preset_selection_modified_label"));
- gtk_label_set_markup(label, "");
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_modified_label");
+ gtk_widget_set_visible(widget, FALSE);
widget = GHB_WIDGET(ud->builder, "preset_selection_reload");
gtk_widget_set_visible(widget, FALSE);
+ widget = GHB_WIDGET(ud->builder, "preset_save_new");
+ gtk_widget_set_visible(widget, FALSE);
}
free(path);
}
{
GtkTreeView * treeview;
GtkTreeSelection * selection;
- GtkLabel * label;
GSimpleAction * action;
GtkWidget * widget;
gtk_tree_selection_unselect_all(selection);
ghb_dict_set_bool(ud->settings, "preset_modified", TRUE);
- label = GTK_LABEL(GHB_WIDGET(ud->builder,
- "preset_selection_modified_label"));
- gtk_label_set_markup(label, "<u><i>Modified</i></u>");
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_modified_label");
+ gtk_widget_set_visible(widget, TRUE);
widget = GHB_WIDGET(ud->builder, "preset_selection_reload");
gtk_widget_set_visible(widget, TRUE);
+ widget = GHB_WIDGET(ud->builder, "preset_save_new");
+ gtk_widget_set_visible(widget, TRUE);
}
G_MODULE_EXPORT void