Bug #665103 - Blank composer/mail/network preferences windows

This commit is contained in:
Milan Crha
2011-11-29 14:16:55 +01:00
parent b16c246151
commit f2b9a4b609
7 changed files with 40 additions and 7 deletions

View File

@ -1134,7 +1134,6 @@ e_config_create_widget (EConfig *emp)
GPtrArray *items = g_ptr_array_new ();
GList *link;
GSList *l;
/*char *domain = NULL;*/
gint i;
g_return_val_if_fail (emp->target != NULL, NULL);

View File

@ -33,9 +33,6 @@
#include "em-utils.h"
#include "em-composer-utils.h"
#include <gconf/gconf.h>
#include <gconf/gconf-client.h>
#include <e-util/e-util.h>
G_DEFINE_TYPE (EMConfig, em_config, E_TYPE_CONFIG)
@ -52,6 +49,9 @@ em_config_set_target (EConfig *ep,
case EM_CONFIG_TARGET_FOLDER: {
/*EMConfigTargetFolder *s = (EMConfigTargetFolder *)t;*/
break; }
case EM_CONFIG_TARGET_PREFS: {
/*EMConfigTargetPrefs *s = (EMConfigTargetPrefs *)t;*/
break; }
case EM_CONFIG_TARGET_SETTINGS: {
EMConfigTargetSettings *s = (EMConfigTargetSettings *) t;
@ -75,6 +75,8 @@ em_config_target_free (EConfig *ep,
switch (t->type) {
case EM_CONFIG_TARGET_FOLDER:
break;
case EM_CONFIG_TARGET_PREFS:
break;
case EM_CONFIG_TARGET_SETTINGS: {
EMConfigTargetSettings *s = (EMConfigTargetSettings *) t;
@ -90,6 +92,9 @@ em_config_target_free (EConfig *ep,
g_object_unref (s->folder);
break; }
case EM_CONFIG_TARGET_PREFS: {
/* EMConfigTargetPrefs *s = (EMConfigTargetPrefs *) t; */
break; }
case EM_CONFIG_TARGET_SETTINGS: {
EMConfigTargetSettings *s = (EMConfigTargetSettings *) t;
@ -146,6 +151,17 @@ em_config_target_new_folder (EMConfig *emp,
return t;
}
EMConfigTargetPrefs *
em_config_target_new_prefs (EMConfig *emp)
{
EMConfigTargetPrefs *t;
t = e_config_target_new (
&emp->config, EM_CONFIG_TARGET_PREFS, sizeof (*t));
return t;
}
EMConfigTargetSettings *
em_config_target_new_settings (EMConfig *emp,
const gchar *email_address,

View File

@ -57,10 +57,12 @@ typedef struct _EMConfigPrivate EMConfigPrivate;
/* Types of popup tagets */
enum _em_config_target_t {
EM_CONFIG_TARGET_FOLDER,
EM_CONFIG_TARGET_PREFS,
EM_CONFIG_TARGET_SETTINGS
};
typedef struct _EMConfigTargetFolder EMConfigTargetFolder;
typedef struct _EMConfigTargetPrefs EMConfigTargetPrefs;
typedef struct _EMConfigTargetSettings EMConfigTargetSettings;
struct _EMConfigTargetFolder {
@ -69,6 +71,10 @@ struct _EMConfigTargetFolder {
CamelFolder *folder;
};
struct _EMConfigTargetPrefs {
EConfigTarget target;
};
struct _EMConfigTargetSettings {
EConfigTarget target;
@ -98,6 +104,8 @@ EMConfig * em_config_new (gint type,
EMConfigTargetFolder *
em_config_target_new_folder (EMConfig *emp,
CamelFolder *folder);
EMConfigTargetPrefs *
em_config_target_new_prefs (EMConfig *emp);
EMConfigTargetSettings *
em_config_target_new_settings (EMConfig *emp,
const gchar *email_address,

View File

@ -34,6 +34,7 @@ static const EConfigHookTargetMask no_masks[] = {
static const EConfigHookTargetMap targets[] = {
{ "folder", EM_CONFIG_TARGET_FOLDER, no_masks },
{ "prefs", EM_CONFIG_TARGET_PREFS, no_masks },
{ "settings", EM_CONFIG_TARGET_SETTINGS, no_masks },
{ NULL }
};

View File

@ -326,8 +326,8 @@ em_composer_prefs_construct (EMComposerPrefs *prefs,
GtkListStore *store;
GtkTreeSelection *selection;
GtkCellRenderer *renderer;
GConfClient *client;
EMConfig *ec;
EMConfigTargetPrefs *target;
GSList *l;
gint i;
@ -345,6 +345,7 @@ em_composer_prefs_construct (EMComposerPrefs *prefs,
* @Id: org.gnome.evolution.mail.composerPrefs
* @Type: E_CONFIG_BOOK
* @Class: org.gnome.evolution.mail.config:1.0
* @Target: EMConfigTargetPrefs
*
* The mail composer preferences settings page.
*/
@ -586,10 +587,10 @@ em_composer_prefs_construct (EMComposerPrefs *prefs,
NULL);
/* get our toplevel widget */
client = gconf_client_get_default ();
target = em_config_target_new_prefs (ec);
e_config_set_target ((EConfig *) ec, (EConfigTarget *) target);
toplevel = e_config_create_widget ((EConfig *) ec);
gtk_container_add (GTK_CONTAINER (prefs), toplevel);
g_object_unref (client);
}
GtkWidget *

View File

@ -712,6 +712,7 @@ em_mailer_prefs_construct (EMMailerPrefs *prefs,
gboolean locked;
gint val, i;
EMConfig *ec;
EMConfigTargetPrefs *target;
GSList *l;
shell_settings = e_shell_get_shell_settings (shell);
@ -728,6 +729,7 @@ em_mailer_prefs_construct (EMMailerPrefs *prefs,
* @Id: org.gnome.evolution.mail.prefs
* @Type: E_CONFIG_BOOK
* @Class: org.gnome.evolution.mail.config:1.0
* @Target: EMConfigTargetPrefs
*
* The main mail preferences page.
*/
@ -1113,6 +1115,8 @@ em_mailer_prefs_construct (EMMailerPrefs *prefs,
G_CALLBACK (jh_remove_cb), prefs);
/* get our toplevel widget */
target = em_config_target_new_prefs (ec);
e_config_set_target ((EConfig *) ec, (EConfigTarget *) target);
toplevel = e_config_create_widget ((EConfig *) ec);
gtk_container_add (GTK_CONTAINER (prefs), toplevel);
}

View File

@ -318,6 +318,7 @@ em_network_prefs_construct (EMNetworkPrefs *prefs)
GSList *l, *ignore;
gchar *buf;
EMConfig *ec;
EMConfigTargetPrefs *target;
gboolean locked;
gint i, val, port;
@ -335,6 +336,7 @@ em_network_prefs_construct (EMNetworkPrefs *prefs)
* @Id: org.gnome.evolution.mail.networkPrefs
* @Type: E_CONFIG_BOOK
* @Class: org.gnome.evolution.mail.config:1.0
* @Target: EMConfigTargetPrefs
*
* The network preferences settings page.
*/
@ -520,6 +522,8 @@ em_network_prefs_construct (EMNetworkPrefs *prefs)
}
/* get our toplevel widget */
target = em_config_target_new_prefs (ec);
e_config_set_target ((EConfig *) ec, (EConfigTarget *) target);
toplevel = e_config_create_widget ((EConfig *) ec);
gtk_container_add (GTK_CONTAINER (prefs), toplevel);
}