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
313ada99
Commit
313ada99
authored
Oct 22, 2020
by
Victor Ananjevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code cleanup
parent
8e2035ec
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
35 additions
and
40 deletions
+35
-40
calendar.c
src/calendar.c
+4
-3
form.c
src/form.c
+4
-4
html.c
src/html.c
+14
-14
icons.c
src/icons.c
+1
-2
list.c
src/list.c
+2
-2
main.c
src/main.c
+2
-7
print.c
src/print.c
+5
-4
progress.c
src/progress.c
+1
-2
text.c
src/text.c
+2
-2
No files found.
src/calendar.c
View file @
313ada99
...
...
@@ -43,14 +43,14 @@ parse_details ()
/* read details file */
while
(
!
feof
(
f
))
{
gchar
buf
[
4096
]
,
**
dtl
;
gchar
buf
[
4096
];
/* read string */
memset
(
buf
,
0
,
4096
);
fgets
(
buf
,
4096
,
f
);
if
(
strlen
(
buf
)
>
0
)
{
dtl
=
g_strsplit
(
buf
,
" "
,
2
);
gchar
**
dtl
=
g_strsplit
(
buf
,
" "
,
2
);
g_hash_table_insert
(
details
,
dtl
[
0
],
dtl
[
1
]);
}
}
...
...
@@ -75,7 +75,8 @@ get_details (GtkCalendar * cal, guint year, guint month, guint day, gpointer dat
if
(
str
)
return
g_strdup
(
str
);
return
str
;
return
NULL
;
}
static
void
...
...
src/form.c
View file @
313ada99
...
...
@@ -169,7 +169,7 @@ expand_action (gchar * cmd)
}
static
void
set_field_value
(
guint
num
,
gchar
*
value
)
set_field_value
(
guint
num
,
gchar
*
value
)
{
GtkWidget
*
w
;
gchar
**
s
;
...
...
@@ -370,7 +370,7 @@ set_field_value (guint num, gchar * value)
}
static
void
button_clicked_cb
(
GtkButton
*
b
,
gpointer
d
ata
)
button_clicked_cb
(
GtkButton
*
b
,
gpointer
d
)
{
gchar
*
action
=
(
gchar
*
)
g_object_get_data
(
G_OBJECT
(
b
),
"cmd"
);
...
...
@@ -1157,7 +1157,7 @@ form_create_widget (GtkWidget * dlg)
case
YAD_FIELD_TEXT
:
{
GtkWidget
*
l
,
*
sw
,
*
b
;
GtkWidget
*
sw
,
*
b
;
gchar
*
ltxt
;
if
(
fld
->
name
)
...
...
@@ -1440,7 +1440,7 @@ form_print_result (void)
guint
j
,
rows
;
rows
=
n_fields
/
options
.
form_data
.
columns
;
rows
+=
(
n_fields
%
options
.
form_data
.
columns
?
1
:
0
);
rows
+=
(
(
n_fields
%
options
.
form_data
.
columns
)
?
1
:
0
);
for
(
i
=
0
;
i
<
rows
;
i
++
)
{
for
(
j
=
0
;
j
<
options
.
form_data
.
columns
;
j
++
)
...
...
src/html.c
View file @
313ada99
...
...
@@ -320,7 +320,7 @@ GtkWidget *
html_create_widget
(
GtkWidget
*
dlg
)
{
GtkWidget
*
sw
;
WebKitSettings
*
settings
;
WebKitSettings
*
wk_
settings
;
sw
=
gtk_scrolled_window_new
(
NULL
,
NULL
);
gtk_scrolled_window_set_policy
(
GTK_SCROLLED_WINDOW
(
sw
),
options
.
hscroll_policy
,
options
.
vscroll_policy
);
...
...
@@ -328,17 +328,17 @@ html_create_widget (GtkWidget * dlg)
view
=
WEBKIT_WEB_VIEW
(
webkit_web_view_new
());
gtk_container_add
(
GTK_CONTAINER
(
sw
),
GTK_WIDGET
(
view
));
settings
=
webkit_settings_new
();
wk_
settings
=
webkit_settings_new
();
g_object_set
(
G_OBJECT
(
settings
),
"user-agent"
,
options
.
html_data
.
user_agent
,
NULL
);
g_object_set
(
G_OBJECT
(
wk_
settings
),
"user-agent"
,
options
.
html_data
.
user_agent
,
NULL
);
if
(
options
.
html_data
.
user_style
)
{
gchar
*
uri
=
g_filename_to_uri
(
options
.
html_data
.
user_style
,
NULL
,
NULL
);
g_object_set
(
G_OBJECT
(
settings
),
"user-stylesheet-uri"
,
uri
,
NULL
);
g_object_set
(
G_OBJECT
(
wk_
settings
),
"user-stylesheet-uri"
,
uri
,
NULL
);
}
webkit_web_view_set_settings
(
view
,
settings
);
webkit_web_view_set_settings
(
view
,
wk_
settings
);
webkit_settings_set_default_charset
(
settings
,
g_get_codeset
());
webkit_settings_set_default_charset
(
wk_
settings
,
g_get_codeset
());
g_signal_connect
(
view
,
"decide-policy"
,
G_CALLBACK
(
policy_cb
),
NULL
);
g_signal_connect
(
view
,
"load-changed"
,
G_CALLBACK
(
loaded_cb
),
NULL
);
...
...
@@ -353,14 +353,14 @@ html_create_widget (GtkWidget * dlg)
}
else
{
g_object_set
(
G_OBJECT
(
settings
),
"enable-caret-browsing"
,
FALSE
,
NULL
);
g_object_set
(
G_OBJECT
(
settings
),
"enable-developer-extras"
,
FALSE
,
NULL
);
g_object_set
(
G_OBJECT
(
settings
),
"enable-html5-database"
,
FALSE
,
NULL
);
g_object_set
(
G_OBJECT
(
settings
),
"enable-html5-local-storage"
,
FALSE
,
NULL
);
g_object_set
(
G_OBJECT
(
settings
),
"enable-offline-web-application-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-private-browsing"
,
TRUE
,
NULL
);
g_object_set
(
G_OBJECT
(
wk_
settings
),
"enable-caret-browsing"
,
FALSE
,
NULL
);
g_object_set
(
G_OBJECT
(
wk_
settings
),
"enable-developer-extras"
,
FALSE
,
NULL
);
g_object_set
(
G_OBJECT
(
wk_
settings
),
"enable-html5-database"
,
FALSE
,
NULL
);
g_object_set
(
G_OBJECT
(
wk_
settings
),
"enable-html5-local-storage"
,
FALSE
,
NULL
);
g_object_set
(
G_OBJECT
(
wk_
settings
),
"enable-offline-web-application-cache"
,
FALSE
,
NULL
);
g_object_set
(
G_OBJECT
(
wk_
settings
),
"enable-page-cache"
,
FALSE
,
NULL
);
g_object_set
(
G_OBJECT
(
wk_
settings
),
"enable-plugins"
,
FALSE
,
NULL
);
g_object_set
(
G_OBJECT
(
wk_
settings
),
"enable-private-browsing"
,
TRUE
,
NULL
);
}
gtk_widget_show_all
(
sw
);
...
...
src/icons.c
View file @
313ada99
...
...
@@ -311,8 +311,7 @@ parse_desktop_file (gchar * filename)
ext_pos
=
g_strrstr
(
nm
,
".desktop"
);
if
(
ext_pos
)
*
ext_pos
=
'\000'
;
ent
->
name
=
g_strdup
(
nm
);
g_free
(
nm
);
ent
->
name
=
nm
;
}
/* get tooltip */
...
...
src/list.c
View file @
313ada99
...
...
@@ -436,7 +436,7 @@ add_columns ()
gtk_tree_view_column_add_attribute
(
column
,
renderer
,
"font"
,
font_col
);
gtk_tree_view_column_set_sort_column_id
(
column
,
i
);
gtk_tree_view_column_set_resizable
(
column
,
TRUE
);
if
(
col
->
type
==
YAD_COLUMN_TIP
)
options
.
list_data
.
tooltip_column
=
i
+
1
;
break
;
...
...
@@ -757,7 +757,7 @@ get_data_as_string (GtkTreeIter *iter)
static
void
edit_row_cb
(
GtkMenuItem
*
item
,
gpointer
data
);
static
void
double_click_cb
(
GtkTreeView
*
view
,
GtkTreePath
*
path
,
GtkTreeViewColumn
*
column
,
gpointer
d
ata
)
double_click_cb
(
GtkTreeView
*
view
,
GtkTreePath
*
path
,
GtkTreeViewColumn
*
column
,
gpointer
d
)
{
GtkTreeModel
*
model
;
GtkTreeIter
iter
;
...
...
src/main.c
View file @
313ada99
...
...
@@ -270,16 +270,11 @@ create_layout (GtkWidget *dlg)
}
/* add expander */
imw
=
NULL
;
if
(
mw
&&
options
.
data
.
expander
)
{
exp
=
gtk_expander_new_with_mnemonic
(
options
.
data
.
expander
);
imw
=
exp
=
gtk_expander_new_with_mnemonic
(
options
.
data
.
expander
);
gtk_expander_set_expanded
(
GTK_EXPANDER
(
exp
),
FALSE
);
if
(
mw
)
{
gtk_container_add
(
GTK_CONTAINER
(
exp
),
mw
);
imw
=
exp
;
}
gtk_container_add
(
GTK_CONTAINER
(
exp
),
mw
);
}
else
imw
=
mw
;
...
...
src/print.c
View file @
313ada99
...
...
@@ -163,12 +163,13 @@ draw_page_image (GtkPrintOperation * op, GtkPrintContext * cnt, gint page, gpoin
pw
=
gtk_print_context_get_width
(
cnt
);
ph
=
gtk_print_context_get_height
(
cnt
);
if
(
options
.
print_data
.
headers
)
ph
-=
HEADER_HEIGHT
+
HEADER_GAP
;
/* create header */
if
(
options
.
print_data
.
headers
)
draw_header
(
cnt
,
1
,
1
);
{
ph
-=
HEADER_HEIGHT
+
HEADER_GAP
;
draw_header
(
cnt
,
1
,
1
);
}
/* scale image to page size */
pb
=
gdk_pixbuf_new_from_file
(
options
.
common_data
.
uri
,
NULL
);
...
...
@@ -425,7 +426,7 @@ yad_print_run (void)
fn
=
g_build_filename
(
g_get_user_config_dir
(),
"yad"
,
NULL
);
g_mkdir_with_parents
(
fn
,
0700
);
g_free
(
fn
);
fn
=
g_build_filename
(
g_get_user_config_dir
(),
"yad"
,
"print.conf"
,
NULL
);
gtk_print_settings_to_file
(
print_settings
,
fn
,
NULL
);
gtk_page_setup_to_file
(
page_setup
,
fn
,
NULL
);
...
...
src/progress.c
View file @
313ada99
...
...
@@ -310,11 +310,10 @@ progress_create_widget (GtkWidget *dlg)
}
gtk_progress_bar_set_inverted
(
GTK_PROGRESS_BAR
(
w
),
p
->
type
==
YAD_PROGRESS_RTL
);
if
(
options
.
common_data
.
vertical
)
gtk_orientable_set_orientation
(
GTK_ORIENTABLE
(
w
),
GTK_ORIENTATION_VERTICAL
);
if
(
options
.
common_data
.
vertical
)
{
gtk_orientable_set_orientation
(
GTK_ORIENTABLE
(
w
),
GTK_ORIENTATION_VERTICAL
);
gtk_grid_attach
(
GTK_GRID
(
table
),
w
,
i
,
0
,
1
,
1
);
gtk_widget_set_vexpand
(
w
,
TRUE
);
}
...
...
src/text.c
View file @
313ada99
...
...
@@ -198,8 +198,8 @@ motion_cb (GtkWidget * w, GdkEventMotion * ev, gpointer d)
tags
=
gtk_text_iter_get_tags
(
&
iter
);
for
(
tagp
=
tags
;
tagp
!=
NULL
;
tagp
=
tagp
->
next
)
{
GtkTextTag
*
t
ag
=
tagp
->
data
;
gint
link
=
GPOINTER_TO_INT
(
g_object_get_data
(
G_OBJECT
(
t
ag
),
"is_link"
));
GtkTextTag
*
t
=
tagp
->
data
;
gint
link
=
GPOINTER_TO_INT
(
g_object_get_data
(
G_OBJECT
(
t
),
"is_link"
));
if
(
link
)
{
...
...
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