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 (`-').
.SS Dialog options
.TP
.B \-\-app
Display application selection dialog.
.TP
.B \-\-calendar
Display calendar dialog.
.TP
......@@ -243,6 +246,19 @@ Set the output type of boolean values to \fITYPE\fP. Possible types are \fIT\fP,
.br
\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
.TP
.B \-\-day=\fINUMBER\fP
......@@ -683,30 +699,6 @@ Sending FormFeed character to list clears it. This symbol may be sent as \fIecho
.B \-\-simple-tips
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
.TP
.B \-\-key=\fIKEY\fP
......@@ -841,19 +833,26 @@ Set the height of log window.
.SS Multiprogress options
.TP
.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
.B \-\-watch-bar=\fINUMBER\fP
Watch for specific bar for auto closing.
.B \-\-vertical
Set vertical orientation of progress bars.
.TP
.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
.B \-\-auto-close
Dismiss the dialog when 100% of all bars (or only watching bar) has been reached.
.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 was pressed.
.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 Text info options
.TP
......
src/about.c
src/app.c
src/calendar.c
src/entry.c
src/file.c
......
AM_CPPFLAGS = \
-DLOCALEDIR=\""$(datadir)/locale"\"
AM_CPPFLAGS = -DLOCALEDIR=\""$(datadir)/locale"\"
bin_PROGRAMS = yad
yad_SOURCES = \
yad_SOURCES = \
about.c \
app.c \
calendar.c \
color.c \
dnd.c \
dnd.c \
entry.c \
file.c \
font.c \
......
......@@ -205,6 +205,9 @@ create_layout (GtkWidget *dlg)
/* create main widget */
switch (options.mode)
{
case YAD_MODE_APP:
mw = app_create_widget (dlg);
break;
case YAD_MODE_CALENDAR:
mw = calendar_create_widget (dlg);
break;
......@@ -609,6 +612,9 @@ yad_print_result (void)
{
switch (options.mode)
{
case YAD_MODE_APP:
app_print_result ();
break;
case YAD_MODE_CALENDAR:
calendar_print_result ();
break;
......@@ -666,7 +672,7 @@ main (gint argc, gchar ** argv)
g_set_application_name ("YAD");
settings = g_settings_new ("yad.settings");
yad_icon_theme = gtk_icon_theme_get_default ();
yad_options_init ();
......
......@@ -66,6 +66,7 @@ static gboolean langs_mode = FALSE;
#ifdef HAVE_SOURCEVIEW
static gboolean themes_mode = FALSE;
#endif
static gboolean app_mode = FALSE;
static gboolean calendar_mode = FALSE;
static gboolean color_mode = FALSE;
static gboolean dnd_mode = FALSE;
......@@ -231,6 +232,19 @@ static GOptionEntry common_options[] = {
{ 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[] = {
{ "calendar", 0, G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &calendar_mode,
N_("Display calendar dialog"), NULL },
......@@ -1365,7 +1379,9 @@ parse_signal (const gchar * option_name, const gchar * value, gpointer data, GEr
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;
else if (color_mode)
options.mode = YAD_MODE_COLOR;
......@@ -1516,6 +1532,12 @@ yad_options_init (void)
options.common_data.spell_lang = NULL;
#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 */
options.calendar_data.day = -1;
options.calendar_data.month = -1;
......@@ -1714,6 +1736,12 @@ yad_create_context (void)
g_option_group_set_translation_domain (a_group, GETTEXT_PACKAGE);
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 */
a_group = g_option_group_new ("calendar", _("Calendar options"), _("Show calendar options"), NULL, NULL);
g_option_group_add_entries (a_group, calendar_options);
......
......@@ -32,6 +32,7 @@
#include <gdk/gdkkeysyms.h>
#include <glib/gi18n.h>
#include <glib/gprintf.h>
#ifdef HAVE_SPELL
#include <gspell/gspell.h>
......@@ -52,6 +53,7 @@ G_BEGIN_DECLS
typedef enum {
YAD_MODE_MESSAGE,
YAD_MODE_APP,
YAD_MODE_CALENDAR,
YAD_MODE_COLOR,
YAD_MODE_DND,
......@@ -239,6 +241,13 @@ typedef struct {
} YadData;
typedef struct {
gboolean show_fallback;
gboolean show_other;
gboolean show_all;
gboolean extended;
} YadAppData;
typedef struct {
gint day;
gint month;
gint year;
......@@ -473,6 +482,7 @@ typedef struct {
YadData data;
YadCommonData common_data;
YadAppData app_data;
YadCalendarData calendar_data;
YadColorData color_data;
YadDNDData dnd_data;
......@@ -555,6 +565,7 @@ void yad_set_mode (void);
void yad_print_result (void);
void yad_exit (gint id);
GtkWidget *app_create_widget (GtkWidget *dlg);
GtkWidget *calendar_create_widget (GtkWidget *dlg);
GtkWidget *color_create_widget (GtkWidget *dlg);
GtkWidget *entry_create_widget (GtkWidget *dlg);
......@@ -579,6 +590,7 @@ void notebook_swallow_childs (void);
void paned_swallow_childs (void);
void picture_fit_to_window (void);
void app_print_result (void);
void calendar_print_result (void);
void color_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