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
fd2d308d
Commit
fd2d308d
authored
Jul 21, 2019
by
Victor Ananjevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
supress warnings about deprecated api
parent
9a6b6543
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
2 deletions
+26
-2
notification.c
src/notification.c
+26
-2
No files found.
src/notification.c
View file @
fd2d308d
...
@@ -115,7 +115,9 @@ set_icon (void)
...
@@ -115,7 +115,9 @@ set_icon (void)
if
(
icon
==
NULL
)
if
(
icon
==
NULL
)
{
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
;
gtk_status_icon_set_from_icon_name
(
status_icon
,
"yad"
);
gtk_status_icon_set_from_icon_name
(
status_icon
,
"yad"
);
G_GNUC_END_IGNORE_DEPRECATIONS
;
return
;
return
;
}
}
...
@@ -131,14 +133,24 @@ set_icon (void)
...
@@ -131,14 +133,24 @@ set_icon (void)
}
}
if
(
pixbuf
)
if
(
pixbuf
)
{
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
;
gtk_status_icon_set_from_pixbuf
(
status_icon
,
pixbuf
);
gtk_status_icon_set_from_pixbuf
(
status_icon
,
pixbuf
);
G_GNUC_END_IGNORE_DEPRECATIONS
;
g_object_unref
(
pixbuf
);
g_object_unref
(
pixbuf
);
}
}
else
else
gtk_status_icon_set_from_icon_name
(
status_icon
,
"yad"
);
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
;
gtk_status_icon_set_from_icon_name
(
status_icon
,
"yad"
);
G_GNUC_END_IGNORE_DEPRECATIONS
;
}
}
}
else
else
gtk_status_icon_set_from_icon_name
(
status_icon
,
icon
);
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
;
gtk_status_icon_set_from_icon_name
(
status_icon
,
icon
);
G_GNUC_END_IGNORE_DEPRECATIONS
;
}
}
}
static
gboolean
static
gboolean
...
@@ -301,18 +313,22 @@ handle_stdin (GIOChannel * channel, GIOCondition condition, gpointer data)
...
@@ -301,18 +313,22 @@ handle_stdin (GIOChannel * channel, GIOCondition condition, gpointer data)
g_free
(
icon
);
g_free
(
icon
);
icon
=
g_strdup
(
value
);
icon
=
g_strdup
(
value
);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
;
if
(
gtk_status_icon_get_visible
(
status_icon
)
&&
gtk_status_icon_is_embedded
(
status_icon
))
if
(
gtk_status_icon_get_visible
(
status_icon
)
&&
gtk_status_icon_is_embedded
(
status_icon
))
set_icon
();
set_icon
();
G_GNUC_END_IGNORE_DEPRECATIONS
;
}
}
else
if
(
!
g_ascii_strcasecmp
(
command
,
"tooltip"
))
else
if
(
!
g_ascii_strcasecmp
(
command
,
"tooltip"
))
{
{
if
(
g_utf8_validate
(
value
,
-
1
,
NULL
))
if
(
g_utf8_validate
(
value
,
-
1
,
NULL
))
{
{
gchar
*
message
=
g_strcompress
(
value
);
gchar
*
message
=
g_strcompress
(
value
);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
;
if
(
!
options
.
data
.
no_markup
)
if
(
!
options
.
data
.
no_markup
)
gtk_status_icon_set_tooltip_markup
(
status_icon
,
message
);
gtk_status_icon_set_tooltip_markup
(
status_icon
,
message
);
else
else
gtk_status_icon_set_tooltip_text
(
status_icon
,
message
);
gtk_status_icon_set_tooltip_text
(
status_icon
,
message
);
G_GNUC_END_IGNORE_DEPRECATIONS
;
g_free
(
message
);
g_free
(
message
);
}
}
else
else
...
@@ -320,10 +336,12 @@ handle_stdin (GIOChannel * channel, GIOCondition condition, gpointer data)
...
@@ -320,10 +336,12 @@ handle_stdin (GIOChannel * channel, GIOCondition condition, gpointer data)
}
}
else
if
(
!
g_ascii_strcasecmp
(
command
,
"visible"
))
else
if
(
!
g_ascii_strcasecmp
(
command
,
"visible"
))
{
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
;
if
(
!
g_ascii_strcasecmp
(
value
,
"false"
))
if
(
!
g_ascii_strcasecmp
(
value
,
"false"
))
gtk_status_icon_set_visible
(
status_icon
,
FALSE
);
gtk_status_icon_set_visible
(
status_icon
,
FALSE
);
else
else
gtk_status_icon_set_visible
(
status_icon
,
TRUE
);
gtk_status_icon_set_visible
(
status_icon
,
TRUE
);
G_GNUC_END_IGNORE_DEPRECATIONS
;
}
}
else
if
(
!
g_ascii_strcasecmp
(
command
,
"action"
))
else
if
(
!
g_ascii_strcasecmp
(
command
,
"action"
))
{
{
...
@@ -366,8 +384,11 @@ yad_notification_run ()
...
@@ -366,8 +384,11 @@ yad_notification_run ()
{
{
GIOChannel
*
channel
=
NULL
;
GIOChannel
*
channel
=
NULL
;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
;
status_icon
=
gtk_status_icon_new
();
status_icon
=
gtk_status_icon_new
();
G_GNUC_END_IGNORE_DEPRECATIONS
;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
;
if
(
options
.
data
.
dialog_text
)
if
(
options
.
data
.
dialog_text
)
{
{
if
(
!
options
.
data
.
no_markup
)
if
(
!
options
.
data
.
no_markup
)
...
@@ -377,6 +398,7 @@ yad_notification_run ()
...
@@ -377,6 +398,7 @@ yad_notification_run ()
}
}
else
else
gtk_status_icon_set_tooltip_text
(
status_icon
,
_
(
"Yad notification"
));
gtk_status_icon_set_tooltip_text
(
status_icon
,
_
(
"Yad notification"
));
G_GNUC_END_IGNORE_DEPRECATIONS
;
if
(
options
.
data
.
dialog_image
)
if
(
options
.
data
.
dialog_image
)
icon
=
g_strdup
(
options
.
data
.
dialog_image
);
icon
=
g_strdup
(
options
.
data
.
dialog_image
);
...
@@ -407,7 +429,9 @@ yad_notification_run ()
...
@@ -407,7 +429,9 @@ yad_notification_run ()
}
}
/* Show icon and wait */
/* Show icon and wait */
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
;
gtk_status_icon_set_visible
(
status_icon
,
!
options
.
notification_data
.
hidden
);
gtk_status_icon_set_visible
(
status_icon
,
!
options
.
notification_data
.
hidden
);
G_GNUC_END_IGNORE_DEPRECATIONS
;
if
(
options
.
data
.
timeout
>
0
)
if
(
options
.
data
.
timeout
>
0
)
g_timeout_add_seconds
(
options
.
data
.
timeout
,
(
GSourceFunc
)
timeout_cb
,
NULL
);
g_timeout_add_seconds
(
options
.
data
.
timeout
,
(
GSourceFunc
)
timeout_cb
,
NULL
);
...
...
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