Commit 0e2ca094 authored by Victor Ananjevsky's avatar Victor Ananjevsky

make notification dialog optional

parent d601f4ce
......@@ -44,6 +44,17 @@ if test x$have_html = xyes; then
AC_DEFINE([HAVE_HTML], [1], [Define this if you have webkit2gt library])
fi
dnl status icon widget
AC_ARG_ENABLE([tray],
[AS_HELP_STRING([--enable-tray],
[Build YAD with status icon])],
[build_tray=$enableval], [build_tray=yes])
AM_CONDITIONAL([TRAY], [test x$build_tray = xyes])
if test x$build_tray = xyes; then
AC_DEFINE([HAVE_TRAY], [1], [Define this if you need status icon])
fi
dnl spell check
AC_ARG_ENABLE([spell],
[AS_HELP_STRING([--enable-spell],
......@@ -135,6 +146,7 @@ AC_OUTPUT
echo
echo "Build configuratioh:"
echo " Status icon - $build_tray"
echo " HTML widget - $have_html"
echo " GtkSourceView - $have_sourceview"
echo " Spell checking - $have_spell"
......
......@@ -16,7 +16,6 @@ yad_SOURCES = \
list.c \
multi-progress.c \
notebook.c \
notification.c \
option.c \
paned.c \
picture.c \
......@@ -30,6 +29,10 @@ yad_SOURCES = \
stock.h \
calendar.xpm
if TRAY
yad_SOURCES += notification.c
endif
if HTML
yad_SOURCES += html.c
endif
......
......@@ -810,9 +810,11 @@ main (gint argc, gchar ** argv)
break;
#endif
#ifdef HAVE_TRAY
case YAD_MODE_NOTIFICATION:
ret = yad_notification_run ();
break;
#endif
case YAD_MODE_PRINT:
ret = yad_print_run ();
......
......@@ -80,7 +80,9 @@ static gboolean icons_mode = FALSE;
static gboolean list_mode = FALSE;
static gboolean multi_progress_mode = FALSE;
static gboolean notebook_mode = FALSE;
#ifdef HAVE_TRAY
static gboolean notification_mode = FALSE;
#endif
static gboolean paned_mode = FALSE;
static gboolean picture_mode = FALSE;
static gboolean print_mode = FALSE;
......@@ -491,6 +493,7 @@ static GOptionEntry notebook_options[] = {
{ NULL }
};
#ifdef HAVE_TRAY
static GOptionEntry notification_options[] = {
{ "notification", 0, G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &notification_mode,
N_("Display notification"), NULL },
......@@ -504,6 +507,7 @@ static GOptionEntry notification_options[] = {
N_("Set icon size for fully specified icons (default - 16)"), N_("SIZE") },
{ NULL }
};
#endif
static GOptionEntry paned_options[] = {
{ "paned", 0, G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &paned_mode,
......@@ -1385,8 +1389,10 @@ yad_set_mode (void)
options.mode = YAD_MODE_MULTI_PROGRESS;
else if (notebook_mode)
options.mode = YAD_MODE_NOTEBOOK;
#ifdef HAVE_TRAY
else if (notification_mode)
options.mode = YAD_MODE_NOTIFICATION;
#endif
else if (paned_mode)
options.mode = YAD_MODE_PANED;
else if (picture_mode)
......@@ -1623,10 +1629,12 @@ yad_options_init (void)
options.notebook_data.expand = FALSE;
options.notebook_data.active = 1;
#ifdef HAVE_TRAY
/* Initialize notification data */
options.notification_data.middle = TRUE;
options.notification_data.hidden = FALSE;
options.notification_data.menu = NULL;
#endif
/* Initialize paned data */
options.paned_data.orient = GTK_ORIENTATION_VERTICAL;
......@@ -1778,12 +1786,14 @@ yad_create_context (void)
g_option_group_set_translation_domain (a_group, GETTEXT_PACKAGE);
g_option_context_add_group (tmp_ctx, a_group);
#ifdef HAVE_TRAY
/* Adds notification option entries */
a_group = g_option_group_new ("notification", _("Notification icon options"),
_("Show notification icon options"), NULL, NULL);
g_option_group_add_entries (a_group, notification_options);
g_option_group_set_translation_domain (a_group, GETTEXT_PACKAGE);
g_option_context_add_group (tmp_ctx, a_group);
#endif
/* Adds paned option entries */
a_group = g_option_group_new ("paned", _("Paned dialog options"), _("Show paned dialog options"), NULL, NULL);
......
......@@ -68,7 +68,9 @@ typedef enum {
YAD_MODE_LIST,
YAD_MODE_MULTI_PROGRESS,
YAD_MODE_NOTEBOOK,
#ifdef HAVE_TRAY
YAD_MODE_NOTIFICATION,
#endif
YAD_MODE_PANED,
YAD_MODE_PICTURE,
YAD_MODE_PRINT,
......@@ -365,11 +367,13 @@ typedef struct {
gboolean expand;
} YadNotebookData;
#ifdef HAVE_TRAY
typedef struct {
gboolean middle;
gboolean hidden;
gchar *menu;
} YadNotificationData;
#endif
typedef struct {
GtkOrientation orient;
......@@ -484,7 +488,9 @@ typedef struct {
YadListData list_data;
YadMultiProgressData multi_progress_data;
YadNotebookData notebook_data;
#ifdef HAVE_TRAY
YadNotificationData notification_data;
#endif
YadPanedData paned_data;
YadPictureData picture_data;
YadPrintData print_data;
......@@ -592,7 +598,9 @@ void text_print_result (void);
void dnd_init (GtkWidget *w);
#ifdef HAVE_TRAY
gint yad_notification_run (void);
#endif
gint yad_print_run (void);
gint yad_about (void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment