summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--Makefile.am8
-rw-r--r--configure.in15
-rw-r--r--mailcheck/.cvsignore11
-rw-r--r--mailcheck/ChangeLog1481
-rw-r--r--mailcheck/GNOME_MailCheckApplet.xml17
-rw-r--r--mailcheck/Makefile.am85
-rw-r--r--mailcheck/eclouds.pngbin16502 -> 0 bytes
-rw-r--r--mailcheck/email-e.pngbin4949 -> 0 bytes
-rw-r--r--mailcheck/email-eclouds.pngbin16152 -> 0 bytes
-rw-r--r--mailcheck/email-tiny.pngbin3598 -> 0 bytes
-rw-r--r--mailcheck/email.pngbin9966 -> 0 bytes
-rw-r--r--mailcheck/gnome-mailcheck.pngbin1397 -> 0 bytes
-rw-r--r--mailcheck/mailcheck.c2938
-rw-r--r--mailcheck/mailcheck.h14
-rw-r--r--mailcheck/mailcheck.schemas.in206
-rw-r--r--mailcheck/mailcheck.soundlist.in6
-rw-r--r--mailcheck/popcheck.c452
-rw-r--r--mailcheck/popcheck.h29
-rw-r--r--mailcheck/remote-helper.c263
-rw-r--r--mailcheck/remote-helper.h26
-rw-r--r--mailcheck/tux-anim.pngbin6589 -> 0 bytes
-rwxr-xr-xmailcheck/update-from-egg.sh25
-rw-r--r--null_applet/ChangeLog7
-rw-r--r--null_applet/GNOME_NullApplet_Factory.server.in.in (renamed from mailcheck/GNOME_MailcheckApplet_Factory.server.in.in)16
-rw-r--r--null_applet/Makefile.am22
-rw-r--r--null_applet/README22
-rw-r--r--null_applet/null_applet.c169
28 files changed, 243 insertions, 5579 deletions
diff --git a/ChangeLog b/ChangeLog
index 6269373ce..88f2bc494 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2004-10-26 Davyd Madeley <davyd@madeley.id.au>
+
+ * Makefile.am:
+ * configure.in: Remove mailcheck, add new null_applet to deprecate
+ mailcheck
+
+ A null_applet/*: null_applet: The Applet Deprecation Applet
+
+ R mailcheck/*: The Inbox Monitor, may it Rest In Peace
+
2004-10-25 Davyd Madeley <davyd@madeley.id.au>
* gtik/gnome-money.png
diff --git a/Makefile.am b/Makefile.am
index a31b5810a..f9db2883d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -47,11 +47,11 @@ always_built_SUBDIRS = \
drivemount \
charpick \
geyes \
- mailcheck \
mini-commander \
gkb-new \
wireless \
- stickynotes
+ stickynotes \
+ null_applet
SUBDIRS = \
po \
@@ -67,7 +67,6 @@ SUBDIRS = \
DIST_SUBDIRS = \
po \
- mailcheck \
mixer \
modemlights \
cdplayer \
@@ -87,7 +86,8 @@ DIST_SUBDIRS = \
stickynotes \
libgswitchit \
gswitchit \
- trashapplet
+ trashapplet \
+ null_applet
EXTRA_DIST = \
COPYING-DOCS \
diff --git a/configure.in b/configure.in
index 8f25bf807..76b729f57 100644
--- a/configure.in
+++ b/configure.in
@@ -355,20 +355,6 @@ accessx-status/docs/Makefile
accessx-status/docs/C/Makefile
accessx-status/docs/eu/Makefile
accessx-status/pixmaps/Makefile
-mailcheck/Makefile
-mailcheck/help/Makefile
-mailcheck/help/C/Makefile
-mailcheck/help/de/Makefile
-mailcheck/help/es/Makefile
-mailcheck/help/eu/Makefile
-mailcheck/help/fr/Makefile
-mailcheck/help/it/Makefile
-mailcheck/help/ja/Makefile
-mailcheck/help/ko/Makefile
-mailcheck/help/sv/Makefile
-mailcheck/help/zh_CN/Makefile
-mailcheck/help/zh_HK/Makefile
-mailcheck/help/zh_TW/Makefile
mini-commander/Makefile
mini-commander/src/Makefile
mini-commander/help/Makefile
@@ -577,4 +563,5 @@ trashapplet/Makefile
trashapplet/src/Makefile
trashapplet/docs/Makefile
trashapplet/docs/C/Makefile
+null_applet/Makefile
])
diff --git a/mailcheck/.cvsignore b/mailcheck/.cvsignore
deleted file mode 100644
index bb1f9781d..000000000
--- a/mailcheck/.cvsignore
+++ /dev/null
@@ -1,11 +0,0 @@
-Makefile.in
-Makefile
-.deps
-.libs
-*.lo
-*.la
-GNOME_MailcheckApplet_Factory.server
-GNOME_MailcheckApplet_Factory.server.in
-mailcheck.soundlist
-mailcheck.schemas
-mailcheck-applet
diff --git a/mailcheck/ChangeLog b/mailcheck/ChangeLog
deleted file mode 100644
index f964c327f..000000000
--- a/mailcheck/ChangeLog
+++ /dev/null
@@ -1,1481 +0,0 @@
-2004-09-30 Arvind Samptur <arvind.samptur@wipro.com>
-
- Patch from Vinay Mandyakoppal <vinay.mandyakoppal@wipro.com>
-
- * mailcheck/mailcheck.c: (password_response_cb): Get
- "Save the password to disk" to work. Fixes bug #153825.
-
-2004-09-12 Shaun McCance <shaunm@gnome.org>
-
- * help/C/mailcheck-C.omf:
- * help/C/mailcheck.xml:
- - Updates for 2.8 from Angela Boyle
-
-2004-08-15 Kjartan Maraas <kmaraas@gnome.org>
-
- * remote-helper.c: (fork_new_handler): more NULL vs 0.
-
-2004-08-15 Kjartan Maraas <kmaraas@gnome.org>
-
- * mailcheck.c: (memchunkAlloc), (b64dec): NULL vs 0
- * popcheck.c: (get_server_hostname), (read_line),
- (wait_for_imap_answer): Same here.
-
-2004-08-07 Davyd Madeley <davyd@madeley.id.au>
-
- * mailcheck.c: Make applet work on intermediate panel sizes (ie.
- 37pt). Closes #149101. Patch from <desrt@desrt.ca>.
-
-2004-07-28 Kjartan Maraas <kmaraas@gnome.org>
-
- * Makefile.am:
- * mailcheck.c: (mailcheck_about): Merge fix for
- bug #148499 from stable.
-
-2004-06-17 Dennis Smit <ds@nerds-incorporated.org>
-
- * mailcheck.c: Check for a new mail is not supported by
- POP3 (RFC 1939). Disable options of play a sound and
- execute command on new mail for POP3.
-
- Patch by: Kaushal Kumar <kaushal.kumar@wipro.com>
-
- Fixes bug #93170.
-
-2004-06-10 Dennis Smit <ds@nerds-incorporated.org>
-
- * mailcheck.c (exec_clicked_cmd): Open on
- single click instead of double based on:
-
- http://developer.gnome.org/projects/gup/hig/1.0/userinput.html#mouse-interaction-applets
-
- (mailcheck_properties_page): Removed references to
- double clicks. Instead just use 'clicked'.
-
- Fixes bug: #129688.
-
-2004-06-07 Dennis Smit <ds@nerds-incorporated.org>
- * mailcheck.c (set_tooltip and set_atk_relation): Set
- the accessible name to read out no of messages and remove
- duplicate relation labelled by. Fixes bug #143695
-
- Patch by: Vinay M R <vinay.mandyakoppal@wipro.com>
-
-2004-06-05 Kjartan Maraas <kmaraas@gnome.org>
-
- * mailcheck.c (mail_file_changed), (remote_server_changed),
- (remote_username_changed), (remote_folder_changed): Removed
- some stray semicolons. Fixes bug #136845.
-
-2004-03-17 Glynn Foster <glynn.foster@sun.com>
-
- * help/ja/*: Add ja docs since the author never got back
- to me.
-
-2004-03-15 Glynn Foster <glynn.foster@sun.com>
-
- * help/*: Online localized help from Sun's translation
- team for de, es, fr, it, ko, sv, zh_CN, zh_HK and zh_TW.
-
-2004-02-29 Dennis Smit <ds@nerds-incorporated.org>
-
- * mailcheck.c (create_mail_widgets): Center
- the label in the middle of the panel (visible
- for vertical panels). Need to work around
- normalized panel values tho.
-
-2004-02-29 Dennis Smit <ds@nerds-incorporated.org>
-
- * mailcheck.c (applet_change_background): Added
- function to handle panel background changes.
-
- (mailcheck_applet_fill): Add signal handler
- for change_background and some small cleanups.
-
-2004-02-26 Dennis Smit <ds@nerds-incorporated.org>
-
- * mailcheck.c: Moved the about window
- entry placing in the Mailcheck structure
- to be not in the property dialog widgets
- area. Small cleanup.
-
-2004-02-22 Dennis Smit <ds@nerds-incorporated.org>
-
- * mailcheck.c (mailcheck_execute_shell):
- Move from egg_screen_execute_command_line_async to
- gdk_spawn_command_line_on_screen.
-
- Fixes bug #135158.
-
-2004-02-19 Kevin Vandersloot
-
- * mailcheck.c: fix updating when user doesn't want auto update. Patch
- from Srinivasa Ragavan. Fixes bug #131407
-
-2004-02-15 Dennis Smit <ds@nerds-incorporated.org>
-
- * mailcheck.c (after_mail_check):
- changed g_strdup into g_strdup_printf
- at some places, fixes gettext issues.
-
- Patch by: Gustavo <gustavo.giraldez@gmx.net>
-
- Fixes bug #134398.
-
-2004-02-14 Dennis Smit <ds@nerds-incorporated.org>
-
- Submitted patch by Leena Gunda to fix
- a few multihead issues when launching commands
- fixes bug #111837
-
-2004-02-11 Breda McColgan <breda.mccolgan@sun.com>
-
- * help/C/mailcheck.xml: Updated for GNOME 2.6.
- * help/C/mailcheck-C.omf: Updated for GNOME 2.6.
- * help/C/l10n.txt: Updated for GNOME 2.6.
-
-2004-02-01 Kevin Vandersloot
-
- * mailcheck.c: use ngettext. Fixes bug #106698. Patch from Danilo Segan.
-
-2004-01-09 Kaushal Kumar <kaushal.kumar@wipro.com>
-
- * GNOME_MailcheckApplet_Factory.server.in.in: Added info for
- bug-reporting.
- Fix bug #129213.
-
-2004-01-07 Jody Goldberg <jody@gnome.org>
-
- * mailcheck.c (password_response_cb) : make this compile
- (get_remote_password) : and this. Looks like a patch went wrong.
- (mailcheck_load_animation) : Use gdk_draw_pixbuf in place of
- deprecated gdk_pixbuf_render_to_drawable.
-
-2004-01-07 Vijaykumar Patwari <vijaykumar.patwari@wipro.com>
-
- * mailcheck.c: (get_remote_password): Set
- gtk_entry_set_activates_default on entry box to
- activate the default widget (dialog).
- (password_response_cb): saving the password if save
- checkbox is set, after OK button is pressed.
-
-2003-12-14 Kevin Vandersloot
-
- * remote-helper.c: Fix possible race condition. Patch from Paul
- Clifford. Fixes bug #129096
-
-2003-10-23 Kaushal Kumar <kaushal.kumar@wipro.com>
-
- * Makefile.am: Removed GTK and GNOME deprecated flags,
- until porting is done. Fixes bug #124630.
-
-Tue Sep 16 14:03:09 2003 George Lebl <jirka@5z.com>
-
- * mailcheck.c: when command line is inhibited, then don't show the
- command setting widgets at all.
-
-Mon Sep 15 15:20:52 2003 George Lebl <jirka@5z.com>
-
- * mailcheck.c: when started in lockdown mode, hide the preferences
- item
-
-Mon Sep 15 14:23:05 2003 George Lebl <jirka@5z.com>
-
- * mailcheck.c, popcheck.c: get rid of compiler warnings
-
-2003-09-03 Dennis Cranston <dennis_cranston at yahoo com>
-
- * mailcheck.c: Correct the about box version number.
-
-2003-08-23 Irene Ryan <irene.ryan@sun.com>
-
- * help/C/mailcheck.xml, mailcheck-C.omf, l10n.txt:
- Updates to the help for the GNOME 2.4 release.
-
-2003-07-21 Dennis Cranston <dennis_cranston at yahoo com>
-
- * mailcheck.c: HIGify widget padding between the vbox and
- action area of the dialogs. Thanks to <chris@gnome-de.org>
- Christian - Manny Calavera - Neumair.
-
-2003-07-18 Pasupathi Duraisamy <pasupathi.duraisamy@wipro.com>
-
- * mailcheck.c: Allow only numeric values to time spin button.
- Fixes bug#117689
-
-2003-07-14 Pasupathi Duraisamy <pasupathi.duraisamy@wipro.com>
-
- * mailcheck.c: Destroy the corresponding password prompt
- dialog when applet is removed. Fixes bug #117041
-
-Mon Jul 07 11:24:18 2003 George Lebl <jirka@5z.com>
-
- * mailcheck.c: make hig_dialog_new static
-
-Mon Jul 07 11:12:45 2003 George Lebl <jirka@5z.com>
-
- * mailcheck.c: respect key-writability in the preferences dialog
-
- * mailcheck.c: HIGify the error boxes with some code stolen from
- gsearchtool
-
-2003-06-26 Kevin Vandersloot
-
- * mailcheck.c: wrap text so it shows better on vertical panels. Kinda fixes bug #99794
-
-2003-06-16 Kevin Vandersloot
-
- * mailcheck.c: keybinding for update and bind space/enter to double click stuff
-
-2003-06-07 Kevin Vandersloot
-
- * mailcheck.c: expand for Fitt's law and put in an alignment
-
-2003-06-03 Kevin Vandersloot
-
- * *.schemas.in: Fix typo. Fixes bug #114300
-
-2003-06-02 Dennis Cranston <dennis_cranston at yahoo com>
-
- * mailcheck.c: Convert "when clicked" to "when double clicked".
-
-2003-05-29 Dennis Cranston <dennis_cranston at yahoo com>
-
- * mailcheck.c: Improve layout of recent changes to preference dialog.
-
-2003-05-28 Shailesh Mittal <shailesh.mittal@wipro.com>
-
- * popcheck.c:
- (have_ipv6): Added to check for runtime IPv6 support.
- (get_server_port): Modified to pick the port out of IPv6 formatted
- host-port string.
- (get_server_hostname): Modified to extract the hostname or address
- out of IPv6 formatted ([host]:port) host-port string.
- (connect_socket): Modified to deal with IPv6 addresses as well.
-
-2003-05-28 Kevin Vandersloot <kfv101@psu.edu>
-
- * popcheck.c: up to timeout to 2 minutes so that checking doesn't fail if
- under heavy loads. Should fix bug #91195
-
-2003-05-26 Rajkumar Sivasamy <rajkumar.siva@wipro.com>
-
- Patch by: Deepa Natarajan <deepa.natarajan@wipro.com>
-
- * mailcheck.c, mailcheck.schemas.in: Do a base64 encode
- of the remote_password and store it in a new gconf key
- "remote_encrypted_password", if store password checkbox
- is enabled. So that we dont store the password in plain
- text! Fixes Bug #99801
-
-2003-05-25 Kevin Vandersloot <kfv101@psu.edu>
-
- * mailcheck.c: change behavior and pref so that when applet is clicked just
- stop animation. Previously there wasn't a way to actually set the number of unread
- mails to zero and hence the pref didn't make any sense. Fixes bug #112914. Also
- if no mail dir is located then set it to the user mail dir. Don't quit the applet if
- USER can be found
-
-2003-05-22 Dennis Cranston <dennis_cranston at yahoo com>
-
- * mailcheck.c: Correct grammar and capitalization for a few error messages.
-
-2003-05-22 Kevin Vandersloot <kfv101@psu.edu>
-
- * mailcheck.c: Make the update interval spins behave more sensibaly my making
- 1 sec the min. Fixes bug #86840. Also remove unused variable from last commit
-
-2003-05-22 Kevin Vandersloot <kfv101@psu.edu>
-
- * mailcheck.c: don't pop up an error dialog on mail check failure. Just indicate in
- the label and set the tooltip to the error message. Fixes bug #83932
-
-2003-05-20 Muktha <muktha.narayan@wipro.com>
- * mailcheck/mailcheck.c: Prevent creation of multiple processes for
- imap configuration. Fixes bug #113351.
-
-2003-05-07 Dennis Cranston <dennis_cranston at yahoo com>
-
- * mailcheck.c: HIGify the action area of the preferences
- dialog. Minor tweak of padding for the spin button unit
- labels.
-
-2003-04-26 Dennis Cranston <dennis_cranston at yahoo com>
-
- * mailcheck.c: Minor HIGification of preferences dialog:
- remove separator; fix widget padding.
-
-2003-04-08 Dennis Cranston <dennis_cranston at yahoo.com>
-
- * mailcheck.c: HIGify the preferences dialog. Also,
- fix a few error messages.
- * help/C/mailcheck.xml: Update for preference dialog
- changes.
-
-2003-04-07 Dennis Cranston <dennis_cranston at yahoo.com>
-
- * GNOME_MailCheckApplet.xml: Minor HIG cleanup for
- the popup menu. Changed "Check for mail" to "_Update".
- Moved "_Update" to top of popup menu. Added a separator.
-
-2003-04-03 Kevin Vandersloot <kfv101@psu.edu>
-
- * mailcheck.c: Fix statis variable usage so that multiple mailchecks can be used. Patch
- by Jens Zechlin. Fixes bug #109806
-
-2003-03-27 Glynn Foster <glynn.foster@sun.com>
-
- * egg-screen*: Remove - we don't need these anymore.
- * help/*: Use 'figs' instead of 'figdir' until we update
- the build system.
-
-2003-03-07 Mark McLoughlin <mark@skynet.ie>
-
- * *: copy mailcheck applet over from gnome-panel and
- fixup the build.
-
- * help/*: copy over the help docs too.
-
-2003-03-06 Balamurali Viswanathan <balamurali.viswanathan@wipro.com>
-
- * mailcheck.c: Added a new error handler.
- * popcheck.[ch] (connect_socket): Retrun proper failure status
- * remote-helper.[ch]: Call the error handler on error conditions
- * solves bug #104891
-
-2003-03-06 Satyajit Kanungo <satyajit.kanungo@wipro.com>
-
- * mailcheck.c Create the pixmap for the corresponding screen the
- applet is present on.Fixes bug #104720.
-
-2003-02-17 Mark McLoughlin <mark@skynet.ie>
-
- * Makefile.am: add support for the GCONF_SCHEMAS_INSTALL
- conditional and the GCONF_SCHEMA_FILE_DIR variable.
-
-2003-01-27 Mark McLoughlin <mark@skynet.ie>
-
- * GNOME_MailcheckApplet_Factory.server.in.in,
- Makefile.am: Copy from gen_util and tweak.
-
- * mailcheck.c: don't include mailcheck.h.
- (mailcheck_factory): add the code to make it
- an oop factory.
-
-2003-01-23 Satyajit Kanungo <satyajit.kanungo@wipro.com>
-
- * mailcheck.c : Replaced g_spawn_command_line_async with
- egg_screen_execute_command_line_async() to execute the application
- in the correct screen.
- Added a new function applet_realized_cb() which will call the function
- to check the mails only after the applet is realixed.
- Fixes bug #104032
-
-2003-01-10 Mark McLoughlin <mark@skynet.ie>
-
- * GNOME_GenUtilApplet_Factory.server.in.in: remove
- the pager, tasklist and showdesktop oaf_servers.
-
- * Makefile.am: remove all the pager, tasklist and
- showdesktop files.
-
- * main.c: (genutil_factory): upd.
-
- * GNOME_PagerApplet.xml, GNOME_ShowDesktopApplet.xml,
- GNOME_TasklistApplet.xml, gnome-show-desktop.png,
- pager.[ch], pager.glade, pager.schemas.in, print.xpm
- printer.[ch] showdesktop.[ch], tasklist.[ch], tasklist.glade,
- tasklist.schemas.in: remove these files.
-
-2003-01-08 Mark McLoughlin <mark@skynet.ie>
-
- * mailcheck.schemas.in: s/Remove/Remote/
- Patch from R.I.P. Deaddog. Fixes #102733.
- Approved by i18n and release teams.
-
-2003-01-06 Mark McLoughlin <mark@skynet.ie>
-
- Makes the password dialog not modal so that we don't
- have a locked up panel when getting the password.
- Fixes #102399. Based on patch from Balamurali Viswanathan.
-
- * mailcheck.c:
- (check_remote_mailbox): factor this out from
- check_mail_file_status().
- (password_response_cb): check the mailbox and
- destroy the dialog once we get the password.
- (get_remote_password): don't make the dialog modal.
- (check_mail_file_status), (fill_mailcheck_applet): upd.
-
-2003-01-06 Mark McLoughlin <mark@skynet.ie>
-
- * clock.c: (fill_clock_applet): remove the 4 pixel
- border around the clock as suggested by Gediminas.
- Fixes #97409.
-
-2002-12-23 Mark McLoughlin <mark@skynet.ie>
-
- * clock.c: (display_about_dialog):
- * mailcheck.c: (mailcheck_about): remove translations
- marks from around the copyright notices for the about
- dialogs. The container non-ascii characters and no longer
- need to be translated anyhow. Fixes #101796.
-
-2002-12-20 Dennis Cranston <dennis_cranston@yahoo.com>
-
- * mailcheck.c: (mailcheck_about) fix previous commit
- so the build doesn't fail.
- * clock.c: (display_about_dialog): mark for translation.
-
-2002-12-20 Mark McLoughlin <mark@skynet.ie>
-
- * clock.c: (display_about_dialog):
- * mailcheck.c: (mailcheck_about): fixup the
- references to the FSF. Fixes #101589 and #101591.
-
-2002-12-19 Mark McLoughlin <mark@skynet.ie>
-
- * help/*: remove these files.
-
-2002-12-18 Mark McLoughlin <mark@skynet.ie>
-
- * Makefile.am: don't build help subdir. Its
- move to $(toplvel)/help/ now.
-
-2002-12-17 Mark McLoughlin <mark@skynet.ie>
-
- * clock.c: (update_timeformat): allow date and
- time in culturally specific orders. Fixes #100547.
-
-2002-12-10 Mark McLoughlin <mark@skynet.ie>
-
- * clock.c: (display_about_dialog):
- * mailcheck.c: (mailcheck_about):
- * pager.c: (display_about_dialog):
- * printer.c: (printer_about):
- * tasklist.c: (display_about_dialog): revert
- copyright changes until we decide on a format.
-
-2002-12-04 Mark McLoughlin <mark@skynet.ie>
-
- * mailcheck.c: (mailcheck_execute_shell): no whitespace
- before punctuation marks.
-
-2002-12-02 Mark McLoughlin <mark@skynet.ie>
-
- * tasklist.schemas.in: put never, auto and always
- in quotes for clarity. #100049.
-
-2002-11-29 Havoc Pennington <hp@pobox.com>
-
- * tasklist.c (destroy_tasklist): free the tasklist struct
- (was leaked before, at least I think so)
- (fill_tasklist_applet): create an icon theme object for the
- tasklist.
- (fill_tasklist_applet): set an icon loader function for the
- tasklist.
-
-2002-11-12 Arvind Samptur <arvind.samputur@wipro.com>
- * remote-helper.c: (fork_new_handler) poll for the
- pid to wrriten on to the pipe before allowing the
- number of mails to be written on to the pipe.
- Fixes the problem of a SIGPIPE occuring causing the
- panel to crash and sometimes the number of mails
- having a junk value(which would be pid).
- Fixes #98001
-
-2002-11-06 Andrew Sobala <andrew@sobala.net>
-
- * clock.schemas.in, mailcheck.schemas.in, tasklist.c,
- tasklist.schemas.in: change some strings to comply with style
- guide
-
-2002-11-03 Havoc Pennington <hp@pobox.com>
-
- * pager.c (num_workspaces_value_changed): when changing number of
- workspaces, ask WM to do it, don't set stuff in gconf
- (workspace_name_edited): change workspace names on the X property,
- don't set stuff in gconf
-
-2002-11-01 Mark McLoughlin <mark@skynet.ie>
-
- * clock.c: (applet_change_background): this callback
- takes a GdkPixmap *, not a filename.
-
-2002-10-16 Mark McLoughlin <mark@skynet.ie>
-
- * egg-screen-help.[ch], egg-screen-url.[ch]: sync
- with libegg.
-
- * clock.c, mailcheck.c, pager.c, showdesktop.c,
- tasklist.c: use updated multiscreen help api.
-
-2002-10-15 Padraig O'Briain <padraig.obriain@sun.com>
-
- * Makefile.am:
- Add CLEANFILES so that make clean deletes $(server_DATA) and
- $(server_DATA).in
-
-2002-10-01 Yanko Kaneti <yaneti@declera.com>
-
- * clock.schemas.in: reorder elements so that it validates.
-
-2002-10-01 Mark McLoughlin <mark@skynet.ie>
-
- * clock.c: (update_timeformat): don't use leading 0
- for 12 hour timeformat. Fixes #94268.
-
-2002-09-23 Havoc Pennington <hp@redhat.com>
-
- * clock.c (destroy_clock): free the timeformat string
-
- * showdesktop.c: show desktop applet
-
- * GNOME_GenUtilApplet_Factory.server.in.in: add ShowDesktopApplet
-
-2002-09-16 Mark McLoughlin <mark@skynet.ie>
-
- * Makefile.am, multihead-hacks.h: kill
- multihead-hacks.h.
-
- * clock.c, mailcheck.c, pager.c, tasklist.c:
- Remove HAVE_GTK_MUTLIEHAD conditionals since
- we require gtk+ 2.1.0 now.
-
-2002-09-16 Mark McLoughlin <mark@skynet.ie>
-
- * pager.c: (applet_realized):
- * tasklist.c: (applet_realized): require
- libwnck HEAD.
-
-2002-09-12 Mark McLoughlin <mark@skynet.ie>
-
- * clock.c:
- (set_tooltip): impl method to create tooltips
- per aplet and set the tip.
- (update_clock), (display_about_dialog): don't
- try and refer to a panel symbol.
-
- * mailcheck.c: ditto. Fixes #92422.
-
-2002-08-21 Havoc Pennington <hp@redhat.com>
-
- * clock.schemas.in: translate the clock format
-
-2002-08-21 Havoc Pennington <hp@redhat.com>
-
- * clock.c (applet_change_background): memleak fix from
- Arjan van de Ven <arjanv@redhat.com>
-
- * tasklist.c (applet_change_background): ditto
-
-2002-09-11 Mark McLoughlin <mark@skynet.ie>
-
- * clock.c: (update_timeformat): put the
- date in front of the time. Fixes #80675.
-
-2002-09-05 Irene Ryan <irene.ryan@sun.com>
-
- * help/C/mailcheck/mailcheck.xml: updated to fix
- bug #91146
- * help/C/mailcheck/mailcheck-C.omf: updated to reflect
- new version number and date of manual
-
-2002-05-20 Dennis Smit <synap@yourbase.nl>
-
- * clock.schemas.in: Show seconds by default disabled.
- Fixes #88679.
-
-2002-07-20 Dennis Smit <synap@area101.penguin.nl>
-
- * clock.c
- (display_properties_dialog): changed mnemonics for _UNIX
- to UNI_X as a fix for bug #88678
-
-2002-08-12 Mark McLoughlin <mark@skynet.ie>
-
- * tasklist.glade: use a table instead of two
- hboxes to make sure the frame match up. #82048.
-
-2002-08-11 Mark McLoughlin <mark@skynet.ie>
-
- * mailcheck.schemas.in: s/mailcheck/Inbox Monitor/
- * pager.schemas.in: s/pager/Workspace Switcher/
- * tasklist.schemas.in: s/tasklist/Window List/
- (only in the descriptions of course, #83819.)
-
-2002-08-08 Mark McLoughlin <mark@skynet.ie>
-
- * Makefile.am: add egg-screen-exec files to the build.
-
- * clock.c: (properties_response_cb), (display_help_dialog):
- * mailcheck.c: (phelp_cb), (help_callback):
- * pager.c: (response_cb), (display_help_dialog):
- * tasklist.c: (response_cb), (display_help_dialog):
- use egg_screen_display_desktop().
-
-2002-08-05 Mark McLoughlin <mark@skynet.ie>
-
- * GNOME_ClockApplet.xml: move Copy Date/Time to
- the top of the menu and add seperator. #89863.
-
-2002-07-30 Mark McLoughlin <mark@skynet.ie>
-
- * pager.c, tasklist.c: don't use methods from the
- libwnck multiscreen patch if they're not defined.
-
-2002-07-29 Mark McLoughlin <mark@skynet.ie>
-
- * tasklist.c: (minimum_size_changed), (maximum_size_changed):
- Handle case where spin buttons have already been destroyed.
- Fixes #89027. Patch from Padraig O'Briain.
-
-2002-07-11 Deepa Chacko Pillai <deepa.chacko@wipro.com>
-
- * remote-helper.c: Added check for waitpid ()
- returning -1 and errno EINTR. Fixes bug 88005.
-
-2002-07-29 Mark McLoughlin <mark@skynet.ie>
-
- * tasklist.c: (fill_tasklist_applet): handle
- gconf errors with default values for min/max
- sizes. Fixes #88422.
-
-2002-07-29 Mark McLoughlin <mark@skynet.ie>
-
- * mailcheck.c: (mailcheck_get_animation_menu):
- unconditionally get the pixmap directory, fixes
- #88125.
-
-2002-07-15 Mark McLoughlin <mark@skynet.ie>
-
- * mailcheck.c:
- (mailcheck_execute_shell): add mailcheck arg and set
- screen upon which the dialog should realise.
- (after_mail_check), (mail_check_timeout),
- (exec_clicked_cmd): update for above change.
-
-2002-05-21 Jorn Baayen <jorn@nl.linux.org>
-
- * pager.glade: use GTK_SHADOW_IN for consistency
-
-2002-05-20 Jorn Baayen <jorn@nl.linux.org>
-
- * tasklist.glade: consistent spacing between the right two frames
-
-2002-07-10 Mark McLoughlin <mark@skynet.ie>
-
- * mailcheck.c:
- (mailcheck_execute_shell): impl using gspawn.
- (after_mail_check), (mail_check_timeout),
- (exec_clicked_cmd): use it here.
- (applet_load_prefs): "mail_file" is a string, not
- an int.
-
-2002-07-02 Arvind Samptur <arvind.samptur@wipro.com>
-
- * pager.c : (close_dialog) hack to get the
- workspace name changes reflected when the user
- closes the dialog without a button-press on the
- list. Fixes #84161.
-
-2002-07-05 Pasupathi Duraisamy <pasupathi.duraisamy@wipro.com>
-
- * mailcheck.c : Add atk descriptions. Fix bug#84099
-
-2002-07-05 Joerg Wendland <joergland@debian.org>
-
- * mailcheck.c: (applet_load_prefs): Make sure we load up
- up the saved preferences. Fixes #84016.
- * mailcheck.schemas.in: Add missing schema.
-
-2002-07-02 Christian Rose <menthos@menthos.com>
-
- * clock.schemas.in: #78532 - s/GMT/UTC/ and
- s/Greenwich Mean Time/Universal Coordinated Time/.
-
-2002-07-01 Mark McLoughlin <mark@skynet.ie>
-
- * tasklist.glade: #85344 - s/Tasklist/Window List/
-
-2002-06-25 Mark McLoughlin <mark@skynet.ie>
-
- * Makefile.am: add multihead-hacks.h.
-
- * multihead-hacks.h: some hacks to reduce the number
- of HAVE_GTK_MULTIHEADs needed.
-
- * clock.c, mailcheck.c: make sure all dialogs realize on
- the right screen.
-
- * pager.c: (applet_get_screen): impl helper method.
- (applet_realized): set the screen that the pager controls
- when the applet is realized.
- (response_cb), (fill_pager_applet), (display_help_dialog),
- (display_about_dialog), (display_properties_dialog): make
- sure all dialogs realize on the right screen.
-
- * tasklist.c: (applet_get_screen): impl helper method.
- (applet_realized): set the screen that the tasklist
- controls when the applet is realized.
- (response_cb), (fill_tasklist_applet), (display_help_dialog),
- (display_about_dialog), (display_properties_dialog): make
- sure all dialogs realize on the right screen.
-
-2002-06-18 Mark McLoughlin <mark@skynet.ie>
-
- * Makefile.am: use $(prefix)/$(DATADIRNAME)/locale instead
- of $datadir/locale for locale directory location. Reported
- by Hidetoshit Tajima in #83623.
-
-2002-06-07 Mark McLoughlin <mark@skynet.ie>
-
- * clock.c: (setup_gconf): store the notifies
- ids.
- (destroy_clock): remove the notifies when the
- applet is destroyed. Fixes crash when removing
- the applet.
-
-2002-06-02 Havoc Pennington <hp@pobox.com>
-
- * pager.glade: revert one of Rajkumar's changes to strings
- in the glade file (mnemonic for "show only the current workspace")
- to save i18n effort
-
-2002-05-21 Rajkumar Sivasamy <rajkumar.siva@wipro.com>
-
- * pager.c: Added tooltip for the applet.
- * pager.glade: Accessible description, tooltip and atk
- relation is set for the components in preferences dialog.
- Default button to be activated on pressing enter key
-
-2002-06-01 Kjartan Maraas <kmaraas@gnome.org>
-
- * pager.schemas.in: Fix a typo.
- * tasklist.schemas.in: Same here.
-
-2002-05-28 Satyajit Kanungo <satyajit.kanungo@wipro.com>
-
- * clock.c: help callback modified .
- * pager.c: help callback added for the help button in preference
- dialog box. help Callback modified and Error handling put.
-
- * mailcheck.c : help button added to the preference dialog box
- and help callback is linked to the button.
- * tasklist.c: help callback added for the help button in the preference
- dialog box.
- * tasklist.glde, pager.glade - response id added for help buttons.
- * Makefile.am : DADADIR, LIBDIR,SYSCONFDIR,and PREFIX passed to the program.
- to be used in program_init()
-
-2002-05-24 Akira TAGOH <tagoh@gnome.gr.jp>
-
- * clock.c (update_timeformat): need to convert UTF-8 to the locale
- encoding (Bug#80539).
- (update_clock): ditto.
- (copy_time): ditto.
- (copy_date): ditto.
-
-2002-05-21 Eric Baudais <baudais@okstate.edu>
-
- * help/C/mailcheck/mailcheck.xml: Updated the help to the new UI.
- * help/C/mailcheck/figures/mailcheck-properties-mailcheck.png: Updated
- the screenshot.
- * help/C/mailcheck/figures/mailcheck-properties-mailbox.png: Updated
- the screenshot.
-
-2002-05-21 Eric Baudais <baudais@okstate.edu>
-
- * help/C/mailcheck/mailcheck-C.omf: Updated the OMF file to the
- Scrollkeeper DTD.
-
-2002-05-21 Thomas Vander Stichele <thomas@apestaart.org>
-
- * tasklist.c:
- - fixed minimum_size and maximum_size for vertical panels
- - added code to do the logical thing when a panel's orientation
- gets changed
- - use _size everywhere
-
-2002-05-20 Mark McLoughlin <mark@skynet.ie>
-
- * Makefile.am: generate .schemas from .schemas.in.
-
- * clock.schemas.in:
- * mailcheck.schemas.in:
- * pager.schemas.in:
- * tasklist.schemas.in: rename from *.schemas.
-
-2002-05-16 Havoc Pennington <hp@pobox.com>
-
- * pager.c (update_workspaces_model): remove call to
- wnck_workspace_get which appears to have gone away.
-
-2002-05-14 Anders Carlsson <andersca@gnu.org>
-
- * pager.c: (fill_pager_applet):
- * tasklist.c: (fill_tasklist_applet):
- Use wnck_screen_get_default () instead of wnck_screen_get (0).
-
-2002-05-13 Deepa Natarajan <deepa.natarajan@wipro.com>
-
- * GNOME_ClockApplet.xml, GNOME_MailCheckApplet.xml
- GNOME_PagerApplet.xml, GNOME_TasklistApplet.xml:
- added mnemonics for the popup menu.
-
-2002-05-13 Dennis Cranston <dennis_cranston@yahoo.com>
- * mailcheck.c, clock.c: "About..." dialog fixes -- change
- the names to match that in the "Add to panel" menu. Also,
- add an icon for the Inbox Monitor.
-
- * pager.c: "About..." dialog fixes -- correct
- grammar errors in the description field.(bug #80071)
-
-2002-05-11 Thomas Vander Stichele <thomas@apestaart.org>
-
- * tasklist.c: implemented minimum_size and
- maximum_size preferences
- using GConf keys and updates to libwnck
- * tasklist.glade: added configuration spinbuttons
- for min/max size
- * tasklist.schema: added GConf keys
-
-2002-05-06 Martin Hostettler <textshell@neutronstar.dyndns.org>
-
- * pager.glade, pager.schema, pager.glade: Made rows in config
- dialog change to cols in vertical orientation
-
-2002-04-25 Arvind Samptur <arvind.samptur@wipro.com>
- * tasklist.c: (display_about_dialog) typo error in the
- message.(#79707)
-
-2002-05-09 Deepa Natarajan <deepa.natarajan@wipro.com>
-
- * mailcheck.c: set atk name, description and relation.
- set Close as the default button. set mnemonics for label
- and check boxes.
-
-2002-05-01 Anders Carlsson <andersca@gnu.org>
-
- * pager.glade: Remove rules hint from tree view.
- Fixes #80469.
-
-2002-04-29 Benedikt Roth <Benedikt.Roth@gmx.net>
-
- * mailcheck.schemas: Fix a key to use underscore.
-
-2002-04-20 Benedikt Roth <Benedikt.Roth@gmx.net>
-
- * mailcheck.c: (got_remote_answer), (set_mailbox_selection),
- (fill_mailcheck_applet):
- Real fix for #78182: First disable automatic updating,
- then show the dialog.
- Add some tooltips if the status is not updated.
-
-2002-04-17 Arvind Samptur <arvind.samptur@wipro.com>
-
- * mailcheck.c: (got_remote_answer): removed model message
- dialog. (#78182)
-
-2002-04-17 Mark McLoughlin <mark@skynet.ie>
-
- * Makefile.am, handlebin.[ch]: kill FooHandle.
-
- * tasklist.c: (applet_change_orient), (applet_size_request),
- (fill_tasklist_applet): kill handle and set HAS_HANDLE
- flag on the applet.
-
-2002-04-15 Mark McLoughlin <mark@skynet.ie>
-
- * clock.c: (display_properties_dialog): use CET instead
- of GMT. (#78532)
-
- * tasklist.c: (fill_tasklist_applet): fix initial orientation
- of handle (#78544)
-
-2002-04-15 Mark McLoughlin <mark@skynet.ie>
-
- * clock.c: (add_atk_relation), (display_properties_dialog):
- applied AtkRelation patch from pasupathi.duraisamy@wipro.com.
- Fixes #74748.
-
-2002-04-13 Alexander Larsson <alla@lysator.liu.se>
-
- * tasklist.c:
- Set size hints when size_allocating frame.
-
-2002-04-12 Mark McLoughlin <mark@skynet.ie>
-
- * pager.c: (display_properties_dialog): fix warning.
-
-2002-04-10 Havoc Pennington <hp@pobox.com>
-
- * handlebin.h, handlebin.c: cheesy container based on GtkFrame
- that puts a handle grip next to its child
-
- * tasklist.c: put it in the above container, so it has a handle
- grip
-
-2002-04-11 Mikael Hallendal <micke@codefactory.se>
-
- * help/C/mailcheck/mailcheck.xml: fixed typo causing the document
- to not be rendered.
-
-2002-04-06 Gediminas Paulauskas <menesis@delfi.lt>
-
- * clock.c: Add "Show seconds" option (#75108), implement seconds for
- normal time and show 1/100s of internet time only when option is
- enabled, fix updating intervals.
- Make clock updating more efficient.
- Move Internet & UNIX time inside Clock type radio group to make
- prefs dialog more easy to use.
- Fix spacing in prefs and applet
- (this resolves last remaining bits of #72201)
-
- * clock.schemas: add show_seconds option
-
-2002-04-02 Mark McLoughlin <mark@skynet.ie>
-
- * clock.c: (fill_clock_applet): add padding around clock (76948)
-
-2002-03-29 Mark McLoughlin <mark@skynet.ie>
-
- * GNOME_ClockApplet.xml, GNOME_MailCheckApplet.xml:
- GNOME_PagerApplet.xml, GNOME_TasklistApplet.xml,
- clock.c, mailcheck.c, pager.c, pager.glade,
- tasklist.c, tasklist.glade: use 'Preferences' instead
- of 'Properties' for applets (76823).
-
-2002-03-28 Mark McLoughlin <mark@skynet.ie>
-
- * Makefile.am: install mailcheck.soundlist. Patch from
- Benedikt Roth.
-
-2002-03-28 Benedikt Roth <Benedikt.Roth@gmx.net>
-
- * mailcheck.c: (get_remote_password), (got_remote_answer),
- (check_mail_file_status), (after_mail_check), (mail_check_timeout),
- (exec_clicked_cmd), (create_mail_widgets),
- (make_check_widgets_sensitive), (reset_on_clicked_toggled),
- (auto_update_toggled), (mailcheck_properties_page),
- (applet_load_prefs):
- Re-enabled error dialog, ported to gtkdialog and fixed wording (#59271).
- Automatically focus the password entry.
- (Would be nice if enter would be the same as clicking the OK button...)
- Added ability to turn off automatic mail-checking
- and used it when an error occures.
- Removed double call to after_mail_checked()
- which lead to newmail_cmd beeing executed too often (#52924).
- Added preference option to reset the mail status and
- thus stop the animation when clicking on the applet (#28987).
-
- * mailcheck.schemas: Added new reset_on_clicked and auto_update keys
- * help/C/mailcheck/mailcheck.xml: Added some short notes on new
- preference options, probably the screenshot should be updated, too.
-
-2002-03-27 Mark McLoughlin <mark@skynet.ie>
-
- * pager.c: (display_properties_dialog):
- * tasklist.c: (display_properties_dialog): weak ref so
- we don't core if the window gets destroyed (74145)
-
-2002-03-25 Pasupathi Duraisamy <pasupathi.duraisamy@wipro.com>
-
- * clock.c: Fix to provide default action for enter key in
- clock's preference dialog.
-
-2002-03-22 Mark McLoughlin <mark@skynet.ie>
-
- * clock.schemas, mailcheck.schemas, pager.schemas,
- tasklist.schemas: use underscore instead of hyphen
- for all gconf keys ... this is te gconf convention.
-
- * clock.c,mailcheck.c, pager.c, tasklist.c: upd for
- gconf key changes.
-
-2002-03-09 Johan Dahlin <jdahlin@telia.com>
-
- reviewed by Mark McLoughlin <mark@skynet.ie>
-
- * tasklist.c: Get rid of inline xml ui
- (fill_tasklist_applet): Call panel_applet_setup_menu_from_file
- instead of using inline xml so the menu items is translated
- correctly.
-
- * Makefile.am (ui_DATA): Add GNOME_TasklistApplet.xml
-
- * GNOME_TasklistApplet.xml: New file
-
-2002-03-19 Mark McLoughlin <mark@skynet.ie>
-
- * tasklist.c: (display_help_dialog): update for new docs names
- (patch from John Fleck)
-
-2002-03-16 Gediminas Paulauskas <menesis@delfi.lt>
-
- * clock.c:
- Set accessible description for clock, add accelerators for
- property labels (#74748, patch from pasupathi.duraisamy@wipro.com)
- Fixed clock to update at 0 seconds (#71039)
- Removed "Show date in tooltip" option, show it always (#73928).
- Determine if to show 12 or 24 hour clock from locale, not from
- translation (#57153).
- Applet is now made only of a label (it was packed into frame,
- alignment, and box).
- Add Dan Mueth as documenter, leave only George and me as authors.
-
-2002-03-14 Benedikt Roth <Benedikt.Roth@gmx.net>
-
- * mailcheck.c: (get_remote_password), (mailcheck_load_animation),
- (animation_selected), (applet_load_prefs):
- Hide the password in the passwort dialog.
- Correctly load and save the preferences for animation and remote user.
- Correctly display the animation if there is mail.
-
- * mailcheck.schemas: Fix to correctly load/save preferences.
- * tasklist.schemas: Fix typo.
-
-2002-03-12 Mark McLoughlin <mark@skynet.ie>
-
- * pager.c: (display_help_dialog): update for new docs
- names (patch from John Fleck).
-
-2002-03-10 Benedikt Roth <Benedikt.Roth@gmx.net>
-
- reviewed by Mark McLoughlin <mark@skynet.ie>
-
- * clock.c: (display_about_dialog):
- * pager.c: (display_about_dialog):
- * tasklist.c: (display_about_dialog):
- Display translator credits and the applets logo.
-
- * mailcheck.c: (after_mail_check), (mailcheck_about):
- Display translator credits and the applets logo.
- Always show the current status of mails in a tooltip.
-
-2002-03-10 John Fleck <jfleck@inkstain.net>
-
- added:
- * help/C/workspace-switcher/Makefile.am, workspace-switcher-C.omf,
- legal.xml, workspace-switcher.xml, figures/workspacelist_applet.png
- * help/C/window-list/Makefile.am, legal.xml, window-list.xml,
- window-list-C.omf, figures/window_list_applet.png, window_list_group.png
- changed:
- help/Makefile.am
-
-2002-03-10 Havoc Pennington <hp@pobox.com>
-
- * pager.c: init num_rows to 1 not 2, #71689
-
- * pager.schemas: default num_rows to 1 not 2
-
-2002-03-10 Havoc Pennington <hp@pobox.com>
-
- * pager.c (fill_pager_applet): print out gconf errors rather than
- silently dumping them leaving people wondering what happened.
-
- * pager.glade: make max rows on spin button match max in the code.
-
- * pager.c (num_rows_changed): if someone sets 0 or negative pager
- rows, force the value back to 1. Also set sane maximum value.
- #70406
-
-2002-03-10 Havoc Pennington <hp@pobox.com>
-
- * pager.c (setup_dialog): someone did not mean "connect_swapped"
- even though they typed it. ;-) #71395
-
-2002-03-08 Gediminas Paulauskas <menesis@delfi.lt>
-
- * tasklist.glade, pager.glade: use Close button instead of Done
-
-2002-03-08 Gediminas Paulauskas <menesis@delfi.lt>
-
- * clock.c: remove tooltip if "Show date in tooltip" option is unset
- (fixes #73547)
-
-2002-03-05 Seth Nickell <snickell@stanford.edu>
-
- * GNOME_GenUtilApplet_Factory.server.in.in:
-
- Put in "Internet" category. (cleared with translators)
-
-2002-03-04 Mark McLoughlin <mark@skynet.ie>
-
- * main.c: (genutil_factory): kill debug.
-
-2002-03-03 Gediminas Paulauskas <menesis@delfi.lt>
-
- Applied patch by Shivram U <shivaram.upadhyayula@wipro.com>
- to fix #72167
-
- * tasklist.c (destroy_tasklist) : remove the gconf client listeners
- when the tasklist widget is destroyed.
- * pager.c (destroy_pager) : added the same fix when the pager widget
- is destroyed
-
-2002-03-03 Gediminas Paulauskas <menesis@delfi.lt>
-
- * clock.c: hour_format is of type int, was bool, so now it is
- remembered. Ensure we have 12/24 even when there was no error
- getting from gconf. Should fix #73126.
-
-2002-02-25 Mark McLoughlin <mark@skynet.ie>
-
- * Makefile.am: define deprecated flags here.
-
- * clock.c: kill them from here.
-
- * mailcheck.c: remove deprecated crap.
-
-2002-02-25 Anders Carlsson <andersca@gnu.org>
-
- * clock.c (fill_clock_applet): Fix build.
-
-2002-02-25 Gediminas Paulauskas <menesis@delfi.lt>
-
- * clock.c: don't use deprecated things, #define *_DISABLE_DEPRECATED
-
-2002-02-23 Gediminas Paulauskas <menesis@delfi.lt>
-
- Properties now work.
-
- * clock.c: move preferences to gconf, made properties dialog
- instant-apply.
- * clock.schemas: new file for clock properties.
- * Makefile.am: install clock.schemas
-
-2002-02-23 Gediminas Paulauskas <menesis@delfi.lt>
-
- * clock.c: make tooltip work. Convert everything we get from strftime
- to UTF-8, so copy date works right.
- * tasklist.c: remove duplicate setup_gconf call
-
-2002-02-23 Kjartan Maraas <kmaraas@gnome.org>
-
- * tasklist.glade: Don't translate the widget label.
- * pager.glade: Same here.
-
-Fri Feb 22 18:50:04 2002 George Lebl <jirka@5z.com>
-
- * mailcheck.c: compile warning fix
-
- * pager.c: when the setup window is closed by the WM, only hide it,
- should solve some crashes
-
-2002-02-22 Kjartan Maraas <kmaraas@gnome.org>
-
- * tasklist.glade: s/workspaces/workspace in a string.
-
-2002-02-22 Mark McLoughlin <mark@skynet.ie>
-
- * tasklist.c: (display_all_workspaces_changed),
- (get_grouping_type), (group_windows_changed),
- (move_unminimized_windows_changed), (fill_tasklist_applet):
- some sanity check on gconf notify handlers to prevent core
- dumps when removing the applet.
-
-2002-02-21 Kjartan Maraas <kmaraas@gnome.org>
-
- * GNOME_GenUtilApplet_Factory.server.in: Mark category names
- for translation.
-
-2002-02-19 Kevin Vandersloot <kfv101@psu.edu>
-
- * mailcheck.c: Port the prefs dialog to GtkDialog and make
- it instant apply
-
- * Makefile.am: remove the -I{includedir}
-
-2002-02-17 Alexander Larsson <alla@lysator.liu.se>
-
- * tasklist.c:
- (tasklist_update):
- Call wnck_tasklist_set_switch_workspace_on_unminimize().
-
-2002-02-17 Alexander Larsson <alla@lysator.liu.se>
-
- * tasklist.glade:
- * tasklist.scemas:
- Now has never, always or auto window grouping.
-
-2002-02-17 Kjartan Maraas <kmaraas@gnome.org>
-
- * printer.c: Remove deprecated calls to functions
- gtk_widget_push|pop_visual().
-
-2002-02-16 Kjartan Maraas <kmaraas@gnome.org>
-
- * GNOME_ClockApplet.xml: Move the xml menu structure out into a file.
- * GNOME_MailCheckApplet.xml: Same.
- * GNOME_PagerApplet.xml: Same.
- * clock.c: Hook it up.
- * mailcheck.c: Same.
- * pager.c: Same.
- * Makefile.am: Here too.
-
-2002-02-15 Seth Nickell <snickell@stanford.edu>
-
- * GNOME_GenUtilApplet_Factory.server.in.in:
-
- Move the clock into the new accessories category.
-
-2002-02-14 Seth Nickell <snickell@stanford.edu>
-
- * GNOME_GenUtilApplet_Factory.server.in.in:
-
- Add better descriptions.
-
- * pager.c: (display_about_dialog):
- * pager.glade:
-
- Use "Workspace Switcher", not "Workspace List",
- and remove unnecessary verbosity.
-
-2002-02-14 Kjartan Maraas <kmaraas@gnome.org>
-
- * pager.c: #include <config.h>
-
-2002-02-14 Mark McLoughlin <mark@skynet.ie>
-
- * Makefile.am: build applet with -avoid-version -module.
-
-2002-02-14 Mark McLoughlin <mark@skynet.ie>
-
- * clock.c: (display_help_dialog):
- * mailcheck.c: (help_callback):
- * pager.c: (display_help_dialog):
- * tasklist.c: (display_help_dialog): hook up gnome_help
- for all of these.
-
-2002-02-13 Mark McLoughlin <mark@skynet.ie>
-
- * pager.c, pager.glade, tasklist.c, tasklist.glade: Finish of
- the string changes.
-
- "Pager" -> "Workspace List"
- "Tasklist" -> "Window List"
-
-2002-02-13 Mark McLoughlin <mark@skynet.ie>
-
- * Makefile.am: define GNOME_ICONDIR here.
-
-2002-02-12 Kjartan Maraas <kmaraas@gnome.org>
-
- * GNOME_GenUtilApplet_Factory.server.in.in: Mark strings for l10n.
-
-2002-02-11 Kjartan Maraas <kmaraas@gnome.org>
-
- * tasklist.c: #include <config.h>
-
-2002-02-09 Mark McLoughlin <mark@skynet.ie>
-
- * tasklist.c: (fill_tasklist_applet): update for
- panel_applet_set_expand_flags change.
-
-2002-02-09 Mark McLoughlin <mark@skynet.ie>
-
- * GNOME_GenUtilApplet_Factory.server.in.in: move to Vertigo namespace.
-
- * main.c: update for factory macro change.
-
-Wed Feb 06 10:01:46 2002 George Lebl <jirka@5z.com>
-
- * clock.c, mailcheck.c, pager.c, tasklist.c: Get initial values
- for size and orient rather then just using defaults. Background
- still needs sorting out.
-
-2002-02-02 Seth Nickell <snickell@stanford.edu>
-
- * GNOME_GenUtilApplet_Factory.server.in.in:
-
- More funky renaming.
-
-2002-01-31 Mark McLoughlin <mark@skynet.ie>
-
- * clock_applet.desktop:
- * mailcheck_applet.desktop:
- * printer.desktop: remove, not needed anymore.
-
-2002-01-30 Mark McLoughlin <mark@skynet.ie>
-
- * Makefile.am: update for AM_GCONF_SOURCE_2.
-
-2002-01-28 Glynn Foster <glynn.foster@sun.com>
-
- * clock.c, remote-helper.c, tasklist.c: Remove some
- unused variables
-
-2002-01-19 Seth Nickell <snickell@stanford.edu>
-
- * GNOME_GenUtilApplet_Factory.server.in.in:
-
- Panel apparently doesn't like things to not
- have a Category and refuses to add them (though
- it shows them in the tree heirarchy OK...go figure).
- Put in utilities until we sort everything.
-
-2002-01-19 Seth Nickell <snickell@stanford.edu>
-
- * GNOME_GenUtilApplet_Factory.server.in.in:
-
- Rename some applets. Notably "Tasklist" and "Pager"
- to "Window List" and "Workspace List", respectively.
- Nils suggests we might try "Window Bar".
-
-2002-01-19 Seth Nickell <snickell@stanford.edu>
-
- * GNOME_GenUtilApplet_Factory.server.in.in:
-
- Call the clock applet "Clock". Don't put it in a category...
- At least not a "Clocks" category, that's just asking for more
- crack-rock clocks to be written :-)
-
-2002-01-16 Richard Hult <rhult@codefactory.se>
-
- * clock.c (create_computer_clock_widget): Make the time/date be
- centered.
-
-2002-01-13 Alexander Larsson <alla@lysator.liu.se>
-
- * Makefile.am:
- Add TASKLIST_GLADEDIR, tasklist.schemas and tasklist.glade
-
- * tastklist.glade, tasklist.schemas:
- New files.
-
- * pager.c:
- Set up gconf before reading values to avoid tiny race.
- Handle workspaces being renamed.
-
- * tasklist.c:
- Add properties dialog.
-
-2002-01-13 Alexander Larsson <alla@lysator.liu.se>
-
- * pager.c (num_workspaces_value_changed):
- Change gconf key to number_of_workspaces.
-
-2002-01-13 Alexander Larsson <alla@lysator.liu.se>
-
- * pager.glade:
- Hook up the workspaces part of the properties dialog.
- This needs some loving in gnome-settings-daemon to work.
-
-2002-01-12 Alexander Larsson <alla@lysator.liu.se>
-
- * pager.c:
- Hook up more preferences.
-
- * pager.glade:
- Set id of help and done button.
-
-2002-01-12 Alexander Larsson <alla@lysator.liu.se>
-
- * Makefile.am:
- Add gladefile and schemas file for pager.
-
- * pager.c:
- First cut at the properties dialog.
-
- * pager.glade:
- * pager.schemas:
- New files.
-
-Fri, 4 Jan 2002 22:28:51 -0500 Frank Belew <frb@ximian.com>
-
- * Makefile.am: remove -I$(includedir), bad things happen when
- prefix is the same as gnome1 and that gets added so early on the
- list
-
-2002-01-02 Kevin Vandersloot <kfv101@psu.edu>
-
- * mailcheck.c: initial port to new api.
-
- * GNOME_GenUtil....server.in.in:
- * main.c:
- Add mailcheck applet to these
-
-2001-12-17 Mark McLoughlin <mark@skynet.ie>
-
- * clock.c: (fill_clock_applet):
- * clock.h:
- * main.c: (genutil_factory):
- * pager.c: (fill_pager_applet):
- * pager.h:
- * tasklist.c: (fill_tasklist_applet):
- * tasklist.h:
- update for panel-applet api changes.
-
-2001-12-17 Mark McLoughlin <mark@skynet.ie>
-
- * ChangeLog: copied from .. preserving history.
-
-2001-12-14 Alex Larsson <alexl@redhat.com>
-
- * gen_util/tasklist.c (applet_change_background):
- Handle background changes. This doesn't change the color of the
- buttons right now, since we would need the whole style for that.
- But it does handle the part of the tasklist that is empty when
- all the buttons fit on the tasklist.
-
-2001-12-14 Alex Larsson <alexl@redhat.com>
-
- * gen_util/clock.c:
- Handle background color changes.
-
-2001-12-14 Mark McLoughlin <mark@skynet.ie>
-
- * gen_util/clock.c: update for panel-applet
- GNOME_Vertigo namespace changes.
-
-2001-12-08 Richard Hult <rhult@codefactory.se>
-
- * gen_util/clock.c (computer_clock_update_func): Convert time/date
- string to utf-8 before setting the label text.
-
-2001-12-04 Alex Larsson <alexl@redhat.com>
-
- * gen_util/GNOME_GenUtilApplet_Factory.server.in.in:
- * gen_util/tasklist.[ch]:
- * applets/gen_util/Makefile.am:
- New tasklist implementation using libwnck.
-
- * applets/gen_util/pager.c:
- Fixed copyright
-
-2001-11-30 Mark McLoughlin <mark@skynet.ie>
-
- * gen_util/clock.c: (make_clock_applet): update for
- applet api changes.
-
- * gen_util/pager.c: (make_pager_applet): ditto.
-
-2001-11-27 Mark McLoughlin <mark@skynet.ie>
-
- * gen_util/Makefile.am: build against ../../libpanel-applet.
-
-2001-11-26 Mark McLoughlin <mark@skynet.ie>
-
- * gen_util/Makefile.am: add
- GNOME_GenUtilApplet_Factory.server.in.in to EXTRA_DIST.
-
-2001-11-23 Mark McLoughlin <mark@skynet.ie>
-
- * gen_util/GNOME_GenUtilApplet_Factory.server.in.in: add
- "panel:icon" and "panel:category" attributes.
-
-2001-11-23 Alexander Larsson <alla@lysator.liu.se>
-
- * gen_util/Makefile.am:
- * gen_util/clock.[ch]:
- * gen_util/main.c:
- Convert to new applet API and gnome 2.
-
- * gen_util/GNOME_GenUtilApplet_Factory.server.in.in:
- New oaf file for the applets.
-
-2002-04-25 Arvind Samptur <arvind.samptur@wipro.com>
- * tasklist.c: (display_about_dialog) typo error in the
- message.(#79707)
-
diff --git a/mailcheck/GNOME_MailCheckApplet.xml b/mailcheck/GNOME_MailCheckApplet.xml
deleted file mode 100644
index 4b2e7cf22..000000000
--- a/mailcheck/GNOME_MailCheckApplet.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<Root>
- <popups>
- <popup name="button3">
- <menuitem name="Check Item" verb="Check" _label="_Update"
- pixtype="stock" pixname="gtk-refresh" accel="*Control*u"/>
- <separator/>
- <menuitem name="Preferences Item" verb="Preferences" _label="_Preferences"
- pixtype="stock" pixname="gtk-properties"/>
- <menuitem name="Help Item" verb="Help" _label="_Help"
- pixtype="stock" pixname="gtk-help"/>
- <menuitem name="About Item" verb="About" _label="_About"
- pixtype="stock" pixname="gnome-stock-about"/>
- </popup>
- </popups>
-</Root>
-
-
diff --git a/mailcheck/Makefile.am b/mailcheck/Makefile.am
deleted file mode 100644
index 2f083e6c6..000000000
--- a/mailcheck/Makefile.am
+++ /dev/null
@@ -1,85 +0,0 @@
-SUBDIRS = help
-
-INCLUDES = \
- $(WARN_CFLAGS) \
- $(GNOME_APPLETS_CFLAGS) \
- $(DISABLE_DEPRECATED_CFLAGS) \
- -DGNOME_ICONDIR=\""$(datadir)/pixmaps\"" \
- -DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
-
-DISABLE_DEPRECATED_CFLAGS = \
- -DG_DISABLE_DEPRECATED \
- -DGDK_DISABLE_DEPRECATED \
- -DGDK_PIXBUF_DISABLE_DEPRECATED
-
-mailcheck_applet_SOURCES = \
- mailcheck.c \
- mailcheck.h \
- popcheck.c \
- popcheck.h \
- remote-helper.c \
- remote-helper.h
-
-mailcheck_applet_LDADD = \
- $(GNOME_APPLETS_LIBS)
-
-libexec_PROGRAMS = mailcheck-applet
-
-GNOME_MailcheckApplet_Factory.server.in: GNOME_MailcheckApplet_Factory.server.in.in
- sed -e "s|\@LIBEXECDIR\@|$(libexecdir)|" $< > $@
-
-MAILCHECK_BITMAPS = \
- email.png \
- email-e.png \
- tux-anim.png \
- email-eclouds.png \
- email-tiny.png \
- eclouds.png
-
-mailcheckbitmapsdir = $(datadir)/pixmaps/mailcheck
-mailcheckbitmaps_DATA = $(MAILCHECK_BITMAPS)
-
-soundlistdir = $(sysconfdir)/sound/events
-soundlist_in_files = mailcheck.soundlist.in
-soundlist_DATA = $(soundlist_in_files:.soundlist.in=.soundlist)
-
-@INTLTOOL_SOUNDLIST_RULE@
-
-uidir = $(datadir)/gnome-2.0/ui
-ui_DATA = GNOME_MailCheckApplet.xml
-
-pixmapdir = $(datadir)/icons/hicolor/48x48/apps
-pixmap_DATA = gnome-mailcheck.png
-
-serverdir = $(libdir)/bonobo/servers
-server_in_files = GNOME_MailcheckApplet_Factory.server.in
-server_DATA = $(server_in_files:.server.in=.server)
-
-@INTLTOOL_SERVER_RULE@
-
-schemasdir = $(GCONF_SCHEMA_FILE_DIR)
-schemas_in_files = mailcheck.schemas.in
-schemas_DATA = $(schemas_in_files:.schemas.in=.schemas)
-
-@INTLTOOL_SCHEMAS_RULE@
-
-if GCONF_SCHEMAS_INSTALL
-# don't do this if we are building in eg. rpm
-install-data-local:
- if test -z "$(DESTDIR)" ; then \
- for p in $(schemas_DATA) ; do \
- GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(top_builddir)/mailcheck/$$p ; \
- done \
- fi
-else
-install-data-local:
-endif
-
-EXTRA_DIST = \
- GNOME_MailcheckApplet_Factory.server.in.in \
- $(MAILCHECK_BITMAPS) \
- $(soundlist_in_files) \
- $(schemas_in_files) \
- $(ui_DATA)
-
-CLEANFILES = $(server_in_files) $(server_DATA)
diff --git a/mailcheck/eclouds.png b/mailcheck/eclouds.png
deleted file mode 100644
index 54711b8ed..000000000
--- a/mailcheck/eclouds.png
+++ /dev/null
Binary files differ
diff --git a/mailcheck/email-e.png b/mailcheck/email-e.png
deleted file mode 100644
index 2f988eff5..000000000
--- a/mailcheck/email-e.png
+++ /dev/null
Binary files differ
diff --git a/mailcheck/email-eclouds.png b/mailcheck/email-eclouds.png
deleted file mode 100644
index 36bbb6108..000000000
--- a/mailcheck/email-eclouds.png
+++ /dev/null
Binary files differ
diff --git a/mailcheck/email-tiny.png b/mailcheck/email-tiny.png
deleted file mode 100644
index 72a9219be..000000000
--- a/mailcheck/email-tiny.png
+++ /dev/null
Binary files differ
diff --git a/mailcheck/email.png b/mailcheck/email.png
deleted file mode 100644
index 30d0eb4d9..000000000
--- a/mailcheck/email.png
+++ /dev/null
Binary files differ
diff --git a/mailcheck/gnome-mailcheck.png b/mailcheck/gnome-mailcheck.png
deleted file mode 100644
index 61dabe4be..000000000
--- a/mailcheck/gnome-mailcheck.png
+++ /dev/null
Binary files differ
diff --git a/mailcheck/mailcheck.c b/mailcheck/mailcheck.c
deleted file mode 100644
index fa45f84e4..000000000
--- a/mailcheck/mailcheck.c
+++ /dev/null
@@ -1,2938 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* GNOME panel mail check module.
- * (C) 1997, 1998, 1999, 2000 The Free Software Foundation
- * (C) 2001 Eazel, Inc.
- *
- * Authors: Miguel de Icaza
- * Jacob Berkman
- * Jaka Mocnik
- * Lennart Poettering
- * George Lebl
- *
- */
-
-#include <config.h>
-#include <stdio.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <dirent.h>
-#include <string.h>
-#include <libgnome/libgnome.h>
-#include <libgnomeui/libgnomeui.h>
-#include <gconf/gconf-client.h>
-#include <panel-applet.h>
-#include <panel-applet-gconf.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <libgnomeui/gnome-window-icon.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-#include "popcheck.h"
-#include "remote-helper.h"
-#include "mailcheck.h"
-
-#define ENCODE 1
-#define DECODE 0
-
-#define NEVER_SENSITIVE "never_sensitive"
-
-static const char *to_b64 =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
-/* encode 72 characters per line */
-#define CHARS_PER_LINE 72
-
-typedef enum {
- MAILBOX_LOCAL,
- MAILBOX_LOCALDIR,
- MAILBOX_POP3,
- MAILBOX_IMAP
-} MailboxType;
-
-typedef struct
-{
- int size;
- char *data;
-} memchunk;
-
-typedef struct _MailCheck MailCheck;
-struct _MailCheck {
- char *mail_file;
-
- /* Does the user have any mail at all? */
- gboolean anymail;
-
- /* whether new mail has arrived */
- gboolean newmail;
-
- /* number of unread/total mails */
- int unreadmail;
- int totalmail;
-
- /* whether to automatically check for mails */
- gboolean auto_update;
-
- /* interval to check for mails in milliseconds */
- guint update_freq;
-
- /* Pref is reset_on_clicked. Show animation is intended to restart animation for newmail */
- gboolean reset_on_clicked;
- gboolean show_animation;
-
- /* execute a command when the applet is clicked (launch email prog) */
- char *clicked_cmd;
- gboolean clicked_enabled;
-
- /* execute a command when new mail arrives (play a sound etc.) */
- char *newmail_cmd;
- gboolean newmail_enabled;
-
- /* execute a command before checking email (fetchmail etc.) */
- char *pre_check_cmd;
- gboolean pre_check_enabled;
-
- PanelApplet *applet;
- /* This is the event box for catching events */
- GtkWidget *ebox;
-
- /* This holds either the drawing area or the label */
- GtkWidget *bin;
-
- /* The widget that holds the label with the mail information */
- GtkWidget *label;
-
- /* Points to whatever we have inside the bin */
- GtkWidget *containee;
-
- /* The drawing area */
- GtkWidget *da;
- GdkPixmap *email_pixmap;
- GdkBitmap *email_mask;
-
- /* handle for the timeout */
- int mail_timeout;
-
- /* how do we report the mail status */
- enum {
- REPORT_MAIL_USE_TEXT,
- REPORT_MAIL_USE_BITMAP,
- REPORT_MAIL_USE_ANIMATION
- } report_mail_mode;
-
- /* current frame on the animation */
- int nframe;
-
- /* number of frames on the pixmap */
- int frames;
-
- /* handle for the animation timeout handler */
- int animation_tag;
-
- /* for the selection routine */
- char *selected_pixmap_name;
-
- /* the about box */
- GtkWidget *about;
-
- /* The property window */
- GtkWidget *property_window;
- GtkWidget *min_spin, *sec_spin;
- GtkWidget *pre_check_cmd_entry, *pre_check_cmd_check;
- GtkWidget *newmail_cmd_entry, *newmail_cmd_check;
- GtkWidget *clicked_cmd_entry, *clicked_cmd_check;
-
- GtkWidget *password_dialog;
-
- gboolean anim_changed;
-
- char *mailcheck_text_only;
-
- char *animation_file;
-
- GtkWidget *mailfile_entry, *mailfile_label, *mailfile_fentry;
- GtkWidget *remote_server_entry, *remote_username_entry, *remote_password_entry, *remote_folder_entry;
- GtkWidget *remote_server_label, *remote_username_label, *remote_password_label, *remote_folder_label;
- GtkWidget *remote_option_menu;
- GtkWidget *remote_password_checkbox;
- GtkWidget *play_sound_check;
-
- char *remote_server, *remote_username, *remote_password, *real_password, *remote_folder;
- char *remote_encrypted_password;
-
- MailboxType mailbox_type; /* local = 0; maildir = 1; pop3 = 2; imap = 3 */
- MailboxType mailbox_type_temp;
-
- gboolean play_sound;
-
- gboolean save_remote_password;
-
- int type; /*mailcheck = 0; mailbox = 1 */
-
- off_t oldsize;
-
- int size;
-
- gulong applet_realized_signal;
-
- /* see remote-helper.h */
- gpointer remote_handle;
-};
-
-static char* b64enc (const memchunk *chunk);
-static memchunk* b64dec (const char *string);
-static memchunk* memchunkAlloc (int size);
-static char* util_base64 (char *data, int flag);
-static void remote_password_save_toggled (GtkToggleButton *button,
- gpointer data);
-static void remote_password_changed (GtkEntry *entry, gpointer data);
-static gboolean focus_out_cb (GtkWidget *entry, GdkEventFocus *event, gpointer data);
-
-static int mail_check_timeout (gpointer data);
-static void after_mail_check (MailCheck *mc);
-
-static void applet_load_prefs(MailCheck *mc);
-
-static void set_atk_name_description (GtkWidget *widget, const gchar *name,
- const gchar *description);
-static void set_atk_relation (GtkWidget *label, GtkWidget *entry, AtkRelationType);
-static void got_remote_answer (int mails, gpointer data);
-static void error_handler (int mails, gpointer data);
-static void null_remote_handle (gpointer data);
-
-#define WANT_BITMAPS(x) (x == REPORT_MAIL_USE_ANIMATION || x == REPORT_MAIL_USE_BITMAP)
-#define HIG_IDENTATION " "
-
-static memchunk*
-memchunkAlloc(int size)
-{
- memchunk *tmp = (memchunk*) calloc(1, sizeof(memchunk));
-
- if (tmp) {
- tmp->size = size;
- tmp->data = (char *) malloc(size);
-
- if (tmp->data == (char *) 0) {
- free(tmp);
- tmp = NULL;
- }
- }
-
- return tmp;
-}
-
-/*
- * b64enc:
- * @chunk: A structure which contains the data to be encrypted.
- *
- * This routine encrypts the data using base64 encryption technique
- *
- * Returns the encrypted data in a character array.
- */
-
-
-static char*
-b64enc(const memchunk *chunk)
-{
- int div = chunk->size / 3;
- int rem = chunk->size % 3;
- int chars = div*4 + rem + 1;
- int newlines = (chars + CHARS_PER_LINE - 1) / CHARS_PER_LINE;
-
- const char *data = chunk->data;
- char *string = (char *) malloc(chars + newlines + 1);
-
- if (string) {
- register char* buf = string;
-
- chars = 0;
-
- /*@+charindex@*/
- while (div > 0) {
- buf[0] = to_b64[ (data[0] >> 2) & 0x3f];
- buf[1] = to_b64[((data[0] << 4) & 0x30) +
- ((data[1] >> 4) & 0xf)];
- buf[2] = to_b64[((data[1] << 2) & 0x3c) +
- ((data[2] >> 6) & 0x3)];
- buf[3] = to_b64[ data[2] & 0x3f];
- data += 3;
- buf += 4;
- div--;
- chars += 4;
- if (chars == CHARS_PER_LINE) {
- chars = 0;
- *(buf++) = '\n';
- }
- }
-
- switch (rem) {
- case 2:
- buf[0] = to_b64[ (data[0] >> 2) & 0x3f];
- buf[1] = to_b64[((data[0] << 4) & 0x30) +
- ((data[1] >> 4) & 0xf)];
- buf[2] = to_b64[ (data[1] << 2) & 0x3c];
- buf[3] = '=';
- buf += 4;
- chars += 4;
- break;
- case 1:
- buf[0] = to_b64[ (data[0] >> 2) & 0x3f];
- buf[1] = to_b64[ (data[0] << 4) & 0x30];
- buf[2] = '=';
- buf[3] = '=';
- buf += 4;
- chars += 4;
- break;
- }
- /*@=charindex@*/
-
- /* *(buf++) = '\n'; This would result in a buffer overrun */
- *buf = '\0';
- }
-
- return string;
-}
-
-/*
- * b64dec:
- * @string: A character array which contains the data to be decoded.
- *
- * This routine decrypts the data using base64 decryption technique
- *
- * Returns the decrypted data.
- */
-
-static memchunk*
-b64dec(const char *string)
-{
-
-/* return a decoded memchunk, or a null pointer in case of failure */
-
- memchunk *rc = NULL;
-
- if (string) {
- register int length = strlen(string);
-
- /* do a format verification first */
- if (length > 0) {
- register int count = 0, rem = 0;
- register const char* tmp = string;
-
- while (length > 0) {
- register int skip = strspn(tmp, to_b64);
- count += skip;
- length -= skip;
- tmp += skip;
- if (length > 0) {
- register int i, vrfy =
- strcspn(tmp, to_b64);
-
- for (i = 0; i < vrfy; i++) {
- if (isspace(tmp[i]))
- continue;
-
- if (tmp[i] == '=') {
- /* we should check if
- * we're close to the
- * end of the string */
- rem = count % 4;
-
- /* rem must be either
- * 2 or 3, otherwise
- * no '=' should be
- * here */
- if (rem < 2)
- return NULL;
-
- /* end-of-message
- * recognized */
- break;
- } else {
- /* Transmission error */
-
- return NULL;
- }
- }
-
- length -= vrfy;
- tmp += vrfy;
- }
- }
-
- rc = memchunkAlloc((count / 4) * 3 + (rem ? (rem - 1) : 0));
-
- if (rc) {
- if (count > 0) {
- register int i, qw = 0, tw = 0;
- register char * data = rc->data;
-
- length = strlen(tmp = string);
-
- for (i = 0; i < length; i++) {
- register char ch = string[i];
- register char bits;
-
- if (isspace(ch))
- continue;
-
- bits = 0;
- if ((ch >= 'A') && (ch <= 'Z')) {
- bits = (char)
- (ch - 'A');
- }
- else if ((ch >= 'a') &&
- (ch <= 'z')) {
- bits = (char)
- (ch - 'a' + 26);
- }
- else if ((ch >= '0') &&
- (ch <= '9')) {
- bits = (char)
- (ch - '0' + 52);
- }
- else if (ch == '=')
- break;
-
- switch (qw++) {
- case 0:
- data[tw+0] =
- (bits << 2) & 0xfc;
- break;
- case 1:
- data[tw+0] |=
- (bits >> 4) & 0x03;
- data[tw+1] =
- (bits << 4) & 0xf0;
- break;
- case 2:
- data[tw+1] |=
- (bits >> 2) & 0x0f;
- data[tw+2] =
- (bits << 6) & 0xc0;
- break;
- case 3:
- data[tw+2] |=
- bits & 0x3f;
- break;
- }
-
- if (qw == 4) {
- qw = 0;
- tw += 3;
- }
- }
- }
- }
- }
- }
-
- return rc;
-}
-
-
-/*
- * util_base64:
- * @data: A character array which contains the data.
- * @flag: Indicates the action to be performed ENCODE/DECODE
- *
- * This is the interface called by other routines for encoding or decoding using
- * base64 encryption/decryption technique. The action is performed based on the flag.
- *
- * Returns either the encrypted data or the decrypted data based on the flag.
- */
-
-static char*
-util_base64(char* data, int flag)
-{
- char *enc_data;
- memchunk chunk;
- memchunk *ret_data;
- char *dec_data;
-
- switch (flag) {
- case ENCODE :
-
- chunk.data = data;
- chunk.size = strlen(data);
- enc_data = b64enc(&chunk);
-
- return enc_data;
-
- case DECODE :
-
- ret_data = (memchunk *) b64dec((char *)data);
- if(ret_data) {
- dec_data = g_strndup(ret_data->data,
- ret_data->size);
- free (ret_data);
- }
- else
- dec_data = NULL;
-
- return dec_data;
-
- default :
- return NULL;
-
- }
-}
-
-static gboolean
-key_writable (PanelApplet *applet, const char *key)
-{
- gboolean writable;
- char *fullkey;
- static GConfClient *client = NULL;
- if (client == NULL)
- client = gconf_client_get_default ();
-
- fullkey = panel_applet_gconf_get_full_key (applet, key);
-
- writable = gconf_client_key_is_writable (client, fullkey, NULL);
-
- g_free (fullkey);
-
- return writable;
-}
-
-/* set sensitive and setup NEVER_SENSITIVE appropriately */
-static void
-hard_set_sensitive (GtkWidget *w, gboolean sensitivity)
-{
- gtk_widget_set_sensitive (w, sensitivity);
- g_object_set_data (G_OBJECT (w), NEVER_SENSITIVE,
- GINT_TO_POINTER ( ! sensitivity));
-}
-
-
-/* set sensitive, but always insensitive if NEVER_SENSITIVE is set */
-static void
-soft_set_sensitive (GtkWidget *w, gboolean sensitivity)
-{
- if (g_object_get_data (G_OBJECT (w), NEVER_SENSITIVE))
- gtk_widget_set_sensitive (w, FALSE);
- else
- gtk_widget_set_sensitive (w, sensitivity);
-}
-
-/* stolen from gsearchtool */
-static GtkWidget*
-hig_dialog_new (GtkWindow *parent,
- GtkDialogFlags flags,
- GtkMessageType type,
- GtkButtonsType buttons,
- const gchar *header,
- const gchar *message)
-{
- GtkWidget *dialog;
- GtkWidget *dialog_vbox;
- GtkWidget *dialog_action_area;
- GtkWidget *hbox;
- GtkWidget *vbox;
- GtkWidget *label;
- GtkWidget *button;
- GtkWidget *image = NULL;
- gchar *title;
-
- dialog = gtk_dialog_new ();
-
- gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
- gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
- gtk_window_set_title (GTK_WINDOW (dialog), "");
-
- dialog_vbox = GTK_DIALOG (dialog)->vbox;
- gtk_box_set_spacing (GTK_BOX (dialog_vbox), 14);
-
- hbox = gtk_hbox_new (FALSE, 12);
- gtk_box_pack_start (GTK_BOX (dialog_vbox), hbox, FALSE, FALSE, 0);
- gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
- gtk_widget_show (hbox);
-
- if (type == GTK_MESSAGE_ERROR) {
- image = gtk_image_new_from_stock ("gtk-dialog-error", GTK_ICON_SIZE_DIALOG);
- } else if (type == GTK_MESSAGE_QUESTION) {
- image = gtk_image_new_from_stock ("gtk-dialog-question", GTK_ICON_SIZE_DIALOG);
- } else {
- g_assert_not_reached ();
- }
- gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
- gtk_widget_show (image);
-
- vbox = gtk_vbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
- gtk_widget_show (vbox);
-
- title = g_strconcat ("<b>", header, "</b>", NULL);
- label = gtk_label_new (title);
- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
- gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
- gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
- gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
- gtk_widget_show (label);
- g_free (title);
-
- label = gtk_label_new (message);
- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
- gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
- gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
- gtk_widget_show (label);
-
- dialog_action_area = GTK_DIALOG (dialog)->action_area;
- gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area), GTK_BUTTONBOX_END);
-
- switch (buttons)
- {
- case GTK_BUTTONS_OK_CANCEL:
-
- button = gtk_button_new_from_stock ("gtk-cancel");
- gtk_widget_show (button);
- gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_CANCEL);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
-
- button = gtk_button_new_from_stock ("gtk-ok");
- gtk_widget_show (button);
- gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_OK);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
- break;
-
- case GTK_BUTTONS_OK:
-
- button = gtk_button_new_from_stock ("gtk-ok");
- gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_OK);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
- gtk_widget_show (button);
- break;
-
- default:
- g_warning ("Unhandled GtkButtonsType");
- break;
- }
-
- if (parent != NULL) {
- gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
- }
- if (flags & GTK_DIALOG_MODAL) {
- gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
- }
- if (flags & GTK_DIALOG_DESTROY_WITH_PARENT) {
- gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
- }
-
- return dialog;
-}
-
-static void
-set_tooltip (GtkWidget *applet,
- const char *tip)
-{
- GtkTooltips *tooltips;
-
- tooltips = g_object_get_data (G_OBJECT (applet), "tooltips");
- if (!tooltips) {
- tooltips = gtk_tooltips_new ();
- g_object_ref (tooltips);
- gtk_object_sink (GTK_OBJECT (tooltips));
- g_object_set_data_full (
- G_OBJECT (applet), "tooltips", tooltips,
- (GDestroyNotify) g_object_unref);
- }
-
- gtk_tooltips_set_tip (tooltips, applet, tip, NULL);
- set_atk_name_description (applet, tip, "");
-}
-
-static void
-mailcheck_execute_shell (MailCheck *mailcheck,
- const char *command)
-{
- GError *error = NULL;
-
- gdk_spawn_command_line_on_screen (gtk_widget_get_screen (GTK_WIDGET (mailcheck->applet)),
- command, &error);
-
- if (error) {
- GtkWidget *dialog;
- char *msg;
-
- msg = g_strdup_printf (_("There was an error executing %s: %s"),
- command,
- error->message);
- dialog = hig_dialog_new (NULL /* parent */,
- 0 /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Error checking mail"),
- msg);
- g_free (msg);
-
- g_signal_connect (dialog, "response",
- G_CALLBACK (gtk_widget_destroy),
- NULL);
-
- gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
- gtk_window_set_screen (GTK_WINDOW (dialog),
- gtk_widget_get_screen (GTK_WIDGET (mailcheck->applet)));
-
- gtk_widget_show (dialog);
-
- g_error_free (error);
- }
-}
-
-void
-command_execute_shell (gpointer data,
- const char *command)
-{
- MailCheck *mc = (MailCheck *) data;
- mailcheck_execute_shell (mc, command);
-}
-
-static G_CONST_RETURN char *
-mail_animation_filename (MailCheck *mc)
-{
- if (!mc->animation_file) {
- mc->animation_file =
- gnome_program_locate_file (
- NULL, GNOME_FILE_DOMAIN_PIXMAP,
- "mailcheck/email.png", TRUE, NULL);
-
- return mc->animation_file;
-
- } else if (mc->animation_file [0]) {
- if (g_file_test (mc->animation_file, G_FILE_TEST_EXISTS))
- return mc->animation_file;
-
- g_free (mc->animation_file);
- mc->animation_file = NULL;
-
- return NULL;
- } else
- /* we are using text only, since the filename was "" */
- return NULL;
-}
-
-static int
-calc_dir_contents (char *dir)
-{
- DIR *dr;
- struct dirent *de;
- int size=0;
-
- dr = opendir(dir);
- if (dr == NULL)
- return 0;
- while((de = readdir(dr))) {
- if (strlen(de->d_name) < 1 || de->d_name[0] == '.')
- continue;
- size ++;
- }
- closedir(dr);
- return size;
-}
-
-static void
-check_remote_mailbox (MailCheck *mc)
-{
- if (!mc->real_password || !mc->remote_username || !mc->remote_server)
- return;
-
- if (mc->mailbox_type == MAILBOX_POP3)
- mc->remote_handle = helper_pop3_check (got_remote_answer,
- error_handler,
- mc,
- null_remote_handle,
- NULL,
- mc->remote_server,
- mc->remote_username,
- mc->real_password);
- else if (mc->mailbox_type == MAILBOX_IMAP)
- mc->remote_handle = helper_imap_check (got_remote_answer,
- error_handler,
- mc,
- null_remote_handle,
- NULL,
- mc->remote_server,
- mc->remote_username,
- mc->real_password,
- mc->remote_folder);
-}
-
-static void
-password_response_cb (GtkWidget *dialog,
- int response_id,
- MailCheck *mc)
-{
-
- switch (response_id) {
- GtkWidget *entry;
- GtkWidget *save_toggle_button;
-
- case GTK_RESPONSE_OK:
- entry = g_object_get_data (G_OBJECT (dialog), "password_entry");
- mc->real_password = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
- remote_password_changed (GTK_ENTRY (entry), mc);
- save_toggle_button = g_object_get_data (G_OBJECT (dialog), "save_password");
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (save_toggle_button)))
- remote_password_save_toggled (GTK_TOGGLE_BUTTON (save_toggle_button), mc);
- check_remote_mailbox (mc);
- break;
- }
-
- gtk_widget_destroy (dialog);
- mc->password_dialog = NULL;
-}
-static void
-get_remote_password (MailCheck *mc)
-{
- GtkWidget *dialog;
- GtkWidget *hbox;
- GtkWidget *label;
- GtkWidget *entry;
- GtkWidget *save_password_checkbox;
-
- if (mc->password_dialog) {
- gtk_window_set_screen (GTK_WINDOW (mc->password_dialog),
- gtk_widget_get_screen (GTK_WIDGET (mc->applet)));
- gtk_window_present (GTK_WINDOW (mc->password_dialog));
- return;
- }
-
- mc->password_dialog = dialog =
- gtk_dialog_new_with_buttons (
- _("Inbox Monitor"), NULL, 0,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
-
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
-
- label = gtk_label_new (_("You didn't set a password in the preferences for the Inbox Monitor,\nso you have to enter it each time it starts up."));
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), label, FALSE, FALSE, GNOME_PAD_BIG);
- gtk_widget_show (label);
-
- hbox = gtk_hbox_new (FALSE, 1);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
- hbox, FALSE, FALSE, GNOME_PAD_SMALL);
-
- label = gtk_label_new_with_mnemonic (_("Please enter your mailserver's _password:"));
- gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
-
- entry = gtk_entry_new ();
-
- set_atk_name_description (entry, _("Password Entry box"), "");
- set_atk_relation (entry, label, ATK_RELATION_LABELLED_BY);
- gtk_entry_set_visibility (GTK_ENTRY (entry), FALSE);
- gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
- gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0);
- gtk_widget_show_all (hbox);
- gtk_widget_grab_focus (GTK_WIDGET (entry));
-
- hbox = gtk_hbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox,
- FALSE, FALSE, GNOME_PAD_SMALL);
-
- gtk_widget_show (hbox);
-
- save_password_checkbox = gtk_check_button_new_with_mnemonic (
- _("_Save password to disk"));
- if ( ! key_writable (mc->applet, "remote_encrypted_password")) {
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (save_password_checkbox),
- FALSE);
- hard_set_sensitive (save_password_checkbox, FALSE);
- } else {
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (save_password_checkbox),
- mc->save_remote_password);
- }
-
- if ( ! key_writable (mc->applet, "save_password")) {
- hard_set_sensitive (save_password_checkbox, FALSE);
- }
-
- gtk_widget_show (save_password_checkbox);
- gtk_box_pack_start (GTK_BOX (hbox), save_password_checkbox, FALSE, FALSE, 0);
-
- gtk_window_set_screen (GTK_WINDOW (dialog),
- gtk_widget_get_screen (GTK_WIDGET (mc->applet)));
-
- g_signal_connect (dialog, "response",
- G_CALLBACK (password_response_cb), mc);
-
- g_object_set_data (G_OBJECT (dialog), "save_password", save_password_checkbox);
- g_object_set_data (G_OBJECT (dialog), "password_entry", entry);
- gtk_widget_show (GTK_WIDGET (dialog));
-}
-
-static void
-got_remote_answer (int mails, gpointer data)
-{
- MailCheck *mc = data;
- int old_unreadmail;
-
- mc->remote_handle = NULL;
-
- old_unreadmail = mc->unreadmail;
- mc->unreadmail = (signed int) (((unsigned int) mails) >> 16);
- if(mc->unreadmail > old_unreadmail) /* lt */
- mc->newmail = 1;
- else
- mc->newmail = 0;
- mc->totalmail = (signed int) (((unsigned int) mails) & 0x0000FFFFL);
- mc->anymail = mc->totalmail ? 1 : 0;
-
- after_mail_check (mc);
-}
-
-static void
-error_handler (int error, gpointer data)
-{
- MailCheck *mc = data;
- gchar *details;
-
- switch (error) {
- case NETWORK_ERROR:
- details = _("Could not connect to the Internet.");
- break;
- case INVALID_USER:
- case INVALID_PASS:
- details = _("The username or password is incorrect.");
- break;
- case INVALID_SERVER:
- details = _("The server name is incorrect.");
- break;
- case NO_SERVER_INFO:
- default:
- details = _("Error connecting to mail server.");
- break;
- }
- /* FIXME: Show some sort of error images for non text mode */
- if (mc->report_mail_mode == REPORT_MAIL_USE_TEXT) {
- gtk_label_set_text (GTK_LABEL (mc->label), _("Error"));
- }
-
- set_tooltip (GTK_WIDGET (mc->applet), details);
- if (mc->animation_tag != 0){
- gtk_timeout_remove (mc->animation_tag);
- mc->animation_tag = 0;
- }
-}
-
-static void
-applet_realized_cb (GtkWidget *widget, gpointer data)
-{
- MailCheck *mc = data;
- mail_check_timeout (mc);
- g_signal_handler_disconnect (G_OBJECT(widget), mc->applet_realized_signal);
-}
-
-static void
-null_remote_handle (gpointer data)
-{
- MailCheck *mc = data;
-
- mc->remote_handle = NULL;
-}
-
-/*
- * Get file modification time, based upon the code
- * of Byron C. Darrah for coolmail and reused on fvwm95
- */
-static void
-check_mail_file_status (MailCheck *mc)
-{
- off_t newsize;
- struct stat s;
- int status;
-
- if ((mc->mailbox_type == MAILBOX_POP3) ||
- (mc->mailbox_type == MAILBOX_IMAP)) {
- if (mc->remote_handle != NULL)
- /* check in progress */
- return;
-
- if (mc->remote_password != NULL &&
- mc->remote_password[0] != '\0') {
- g_free (mc->real_password);
- mc->real_password = g_strdup (mc->remote_password);
-
- } else if (!mc->real_password)
- get_remote_password (mc);
-
- check_remote_mailbox (mc);
- }
- else if (mc->mailbox_type == MAILBOX_LOCAL) {
- status = stat (mc->mail_file, &s);
- if (status < 0) {
- mc->oldsize = 0;
- mc->anymail = mc->newmail = mc->unreadmail = 0;
- after_mail_check (mc);
- return;
- }
-
- newsize = s.st_size;
- mc->anymail = newsize > 0;
- mc->unreadmail = (s.st_mtime >= s.st_atime && newsize > 0);
-
- if (newsize != mc->oldsize && mc->unreadmail)
- mc->newmail = 1;
- else
- mc->newmail = 0;
-
- mc->oldsize = newsize;
-
- after_mail_check (mc);
- }
- else if (mc->mailbox_type == MAILBOX_LOCALDIR) {
- int newmail, oldmail;
- char tmp[1024];
- g_snprintf(tmp, sizeof (tmp), "%s/new", mc->mail_file);
- newmail = calc_dir_contents(tmp);
- g_snprintf(tmp, sizeof (tmp), "%s/cur", mc->mail_file);
- oldmail = calc_dir_contents(tmp);
- mc->newmail = newmail > mc->oldsize;
- mc->unreadmail = newmail;
- mc->oldsize = newmail;
- mc->anymail = newmail || oldmail;
- mc->totalmail = newmail + oldmail;
-
- after_mail_check (mc);
- }
-}
-
-static gboolean
-mailcheck_load_animation (MailCheck *mc, const char *fname)
-{
- int width, height;
- int pbwidth, pbheight;
- GdkPixbuf *pb;
-
- if (mc->email_pixmap)
- g_object_unref (mc->email_pixmap);
-
- if (mc->email_mask)
- g_object_unref (mc->email_mask);
-
- mc->email_pixmap = NULL;
- mc->email_mask = NULL;
-
- pb = gdk_pixbuf_new_from_file (fname, NULL);
- if (!pb)
- return FALSE;
-
- pbwidth = gdk_pixbuf_get_width (pb);
- pbheight = gdk_pixbuf_get_height (pb);
-
- if(pbheight != mc->size) {
- GdkPixbuf *pbt;
- height = mc->size;
- width = pbwidth*((double)height/pbheight);
-
- pbt = gdk_pixbuf_scale_simple(pb, width, height,
- GDK_INTERP_NEAREST);
- g_object_unref (pb);
- pb = pbt;
- } else {
- width = pbwidth;
- height = pbheight;
- }
-
- /* yeah, they have to be square, in case you were wondering :-) */
- mc->frames = width / height;
- if (mc->frames < 3)
- return FALSE;
- else if (mc->frames == 3)
- mc->report_mail_mode = REPORT_MAIL_USE_BITMAP;
- else
- mc->report_mail_mode = REPORT_MAIL_USE_ANIMATION;
- mc->nframe = 0;
-
- mc->email_pixmap = gdk_pixmap_new (gdk_screen_get_root_window (
- gtk_widget_get_screen (GTK_WIDGET (mc->applet))),
- width, height, -1);
-
- gdk_draw_pixbuf (mc->email_pixmap, mc->da->style->black_gc, pb,
- 0, 0, 0, 0, width, height,
- GDK_RGB_DITHER_NORMAL, 0, 0);
-
- g_object_unref (pb);
-
- return TRUE;
-}
-
-static int
-next_frame (gpointer data)
-{
- MailCheck *mc = data;
-
- mc->nframe = (mc->nframe + 1) % mc->frames;
- if (mc->nframe == 0)
- mc->nframe = 1;
-
- gtk_widget_queue_draw (mc->da);
-
- return TRUE;
-}
-
-static void
-after_mail_check (MailCheck *mc)
-{
- static const char *supinfo[] = {"mailcheck", "new-mail", NULL};
- char *text;
- char *plural1, *plural2;
-
- if (mc->anymail){
- if(mc->mailbox_type == MAILBOX_LOCAL) {
- if(mc->newmail)
- text = g_strdup(_("You have new mail."));
- else
- text = g_strdup(_("You have mail."));
- }
- else {
- if (mc->unreadmail) {
- plural1 = g_strdup_printf(ngettext ("%d unread", "%d unread", mc->unreadmail), mc->unreadmail);
- plural2 = g_strdup_printf(ngettext ("%d message", "%d messages", mc->totalmail), mc->totalmail);
-
- /* translators: this is of the form "%d unread/%d messages" */
- text = g_strdup_printf(_("%s/%s"), plural1, plural2);
-
- g_free (plural1);
- g_free (plural2);
- }
- else
- text = g_strdup_printf(ngettext ("%d message",
- "%d messages",
- mc->totalmail),
- mc->totalmail);
- }
- }
- else
- text = g_strdup_printf(_("No mail."));
-
- if (mc->newmail) {
- mc->show_animation = TRUE;
-
- if(mc->play_sound)
- gnome_triggers_vdo("You've got new mail!", "program", supinfo);
-
- if (mc->newmail_enabled &&
- mc->newmail_cmd &&
- (strlen(mc->newmail_cmd) > 0))
- mailcheck_execute_shell (mc, mc->newmail_cmd);
- }
-
- switch (mc->report_mail_mode) {
- case REPORT_MAIL_USE_ANIMATION:
- if (mc->anymail){
- if (mc->unreadmail){
- if (mc->animation_tag == 0 && mc->show_animation){
- mc->animation_tag = gtk_timeout_add (150, next_frame, mc);
- mc->nframe = 1;
- }
- } else {
- if (mc->animation_tag != 0){
- gtk_timeout_remove (mc->animation_tag);
- mc->animation_tag = 0;
- }
- mc->nframe = 1;
- }
- } else {
- if (mc->animation_tag != 0){
- gtk_timeout_remove (mc->animation_tag);
- mc->animation_tag = 0;
- }
- mc->nframe = 0;
- }
-
- gtk_widget_queue_draw (mc->da);
-
- break;
- case REPORT_MAIL_USE_BITMAP:
- if (mc->anymail){
- if (mc->newmail)
- mc->nframe = 2;
- else
- mc->nframe = 1;
- } else
- mc->nframe = 0;
-
- gtk_widget_queue_draw (mc->da);
-
- break;
- case REPORT_MAIL_USE_TEXT:
- gtk_label_set_text (GTK_LABEL (mc->label), text);
- break;
- }
-
- set_tooltip (GTK_WIDGET (mc->applet), text);
- g_free (text);
-}
-
-static gboolean
-mail_check_timeout (gpointer data)
-{
- MailCheck *mc = data;
-
- if (mc->pre_check_enabled &&
- mc->pre_check_cmd &&
- (strlen(mc->pre_check_cmd) > 0)){
- /*
- * if we have to execute a command before checking for mail, we
- * remove the mail-check timeout and re-add it after the command
- * returns, just in case the execution takes too long.
- */
-
- if(mc->mail_timeout != 0) {
- gtk_timeout_remove (mc->mail_timeout);
- mc->mail_timeout = 0;
- }
-
- mailcheck_execute_shell (mc, mc->pre_check_cmd);
-
- if(mc->auto_update)
- mc->mail_timeout = gtk_timeout_add(mc->update_freq, mail_check_timeout, mc);
- }
-
- check_mail_file_status (mc);
-
- if (mc->auto_update)
- return TRUE;
- else
- /* This handler should just run once */
- return FALSE;
-}
-
-/*
- * this gets called when we have to redraw the nice icon
- */
-static gint
-icon_expose (GtkWidget *widget, GdkEventExpose *event, gpointer data)
-{
- MailCheck *mc = data;
- int h = mc->size;
-
- gdk_draw_drawable (
- mc->da->window, mc->da->style->black_gc,
- mc->email_pixmap, mc->nframe * h,
- 0, 0, 0, h, h);
-
- return TRUE;
-}
-
-static gint
-exec_clicked_cmd (GtkWidget *widget, GdkEventButton *event, gpointer data)
-{
- MailCheck *mc = data;
- gboolean retval = FALSE;
-
- if (event->button == 1 && event->type == GDK_BUTTON_PRESS) {
-
- if (mc->clicked_enabled && mc->clicked_cmd && (strlen(mc->clicked_cmd) > 0))
- mailcheck_execute_shell (mc, mc->clicked_cmd);
-
- if (mc->reset_on_clicked) {
-
- mc->show_animation = FALSE;
- if (mc->animation_tag != 0){
- gtk_timeout_remove (mc->animation_tag);
- mc->animation_tag = 0;
- }
- }
-
- retval = TRUE;
- }
- return(retval);
-}
-
-static gboolean
-key_press_cb (GtkWidget *widget, GdkEventKey *event, MailCheck *mc)
-{
- switch (event->keyval) {
- case GDK_u:
- if (event->state == GDK_CONTROL_MASK) {
- mail_check_timeout(mc);
- return TRUE;
- }
- break;
- case GDK_KP_Enter:
- case GDK_ISO_Enter:
- case GDK_3270_Enter:
- case GDK_Return:
- case GDK_space:
- case GDK_KP_Space:
- if (mc->clicked_enabled && mc->clicked_cmd && (strlen(mc->clicked_cmd) > 0))
- mailcheck_execute_shell (mc, mc->clicked_cmd);
-
- if (mc->reset_on_clicked) {
-
- mc->show_animation = FALSE;
- if (mc->animation_tag != 0){
- gtk_timeout_remove (mc->animation_tag);
- mc->animation_tag = 0;
- }
- }
- return TRUE;
- break;
- default:
- break;
- }
-
- return FALSE;
-}
-
-static void
-load_new_pixmap (MailCheck *mc)
-{
- gtk_widget_hide (mc->containee);
- gtk_container_remove (GTK_CONTAINER (mc->bin), mc->containee);
-
- if (mc->selected_pixmap_name == mc->mailcheck_text_only) {
- mc->report_mail_mode = REPORT_MAIL_USE_TEXT;
- mc->containee = mc->label;
- g_free(mc->animation_file);
- mc->animation_file = NULL;
- } else {
- char *fname;
- char *full;
-
- fname = g_build_filename ("mailcheck", mc->selected_pixmap_name, NULL);
- full = gnome_program_locate_file (
- NULL, GNOME_FILE_DOMAIN_PIXMAP,
- fname, TRUE, NULL);
- free (fname);
-
- if(full != NULL &&
- mailcheck_load_animation (mc, full)) {
- mc->containee = mc->da;
- g_free(mc->animation_file);
- mc->animation_file = full;
- } else {
- g_free (full);
- mc->report_mail_mode = REPORT_MAIL_USE_TEXT;
- mc->containee = mc->label;
- g_free(mc->animation_file);
- mc->animation_file = NULL;
- }
- }
-
- mail_check_timeout (mc);
-
- gtk_container_add (GTK_CONTAINER (mc->bin), mc->containee);
- gtk_widget_show (mc->containee);
-}
-
-static void
-animation_selected (GtkMenuItem *item, gpointer data)
-{
- MailCheck *mc = g_object_get_data(G_OBJECT(item), "MailCheck");
- mc->selected_pixmap_name = data;
-
- load_new_pixmap (mc);
- panel_applet_gconf_set_string(mc->applet, "animation_file",
- mc->animation_file ? mc->animation_file : "", NULL);
-}
-
-static void
-mailcheck_new_entry (MailCheck *mc, GtkWidget *menu, GtkWidget *item, char *s)
-{
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-
- g_object_set_data (G_OBJECT (item), "MailCheck", mc);
-
- g_signal_connect_data (item, "activate", G_CALLBACK (animation_selected),
- g_strdup (s), (GClosureNotify) g_free, 0);
-}
-
-static GtkWidget *
-mailcheck_get_animation_menu (MailCheck *mc)
-{
- GtkWidget *omenu, *menu, *item;
- struct dirent *e;
- char *dname;
- DIR *dir;
- char *basename = NULL;
- int i = 0, select_item = 0;
-
- dname = gnome_program_locate_file (
- NULL, GNOME_FILE_DOMAIN_PIXMAP,
- "mailcheck", FALSE, NULL);
-
- mc->selected_pixmap_name = mc->mailcheck_text_only;
- omenu = gtk_option_menu_new ();
- menu = gtk_menu_new ();
-
- item = gtk_menu_item_new_with_label (mc->mailcheck_text_only);
- gtk_widget_show (item);
- mailcheck_new_entry (mc, menu, item, mc->mailcheck_text_only);
-
- if (mc->animation_file != NULL)
- basename = g_path_get_basename (mc->animation_file);
- else
- basename = NULL;
-
- i = 1;
- dir = opendir (dname);
- if (dir){
- while ((e = readdir (dir)) != NULL){
- char *s;
-
- if (! (strstr (e->d_name, ".xpm") ||
- strstr (e->d_name, ".png") ||
- strstr (e->d_name, ".gif") ||
- strstr (e->d_name, ".jpg")))
- continue;
-
- s = g_strdup (e->d_name);
- /* FIXME the string s will be freed in a second so
- ** this should be a strdup */
- if (!mc->selected_pixmap_name)
- mc->selected_pixmap_name = s;
- if (basename && strcmp (basename, e->d_name) == 0)
- select_item = i;
- item = gtk_menu_item_new_with_label (s);
-
- i++;
- gtk_widget_show (item);
-
- mailcheck_new_entry (mc,menu, item, s);
-
- g_free (s);
- }
- closedir (dir);
- }
- gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), menu);
- gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), select_item);
- gtk_widget_show (omenu);
-
- g_free (dname);
- g_free (basename);
-
- return omenu;
-}
-
-static void
-make_check_widgets_sensitive(MailCheck *mc)
-{
- soft_set_sensitive (GTK_WIDGET (mc->min_spin), mc->auto_update);
- soft_set_sensitive (GTK_WIDGET (mc->sec_spin), mc->auto_update);
-}
-
-static void
-make_remote_widgets_sensitive(MailCheck *mc)
-{
- gboolean b = mc->mailbox_type != MAILBOX_LOCAL &&
- mc->mailbox_type != MAILBOX_LOCALDIR;
- gboolean f = mc->mailbox_type == MAILBOX_IMAP;
- gboolean p = mc->mailbox_type == MAILBOX_POP3;
-
- soft_set_sensitive (mc->newmail_cmd_check, !p);
- if (p)
- soft_set_sensitive (mc->newmail_cmd_entry, !p);
- else
- soft_set_sensitive (mc->newmail_cmd_entry, mc->newmail_enabled);
- soft_set_sensitive (mc->play_sound_check, !p);
-
- soft_set_sensitive (mc->mailfile_fentry, !b);
- soft_set_sensitive (mc->mailfile_label, !b);
-
- soft_set_sensitive (mc->remote_server_entry, b);
- soft_set_sensitive (mc->remote_password_entry, b);
- soft_set_sensitive (mc->remote_password_checkbox, b);
- soft_set_sensitive (mc->remote_username_entry, b);
- soft_set_sensitive (mc->remote_folder_entry, f);
- soft_set_sensitive (mc->remote_server_label, b);
- soft_set_sensitive (mc->remote_password_label, b);
- soft_set_sensitive (mc->remote_username_label, b);
- soft_set_sensitive (mc->remote_folder_label, f);
-}
-
-static void
-mail_file_changed (GtkEntry *entry, gpointer data)
-{
- MailCheck *mc = data;
- gchar *text;
-
- text = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, -1);
- if (!text)
- return;
-
- if (mc->mail_file)
- g_free (mc->mail_file);
-
- mc->mail_file = text;
- panel_applet_gconf_set_string(mc->applet, "mail_file", mc->mail_file, NULL);
-}
-
-static void
-remote_server_changed (GtkEntry *entry, gpointer data)
-{
- MailCheck *mc = data;
- gchar *text;
-
- text = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, -1);
- if (!text)
- return;
-
- if (mc->remote_server)
- g_free (mc->remote_server);
-
- mc->remote_server = text;
- panel_applet_gconf_set_string(mc->applet, "remote_server",
- mc->remote_server, NULL);
-}
-
-static void
-remote_username_changed (GtkEntry *entry, gpointer data)
-{
- MailCheck *mc = data;
- gchar *text;
-
- text = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, -1);
- if (!text)
- return;
-
- if (mc->remote_username)
- g_free (mc->remote_username);
-
- mc->remote_username = text;
- panel_applet_gconf_set_string(mc->applet, "remote_username",
- mc->remote_username, NULL);
-}
-
-static void
-remote_password_changed (GtkEntry *entry, gpointer data)
-{
- MailCheck *mc = data;
- gchar *text;
-
- text = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, -1);
- if (!text)
- return;
-
- if (mc->remote_password)
- g_free (mc->remote_password);
- mc->remote_password = text;
-
- if (mc->remote_encrypted_password)
- g_free (mc->remote_encrypted_password);
- mc->remote_encrypted_password = util_base64 (text, ENCODE);
-
- if (key_writable (mc->applet, "remote_encrypted_password")) {
- if (mc->save_remote_password)
- panel_applet_gconf_set_string (mc->applet, "remote_encrypted_password",
- mc->remote_encrypted_password, NULL);
- else
- panel_applet_gconf_set_string (mc->applet, "remote_encrypted_password",
- "", NULL);
- }
-}
-
-static gboolean
-focus_out_cb (GtkWidget *entry, GdkEventFocus *event, gpointer data)
-{
- remote_password_changed (GTK_ENTRY (entry), data);
-
- return FALSE;
-
-}
-
-static void
-remote_folder_changed (GtkEntry *entry, gpointer data)
-{
- MailCheck *mc = data;
- gchar *text;
-
- text = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, -1);
- if (!text)
- return;
-
- if (mc->remote_folder)
- g_free (mc->remote_folder);
-
- mc->remote_folder = text;
- panel_applet_gconf_set_string(mc->applet, "remote_folder",
- mc->remote_folder, NULL);
-}
-
-static void
-set_mailbox_selection (GtkWidget *widget, gpointer data)
-{
- MailCheck *mc = g_object_get_data(G_OBJECT(widget), "MailCheck");
- mc->mailbox_type = GPOINTER_TO_INT(data);
- panel_applet_gconf_set_int(mc->applet, "mailbox_type",
- (gint)mc->mailbox_type, NULL);
- make_remote_widgets_sensitive(mc);
-
- if ((mc->mailbox_type != MAILBOX_POP3) &&
- (mc->mailbox_type != MAILBOX_IMAP) &&
- (mc->remote_handle != NULL)) {
- helper_whack_handle (mc->remote_handle);
- mc->remote_handle = NULL;
- }
- gtk_label_set_text (GTK_LABEL (mc->label), _("Status not updated"));
- set_tooltip (GTK_WIDGET (mc->applet), _("Status not updated"));
-}
-
-static void
-pre_check_toggled (GtkToggleButton *button, gpointer data)
-{
- MailCheck *mc = data;
-
- mc->pre_check_enabled = gtk_toggle_button_get_active (button);
- panel_applet_gconf_set_bool(mc->applet, "exec_enabled",
- mc->pre_check_enabled, NULL);
- soft_set_sensitive (mc->pre_check_cmd_entry, mc->pre_check_enabled);
-
-}
-
-static void
-remote_password_save_toggled (GtkToggleButton *button, gpointer data)
-{
- MailCheck *mc = data;
-
- mc->save_remote_password = gtk_toggle_button_get_active (button);
- if (key_writable (mc->applet, "save_password")) {
- panel_applet_gconf_set_bool (mc->applet, "save_password",
- mc->save_remote_password, NULL);
- }
-
- if (key_writable (mc->applet, "remote_encrypted_password")) {
- if (mc->save_remote_password)
- panel_applet_gconf_set_string (mc->applet, "remote_encrypted_password",
- mc->remote_encrypted_password, NULL);
- else
- panel_applet_gconf_set_string (mc->applet, "remote_encrypted_password",
- "", NULL);
- }
-}
-
-static void
-pre_check_changed (GtkEntry *entry, gpointer data)
-{
- MailCheck *mc = data;
- gchar *text;
-
- text = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, -1);
- if (!text)
- return;
-
- if (mc->pre_check_cmd)
- g_free (mc->pre_check_cmd);
- mc->pre_check_cmd = g_strdup (text);
- panel_applet_gconf_set_string(mc->applet, "exec_command",
- mc->pre_check_cmd, NULL);
- g_free (text);
-
-}
-
-static void
-newmail_toggled (GtkToggleButton *button, gpointer data)
-{
- MailCheck *mc = data;
-
- mc->newmail_enabled = gtk_toggle_button_get_active (button);
- panel_applet_gconf_set_bool(mc->applet, "newmail_enabled",
- mc->newmail_enabled, NULL);
- soft_set_sensitive (mc->newmail_cmd_entry, mc->newmail_enabled);
-
-}
-
-static void
-newmail_changed (GtkEntry *entry, gpointer data)
-{
- MailCheck *mc = data;
- gchar *text;
-
- text = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, -1);
- if (!text)
- return;
-
- if (mc->newmail_cmd)
- g_free (mc->newmail_cmd);
- mc->newmail_cmd = g_strdup (text);
- panel_applet_gconf_set_string(mc->applet, "newmail_command",
- mc->newmail_cmd, NULL);
- g_free (text);
-
-}
-
-static void
-clicked_toggled (GtkToggleButton *button, gpointer data)
-{
- MailCheck *mc = data;
-
- mc->clicked_enabled = gtk_toggle_button_get_active (button);
- panel_applet_gconf_set_bool(mc->applet, "clicked_enabled",
- mc->clicked_enabled, NULL);
- soft_set_sensitive (mc->clicked_cmd_entry, mc->clicked_enabled);
-
-}
-
-static void
-clicked_changed (GtkEntry *entry, gpointer data)
-{
- MailCheck *mc = data;
- gchar *text;
-
- text = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, -1);
- if (!text)
- return;
-
- if (mc->clicked_cmd)
- g_free (mc->clicked_cmd);
- mc->clicked_cmd = g_strdup (text);
- panel_applet_gconf_set_string(mc->applet, "clicked_command", mc->clicked_cmd, NULL);
- g_free (text);
-
-}
-
-static void
-reset_on_clicked_toggled (GtkToggleButton *button, gpointer data)
-{
- MailCheck *mc = data;
-
- mc->reset_on_clicked = gtk_toggle_button_get_active (button);
- panel_applet_gconf_set_bool(mc->applet, "reset_on_clicked",
- mc->reset_on_clicked, NULL);
-
-}
-
-static void
-auto_update_toggled (GtkToggleButton *button, gpointer data)
-{
- MailCheck *mc = data;
-
- mc->auto_update = gtk_toggle_button_get_active (button);
-
- if(mc->mail_timeout != 0) {
- gtk_timeout_remove(mc->mail_timeout);
- mc->mail_timeout = 0;
- }
- if(mc->auto_update)
- mc->mail_timeout = gtk_timeout_add(mc->update_freq, mail_check_timeout, mc);
-
- make_check_widgets_sensitive(mc);
- panel_applet_gconf_set_bool(mc->applet, "auto_update", mc->auto_update, NULL);
-
- /*
- * check the mail right now, so we don't have to wait
- * for the first timeout
- */
- mail_check_timeout (mc);
-}
-
-static void
-update_spin_changed (GtkSpinButton *spin, gpointer data)
-{
- MailCheck *mc = data;
-
- mc->update_freq = 1000 * (guint)(gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (mc->sec_spin)) + 60 * gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (mc->min_spin)));
-
- if (mc->update_freq == 0) {
- gtk_spin_button_set_value(GTK_SPIN_BUTTON (mc->sec_spin), 1.0);
- gtk_spin_button_set_value(GTK_SPIN_BUTTON (mc->min_spin), 0.0);
- mc->update_freq = 1000;
- }
- if(mc->mail_timeout != 0)
- gtk_timeout_remove (mc->mail_timeout);
- mc->mail_timeout = gtk_timeout_add (mc->update_freq, mail_check_timeout, mc);
- panel_applet_gconf_set_int(mc->applet, "update_frequency", mc->update_freq, NULL);
-}
-
-static void
-sound_toggled (GtkToggleButton *button, gpointer data)
-{
- MailCheck *mc = data;
-
- mc->play_sound = gtk_toggle_button_get_active (button);
- panel_applet_gconf_set_bool(mc->applet, "play_sound", mc->play_sound, NULL);
-}
-
-static GtkWidget *
-mailbox_properties_page(MailCheck *mc)
-{
- GtkWidget *indent, *categories_vbox, *category_vbox, *control_vbox, *control_hbox;
- GtkWidget *vbox, *hbox, *l, *l2, *item, *label, *entry;
- GtkSizeGroup *size_group;
- gchar *title;
-
- mc->type = 1;
-
- size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
-
- vbox = gtk_vbox_new (FALSE, 0);
- gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
- gtk_widget_show (vbox);
-
- categories_vbox = gtk_vbox_new (FALSE, 18);
- gtk_box_pack_start (GTK_BOX (vbox), categories_vbox, TRUE, TRUE, 0);
- gtk_widget_show (categories_vbox);
-
- category_vbox = gtk_vbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX (categories_vbox), category_vbox, TRUE, TRUE, 0);
- gtk_widget_show (category_vbox);
-
- title = g_strconcat ("<span weight=\"bold\">", _("Inbox Settings"), "</span>", NULL);
- label = gtk_label_new (title);
- gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
- gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
- gtk_box_pack_start (GTK_BOX (category_vbox), label, FALSE, FALSE, 0);
- gtk_widget_show (label);
- g_free (title);
-
- hbox = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (category_vbox), hbox, FALSE, FALSE, 0);
- gtk_widget_show (hbox);
-
- indent = gtk_label_new (HIG_IDENTATION);
- gtk_label_set_justify (GTK_LABEL (indent), GTK_JUSTIFY_LEFT);
- gtk_box_pack_start (GTK_BOX (hbox), indent, FALSE, FALSE, 0);
- gtk_widget_show (indent);
-
- control_vbox = gtk_vbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX (hbox), control_vbox, TRUE, TRUE, 0);
- gtk_widget_show (control_vbox);
-
- control_hbox = gtk_hbox_new (FALSE, 12);
- gtk_box_pack_start (GTK_BOX (control_vbox), control_hbox, TRUE, TRUE, 0);
- gtk_widget_show (control_hbox);
-
- label = gtk_label_new_with_mnemonic(_("Mailbox _resides on:"));
- gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0f, 0.5f);
- gtk_size_group_add_widget (size_group, label);
- gtk_widget_show(label);
- gtk_box_pack_start (GTK_BOX (control_hbox), label, FALSE, FALSE, 0);
-
- mc->remote_option_menu = l = gtk_option_menu_new();
- set_atk_relation (mc->remote_option_menu, label, ATK_RELATION_LABELLED_BY);
-
- l2 = gtk_menu_new();
- item = gtk_menu_item_new_with_label(_("Local mailspool"));
- gtk_widget_show(item);
- g_object_set_data(G_OBJECT(item), "MailCheck", mc);
- g_signal_connect (G_OBJECT(item), "activate",
- G_CALLBACK(set_mailbox_selection),
- GINT_TO_POINTER(MAILBOX_LOCAL));
- gtk_menu_shell_append (GTK_MENU_SHELL (l2), item);
-
- item = gtk_menu_item_new_with_label(_("Local maildir"));
- gtk_widget_show(item);
- g_object_set_data(G_OBJECT(item), "MailCheck", mc);
- g_signal_connect (G_OBJECT(item), "activate",
- G_CALLBACK(set_mailbox_selection),
- GINT_TO_POINTER(MAILBOX_LOCALDIR));
- gtk_menu_shell_append (GTK_MENU_SHELL (l2), item);
-
- item = gtk_menu_item_new_with_label(_("Remote POP3-server"));
- gtk_widget_show(item);
- g_object_set_data(G_OBJECT(item), "MailCheck", mc);
- g_signal_connect (G_OBJECT(item), "activate",
- G_CALLBACK(set_mailbox_selection),
- GINT_TO_POINTER(MAILBOX_POP3));
-
- gtk_menu_shell_append (GTK_MENU_SHELL (l2), item);
- item = gtk_menu_item_new_with_label(_("Remote IMAP-server"));
- gtk_widget_show(item);
- g_object_set_data(G_OBJECT(item), "MailCheck", mc);
- g_signal_connect (G_OBJECT(item), "activate",
- G_CALLBACK(set_mailbox_selection),
- GINT_TO_POINTER(MAILBOX_IMAP));
- gtk_menu_shell_append (GTK_MENU_SHELL (l2), item);
-
- gtk_widget_show(l2);
-
- gtk_option_menu_set_menu(GTK_OPTION_MENU(l), l2);
- gtk_option_menu_set_history(GTK_OPTION_MENU(l), mc->mailbox_type_temp = mc->mailbox_type);
- gtk_widget_show(l);
-
- gtk_box_pack_start (GTK_BOX (control_hbox), l, TRUE, TRUE, 0);
-
- if ( ! key_writable (mc->applet, "mailbox_type")) {
- hard_set_sensitive (l, FALSE);
- hard_set_sensitive (label, FALSE);
- }
-
- control_hbox = gtk_hbox_new (FALSE, 12);
- gtk_box_pack_start (GTK_BOX (control_vbox), control_hbox, TRUE, TRUE, 0);
- gtk_widget_show (control_hbox);
-
- mc->mailfile_label = l = gtk_label_new_with_mnemonic(_("Mail _spool file:"));
- gtk_label_set_justify (GTK_LABEL (l), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment (GTK_MISC (l), 0.0f, 0.5f);
- gtk_size_group_add_widget (size_group, l);
- gtk_widget_show(l);
- gtk_box_pack_start (GTK_BOX (control_hbox), l, FALSE, FALSE, 0);
-
- mc->mailfile_fentry = l = gnome_file_entry_new ("spool_file", _("Browse"));
- entry = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (mc->mailfile_fentry));
- set_atk_relation (entry, mc->mailfile_label, ATK_RELATION_LABELLED_BY);
- gtk_widget_show(l);
- gtk_box_pack_start (GTK_BOX (control_hbox), l, TRUE, TRUE, 0);
-
- mc->mailfile_entry = l = gnome_file_entry_gtk_entry(GNOME_FILE_ENTRY (l));
- gtk_entry_set_text(GTK_ENTRY(l), mc->mail_file);
- g_signal_connect(G_OBJECT(l), "changed",
- G_CALLBACK(mail_file_changed), mc);
-
- if ( ! key_writable (mc->applet, "mail_file")) {
- hard_set_sensitive (mc->mailfile_label, FALSE);
- hard_set_sensitive (mc->mailfile_fentry, FALSE);
- }
-
- control_hbox = gtk_hbox_new (FALSE, 12);
- gtk_box_pack_start (GTK_BOX (control_vbox), control_hbox, TRUE, TRUE, 0);
- gtk_widget_show (control_hbox);
-
- mc->remote_server_label = l = gtk_label_new_with_mnemonic(_("Mail s_erver:"));
- gtk_label_set_justify (GTK_LABEL (l), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment (GTK_MISC (l), 0.0f, 0.5f);
- gtk_size_group_add_widget (size_group, l);
- gtk_widget_show(l);
- gtk_box_pack_start (GTK_BOX (control_hbox), l, FALSE, FALSE, 0);
-
- mc->remote_server_entry = l = gtk_entry_new();
-
- set_atk_name_description (mc->remote_server_entry, _("Mail Server Entry box"), "");
- set_atk_relation (mc->remote_server_entry, mc->remote_server_label, ATK_RELATION_LABELLED_BY);
- if (mc->remote_server)
- gtk_entry_set_text(GTK_ENTRY(l), mc->remote_server);
- gtk_widget_show(l);
- gtk_box_pack_start (GTK_BOX (control_hbox), l, TRUE, TRUE, 0);
-
- g_signal_connect(G_OBJECT(l), "changed",
- G_CALLBACK(remote_server_changed), mc);
-
- if ( ! key_writable (mc->applet, "remote_server")) {
- hard_set_sensitive (mc->remote_server_entry, FALSE);
- hard_set_sensitive (mc->remote_server_label, FALSE);
- }
-
- control_hbox = gtk_hbox_new (FALSE, 12);
- gtk_box_pack_start (GTK_BOX (control_vbox), control_hbox, TRUE, TRUE, 0);
- gtk_widget_show (control_hbox);
-
- mc->remote_username_label = l = gtk_label_new_with_mnemonic(_("_Username:"));
- gtk_label_set_justify (GTK_LABEL (l), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment (GTK_MISC (l), 0.0f, 0.5f);
- gtk_size_group_add_widget (size_group, l);
- gtk_widget_show(l);
- gtk_box_pack_start (GTK_BOX (control_hbox), l, FALSE, FALSE, 0);
-
- mc->remote_username_entry = l = gtk_entry_new();
- if (mc->remote_username)
- gtk_entry_set_text(GTK_ENTRY(l), mc->remote_username);
-
- set_atk_name_description (mc->remote_username_entry, _("Username Entry box"), "");
- set_atk_relation (mc->remote_username_entry, mc->remote_username_label, ATK_RELATION_LABELLED_BY);
-
- gtk_widget_show(l);
- gtk_box_pack_start (GTK_BOX (control_hbox), l, TRUE, TRUE, 0);
-
- g_signal_connect(G_OBJECT(l), "changed",
- G_CALLBACK(remote_username_changed), mc);
-
- if ( ! key_writable (mc->applet, "remote_username")) {
- hard_set_sensitive (mc->remote_username_entry, FALSE);
- hard_set_sensitive (mc->remote_username_label, FALSE);
- }
-
- control_hbox = gtk_hbox_new (FALSE, 12);
- gtk_box_pack_start (GTK_BOX (control_vbox), control_hbox, TRUE, TRUE, 0);
- gtk_widget_show (control_hbox);
-
- mc->remote_password_label = l = gtk_label_new_with_mnemonic(_("_Password:"));
- gtk_label_set_justify (GTK_LABEL (l), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment (GTK_MISC (l), 0.0f, 0.5f);
- gtk_size_group_add_widget (size_group, l);
- gtk_widget_show(l);
- gtk_box_pack_start (GTK_BOX (control_hbox), l, FALSE, FALSE, 0);
-
- mc->remote_password_entry = l = gtk_entry_new();
- if (mc->remote_password)
- gtk_entry_set_text(GTK_ENTRY(l), mc->remote_password);
-
- set_atk_name_description (mc->remote_password_entry, _("Password Entry box"), "");
- set_atk_relation (mc->remote_password_entry, mc->remote_password_label, ATK_RELATION_LABELLED_BY);
- gtk_entry_set_visibility(GTK_ENTRY (l), FALSE);
- gtk_widget_show(l);
- gtk_box_pack_start (GTK_BOX (control_hbox), l, TRUE, TRUE, 0);
-
- g_signal_connect(G_OBJECT(l), "focus_out_event",
- G_CALLBACK(focus_out_cb), mc);
-
- g_signal_connect(G_OBJECT(l), "activate",
- G_CALLBACK(remote_password_changed), mc);
-
- if ( ! key_writable (mc->applet, "remote_encrypted_password")) {
- hard_set_sensitive (mc->remote_password_entry, FALSE);
- hard_set_sensitive (mc->remote_password_label, FALSE);
- }
-
- control_hbox = gtk_hbox_new (FALSE, 12);
- gtk_box_pack_start (GTK_BOX (control_vbox), control_hbox, TRUE, TRUE, 0);
- gtk_widget_show (control_hbox);
-
- l = gtk_label_new ("");
- gtk_size_group_add_widget (size_group, l);
- gtk_widget_show (l);
- gtk_box_pack_start (GTK_BOX (control_hbox), l, FALSE, FALSE, 0);
-
- mc->remote_password_checkbox = l = gtk_check_button_new_with_mnemonic (
- _("_Save password to disk"));
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(l), mc->save_remote_password);
- gtk_widget_show (l);
- gtk_box_pack_start (GTK_BOX (control_hbox), l, TRUE, TRUE, 0);
-
- g_signal_connect (G_OBJECT (l), "toggled",
- G_CALLBACK(remote_password_save_toggled), mc);
-
- if ( ! key_writable (mc->applet, "save_password"))
- hard_set_sensitive (mc->remote_password_checkbox, FALSE);
-
- control_hbox = gtk_hbox_new (FALSE, 12);
- gtk_box_pack_start (GTK_BOX (control_vbox), control_hbox, TRUE, TRUE, 0);
- gtk_widget_show (control_hbox);
-
- mc->remote_folder_label = l = gtk_label_new_with_mnemonic(_("_Folder:"));
- gtk_label_set_justify (GTK_LABEL(l), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment (GTK_MISC(l), 0.0f, 0.5f);
- gtk_size_group_add_widget (size_group, l);
- gtk_widget_show(l);
- gtk_box_pack_start (GTK_BOX (control_hbox), l, FALSE, FALSE, 0);
-
- mc->remote_folder_entry = l = gtk_entry_new();
- if (mc->remote_folder)
- gtk_entry_set_text(GTK_ENTRY(l), mc->remote_folder);
-
- set_atk_name_description (mc->remote_folder_entry, _("Folder Entry box"), "");
- set_atk_relation (mc->remote_folder_entry, mc->remote_folder_label, ATK_RELATION_LABELLED_BY);
- gtk_widget_show(l);
- gtk_box_pack_start (GTK_BOX (control_hbox), l, TRUE, TRUE, 0);
-
- g_signal_connect(G_OBJECT(l), "changed",
- G_CALLBACK(remote_folder_changed), mc);
-
- if ( ! key_writable (mc->applet, "remote_folder")) {
- hard_set_sensitive (mc->remote_folder_entry, FALSE);
- hard_set_sensitive (mc->remote_folder_label, FALSE);
- }
-
- make_remote_widgets_sensitive(mc);
-
- return vbox;
-}
-
-static GtkWidget *
-mailcheck_properties_page (MailCheck *mc)
-{
- GtkWidget *vbox, *hbox, *hbox2, *l, *table, *check_box, *animation_option_menu;
- GtkWidget *label, *indent, *categories_vbox, *category_vbox, *control_vbox, *control_hbox;
- GtkObject *freq_a;
- gchar *title;
- gboolean writable;
- GConfClient *client;
- gboolean inhibit_command_line;
-
- client = gconf_client_get_default ();
- inhibit_command_line = gconf_client_get_bool (client, "/desktop/gnome/lockdown/inhibit_command_line", NULL);
-
- mc->type = 0;
-
- vbox = gtk_vbox_new (FALSE, 0);
- gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
- gtk_widget_show (vbox);
-
- categories_vbox = gtk_vbox_new (FALSE, 18);
- gtk_box_pack_start (GTK_BOX (vbox), categories_vbox, TRUE, TRUE, 0);
- gtk_widget_show (categories_vbox);
-
- category_vbox = gtk_vbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX (categories_vbox), category_vbox, TRUE, TRUE, 0);
- gtk_widget_show (category_vbox);
-
- title = g_strconcat ("<span weight=\"bold\">", _("General"), "</span>", NULL);
- label = gtk_label_new (title);
- gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
- gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
- gtk_box_pack_start (GTK_BOX (category_vbox), label, FALSE, FALSE, 0);
- gtk_widget_show (label);
- g_free (title);
-
- hbox = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (category_vbox), hbox, TRUE, TRUE, 0);
- gtk_widget_show (hbox);
-
- indent = gtk_label_new (HIG_IDENTATION);
- gtk_label_set_justify (GTK_LABEL (indent), GTK_JUSTIFY_LEFT);
- gtk_box_pack_start (GTK_BOX (hbox), indent, FALSE, FALSE, 0);
- gtk_widget_show (indent);
-
- control_vbox = gtk_vbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX (hbox), control_vbox, TRUE, TRUE, 0);
- gtk_widget_show (control_vbox);
-
- control_hbox = gtk_hbox_new (FALSE, 12);
- gtk_box_pack_start(GTK_BOX(control_vbox), control_hbox, TRUE, TRUE, 0);
- gtk_widget_show(control_hbox);
-
- check_box = l = gtk_check_button_new_with_mnemonic (_("Check for mail _every:"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(l), mc->auto_update);
- g_signal_connect(G_OBJECT(l), "toggled",
- G_CALLBACK(auto_update_toggled), mc);
- gtk_box_pack_start (GTK_BOX (control_hbox), l, FALSE, FALSE, 0);
- gtk_widget_show(l);
- if ( ! key_writable (mc->applet, "auto_update"))
- hard_set_sensitive (l, FALSE);
-
- hbox2 = gtk_hbox_new (FALSE, 6);
- gtk_box_pack_start(GTK_BOX(control_hbox), hbox2, FALSE, FALSE, 0);
- gtk_widget_show(hbox2);
-
-
- writable = key_writable (mc->applet, "update_frequency");
-
- freq_a = gtk_adjustment_new((float)((mc->update_freq/1000)/60), 0, 1440, 1, 5, 5);
- mc->min_spin = gtk_spin_button_new( GTK_ADJUSTMENT (freq_a), 1, 0);
- gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (mc->min_spin), TRUE);
- g_signal_connect (G_OBJECT (mc->min_spin), "value_changed",
- G_CALLBACK (update_spin_changed), mc);
- gtk_box_pack_start (GTK_BOX (hbox2), mc->min_spin, FALSE, FALSE, 0);
- set_atk_name_description (mc->min_spin, _("minutes"), _("Choose time interval in minutes to check mail"));
- set_atk_relation (mc->min_spin, check_box, ATK_RELATION_CONTROLLED_BY);
- gtk_widget_show(mc->min_spin);
- if ( ! writable)
- hard_set_sensitive (mc->min_spin, FALSE);
-
- l = gtk_label_new (_("minutes"));
- set_atk_relation (mc->min_spin, l, ATK_RELATION_LABELLED_BY);
- gtk_widget_show(l);
- gtk_box_pack_start (GTK_BOX (hbox2), l, FALSE, FALSE, 0);
- if ( ! writable)
- hard_set_sensitive (l, FALSE);
-
- hbox2 = gtk_hbox_new (FALSE, 6);
- gtk_box_pack_start(GTK_BOX(control_hbox), hbox2, FALSE, FALSE, 0);
- gtk_widget_show(hbox2);
-
- freq_a = gtk_adjustment_new((float)((mc->update_freq/1000)%60), 0, 59, 1, 5, 5);
- mc->sec_spin = gtk_spin_button_new (GTK_ADJUSTMENT (freq_a), 1, 0);
- gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (mc->sec_spin), TRUE);
- g_signal_connect (G_OBJECT (mc->sec_spin), "value_changed",
- G_CALLBACK (update_spin_changed), mc);
- gtk_box_pack_start (GTK_BOX (hbox2), mc->sec_spin, FALSE, FALSE, 0);
- set_atk_name_description (mc->sec_spin, _("seconds"), _("Choose time interval in seconds to check mail"));
- set_atk_relation (mc->sec_spin, check_box, ATK_RELATION_CONTROLLED_BY);
- gtk_widget_show(mc->sec_spin);
- if ( ! writable)
- hard_set_sensitive (mc->sec_spin, FALSE);
-
- l = gtk_label_new (_("seconds"));
- set_atk_relation (mc->sec_spin, l, ATK_RELATION_LABELLED_BY);
- gtk_widget_show(l);
- gtk_misc_set_alignment (GTK_MISC (l), 0.0f, 0.5f);
- gtk_box_pack_start (GTK_BOX (hbox2), l, TRUE, TRUE, 0);
- if ( ! writable)
- hard_set_sensitive (l, FALSE);
-
- set_atk_relation (check_box, mc->min_spin, ATK_RELATION_CONTROLLER_FOR);
- set_atk_relation (check_box, mc->sec_spin, ATK_RELATION_CONTROLLER_FOR);
-
- mc->play_sound_check = gtk_check_button_new_with_mnemonic(_("Play a _sound when new mail arrives"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mc->play_sound_check), mc->play_sound);
- g_signal_connect(G_OBJECT(mc->play_sound_check), "toggled",
- G_CALLBACK(sound_toggled), mc);
- gtk_widget_show(mc->play_sound_check);
- gtk_box_pack_start(GTK_BOX (control_vbox), mc->play_sound_check, TRUE, TRUE, 0);
- if ( ! key_writable (mc->applet, "play_sound"))
- hard_set_sensitive (mc->play_sound_check, FALSE);
-
- /*l = gtk_check_button_new_with_mnemonic (_("Set the number of unread mails to _zero when clicked"));*/
- l = gtk_check_button_new_with_mnemonic (_("Sto_p animation when clicked"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(l), mc->reset_on_clicked);
- g_signal_connect(G_OBJECT(l), "toggled",
- G_CALLBACK(reset_on_clicked_toggled), mc);
- gtk_widget_show(l);
- gtk_box_pack_start(GTK_BOX (control_vbox), l, TRUE, TRUE, 0);
- if ( ! key_writable (mc->applet, "reset_on_clicked"))
- hard_set_sensitive (l, FALSE);
-
- hbox = gtk_hbox_new (FALSE, 12);
- gtk_box_pack_start (GTK_BOX (control_vbox), hbox, TRUE, TRUE, 0);
- gtk_widget_show (hbox);
-
- l = gtk_label_new_with_mnemonic (_("Select a_nimation:"));
- gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5);
- gtk_widget_show (l);
- gtk_box_pack_start (GTK_BOX (hbox), l, FALSE, FALSE, 0);
- animation_option_menu = mailcheck_get_animation_menu (mc);
- gtk_box_pack_start (GTK_BOX (hbox), animation_option_menu, FALSE, FALSE, 0);
- set_atk_relation (animation_option_menu, l, ATK_RELATION_LABELLED_BY);
- make_check_widgets_sensitive(mc);
- if ( ! key_writable (mc->applet, "animation_file")) {
- hard_set_sensitive (l, FALSE);
- hard_set_sensitive (animation_option_menu, FALSE);
- }
-
- if ( ! inhibit_command_line) {
- category_vbox = gtk_vbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX (categories_vbox), category_vbox, TRUE, TRUE, 0);
- gtk_widget_show (category_vbox);
-
- title = g_strconcat ("<span weight=\"bold\">", _("Commands"), "</span>", NULL);
- label = gtk_label_new (title);
- gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
- gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
- gtk_box_pack_start (GTK_BOX (category_vbox), label, FALSE, FALSE, 0);
- gtk_widget_show (label);
- g_free (title);
-
- hbox = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (category_vbox), hbox, TRUE, TRUE, 0);
- gtk_widget_show (hbox);
-
- indent = gtk_label_new (HIG_IDENTATION);
- gtk_label_set_justify (GTK_LABEL (indent), GTK_JUSTIFY_LEFT);
- gtk_box_pack_start (GTK_BOX (hbox), indent, FALSE, FALSE, 0);
- gtk_widget_show (indent);
-
- control_vbox = gtk_vbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX (hbox), control_vbox, TRUE, TRUE, 0);
- gtk_widget_show (control_vbox);
-
- table = gtk_table_new (3, 2, FALSE);
- gtk_table_set_col_spacings (GTK_TABLE (table), 12);
- gtk_table_set_row_spacings (GTK_TABLE (table), 6);
- gtk_container_set_border_width (GTK_CONTAINER (table), 0);
- gtk_widget_show(table);
- gtk_container_add (GTK_CONTAINER (control_vbox), table);
-
- l = gtk_check_button_new_with_mnemonic(_("Before each _update:"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(l), mc->pre_check_enabled);
- g_signal_connect(G_OBJECT(l), "toggled",
- G_CALLBACK(pre_check_toggled), mc);
- gtk_widget_show(l);
- mc->pre_check_cmd_check = l;
- if ( ! key_writable (mc->applet, "exec_enabled"))
- hard_set_sensitive (l, FALSE);
-
- gtk_table_attach (GTK_TABLE (table), mc->pre_check_cmd_check,
- 0, 1, 0, 1, GTK_FILL, 0, 0, 0);
-
-
- mc->pre_check_cmd_entry = gtk_entry_new();
- if(mc->pre_check_cmd)
- gtk_entry_set_text(GTK_ENTRY(mc->pre_check_cmd_entry),
- mc->pre_check_cmd);
- set_atk_name_description (mc->pre_check_cmd_entry, _("Command to execute before each update"), "");
- set_atk_relation (mc->pre_check_cmd_entry, mc->pre_check_cmd_check, ATK_RELATION_CONTROLLED_BY);
- set_atk_relation (mc->pre_check_cmd_check, mc->pre_check_cmd_entry, ATK_RELATION_CONTROLLER_FOR);
- soft_set_sensitive (mc->pre_check_cmd_entry, mc->pre_check_enabled);
- g_signal_connect(G_OBJECT(mc->pre_check_cmd_entry), "changed",
- G_CALLBACK(pre_check_changed), mc);
- gtk_widget_show(mc->pre_check_cmd_entry);
- gtk_table_attach_defaults (GTK_TABLE (table), mc->pre_check_cmd_entry,
- 1, 2, 0, 1);
- if ( ! key_writable (mc->applet, "exec_command"))
- hard_set_sensitive (mc->pre_check_cmd_entry, FALSE);
-
- l = gtk_check_button_new_with_mnemonic (_("When new mail _arrives:"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(l), mc->newmail_enabled);
- g_signal_connect(G_OBJECT(l), "toggled",
- G_CALLBACK(newmail_toggled), mc);
- gtk_widget_show(l);
- gtk_table_attach (GTK_TABLE (table), l, 0, 1, 1, 2, GTK_FILL, 0, 0, 0);
- mc->newmail_cmd_check = l;
- if ( ! key_writable (mc->applet, "newmail_enabled"))
- hard_set_sensitive (l, FALSE);
-
- mc->newmail_cmd_entry = gtk_entry_new();
- if (mc->newmail_cmd) {
- gtk_entry_set_text(GTK_ENTRY(mc->newmail_cmd_entry),
- mc->newmail_cmd);
- }
- set_atk_name_description (mc->newmail_cmd_entry, _("Command to execute when new mail arrives"), "");
- set_atk_relation (mc->newmail_cmd_entry, mc->newmail_cmd_check, ATK_RELATION_CONTROLLED_BY);
- set_atk_relation (mc->newmail_cmd_check, mc->newmail_cmd_entry, ATK_RELATION_CONTROLLER_FOR);
- soft_set_sensitive (mc->newmail_cmd_entry, mc->newmail_enabled);
- g_signal_connect(G_OBJECT (mc->newmail_cmd_entry), "changed",
- G_CALLBACK(newmail_changed), mc);
- gtk_widget_show(mc->newmail_cmd_entry);
- gtk_table_attach_defaults (GTK_TABLE (table), mc->newmail_cmd_entry,
- 1, 2, 1, 2);
- if ( ! key_writable (mc->applet, "newmail_command"))
- hard_set_sensitive (mc->newmail_cmd_entry, FALSE);
-
- l = gtk_check_button_new_with_mnemonic (_("When clicke_d:"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(l), mc->clicked_enabled);
- g_signal_connect(G_OBJECT(l), "toggled",
- G_CALLBACK(clicked_toggled), mc);
- gtk_widget_show(l);
- gtk_table_attach (GTK_TABLE (table), l, 0, 1, 2, 3, GTK_FILL, 0, 0, 0);
- mc->clicked_cmd_check = l;
- if ( ! key_writable (mc->applet, "clicked_enabled"))
- hard_set_sensitive (l, FALSE);
-
- mc->clicked_cmd_entry = gtk_entry_new();
- if(mc->clicked_cmd) {
- gtk_entry_set_text(GTK_ENTRY(mc->clicked_cmd_entry),
- mc->clicked_cmd);
- }
- set_atk_name_description (mc->clicked_cmd_entry, _("Command to execute when clicked"), "");
- set_atk_relation (mc->clicked_cmd_entry, mc->clicked_cmd_check, ATK_RELATION_CONTROLLED_BY);
- set_atk_relation (mc->clicked_cmd_check, mc->clicked_cmd_entry, ATK_RELATION_CONTROLLER_FOR);
- soft_set_sensitive (mc->clicked_cmd_entry, mc->clicked_enabled);
- g_signal_connect(G_OBJECT(mc->clicked_cmd_entry), "changed",
- G_CALLBACK(clicked_changed), mc);
- gtk_widget_show(mc->clicked_cmd_entry);
- gtk_table_attach_defaults (GTK_TABLE (table), mc->clicked_cmd_entry,
- 1, 2, 2, 3);
- if ( ! key_writable (mc->applet, "clicked_command"))
- hard_set_sensitive (mc->clicked_cmd_entry, FALSE);
- }
-
- return vbox;
-}
-
-static void
-phelp_cb (GtkDialog *w, gint tab, MailCheck *mc)
-{
- GError *error = NULL;
- static GnomeProgram *applet_program = NULL;
-
- if (!applet_program) {
- int argc = 1;
- char *argv[2] = { "mailcheck" };
- applet_program = gnome_program_init ("mailcheck", VERSION,
- LIBGNOME_MODULE, argc, argv,
- GNOME_PROGRAM_STANDARD_PROPERTIES, NULL);
- }
-
- gnome_help_display_desktop_on_screen (
- applet_program, "mailcheck", "mailcheck", "mailcheck-prefs",
- gtk_widget_get_screen (GTK_WIDGET (mc->applet)),
- &error);
- if (error) {
- GtkWidget *dialog;
- char *msg;
-
- msg = g_strdup_printf (_("There was an error displaying help: %s"),
- error->message);
- dialog = hig_dialog_new (GTK_WINDOW (w),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Error displaying help"),
- msg);
- g_free (msg);
-
- g_signal_connect (G_OBJECT (dialog), "response",
- G_CALLBACK (gtk_widget_destroy),
- NULL);
-
- gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
- gtk_window_set_screen (GTK_WINDOW (dialog),
- gtk_widget_get_screen (GTK_WIDGET (mc->applet)));
- gtk_widget_show (dialog);
- g_error_free (error);
- }
-}
-
-static void
-response_cb (GtkDialog *dialog, gint id, MailCheck *mc)
-{
- if (id == GTK_RESPONSE_HELP) {
- phelp_cb (dialog, id, mc);
- return;
- }
-
- gtk_widget_destroy (GTK_WIDGET (dialog));
- mc->property_window = NULL;
-}
-
-
-static void
-mailcheck_properties (BonoboUIComponent *uic, MailCheck *mc, const gchar *verbname)
-{
- GtkWidget *p;
- GtkWidget *notebook;
-
- if (mc->property_window) {
- gtk_window_set_screen (GTK_WINDOW (mc->property_window),
- gtk_widget_get_screen (GTK_WIDGET (mc->applet)));
- gtk_window_present (GTK_WINDOW (mc->property_window));
- return;
- }
-
- mc->property_window = gtk_dialog_new_with_buttons (_("Inbox Monitor Preferences"),
- NULL,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_STOCK_CLOSE,
- GTK_RESPONSE_CLOSE,
- GTK_STOCK_HELP,
- GTK_RESPONSE_HELP,
- NULL);
- gtk_window_set_resizable (GTK_WINDOW (mc->property_window), FALSE);
- gtk_window_set_screen (GTK_WINDOW (mc->property_window),
- gtk_widget_get_screen (GTK_WIDGET (mc->property_window)));
- gtk_dialog_set_default_response (GTK_DIALOG (mc->property_window), GTK_RESPONSE_CLOSE);
- gtk_dialog_set_has_separator (GTK_DIALOG (mc->property_window), FALSE);
- gtk_container_set_border_width (GTK_CONTAINER (mc->property_window), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (mc->property_window)->vbox), 2);
- gtk_window_set_default_icon_name ("gnome-mailcheck");
- gtk_window_set_screen (GTK_WINDOW (mc->property_window),
- gtk_widget_get_screen (GTK_WIDGET (mc->applet)));
-
- notebook = gtk_notebook_new ();
- gtk_container_set_border_width (GTK_CONTAINER (notebook), 5);
- gtk_widget_show (notebook);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (mc->property_window)->vbox), notebook,
- TRUE, TRUE, 0);
- p = mailcheck_properties_page (mc);
- gtk_notebook_append_page (GTK_NOTEBOOK (notebook), p,
- gtk_label_new_with_mnemonic (_("Behavior")));
-
- p = mailbox_properties_page (mc);
- gtk_notebook_append_page (GTK_NOTEBOOK (notebook), p,
- gtk_label_new_with_mnemonic (_("Inbox Settings")));
-
- g_signal_connect (G_OBJECT (mc->property_window), "response",
- G_CALLBACK (response_cb), mc);
- gtk_widget_show (GTK_DIALOG (mc->property_window)->vbox);
- gtk_widget_show (mc->property_window);
-}
-
-static void
-check_callback (BonoboUIComponent *uic, gpointer data, const gchar *verbname)
-{
- MailCheck *mc = data;
-
- mail_check_timeout(mc);
-}
-
-static void
-applet_load_prefs(MailCheck *mc)
-{
- panel_applet_gconf_set_string(mc->applet, "remote_password", "", NULL);
-
- mc->animation_file = panel_applet_gconf_get_string(mc->applet, "animation_file", NULL);
-
- mc->auto_update = panel_applet_gconf_get_bool(mc->applet, "auto_update", NULL);
- mc->reset_on_clicked = panel_applet_gconf_get_bool (mc->applet, "reset_on_clicked", 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_string(mc->applet, "remote_server", NULL);
- mc->remote_username = panel_applet_gconf_get_string(mc->applet, "remote_username", NULL);
- if(!mc->remote_username) {
- g_free(mc->remote_username);
- mc->remote_username = g_strdup(g_getenv("USER"));
- }
- mc->remote_encrypted_password = panel_applet_gconf_get_string (mc->applet,
- "remote_encrypted_password", NULL);
- mc->remote_password = util_base64 (mc->remote_encrypted_password, DECODE);
- mc->save_remote_password = panel_applet_gconf_get_bool (mc->applet, "save_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->mail_file = panel_applet_gconf_get_string (mc->applet, "mail_file", NULL);
- mc->play_sound = panel_applet_gconf_get_bool(mc->applet, "play_sound", NULL);
-}
-
-static void
-mailcheck_about(BonoboUIComponent *uic, MailCheck *mc, const gchar *verbname)
-{
- GdkPixbuf *pixbuf = NULL;
-
- static const gchar *authors [] =
- {
- "Miguel de Icaza <miguel@kernel.org>",
- "Jacob Berkman <jberkman@andrew.cmu.edu>",
- "Jaka Mocnik <jaka.mocnik@kiss.uni-lj.si>",
- "Lennart Poettering <poettering@gmx.net>",
- NULL
- };
- const char *documenters [] = {
- "Eric Baudais <baudais@okstate.edu>",
- "Telsa Gwynne <telsa@linuxchix.org>",
- "Sun GNOME Documentation Team <gdocteam@sun.com>",
- NULL
- };
- const char *translator_credits = _("translator_credits");
-
- if (mc->about) {
- gtk_window_set_screen (GTK_WINDOW (mc->about),
- gtk_widget_get_screen (GTK_WIDGET (mc->applet)));
-
- gtk_window_present (GTK_WINDOW (mc->about));
- return;
- }
-
- pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
- "gnome-clock", 48, 0, NULL);
-
- mc->about = gnome_about_new (_("Inbox Monitor"), VERSION,
- "Copyright \xc2\xa9 1998-2002 Free Software Foundation, Inc.",
- _("Inbox Monitor notifies you when new mail arrives in your mailbox"),
- authors,
- documenters,
- strcmp (translator_credits, "translator_credits") != 0 ? translator_credits : NULL,
- pixbuf);
-
- if (pixbuf)
- g_object_unref (pixbuf);
-
- gtk_window_set_wmclass (GTK_WINDOW (mc->about), "mailcheck", "Mailcheck");
-
- gtk_window_set_screen (GTK_WINDOW (mc->about),
- gtk_widget_get_screen (GTK_WIDGET (mc->applet)));
-
- gnome_window_icon_set_from_file (GTK_WINDOW (mc->about),
- GNOME_ICONDIR"/gnome-mailcheck.png");
-
- g_signal_connect( G_OBJECT(mc->about), "destroy",
- G_CALLBACK(gtk_widget_destroyed), &mc->about );
-
- gtk_widget_show(mc->about);
-}
-
-static void
-applet_size_allocate (PanelApplet *w, GtkAllocation *allocation, MailCheck *mc)
-{
- const char *fname;
-
- switch (panel_applet_get_orient (w)) {
- case PANEL_APPLET_ORIENT_DOWN:
- case PANEL_APPLET_ORIENT_UP:
- if( mc->size == allocation->height )
- return;
-
- mc->size = allocation->height;
- gtk_widget_set_size_request (mc->label, -1, mc->size);
- break;
-
- case PANEL_APPLET_ORIENT_LEFT:
- case PANEL_APPLET_ORIENT_RIGHT:
- if( mc->size == allocation->width )
- return;
-
- mc->size = allocation->width;
- gtk_widget_set_size_request (mc->label, mc->size, -1);
- break;
- }
-
- fname = mail_animation_filename (mc);
-
- gtk_widget_set_size_request (GTK_WIDGET(mc->da), mc->size, mc->size);
-
- if (!fname)
- return;
-
- mailcheck_load_animation (mc, fname);
-}
-
-static void
-applet_change_orient(PanelApplet * w, PanelAppletOrient orient, gpointer data)
-{
- MailCheck *mc = data;
-
- switch (orient) {
- case PANEL_APPLET_ORIENT_DOWN:
- case PANEL_APPLET_ORIENT_UP:
- gtk_widget_set_size_request (mc->label, -1, mc->size);
- break;
- case PANEL_APPLET_ORIENT_LEFT:
- case PANEL_APPLET_ORIENT_RIGHT:
- gtk_widget_set_size_request (mc->label, mc->size, -1);
- break;
- }
-
-}
-
-static void
-applet_change_background(PanelApplet *a,
- PanelAppletBackgroundType type,
- GdkColor *color, GdkPixmap *pixmap,
- MailCheck *mc)
-{
- GtkRcStyle *rc_style = gtk_rc_style_new ();
-
- switch (type) {
- case PANEL_PIXMAP_BACKGROUND:
- gtk_widget_modify_style (GTK_WIDGET (mc->ebox), rc_style);
- gtk_widget_modify_style (GTK_WIDGET (mc->applet), rc_style);
- break;
-
- case PANEL_COLOR_BACKGROUND:
- gtk_widget_modify_bg (GTK_WIDGET (mc->ebox), GTK_STATE_NORMAL, color);
- gtk_widget_modify_bg (GTK_WIDGET (mc->applet), GTK_STATE_NORMAL, color);
- break;
-
- case PANEL_NO_BACKGROUND:
- gtk_widget_modify_style (GTK_WIDGET (mc->ebox), rc_style);
- gtk_widget_modify_style (GTK_WIDGET (mc->applet), rc_style);
- break;
-
- default:
- gtk_widget_modify_style (GTK_WIDGET (mc->ebox), rc_style);
- gtk_widget_modify_style (GTK_WIDGET (mc->applet), rc_style);
- break;
- }
-
- gtk_rc_style_unref (rc_style);
-}
-
-static void
-help_callback (BonoboUIComponent *uic, MailCheck *mc, const gchar *verbname)
-{
- GError *error = NULL;
- static GnomeProgram *applet_program = NULL;
-
- if (!applet_program) {
- int argc = 1;
- char *argv[2] = { "mailcheck" };
- applet_program = gnome_program_init ("mailcheck", VERSION,
- LIBGNOME_MODULE, argc, argv,
- GNOME_PROGRAM_STANDARD_PROPERTIES, NULL);
- }
-
- gnome_help_display_desktop_on_screen (
- applet_program, "mailcheck", "mailcheck",NULL,
- gtk_widget_get_screen (GTK_WIDGET (mc->applet)),
- &error);
- if (error) {
- GtkWidget *dialog;
- char *msg;
-
- msg = g_strdup_printf (_("There was an error displaying help: %s"),
- error->message);
- dialog = hig_dialog_new (NULL /* parent */,
- 0 /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Error displaying help"),
- msg);
- g_free (msg);
-
- g_signal_connect (G_OBJECT (dialog), "response",
- G_CALLBACK (gtk_widget_destroy),
- NULL);
-
- gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
- gtk_window_set_screen (GTK_WINDOW (dialog),
- gtk_widget_get_screen (GTK_WIDGET (mc->applet)));
- gtk_widget_show (dialog);
- g_error_free (error);
- }
-}
-
-static void
-mailcheck_destroy (GtkWidget *widget, gpointer data)
-{
- MailCheck *mc = data;
-
- mc->bin = NULL;
-
- if (mc->property_window != NULL)
- gtk_widget_destroy (mc->property_window);
- if (mc->about != NULL)
- gtk_widget_destroy (mc->about);
- if (mc->password_dialog != NULL)
- gtk_widget_destroy (mc->password_dialog);
-
- gtk_widget_unref (mc->da);
-
- g_free (mc->pre_check_cmd);
- g_free (mc->newmail_cmd);
- g_free (mc->clicked_cmd);
-
- g_free (mc->remote_server);
- g_free (mc->remote_username);
- g_free (mc->remote_password);
- g_free (mc->remote_encrypted_password);
- g_free (mc->remote_folder);
- g_free (mc->real_password);
-
- g_free (mc->animation_file);
- g_free (mc->mail_file);
-
- if (mc->email_pixmap)
- g_object_unref (mc->email_pixmap);
-
- if (mc->email_mask)
- g_object_unref (mc->email_mask);
-
- if (mc->mail_timeout != 0)
- gtk_timeout_remove (mc->mail_timeout);
-
- if (mc->animation_tag != 0)
- gtk_timeout_remove (mc->animation_tag);
-
- if (mc->remote_handle != NULL)
- helper_whack_handle (mc->remote_handle);
-
- /* just for sanity */
- memset(mc, 0, sizeof(MailCheck));
-
- g_free(mc);
-}
-
-static GtkWidget *
-create_mail_widgets (MailCheck *mc)
-{
- const char *fname;
- GtkWidget *alignment;
-
- fname = mail_animation_filename (mc);
-
- mc->ebox = gtk_event_box_new();
- gtk_widget_set_events(mc->ebox,
- gtk_widget_get_events(mc->ebox) |
- GDK_BUTTON_PRESS_MASK);
- gtk_widget_show (mc->ebox);
-
- alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
- gtk_container_add (GTK_CONTAINER (mc->ebox), alignment);
- gtk_widget_show (alignment);
-
- /*
- * This is so that the properties dialog is destroyed if the
- * applet is removed from the panel while the dialog is
- * active.
- */
- g_signal_connect (G_OBJECT (mc->ebox), "destroy",
- (GtkSignalFunc) mailcheck_destroy,
- mc);
-
- mc->bin = gtk_hbox_new (0, 0);
- gtk_container_add(GTK_CONTAINER(alignment), mc->bin);
-
- gtk_widget_show (mc->bin);
-
- if (mc->auto_update)
- mc->mail_timeout = gtk_timeout_add (mc->update_freq, mail_check_timeout, mc);
- else
- mc->mail_timeout = 0;
-
- /* The drawing area */
- mc->da = gtk_drawing_area_new ();
- gtk_widget_ref (mc->da);
-
- gtk_widget_set_size_request (mc->da, mc->size, mc->size);
-
- g_signal_connect (G_OBJECT(mc->da), "expose_event", (GtkSignalFunc)icon_expose, mc);
- gtk_widget_show (mc->da);
-
- /* The label */
- mc->label = gtk_label_new (NULL);
- gtk_label_set_justify (GTK_LABEL (mc->label), GTK_JUSTIFY_CENTER);
- gtk_label_set_line_wrap (GTK_LABEL (mc->label), TRUE);
- gtk_widget_show (mc->label);
- gtk_widget_ref (mc->label);
-
- if (fname != NULL &&
- WANT_BITMAPS (mc->report_mail_mode) &&
- mailcheck_load_animation (mc, fname)) {
- mc->containee = mc->da;
- } else {
- mc->report_mail_mode = REPORT_MAIL_USE_TEXT;
- mc->containee = mc->label;
- }
-
- gtk_container_add (GTK_CONTAINER (mc->bin), mc->containee);
- switch (panel_applet_get_orient (PANEL_APPLET (mc->applet))) {
- case PANEL_APPLET_ORIENT_DOWN:
- case PANEL_APPLET_ORIENT_UP:
- gtk_widget_set_size_request (mc->label, -1, mc->size);
- break;
- case PANEL_APPLET_ORIENT_LEFT:
- case PANEL_APPLET_ORIENT_RIGHT:
- gtk_widget_set_size_request (mc->label, mc->size, -1);
- break;
- }
-
- return mc->ebox;
-}
-
-static void
-set_atk_name_description (GtkWidget *widget, const gchar *name,
- const gchar *description)
-{
- AtkObject *aobj;
-
- aobj = gtk_widget_get_accessible (widget);
- /* Check if gail is loaded */
- if (GTK_IS_ACCESSIBLE (aobj) == FALSE)
- return;
- atk_object_set_name (aobj, name);
- atk_object_set_description (aobj, description);
-}
-
-static void
-set_atk_relation (GtkWidget *widget1, GtkWidget *widget2, AtkRelationType relation_type)
-{
- AtkObject *atk_widget1;
- AtkObject *atk_widget2;
- AtkRelationSet *relation_set;
- AtkRelation *relation;
- AtkObject *targets[1];
-
- atk_widget1 = gtk_widget_get_accessible (widget1);
- atk_widget2 = gtk_widget_get_accessible (widget2);
-
- /* Set the label-for relation only if label-by is being set */
- if (relation_type == ATK_RELATION_LABELLED_BY) {
- gtk_label_set_mnemonic_widget (GTK_LABEL (widget2), widget1);
- return;
- }
-
- /* Check if gail is loaded */
- if (GTK_IS_ACCESSIBLE (atk_widget1) == FALSE)
- return;
-
- /* Set the labelled-by relation */
- relation_set = atk_object_ref_relation_set (atk_widget1);
- targets[0] = atk_widget2;
- relation = atk_relation_new (targets, 1, relation_type);
- atk_relation_set_add (relation_set, relation);
- g_object_unref (G_OBJECT (relation));
-}
-
-static const BonoboUIVerb mailcheck_menu_verbs [] = {
- BONOBO_UI_UNSAFE_VERB ("Preferences", mailcheck_properties),
- BONOBO_UI_UNSAFE_VERB ("Help", help_callback),
- BONOBO_UI_UNSAFE_VERB ("About", mailcheck_about),
- BONOBO_UI_UNSAFE_VERB ("Check", check_callback),
- BONOBO_UI_VERB_END
-};
-
-static gboolean
-mailcheck_applet_fill (PanelApplet *applet)
-{
- GtkWidget *mailcheck;
- MailCheck *mc;
-
- mc = g_new0(MailCheck, 1);
- mc ->applet = applet;
- mc->animation_file = NULL;
- mc->property_window = NULL;
- mc->anim_changed = FALSE;
- mc->anymail = mc->unreadmail = mc->newmail = FALSE;
- mc->mail_timeout = 0;
- mc->animation_tag = 0;
- mc->password_dialog = NULL;
- mc->oldsize = 0;
- mc->show_animation = TRUE;
-
- /*initial state*/
- mc->report_mail_mode = REPORT_MAIL_USE_ANIMATION;
-
- mc->mail_file = NULL;
-
- panel_applet_add_preferences (applet, "/schemas/apps/mailcheck_applet/prefs", NULL);
- panel_applet_set_flags (applet, PANEL_APPLET_EXPAND_MINOR);
- applet_load_prefs(mc);
- if (mc->mail_file == NULL || strlen(mc->mail_file)==0) {
- const char *mail_file = g_getenv ("MAIL");
- if (mail_file == NULL) {
- const char *user = g_getenv ("USER");
- if (user != NULL)
- mc->mail_file = g_strdup_printf ("/var/spool/mail/%s",
- user);
- } else
- mc->mail_file = g_strdup (mail_file);
- }
-
- mc->mailcheck_text_only = _("Text only");
-
- mc->size = panel_applet_get_size (applet);
-
- g_signal_connect(G_OBJECT(applet), "size_allocate",
- G_CALLBACK(applet_size_allocate),
- mc);
-
- g_signal_connect(G_OBJECT(applet), "change_orient",
- G_CALLBACK(applet_change_orient),
- mc);
-
- g_signal_connect(G_OBJECT(applet), "change_background",
- G_CALLBACK(applet_change_background),
- mc);
-
- mailcheck = create_mail_widgets (mc);
- gtk_widget_show(mailcheck);
-
- gtk_container_add (GTK_CONTAINER (applet), mailcheck);
-
- g_signal_connect(G_OBJECT(mc->ebox), "button_press_event",
- G_CALLBACK(exec_clicked_cmd),
- mc);
-
- g_signal_connect(G_OBJECT(applet), "key_press_event",
- G_CALLBACK(key_press_cb),
- mc);
-
- panel_applet_setup_menu_from_file (applet,
- NULL,
- "GNOME_MailCheckApplet.xml",
- NULL,
- mailcheck_menu_verbs,
- mc);
-
- if (panel_applet_get_locked_down (applet)) {
- BonoboUIComponent *popup_component;
-
- popup_component = panel_applet_get_popup_component (applet);
-
- bonobo_ui_component_set_prop (popup_component,
- "/commands/Preferences",
- "hidden", "1",
- NULL);
- }
-
- gtk_label_set_text (GTK_LABEL (mc->label), _("Status not updated"));
- set_tooltip (GTK_WIDGET (mc->applet), _("Status not updated"));
- set_atk_name_description (GTK_WIDGET (mc->applet), _("Mail check"),
- _("Mail check notifies you when new mail arrives in your mailbox"));
- gtk_widget_show_all (GTK_WIDGET (applet));
-
- /*
- * check the mail if the applet is realized. Checking the mail
- * right now (in case the applet is not realized), will give us
- * wrong screen value.
- */
-
- if (GTK_WIDGET_REALIZED (GTK_WIDGET (applet)))
- mail_check_timeout (mc);
- else
- mc->applet_realized_signal =
- g_signal_connect (G_OBJECT(applet), "realize",
- G_CALLBACK(applet_realized_cb), mc);
-
- return(TRUE);
-}
-
-static gboolean
-mailcheck_factory (PanelApplet *applet,
- const char *iid,
- gpointer data)
-{
- gboolean retval = FALSE;
-
- if (!strcmp (iid, "OAFIID:GNOME_MailcheckApplet"))
- retval = mailcheck_applet_fill (applet);
-
- return retval;
-}
-
-PANEL_APPLET_BONOBO_FACTORY ("OAFIID:GNOME_MailcheckApplet_Factory",
- PANEL_TYPE_APPLET,
- "InboxMonitor",
- "0",
- mailcheck_factory,
- NULL)
diff --git a/mailcheck/mailcheck.h b/mailcheck/mailcheck.h
deleted file mode 100644
index ee78672eb..000000000
--- a/mailcheck/mailcheck.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * GNOME panel mail check module.
- * (C) 1997, 1998 The Free Software Foundation
- *
- * Author: Leena Gunda
- *
- */
-#ifndef _MAILCHECK_H_
-#define _MAILCHECK_H_
-
-void command_execute_shell (gpointer data,
- const char *command);
-
-#endif
diff --git a/mailcheck/mailcheck.schemas.in b/mailcheck/mailcheck.schemas.in
deleted file mode 100644
index c7722d7a0..000000000
--- a/mailcheck/mailcheck.schemas.in
+++ /dev/null
@@ -1,206 +0,0 @@
-<gconfschemafile>
- <schemalist>
- <schema>
- <key>/schemas/apps/mailcheck_applet/prefs/animation_file</key>
- <owner>mailcheck-applet</owner>
- <type>string</type>
- <default></default>
- <locale name="C">
- <short>Path to the animation file</short>
- <long>This is the animation that will be displayed during normal
- Inbox Monitor usage
- </long>
- </locale>
- </schema>
- <schema>
- <key>/schemas/apps/mailcheck_applet/prefs/auto_update</key>
- <owner>mailcheck-applet</owner>
- <type>bool</type>
- <default>true</default>
- <locale name="C">
- <short>If mail should be checked automatically</short>
- <long>If this is set mail will be checked every update-freq milliseconds</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 you click on the Inbox Monitor</short>
- <long>We run this command when the user clicks on Inbox Monitor</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/reset_on_clicked</key>
- <owner>mailcheck-applet</owner>
- <type>bool</type>
- <default>true</default>
- <locale name="C">
- <short>Whether to reset mail status when you click on Inbox Monitor</short>
- <long></long>
- </locale>
- </schema>
- <schema>
- <key>/schemas/apps/mailcheck_applet/prefs/remote_server</key>
- <owner>mailcheck-applet</owner>
- <type>string</type>
- <default></default>
- <locale name="C">
- <short>The mail server</short>
- <long>Remote 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></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/save_password</key>
- <owner>mailcheck-applet</owner>
- <type>bool</type>
- <default>false</default>
- <locale name="C">
- <short>Do we want to save the password to disk</short>
- <long>If this is enabled, we save the password in gconf</long>
- </locale>
- </schema>
- <schema>
- <key>/schemas/apps/mailcheck_applet/prefs/remote_encrypted_password</key>
- <owner>mailcheck-applet</owner>
- <type>string</type>
- <default></default>
- <locale name="C">
- <short>Encrypted password</short>
- <long>The user's encrypted 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/mail_file</key>
- <owner>mailcheck-applet</owner>
- <type>string</type>
- <default></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>
diff --git a/mailcheck/mailcheck.soundlist.in b/mailcheck/mailcheck.soundlist.in
deleted file mode 100644
index 7ec81573b..000000000
--- a/mailcheck/mailcheck.soundlist.in
+++ /dev/null
@@ -1,6 +0,0 @@
-[__section_info__]
-_description=Mailcheck
-
-[new-mail]
-file=phone.wav
-_description=New Mail
diff --git a/mailcheck/popcheck.c b/mailcheck/popcheck.c
deleted file mode 100644
index 778c1d105..000000000
--- a/mailcheck/popcheck.c
+++ /dev/null
@@ -1,452 +0,0 @@
-/* GNOME pop/imap-mail-check-library.
- * (C) 1997, 1998 The Free Software Foundation
- *
- * Author: Lennart Poettering
- *
- */
-
-#include <config.h>
-
-#include <netdb.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-#include <glib.h>
-
-#include "popcheck.h"
-
-#define TIMEOUT 120
-
-#ifdef ENABLE_IPV6
-static gboolean have_ipv6(void);
-#endif
-
-static int get_server_port(const char *);
-static char* get_server_hostname(const char *);
-static int connect_socket(const char *, int);
-static char *read_line(int);
-static int write_line(int, char *);
-static int is_pop3_answer_ok(const char *);
-static int is_imap_answer_untagged(const char *);
-static int is_imap_answer_ok(const char *);
-static char *wait_for_imap_answer(int, char *);
-
-#ifdef ENABLE_IPV6
-/*Check whether the node is IPv6 enabled.*/
-static gboolean have_ipv6(void)
- {
- int s;
-
- s = socket(AF_INET6, SOCK_STREAM, 0);
- if (s != -1) {
- close(s);
- return TRUE;
- }
- return FALSE;
- }
-#endif
-
-static int get_server_port(const char *h)
- {
- const char *x;
- int cnt;
-
- for (cnt = 0, x = h; *x; x++) {
- if (*x == ':')
- cnt ++;
- }
-
- x = strchr(h, ']');
- if (x)
- x = strchr(x, ':');
- else
- x = (cnt < 2) ? strchr(h, ':') : NULL;
-
- if (x)
- {
- return atoi(x+1);
- }
- else
- return 0;
- }
-
-static char* get_server_hostname(const char *h)
- {
- const char *e, *n;
- int cnt;
- if (!h) return NULL;
-
- for (cnt = 0, n = h; *n; n++) {
- if (*n == ':')
- cnt ++;
- }
-
- e = NULL;
- n = strchr(h, ']');
- if (n)
- e = strchr(n, ':');
- else {
- if (cnt < 2)
- e = strchr(h, ':');
- }
-
- if (e)
- {
- char *x;
- int l;
- l = (n == NULL) ? (e-h) : (n-h-1);
-
- x = g_malloc(l+5);
- if (n == NULL)
- strncpy(x, h, l);
- else
- strncpy(x, h+1, l);
-
- x[l] = 0;
- return x;
- }
- else
- {
- if (n == NULL)
- return strcpy((char*) g_malloc(strlen(h)+1), h);
- else
- return strncpy((char*) g_malloc(strlen(h)-1), h+1, n-h-1);
- }
- }
-
-static int connect_socket(const char *h, int def)
- {
-#if defined (ENABLE_IPV6) && defined (HAVE_GETADDRINFO)
- struct addrinfo hints, *res, *result;
-#endif
- struct hostent *he;
- struct sockaddr_in peer;
- int fd, p;
- char *hn;
- extern int h_errno;
-
- h_errno = 0;
-
- hn = get_server_hostname(h);
- if (!hn)
- return NO_SERVER_INFO;
-
- p = get_server_port(h);
- if (p == 0) p = def;
-
-#if defined (ENABLE_IPV6) && defined (HAVE_GETADDRINFO)
- result = NULL;
- if (have_ipv6()) {
- int status;
-
- fd = 0;
- status = 0;
-
- memset(&hints, 0, sizeof(hints));
- hints.ai_socktype = SOCK_STREAM;
- hints.ai_flags = AI_CANONNAME;
-
- if (getaddrinfo(hn, NULL, &hints, &result) != 0) {
- g_free(hn);
-
- if (result == NULL)
- return INVALID_SERVER;
- else
- return NETWORK_ERROR;
- }
-
- for (res = result; res; res = res->ai_next) {
- if (res->ai_family != AF_INET6 && res->ai_family != AF_INET)
- continue;
-
- fd = socket(res->ai_family, SOCK_STREAM, 0);
- if (fd < 0)
- continue;
-
- if (res->ai_family == AF_INET)
- ((struct sockaddr_in *)res->ai_addr)->sin_port = htons(p);
-
- if (res->ai_family == AF_INET6)
- ((struct sockaddr_in6 *)res->ai_addr)->sin6_port = htons(p);
-
- status = connect(fd, res->ai_addr, res->ai_addrlen);
- if (status != -1)
- break;
-
- close(fd);
- }
-
- freeaddrinfo(result);
-
- if (!res) {
- if (fd < 0 || status < 0)
- return NETWORK_ERROR;
- else
- return INVALID_SERVER;
- }
- }
- else
-#endif
- {
- he = gethostbyname(hn);
- g_free(hn);
-
- if (!he) {
- if (h_errno == HOST_NOT_FOUND)
- return INVALID_SERVER;
- else
- return NETWORK_ERROR;
- }
-
- fd = socket(PF_INET, SOCK_STREAM, 0);
- if (fd < 0)
- return NETWORK_ERROR;
-
- peer.sin_family = AF_INET;
- peer.sin_port = htons(p);
- peer.sin_addr = *(struct in_addr*) he->h_addr;
-
- if (connect(fd, (struct sockaddr*) &peer, sizeof(peer)) < 0)
- {
- close(fd);
- return NETWORK_ERROR;
- }
- } /*have_ipv6*/
-
- return fd;
- }
-
-static char *read_line(int s)
- {
- static char response[1024];
- char *c;
- int m = sizeof(response);
-
- c = response;
-
- while (m--)
- {
- char ch;
- fd_set fs;
- struct timeval t;
-
- FD_ZERO(&fs);
- FD_SET(s, &fs);
-
- t.tv_sec = TIMEOUT;
- t.tv_usec = 0;
-
- if (select(FD_SETSIZE, &fs, NULL, NULL, &t) <= 0)
- return NULL;
-
- if (read(s, &ch, sizeof(ch)) != sizeof(ch))
- return NULL;
-
- if (ch == 10)
- {
- *c = 0;
- return response;
- }
-
- *(c++) = ch;
- }
-
- return NULL;
- }
-
-static int write_line(int s, char *p)
- {
- char *p2;
- p2 = g_malloc(strlen(p)+3);
- strcat(strcpy(p2, p), "\r\n");
-
- if (write(s, p2, strlen(p2)) == strlen(p2))
- {
- g_free(p2);
- return 1;
- }
-
- g_free(p2);
- return 0;
- }
-
-
-static int is_pop3_answer_ok(const char *p)
- {
- if (p)
- if (p[0] == '+') return 1;
-
- return 0;
- }
-
-int pop3_check(const char *h, const char* n, const char* e)
-{
- int s;
- char *c;
- char *x;
- int r = -1, msg = 0, last = 0;
-
- if (!h || !n || !e) return -1;
-
- s = connect_socket(h, 110);
-
- if (s > 0) {
- if (!is_pop3_answer_ok(read_line(s))) {
- close(s);
- return NO_SERVER_INFO;
- }
-
- c = g_strdup_printf("USER %s", n);
- if (!write_line(s, c) ||
- !is_pop3_answer_ok(read_line(s))) {
- close(s);
- g_free(c);
- return INVALID_USER;
- }
- g_free(c);
-
- c = g_strdup_printf("PASS %s", e);
- if (!write_line(s, c) ||
- !is_pop3_answer_ok(read_line(s))) {
- close(s);
- g_free(c);
- return INVALID_PASS;
- }
- g_free(c);
-
- if (write_line(s, "STAT") &&
- is_pop3_answer_ok(x = read_line(s)) &&
- x != NULL &&
- sscanf(x, "%*s %d %*d", &msg) == 1)
- r = ((unsigned int)msg & 0x0000FFFFL);
-
- if (r != -1 &&
- write_line(s, "LAST") &&
- is_pop3_answer_ok(x = read_line(s)) &&
- x != NULL &&
- sscanf(x, "%*s %d", &last) == 1)
- r |= (unsigned int)(msg - last) << 16;
-
- if (write_line(s, "QUIT"))
- read_line(s);
-
- close(s);
- return r;
- }
-
- return s;
-}
-
-static int is_imap_answer_untagged(const char *tag)
- {
- return tag ? *tag == '*' : 0;
- }
-
-static int is_imap_answer_ok(const char *p)
- {
- if (p)
- {
- const char *b = strchr(p, ' ');
- if (b)
- {
- if (*(++b) == 'O' && *(++b) == 'K')
- return 1;
- }
- }
-
- return 0;
- }
-
-static char *wait_for_imap_answer(int s, char *tag)
- {
- char *p;
- int i = 10; /* read not more than 10 lines */
-
- while (i--)
- {
- p = read_line(s);
- if (!p) return NULL;
- if (strncmp(p, tag, strlen(tag)) == 0) return p;
- }
-
- return NULL;
- }
-
-int
-imap_check(const char *h, const char* n, const char* e, const char* f)
-{
- int s;
- char *c = NULL;
- char *x;
- unsigned int r = (unsigned int) -1;
- int total = 0, unseen = 0;
- int count = 0;
-
- if (!h || !n || !e) return NO_SERVER_INFO;
-
- if (f == NULL ||
- f[0] == '\0')
- f = "INBOX";
-
- s = connect_socket(h, 143);
-
- if (s < 0)
- return s;
-
- x = read_line(s);
- /* The greeting us untagged */
- if (!is_imap_answer_untagged(x))
- goto return_from_imap_check;
-
- if (!is_imap_answer_ok(x))
- goto return_from_imap_check;
-
-
- c = g_strdup_printf("A1 LOGIN \"%s\" \"%s\"", n, e);
- if (!write_line(s, c))
- goto return_from_imap_check;
-
- if (!is_imap_answer_ok(wait_for_imap_answer(s, "A1"))) {
- g_free (c);
- close (s);
- return INVALID_PASS;
- }
-
- c = g_strdup_printf("A2 STATUS \"%s\" (MESSAGES UNSEEN)",f);
- if (!write_line(s, c))
- goto return_from_imap_check;
-
- /* We only loop 5 times if more than that this is
- * probably a bogus reply */
- for (count = 0, x = read_line(s);
- count < 5 && x != NULL;
- count++, x = read_line(s)) {
- char tmpstr[4096];
-
- if (sscanf(x, "%*s %*s %*s %*s %d %4095s %d",
- &total, tmpstr, &unseen) != 3)
- continue;
- if (strcmp(tmpstr, "UNSEEN") == 0)
- break;
-
- }
-
- r = (((unsigned int) unseen ) << 16) | /* lt unseen only */
- ((unsigned int) total & 0x0000FFFFL);
-
- if (write_line(s, "A3 LOGOUT"))
- read_line(s);
-
- return_from_imap_check:
-
- g_free (c);
- close (s);
-
- return r;
- }
-
diff --git a/mailcheck/popcheck.h b/mailcheck/popcheck.h
deleted file mode 100644
index 117e8bab9..000000000
--- a/mailcheck/popcheck.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* GNOME pop/imap-mail-check-library.
- * (C) 1997, 1998 The Free Software Foundation
- *
- * Author: Lennart Poettering
- *
- */
-
-#ifndef _POPCHECK_H_
-#define _POPCHECK_H_
-
-/* Returns how many mails are available on POP3-server "h" with username "n" and password "e"
- * The server-name may be given with or without port-number in form "host:port".
- */
-int pop3_check(const char *h, const char* n, const char* e);
-
-/* Returns how many mails are available on IMAP-server "h"
- * in folder "f" with username "n" and password "e"
- * Hi: unseen/recent; Lo: total
- * The server-name may be given with or without port-number in form "host:port".
- */
-int imap_check(const char *h, const char* n, const char* e, const char* f);
-
-#define NO_SERVER_INFO -1
-#define NETWORK_ERROR -2
-#define INVALID_USER -3
-#define INVALID_PASS -4
-#define INVALID_SERVER -5
-#endif
-
diff --git a/mailcheck/remote-helper.c b/mailcheck/remote-helper.c
deleted file mode 100644
index 487148f9b..000000000
--- a/mailcheck/remote-helper.c
+++ /dev/null
@@ -1,263 +0,0 @@
-/* GNOME remote helper, forks to run imap or pop checks
- * (C) 2001 Eazel, Inc.
- *
- * Author: George Lebl
- *
- * Utterly ugly, make this use corba at some point in the future.
- */
-
-#include "config.h"
-#include <gtk/gtk.h>
-#include <libgnome/libgnome.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/wait.h>
-#include <signal.h>
-#include <errno.h>
-#include <poll.h>
-
-#include "popcheck.h"
-#include "mailcheck.h"
-#include "remote-helper.h"
-
-#define POLLTIMEOUT 5000 /* 5 milliseconds */
-
-typedef struct {
- pid_t pid;
- int fd;
- guint timeout;
- RemoteHandler handler;
- RemoteHandler error_handler;
- gpointer data;
- GDestroyNotify destroy_notify;
-} RemoteHandlerData;
-
-static gboolean
-try_reading (gpointer data)
-{
- int retval;
- int mails;
- RemoteHandlerData *handler = data;
- sigset_t mask, omask;
-
- sigemptyset (&mask);
- sigaddset (&mask, SIGPIPE);
- sigprocmask (SIG_BLOCK, &mask, &omask);
-
- retval = read (handler->fd, &mails, sizeof (mails));
-
- sigprocmask (SIG_SETMASK, &omask, NULL);
-
- if (retval == 0 ||
- (retval < 0 && errno == EAGAIN)) {
- if (kill (handler->pid, 0) != 0) {
- handler->timeout = 0;
- helper_whack_handle (handler);
- return FALSE;
- }
- return TRUE;
- } else if (retval < 0) {
- handler->timeout = 0;
- helper_whack_handle (handler);
- return FALSE;
- }
-
- if (mails < 0)
- handler->error_handler (mails, handler->data);
- else
- handler->handler (mails, handler->data);
-
- handler->timeout = 0;
- helper_whack_handle (handler);
- return FALSE;
-}
-
-void
-helper_whack_handle (gpointer handle)
-{
- RemoteHandlerData *handler = handle;
-
- if (handler->fd >= 0)
- close (handler->fd);
- handler->fd = -1;
-
- if (handler->pid > 0) {
- kill (handler->pid, SIGTERM);
- }
- handler->pid = 0;
-
- if (handler->timeout > 0)
- gtk_timeout_remove (handler->timeout);
- handler->timeout = 0;
-
- handler->handler = NULL;
- if (handler->destroy_notify != NULL)
- handler->destroy_notify (handler->data);
- handler->data = NULL;
- handler->destroy_notify = NULL;
-
- g_free (handler);
-}
-
-static RemoteHandlerData *
-fork_new_handler (RemoteHandler handler, RemoteHandler error_handler,
- gpointer data, GDestroyNotify destroy_notify)
-{
- pid_t pid;
- int pidpipe[2], mailpipe[2];
- RemoteHandlerData *handler_data;
-
- if (pipe (pidpipe) != 0)
- return NULL;
- if (pipe (mailpipe) != 0) {
- close (pidpipe[0]);
- close (pidpipe[1]);
- return NULL;
- }
-
- handler_data = g_new0 (RemoteHandlerData, 1);
-
- pid = fork ();
- if (pid < 0) {
- close (pidpipe[0]);
- close (pidpipe[1]);
- close (mailpipe[0]);
- close (mailpipe[1]);
- g_free (handler_data);
- return NULL;
- } else if (pid == 0) {
- /*child*/
- pid = fork ();
- if (pid != 0) {
- write (pidpipe[1], &pid, sizeof (pid));
- _exit (0);
- } else {
- /* grand child */
-
- close (pidpipe [0]);
- close (pidpipe [1]);
-
- handler_data->pid = 0;
- handler_data->fd = mailpipe[1];
- return handler_data;
- }
- } else {
- /*parent*/
- close (pidpipe[1]);
- close (mailpipe[1]);
- while ((waitpid (pid, NULL, 0) == -1) && errno == EINTR);
- if (read (pidpipe[0], &pid, sizeof (pid)) == -1)
- pid = -1;
- close (pidpipe[0]);
-
- if (pid <= 0) {
- close (mailpipe[0]);
- g_free (handler_data);
- return NULL;
- }
-
- /* set to nonblocking */
- fcntl(mailpipe[0], F_SETFL, O_NONBLOCK);
-
- handler_data->pid = pid;
- handler_data->fd = mailpipe[0];
- handler_data->handler = handler;
- handler_data->error_handler = error_handler;
- handler_data->data = data;
- handler_data->destroy_notify = destroy_notify;
- handler_data->timeout = gtk_timeout_add (500, try_reading,
- handler_data);
-
- return handler_data;
- }
-}
-
-
-gpointer
-helper_pop3_check (RemoteHandler handler, RemoteHandler error_handler,
- gpointer data,
- GDestroyNotify destroy_notify,
- const char *command,
- const char *h, const char* n, const char* e)
-{
- RemoteHandlerData *handler_data;
-
- handler_data = fork_new_handler (handler, error_handler, data,
- destroy_notify);
-
- if (handler_data == NULL) {
- int mails;
-
- mails = pop3_check (h, n, e);
-
- if (mails < 0)
- error_handler (mails, data);
- else
- handler (mails, data);
-
- if (destroy_notify != NULL)
- destroy_notify (data);
- return NULL;
- }
-
- if (handler_data->pid == 0) {
- int mails;
-
- mails = pop3_check (h, n, e);
-
- write (handler_data->fd, &mails, sizeof (mails));
-
- _exit (0);
- }
-
- if (command != NULL &&
- command[0] != '\0')
- command_execute_shell (data, command);
-
- return handler_data;
-}
-
-gpointer
-helper_imap_check (RemoteHandler handler, RemoteHandler error_handler,
- gpointer data,
- GDestroyNotify destroy_notify,
- const char *command,
- const char *h, const char* n, const char* e, const char *f)
-{
- RemoteHandlerData *handler_data;
-
- handler_data = fork_new_handler (handler, error_handler, data,
- destroy_notify);
-
- if (handler_data == NULL) {
- int mails;
-
- mails = imap_check (h, n, e, f);
-
- if (mails < 0)
- error_handler (mails, data);
- else
- handler (mails, data);
-
- return NULL;
- }
-
- if (handler_data->pid == 0) {
- int mails;
-
- mails = imap_check (h, n, e, f);
-
- write (handler_data->fd, &mails, sizeof (mails));
-
- _exit (0);
- }
-
- if (command != NULL &&
- command[0] != '\0')
- command_execute_shell (data, command);
-
- return handler_data;
-}
diff --git a/mailcheck/remote-helper.h b/mailcheck/remote-helper.h
deleted file mode 100644
index 75a1abbf9..000000000
--- a/mailcheck/remote-helper.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* GNOME remote helper, forks to run imap or pop checks
- * (C) 2001 Eazel, Inc.
- *
- * Author: George Lebl
- *
- */
-
-#ifndef REMOTE_HELPER_H
-#define REMOTE_HELPER_H
-
-typedef void (* RemoteHandler) (int mails, gpointer data);
-
-gpointer helper_pop3_check (RemoteHandler handler, RemoteHandler error_handler,
- gpointer data,
- GDestroyNotify destroy_notify,
- const char *command,
- const char *h, const char* n, const char* e);
-gpointer helper_imap_check (RemoteHandler handler, RemoteHandler error_handler,
- gpointer data,
- GDestroyNotify destroy_notify,
- const char *command,
- const char *h, const char* n, const char* e,
- const char *f);
-void helper_whack_handle (gpointer handle);
-
-#endif
diff --git a/mailcheck/tux-anim.png b/mailcheck/tux-anim.png
deleted file mode 100644
index c96c478f2..000000000
--- a/mailcheck/tux-anim.png
+++ /dev/null
Binary files differ
diff --git a/mailcheck/update-from-egg.sh b/mailcheck/update-from-egg.sh
deleted file mode 100755
index 9be68a9b4..000000000
--- a/mailcheck/update-from-egg.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-function die() {
- echo $*
- exit 1
-}
-
-if test -z "$EGGDIR"; then
- echo "Must set EGGDIR"
- exit 1
-fi
-
-if test -z "$EGGFILES"; then
- echo "Must set EGGFILES"
- exit 1
-fi
-
-for FILE in $EGGFILES; do
- if cmp -s $EGGDIR/$FILE $FILE; then
- echo "File $FILE is unchanged"
- else
- cp $EGGDIR/$FILE $FILE || die "Could not move $EGGDIR/$FILE to $FILE"
- echo "Updated $FILE"
- fi
-done
diff --git a/null_applet/ChangeLog b/null_applet/ChangeLog
new file mode 100644
index 000000000..175f06c4a
--- /dev/null
+++ b/null_applet/ChangeLog
@@ -0,0 +1,7 @@
+2004-10-26 Davyd Madeley <davyd@madeley.id.au>
+
+ * README:
+ * GNOME_NullApplet_Factory.server.in.in:
+ * Makefile.am:
+ * null_applet.c: Initial version: specifically for deprecating the
+ mailcheck applet.
diff --git a/mailcheck/GNOME_MailcheckApplet_Factory.server.in.in b/null_applet/GNOME_NullApplet_Factory.server.in.in
index 06cc8e53e..fb11b1f10 100644
--- a/mailcheck/GNOME_MailcheckApplet_Factory.server.in.in
+++ b/null_applet/GNOME_NullApplet_Factory.server.in.in
@@ -1,34 +1,34 @@
<oaf_info>
-<oaf_server iid="OAFIID:GNOME_MailcheckApplet_Factory"
+<!-- null_applet factory -->
+<oaf_server iid="OAFIID:GNOME_NullApplet_Factory"
type="exe"
- location="@LIBEXECDIR@/mailcheck-applet">
+ location="@LIBEXECDIR@/null_applet">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Bonobo/GenericFactory:1.0"/>
<item value="IDL:Bonobo/Unknown:1.0"/>
</oaf_attribute>
- <oaf_attribute name="name" type="string" _value="Inbox Monitor Factory"/>
- <oaf_attribute name="description" type="string" _value="Factory for creating inbox monitors."/>
+ <oaf_attribute name="name" type="string" _value="Null Applet Factory"/>
+ <oaf_attribute name="description" type="string" _value="Factory for deprecating applets"/>
</oaf_server>
+<!-- mailcheck applet -->
<oaf_server iid="OAFIID:GNOME_MailcheckApplet"
type="factory"
- location="OAFIID:GNOME_MailcheckApplet_Factory">
+ location="OAFIID:GNOME_NullApplet_Factory">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:GNOME/Vertigo/PanelAppletShell:1.0"/>
<item value="IDL:Bonobo/Control:1.0"/>
<item value="IDL:Bonobo/Unknown:1.0"/>
</oaf_attribute>
- <oaf_attribute name="name" type="string" _value="Inbox Monitor"/>
+ <oaf_attribute name="name" type="string" _value="Inbox Monitor (Deprecated)"/>
<oaf_attribute name="description" type="string" _value="Alert you when new mail arrives"/>
- <oaf_attribute name="panel:icon" type="string" value="gnome-mailcheck.png"/>
<oaf_attribute name="bugzilla:bugzilla" type="string" value="GNOME"/>
<oaf_attribute name="bugzilla:product" type="string" value="gnome-applets"/>
<oaf_attribute name="bugzilla:component" type="string" value="Mailcheck Applet"/>
- <oaf_attribute name="bugzilla:other_binaries" type="string" value="mailcheck-applet"/>
</oaf_server>
diff --git a/null_applet/Makefile.am b/null_applet/Makefile.am
new file mode 100644
index 000000000..76881660c
--- /dev/null
+++ b/null_applet/Makefile.am
@@ -0,0 +1,22 @@
+INCLUDES = -I. -I$(srcdir) \
+-DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
+$(GNOME_APPLETS_CFLAGS)
+
+libexec_PROGRAMS = null_applet
+
+null_applet_SOURCES = null_applet.c
+
+null_applet_LDADD = $(GNOME_APPLETS_LIBS)
+
+serverdir = $(libdir)/bonobo/servers
+server_in_files = GNOME_NullApplet_Factory.server.in
+server_DATA = $(server_in_files:.server.in=.server)
+
+$(server_in_files): $(server_in_files:.server.in=.server.in.in)
+ sed -e "s|\@LIBEXECDIR\@|$(libexecdir)|" $< > $@
+
+@INTLTOOL_SERVER_RULE@
+
+CLEANFILES = $(server_in_files) $(server_DATA)
+
+EXTRA_DIST = GNOME_NullApplet_Factory.server.in.in
diff --git a/null_applet/README b/null_applet/README
new file mode 100644
index 000000000..be4c8a706
--- /dev/null
+++ b/null_applet/README
@@ -0,0 +1,22 @@
+What the hell is a Null Applet?
+===============================
+
+The Null Applet is the Applet Deprecation Applet. It allows us to remove applets
+from a users configuration, without them getting cryptic messages about being
+unable to resolve things, and getting a raw dump of preferences (the panel likes
+to do this). In the future, the null applet will also be useful for when someone
+decides not to build one of the optional applets, to prevent them from seeing
+the same ugly message.
+
+How do I add an applet to Null Applet?
+======================================
+
+You'll need the factory from the oaf_server, copy that server to
+GNOME_NullApplet_Factory.server.in.in, set it's location to
+GNOME_NullApplet_Factory. Remove it's panel:icon attribute so that it doesn't
+appear in the add to panel list.
+
+Who wrote this abomination?
+===========================
+
+Blame Davyd Madeley <davyd@madeley.id.au>
diff --git a/null_applet/null_applet.c b/null_applet/null_applet.c
new file mode 100644
index 000000000..bcd217413
--- /dev/null
+++ b/null_applet/null_applet.c
@@ -0,0 +1,169 @@
+/* -*- mode: C; c-basic-offset: 4 -*-
+ * Null Applet - The Applet Deprecation Applet
+ * Copyright (c) 2004, Davyd Madeley
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author:
+ * Davyd Madeley <davyd@madeley.id.au>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+#include <gconf/gconf-client.h>
+#include <panel-applet.h>
+
+static const char null_applet_iid[] = "OAFIID:GNOME_NullApplet";
+static const char factory_iid[] = "OAFIID:GNOME_NullApplet_Factory";
+
+static inline void
+insert_oafiids (GHashTable *hash_table)
+{
+ /*
+ * Add OAFIID's and descriptions of deprecated applets here
+ */
+ g_hash_table_insert (hash_table,
+ "OAFIID:GNOME_MailcheckApplet", "Inbox Monitor");
+}
+
+static gboolean already_running;
+
+static void
+response_cb (GtkWidget *dialog, gint arg1, gpointer user_data)
+{
+ PanelApplet *applet;
+
+ applet = PANEL_APPLET (user_data);
+
+ gtk_widget_destroy (dialog);
+}
+
+static char
+*get_all_applets (void)
+{
+ GConfClient *client;
+ GError *error;
+ GSList *list, *l, *applet_list;
+ char *key, *oafiid, *name;
+ GHashTable *hash_table;
+ GString *string;
+
+ error = NULL;
+ hash_table = g_hash_table_new (g_str_hash, g_str_equal);
+ insert_oafiids (hash_table);
+
+ string = g_string_new ("");
+
+ client = gconf_client_get_default ();
+
+ list = gconf_client_all_dirs (client,
+ "/apps/panel/profiles/default/applets",
+ &error);
+
+ if (error)
+ {
+ g_warning ("Error: %s", error->message);
+ g_error_free (error);
+ error = NULL;
+ }
+
+ for (l = list; l; l = l->next)
+ {
+ key = g_strdup_printf ("%s/bonobo_iid", l->data);
+ oafiid = gconf_client_get_string (client, key, &error);
+ if (error)
+ {
+ g_warning ("Error: %s", error->message);
+ g_error_free (error);
+ error = NULL;
+ }
+ g_free (key);
+
+ name = g_hash_table_lookup (hash_table, oafiid);
+ if (name)
+ {
+ g_warning ("Deleting %s (%s) from config",
+ oafiid, name);
+ gconf_client_recursive_unset (client, l->data,
+ GCONF_UNSET_INCLUDING_SCHEMA_NAMES,
+ &error);
+ if (error)
+ {
+ g_warning ("Error: %s", error->message);
+ g_error_free (error);
+ error = NULL;
+ }
+ g_string_append_printf (string, " • %s\n", name);
+ }
+ g_free (oafiid);
+ g_free (l->data);
+ }
+
+ g_slist_free (list);
+ g_hash_table_destroy (hash_table);
+
+ return g_string_free (string, FALSE);
+}
+
+static gboolean
+applet_factory (PanelApplet *applet,
+ const char *iid,
+ gpointer user_data)
+{
+ char *applet_list;
+
+ if (already_running)
+ {
+ g_warning ("not first applet, ignoring");
+ return FALSE;
+ }
+ already_running = TRUE;
+ g_warning ("was given applet to handle\n");
+
+ applet_list = get_all_applets ();
+
+ GtkWidget *dialog;
+
+ dialog = gtk_message_dialog_new_with_markup (NULL,
+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_INFO, GTK_BUTTONS_OK,
+ "<span size=\"large\" weight=\"bold\">%s</span>"
+ "\n\n%s\n\n%s\n%s\n%s",
+ _("Some panel items are no longer available"),
+ _("One or more panel items (also referred to as applets"
+ ") are no longer available in the GNOME desktop."),
+ _("These items will now be removed from your "
+ "configuration:"),
+ applet_list,
+ _("You will not receive this message again.")
+ );
+
+ g_free (applet_list);
+
+ g_signal_connect (G_OBJECT (dialog), "response",
+ G_CALLBACK (response_cb), applet);
+
+ gtk_widget_show_all (dialog);
+
+ return TRUE;
+}
+
+PANEL_APPLET_BONOBO_FACTORY (factory_iid,
+ PANEL_TYPE_APPLET,
+ "Null-Applet", "0",
+ applet_factory, NULL);