parent
3dfa36fad1
commit
53620ecce4
@ -64,6 +64,7 @@ Fixes
|
|||||||
|
|
||||||
- Fixed empty space being shown after tabs in the tabbar in some cases.
|
- Fixed empty space being shown after tabs in the tabbar in some cases.
|
||||||
- Fixed `:restart` in private browsing mode.
|
- Fixed `:restart` in private browsing mode.
|
||||||
|
- Fixed printing on macOS.
|
||||||
|
|
||||||
v0.11.0
|
v0.11.0
|
||||||
-------
|
-------
|
||||||
|
@ -20,11 +20,12 @@
|
|||||||
"""Command dispatcher for TabbedBrowser."""
|
"""Command dispatcher for TabbedBrowser."""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import os.path
|
import os.path
|
||||||
import shlex
|
import shlex
|
||||||
import functools
|
import functools
|
||||||
|
|
||||||
from PyQt5.QtWidgets import QApplication, QTabBar
|
from PyQt5.QtWidgets import QApplication, QTabBar, QDialog
|
||||||
from PyQt5.QtCore import Qt, QUrl, QEvent, QUrlQuery
|
from PyQt5.QtCore import Qt, QUrl, QEvent, QUrlQuery
|
||||||
from PyQt5.QtGui import QKeyEvent
|
from PyQt5.QtGui import QKeyEvent
|
||||||
from PyQt5.QtPrintSupport import QPrintDialog, QPrintPreviewDialog
|
from PyQt5.QtPrintSupport import QPrintDialog, QPrintPreviewDialog
|
||||||
@ -436,9 +437,18 @@ class CommandDispatcher:
|
|||||||
message.error("Printing failed!")
|
message.error("Printing failed!")
|
||||||
diag.deleteLater()
|
diag.deleteLater()
|
||||||
|
|
||||||
|
def do_print():
|
||||||
|
"""Called when the dialog was closed."""
|
||||||
|
tab.printing.to_printer(diag.printer(), print_callback)
|
||||||
|
|
||||||
diag = QPrintDialog(tab)
|
diag = QPrintDialog(tab)
|
||||||
diag.open(lambda: tab.printing.to_printer(diag.printer(),
|
if sys.platform == 'darwin':
|
||||||
print_callback))
|
# For some reason we get a segfault when using open() on macOS
|
||||||
|
ret = diag.exec_()
|
||||||
|
if ret == QDialog.Accepted:
|
||||||
|
do_print()
|
||||||
|
else:
|
||||||
|
diag.open(do_print)
|
||||||
|
|
||||||
@cmdutils.register(instance='command-dispatcher', name='print',
|
@cmdutils.register(instance='command-dispatcher', name='print',
|
||||||
scope='window')
|
scope='window')
|
||||||
|
Loading…
Reference in New Issue
Block a user