Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yad
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav
yad
Commits
73b3cd88
Commit
73b3cd88
authored
Apr 17, 2021
by
Victor Ananjevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move --show-lang and --show-themes functions to yad-tools
parent
f72acd1e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
70 additions
and
72 deletions
+70
-72
ru.po
po/ru.po
+1
-1
Makefile.am
src/Makefile.am
+2
-2
main.c
src/main.c
+0
-12
option.c
src/option.c
+0
-22
tools.c
src/tools.c
+67
-0
util.c
src/util.c
+0
-35
No files found.
po/ru.po
View file @
73b3cd88
...
...
@@ -1463,7 +1463,7 @@ msgstr "Показать список языков проверки орфогр
#: ../src/option.c:717
msgid "Show list of GtkSourceView themes"
msgstr "Показать список те
к
м для GtkSourceView"
msgstr "Показать список тем для GtkSourceView"
#: ../src/option.c:720
msgid "Load additional CSS settings from file or string"
...
...
src/Makefile.am
View file @
73b3cd88
...
...
@@ -46,8 +46,8 @@ if BUILD_TOOLS
bin_PROGRAMS
+=
yad-tools
yad_tools_SOURCES
=
tools.c
yad_tools_CFLAGS
=
$(GTK_CFLAGS)
yad_tools_LDADD
=
$(GTK_LIBS)
yad_tools_CFLAGS
=
$(GTK_CFLAGS)
$(SPELL_CFLAGS)
$(SOURCEVIEW_CFLAGS)
yad_tools_LDADD
=
$(GTK_LIBS)
$(SPELL_LIBS)
$(SOURCEVIEW_LIBS)
endif
if
BUILD_IB
...
...
src/main.c
View file @
73b3cd88
...
...
@@ -875,18 +875,6 @@ main (gint argc, gchar ** argv)
g_print
(
"%s (GTK+ %d.%d.%d)
\n
"
,
VERSION
,
gtk_major_version
,
gtk_minor_version
,
gtk_micro_version
);
break
;
#ifdef HAVE_SPELL
case
YAD_MODE_LANGS
:
show_langs
();
break
;
#endif
#ifdef HAVE_SOURCEVIEW
case
YAD_MODE_THEMES
:
show_themes
();
break
;
#endif
#ifdef HAVE_TRAY
case
YAD_MODE_NOTIFICATION
:
ret
=
yad_notification_run
();
...
...
src/option.c
View file @
73b3cd88
...
...
@@ -63,12 +63,6 @@ static gboolean set_smart_homend (const gchar *, const gchar *, gpointer, GError
static
gboolean
about_mode
=
FALSE
;
static
gboolean
version_mode
=
FALSE
;
#ifdef HAVE_SPELL
static
gboolean
langs_mode
=
FALSE
;
#endif
#ifdef HAVE_SOURCEVIEW
static
gboolean
themes_mode
=
FALSE
;
#endif
static
gboolean
app_mode
=
FALSE
;
static
gboolean
calendar_mode
=
FALSE
;
static
gboolean
color_mode
=
FALSE
;
...
...
@@ -708,14 +702,6 @@ static GOptionEntry filter_options[] = {
static
GOptionEntry
misc_options
[]
=
{
{
"version"
,
0
,
0
,
G_OPTION_ARG_NONE
,
&
version_mode
,
N_
(
"Print version"
),
NULL
},
#ifdef HAVE_SPELL
{
"show-langs"
,
0
,
0
,
G_OPTION_ARG_NONE
,
&
langs_mode
,
N_
(
"Show list of spell languages"
),
NULL
},
#endif
#ifdef HAVE_SOURCEVIEW
{
"show-themes"
,
0
,
0
,
G_OPTION_ARG_NONE
,
&
themes_mode
,
N_
(
"Show list of GtkSourceView themes"
),
NULL
},
#endif
{
"css"
,
0
,
0
,
G_OPTION_ARG_STRING
,
&
options
.
css
,
N_
(
"Load additional CSS settings from file or string"
),
N_
(
"STRING"
)
},
{
"gtkrc"
,
0
,
0
,
G_OPTION_ARG_FILENAME
,
&
options
.
gtkrc_file
,
...
...
@@ -1527,14 +1513,6 @@ yad_set_mode (void)
options
.
mode
=
YAD_MODE_ABOUT
;
else
if
(
version_mode
)
options
.
mode
=
YAD_MODE_VERSION
;
#ifdef HAVE_SPELL
else
if
(
langs_mode
)
options
.
mode
=
YAD_MODE_LANGS
;
#endif
#ifdef HAVE_SOURCEVIEW
else
if
(
themes_mode
)
options
.
mode
=
YAD_MODE_THEMES
;
#endif
}
void
...
...
src/tools.c
View file @
73b3cd88
...
...
@@ -22,6 +22,14 @@
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#ifdef HAVE_SPELL
#include <gspell/gspell.h>
#endif
#ifdef HAVE_SOURCEVIEW
#include <gtksourceview/gtksource.h>
#endif
typedef
enum
{
PANGO_SPEC
,
XFT_SPEC
...
...
@@ -35,6 +43,12 @@ static FontType font_type = XFT_SPEC;
static
gboolean
pfd_mode
=
FALSE
;
static
gboolean
icon_mode
=
FALSE
;
static
gboolean
ver
=
FALSE
;
#ifdef HAVE_SPELL
static
gboolean
langs_mode
=
FALSE
;
#endif
#ifdef HAVE_SOURCEVIEW
static
gboolean
themes_mode
=
FALSE
;
#endif
static
guint
icon_size
=
24
;
static
gchar
*
icon_theme_name
=
NULL
;
...
...
@@ -43,6 +57,12 @@ static gchar **args = NULL;
static
GOptionEntry
ents
[]
=
{
{
"version"
,
'v'
,
0
,
G_OPTION_ARG_NONE
,
&
ver
,
N_
(
"Print version"
),
NULL
},
#ifdef HAVE_SPELL
{
"show-langs"
,
0
,
0
,
G_OPTION_ARG_NONE
,
&
langs_mode
,
N_
(
"Show list of spell languages"
),
NULL
},
#endif
#ifdef HAVE_SOURCEVIEW
{
"show-themes"
,
0
,
0
,
G_OPTION_ARG_NONE
,
&
themes_mode
,
N_
(
"Show list of GtkSourceView themes"
),
NULL
},
#endif
{
G_OPTION_REMAINING
,
0
,
0
,
G_OPTION_ARG_STRING_ARRAY
,
&
args
,
NULL
,
N_
(
"STRING ..."
)
},
{
NULL
}
};
...
...
@@ -272,6 +292,45 @@ run_icon_mode ()
return
0
;
}
#ifdef HAVE_SPELL
static
gint
show_langs
()
{
const
GList
*
lng
;
for
(
lng
=
gspell_language_get_available
();
lng
;
lng
=
lng
->
next
)
{
const
GspellLanguage
*
l
=
lng
->
data
;
g_print
(
"%s
\n
"
,
gspell_language_get_code
(
l
));
}
return
0
;
}
#endif
#ifdef HAVE_SOURCEVIEW
static
gint
show_themes
()
{
GtkSourceStyleSchemeManager
*
sm
;
const
gchar
**
si
;
guint
i
=
0
;
sm
=
gtk_source_style_scheme_manager_get_default
();
if
((
si
=
(
const
gchar
**
)
gtk_source_style_scheme_manager_get_scheme_ids
(
sm
))
==
NULL
)
return
1
;
while
(
si
[
i
])
{
GtkSourceStyleScheme
*
s
=
gtk_source_style_scheme_manager_get_scheme
(
sm
,
si
[
i
]);
g_print
(
"%s
\n
"
,
gtk_source_style_scheme_get_name
(
s
));
i
++
;
}
return
0
;
}
#endif
int
main
(
int
argc
,
char
*
argv
[])
{
...
...
@@ -319,6 +378,14 @@ main (int argc, char *argv[])
ret
=
run_pfd_mode
();
else
if
(
icon_mode
)
ret
=
run_icon_mode
();
#ifdef HAVE_SPELL
else
if
(
langs_mode
)
ret
=
show_langs
();
#endif
#ifdef HAVE_SOURCEVIEW
else
if
(
themes_mode
)
ret
=
show_themes
();
#endif
else
{
g_printerr
(
_
(
"no mode specified
\n
"
));
...
...
src/util.c
View file @
73b3cd88
...
...
@@ -823,38 +823,3 @@ open_uri (const gchar *uri)
run_command_async
(
cmdline
);
g_free
(
cmdline
);
}
#ifdef HAVE_SPELL
void
show_langs
()
{
const
GList
*
lng
;
for
(
lng
=
gspell_language_get_available
();
lng
;
lng
=
lng
->
next
)
{
const
GspellLanguage
*
l
=
lng
->
data
;
g_print
(
"%s
\n
"
,
gspell_language_get_code
(
l
));
}
}
#endif
#ifdef HAVE_SOURCEVIEW
void
show_themes
()
{
GtkSourceStyleSchemeManager
*
sm
;
const
gchar
**
si
;
guint
i
=
0
;
sm
=
gtk_source_style_scheme_manager_get_default
();
if
((
si
=
(
const
gchar
**
)
gtk_source_style_scheme_manager_get_scheme_ids
(
sm
))
==
NULL
)
return
;
while
(
si
[
i
])
{
GtkSourceStyleScheme
*
s
=
gtk_source_style_scheme_manager_get_scheme
(
sm
,
si
[
i
]);
g_print
(
"%s
\n
"
,
gtk_source_style_scheme_get_name
(
s
));
i
++
;
}
}
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment