Commit d161764b authored by Victor Ananjevsky's avatar Victor Ananjevsky

same as previous commit

parent 9952fd53
...@@ -20,6 +20,9 @@ options starting with two dashes (`-'). ...@@ -20,6 +20,9 @@ options starting with two dashes (`-').
.SS Dialog options .SS Dialog options
.TP .TP
.B \-\-app
Display application selection dialog.
.TP
.B \-\-calendar .B \-\-calendar
Display calendar dialog. Display calendar dialog.
.TP .TP
...@@ -243,6 +246,19 @@ Set the output type of boolean values to \fITYPE\fP. Possible types are \fIT\fP, ...@@ -243,6 +246,19 @@ Set the output type of boolean values to \fITYPE\fP. Possible types are \fIT\fP,
.br .br
\fI1\fP - for \fI1/0\fP pair. \fI1\fP - for \fI1/0\fP pair.
.SS Application selection options
.TP
.B \-\-enable-fallback
Show fallback applications.
.B \-\-enable-other
Show other applications.
.B \-\-enable-all
Show all available applications.
.B \-\-extened
Shown extended information about choosen application. By default only executable is shown. In extended form the output fields are name, display name, description, icon and executable.
Additional argument for application dialog is a mime-type. If mime-type is not specified \fItext/plain\fP will be used.
.SS Calendar options .SS Calendar options
.TP .TP
.B \-\-day=\fINUMBER\fP .B \-\-day=\fINUMBER\fP
...@@ -683,30 +699,6 @@ Sending FormFeed character to list clears it. This symbol may be sent as \fIecho ...@@ -683,30 +699,6 @@ Sending FormFeed character to list clears it. This symbol may be sent as \fIecho
.B \-\-simple-tips .B \-\-simple-tips
Don't use markup in tooltips even if text has a valid markup. Don't use markup in tooltips even if text has a valid markup.
.SS Multi progress bars dialog options
.TP
.B \-\-bar=\fILABEL[:TYPE]\fP
Add progress bar. \fILABEL\fP is a text label for progress bar. \fITYPE\fP is a progress bar type.
Types are: \fINORM\fP for normal progress bar, \fIRTL\fP for inverted progress bar and \fIPULSE\fP for pulsate progress bar.
.TP
.B \-\-vertical
Set vertical orientation of progress bars.
.TP
.B \-\-align=\fITYPE\fP
Set alignment of bar labels. Possible types are \fIleft\fP, \fIcenter\fP or \fIright\fP. Default is left.
.TP
.B \-\-auto\-close
Close dialog when 100% has been reached for all of non-pulsating progress bars.
.TP
.B \-\-watch-bar\fINUMBER\fP
Watch for 100% of bar \fINUMBER\fP for close dialog.
.TP
.B \-\-auto\-kill
Kill parent process if cancel button is pressed.
.PP
Initial values for bars set as an extra arguments. Each lines with progress data passed to stdin must be started
from \fIN:\fP where \fIN\fP is a number of progress bar.
.SS Notebook options .SS Notebook options
.TP .TP
.B \-\-key=\fIKEY\fP .B \-\-key=\fIKEY\fP
...@@ -841,19 +833,26 @@ Set the height of log window. ...@@ -841,19 +833,26 @@ Set the height of log window.
.SS Multiprogress options .SS Multiprogress options
.TP .TP
.B \-\-bar=\fILABEL[:TYPE]\fP .B \-\-bar=\fILABEL[:TYPE]\fP
Add the progress bar with type \fITYPE\fp. \fITYPE\fP can be one of the \fInorm\fP for average progress bar, \fIrtl\fP for progress bar with inverted direction, \fIpulse\fP for pulsating progress bar (m,oves on receiving data) or \fIperm\fP for permanent pulsatin progress bar. \fIprem\fP progress bar understant two commands - \fIstart\fP for start movement and \fIstop\fP for stop it. Add progress bar. \fILABEL\fP is a text label for progress bar. \fITYPE\fP is a progress bar type.
Types are: \fINORM\fP for normal progress bar, \fIRTL\fP for inverted progress bar and \fIPULSE\fP for pulsate progress bar.
.TP .TP
.B \-\-watch-bar=\fINUMBER\fP .B \-\-vertical
Watch for specific bar for auto closing. Set vertical orientation of progress bars.
.TP .TP
.B \-\-align=\fITYPE\fP .B \-\-align=\fITYPE\fP
Set alignment of bar labels. \fITYPE\fP can be \fIleft\fP, \fIcenter\fP or \fIright\fP. Set alignment of bar labels. Possible types are \fIleft\fP, \fIcenter\fP or \fIright\fP. Default is left.
.TP .TP
.B \-\-auto-close .B \-\-auto\-close
Dismiss the dialog when 100% of all bars (or only watching bar) has been reached. Close dialog when 100% has been reached for all of non-pulsating progress bars.
.TP
.B \-\-watch-bar\fINUMBER\fP
Watch for 100% of bar \fINUMBER\fP for close dialog.
.TP .TP
.B \-\-auto-kill .B \-\-auto\-kill
Kill parent process if cancel button was pressed. Kill parent process if cancel button is pressed.
.PP
Initial values for bars set as an extra arguments. Each lines with progress data passed to stdin must be started
from \fIN:\fP where \fIN\fP is a number of progress bar.
.SS Text info options .SS Text info options
.TP .TP
......
src/about.c src/about.c
src/app.c
src/calendar.c src/calendar.c
src/entry.c src/entry.c
src/file.c src/file.c
......
AM_CPPFLAGS = \ AM_CPPFLAGS = -DLOCALEDIR=\""$(datadir)/locale"\"
-DLOCALEDIR=\""$(datadir)/locale"\"
bin_PROGRAMS = yad bin_PROGRAMS = yad
yad_SOURCES = \ yad_SOURCES = \
about.c \ about.c \
app.c \
calendar.c \ calendar.c \
color.c \ color.c \
dnd.c \ dnd.c \
entry.c \ entry.c \
file.c \ file.c \
font.c \ font.c \
......
...@@ -205,6 +205,9 @@ create_layout (GtkWidget *dlg) ...@@ -205,6 +205,9 @@ create_layout (GtkWidget *dlg)
/* create main widget */ /* create main widget */
switch (options.mode) switch (options.mode)
{ {
case YAD_MODE_APP:
mw = app_create_widget (dlg);
break;
case YAD_MODE_CALENDAR: case YAD_MODE_CALENDAR:
mw = calendar_create_widget (dlg); mw = calendar_create_widget (dlg);
break; break;
...@@ -609,6 +612,9 @@ yad_print_result (void) ...@@ -609,6 +612,9 @@ yad_print_result (void)
{ {
switch (options.mode) switch (options.mode)
{ {
case YAD_MODE_APP:
app_print_result ();
break;
case YAD_MODE_CALENDAR: case YAD_MODE_CALENDAR:
calendar_print_result (); calendar_print_result ();
break; break;
...@@ -666,7 +672,7 @@ main (gint argc, gchar ** argv) ...@@ -666,7 +672,7 @@ main (gint argc, gchar ** argv)
g_set_application_name ("YAD"); g_set_application_name ("YAD");
settings = g_settings_new ("yad.settings"); settings = g_settings_new ("yad.settings");
yad_icon_theme = gtk_icon_theme_get_default (); yad_icon_theme = gtk_icon_theme_get_default ();
yad_options_init (); yad_options_init ();
......
...@@ -66,6 +66,7 @@ static gboolean langs_mode = FALSE; ...@@ -66,6 +66,7 @@ static gboolean langs_mode = FALSE;
#ifdef HAVE_SOURCEVIEW #ifdef HAVE_SOURCEVIEW
static gboolean themes_mode = FALSE; static gboolean themes_mode = FALSE;
#endif #endif
static gboolean app_mode = FALSE;
static gboolean calendar_mode = FALSE; static gboolean calendar_mode = FALSE;
static gboolean color_mode = FALSE; static gboolean color_mode = FALSE;
static gboolean dnd_mode = FALSE; static gboolean dnd_mode = FALSE;
...@@ -231,6 +232,19 @@ static GOptionEntry common_options[] = { ...@@ -231,6 +232,19 @@ static GOptionEntry common_options[] = {
{ NULL } { NULL }
}; };
static GOptionEntry app_options[] = {
{ "app", 0, G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &app_mode,
N_("Display application selection dialog"), NULL },
{ "enable-fallback", 0, 0, G_OPTION_ARG_NONE, &options.app_data.show_fallback,
N_("Show fallback applications"), NULL },
{ "enable-other", 0, 0, G_OPTION_ARG_NONE, &options.app_data.show_other,
N_("Show other applications"), NULL },
{ "enable-all", 0, 0, G_OPTION_ARG_NONE, &options.app_data.show_all,
N_("Show all applications"), NULL },
{ "extended", 0, 0, G_OPTION_ARG_NONE, &options.app_data.extended,
N_("Output all application data"), NULL },
};
static GOptionEntry calendar_options[] = { static GOptionEntry calendar_options[] = {
{ "calendar", 0, G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &calendar_mode, { "calendar", 0, G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &calendar_mode,
N_("Display calendar dialog"), NULL }, N_("Display calendar dialog"), NULL },
...@@ -1365,7 +1379,9 @@ parse_signal (const gchar * option_name, const gchar * value, gpointer data, GEr ...@@ -1365,7 +1379,9 @@ parse_signal (const gchar * option_name, const gchar * value, gpointer data, GEr
void void
yad_set_mode (void) yad_set_mode (void)
{ {
if (calendar_mode) if (app_mode)
options.mode = YAD_MODE_APP;
else if (calendar_mode)
options.mode = YAD_MODE_CALENDAR; options.mode = YAD_MODE_CALENDAR;
else if (color_mode) else if (color_mode)
options.mode = YAD_MODE_COLOR; options.mode = YAD_MODE_COLOR;
...@@ -1516,6 +1532,12 @@ yad_options_init (void) ...@@ -1516,6 +1532,12 @@ yad_options_init (void)
options.common_data.spell_lang = NULL; options.common_data.spell_lang = NULL;
#endif #endif
/* Initialize application data */
options.app_data.show_fallback = FALSE;
options.app_data.show_other = FALSE;
options.app_data.show_all = FALSE;
options.app_data.extended = FALSE;
/* Initialize calendar data */ /* Initialize calendar data */
options.calendar_data.day = -1; options.calendar_data.day = -1;
options.calendar_data.month = -1; options.calendar_data.month = -1;
...@@ -1714,6 +1736,12 @@ yad_create_context (void) ...@@ -1714,6 +1736,12 @@ yad_create_context (void)
g_option_group_set_translation_domain (a_group, GETTEXT_PACKAGE); g_option_group_set_translation_domain (a_group, GETTEXT_PACKAGE);
g_option_context_add_group (tmp_ctx, a_group); g_option_context_add_group (tmp_ctx, a_group);
/* Adds app option entries */
a_group = g_option_group_new ("app", _("Application selection options"), _("Show application selection options"), NULL, NULL);
g_option_group_add_entries (a_group, app_options);
g_option_group_set_translation_domain (a_group, GETTEXT_PACKAGE);
g_option_context_add_group (tmp_ctx, a_group);
/* Adds calendar option entries */ /* Adds calendar option entries */
a_group = g_option_group_new ("calendar", _("Calendar options"), _("Show calendar options"), NULL, NULL); a_group = g_option_group_new ("calendar", _("Calendar options"), _("Show calendar options"), NULL, NULL);
g_option_group_add_entries (a_group, calendar_options); g_option_group_add_entries (a_group, calendar_options);
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <glib/gprintf.h>
#ifdef HAVE_SPELL #ifdef HAVE_SPELL
#include <gspell/gspell.h> #include <gspell/gspell.h>
...@@ -52,6 +53,7 @@ G_BEGIN_DECLS ...@@ -52,6 +53,7 @@ G_BEGIN_DECLS
typedef enum { typedef enum {
YAD_MODE_MESSAGE, YAD_MODE_MESSAGE,
YAD_MODE_APP,
YAD_MODE_CALENDAR, YAD_MODE_CALENDAR,
YAD_MODE_COLOR, YAD_MODE_COLOR,
YAD_MODE_DND, YAD_MODE_DND,
...@@ -239,6 +241,13 @@ typedef struct { ...@@ -239,6 +241,13 @@ typedef struct {
} YadData; } YadData;
typedef struct { typedef struct {
gboolean show_fallback;
gboolean show_other;
gboolean show_all;
gboolean extended;
} YadAppData;
typedef struct {
gint day; gint day;
gint month; gint month;
gint year; gint year;
...@@ -473,6 +482,7 @@ typedef struct { ...@@ -473,6 +482,7 @@ typedef struct {
YadData data; YadData data;
YadCommonData common_data; YadCommonData common_data;
YadAppData app_data;
YadCalendarData calendar_data; YadCalendarData calendar_data;
YadColorData color_data; YadColorData color_data;
YadDNDData dnd_data; YadDNDData dnd_data;
...@@ -555,6 +565,7 @@ void yad_set_mode (void); ...@@ -555,6 +565,7 @@ void yad_set_mode (void);
void yad_print_result (void); void yad_print_result (void);
void yad_exit (gint id); void yad_exit (gint id);
GtkWidget *app_create_widget (GtkWidget *dlg);
GtkWidget *calendar_create_widget (GtkWidget *dlg); GtkWidget *calendar_create_widget (GtkWidget *dlg);
GtkWidget *color_create_widget (GtkWidget *dlg); GtkWidget *color_create_widget (GtkWidget *dlg);
GtkWidget *entry_create_widget (GtkWidget *dlg); GtkWidget *entry_create_widget (GtkWidget *dlg);
...@@ -579,6 +590,7 @@ void notebook_swallow_childs (void); ...@@ -579,6 +590,7 @@ void notebook_swallow_childs (void);
void paned_swallow_childs (void); void paned_swallow_childs (void);
void picture_fit_to_window (void); void picture_fit_to_window (void);
void app_print_result (void);
void calendar_print_result (void); void calendar_print_result (void);
void color_print_result (void); void color_print_result (void);
void entry_print_result (void); void entry_print_result (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