<property name="action-name">app.preset-default</property>
</object>
</child>
- <child>
- <object class="GtkMenuItem" id="presets_window_new_folder">
- <property name="label" translatable="yes">_New Folder</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="use_underline">True</property>
- <property name="action-name">app.preset-folder</property>
- </object>
- </child>
<child>
<object class="GtkMenuItem" id="presets_window_export">
<property name="label" translatable="yes">_Export</property>
<property name="action-name">app.preset-default</property>
</object>
</child>
- <child>
- <object class="GtkMenuItem" id="presets_new_folder">
- <property name="label" translatable="yes">_New Folder</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="use_underline">True</property>
- <property name="action-name">app.preset-folder</property>
- </object>
- </child>
<child>
<object class="GtkMenuItem" id="presets_export">
<property name="label" translatable="yes">_Export</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
- <object class="GtkBox" id="hbox41">
- <property name="orientation">horizontal</property>
+ <object class="GtkGrid" id="preset_save_name_table">
<property name="visible">True</property>
+ <property name="row-spacing">2</property>
+ <property name="column-spacing">6</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <child>
+ <object class="GtkLabel" id="preset_save_category_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="halign">end</property>
+ <property name="label" translatable="yes">Category:</property>
+ </object>
+ <packing>
+ <property name="top_attach">0</property>
+ <property name="left_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="PresetCategory">
+ <property name="valign">GTK_ALIGN_CENTER</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="tooltip_text" translatable="yes">Set the category that this preset will be shown under.</property>
+ <signal name="changed" handler="preset_category_changed_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="top_attach">0</property>
+ <property name="left_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="PresetCategoryEntryLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="halign">end</property>
+ <property name="label" translatable="yes">Category Name:</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="left_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="PresetCategoryName">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="max_length">40</property>
+ <property name="activates_default">True</property>
+ <property name="width-chars">30</property>
+ <property name="truncate_multiline">True</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <signal name="changed" handler="preset_category_changed_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="left_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
<child>
<object class="GtkLabel" id="label64">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="halign">start</property>
+ <property name="halign">end</property>
<property name="label" translatable="yes">Preset Name:</property>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
+ <property name="top_attach">2</property>
+ <property name="left_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
<property name="truncate_multiline">True</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
+ <signal name="changed" handler="preset_name_changed_cb" swapped="no"/>
</object>
<packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
+ <property name="top_attach">2</property>
+ <property name="left_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
</object>
#define MAX_NESTED_PRESET 3
-enum
-{
- PRESETS_INVALID = -1,
- PRESETS_BUILTIN = 0,
- PRESETS_CUSTOM
-};
-
static GhbValue *prefsDict = NULL;
static gboolean prefs_modified = FALSE;
static gchar *override_user_config_dir = NULL;
}
void
-ghb_select_preset(signal_user_data_t *ud, const char *name)
+ghb_select_preset(signal_user_data_t *ud, const char *name, int type)
{
hb_preset_index_t *path;
- path = hb_preset_search_index(name, 1);
+ path = hb_preset_search_index(name, 1, type);
if (path != NULL)
{
select_preset2(ud, path);
{
const gchar *color;
- if (type == PRESETS_CUSTOM)
+ if (type == HB_PRESET_TYPE_CUSTOM)
{
color = "DimGray";
if (is_folder)
preset_select_action_cb(GSimpleAction *action, GVariant *param,
signal_user_data_t *ud)
{
- const char * preset_path = g_variant_get_string(param, NULL);
+ const char * preset_path = g_variant_get_string(param, NULL);
+ int type = preset_path[0] - '0';
- ghb_select_preset(ud, preset_path);
+ ghb_select_preset(ud, &preset_path[1], type);
}
G_MODULE_EXPORT void
signal_user_data_t *ud)
{
const char * preset_path;
+ int type;
+ type = ghb_dict_get_int(ud->settings, "Type");
preset_path = ghb_dict_get_string(ud->settings, "PresetFullName");
if (preset_path != NULL)
{
- ghb_select_preset(ud, preset_path);
+ ghb_select_preset(ud, preset_path, type);
}
}
void
ghb_presets_menu_init(signal_user_data_t *ud)
{
- GMenu * menu = g_menu_new();
- hb_preset_index_t * path;
- GhbValue * presets;
- int menu_count, submenu_count, type, ii, jj;
+ GMenu * menu = g_menu_new();
+ hb_preset_index_t * path;
+ GhbValue * presets;
+ int menu_count, submenu_count, type, ii, jj, kk;
+ char ** official_names;
// Add official presets
path = hb_preset_index_init(NULL, 0);
}
menu_count = ghb_array_len(presets);
+ // Menus can't contain the same name twice. Since our preset list
+ // allows official and custom preset categories with the same name
+ // I must modify one of them when duplicates exist :(
+ official_names = calloc(menu_count + 1, sizeof(char*));
+ kk = 0;
path->depth++;
// Process Official Presets in first pass, then Custom Presets
for (type = 0; type < 2; type++)
gboolean is_folder;
GhbValue * folder;
GString * folder_str;
+ char * menu_item_name;
path->index[path->depth-1] = ii;
continue;
}
+ if (type == 0)
+ {
+ // Add folder name to list of official names
+ official_names[kk++] = g_strdup(folder_name);
+ }
+
folder_str = g_string_new("");
- g_string_append_printf(folder_str, "/%s", folder_name);
+ g_string_append_printf(folder_str, "%d/%s",
+ folder_type, folder_name);
if (is_folder)
{
GMenu * submenu = g_menu_new();
g_menu_append(submenu, name, detail_action);
free(preset_path);
}
- g_menu_append_submenu(section, folder_name,
+ if (type == 1 &&
+ g_strv_contains((const char**)official_names, folder_name))
+ {
+ menu_item_name = g_strdup_printf("My %s", folder_name);
+ }
+ else
+ {
+ menu_item_name = g_strdup(folder_name);
+ }
+ g_menu_append_submenu(section, menu_item_name,
G_MENU_MODEL(submenu));
+ g_free(menu_item_name);
}
g_string_free(folder_str, TRUE);
}
g_menu_append_section(menu, type ? "Custom" : "Official",
G_MENU_MODEL(section));
}
+ g_strfreev(official_names);
GtkMenuButton * mb;
2, def ? 2 : 0,
3, color,
4, description,
- 5, type == PRESETS_BUILTIN ? 0 : 1,
+ 5, type == HB_PRESET_TYPE_OFFICIAL ? 0 : 1,
-1);
if (is_folder)
{
2, def ? 2 : 0,
3, color,
4, description,
- 5, type == PRESETS_BUILTIN ? 0 : 1,
+ 5, type == HB_PRESET_TYPE_OFFICIAL ? 0 : 1,
-1);
if (recurse && is_folder)
{
2, def ? 2 : 0,
3, color,
4, description,
- 5, type == PRESETS_BUILTIN ? 0 : 1,
+ 5, type == HB_PRESET_TYPE_OFFICIAL ? 0 : 1,
-1);
if (is_folder)
{
gboolean autoscale, br, constant;
ghb_dict_set_bool(preset, "Default", 0);
- ghb_dict_set_int(preset, "Type", PRESETS_CUSTOM);
+ ghb_dict_set_int(preset, "Type", HB_PRESET_TYPE_CUSTOM);
if (!ghb_dict_get_bool(preset, "PictureWidthEnable"))
{
ghb_dict_remove(preset, "PictureWidth");
store_presets();
}
}
+ ghb_update_ui_combo_box(ud, "PresetCategory", NULL, FALSE);
}
static void
-settings_save(signal_user_data_t *ud, hb_preset_index_t *path, const char *name)
-{
- GhbValue *dict;
- gboolean replace = FALSE, def = FALSE;
-
- dict = hb_preset_get(path);
- if (dict != NULL)
- {
- gboolean is_folder;
- int type;
- const char *s;
-
- def = ghb_dict_get_bool(dict, "Default");
- is_folder = ghb_dict_get_bool(dict, "Folder");
- type = ghb_dict_get_int(dict, "Type");
- s = ghb_dict_get_string(dict, "PresetName");
- if (s == NULL || strcmp(s, name) || type != PRESETS_CUSTOM || is_folder)
+settings_save(signal_user_data_t *ud, const char * category,
+ const char *name, const char * desc)
+{
+ GhbValue * preset, * new_preset;
+ gboolean def = FALSE;
+ hb_preset_index_t * folder_path, * path;
+ char * fullname;
+
+ folder_path = hb_preset_search_index(category, 0, HB_PRESET_TYPE_CUSTOM);
+ if (folder_path->depth <= 0)
+ {
+ GhbValue * new_folder;
+ new_folder = ghb_dict_new();
+ ghb_dict_set_string(new_folder, "PresetName", category);
+ ghb_dict_set(new_folder, "ChildrenArray", ghb_array_new());
+ ghb_dict_set_int(new_folder, "Type", HB_PRESET_TYPE_CUSTOM);
+ ghb_dict_set_bool(new_folder, "Folder", TRUE);
+ int index = hb_preset_append(folder_path, new_folder);
+ if (index >= 0)
{
- // Name changed or original preset was builtin or original
- // was a folder. Don't replace it.
- replace = FALSE;
- path->depth--;
- if (type != PRESETS_CUSTOM)
- {
- // Don't put new custom presets in a builtin folder
- path->depth = 0;
- }
+ folder_path->index[folder_path->depth++] = index;
+ presets_list_append(ud, folder_path);
}
else
{
- replace = TRUE;
+ ghb_log("Failed to create category (%s)...", category);
+ return;
}
+ ghb_value_free(&new_folder);
}
- char * new_name = strdup(name);
- if (!replace)
- {
- // We are creating a new preset. Make sure there is not
- // another preset in this folder that has the same name
- int ii, count, index = 1;
- GhbValue *children;
- children = hb_presets_get_folder_children(path);
- count = ghb_array_len(children);
- do
- {
- for (ii = 0; ii < count; ii++)
- {
- GhbValue *preset;
- const char *s;
+ new_preset = ghb_settings_to_preset(ud->settings);
+ ghb_dict_set_string(new_preset, "PresetName", name);
+ ghb_dict_set_string(new_preset, "PresetDescription", desc);
- preset = ghb_array_get(children, ii);
- s = ghb_dict_get_string(preset, "PresetName");
- if (s != NULL && !strcmp(s, new_name))
- {
- free(new_name);
- new_name = g_strdup_printf("%s (%d)", name, index++);
- break;
- }
- }
- } while (ii < count);
- }
- dict = ghb_settings_to_preset(ud->settings);
- ghb_dict_set_string(dict, "PresetName", new_name);
- free(new_name);
- if (replace)
+ fullname = g_strdup_printf("/%s/%s", category, name);
+ path = hb_preset_search_index(fullname, 0, HB_PRESET_TYPE_CUSTOM);
+ preset = hb_preset_get(path);
+ if (preset != NULL)
{
+ // Replacing an existing preset
+ def = ghb_dict_get_bool(preset, "Default");
+
// If we are replacing the default preset, re-mark it as default
- ghb_dict_set_bool(dict, "Default", def);
+ ghb_dict_set_bool(new_preset, "Default", def);
// Already exists, update its description
- if (hb_preset_set(path, dict) >= 0)
+ if (hb_preset_set(path, new_preset) >= 0)
{
presets_list_update_item(ud, path, FALSE);
}
}
else
{
- // Append to the folder list the source came from
- int index = hb_preset_append(path, dict);
+ // Adding a new preset
+ // Append to the folder
+ int index = hb_preset_append(folder_path, new_preset);
if (index >= 0)
{
- path->index[path->depth++] = index;
- presets_list_append(ud, path);
+ folder_path->index[folder_path->depth++] = index;
+ presets_list_append(ud, folder_path);
}
+ *path = *folder_path;
}
- ghb_value_free(&dict);
+
+
+ free(fullname);
+ ghb_value_free(&new_preset);
+
store_presets();
ghb_presets_menu_reinit(ud);
// Make the new preset the selected item
select_preset2(ud, path);
ud->dont_clear_presets = FALSE;
- return;
-}
-static void
-folder_save(signal_user_data_t *ud, hb_preset_index_t *path, const char *name)
-{
- GhbValue *dict;
-
- dict = hb_preset_get(path);
- if (dict != NULL)
- {
- gboolean is_folder;
- int type;
- const char *s;
-
- is_folder = ghb_dict_get_bool(dict, "Folder");
- type = ghb_dict_get_int(dict, "Type");
- s = ghb_dict_get_string(dict, "PresetName");
- if (s == NULL || strcmp(s, name) || type != PRESETS_CUSTOM || !is_folder)
- {
- // Name changed or original preset was builtin or original
- // was a not a folder. Don't replace it.
- dict = NULL;
- path->depth--;
- if (type != PRESETS_CUSTOM)
- {
- // Don't put new custom presets in a builtin folder
- path->depth = 1;
- }
- }
- }
- if (dict != NULL)
- {
- // Already exists, update its description
- dict = hb_preset_get(path);
- ghb_dict_set(dict, "PresetDescription",
- ghb_value_dup(ghb_dict_get(ud->settings, "PresetDescription")));
- presets_list_update_item(ud, path, FALSE);
- }
- else
- {
- dict = ghb_dict_new();
- ghb_dict_set(dict, "PresetDescription",
- ghb_value_dup(ghb_dict_get(ud->settings, "PresetDescription")));
- ghb_dict_set_string(dict, "PresetName", name);
- ghb_dict_set(dict, "ChildrenArray", ghb_array_new());
- ghb_dict_set_int(dict, "Type", PRESETS_CUSTOM);
- ghb_dict_set_bool(dict, "Folder", TRUE);
- int index = hb_preset_append(path, dict);
- if (index >= 0)
- {
- path->index[path->depth++] = index;
- presets_list_append(ud, path);
- }
- ghb_value_free(&dict);
- }
- store_presets();
+ free(folder_path);
+ free(path);
return;
}
hb_value_free(&dict);
}
-G_MODULE_EXPORT void
-preset_folder_action_cb(GSimpleAction *action, GVariant *param,
- signal_user_data_t *ud)
-{
- GtkWidget *dialog;
- GtkEntry *entry;
- GtkTextView *desc;
- GtkResponseType response;
- hb_preset_index_t *path;
- const gchar *name;
- const gchar *description;
-
- path = get_selected_path(ud);
- name = ghb_dict_get_string(ud->settings, "PresetName");
- description = ghb_dict_get_string(ud->settings, "PresetDescription");
- ghb_ui_update(ud, "FolderDescription", ghb_string_value(description));
-
- desc = GTK_TEXT_VIEW(GHB_WIDGET(ud->builder, "FolderDescription"));
- dialog = GHB_WIDGET(ud->builder, "preset_new_folder_dialog");
- entry = GTK_ENTRY(GHB_WIDGET(ud->builder, "FolderName"));
- gtk_entry_set_text(entry, name);
- response = gtk_dialog_run(GTK_DIALOG(dialog));
- gtk_widget_hide(dialog);
- if (response == GTK_RESPONSE_OK)
- {
- // save the preset
- const gchar *name = gtk_entry_get_text(entry);
- GhbValue *val = ghb_widget_value(GTK_WIDGET(desc));
- ghb_dict_set(ud->settings, "PresetDescription", ghb_value_dup(val));
- folder_save(ud, path, name);
- }
- free(path);
-}
-
G_MODULE_EXPORT void
preset_save_action_cb(GSimpleAction *action, GVariant *param,
signal_user_data_t *ud)
{
- const gchar *name;
- const gchar *fullname;
- hb_preset_index_t *path;
- int width, height;
- gboolean autoscale;
- GtkWidget *dialog;
- GtkEntry *entry;
- GtkTextView *desc;
- GtkResponseType response;
+ const char * category = NULL;
+ const gchar * name;
+ const gchar * fullname;
+ int type;
+ hb_preset_index_t * path;
+ int width, height;
+ gboolean autoscale;
+ GtkWidget * dialog;
+ GtkEntry * entry;
+ GtkTextView * tv;
+ GhbValue * dict;
+ GtkResponseType response;
name = ghb_dict_get_string(ud->settings, "PresetName");
+ type = ghb_dict_get_int(ud->settings, "Type");
fullname = ghb_dict_get_string(ud->settings, "PresetFullName");
width = ghb_dict_get_int(ud->settings, "PictureWidth");
height = ghb_dict_get_int(ud->settings, "PictureHeight");
autoscale = ghb_dict_get_bool(ud->settings, "autoscale");
+
ghb_ui_update(ud, "PictureWidthEnable", ghb_boolean_value(!autoscale));
ghb_ui_update(ud, "PictureHeightEnable", ghb_boolean_value(!autoscale));
- path = hb_preset_search_index(fullname, 0);
- desc = GTK_TEXT_VIEW(GHB_WIDGET(ud->builder, "PresetDescription"));
+ path = hb_preset_search_index(fullname, 0, type);
+
+ // Find an appropriate default category
+ if (path != NULL)
+ {
+ path->depth = 1;
+ dict = hb_preset_get(path);
+ if (ghb_dict_get_bool(dict, "Folder"))
+ {
+ category = ghb_dict_get_string(dict, "PresetName");
+ }
+ free(path);
+ }
+ if (category == NULL)
+ {
+ // Find first custom folder
+ hb_value_t * presets;
+ int ii, count;
+
+ presets = hb_presets_get();
+ count = hb_value_array_len(presets);
+ for (ii = 0; ii < count; ii++)
+ {
+ dict = hb_value_array_get(presets, ii);
+ if (!ghb_dict_get_bool(dict, "Folder"))
+ {
+ continue;
+ }
+ if (ghb_dict_get_int(dict, "Type") == 1)
+ {
+ category = ghb_dict_get_string(dict, "PresetName");
+ break;
+ }
+ }
+ }
+ if (category == NULL)
+ {
+ // Force creation of new category
+ category = "new";
+ }
+ ghb_ui_update(ud, "PresetCategory", ghb_string_value(category));
+ tv = GTK_TEXT_VIEW(GHB_WIDGET(ud->builder, "PresetDescription"));
if (!width)
{
width = ghb_dict_get_int(ud->settings, "scale_width");
gtk_widget_hide(dialog);
if (response == GTK_RESPONSE_OK)
{
+ GtkTextBuffer * buffer;
+ GtkTextIter start, end;
+ char * desc;
+
// save the preset
name = gtk_entry_get_text(entry);
- ghb_widget_to_setting(ud->settings, GTK_WIDGET(desc));
- settings_save(ud, path, name);
+ category = ghb_dict_get_string(ud->settings, "PresetCategory");
+ if (!strcmp(category, "new"))
+ {
+ entry = GTK_ENTRY(GHB_WIDGET(ud->builder, "PresetCategoryEntry"));
+ category = gtk_entry_get_text(entry);
+ }
+ if (category == NULL || category[0] == 0)
+ {
+ ghb_log("Invalid empty category.");
+ return;
+ }
+ buffer = gtk_text_view_get_buffer(tv);
+ gtk_text_buffer_get_bounds(buffer, &start, &end);
+ desc = gtk_text_buffer_get_text(buffer, &start, &end, FALSE);
+ settings_save(ud, category, name, desc);
+ free(desc);
}
- free(path);
+}
+
+static void
+preset_save_set_ok_sensitive(signal_user_data_t *ud)
+{
+ GtkEntry * entry;
+ GtkWidget * ok_button;
+ const char * name;
+ const char * category;
+ const char * category_name;
+ gboolean sensitive;
+
+ ok_button = GHB_WIDGET(ud->builder, "preset_ok");
+
+ category = ghb_dict_get_string(ud->settings, "PresetCategory");
+ entry = GTK_ENTRY(GHB_WIDGET(ud->builder, "PresetName"));
+ name = gtk_entry_get_text(entry);
+ entry = GTK_ENTRY(GHB_WIDGET(ud->builder, "PresetCategoryName"));
+ category_name = gtk_entry_get_text(entry);
+
+ sensitive = name[0] && (strcmp(category, "new") || category_name[0]);
+ gtk_widget_set_sensitive(ok_button, sensitive);
}
G_MODULE_EXPORT void
-preset_type_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
+preset_category_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
ghb_widget_to_setting(ud->settings, widget);
+ preset_save_set_ok_sensitive(ud);
+ ghb_check_dependency(ud, widget, NULL);
+}
+
+G_MODULE_EXPORT void
+preset_name_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
+{
+ preset_save_set_ok_sensitive(ud);
}
G_MODULE_EXPORT void
preset_remove_action_cb(GSimpleAction *action, GVariant *param,
signal_user_data_t *ud)
{
-
+ int type;
const char * fullname;
hb_preset_index_t * path;
- fullname = ghb_dict_get_string(ud->settings, "PresetFullName");
+ type = ghb_dict_get_int(ud->settings, "Type");
+ fullname = ghb_dict_get_string(ud->settings, "PresetFullName");
if (fullname == NULL)
{
return;
}
- path = hb_preset_search_index(fullname, 0);
+ path = hb_preset_search_index(fullname, 0, type);
if (path == NULL)
{
return;
}
}
free(path);
+ ghb_update_ui_combo_box(ud, "PresetCategory", NULL, FALSE);
}
// controls where valid drop locations are
return TRUE;
}
// Don't allow repositioning of builtin presets
- if (src_ptype != PRESETS_CUSTOM)
+ if (src_ptype != HB_PRESET_TYPE_CUSTOM)
{
gdk_drag_status(ctx, 0, time);
return TRUE;
}
else
{
- dst_ptype = PRESETS_CUSTOM;
+ dst_ptype = HB_PRESET_TYPE_CUSTOM;
dst_folder = FALSE;
}
// Don't allow mixing custom presets in the builtins
- if (dst_ptype != PRESETS_CUSTOM)
+ if (dst_ptype != HB_PRESET_TYPE_CUSTOM)
{
gdk_drag_status(ctx, 0, time);
return TRUE;
src_folder = preset_is_folder(src_path);
// Don't allow repositioning of builtin presets
- if (src_ptype != PRESETS_CUSTOM)
+ if (src_ptype != HB_PRESET_TYPE_CUSTOM)
{
free(src_path);
return;