return bar;
}
+/**
+ * @brief Sets the bar_sort_enabled flag
+ * @param lw
+ * @param attribute_names
+ * @param attribute_values
+ *
+ * Called from rcfile when processing geeqierc.xml on start-up.
+ * It is neccesary to set the bar_sort_enabled flag because
+ * the sort manager and desktop files are set up in the idle loop, and
+ * setup is not yet completed during initialisation.
+ * The flag is checked in layout_editors_reload_idle_cb.
+ * action, mode, selection and filter_key are ignored.
+ */
+void bar_sort_cold_start(LayoutWindow *lw, const gchar **attribute_names, const gchar **attribute_values)
+{
+ gboolean enabled = TRUE;
+ gint action = 0;
+ gint mode = 0;
+ gint selection = 0;
+ gchar *filter_key = NULL;
+
+ while (attribute_names && *attribute_names)
+ {
+ const gchar *option = *attribute_names++;
+ const gchar *value = *attribute_values++;
+
+ if (READ_BOOL_FULL("enabled", enabled)) continue;
+ if (READ_INT_CLAMP_FULL("action", action, 0, BAR_SORT_ACTION_COUNT - 1)) continue;
+ if (READ_INT_CLAMP_FULL("mode", mode, 0, BAR_SORT_MODE_COUNT - 1)) continue;
+ if (READ_INT_CLAMP_FULL("selection", selection, 0, BAR_SORT_SELECTION_COUNT - 1)) continue;
+ if (READ_CHAR_FULL("filter_key", filter_key)) continue;
+
+ log_printf("unknown attribute %s = %s\n", option, value);
+ }
+
+ lw->bar_sort_enabled = enabled;
+}
+
GtkWidget *bar_sort_new_default(LayoutWindow *lw)
{
return bar_sort_new_from_config(lw, NULL, NULL);
void bar_sort_close(GtkWidget *bar);
void bar_sort_write_config(GtkWidget *bar, GString *outstr, gint indent);
-
+void bar_sort_cold_start(LayoutWindow *lw, const gchar **attribute_names, const gchar **attribute_values);
#endif
/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
options_parse_func_push(parser_data, options_parse_bar, NULL, lw->bar);
}
-#if 0
-/* FIXME: The sort manager and desktop files are set up in the idle loop.
- * Setup is not yet completed when the layout is first displayed.
- */
else if (g_ascii_strcasecmp(element_name, "bar_sort") == 0)
{
- GtkWidget *bar = bar_sort_new_from_config(lw, attribute_names, attribute_values);
- layout_bar_sort_set(lw, bar);
+ bar_sort_cold_start(lw, attribute_names, attribute_values);
options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL);
}
-#endif
else if (g_ascii_strcasecmp(element_name, "toolbar") == 0)
{
options_parse_func_push(parser_data, options_parse_toolbar_and_statusbar, NULL, NULL);