Commit 4e123e6f authored by Milan Crha's avatar Milan Crha

Bug 203955 - Custom icon/text color for Mail folders

Closes https://bugzilla.gnome.org/show_bug.cgi?id=203955
parent 81dc013c
......@@ -66,6 +66,7 @@ set(SOURCES
e-mail-display-popup-extension.c
e-mail-folder-create-dialog.c
e-mail-folder-pane.c
e-mail-folder-tweaks.c
e-mail-free-form-exp.c
e-mail-junk-options.c
e-mail-label-action.c
......@@ -154,6 +155,7 @@ set(HEADERS
e-mail-enums.h
e-mail-folder-create-dialog.h
e-mail-folder-pane.h
e-mail-folder-tweaks.h
e-mail-free-form-exp.h
e-mail-junk-options.h
e-mail-label-action.h
......
/*
* Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
*
* This library is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "evolution-config.h"
#include <glib-object.h>
#include <gtk/gtk.h>
#include "libemail-engine/libemail-engine.h"
#include "e-mail-folder-tweaks.h"
#define KEY_TEXT_COLOR "Color"
#define KEY_ICON_FILENAME "Icon"
struct _EMailFolderTweaksPrivate {
gchar *config_filename;
GKeyFile *config;
gboolean saving;
};
enum {
CHANGED,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL];
G_DEFINE_TYPE (EMailFolderTweaks, e_mail_folder_tweaks, G_TYPE_OBJECT)
static gboolean
mail_folder_tweaks_save_idle_cb (gpointer user_data)
{
EMailFolderTweaks *tweaks = user_data;
GError *error = NULL;
g_return_val_if_fail (E_IS_MAIL_FOLDER_TWEAKS (tweaks), FALSE);
if (!g_key_file_save_to_file (tweaks->priv->config, tweaks->priv->config_filename, &error)) {
g_warning ("%s: Failed to save tweaks to '%s': %s", G_STRFUNC,
tweaks->priv->config_filename, error ? error->message : "Unknown error");
g_clear_error (&error);
}
tweaks->priv->saving = FALSE;
return FALSE;
}
static void
mail_folder_tweaks_schedule_save (EMailFolderTweaks *tweaks)
{
g_return_if_fail (E_IS_MAIL_FOLDER_TWEAKS (tweaks));
if (!tweaks->priv->saving) {
tweaks->priv->saving = TRUE;
g_idle_add_full (G_PRIORITY_LOW, mail_folder_tweaks_save_idle_cb, g_object_ref (tweaks), g_object_unref);
}
}
static gchar *
mail_folder_tweaks_dup_string (EMailFolderTweaks *tweaks,
const gchar *folder_uri,
const gchar *key)
{
g_return_val_if_fail (E_IS_MAIL_FOLDER_TWEAKS (tweaks), NULL);
g_return_val_if_fail (folder_uri != NULL, NULL);
g_return_val_if_fail (key != NULL, NULL);
return g_key_file_get_string (tweaks->priv->config, folder_uri, key, NULL);
}
static void
mail_folder_tweaks_set_string (EMailFolderTweaks *tweaks,
const gchar *folder_uri,
const gchar *key,
const gchar *value)
{
gboolean changed;
g_return_if_fail (E_IS_MAIL_FOLDER_TWEAKS (tweaks));
g_return_if_fail (folder_uri != NULL);
g_return_if_fail (key != NULL);
if (!value || !*value) {
changed = g_key_file_remove_key (tweaks->priv->config, folder_uri, key, NULL);
if (changed) {
gchar **keys;
keys = g_key_file_get_keys (tweaks->priv->config, folder_uri, NULL, NULL);
/* Remove the whole group, if it's the last key in it */
if (!keys || !keys[0]) {
g_key_file_remove_group (tweaks->priv->config, folder_uri, NULL);
}
g_strfreev (keys);
}
} else {
gchar *stored;
stored = mail_folder_tweaks_dup_string (tweaks, folder_uri, key);
changed = g_strcmp0 (stored, value) != 0;
g_free (stored);
if (changed)
g_key_file_set_string (tweaks->priv->config, folder_uri, key, value);
}
if (changed) {
mail_folder_tweaks_schedule_save (tweaks);
g_signal_emit (tweaks, signals[CHANGED], 0, folder_uri, NULL);
}
}
static GObject *
e_mail_folder_tweaks_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_properties)
{
static GWeakRef singleton;
GObject *result;
result = g_weak_ref_get (&singleton);
if (!result) {
result = G_OBJECT_CLASS (e_mail_folder_tweaks_parent_class)->constructor (type, n_construct_properties, construct_properties);
if (result)
g_weak_ref_set (&singleton, result);
}
return result;
}
static void
e_mail_folder_tweaks_finalize (GObject *object)
{
EMailFolderTweaks *tweaks = E_MAIL_FOLDER_TWEAKS (object);
g_free (tweaks->priv->config_filename);
g_key_file_free (tweaks->priv->config);
/* Chain up to parent's method. */
G_OBJECT_CLASS (e_mail_folder_tweaks_parent_class)->finalize (object);
}
static void
e_mail_folder_tweaks_class_init (EMailFolderTweaksClass *klass)
{
GObjectClass *object_class;
g_type_class_add_private (klass, sizeof (EMailFolderTweaksPrivate));
object_class = G_OBJECT_CLASS (klass);
object_class->constructor = e_mail_folder_tweaks_constructor;
object_class->finalize = e_mail_folder_tweaks_finalize;
signals[CHANGED] = g_signal_new (
"changed",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_ACTION,
G_STRUCT_OFFSET (EMailFolderTweaksClass, changed),
NULL, NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1,
G_TYPE_STRING);
}
static void
e_mail_folder_tweaks_init (EMailFolderTweaks *tweaks)
{
tweaks->priv = G_TYPE_INSTANCE_GET_PRIVATE (tweaks, E_TYPE_MAIL_FOLDER_TWEAKS, EMailFolderTweaksPrivate);
tweaks->priv->config_filename = g_build_filename (mail_session_get_config_dir (), "folder-tweaks.ini", NULL);
tweaks->priv->config = g_key_file_new ();
/* Ignore errors */
g_key_file_load_from_file (tweaks->priv->config, tweaks->priv->config_filename, G_KEY_FILE_NONE, NULL);
}
EMailFolderTweaks *
e_mail_folder_tweaks_new (void)
{
return g_object_new (E_TYPE_MAIL_FOLDER_TWEAKS, NULL);
}
void
e_mail_folder_tweaks_remove_for_folders (EMailFolderTweaks *tweaks,
const gchar *top_folder_uri)
{
gboolean changed = FALSE;
gchar **groups;
gint ii;
g_return_if_fail (E_IS_MAIL_FOLDER_TWEAKS (tweaks));
g_return_if_fail (top_folder_uri != NULL);
groups = g_key_file_get_groups (tweaks->priv->config, NULL);
if (!groups)
return;
for (ii = 0; groups[ii]; ii++) {
if (g_str_has_prefix (groups[ii], top_folder_uri)) {
changed = g_key_file_remove_group (tweaks->priv->config, groups[ii], NULL);
}
}
g_strfreev (groups);
if (changed)
mail_folder_tweaks_schedule_save (tweaks);
}
gboolean
e_mail_folder_tweaks_get_color (EMailFolderTweaks *tweaks,
const gchar *folder_uri,
GdkRGBA *out_rgba)
{
gchar *stored;
gboolean success;
g_return_val_if_fail (E_IS_MAIL_FOLDER_TWEAKS (tweaks), FALSE);
g_return_val_if_fail (folder_uri != NULL, FALSE);
g_return_val_if_fail (out_rgba != NULL, FALSE);
stored = mail_folder_tweaks_dup_string (tweaks, folder_uri, KEY_TEXT_COLOR);
if (!stored)
return FALSE;
success = gdk_rgba_parse (out_rgba, stored);
g_free (stored);
return success;
}
void
e_mail_folder_tweaks_set_color (EMailFolderTweaks *tweaks,
const gchar *folder_uri,
const GdkRGBA *rgba)
{
gchar *value;
g_return_if_fail (E_IS_MAIL_FOLDER_TWEAKS (tweaks));
g_return_if_fail (folder_uri != NULL);
if (rgba)
value = gdk_rgba_to_string (rgba);
else
value = NULL;
mail_folder_tweaks_set_string (tweaks, folder_uri, KEY_TEXT_COLOR, value);
g_free (value);
}
gchar *
e_mail_folder_tweaks_dup_icon_filename (EMailFolderTweaks *tweaks,
const gchar *folder_uri)
{
g_return_val_if_fail (E_IS_MAIL_FOLDER_TWEAKS (tweaks), FALSE);
g_return_val_if_fail (folder_uri != NULL, FALSE);
return mail_folder_tweaks_dup_string (tweaks, folder_uri, KEY_ICON_FILENAME);
}
void
e_mail_folder_tweaks_set_icon_filename (EMailFolderTweaks *tweaks,
const gchar *folder_uri,
const gchar *icon_filename)
{
g_return_if_fail (E_IS_MAIL_FOLDER_TWEAKS (tweaks));
g_return_if_fail (folder_uri != NULL);
mail_folder_tweaks_set_string (tweaks, folder_uri, KEY_ICON_FILENAME, icon_filename);
}
/*
* Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
*
* This library is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef E_MAIL_FOLDER_TWEAKS_H
#define E_MAIL_FOLDER_TWEAKS_H
#include <glib-object.h>
#include <gtk/gtk.h>
/* Standard GObject macros */
#define E_TYPE_MAIL_FOLDER_TWEAKS \
(e_mail_folder_tweaks_get_type ())
#define E_MAIL_FOLDER_TWEAKS(obj) \
(G_TYPE_CHECK_INSTANCE_CAST \
((obj), E_TYPE_MAIL_FOLDER_TWEAKS, EMailFolderTweaks))
#define E_MAIL_FOLDER_TWEAKS_CLASS(cls) \
(G_TYPE_CHECK_CLASS_CAST \
((cls), E_TYPE_MAIL_FOLDER_TWEAKS, EMailFolderTweaksClass))
#define E_IS_MAIL_FOLDER_TWEAKS(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE \
((obj), E_TYPE_MAIL_FOLDER_TWEAKS))
#define E_IS_MAIL_FOLDER_TWEAKS_CLASS(cls) \
(G_TYPE_CHECK_CLASS_TYPE \
((cls), E_TYPE_MAIL_FOLDER_TWEAKS))
#define E_MAIL_FOLDER_TWEAKS_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS \
((obj), E_TYPE_MAIL_FOLDER_TWEAKS, EMailFolderTweaksClass))
G_BEGIN_DECLS
typedef struct _EMailFolderTweaks EMailFolderTweaks;
typedef struct _EMailFolderTweaksClass EMailFolderTweaksClass;
typedef struct _EMailFolderTweaksPrivate EMailFolderTweaksPrivate;
struct _EMailFolderTweaks {
/*< private >*/
GObject parent;
EMailFolderTweaksPrivate *priv;
};
struct _EMailFolderTweaksClass {
/*< private >*/
GObjectClass parent_class;
void (* changed) (EMailFolderTweaks *tweaks,
const gchar *folder_uri);
};
GType e_mail_folder_tweaks_get_type (void);
EMailFolderTweaks *
e_mail_folder_tweaks_new (void);
void e_mail_folder_tweaks_remove_for_folders
(EMailFolderTweaks *tweaks,
const gchar *top_folder_uri);
gboolean e_mail_folder_tweaks_get_color (EMailFolderTweaks *tweaks,
const gchar *folder_uri,
GdkRGBA *out_rgba);
void e_mail_folder_tweaks_set_color (EMailFolderTweaks *tweaks,
const gchar *folder_uri,
const GdkRGBA *rgba);
gchar * e_mail_folder_tweaks_dup_icon_filename
(EMailFolderTweaks *tweaks,
const gchar *folder_uri);
void e_mail_folder_tweaks_set_icon_filename
(EMailFolderTweaks *tweaks,
const gchar *folder_uri,
const gchar *icon_filename);
G_END_DECLS
#endif /* E_MAIL_FOLDER_TWEAKS_H */
......@@ -35,6 +35,7 @@
#include <e-util/e-util.h>
#include "e-mail-backend.h"
#include "e-mail-folder-tweaks.h"
#include "e-mail-label-dialog.h"
#include "e-mail-notes.h"
#include "e-mail-ui-session.h"
......@@ -85,6 +86,258 @@ emfp_free (EConfig *ec,
g_slist_free (items);
}
typedef struct _FolderTweaksData {
gchar *folder_uri;
EMailFolderTweaks *tweaks; /* referenced */
GtkWidget *widget; /* not referenced */
} FolderTweaksData;
static FolderTweaksData *
folder_tweaks_data_new (const gchar *folder_uri,
EMailFolderTweaks *tweaks,
GtkWidget *widget)
{
FolderTweaksData *ftd;
ftd = g_new0 (FolderTweaksData, 1);
ftd->folder_uri = g_strdup (folder_uri);
ftd->tweaks = g_object_ref (tweaks);
ftd->widget = widget;
return ftd;
}
static void
folder_tweaks_data_free (gpointer ptr,
GClosure *closure)
{
FolderTweaksData *ftd = ptr;
if (ftd) {
g_free (ftd->folder_uri);
g_object_unref (ftd->tweaks);
g_free (ftd);
}
}
static void
tweaks_custom_icon_check_toggled_cb (GtkToggleButton *toggle_button,
FolderTweaksData *ftd)
{
GtkWidget *image;
g_return_if_fail (ftd != NULL);
if (!gtk_toggle_button_get_active (toggle_button)) {
e_mail_folder_tweaks_set_icon_filename (ftd->tweaks, ftd->folder_uri, NULL);
return;
}
image = gtk_button_get_image (GTK_BUTTON (ftd->widget));
if (image && gtk_image_get_storage_type (GTK_IMAGE (image))) {
GIcon *icon = NULL;
gtk_image_get_gicon (GTK_IMAGE (image), &icon, NULL);
if (G_IS_FILE_ICON (icon)) {
GFile *file;
file = g_file_icon_get_file (G_FILE_ICON (icon));
if (file) {
gchar *filename;
filename = g_file_get_path (file);
if (filename) {
e_mail_folder_tweaks_set_icon_filename (ftd->tweaks, ftd->folder_uri, filename);
g_free (filename);
}
}
}
}
}
static void
tweaks_custom_icon_button_clicked_cb (GtkWidget *button,
FolderTweaksData *ftd)
{
GtkWidget *dialog;
GtkWidget *toplevel;
GFile *file;
toplevel = gtk_widget_get_toplevel (button);
dialog = e_image_chooser_dialog_new (_("Select Custom Icon"),
GTK_IS_WINDOW (toplevel) ? GTK_WINDOW (toplevel) : NULL);
file = e_image_chooser_dialog_run (E_IMAGE_CHOOSER_DIALOG (dialog));
gtk_widget_destroy (dialog);
if (file) {
gchar *filename;
filename = g_file_get_path (file);
if (filename) {
GtkWidget *image;
GIcon *custom_icon;
image = gtk_button_get_image (GTK_BUTTON (button));
custom_icon = g_file_icon_new (file);
gtk_image_set_from_gicon (GTK_IMAGE (image), custom_icon, GTK_ICON_SIZE_BUTTON);
g_clear_object (&custom_icon);
e_mail_folder_tweaks_set_icon_filename (ftd->tweaks, ftd->folder_uri, filename);
g_free (filename);
}
g_object_unref (file);
}
}
static void
emfp_add_tweaks_custom_icon_row (GtkBox *vbox,
const gchar *folder_uri,
EMailFolderTweaks *tweaks)
{
GtkWidget *checkbox;
GtkWidget *button;
GtkWidget *image;
GtkWidget *hbox;
gchar *icon_filename;
g_return_if_fail (GTK_IS_BOX (vbox));
g_return_if_fail (folder_uri != NULL);
g_return_if_fail (E_IS_MAIL_FOLDER_TWEAKS (tweaks));
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
gtk_box_pack_start (vbox, hbox, FALSE, FALSE, 0);
checkbox = gtk_check_button_new_with_mnemonic (_("_Use custom icon"));
gtk_box_pack_start (GTK_BOX (hbox), checkbox, FALSE, FALSE, 0);
button = gtk_button_new ();
image = gtk_image_new_from_icon_name (NULL, GTK_ICON_SIZE_BUTTON);
gtk_button_set_image (GTK_BUTTON (button), image);
gtk_button_set_always_show_image (GTK_BUTTON (button), TRUE);
icon_filename = e_mail_folder_tweaks_dup_icon_filename (tweaks, folder_uri);
if (icon_filename &&
g_file_test (icon_filename, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) {
GFile *file;
GIcon *custom_icon;
file = g_file_new_for_path (icon_filename);
custom_icon = g_file_icon_new (file);
g_clear_object (&file);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox), TRUE);
gtk_image_set_from_gicon (GTK_IMAGE (image), custom_icon, GTK_ICON_SIZE_BUTTON);
g_clear_object (&custom_icon);
}
g_free (icon_filename);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
e_binding_bind_property (
checkbox, "active",
button, "sensitive",
G_BINDING_DEFAULT |
G_BINDING_SYNC_CREATE);
g_signal_connect_data (checkbox, "toggled",
G_CALLBACK (tweaks_custom_icon_check_toggled_cb),
folder_tweaks_data_new (folder_uri, tweaks, button), folder_tweaks_data_free, 0);
g_signal_connect_data (button, "clicked",
G_CALLBACK (tweaks_custom_icon_button_clicked_cb),
folder_tweaks_data_new (folder_uri, tweaks, NULL), folder_tweaks_data_free, 0);
gtk_widget_show_all (hbox);
}
static void
tweaks_text_color_check_toggled_cb (GtkToggleButton *toggle_button,
FolderTweaksData *ftd)
{
g_return_if_fail (ftd != NULL);
if (gtk_toggle_button_get_active (toggle_button)) {
GdkRGBA rgba;
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (ftd->widget), &rgba);
e_mail_folder_tweaks_set_color (ftd->tweaks, ftd->folder_uri, &rgba);
} else {
e_mail_folder_tweaks_set_color (ftd->tweaks, ftd->folder_uri, NULL);
}
}
static void
tweaks_text_color_button_color_set_cb (GtkColorButton *col_button,
FolderTweaksData *ftd)
{
GdkRGBA rgba;
g_return_if_fail (ftd != NULL);
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (col_button), &rgba);
e_mail_folder_tweaks_set_color (ftd->tweaks, ftd->folder_uri, &rgba);
}
static void
emfp_add_tweaks_text_color_row (GtkBox *vbox,
const gchar *folder_uri,
EMailFolderTweaks *tweaks)
{
GtkWidget *checkbox;
GtkWidget *button;
GtkWidget *hbox;
GdkRGBA rgba;
g_return_if_fail (GTK_IS_BOX (vbox));
g_return_if_fail (folder_uri != NULL);
g_return_if_fail (E_IS_MAIL_FOLDER_TWEAKS (tweaks));
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
gtk_box_pack_start (vbox, hbox, FALSE, FALSE, 0);
checkbox = gtk_check_button_new_with_mnemonic (_("Use te_xt color"));
gtk_box_pack_start (GTK_BOX (hbox), checkbox, FALSE, FALSE, 0);
button = gtk_color_button_new ();
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
if (e_mail_folder_tweaks_get_color (tweaks, folder_uri, &rgba)) {
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox), TRUE);
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (button), &rgba);
}
e_binding_bind_property (
checkbox, "active",
button, "sensitive",
G_BINDING_DEFAULT |
G_BINDING_SYNC_CREATE);
g_signal_connect_data (checkbox, "toggled",
G_CALLBACK (tweaks_text_color_check_toggled_cb),
folder_tweaks_data_new (folder_uri, tweaks, button), folder_tweaks_data_free, 0);
g_signal_connect_data (button, "color-set",
G_CALLBACK (tweaks_text_color_button_color_set_cb),
folder_tweaks_data_new (folder_uri, tweaks, NULL), folder_tweaks_data_free, 0);
gtk_widget_show_all (hbox);
}
static void
mail_identity_combo_box_changed_cb (GtkComboBox *combo_box,
EMailSendAccountOverride *account_override)
......@@ -462,6 +715,39 @@ emfp_get_folder_item (EConfig *ec,
return table;
}
static GtkWidget *
emfp_get_appearance_item (EConfig *ec,
EConfigItem *item,
GtkWidget *parent,
GtkWidget *old,
gint position,
gpointer user_data)
{
AsyncContext *context = user_data;
GtkBox *vbox;
EMailFolderTweaks *tweaks;
gchar *folder_uri;
if (old)
return old;
vbox = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 6));
gtk_widget_show (GTK_WIDGET (vbox));
gtk_box_pack_start (GTK_BOX (parent), GTK_WIDGET (vbox), TRUE, TRUE, 0);
tweaks = e_mail_folder_tweaks_new ();
folder_uri = e_mail_folder_uri_from_folder (context->folder);
emfp_add_tweaks_custom_icon_row (vbox, folder_uri, tweaks);
emfp_add_tweaks_text_color_row (vbox, folder_uri, tweaks);
g_clear_object (&tweaks);
g_free (folder_uri);
return GTK_WIDGET (vbox);
}
static const gchar *
emfp_autoarchive_config_to_string (EAutoArchiveConfig config)
{
......@@ -1076,22 +1362,22 @@ emfp_get_labels_item (EConfig *ec,
return GTK_WIDGET (grid);
}
#define EMFP_FOLDER_SECTION (2)
static EMConfigItem emfp_items[] = {
{ E_CONFIG_BOOK, (gchar *) "", NULL },
{ E_CONFIG_PAGE, (gchar *) "00.general", (gchar *) N_("General") },
{ E_CONFIG_SECTION, (gchar *) "00.general/00.folder", NULL /* set by code */ },
{ E_CONFIG_ITEM, (gchar *) "00.general/00.folder/00.info", NULL, emfp_get_folder_item },
{ E_CONFIG_PAGE, (gchar *) "10.appearance", (gchar *) N_("Appearance") },
{ E_CONFIG_SECTION, (gchar *) "10.appearance/00.folder", NULL },
{ E_CONFIG_ITEM, (gchar *) "10.appearance/00.folder/00.appearance", NULL, emfp_get_appearance_item },
/* Translators: "Archive" is a noun (This is a tab heading in the mail folder properties) */
{ E_CONFIG_PAGE, (gchar *) "10.autoarchive", (gchar *) N_("Archive") },
{ E_CONFIG_SECTION, (gchar *) "10.autoarchive/00.folder", NULL },
{ E_CONFIG_ITEM, (gchar *) "10.autoarchive/00.folder/00.info", NULL, emfp_get_autoarchive_item },
{ E_CONFIG_PAGE, (gchar *) "20.labels", (gchar *) N_("Labels") },
{ E_CONFIG_SECTION, (gchar *) "20.labels/00.folder", NULL },
{ E_CONFIG_ITEM, (gchar *) "20.labels/00.folder/00.labels", NULL, emfp_get_labels_item }
{ E_CONFIG_PAGE, (gchar *) "20.autoarchive", (gchar *) N_("Archive") },
{ E_CONFIG_SECTION, (gchar *) "20.autoarchive/00.folder", NULL },
{ E_CONFIG_ITEM, (gchar *) "20.autoarchive/00.folder/00.info", NULL, emfp_get_autoarchive_item },
{ E_CONFIG_PAGE, (gchar *) "30.labels", (gchar *) N_("Labels") },
{ E_CONFIG_SECTION, (gchar *) "30.labels/00.folder", NULL },
{ E_CONFIG_ITEM, (gchar *) "30.labels/00.folder/00.labels", NULL, emfp_get_labels_item }
};
static gboolean emfp_items_translated = FALSE;
static void
emfp_dialog_run (AsyncContext *context)
......@@ -1107,6 +1393,7 @@ emfp_dialog_run (AsyncContext *context)
gboolean store_is_local;
gboolean hide_deleted;
GSettings *settings;
const gchar *folder_label;