Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
dart_pdf
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
David PHAM-VAN
2021-12-15 06:41:12 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e22f86cff3ccd382eab1fd95e5eaaf1f11d199a8
e22f86cf
1 parent
0e07e485
Fix print dialog crash on Linux
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
4 deletions
printing/CHANGELOG.md
printing/linux/print_job.cc
printing/linux/print_job.h
printing/pubspec.yaml
printing/CHANGELOG.md
View file @
e22f86c
# Changelog
## 5.6.8
-
Fix print dialog crash on Linux
## 5.6.7
-
Fix imports for Dart 2.15
...
...
printing/linux/print_job.cc
View file @
e22f86c
...
...
@@ -105,6 +105,9 @@ static void job_completed(GtkPrintJob* gtk_print_job,
gpointer
user_data
,
const
GError
*
error
)
{
auto
job
=
static_cast
<
print_job
*>
(
user_data
);
if
(
job
->
dialog
)
{
gtk_widget_destroy
(
GTK_WIDGET
(
job
->
dialog
));
}
on_completed
(
job
,
error
==
nullptr
,
error
!=
nullptr
?
error
->
message
:
nullptr
);
}
...
...
@@ -135,8 +138,7 @@ bool print_job::print_pdf(const gchar* name,
setup
=
gtk_page_setup_new
();
}
else
{
auto
dialog
=
GTK_PRINT_UNIX_DIALOG
(
gtk_print_unix_dialog_new
(
name
,
nullptr
));
dialog
=
GTK_PRINT_UNIX_DIALOG
(
gtk_print_unix_dialog_new
(
name
,
nullptr
));
gtk_print_unix_dialog_set_manual_capabilities
(
dialog
,
(
GtkPrintCapabilities
)(
GTK_PRINT_CAPABILITY_GENERATE_PDF
));
gtk_print_unix_dialog_set_embed_page_setup
(
dialog
,
true
);
...
...
@@ -157,7 +159,7 @@ bool print_job::print_pdf(const gchar* name,
gtk_print_unix_dialog_get_settings
(
GTK_PRINT_UNIX_DIALOG
(
dialog
));
setup
=
gtk_print_unix_dialog_get_page_setup
(
GTK_PRINT_UNIX_DIALOG
(
dialog
));
gtk_widget_
destroy
(
GTK_WIDGET
(
dialog
));
gtk_widget_
hide
(
GTK_WIDGET
(
dialog
));
loop
=
false
;
}
break
;
case
GTK_RESPONSE_APPLY
:
// Preview
...
...
printing/linux/print_job.h
View file @
e22f86c
...
...
@@ -31,6 +31,8 @@ class print_job {
GtkPrintJob
*
printJob
;
public
:
GtkPrintUnixDialog
*
dialog
=
nullptr
;
print_job
(
int
index
);
~
print_job
();
...
...
printing/pubspec.yaml
View file @
e22f86c
...
...
@@ -6,7 +6,7 @@ description: >
homepage
:
https://github.com/DavBfr/dart_pdf/tree/master/printing
repository
:
https://github.com/DavBfr/dart_pdf
issue_tracker
:
https://github.com/DavBfr/dart_pdf/issues
version
:
5.6.
7
version
:
5.6.
8
environment
:
sdk
:
"
>=2.12.0
<3.0.0"
...
...
Please
register
or
login
to post a comment