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
4867c81b
Commit
4867c81b
authored
May 31, 2023
by
Victor Ananjevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new branch for implementing extended actions on USR1 and USR2 signals
parent
fbfb0faf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
main.c
src/main.c
+6
-2
option.c
src/option.c
+10
-0
yad.h
src/yad.h
+4
-0
No files found.
src/main.c
View file @
4867c81b
...
@@ -60,7 +60,9 @@ YadNTabs *tabs;
...
@@ -60,7 +60,9 @@ YadNTabs *tabs;
static
void
static
void
sa_usr1
(
gint
sig
)
sa_usr1
(
gint
sig
)
{
{
if
(
options
.
plug
!=
-
1
)
if
(
options
.
common_data
.
usr1_action
)
run_command_async
(
options
.
common_data
.
usr1_action
);
else
if
(
options
.
plug
!=
-
1
)
yad_print_result
();
yad_print_result
();
else
else
yad_exit
(
options
.
data
.
def_resp
);
yad_exit
(
options
.
data
.
def_resp
);
...
@@ -69,7 +71,9 @@ sa_usr1 (gint sig)
...
@@ -69,7 +71,9 @@ sa_usr1 (gint sig)
static
void
static
void
sa_usr2
(
gint
sig
)
sa_usr2
(
gint
sig
)
{
{
if
(
options
.
plug
!=
-
1
)
if
(
options
.
common_data
.
usr2_action
)
run_command_async
(
options
.
common_data
.
usr2_action
);
else
if
(
options
.
plug
!=
-
1
)
gtk_main_quit
();
gtk_main_quit
();
else
else
yad_exit
(
YAD_RESPONSE_CANCEL
);
yad_exit
(
YAD_RESPONSE_CANCEL
);
...
...
src/option.c
View file @
4867c81b
...
@@ -236,6 +236,12 @@ static GOptionEntry common_options[] = {
...
@@ -236,6 +236,12 @@ static GOptionEntry common_options[] = {
N_
(
"Disable search in text and html dialogs"
),
NULL
},
N_
(
"Disable search in text and html dialogs"
),
NULL
},
{
"file-op"
,
0
,
0
,
G_OPTION_ARG_NONE
,
&
options
.
common_data
.
file_op
,
{
"file-op"
,
0
,
0
,
G_OPTION_ARG_NONE
,
&
options
.
common_data
.
file_op
,
N_
(
"Enable file operations"
),
NULL
},
N_
(
"Enable file operations"
),
NULL
},
#ifndef G_OS_WIN32
{
"usr1-action"
,
0
,
0
,
G_OPTION_ARG_STRING
,
&
options
.
common_data
.
usr1_action
,
N_
(
"Action for USR1 signal"
),
N_
(
"COMMAND"
)
},
{
"usr2-action"
,
0
,
0
,
G_OPTION_ARG_STRING
,
&
options
.
common_data
.
usr2_action
,
N_
(
"Action for USR2 signal"
),
N_
(
"COMMAND"
)
},
#endif
#if GLIB_CHECK_VERSION(2,30,0)
#if GLIB_CHECK_VERSION(2,30,0)
{
"iec-format"
,
0
,
G_OPTION_FLAG_OPTIONAL_ARG
,
G_OPTION_ARG_CALLBACK
,
set_size_format
,
{
"iec-format"
,
0
,
G_OPTION_FLAG_OPTIONAL_ARG
,
G_OPTION_ARG_CALLBACK
,
set_size_format
,
N_
(
"Use IEC (base 1024) units with for size values"
),
NULL
},
N_
(
"Use IEC (base 1024) units with for size values"
),
NULL
},
...
@@ -1684,6 +1690,10 @@ yad_options_init (void)
...
@@ -1684,6 +1690,10 @@ yad_options_init (void)
options
.
common_data
.
scroll
=
FALSE
;
options
.
common_data
.
scroll
=
FALSE
;
options
.
common_data
.
enable_search
=
TRUE
;
options
.
common_data
.
enable_search
=
TRUE
;
options
.
common_data
.
file_op
=
FALSE
;
options
.
common_data
.
file_op
=
FALSE
;
#ifndef G_OS_WIN32
options
.
common_data
.
usr1_action
=
NULL
;
options
.
common_data
.
usr2_action
=
NULL
;
#endif
#if GLIB_CHECK_VERSION(2,30,0)
#if GLIB_CHECK_VERSION(2,30,0)
options
.
common_data
.
size_fmt
=
G_FORMAT_SIZE_DEFAULT
;
options
.
common_data
.
size_fmt
=
G_FORMAT_SIZE_DEFAULT
;
#endif
#endif
...
...
src/yad.h
View file @
4867c81b
...
@@ -536,6 +536,10 @@ typedef struct {
...
@@ -536,6 +536,10 @@ typedef struct {
gboolean
enable_search
;
gboolean
enable_search
;
gboolean
file_op
;
gboolean
file_op
;
gboolean
scroll
;
gboolean
scroll
;
#ifndef G_OS_WIN32
gchar
*
usr1_action
;
gchar
*
usr2_action
;
#endif
#if GLIB_CHECK_VERSION(2,30,0)
#if GLIB_CHECK_VERSION(2,30,0)
GFormatSizeFlags
size_fmt
;
GFormatSizeFlags
size_fmt
;
#endif
#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