Commit 6686e709 authored by Pat Brands's avatar Pat Brands

Merge branch 'master' into constrain-scale-to-steps

parents 87bc1e94 a5b1a7a3
Version 6.0
- add --use-interp option. this feature can reduce quoting in command arguments
- add link field to --form dialog
- returning customizable options for --text-info dialog
- fix yad behavior outside X11 (spetial thanks to Michael Weiser)
- improve dialog window placement
- update translations
Version 5.0
- add debug mode. this feature can be turned on through gsettings.
in this mode yad will warn about obsolete or nonexistent options
- add configure option --enable-standalone for build yad without gsettings support
- fix expanding tree nodes for stdin data
- some fixes in print dialog
- fix --uri-handler option in html dialog
- fix wrong autoclose behavior in progress dialog
Version 4.1
- fix handling tree data from stdin in list dialog
Version 4.0
- font can be selected with double-click in font dialog
- add application chooser dialog and application chooser field in form dialog
- add tree mode in list dialog
- multi-progress dialog features merged with progress dialog. separate multi-progres dialog no longer exists
- enable markup in progress log window
- fix output of color values in hex notation
- removed *-selection aliases for --file, --color and --font dialogs
Version 3.0 Version 3.0
- add user defined handlers for all editing actions in list dialog. --add-action parameter renamed to --row-action - add user defined handlers for all editing actions in list dialog. --add-action parameter renamed to --row-action
- fix loading text from file in text-info dialog - fix loading text from file in text-info dialog
......
...@@ -6,13 +6,15 @@ shell scripts. YAD depends on GTK+ only. Minimal GTK+ version is 3.22.0 ...@@ -6,13 +6,15 @@ shell scripts. YAD depends on GTK+ only. Minimal GTK+ version is 3.22.0
This software is licensed under the GPL v.3 This software is licensed under the GPL v.3
Project homepage: https://sourceforge.net/projects/yad-dialog/ Project homepage: https://github.com/v1cont/yad
Example usage: https://sourceforge.net/p/yad-dialog/wiki/browse_pages/ Complex examples: https://sanana.kiev.ua/index.php/yad
Mailing list: http://groups.google.com/group/yad-common Mailing list: http://groups.google.com/group/yad-common
Some miscellaneous stuff can be found in data directory including notify-send script Some miscellaneous stuff can be found in data directory including notify-send script
and simple zenity-compatible wrapper and simple zenity-compatible wrapper
A fresh gtk2 branch of YAD can be obtained from this repository - https://github.com/step-/yad
Building git version Building git version
---------------------- ----------------------
...@@ -37,3 +39,16 @@ Additionally, you can build yad with the following libraries: ...@@ -37,3 +39,16 @@ Additionally, you can build yad with the following libraries:
* Webkit - for supporting HTML dialog (http://webkitgtk.org) * Webkit - for supporting HTML dialog (http://webkitgtk.org)
* GtkSourceView - for enabling syntax highlighting in text-info dialog (https://wiki.gnome.org/Projects/GtkSourceView) * GtkSourceView - for enabling syntax highlighting in text-info dialog (https://wiki.gnome.org/Projects/GtkSourceView)
* GSpell - for support spell checking in text fields (https://wiki.gnome.org/Projects/gspell) * GSpell - for support spell checking in text fields (https://wiki.gnome.org/Projects/gspell)
In standalone build (configure option --enable-standalone) some defaults can be redefined with the following defines
BORDERS - set the default border width around dialog. Default is 5
REMAIN - if defined, timeout indicator will show the remaining time
COMBO_EDIT - if defined, combo-box in entry dialog will be always editable
TERM_CMD - string with terminal command. Default is "xterm -e '%s'"
OPEN_CMD - string with open command. Default is "xdg-open '%s'"
DATE_FMT - string with date output format. Default is "%x". See strftime(3) for details
URI_COLOR - color for URIs in text-info dialog. Default is blue
MAX_TABS - set the number of tabs for tabbed dialog. Default is 100
Defines can be added througs CFLAGS environment variable
AC_INIT([YAD], [3.0], [https://github.com/v1cont/yad/issues/], yad, [https://github.com/v1cont/yad/]) AC_INIT([YAD], [6.0], [https://github.com/v1cont/yad/issues/], yad, [https://github.com/v1cont/yad/])
AC_CONFIG_AUX_DIR([build]) AC_CONFIG_AUX_DIR([build])
AM_INIT_AUTOMAKE([1.11 foreign dist-xz no-dist-gzip]) AM_INIT_AUTOMAKE([1.11 foreign dist-xz no-dist-gzip])
...@@ -89,6 +89,16 @@ if test x$have_sourceview = xyes; then ...@@ -89,6 +89,16 @@ if test x$have_sourceview = xyes; then
AC_DEFINE([HAVE_SOURCEVIEW], [1], [Define this if you need GtkSourceView support]) AC_DEFINE([HAVE_SOURCEVIEW], [1], [Define this if you need GtkSourceView support])
fi fi
dnl icon browser
AC_ARG_ENABLE([standalone],
[AS_HELP_STRING([--enable-standalone],
[Build standalone YAD binary (wihtout gsettings)])],
[build_sa=$enableval], [build_sa=no])
AM_CONDITIONAL([STANDALONE], [test x$build_sa = xyes])
if test x$build_sa = xyes; then
AC_DEFINE([STANDALONE], [1], [Define this if you need standalone YAD binary])
fi
dnl pfd dnl pfd
AC_ARG_ENABLE([pfd], AC_ARG_ENABLE([pfd],
[AS_HELP_STRING([--enable-pfd], [AS_HELP_STRING([--enable-pfd],
...@@ -156,6 +166,7 @@ echo " HTML widget - $have_html" ...@@ -156,6 +166,7 @@ echo " HTML widget - $have_html"
echo " GtkSourceView - $have_sourceview" echo " GtkSourceView - $have_sourceview"
echo " Spell checking - $have_spell" echo " Spell checking - $have_spell"
echo " Path to rgb.txt - $with_rgb" echo " Path to rgb.txt - $with_rgb"
echo " Standalone build - $build_sa"
echo " pfd - $build_pfd" echo " pfd - $build_pfd"
echo " Icon browser - $build_ib" echo " Icon browser - $build_ib"
echo echo
...@@ -164,7 +164,11 @@ Don't close dialog if \fIEscape\fP was pressed. ...@@ -164,7 +164,11 @@ Don't close dialog if \fIEscape\fP was pressed.
\fIEscape\fP acts like pressing \fIOK\fP button. \fIEscape\fP acts like pressing \fIOK\fP button.
.TP .TP
.B \-\-always-print-result .B \-\-always-print-result
Print result for any of the return codes. This options doesn't work if timeout was reached or \fIEscape\fP was pressed. Print result for any of the return codes. This option doesn't work if timeout was reached or \fIEscape\fP was pressed.
.TP
.B \-\-use-interp=\fI[INTERP]\fP
All commands runs unter specified interpreter. Default is \fIbash -c '%s'\fP. This option can reduse quoting in commands. If \fI%s\fP is specified, it will be replaced by the command.
Otherwise command will be appended to the end of command line.
.TP .TP
.B \-\-borders=\fINUM\fP .B \-\-borders=\fINUM\fP
Set dialog window borders. Set dialog window borders.
...@@ -494,6 +498,8 @@ A quoting style for value when \fIsh -c\fP is used \- a single quotes around com ...@@ -494,6 +498,8 @@ A quoting style for value when \fIsh -c\fP is used \- a single quotes around com
.br .br
\fBFBTN\fP - same as button field, but with full relief of a button. \fBFBTN\fP - same as button field, but with full relief of a button.
.br .br
\fBLINK\fP - link button field.
.br
\fBLBL\fP - text label. If field name is empty, horizontal separator line will be shown. \fBLBL\fP - text label. If field name is empty, horizontal separator line will be shown.
.br .br
\fBTXT\fP - multiline text entry. This field is always occupy all of form width. \fBTXT\fP - multiline text entry. This field is always occupy all of form width.
...@@ -585,6 +591,9 @@ Size of icons may be set in gtk config file at GTK_ICON_SIZE_MENU position of gt ...@@ -585,6 +591,9 @@ Size of icons may be set in gtk config file at GTK_ICON_SIZE_MENU position of gt
Special column names \fI@fore@\fP, \fI@back@\fP and \fI@font@\fP sets corresponding rows attributes. Special column names \fI@fore@\fP, \fI@back@\fP and \fI@font@\fP sets corresponding rows attributes.
Values of those columns don't show in results. Values of those columns don't show in results.
.TP .TP
.B \-\-tree
Enbale tree mode. In this mode extra data in form \fIROW_ID[:PARENT_ID]\fP must be passed to yad before each row. See \fBEXAMPLES\fP for details.
.TP
.B \-\-checklist .B \-\-checklist
Use check boxes for the first column. Output checked rows instead of selected rows. Disable multiple selection. Use check boxes for the first column. Output checked rows instead of selected rows. Disable multiple selection.
.TP .TP
...@@ -674,6 +683,9 @@ This option doesn't work with \fI--multiple\fP. ...@@ -674,6 +683,9 @@ This option doesn't work with \fI--multiple\fP.
Set the \fICMD\fP as a action when the row is added, modified or removed. First argument for the command is the name of action (\fIadd\fP, \fIedit\fP or \fIdel\fP). Set the \fICMD\fP as a action when the row is added, modified or removed. First argument for the command is the name of action (\fIadd\fP, \fIedit\fP or \fIdel\fP).
The rest of command line is data from selected row. Output of this command sets the new row values. The rest of command line is data from selected row. Output of this command sets the new row values.
.TP .TP
.B \-\-tree-expanded
Expand all tree nodes at startup.
.TP
.B \-\-regex-search .B \-\-regex-search
Use regular expressions in search for text fields. Use regular expressions in search for text fields.
.TP .TP
...@@ -875,7 +887,13 @@ Show cursor in read-only mode. ...@@ -875,7 +887,13 @@ Show cursor in read-only mode.
.B \-\-show-uri .B \-\-show-uri
Make links in text clickable. Links opens with \fIxdg-open\fP command. Make links in text clickable. Links opens with \fIxdg-open\fP command.
.TP .TP
.B \-\-uri-color .B \-\-fore=\fICOLOR\fP
Set default color for text.
.TP
.B \-\-back=\fICOLOR\fP
Set default color for background.
.TP
.B \-\-uri-color=\fICOLOR\fP
Set color for links. Default is \fIblue\fP. Set color for links. Default is \fIblue\fP.
.TP .TP
.B \-\-lang=LANGUAGE .B \-\-lang=LANGUAGE
...@@ -887,6 +905,7 @@ Set used theme to \fITHEME\fP. This option works only if yad builds with gtksour ...@@ -887,6 +905,7 @@ Set used theme to \fITHEME\fP. This option works only if yad builds with gtksour
.B \-\-listen .B \-\-listen
Listen data from stdin even if filename was specified. Listen data from stdin even if filename was specified.
If \fIfontname\fP option is specified for text dialog, the description of font must be in CSS style (not in a Pango style).
Sending FormFeed character to text dialog clears it. This symbol may be sent as \fIecho \-e '\\f'\fP. Sending FormFeed character to text dialog clears it. This symbol may be sent as \fIecho \-e '\\f'\fP.
Pressing \fICtrl+S\fP popups the search entry in text dialog. Pressing \fICtrl+S\fP popups the search entry in text dialog.
...@@ -1111,6 +1130,7 @@ yad-form-spin@GtkSpinButton@Numeric entry field in form ...@@ -1111,6 +1130,7 @@ yad-form-spin@GtkSpinButton@Numeric entry field in form
yad-form-check@GtkCheckButton@Checkbox field in form yad-form-check@GtkCheckButton@Checkbox field in form
yad-form-combo@GtkComboBox@Combo field in form yad-form-combo@GtkComboBox@Combo field in form
yad-form-edit-combo@GtkComboBoxEntry@Editable combo field in form yad-form-edit-combo@GtkComboBoxEntry@Editable combo field in form
yad-form-link@GtkLinkButton@Link field in form
yad-form-file@GtkFileChooserButton@File or directory field in form yad-form-file@GtkFileChooserButton@File or directory field in form
yad-form-font@GtkFontChooserButton@Font field in form yad-form-font@GtkFontChooserButton@Font field in form
yad-form-app@GtkAppChooserButton@Application field in form yad-form-app@GtkAppChooserButton@Application field in form
...@@ -1175,6 +1195,10 @@ find $HOME \-name '*.ps' | yad \-\-progress \-\-pulsate ...@@ -1175,6 +1195,10 @@ find $HOME \-name '*.ps' | yad \-\-progress \-\-pulsate
Display a box with all of the installed desktop applications Display a box with all of the installed desktop applications
.IP .IP
yad \-\-icons \-\-read-dir=/usr/share/applications yad \-\-icons \-\-read-dir=/usr/share/applications
.PP
Display list in tree mode
.IP
yad --list --tree --column "Items" f Fruits 1:f Apple 2:f Lemon v Vegetables 3:v Popato 4:v Onion
.SH DEVELOPMENT .SH DEVELOPMENT
There are some developers features providing with YAD. There are some developers features providing with YAD.
......
...@@ -36,13 +36,17 @@ ...@@ -36,13 +36,17 @@
<default>'blue'</default> <default>'blue'</default>
<_summary>Default color for URI in text-info dialog</_summary> <_summary>Default color for URI in text-info dialog</_summary>
</key> </key>
<key name="max-tab" type="i">
<default>100</default>
<_summary>Maximum number of tabs in notebook dialog</_summary>
</key>
<key name="ignore-unknown-options" type="b"> <key name="ignore-unknown-options" type="b">
<default>true</default> <default>true</default>
<_summary>Ignore unknown command-line options</_summary> <_summary>Ignore unknown command-line options</_summary>
</key> </key>
<key name="max-tab" type="i"> <key name="debug" type="b">
<default>100</default> <default>false</default>
<_summary>Maximum number of tabs in notebook dialog</_summary> <_summary>Enable debug mode with information about deprecated features</_summary>
</key> </key>
</schema> </schema>
</schemalist> </schemalist>
......
...@@ -1347,4 +1347,4 @@ msgstr "Explorador de Iconos" ...@@ -1347,4 +1347,4 @@ msgstr "Explorador de Iconos"
#: ../data/yad-icon-browser.desktop.in.h:2 #: ../data/yad-icon-browser.desktop.in.h:2
msgid "Inspect GTK Icon Theme" msgid "Inspect GTK Icon Theme"
msgstr "Incpeccionar tema de íconos GTK" msgstr "Inspeccionar tema de íconos GTK"
...@@ -21,7 +21,8 @@ msgstr "" ...@@ -21,7 +21,8 @@ msgstr ""
msgid "translator-credits" msgid "translator-credits"
msgstr "" msgstr ""
"Gustavo Soares de Lima <gustavo@logicus.com.br>\n" "Gustavo Soares de Lima <gustavo@logicus.com.br>\n"
"Angela Fernanda Ferreira <angela@logicus.com.br" "Angela Fernanda Ferreira <angela@logicus.com.br\n"
"Tulio Calil <tuliocll@gmail.com>"
#: ../src/about.c:32 #: ../src/about.c:32
msgid "" msgid ""
...@@ -1656,11 +1657,11 @@ msgstr "embutido" ...@@ -1656,11 +1657,11 @@ msgstr "embutido"
#. initialize GTK+ and parse the command line arguments #. initialize GTK+ and parse the command line arguments
#: ../src/browser.c:200 #: ../src/browser.c:200
msgid "- Icon browser" msgid "- Icon browser"
msgstr "Ícone do navegador" msgstr "Navegador de ícones"
#: ../src/browser.c:213 #: ../src/browser.c:213
msgid "Icon browser" msgid "Icon browser"
msgstr "Ícone do navegador" msgstr "Navegador de ícones"
#: ../src/browser.c:247 #: ../src/browser.c:247
msgid "<b>Name:</b>" msgid "<b>Name:</b>"
...@@ -1684,7 +1685,7 @@ msgstr "Ícones" ...@@ -1684,7 +1685,7 @@ msgstr "Ícones"
#: ../data/yad-icon-browser.desktop.in.h:1 #: ../data/yad-icon-browser.desktop.in.h:1
msgid "Icon Browser" msgid "Icon Browser"
msgstr "Ícone do navegador" msgstr "Navegador de ícones"
#: ../data/yad-icon-browser.desktop.in.h:2 #: ../data/yad-icon-browser.desktop.in.h:2
msgid "Inspect GTK Icon Theme" msgid "Inspect GTK Icon Theme"
......
...@@ -35,6 +35,10 @@ if HTML ...@@ -35,6 +35,10 @@ if HTML
yad_SOURCES += html.c yad_SOURCES += html.c
endif endif
if STANDALONE
yad_SOURCES += defaults.h
endif
yad_CFLAGS = $(GTK_CFLAGS) $(HTML_CFLAGS) $(SPELL_CFLAGS) $(SOURCEVIEW_CFLAGS) yad_CFLAGS = $(GTK_CFLAGS) $(HTML_CFLAGS) $(SPELL_CFLAGS) $(SOURCEVIEW_CFLAGS)
yad_LDADD = $(GTK_LIBS) $(HTML_LIBS) $(SPELL_LIBS) $(SOURCEVIEW_LIBS) yad_LDADD = $(GTK_LIBS) $(HTML_LIBS) $(SPELL_LIBS) $(SOURCEVIEW_LIBS)
......
#ifndef __YAD_DEFS_H__
#define __YAD_DEFS_H__
#ifndef BORDERS
#define BORDERS 5
#endif
#ifndef REMAIN
#define SHOW_REMAIN FALSE
#else
#define SHOW_REMAIN TRUE
#endif
#ifndef COMBO_EDIT
#define COMBO_ALWAYS_EDIT FALSE
#else
#define COMBO_ALWAYS_EDIT TRUE
#endif
#ifndef TERM_CMD
#define TERM_CMD "xterm -e '%s'"
#endif
#ifndef OPEN_CMD
#define OPEN_CMD "xdg-open '%s'"
#endif
#ifndef DATE_FMT
#define DATE_FMT "%x"
#endif
#ifndef URI_COLOR
#define URI_COLOR "blue"
#endif
#ifndef MAX_TABS
#define MAX_TABS 100
#endif
#endif /* __YAD_DEFS_H__ */
...@@ -48,7 +48,7 @@ drop_data_cb (GtkWidget * w, GdkDragContext * dc, gint x, gint y, ...@@ -48,7 +48,7 @@ drop_data_cb (GtkWidget * w, GdkDragContext * dc, gint x, gint y,
action = g_strdup_printf (options.common_data.command, dstr); action = g_strdup_printf (options.common_data.command, dstr);
else else
action = g_strdup_printf ("%s '%s'", options.common_data.command, dstr); action = g_strdup_printf ("%s '%s'", options.common_data.command, dstr);
g_spawn_command_line_async (action, NULL); run_command_async (action);
g_free (action); g_free (action);
} }
else else
...@@ -77,7 +77,8 @@ drop_data_cb (GtkWidget * w, GdkDragContext * dc, gint x, gint y, ...@@ -77,7 +77,8 @@ drop_data_cb (GtkWidget * w, GdkDragContext * dc, gint x, gint y,
else else
action = g_strdup_printf ("%s %s", options.common_data.command, arg); action = g_strdup_printf ("%s %s", options.common_data.command, arg);
g_free (arg); g_free (arg);
g_spawn_command_line_async (action, NULL);
run_command_async (action);
g_free (action); g_free (action);
} }
else else
......
...@@ -188,7 +188,13 @@ entry_create_widget (GtkWidget * dlg) ...@@ -188,7 +188,13 @@ entry_create_widget (GtkWidget * dlg)
{ {
gint active, i; gint active, i;
if (options.common_data.editable || g_settings_get_boolean (settings, "combo-always-editable")) if (options.common_data.editable ||
#ifndef STANDALONE
g_settings_get_boolean (settings, "combo-always-editable")
#else
COMBO_ALWAYS_EDIT
#endif
)
{ {
c = gtk_combo_box_text_new_with_entry (); c = gtk_combo_box_text_new_with_entry ();
gtk_widget_set_name (c, "yad-entry-edit-combo"); gtk_widget_set_name (c, "yad-entry-edit-combo");
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>. * along with YAD. If not, see <http://www.gnu.org/licenses/>.
* *
* Copyright (C) 2008-2019, Victor Ananjevsky <ananasik@gmail.com> * Copyright (C) 2008-2020, Victor Ananjevsky <ananasik@gmail.com>
*/ */
#include <ctype.h> #include <ctype.h>
...@@ -100,6 +100,9 @@ expand_action (gchar * cmd) ...@@ -100,6 +100,9 @@ expand_action (gchar * cmd)
case YAD_FIELD_FONT: case YAD_FIELD_FONT:
arg = g_shell_quote (gtk_font_chooser_get_font (GTK_FONT_CHOOSER (g_slist_nth_data (fields, num)))); arg = g_shell_quote (gtk_font_chooser_get_font (GTK_FONT_CHOOSER (g_slist_nth_data (fields, num))));
break; break;
case YAD_FIELD_LINK:
arg = g_shell_quote (gtk_link_button_get_uri (GTK_LINK_BUTTON (g_slist_nth_data (fields, num))));
break;
case YAD_FIELD_APP: case YAD_FIELD_APP:
{ {
GList *wl = gtk_container_get_children (GTK_CONTAINER (g_slist_nth_data (fields, num))); GList *wl = gtk_container_get_children (GTK_CONTAINER (g_slist_nth_data (fields, num)));
...@@ -325,8 +328,6 @@ set_field_value (guint num, gchar * value) ...@@ -325,8 +328,6 @@ set_field_value (guint num, gchar * value)
gtk_widget_destroy (cw); gtk_widget_destroy (cw);
} }
printf ("set value %s for app field\n");
if (value && value[0]) if (value && value[0])
b = gtk_app_chooser_button_new (value); b = gtk_app_chooser_button_new (value);
else else
...@@ -350,6 +351,10 @@ set_field_value (guint num, gchar * value) ...@@ -350,6 +351,10 @@ set_field_value (guint num, gchar * value)
g_object_set_data_full (G_OBJECT (w), "cmd", g_strdup (value), g_free); g_object_set_data_full (G_OBJECT (w), "cmd", g_strdup (value), g_free);
break; break;
case YAD_FIELD_LINK:
gtk_link_button_set_uri (GTK_LINK_BUTTON (w), value);
break;
case YAD_FIELD_TEXT: case YAD_FIELD_TEXT:
{ {
GtkTextBuffer *tb = gtk_text_view_get_buffer (GTK_TEXT_VIEW (w)); GtkTextBuffer *tb = gtk_text_view_get_buffer (GTK_TEXT_VIEW (w));
...@@ -375,7 +380,7 @@ button_clicked_cb (GtkButton * b, gpointer data) ...@@ -375,7 +380,7 @@ button_clicked_cb (GtkButton * b, gpointer data)
gchar *data; gchar *data;
gint exit = 1; gint exit = 1;
GString *cmd = expand_action (action + 1); GString *cmd = expand_action (action + 1);
g_spawn_command_line_sync (cmd->str, &data, NULL, &exit, NULL); exit = run_command_sync (cmd->str, &data);
if (exit == 0) if (exit == 0)
{ {
guint i = 0; guint i = 0;
...@@ -404,7 +409,7 @@ button_clicked_cb (GtkButton * b, gpointer data) ...@@ -404,7 +409,7 @@ button_clicked_cb (GtkButton * b, gpointer data)
else else
{ {
GString *cmd = expand_action (action); GString *cmd = expand_action (action);
g_spawn_command_line_async (cmd->str, NULL); run_command_async (cmd->str);
g_string_free (cmd, TRUE); g_string_free (cmd, TRUE);
} }
} }
...@@ -747,7 +752,8 @@ form_create_widget (GtkWidget * dlg) ...@@ -747,7 +752,8 @@ form_create_widget (GtkWidget * dlg)
/* add field label */ /* add field label */
l = NULL; l = NULL;
if (fld->type != YAD_FIELD_CHECK && fld->type != YAD_FIELD_BUTTON && if (fld->type != YAD_FIELD_CHECK && fld->type != YAD_FIELD_BUTTON &&
fld->type != YAD_FIELD_FULL_BUTTON && fld->type != YAD_FIELD_LABEL && fld->type != YAD_FIELD_TEXT) fld->type != YAD_FIELD_FULL_BUTTON && fld->type != YAD_FIELD_LINK &&
fld->type != YAD_FIELD_LABEL && fld->type != YAD_FIELD_TEXT)
{ {
gchar *buf = g_strcompress (fld->name); gchar *buf = g_strcompress (fld->name);
l = gtk_label_new (NULL); l = gtk_label_new (NULL);
...@@ -960,6 +966,17 @@ form_create_widget (GtkWidget * dlg) ...@@ -960,6 +966,17 @@ form_create_widget (GtkWidget * dlg)
fields = g_slist_append (fields, e); fields = g_slist_append (fields, e);
break; break;
case YAD_FIELD_LINK:
{
gchar *buf = g_strcompress (fld->name[0] ? fld->name : _("Link"));
e = gtk_link_button_new_with_label ("", buf);
gtk_widget_set_name (e, "yad-form-link");
gtk_grid_attach (GTK_GRID (tbl), e, col * 2, row, 2, 1);
gtk_widget_set_hexpand (e, TRUE);
fields = g_slist_append (fields, e);
break;
}
case YAD_FIELD_LABEL: case YAD_FIELD_LABEL:
if (fld->name[0]) if (fld->name[0])
{ {
...@@ -1207,6 +1224,17 @@ form_print_field (guint fn) ...@@ -1207,6 +1224,17 @@ form_print_field (guint fn)
g_printf ("%d%s", (gint) gtk_range_get_value (GTK_RANGE (g_slist_nth_data (fields, fn))), g_printf ("%d%s", (gint) gtk_range_get_value (GTK_RANGE (g_slist_nth_data (fields, fn))),
options.common_data.separator); options.common_data.separator);
break; break;
case YAD_FIELD_LINK:
if (options.common_data.quoted_output)
{
buf = g_shell_quote (gtk_link_button_get_uri (GTK_LINK_BUTTON (g_slist_nth_data (fields, fn))));
g_printf ("%s%s", buf, options.common_data.separator);
g_free (buf);
}
else
g_printf ("%s%s", gtk_link_button_get_uri (GTK_LINK_BUTTON (g_slist_nth_data (fields, fn))),
options.common_data.separator);
break;
case YAD_FIELD_BUTTON: case YAD_FIELD_BUTTON:
case YAD_FIELD_FULL_BUTTON: case YAD_FIELD_FULL_BUTTON:
case YAD_FIELD_LABEL: case YAD_FIELD_LABEL:
......
...@@ -48,8 +48,7 @@ load_uri (const gchar * uri) ...@@ -48,8 +48,7 @@ load_uri (const gchar * uri)
addr = g_filename_to_uri (uri, NULL, NULL); addr = g_filename_to_uri (uri, NULL, NULL);
else else
{ {
gchar *afn = g_new0 (gchar, PATH_MAX); gchar *afn = realpath (uri, NULL);
realpath (uri, afn);
addr = g_filename_to_uri (afn, NULL, NULL); addr = g_filename_to_uri (afn, NULL, NULL);
g_free (afn); g_free (afn);
} }
...@@ -77,21 +76,80 @@ loaded_cb (WebKitWebView *v, WebKitLoadEvent ev, gpointer d) ...@@ -77,21 +76,80 @@ loaded_cb (WebKitWebView *v, WebKitLoadEvent ev, gpointer d)
static gboolean static gboolean
policy_cb (WebKitWebView *v, WebKitPolicyDecision *pd, WebKitPolicyDecisionType pt, gpointer d) policy_cb (WebKitWebView *v, WebKitPolicyDecision *pd, WebKitPolicyDecisionType pt, gpointer d)
{ {
if (is_loaded && !options.html_data.browser) const gchar *uri;
if (!is_loaded)
return FALSE;
if (!options.html_data.browser)
{ {
WebKitNavigationAction *act = webkit_navigation_policy_decision_get_navigation_action (WEBKIT_NAVIGATION_POLICY_DECISION (pd)); WebKitNavigationAction *act = webkit_navigation_policy_decision_get_navigation_action (WEBKIT_NAVIGATION_POLICY_DECISION (pd));
webkit_policy_decision_ignore (pd); webkit_policy_decision_ignore (pd);
if (webkit_navigation_action_get_navigation_type (act) == WEBKIT_NAVIGATION_TYPE_LINK_CLICKED) if (webkit_navigation_action_get_navigation_type (act) == WEBKIT_NAVIGATION_TYPE_LINK_CLICKED)
{ {
WebKitURIRequest *r = webkit_navigation_action_get_request (act); WebKitURIRequest *r = webkit_navigation_action_get_request (act);
gchar *uri = (gchar *) webkit_uri_request_get_uri (r);
uri = webkit_uri_request_get_uri (r);
if (options.html_data.print_uri) if (options.html_data.print_uri)
g_printf ("%s\n", uri); g_printf ("%s\n", uri);
else else
g_app_info_launch_default_for_uri (uri, NULL, NULL); g_app_info_launch_default_for_uri (uri, NULL, NULL);
} }
} }
else if (options.html_data.uri_cmd)
{
gchar *v1, *v2, *cmd;
gint status;
if (pt == WEBKIT_POLICY_DECISION_TYPE_RESPONSE)
{
WebKitURIRequest *r = webkit_response_policy_decision_get_request (WEBKIT_RESPONSE_POLICY_DECISION (pd));
uri = webkit_uri_request_get_uri (r);
v1 = g_strdup ("");
v2 = g_strdup ("");
}
else
{
WebKitNavigationAction *act = webkit_navigation_policy_decision_get_navigation_action (WEBKIT_NAVIGATION_POLICY_DECISION (pd));
WebKitURIRequest *r = webkit_navigation_action_get_request (act);
uri = webkit_uri_request_get_uri (r);
v1 = g_strdup_printf ("%d", webkit_navigation_action_get_mouse_button (act));
v2 = g_strdup_printf ("%d", webkit_navigation_action_get_modifiers (act));
}
g_setenv ("YAD_HTML_BUTTON", v1, TRUE);
g_setenv ("YAD_HTML_STATE", v2, TRUE);
cmd = g_strdup_printf ("%s '%s'", options.html_data.uri_cmd, uri);
status = run_command_sync (cmd, NULL);
g_free (cmd);
g_unsetenv ("YAD_HTML_BUTTON");
g_unsetenv ("YAD_HTML_STATE");
g_free (v1);
g_free (v2);
/* actial exit code in a highest byte */
switch (status >> 8)
{
case 0:
webkit_policy_decision_use (pd);
break;
case 1:
webkit_policy_decision_ignore (pd);
break;
case 2:
if (pt == WEBKIT_POLICY_DECISION_TYPE_RESPONSE)
webkit_policy_decision_download (pd);
else
webkit_policy_decision_use (pd);
break;
default:
g_printerr ("yad: wrong return code (%d) from uri handler\n", status >> 8);
return FALSE;
}
}
else else
return FALSE; return FALSE;
...@@ -280,6 +338,7 @@ html_create_widget (GtkWidget * dlg) ...@@ -280,6 +338,7 @@ html_create_widget (GtkWidget * dlg)
webkit_settings_set_default_charset (settings, g_get_codeset ()); webkit_settings_set_default_charset (settings, g_get_codeset ());
g_signal_connect (view, "decide-policy", G_CALLBACK (policy_cb), NULL); g_signal_connect (view, "decide-policy", G_CALLBACK (policy_cb), NULL);
g_signal_connect (view, "load-changed", G_CALLBACK (loaded_cb), NULL);
if (options.html_data.browser) if (options.html_data.browser)
{ {
...@@ -299,7 +358,6 @@ html_create_widget (GtkWidget * dlg) ...@@ -299,7 +358,6 @@ html_create_widget (GtkWidget * dlg)
g_object_set (G_OBJECT(settings), "enable-page-cache", FALSE, NULL); g_object_set (G_OBJECT(settings), "enable-page-cache", FALSE, NULL);
g_object_set (G_OBJECT(settings), "enable-plugins", FALSE, NULL); g_object_set (G_OBJECT(settings), "enable-plugins", FALSE, NULL);
g_object_set (G_OBJECT (settings), "enable-private-browsing", TRUE, NULL); g_object_set (G_OBJECT (settings), "enable-private-browsing", TRUE, NULL);
g_signal_connect (view, "load-changed", G_CALLBACK (loaded_cb), NULL);
} }
gtk_widget_show_all (sw); gtk_widget_show_all (sw);
......
...@@ -134,14 +134,12 @@ activate_cb (GtkWidget * view, GtkTreePath * path, gpointer data) ...@@ -134,14 +134,12 @@ activate_cb (GtkWidget * view, GtkTreePath * path, gpointer data)
{ {
if (in_term) if (in_term)
{ {
gchar *tcmd; gchar *tcmd = g_strdup_printf (options.icons_data.term, cmd);
run_command_async (tcmd);
tcmd = g_strdup_printf (options.icons_data.term, cmd);
g_spawn_command_line_async (tcmd, NULL);
g_free (tcmd); g_free (tcmd);
} }
else else
g_spawn_command_line_async (cmd, NULL); run_command_async (cmd);
} }
} }
...@@ -346,7 +344,11 @@ parse_desktop_file (gchar * filename) ...@@ -346,7 +344,11 @@ parse_desktop_file (gchar * filename)
gchar *url = g_key_file_get_string (kf, "Desktop Entry", "URL", NULL); gchar *url = g_key_file_get_string (kf, "Desktop Entry", "URL", NULL);
if (url) if (url)
{ {
#ifndef STANDALONE
ent->command = g_strdup_printf (g_settings_get_string (settings, "open-command"), url); ent->command = g_strdup_printf (g_settings_get_string (settings, "open-command"), url);
#else
ent->command = g_strdup_printf (OPEN_CMD, url);
#endif
g_free (url); g_free (url);
} }
} }
......
...@@ -34,9 +34,12 @@ ...@@ -34,9 +34,12 @@
#include "yad.h" #include "yad.h"
YadOptions options; YadOptions options;
GSettings *settings;
GtkIconTheme *yad_icon_theme; GtkIconTheme *yad_icon_theme;
#ifndef STANDALONE
GSettings *settings;
#endif
GdkPixbuf *big_fallback_image = NULL; GdkPixbuf *big_fallback_image = NULL;
GdkPixbuf *small_fallback_image = NULL; GdkPixbuf *small_fallback_image = NULL;
...@@ -45,6 +48,8 @@ static GtkWidget *text = NULL; ...@@ -45,6 +48,8 @@ static GtkWidget *text = NULL;
static gint ret = YAD_RESPONSE_ESC; static gint ret = YAD_RESPONSE_ESC;
static gboolean is_x11 = FALSE;
YadNTabs *tabs; YadNTabs *tabs;
#ifndef G_OS_WIN32 #ifndef G_OS_WIN32
...@@ -96,7 +101,7 @@ static void ...@@ -96,7 +101,7 @@ static void
btn_cb (GtkWidget *b, gchar *cmd) btn_cb (GtkWidget *b, gchar *cmd)
{ {
if (cmd) if (cmd)
g_spawn_command_line_async (cmd, NULL); run_command_async (cmd);
else else
{ {
gint resp = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (b), "resp")); gint resp = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (b), "resp"));
...@@ -120,7 +125,11 @@ timeout_cb (gpointer data) ...@@ -120,7 +125,11 @@ timeout_cb (gpointer data)
{ {
gdouble percent = ((gdouble) options.data.timeout - count) / (gdouble) options.data.timeout; gdouble percent = ((gdouble) options.data.timeout - count) / (gdouble) options.data.timeout;
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (w), percent); gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (w), percent);
#ifndef STANDALONE
if (g_settings_get_boolean (settings, "show-remain")) if (g_settings_get_boolean (settings, "show-remain"))
#else
if (SHOW_REMAIN)
#endif
{ {
gchar *lbl = g_strdup_printf (_("%d sec"), options.data.timeout - count); gchar *lbl = g_strdup_printf (_("%d sec"), options.data.timeout - count);
gtk_progress_bar_set_text (GTK_PROGRESS_BAR (w), lbl); gtk_progress_bar_set_text (GTK_PROGRESS_BAR (w), lbl);
...@@ -294,6 +303,38 @@ create_layout (GtkWidget *dlg) ...@@ -294,6 +303,38 @@ create_layout (GtkWidget *dlg)
return layout; return layout;
} }
static void
realize_cb (GtkWidget *dlg, gpointer d)
{
gint cw, ch;
/* get current window size for gtk_window_resize */
gtk_window_get_size (GTK_WINDOW (dlg), &cw, &ch);
if (options.data.width == -1)
options.data.width = cw;
if (options.data.height == -1)
options.data.height = ch;
gtk_window_resize (GTK_WINDOW (dlg), options.data.width, options.data.height);
gtk_window_set_resizable (GTK_WINDOW (dlg), !options.data.fixed);
if (options.data.use_posx || options.data.use_posy)
{
gint ww, wh, sw, sh;
gtk_window_get_size (GTK_WINDOW (dlg), &ww, &wh);
gdk_window_get_geometry (gdk_get_default_root_window (), NULL, NULL, &sw, &sh);
/* place window to specified coordinates */
if (!options.data.use_posx)
gtk_window_get_position (GTK_WINDOW (dlg), &options.data.posx, NULL);
if (!options.data.use_posy)
gtk_window_get_position (GTK_WINDOW (dlg), NULL, &options.data.posy);
if (options.data.posx < 0)
options.data.posx = sw - ww + options.data.posx;
if (options.data.posy < 0)
options.data.posy = sh - wh + options.data.posy;
gtk_window_move (GTK_WINDOW (dlg), options.data.posx, options.data.posy);
}
}
static GtkWidget * static GtkWidget *
create_dialog (void) create_dialog (void)
{ {
...@@ -394,7 +435,11 @@ create_dialog (void) ...@@ -394,7 +435,11 @@ create_dialog (void)
gtk_box_pack_end (GTK_BOX (cbox), topb, FALSE, FALSE, 2); gtk_box_pack_end (GTK_BOX (cbox), topb, FALSE, FALSE, 2);
} }
#ifndef STANDALONE
if (g_settings_get_boolean (settings, "show-remain")) if (g_settings_get_boolean (settings, "show-remain"))
#else
if (SHOW_REMAIN)
#endif
{ {
gchar *lbl = g_strdup_printf (_("%d sec"), options.data.timeout); gchar *lbl = g_strdup_printf (_("%d sec"), options.data.timeout);
gtk_progress_bar_set_show_text (GTK_PROGRESS_BAR (topb), TRUE); gtk_progress_bar_set_show_text (GTK_PROGRESS_BAR (topb), TRUE);
...@@ -499,39 +544,9 @@ create_dialog (void) ...@@ -499,39 +544,9 @@ create_dialog (void)
/* parse geometry or move window, if given. must be after showing widget */ /* parse geometry or move window, if given. must be after showing widget */
if (!options.data.maximized && !options.data.fullscreen) if (!options.data.maximized && !options.data.fullscreen)
{ {
gint cw, ch;
gtk_widget_show_all (dlg);
parse_geometry (); parse_geometry ();
g_signal_connect (G_OBJECT (dlg), "realize", G_CALLBACK (realize_cb), NULL);
/* get current window size for gtk_window_resize */ gtk_widget_show_all (dlg);
gtk_window_get_size (GTK_WINDOW (dlg), &cw, &ch);
if (options.data.width == -1)
options.data.width = cw;
if (options.data.height == -1)
options.data.height = ch;
gtk_window_resize (GTK_WINDOW (dlg), options.data.width, options.data.height);
gtk_window_set_resizable (GTK_WINDOW (dlg), !options.data.fixed);
if (options.data.use_posx || options.data.use_posy)
{
gint ww, wh, sw, sh;
gtk_window_get_size (GTK_WINDOW (dlg), &ww, &wh);
gdk_window_get_geometry (gdk_get_default_root_window (), NULL, NULL, &sw, &sh);
/* place window to specified coordinates */
if (!options.data.use_posx)
gtk_window_get_position (GTK_WINDOW (dlg), &options.data.posx, NULL);
if (!options.data.use_posy)
gtk_window_get_position (GTK_WINDOW (dlg), NULL, &options.data.posy);
if (options.data.posx < 0)
options.data.posx = sw - ww + options.data.posx;
if (options.data.posy < 0)
options.data.posy = sh - wh + options.data.posy;
gtk_window_move (GTK_WINDOW (dlg), options.data.posx, options.data.posy);
}
} }
else else
{ {
...@@ -543,9 +558,8 @@ create_dialog (void) ...@@ -543,9 +558,8 @@ create_dialog (void)
gtk_window_fullscreen (GTK_WINDOW (dlg)); gtk_window_fullscreen (GTK_WINDOW (dlg));
} }
#ifndef G_OS_WIN32
/* print xid */ /* print xid */
if (options.print_xid) if (is_x11 && options.print_xid)
{ {
FILE *xf; FILE *xf;
...@@ -564,7 +578,6 @@ create_dialog (void) ...@@ -564,7 +578,6 @@ create_dialog (void)
fflush (xf); fflush (xf);
} }
} }
#endif
return dlg; return dlg;
} }
...@@ -667,7 +680,9 @@ main (gint argc, gchar ** argv) ...@@ -667,7 +680,9 @@ main (gint argc, gchar ** argv)
gtk_init (&argc, &argv); gtk_init (&argc, &argv);
g_set_application_name ("YAD"); g_set_application_name ("YAD");
#ifndef STANDALONE
settings = g_settings_new ("yad.settings"); settings = g_settings_new ("yad.settings");
#endif
yad_icon_theme = gtk_icon_theme_get_default (); yad_icon_theme = gtk_icon_theme_get_default ();
...@@ -710,6 +725,12 @@ main (gint argc, gchar ** argv) ...@@ -710,6 +725,12 @@ main (gint argc, gchar ** argv)
} }
yad_set_mode (); yad_set_mode ();
/* check for current GDK backend */
#ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_DISPLAY (gdk_display_get_default ()))
is_x11 = TRUE;
#endif
/* parse custom gtkrc */ /* parse custom gtkrc */
if (options.gtkrc_file) if (options.gtkrc_file)
{ {
...@@ -777,6 +798,13 @@ main (gint argc, gchar ** argv) ...@@ -777,6 +798,13 @@ main (gint argc, gchar ** argv)
signal (SIGUSR2, sa_usr2); signal (SIGUSR2, sa_usr2);
#endif #endif
if (!is_x11 && options.plug != -1)
{
options.plug = -1;
if (options.debug)
g_printerr (_("WARNING: --plug mode not supported outside X11\n"));
}
/* plug mode */ /* plug mode */
if (options.plug != -1) if (options.plug != -1)
{ {
...@@ -786,6 +814,19 @@ main (gint argc, gchar ** argv) ...@@ -786,6 +814,19 @@ main (gint argc, gchar ** argv)
return ret; return ret;
} }
if (!is_x11)
{
if (options.mode == YAD_MODE_NOTEBOOK || options.mode == YAD_MODE_PANED
#ifdef HAVE_TRAY
|| options.mode == YAD_MODE_NOTIFICATION
#endif
)
{
g_printerr (_("WARNING: This mode not supported outside X11\n"));
return 1;
}
}
switch (options.mode) switch (options.mode)
{ {
case YAD_MODE_ABOUT: case YAD_MODE_ABOUT:
...@@ -821,11 +862,12 @@ main (gint argc, gchar ** argv) ...@@ -821,11 +862,12 @@ main (gint argc, gchar ** argv)
default: default:
dialog = create_dialog (); dialog = create_dialog ();
#ifndef G_OS_WIN32 if (is_x11)
{
/* add YAD_XID variable */ /* add YAD_XID variable */
str = g_strdup_printf ("0x%X", (guint) GDK_WINDOW_XID (gtk_widget_get_window (dialog))); str = g_strdup_printf ("0x%X", (guint) GDK_WINDOW_XID (gtk_widget_get_window (dialog)));
g_setenv ("YAD_XID", str, TRUE); g_setenv ("YAD_XID", str, TRUE);
#endif }
/* make some specific init actions */ /* make some specific init actions */
if (options.mode == YAD_MODE_NOTEBOOK) if (options.mode == YAD_MODE_NOTEBOOK)
......
...@@ -165,7 +165,7 @@ activate_cb (GtkWidget * widget, YadData * data) ...@@ -165,7 +165,7 @@ activate_cb (GtkWidget * widget, YadData * data)
if (g_ascii_strcasecmp (action, "menu") == 0) if (g_ascii_strcasecmp (action, "menu") == 0)
popup_menu_cb (GTK_STATUS_ICON (widget), 1, GDK_CURRENT_TIME, data); popup_menu_cb (GTK_STATUS_ICON (widget), 1, GDK_CURRENT_TIME, data);
else else
g_spawn_command_line_async (action, NULL); run_command_async (action);
} }
return TRUE; return TRUE;
...@@ -199,12 +199,12 @@ popup_menu_item_activate_cb (GtkWidget * w, gpointer data) ...@@ -199,12 +199,12 @@ popup_menu_item_activate_cb (GtkWidget * w, gpointer data)
gtk_main_quit (); gtk_main_quit ();
} }
else else
g_spawn_command_line_async (cmd, NULL); run_command_async (cmd);
} }
} }
static void static void
popup_menu_cb (GtkStatusIcon * icon, guint button, guint activate_time, gpointer data) popup_menu_cb (GtkStatusIcon *icon, guint button, guint activate_time, gpointer data)
{ {
GtkWidget *menu; GtkWidget *menu;
GtkWidget *item; GtkWidget *item;
...@@ -254,7 +254,7 @@ popup_menu_cb (GtkStatusIcon * icon, guint button, guint activate_time, gpointer ...@@ -254,7 +254,7 @@ popup_menu_cb (GtkStatusIcon * icon, guint button, guint activate_time, gpointer
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
} }
gtk_menu_popup_at_widget (GTK_MENU (menu), GTK_WIDGET (icon), GDK_GRAVITY_SOUTH_WEST, GDK_GRAVITY_NORTH_WEST, NULL); gtk_menu_popup_at_pointer (GTK_MENU (menu), NULL);
} }
static gboolean static gboolean
......
...@@ -57,6 +57,7 @@ static gboolean set_scroll_policy (const gchar *, const gchar *, gpointer, GErro ...@@ -57,6 +57,7 @@ static gboolean set_scroll_policy (const gchar *, const gchar *, gpointer, GErro
#if GLIB_CHECK_VERSION(2,30,0) #if GLIB_CHECK_VERSION(2,30,0)
static gboolean set_size_format (const gchar *, const gchar *, gpointer, GError **); static gboolean set_size_format (const gchar *, const gchar *, gpointer, GError **);
#endif #endif
static gboolean set_interp (const gchar *, const gchar *, gpointer, GError **);
static gboolean about_mode = FALSE; static gboolean about_mode = FALSE;
static gboolean version_mode = FALSE; static gboolean version_mode = FALSE;
...@@ -141,6 +142,8 @@ static GOptionEntry general_options[] = { ...@@ -141,6 +142,8 @@ static GOptionEntry general_options[] = {
N_("Dialog text can be selected"), NULL }, N_("Dialog text can be selected"), NULL },
{ "keep-icon-size", 0, 0, G_OPTION_ARG_NONE, &options.data.keep_icon_size, { "keep-icon-size", 0, 0, G_OPTION_ARG_NONE, &options.data.keep_icon_size,
N_("Don't scale icons"), NULL }, N_("Don't scale icons"), NULL },
{ "use-interp", 0, G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, set_interp,
N_("Run commands under specified interpreter (default: bash -c '%s')"), N_("CMD") },
/* window settings */ /* window settings */
{ "sticky", 0, 0, G_OPTION_ARG_NONE, &options.data.sticky, { "sticky", 0, 0, G_OPTION_ARG_NONE, &options.data.sticky,
N_("Set window sticky"), NULL }, N_("Set window sticky"), NULL },
...@@ -410,6 +413,8 @@ static GOptionEntry list_options[] = { ...@@ -410,6 +413,8 @@ static GOptionEntry list_options[] = {
N_("Display list dialog"), NULL }, N_("Display list dialog"), NULL },
{ "column", 0, 0, G_OPTION_ARG_CALLBACK, add_column, { "column", 0, 0, G_OPTION_ARG_CALLBACK, add_column,
N_("Set the column header (see man page for list of possible types)"), N_("COLUMN[:TYPE]") }, N_("Set the column header (see man page for list of possible types)"), N_("COLUMN[:TYPE]") },
{ "tree", 0, 0, G_OPTION_ARG_NONE, &options.list_data.tree_mode,
N_("Enbale tree mode"), NULL },
{ "checklist", 0, 0, G_OPTION_ARG_NONE, &options.list_data.checkbox, { "checklist", 0, 0, G_OPTION_ARG_NONE, &options.list_data.checkbox,
N_("Use checkboxes for first column"), NULL }, N_("Use checkboxes for first column"), NULL },
{ "radiolist", 0, 0, G_OPTION_ARG_NONE, &options.list_data.radiobox, { "radiolist", 0, 0, G_OPTION_ARG_NONE, &options.list_data.radiobox,
...@@ -418,8 +423,6 @@ static GOptionEntry list_options[] = { ...@@ -418,8 +423,6 @@ static GOptionEntry list_options[] = {
N_("Don't show column headers"), NULL }, N_("Don't show column headers"), NULL },
{ "no-click", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &options.list_data.clickable, { "no-click", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &options.list_data.clickable,
N_("Disable clickable column headers"), NULL }, N_("Disable clickable column headers"), NULL },
{ "no-rules-hint", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &options.list_data.rules_hint,
N_("Disable rules hints"), NULL },
{ "grid-lines", 0, 0, G_OPTION_ARG_CALLBACK, set_grid_lines, { "grid-lines", 0, 0, G_OPTION_ARG_CALLBACK, set_grid_lines,
N_("Set grid lines (hor[izontal], vert[ical] or both)"), N_("TYPE") }, N_("Set grid lines (hor[izontal], vert[ical] or both)"), N_("TYPE") },
{ "print-all", 0, 0, G_OPTION_ARG_NONE, &options.list_data.print_all, { "print-all", 0, 0, G_OPTION_ARG_NONE, &options.list_data.print_all,
...@@ -456,6 +459,8 @@ static GOptionEntry list_options[] = { ...@@ -456,6 +459,8 @@ static GOptionEntry list_options[] = {
N_("Set select action"), N_("CMD") }, N_("Set select action"), N_("CMD") },
{ "row-action", 0, 0, G_OPTION_ARG_STRING, &options.list_data.row_action, { "row-action", 0, 0, G_OPTION_ARG_STRING, &options.list_data.row_action,
N_("Set row action"), N_("CMD") }, N_("Set row action"), N_("CMD") },
{ "tree-expanded", 0, 0, G_OPTION_ARG_NONE, &options.list_data.tree_expanded,
N_("Expand all tree nodes"), NULL },
{ "regex-search", 0, 0, G_OPTION_ARG_NONE, &options.list_data.regex_search, { "regex-search", 0, 0, G_OPTION_ARG_NONE, &options.list_data.regex_search,
N_("Use regex in search"), NULL }, N_("Use regex in search"), NULL },
{ "no-selection", 0, 0, G_OPTION_ARG_NONE, &options.list_data.no_selection, { "no-selection", 0, 0, G_OPTION_ARG_NONE, &options.list_data.no_selection,
...@@ -599,6 +604,10 @@ static GOptionEntry text_options[] = { ...@@ -599,6 +604,10 @@ static GOptionEntry text_options[] = {
N_("Set justification (left, right, center or fill)"), N_("TYPE") }, N_("Set justification (left, right, center or fill)"), N_("TYPE") },
{ "margins", 0, 0, G_OPTION_ARG_INT, &options.text_data.margins, { "margins", 0, 0, G_OPTION_ARG_INT, &options.text_data.margins,
N_("Set text margins"), N_("SIZE") }, N_("Set text margins"), N_("SIZE") },
{ "fore", 0, 0, G_OPTION_ARG_STRING, &options.text_data.fore,
N_("Use specified color for text"), N_("COLOR") },
{ "back", 0, 0, G_OPTION_ARG_STRING, &options.text_data.back,
N_("Use specified color for background"), N_("COLOR") },
{ "show-cursor", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &options.text_data.hide_cursor, { "show-cursor", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &options.text_data.hide_cursor,
N_("Show cursor in read-only mode"), NULL }, N_("Show cursor in read-only mode"), NULL },
{ "show-uri", 0, 0, G_OPTION_ARG_NONE, &options.text_data.uri, { "show-uri", 0, 0, G_OPTION_ARG_NONE, &options.text_data.uri,
...@@ -798,6 +807,8 @@ add_field (const gchar * option_name, const gchar * value, gpointer data, GError ...@@ -798,6 +807,8 @@ add_field (const gchar * option_name, const gchar * value, gpointer data, GError
fld->type = YAD_FIELD_BUTTON; fld->type = YAD_FIELD_BUTTON;
else if (strcasecmp (fstr[1], "FBTN") == 0) else if (strcasecmp (fstr[1], "FBTN") == 0)
fld->type = YAD_FIELD_FULL_BUTTON; fld->type = YAD_FIELD_FULL_BUTTON;
else if (strcasecmp (fstr[1], "LINK") == 0)
fld->type = YAD_FIELD_LINK;
else if (strcasecmp (fstr[1], "LBL") == 0) else if (strcasecmp (fstr[1], "LBL") == 0)
fld->type = YAD_FIELD_LABEL; fld->type = YAD_FIELD_LABEL;
else if (strcasecmp (fstr[1], "TXT") == 0) else if (strcasecmp (fstr[1], "TXT") == 0)
...@@ -1248,6 +1259,17 @@ set_size_format (const gchar * option_name, const gchar * value, gpointer data, ...@@ -1248,6 +1259,17 @@ set_size_format (const gchar * option_name, const gchar * value, gpointer data,
} }
#endif #endif
static gboolean
set_interp (const gchar * option_name, const gchar * value, gpointer data, GError ** err)
{
options.data.use_interp = TRUE;
if (value)
options.data.interp = g_strdup (value);
return TRUE;
}
#ifndef G_OS_WIN32 #ifndef G_OS_WIN32
static gboolean static gboolean
set_xid_file (const gchar * option_name, const gchar * value, gpointer data, GError ** err) set_xid_file (const gchar * option_name, const gchar * value, gpointer data, GError ** err)
...@@ -1431,6 +1453,12 @@ yad_options_init (void) ...@@ -1431,6 +1453,12 @@ yad_options_init (void)
options.xid_file = NULL; options.xid_file = NULL;
#endif #endif
#ifndef STANDALONE
options.debug = g_settings_get_boolean (settings, "debug");
#else
options.debug = FALSE;
#endif
options.hscroll_policy = GTK_POLICY_AUTOMATIC; options.hscroll_policy = GTK_POLICY_AUTOMATIC;
options.vscroll_policy = GTK_POLICY_AUTOMATIC; options.vscroll_policy = GTK_POLICY_AUTOMATIC;
...@@ -1441,8 +1469,12 @@ yad_options_init (void) ...@@ -1441,8 +1469,12 @@ yad_options_init (void)
/* Initialize general data */ /* Initialize general data */
options.data.dialog_title = NULL; options.data.dialog_title = NULL;
options.data.window_icon = "yad"; options.data.window_icon = "yad";
#ifndef STANDALONE
options.data.width = g_settings_get_int (settings, "width"); options.data.width = g_settings_get_int (settings, "width");
options.data.height = g_settings_get_int (settings, "height"); options.data.height = g_settings_get_int (settings, "height");
#else
options.data.width = options.data.height = -1;
#endif
options.data.use_posx = FALSE; options.data.use_posx = FALSE;
options.data.posx = 0; options.data.posx = 0;
options.data.use_posy = FALSE; options.data.use_posy = FALSE;
...@@ -1458,7 +1490,11 @@ yad_options_init (void) ...@@ -1458,7 +1490,11 @@ yad_options_init (void)
options.data.buttons = NULL; options.data.buttons = NULL;
options.data.no_buttons = FALSE; options.data.no_buttons = FALSE;
options.data.buttons_layout = GTK_BUTTONBOX_END; options.data.buttons_layout = GTK_BUTTONBOX_END;
options.data.borders = g_settings_get_int (settings, "border");; #ifndef STANDALONE
options.data.borders = g_settings_get_int (settings, "border");
#else
options.data.borders = BORDERS;
#endif
options.data.no_markup = FALSE; options.data.no_markup = FALSE;
options.data.no_escape = FALSE; options.data.no_escape = FALSE;
options.data.escape_ok = FALSE; options.data.escape_ok = FALSE;
...@@ -1466,6 +1502,8 @@ yad_options_init (void) ...@@ -1466,6 +1502,8 @@ yad_options_init (void)
options.data.selectable_labels = FALSE; options.data.selectable_labels = FALSE;
options.data.keep_icon_size = FALSE; options.data.keep_icon_size = FALSE;
options.data.def_resp = YAD_RESPONSE_OK; options.data.def_resp = YAD_RESPONSE_OK;
options.data.use_interp = FALSE;
options.data.interp = "bash -c '%s'";
/* Initialize window options */ /* Initialize window options */
options.data.sticky = FALSE; options.data.sticky = FALSE;
...@@ -1490,7 +1528,11 @@ yad_options_init (void) ...@@ -1490,7 +1528,11 @@ yad_options_init (void)
options.common_data.editable = FALSE; options.common_data.editable = FALSE;
options.common_data.tail = FALSE; options.common_data.tail = FALSE;
options.common_data.command = NULL; options.common_data.command = NULL;
#ifndef STANDALONE
options.common_data.date_format = g_settings_get_string (settings, "date-format"); options.common_data.date_format = g_settings_get_string (settings, "date-format");
#else
options.common_data.date_format = DATE_FMT;
#endif
options.common_data.float_precision = 3; options.common_data.float_precision = 3;
options.common_data.vertical = FALSE; options.common_data.vertical = FALSE;
options.common_data.align = 0.0; options.common_data.align = 0.0;
...@@ -1587,7 +1629,11 @@ yad_options_init (void) ...@@ -1587,7 +1629,11 @@ yad_options_init (void)
options.icons_data.compact = FALSE; options.icons_data.compact = FALSE;
options.icons_data.generic = FALSE; options.icons_data.generic = FALSE;
options.icons_data.width = -1; options.icons_data.width = -1;
#ifndef STANDALONE
options.icons_data.term = g_settings_get_string (settings, "terminal"); options.icons_data.term = g_settings_get_string (settings, "terminal");
#else
options.icons_data.term = TERM_CMD;
#endif
options.icons_data.sort_by_name = FALSE; options.icons_data.sort_by_name = FALSE;
options.icons_data.descend = FALSE; options.icons_data.descend = FALSE;
options.icons_data.single_click = FALSE; options.icons_data.single_click = FALSE;
...@@ -1595,11 +1641,11 @@ yad_options_init (void) ...@@ -1595,11 +1641,11 @@ yad_options_init (void)
/* Initialize list data */ /* Initialize list data */
options.list_data.columns = NULL; options.list_data.columns = NULL;
options.list_data.no_headers = FALSE; options.list_data.tree_mode = FALSE;
options.list_data.checkbox = FALSE; options.list_data.checkbox = FALSE;
options.list_data.radiobox = FALSE; options.list_data.radiobox = FALSE;
options.list_data.no_headers = FALSE;
options.list_data.print_all = FALSE; options.list_data.print_all = FALSE;
options.list_data.rules_hint = TRUE;
options.list_data.grid_lines = GTK_TREE_VIEW_GRID_LINES_NONE; options.list_data.grid_lines = GTK_TREE_VIEW_GRID_LINES_NONE;
options.list_data.print_column = 0; options.list_data.print_column = 0;
options.list_data.hide_column = 0; options.list_data.hide_column = 0;
...@@ -1617,6 +1663,7 @@ yad_options_init (void) ...@@ -1617,6 +1663,7 @@ yad_options_init (void)
options.list_data.dclick_action = NULL; options.list_data.dclick_action = NULL;
options.list_data.select_action = NULL; options.list_data.select_action = NULL;
options.list_data.row_action = NULL; options.list_data.row_action = NULL;
options.list_data.tree_expanded = FALSE;
options.list_data.regex_search = FALSE; options.list_data.regex_search = FALSE;
options.list_data.clickable = TRUE; options.list_data.clickable = TRUE;
options.list_data.no_selection = FALSE; options.list_data.no_selection = FALSE;
...@@ -1682,7 +1729,13 @@ yad_options_init (void) ...@@ -1682,7 +1729,13 @@ yad_options_init (void)
options.text_data.justify = GTK_JUSTIFY_LEFT; options.text_data.justify = GTK_JUSTIFY_LEFT;
options.text_data.margins = 0; options.text_data.margins = 0;
options.text_data.hide_cursor = TRUE; options.text_data.hide_cursor = TRUE;
options.text_data.fore = NULL;
options.text_data.back = NULL;
#ifndef STANDALONE
options.text_data.uri_color = g_settings_get_string (settings, "uri-color"); options.text_data.uri_color = g_settings_get_string (settings, "uri-color");
#else
options.text_data.uri_color = URI_COLOR;
#endif
options.text_data.formatted = FALSE; options.text_data.formatted = FALSE;
#ifdef HAVE_SOURCEVIEW #ifdef HAVE_SOURCEVIEW
...@@ -1857,7 +1910,14 @@ yad_create_context (void) ...@@ -1857,7 +1910,14 @@ yad_create_context (void)
g_option_context_add_group (tmp_ctx, a_group); g_option_context_add_group (tmp_ctx, a_group);
g_option_context_set_help_enabled (tmp_ctx, TRUE); g_option_context_set_help_enabled (tmp_ctx, TRUE);
#ifndef STANDALONE
if (!options.debug)
g_option_context_set_ignore_unknown_options (tmp_ctx, g_settings_get_boolean (settings, "ignore-unknown-options")); g_option_context_set_ignore_unknown_options (tmp_ctx, g_settings_get_boolean (settings, "ignore-unknown-options"));
else
g_option_context_set_ignore_unknown_options (tmp_ctx, FALSE);
#else
g_option_context_set_ignore_unknown_options (tmp_ctx, TRUE);
#endif
return tmp_ctx; return tmp_ctx;
} }
...@@ -245,6 +245,11 @@ yad_print_run (void) ...@@ -245,6 +245,11 @@ yad_print_run (void)
} }
g_free (fn); g_free (fn);
if (!print_settings)
print_settings = gtk_print_settings_new ();
if (!page_setup)
page_setup = gtk_page_setup_new ();
/* create print dialog */ /* create print dialog */
dlg = gtk_print_unix_dialog_new (options.data.dialog_title, NULL); dlg = gtk_print_unix_dialog_new (options.data.dialog_title, NULL);
gtk_window_set_type_hint (GTK_WINDOW (dlg), GDK_WINDOW_TYPE_HINT_NORMAL); gtk_window_set_type_hint (GTK_WINDOW (dlg), GDK_WINDOW_TYPE_HINT_NORMAL);
...@@ -260,10 +265,7 @@ yad_print_run (void) ...@@ -260,10 +265,7 @@ yad_print_run (void)
gtk_print_settings_set (print_settings, "output-uri", g_filename_to_uri (uri, NULL, NULL)); gtk_print_settings_set (print_settings, "output-uri", g_filename_to_uri (uri, NULL, NULL));
g_free (uri); g_free (uri);
if (print_settings)
gtk_print_unix_dialog_set_settings (GTK_PRINT_UNIX_DIALOG (dlg), print_settings); gtk_print_unix_dialog_set_settings (GTK_PRINT_UNIX_DIALOG (dlg), print_settings);
if (page_setup)
gtk_print_unix_dialog_set_page_setup (GTK_PRINT_UNIX_DIALOG (dlg), page_setup); gtk_print_unix_dialog_set_page_setup (GTK_PRINT_UNIX_DIALOG (dlg), page_setup);
/* set window behavior */ /* set window behavior */
......
...@@ -222,6 +222,10 @@ handle_stdin (GIOChannel *channel, GIOCondition condition, gpointer data) ...@@ -222,6 +222,10 @@ handle_stdin (GIOChannel *channel, GIOCondition condition, gpointer data)
if ((condition != G_IO_IN) && (condition != G_IO_IN + G_IO_HUP)) if ((condition != G_IO_IN) && (condition != G_IO_IN + G_IO_HUP))
{ {
g_io_channel_shutdown (channel, TRUE, NULL); g_io_channel_shutdown (channel, TRUE, NULL);
if (options.progress_data.autoclose && options.plug == -1)
yad_exit (options.data.def_resp);
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
...@@ -240,6 +244,9 @@ progress_create_widget (GtkWidget *dlg) ...@@ -240,6 +244,9 @@ progress_create_widget (GtkWidget *dlg)
{ {
YadProgressBar *bar = g_new0 (YadProgressBar, 1); YadProgressBar *bar = g_new0 (YadProgressBar, 1);
if (options.debug)
g_printerr (_("WARNING: You are usinge old-style progress dialog. This features is obsolete now, please use --bar style instead\n"));
if (options.progress_data.pulsate) if (options.progress_data.pulsate)
bar->type = YAD_PROGRESS_PULSE; bar->type = YAD_PROGRESS_PULSE;
else if (options.progress_data.rtl) else if (options.progress_data.rtl)
......
...@@ -171,10 +171,14 @@ tag_event_cb (GtkTextTag * tag, GObject * obj, GdkEvent * ev, GtkTextIter * iter ...@@ -171,10 +171,14 @@ tag_event_cb (GtkTextTag * tag, GObject * obj, GdkEvent * ev, GtkTextIter * iter
gtk_text_iter_forward_to_tag_toggle (&end, tag); gtk_text_iter_forward_to_tag_toggle (&end, tag);
url = gtk_text_iter_get_text (&start, &end); url = gtk_text_iter_get_text (&start, &end);
#ifndef STANDALONE
cmdline = g_strdup_printf (g_settings_get_string (settings, "open-command"), url); cmdline = g_strdup_printf (g_settings_get_string (settings, "open-command"), url);
#else
cmdline = g_strdup_printf (OPEN_CMD, url);
#endif
g_free (url); g_free (url);
g_spawn_command_line_async (cmdline, NULL); run_command_async (cmdline);
g_free (cmdline); g_free (cmdline);
return TRUE; return TRUE;
...@@ -445,6 +449,30 @@ text_create_widget (GtkWidget * dlg) ...@@ -445,6 +449,30 @@ text_create_widget (GtkWidget * dlg)
if (options.text_data.wrap) if (options.text_data.wrap)
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view), GTK_WRAP_WORD_CHAR); gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view), GTK_WRAP_WORD_CHAR);
if (options.common_data.font || options.text_data.fore || options.text_data.back)
{
GtkCssProvider *provider;
GtkStyleContext *context;
GString *css;
css = g_string_new ("textview, textview text {\n");
if (options.common_data.font)
g_string_append_printf (css, " font: %s;\n", options.common_data.font);
if (options.text_data.fore)
g_string_append_printf (css, " color: %s;\n", options.text_data.fore);
if (options.text_data.back)
g_string_append_printf (css, " background-color: %s;\n", options.text_data.back);
g_string_append (css, "}\n");
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (provider, css->str, -1, NULL);
context = gtk_widget_get_style_context (text_view);
gtk_style_context_add_provider (context, GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_string_free (css, TRUE);
}
#ifdef HAVE_SOURCEVIEW #ifdef HAVE_SOURCEVIEW
if (options.source_data.theme) if (options.source_data.theme)
{ {
......
...@@ -240,7 +240,11 @@ get_tabs (key_t key, gboolean create) ...@@ -240,7 +240,11 @@ get_tabs (key_t key, gboolean create)
int shmid, i, max_tab; int shmid, i, max_tab;
/* get shared memory */ /* get shared memory */
#ifndef STANDALONE
max_tab = g_settings_get_int (settings, "max-tab") + 1; max_tab = g_settings_get_int (settings, "max-tab") + 1;
#else
max_tab = MAX_TABS + 1;
#endif
if (create) if (create)
{ {
if ((shmid = shmget (key, max_tab * sizeof (YadNTabs), IPC_CREAT | IPC_EXCL | 0644)) == -1) if ((shmid = shmget (key, max_tab * sizeof (YadNTabs), IPC_CREAT | IPC_EXCL | 0644)) == -1)
...@@ -608,6 +612,60 @@ print_bool_val (gboolean val) ...@@ -608,6 +612,60 @@ print_bool_val (gboolean val)
return ret; return ret;
} }
gint
run_command_sync (gchar *cmd, gchar **out)
{
gint ret = 0;
gchar *full_cmd = NULL;
GError *err = NULL;
if (options.data.use_interp)
{
if (g_strstr_len (options.data.interp, -1, "%s") != NULL)
full_cmd = g_strdup_printf (options.data.interp, cmd);
else
full_cmd = g_strdup_printf ("%s %s", options.data.interp, cmd);
}
else
full_cmd = g_strdup (cmd);
if (!g_spawn_command_line_sync (full_cmd, out, NULL, &ret, &err))
{
if (options.debug)
g_printerr (_("WARNING: Run command failed: %s\n"), err->message);
g_error_free (err);
}
g_free (full_cmd);
return ret;
}
void
run_command_async (gchar *cmd)
{
gchar *full_cmd = NULL;
GError *err = NULL;
if (options.data.use_interp)
{
if (g_strstr_len (options.data.interp, -1, "%s") != NULL)
full_cmd = g_strdup_printf (options.data.interp, cmd);
else
full_cmd = g_strdup_printf ("%s %s", options.data.interp, cmd);
}
else
full_cmd = g_strdup (cmd);
if (!g_spawn_command_line_async (full_cmd, &err))
{
if (options.debug)
g_printerr (_("WARNING: Run command failed: %s\n"), err->message);
g_error_free (err);
}
g_free (full_cmd);
}
#ifdef HAVE_SPELL #ifdef HAVE_SPELL
void void
show_langs () show_langs ()
......
...@@ -46,6 +46,10 @@ ...@@ -46,6 +46,10 @@
#include <gtksourceview/gtksource.h> #include <gtksourceview/gtksource.h>
#endif #endif
#ifdef STANDALONE
#include "defaults.h"
#endif
G_BEGIN_DECLS G_BEGIN_DECLS
#define YAD_RESPONSE_OK 0 #define YAD_RESPONSE_OK 0
...@@ -113,6 +117,7 @@ typedef enum { ...@@ -113,6 +117,7 @@ typedef enum {
YAD_FIELD_SCALE, YAD_FIELD_SCALE,
YAD_FIELD_BUTTON, YAD_FIELD_BUTTON,
YAD_FIELD_FULL_BUTTON, YAD_FIELD_FULL_BUTTON,
YAD_FIELD_LINK,
YAD_FIELD_LABEL, YAD_FIELD_LABEL,
YAD_FIELD_TEXT YAD_FIELD_TEXT
} YadFieldType; } YadFieldType;
...@@ -229,6 +234,8 @@ typedef struct { ...@@ -229,6 +234,8 @@ typedef struct {
gboolean keep_icon_size; gboolean keep_icon_size;
GtkButtonBoxStyle buttons_layout; GtkButtonBoxStyle buttons_layout;
gint def_resp; gint def_resp;
gboolean use_interp;
gchar *interp;
/* window settings */ /* window settings */
gboolean sticky; gboolean sticky;
gboolean fixed; gboolean fixed;
...@@ -336,11 +343,11 @@ typedef struct { ...@@ -336,11 +343,11 @@ typedef struct {
typedef struct { typedef struct {
GSList *columns; GSList *columns;
gboolean no_headers; gboolean tree_mode;
gboolean checkbox; gboolean checkbox;
gboolean radiobox; gboolean radiobox;
gboolean no_headers;
gboolean print_all; gboolean print_all;
gboolean rules_hint;
GtkTreeViewGridLines grid_lines; GtkTreeViewGridLines grid_lines;
gint print_column; gint print_column;
gint hide_column; gint hide_column;
...@@ -358,6 +365,7 @@ typedef struct { ...@@ -358,6 +365,7 @@ typedef struct {
gchar *dclick_action; gchar *dclick_action;
gchar *select_action; gchar *select_action;
gchar *row_action; gchar *row_action;
gboolean tree_expanded;
gboolean regex_search; gboolean regex_search;
gboolean clickable; gboolean clickable;
gboolean no_selection; gboolean no_selection;
...@@ -434,6 +442,8 @@ typedef struct { ...@@ -434,6 +442,8 @@ typedef struct {
gboolean hide_cursor; gboolean hide_cursor;
gchar *uri_color; gchar *uri_color;
gboolean formatted; gboolean formatted;
gchar *fore;
gchar *back;
} YadTextData; } YadTextData;
#ifdef HAVE_SOURCEVIEW #ifdef HAVE_SOURCEVIEW
...@@ -520,6 +530,8 @@ typedef struct { ...@@ -520,6 +530,8 @@ typedef struct {
key_t plug; key_t plug;
guint tabnum; guint tabnum;
gboolean debug;
#ifndef G_OS_WIN32 #ifndef G_OS_WIN32
guint kill_parent; guint kill_parent;
gboolean print_xid; gboolean print_xid;
...@@ -528,9 +540,12 @@ typedef struct { ...@@ -528,9 +540,12 @@ typedef struct {
} YadOptions; } YadOptions;
extern YadOptions options; extern YadOptions options;
extern GSettings *settings;
extern GtkIconTheme *yad_icon_theme; extern GtkIconTheme *yad_icon_theme;
#ifndef STANDALONE
extern GSettings *settings;
#endif
extern GdkPixbuf *big_fallback_image; extern GdkPixbuf *big_fallback_image;
extern GdkPixbuf *small_fallback_image; extern GdkPixbuf *small_fallback_image;
...@@ -640,6 +655,9 @@ void parse_geometry (); ...@@ -640,6 +655,9 @@ void parse_geometry ();
gboolean get_bool_val (gchar *str); gboolean get_bool_val (gchar *str);
gchar *print_bool_val (gboolean val); gchar *print_bool_val (gboolean val);
gint run_command_sync (gchar *cmd, gchar **out);
void run_command_async (gchar *cmd);
#ifdef HAVE_SPELL #ifdef HAVE_SPELL
void show_langs (); void show_langs ();
#endif #endif
......
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