unity-launcher-integration-20140305.2346.diff

Kentaro HAYASHI, 03/05/2014 11:49 PM

Download (5.29 KB)

View differences:

sylpheed.desktop (working copy)
16 16
Terminal=false
17 17
Type=Application
18 18
Categories=GTK;Network;Email;News;
19
Actions=Compose;Safemode
20

  
21
[Desktop Action Compose]
22
Name=Compose New Message
23
Name[de]=Neue Nachricht erstellen
24
Name[fr]=Rédiger un nouveau courriel
25
Name[hu]=Új üzenet írása
26
Name[ja]=新しいメッセージの作成
27
Name[pl]=Utwórz nową wiadomość
28
Name[tr]=Yeni İleti Oluştur
29
Name[ru]=Написать новое сообщение
30
Name[uk]=Написати нове повідомлення
31
Exec=sylpheed --compose
32
OnlyShowIn=Messaging Menu;Unity;
33

  
34
[Desktop Action Safemode]
35
Name=Launch Sylpheed in safe mode
36
Name[de]=Start i fejlsikret tilstand
37
Name[fr]=Lancer en mode sans échec
38
Name[hu]=Indítás csökkentett módban
39
Name[ja]=セーフモードで起動
40
Name[pl]=Uruchomić w trybie awaryjnym
41
Name[tr]=Güvenli modda başlayın
42
Name[ru]=Начните в безопасном режиме
43
Name[uk]=Почніть в безпечному режимі
44
Exec=sylpheed --safe-mode
45
OnlyShowIn=Messaging Menu;Unity;
configure.in (working copy)
422 422
  fi
423 423
fi
424 424

  
425
AC_ARG_ENABLE(unity,
426
	[  --enable-unity          Enable Unity integration support],
427
	[ac_cv_enable_unity=$enableval], [ac_cv_enable_unity=no])
428
if test x"$ac_cv_enable_unity" = xyes ; then
429
  PKG_CHECK_MODULES(UNITY, unity >= 5.12.0,
430
	[AC_DEFINE([USE_UNITY_INTEGRATION], [1], [Enable unity integration feature.])],[])
431
fi
432

  
425 433
dnl Check for d_type member in struct dirent
426 434
AC_MSG_CHECKING([whether struct dirent has d_type member])
427 435
AC_CACHE_VAL(ac_cv_dirent_d_type,[
......
496 504
echo ""
497 505
echo "$PACKAGE $VERSION"
498 506
echo ""
499
echo "GnuPG         : $ac_cv_enable_gpgme"
500
echo "JPilot        : $ac_cv_enable_jpilot"
501
echo "LDAP          : $ac_cv_enable_ldap"
502
echo "OpenSSL       : $ac_cv_enable_ssl"
503
echo "iconv         : $am_cv_func_iconv"
504
echo "compface      : $ac_cv_enable_compface"
505
echo "IPv6          : $ac_cv_enable_ipv6"
506
echo "GtkSpell      : $ac_cv_enable_gtkspell"
507
echo "Oniguruma     : $ac_cv_enable_oniguruma"
508
echo "GThread       : $use_threads"
507
echo "GnuPG            : $ac_cv_enable_gpgme"
508
echo "JPilot           : $ac_cv_enable_jpilot"
509
echo "LDAP             : $ac_cv_enable_ldap"
510
echo "OpenSSL          : $ac_cv_enable_ssl"
511
echo "iconv            : $am_cv_func_iconv"
512
echo "compface         : $ac_cv_enable_compface"
513
echo "IPv6             : $ac_cv_enable_ipv6"
514
echo "GtkSpell         : $ac_cv_enable_gtkspell"
515
echo "Oniguruma        : $ac_cv_enable_oniguruma"
516
echo "GThread          : $use_threads"
517
echo "Unity integration: $ac_cv_enable_unity"
509 518
echo ""
510 519
echo "The binary will be installed in $prefix/bin"
511 520
echo ""
src/mainwindow.c (working copy)
49 49
#include <gtk/gtkimage.h>
50 50
#include <string.h>
51 51

  
52
#ifdef USE_UNITY_INTEGRATION
53
#  include <unity.h>
54
#endif
52 55
#include "main.h"
53 56
#include "mainwindow.h"
54 57
#include "folderview.h"
......
545 548
				  FolderItem	*item,
546 549
				  gpointer	 data);
547 550

  
551
static void update_unity_integration(PrefsAccount *account);
552

  
548 553
static GtkItemFactoryEntry mainwin_entries[] =
549 554
{
550 555
	{N_("/_File"),				NULL, NULL, 0, "<Branch>"},
......
3549 3554
static void inc_mail_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
3550 3555
{
3551 3556
	inc_mail(mainwin);
3557
	update_unity_integration(cur_account);
3552 3558
}
3553 3559

  
3554 3560
static void inc_all_account_mail_cb(MainWindow *mainwin, guint action,
3555 3561
				    GtkWidget *widget)
3556 3562
{
3557 3563
	inc_all_account_mail(mainwin, FALSE);
3564
	update_unity_integration(NULL);
3558 3565
}
3559 3566

  
3560 3567
static void inc_stop_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
......
3565 3572
static void rpop3_cb(MainWindow	*mainwin, guint action, GtkWidget *widget)
3566 3573
{
3567 3574
	rpop3_account(cur_account);
3575
	update_unity_integration(cur_account);
3568 3576
}
3569 3577

  
3570 3578
static void send_queue_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
......
4208 4216
	STATUSBAR_POP(mainwin);
4209 4217
	g_free(str);
4210 4218
}
4219

  
4220
#ifdef USE_UNITY_INTEGRATION
4221
static void update_unity_integration(PrefsAccount *account)
4222
{
4223
	UnityLauncherEntry *launcher;
4224
	FolderItem *item;
4225

  
4226
	if (!account)
4227
		account = account_get_current_account();
4228
	if (!account)
4229
		account = account_get_default();
4230
	if (account && account->folder) {
4231
		item = FOLDER(account->folder)->inbox;
4232
		if (item) {
4233
			launcher = unity_launcher_entry_get_for_desktop_id("sylpheed.desktop");
4234
			if (launcher) {
4235
				unity_launcher_entry_set_count(launcher, item->unread);
4236
				unity_launcher_entry_set_count_visible(launcher, TRUE);
4237
			}
4238
		}
4239
	}
4240
}
4241
#endif
src/Makefile.am (working copy)
141 141
	-I$(top_srcdir)/libsylph \
142 142
	$(GTK_CFLAGS) \
143 143
	$(GDK_PIXBUF_CFLAGS) \
144
	$(GPGME_CFLAGS)
144
	$(GPGME_CFLAGS) \
145
	$(UNITY_CFLAGS)
145 146

  
146 147
if NATIVE_WIN32
147 148
SYLPHEED_RES = sylpheed.res
......
156 157
	$(GTK_LIBS) \
157 158
	$(GLIB_LIBS) \
158 159
	$(GPGME_LIBS) \
160
	$(UNITY_LIBS) \
159 161
	$(LDAP_LIBS) \
160 162
	$(LIBICONV) \
161 163
	libsylpheed-plugin-0.la \