aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--ChangeLog.ja7
-rw-r--r--src/main.c3
-rw-r--r--src/mainwindow.c4
-rw-r--r--src/trayicon.c23
-rw-r--r--src/trayicon.h1
6 files changed, 38 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index fff149d9..2514f803 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2006-09-28
+ * src/trayicon.[ch]: trayicon_hide(): added.
+ * src/mainwindow.c: call trayicon_hide() instead of trayicon_destroy().
+ * src/main.c: app_will_exit(): call trayicon_destroy().
+
+2006-09-28
+
* src/trayicon.c: use 16x16 icon for Windows system tray.
* src/icons/stock_sylpheed_16.png
src/icons/Makefile.am
diff --git a/ChangeLog.ja b/ChangeLog.ja
index 279fe54c..bb1246a6 100644
--- a/ChangeLog.ja
+++ b/ChangeLog.ja
@@ -1,5 +1,12 @@
2006-09-28
+ * src/trayicon.[ch]: trayicon_hide(): 追加。
+ src/mainwindow.c: trayicon_destroy() の代わりに trayicon_hide() を
+ 呼ぶようにした。
+ * src/main.c: app_will_exit(): trayicon_destroy() を呼ぶようにした。
+
+2006-09-28
+
* src/trayicon.c: Windows のシステムトレイに16x16のアイコンを使用。
* src/icons/stock_sylpheed_16.png
src/icons/Makefile.am
diff --git a/src/main.c b/src/main.c
index 37e8088e..5fd89c2b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -79,6 +79,7 @@
#include "gtkutils.h"
#include "socket.h"
#include "stock_pixmap.h"
+#include "trayicon.h"
#if USE_GPGME
# include "rfc2015.h"
@@ -654,6 +655,8 @@ void app_will_exit(gboolean force)
procmsg_remove_all_cached_messages(FOLDER(ac->folder));
}
+ trayicon_destroy(mainwin->tray_icon);
+
/* save all state before exiting */
folder_write_list();
summary_write_cache(mainwin->summaryview);
diff --git a/src/mainwindow.c b/src/mainwindow.c
index 814fbcf5..76a4e7ba 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -1224,8 +1224,8 @@ void main_window_reflect_prefs_all(void)
if (prefs_common.show_trayicon)
trayicon_show(mainwin->tray_icon);
else {
- /* trayicon is automatically restored after this */
- trayicon_destroy(mainwin->tray_icon);
+ /* trayicon is automatically replaced by new one */
+ trayicon_hide(mainwin->tray_icon);
}
}
diff --git a/src/trayicon.c b/src/trayicon.c
index 35a20083..fb33f0a1 100644
--- a/src/trayicon.c
+++ b/src/trayicon.c
@@ -172,16 +172,18 @@ TrayIcon *trayicon_create(MainWindow *mainwin)
void trayicon_show(TrayIcon *tray_icon)
{
- gtk_status_icon_set_visible(trayicon.status_icon, TRUE);
+ gtk_status_icon_set_visible(tray_icon->status_icon, TRUE);
};
+void trayicon_hide(TrayIcon *tray_icon)
+{
+ gtk_status_icon_set_visible(tray_icon->status_icon, FALSE);
+}
+
void trayicon_destroy(TrayIcon *tray_icon)
{
-#if 0
g_object_unref(tray_icon->status_icon);
tray_icon->status_icon = NULL;
-#endif
- gtk_status_icon_set_visible(tray_icon->status_icon, FALSE);
}
void trayicon_set_tooltip(const gchar *text)
@@ -247,8 +249,17 @@ void trayicon_show(TrayIcon *tray_icon)
gtk_widget_show(tray_icon->widget);
};
+void trayicon_hide(TrayIcon *tray_icon)
+{
+ gtk_widget_destroy(tray_icon->widget);
+ tray_icon->widget = NULL;
+}
+
void trayicon_destroy(TrayIcon *tray_icon)
{
+ g_signal_handlers_disconnect_by_func(G_OBJECT(trayicon->widget),
+ G_CALLBACK(trayicon_destroy_cb),
+ mainwin);
gtk_widget_destroy(tray_icon->widget);
tray_icon->widget = NULL;
}
@@ -369,6 +380,10 @@ void trayicon_show(TrayIcon *tray_icon)
{
}
+void trayicon_hide(TrayIcon *tray_icon)
+{
+}
+
void trayicon_destroy(TrayIcon *tray_icon)
{
}
diff --git a/src/trayicon.h b/src/trayicon.h
index af509dd9..eea46af0 100644
--- a/src/trayicon.h
+++ b/src/trayicon.h
@@ -44,6 +44,7 @@ struct _TrayIcon
TrayIcon *trayicon_create (MainWindow *mainwin);
void trayicon_show (TrayIcon *tray_icon);
+void trayicon_hide (TrayIcon *tray_icon);
void trayicon_destroy (TrayIcon *tray_icon);
void trayicon_set_tooltip (const gchar *text);
void trayicon_set_notify (gboolean enabled);