Commit d8a099fa authored by Chris Phelps's avatar Chris Phelps
Browse files

Finished implementing panel_applet_gconf calls and added a schema for mailcheck applet defaults

parent 654c863d
......@@ -42,11 +42,17 @@ EXTRA_DIST = GNOME_GenUtilApplet_Factory.server.in.in \
$(PRINTER_BITMAPS) \
$(MAILCHECK_BITMAPS)
mailcheckbitmapsdir = $(datadir)/pixmaps/mailcheck
mailcheckbitmaps_DATA = $(MAILCHECK_BITMAPS)
schemadir = $(sysconfdir)/gconf/schemas
schema_DATA = mailcheck.schemas
serverdir = $(libdir)/bonobo/servers
server_in_files = GNOME_GenUtilApplet_Factory.server.in
server_DATA = $(server_in_files:.server.in=.server)
@INTLTOOL_SERVER_RULE@
mailcheckbitmapsdir = $(datadir)/pixmaps/mailcheck
mailcheckbitmaps_DATA = $(MAILCHECK_BITMAPS)
install-data-local:
GCONF_CONFIG_SOURCE=$(GCONF_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$(schema_DATA)
......@@ -42,11 +42,17 @@ EXTRA_DIST = GNOME_GenUtilApplet_Factory.server.in.in \
$(PRINTER_BITMAPS) \
$(MAILCHECK_BITMAPS)
mailcheckbitmapsdir = $(datadir)/pixmaps/mailcheck
mailcheckbitmaps_DATA = $(MAILCHECK_BITMAPS)
schemadir = $(sysconfdir)/gconf/schemas
schema_DATA = mailcheck.schemas
serverdir = $(libdir)/bonobo/servers
server_in_files = GNOME_GenUtilApplet_Factory.server.in
server_DATA = $(server_in_files:.server.in=.server)
@INTLTOOL_SERVER_RULE@
mailcheckbitmapsdir = $(datadir)/pixmaps/mailcheck
mailcheckbitmaps_DATA = $(MAILCHECK_BITMAPS)
install-data-local:
GCONF_CONFIG_SOURCE=$(GCONF_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$(schema_DATA)
......@@ -1319,24 +1319,30 @@ applet_load_prefs(MailCheck *mc)
gchar *query;
query = gnome_unconditional_pixmap_file("mailcheck/email.png");
mc->animation_file = panel_applet_gconf_get_conditional_string(mc->applet, "animation-file", query, NULL);
mc->animation_file = panel_applet_gconf_get_string(mc->applet, "animation-file", NULL);
if(!mc->animation_file || strcmp(mc->animation_file, "none")) {
g_free(mc->animation_file);
mc->animation_file = g_strdup(query);
}
g_free(query);
#if 0
mc->update_freq = panel_applet_gconf_get_conditional_int(mc->applet, "update-frequency", 120000, NULL);
mc->update_freq = panel_applet_gconf_get_int(mc->applet, "update-frequency", NULL);
mc->pre_check_cmd = panel_applet_gconf_get_string(mc->applet, "exec-command", NULL);
mc->pre_check_enabled = panel_applet_gconf_get_bool(mc->applet, "exec-enabled", NULL);
mc->newmail_cmd = panel_applet_gconf_get_string(mc->applet, "newmail-command", NULL);
mc->newmail_enabled = panel_applet_gconf_get_bool(mc->applet, "newmail-enabled", NULL);
mc->clicked_cmd = panel_applet_gconf_get_string(mc->applet, "clicked-command", NULL);
mc->clicked_enabled = panel_applet_gconf_get_bool(mc->applet, "clicked-enabled", NULL);
mc->remote_server = panel_applet_gconf_get_conditional_string(mc->applet, "remote-server", "mail", NULL);
mc->remote_server = panel_applet_gconf_get_string(mc->applet, "remote-server", NULL);
mc->pre_remote_command = panel_applet_gconf_get_string(mc->applet, "pre-remote-command", NULL);
mc->remote_username = panel_applet_gconf_get_conditional_string(mc->applet, "remote-username", g_getenv("USER"), NULL);
mc->remote_username = panel_applet_gconf_get_string(mc->applet, "remote-username", NULL);
if(!mc->remote_username || strcmp(mc->remote_username, "none")) {
g_free(mc->remote_username);
mc->remote_username = g_strdup(g_getenv("USER"));
}
mc->remote_password = panel_applet_gconf_get_string(mc->applet, "remote-password", NULL);
mc->remote_folder = panel_applet_gconf_get_string(mc->applet, "remote-folder", NULL);
mc->mailbox_type = panel_applet_gconf_get_int(mc->applet, "mailbox-type", NULL);
mc->play_sound = panel_applet_gconf_get_bool(mc->applet, "play-sound", NULL);
#endif
}
static void
......@@ -1481,7 +1487,8 @@ fill_mailcheck_applet(PanelApplet *applet)
} else
mc->mail_file = g_strdup (mail_file);
}
panel_applet_add_preferences (applet, "/schemas/apps/mailcheck-applet/prefs", NULL);
applet_load_prefs(mc);
mc->mailcheck_text_only = _("Text only");
......
<gconfschemafile>
<schemalist>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/animation-file</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default>none</default>
<locale name="C">
<short>Path to the animation file</short>
<long>This is the animation that will be displayed during normal use of the mailcheck applet</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/update-frequency</key>
<owner>mailcheck-applet</owner>
<type>int</type>
<default>120000</default>
<locale name="C">
<short>Interval for checking mail</short>
<long>How often (in milliseconds) we check the mail</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/exec-command</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default></default>
<locale name="C">
<short>Command to execute when checking mail</short>
<long>This is how we check the mail, check the mail, check the mail...</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/exec-enabled</key>
<owner>mailcheck-applet</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Do we run the exec-command</short>
<long>If this is set, we should run the exec-command</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/newmail-command</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default></default>
<locale name="C">
<short>Command to execute when new mail arrives</short>
<long>This is how we process the mail, process the mail, process the mail...</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/newmail-enabled</key>
<owner>mailcheck-applet</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Do we run the newmail-command</short>
<long>If this is set, we should run the newmail-command</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/clicked-command</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default></default>
<locale name="C">
<short>Command to execute when the applet is clicked</short>
<long>We run this command when the user clicks on the applet</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/clicked-enabled</key>
<owner>mailcheck-applet</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short></short>
<long></long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/remote-server</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default>mail</default>
<locale name="C">
<short>The mail server</short>
<long>Remove server to connect to for our mail</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/pre-remote-command</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default></default>
<locale name="C">
<short>Command to run before checking mail</short>
<long>Run this command before we check the mail</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/remote-username</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default>none</default>
<locale name="C">
<short>Username on the remote server</short>
<long>Username on the remote server</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/remote-password</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default></default>
<locale name="C">
<short>The user's password</short>
<long>The user's password for the remote server</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/remote-folder</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default></default>
<locale name="C">
<short>Remote folder for mail retrieval</short>
<long>Remote folder for mail retrieval</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/mailbox-type</key>
<owner>mailcheck-applet</owner>
<type>int</type>
<default>0</default>
<locale name="C">
<short></short>
<long></long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/play-sound</key>
<owner>mailcheck-applet</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>You've got mail!</short>
<long>Play a sound when mail is recieved</long>
</locale>
</schema>
</schemalist>
</gconfschemafile>
<gconfschemafile>
<schemalist>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/animation-file</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default>none</default>
<locale name="C">
<short>Path to the animation file</short>
<long>This is the animation that will be displayed during normal use of the mailcheck applet</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/update-frequency</key>
<owner>mailcheck-applet</owner>
<type>int</type>
<default>120000</default>
<locale name="C">
<short>Interval for checking mail</short>
<long>How often (in milliseconds) we check the mail</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/exec-command</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default></default>
<locale name="C">
<short>Command to execute when checking mail</short>
<long>This is how we check the mail, check the mail, check the mail...</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/exec-enabled</key>
<owner>mailcheck-applet</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Do we run the exec-command</short>
<long>If this is set, we should run the exec-command</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/newmail-command</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default></default>
<locale name="C">
<short>Command to execute when new mail arrives</short>
<long>This is how we process the mail, process the mail, process the mail...</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/newmail-enabled</key>
<owner>mailcheck-applet</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Do we run the newmail-command</short>
<long>If this is set, we should run the newmail-command</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/clicked-command</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default></default>
<locale name="C">
<short>Command to execute when the applet is clicked</short>
<long>We run this command when the user clicks on the applet</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/clicked-enabled</key>
<owner>mailcheck-applet</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short></short>
<long></long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/remote-server</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default>mail</default>
<locale name="C">
<short>The mail server</short>
<long>Remove server to connect to for our mail</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/pre-remote-command</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default></default>
<locale name="C">
<short>Command to run before checking mail</short>
<long>Run this command before we check the mail</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/remote-username</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default>none</default>
<locale name="C">
<short>Username on the remote server</short>
<long>Username on the remote server</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/remote-password</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default></default>
<locale name="C">
<short>The user's password</short>
<long>The user's password for the remote server</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/remote-folder</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default></default>
<locale name="C">
<short>Remote folder for mail retrieval</short>
<long>Remote folder for mail retrieval</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/mailbox-type</key>
<owner>mailcheck-applet</owner>
<type>int</type>
<default>0</default>
<locale name="C">
<short></short>
<long></long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/play-sound</key>
<owner>mailcheck-applet</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>You've got mail!</short>
<long>Play a sound when mail is recieved</long>
</locale>
</schema>
</schemalist>
</gconfschemafile>
......@@ -42,11 +42,17 @@ EXTRA_DIST = GNOME_GenUtilApplet_Factory.server.in.in \
$(PRINTER_BITMAPS) \
$(MAILCHECK_BITMAPS)
mailcheckbitmapsdir = $(datadir)/pixmaps/mailcheck
mailcheckbitmaps_DATA = $(MAILCHECK_BITMAPS)
schemadir = $(sysconfdir)/gconf/schemas
schema_DATA = mailcheck.schemas
serverdir = $(libdir)/bonobo/servers
server_in_files = GNOME_GenUtilApplet_Factory.server.in
server_DATA = $(server_in_files:.server.in=.server)
@INTLTOOL_SERVER_RULE@
mailcheckbitmapsdir = $(datadir)/pixmaps/mailcheck
mailcheckbitmaps_DATA = $(MAILCHECK_BITMAPS)
install-data-local:
GCONF_CONFIG_SOURCE=$(GCONF_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$(schema_DATA)
......@@ -1319,24 +1319,30 @@ applet_load_prefs(MailCheck *mc)
gchar *query;
query = gnome_unconditional_pixmap_file("mailcheck/email.png");
mc->animation_file = panel_applet_gconf_get_conditional_string(mc->applet, "animation-file", query, NULL);
mc->animation_file = panel_applet_gconf_get_string(mc->applet, "animation-file", NULL);
if(!mc->animation_file || strcmp(mc->animation_file, "none")) {
g_free(mc->animation_file);
mc->animation_file = g_strdup(query);
}
g_free(query);
#if 0
mc->update_freq = panel_applet_gconf_get_conditional_int(mc->applet, "update-frequency", 120000, NULL);
mc->update_freq = panel_applet_gconf_get_int(mc->applet, "update-frequency", NULL);
mc->pre_check_cmd = panel_applet_gconf_get_string(mc->applet, "exec-command", NULL);
mc->pre_check_enabled = panel_applet_gconf_get_bool(mc->applet, "exec-enabled", NULL);
mc->newmail_cmd = panel_applet_gconf_get_string(mc->applet, "newmail-command", NULL);
mc->newmail_enabled = panel_applet_gconf_get_bool(mc->applet, "newmail-enabled", NULL);
mc->clicked_cmd = panel_applet_gconf_get_string(mc->applet, "clicked-command", NULL);
mc->clicked_enabled = panel_applet_gconf_get_bool(mc->applet, "clicked-enabled", NULL);
mc->remote_server = panel_applet_gconf_get_conditional_string(mc->applet, "remote-server", "mail", NULL);
mc->remote_server = panel_applet_gconf_get_string(mc->applet, "remote-server", NULL);
mc->pre_remote_command = panel_applet_gconf_get_string(mc->applet, "pre-remote-command", NULL);
mc->remote_username = panel_applet_gconf_get_conditional_string(mc->applet, "remote-username", g_getenv("USER"), NULL);
mc->remote_username = panel_applet_gconf_get_string(mc->applet, "remote-username", NULL);
if(!mc->remote_username || strcmp(mc->remote_username, "none")) {
g_free(mc->remote_username);
mc->remote_username = g_strdup(g_getenv("USER"));
}
mc->remote_password = panel_applet_gconf_get_string(mc->applet, "remote-password", NULL);
mc->remote_folder = panel_applet_gconf_get_string(mc->applet, "remote-folder", NULL);
mc->mailbox_type = panel_applet_gconf_get_int(mc->applet, "mailbox-type", NULL);
mc->play_sound = panel_applet_gconf_get_bool(mc->applet, "play-sound", NULL);
#endif
}
static void
......@@ -1481,7 +1487,8 @@ fill_mailcheck_applet(PanelApplet *applet)
} else
mc->mail_file = g_strdup (mail_file);
}
panel_applet_add_preferences (applet, "/schemas/apps/mailcheck-applet/prefs", NULL);
applet_load_prefs(mc);
mc->mailcheck_text_only = _("Text only");
......
<gconfschemafile>
<schemalist>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/animation-file</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default>none</default>
<locale name="C">
<short>Path to the animation file</short>
<long>This is the animation that will be displayed during normal use of the mailcheck applet</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/update-frequency</key>
<owner>mailcheck-applet</owner>
<type>int</type>
<default>120000</default>
<locale name="C">
<short>Interval for checking mail</short>
<long>How often (in milliseconds) we check the mail</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/exec-command</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default></default>
<locale name="C">
<short>Command to execute when checking mail</short>
<long>This is how we check the mail, check the mail, check the mail...</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/exec-enabled</key>
<owner>mailcheck-applet</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Do we run the exec-command</short>
<long>If this is set, we should run the exec-command</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/newmail-command</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default></default>
<locale name="C">
<short>Command to execute when new mail arrives</short>
<long>This is how we process the mail, process the mail, process the mail...</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/newmail-enabled</key>
<owner>mailcheck-applet</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Do we run the newmail-command</short>
<long>If this is set, we should run the newmail-command</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/clicked-command</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default></default>
<locale name="C">
<short>Command to execute when the applet is clicked</short>
<long>We run this command when the user clicks on the applet</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/clicked-enabled</key>
<owner>mailcheck-applet</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short></short>
<long></long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/remote-server</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default>mail</default>
<locale name="C">
<short>The mail server</short>
<long>Remove server to connect to for our mail</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/pre-remote-command</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default></default>
<locale name="C">
<short>Command to run before checking mail</short>
<long>Run this command before we check the mail</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/remote-username</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default>none</default>
<locale name="C">
<short>Username on the remote server</short>
<long>Username on the remote server</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/remote-password</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default></default>
<locale name="C">
<short>The user's password</short>
<long>The user's password for the remote server</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/remote-folder</key>
<owner>mailcheck-applet</owner>
<type>string</type>
<default></default>
<locale name="C">
<short>Remote folder for mail retrieval</short>
<long>Remote folder for mail retrieval</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/mailbox-type</key>
<owner>mailcheck-applet</owner>
<type>int</type>
<default>0</default>
<locale name="C">
<short></short>
<long></long>
</locale>
</schema>
<schema>
<key>/schemas/apps/mailcheck-applet/prefs/play-sound</key>
<owner>mailcheck-applet</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>You've got mail!</short>
<long>Play a sound when mail is recieved</long>
</locale>
</schema>
</schemalist>
</gconfschemafile>