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
f01bbc5b
Commit
f01bbc5b
authored
Jul 01, 2019
by
Victor Ananjevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix pulsate behavior in progress dialog
parent
7d56d064
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
22 deletions
+6
-22
progress.c
src/progress.c
+6
-22
No files found.
src/progress.c
View file @
f01bbc5b
...
...
@@ -31,16 +31,8 @@ static GtkWidget *progress_log;
static
GtkTextBuffer
*
log_buffer
;
static
gboolean
pulsate_progress_bar
(
gpointer
user_data
)
{
gtk_progress_bar_pulse
(
GTK_PROGRESS_BAR
(
progress_bar
));
return
TRUE
;
}
static
gboolean
handle_stdin
(
GIOChannel
*
channel
,
GIOCondition
condition
,
gpointer
data
)
{
static
guint
pulsate_timeout
=
0
;
float
percentage
=
0
.
0
;
if
((
condition
==
G_IO_IN
)
||
(
condition
==
G_IO_IN
+
G_IO_HUP
))
...
...
@@ -50,13 +42,7 @@ handle_stdin (GIOChannel * channel, GIOCondition condition, gpointer data)
string
=
g_string_new
(
NULL
);
if
(
options
.
progress_data
.
pulsate
)
{
if
(
pulsate_timeout
==
0
)
pulsate_timeout
=
g_timeout_add
(
100
,
pulsate_progress_bar
,
NULL
);
}
while
(
channel
->
is_readable
!=
TRUE
);
while
(
channel
->
is_readable
!=
TRUE
)
;
do
{
...
...
@@ -109,7 +95,7 @@ handle_stdin (GIOChannel * channel, GIOCondition condition, gpointer data)
gtk_progress_bar_set_text
(
GTK_PROGRESS_BAR
(
progress_bar
),
match
);
g_free
(
match
);
}
else
else
if
(
!
options
.
progress_data
.
pulsate
)
{
if
(
g_ascii_isdigit
(
*
(
string
->
str
)))
{
...
...
@@ -126,6 +112,9 @@ handle_stdin (GIOChannel * channel, GIOCondition condition, gpointer data)
}
}
if
(
options
.
progress_data
.
pulsate
)
gtk_progress_bar_pulse
(
GTK_PROGRESS_BAR
(
progress_bar
));
}
while
(
g_io_channel_get_buffer_condition
(
channel
)
==
G_IO_IN
);
g_string_free
(
string
,
TRUE
);
...
...
@@ -135,18 +124,13 @@ handle_stdin (GIOChannel * channel, GIOCondition condition, gpointer data)
{
gtk_progress_bar_set_fraction
(
GTK_PROGRESS_BAR
(
progress_bar
),
1
.
0
);
if
(
options
.
progress_data
.
pulsate
)
{
g_source_remove
(
pulsate_timeout
);
pulsate_timeout
=
0
;
}
if
(
options
.
progress_data
.
autoclose
&&
options
.
plug
==
-
1
)
yad_exit
(
options
.
data
.
def_resp
);
g_io_channel_shutdown
(
channel
,
TRUE
,
NULL
);
return
FALSE
;
}
return
TRUE
;
}
...
...
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