|
@ -1,4 +1,5 @@ |
|
|
from PyQt5.QtWidgets import QApplication, QAction, QLabel, QDialogButtonBox, QDialog, QFileDialog, QMessageBox, QPushButton, QLineEdit, QCheckBox, QSpinBox, QDoubleSpinBox, QTableWidgetItem, QTabWidget, QComboBox, QWidget, QScrollArea, QMainWindow, QShortcut |
|
|
|
|
|
|
|
|
from PyQt5.QtWidgets import QApplication, QAction, QLabel, QDialogButtonBox, QDialog, QFileDialog, QMessageBox, QPushButton, QLineEdit, QCheckBox, QSpinBox, QDoubleSpinBox, QTableWidgetItem, QTabWidget, QComboBox, QWidget, QScrollArea, QMainWindow, QShortcut, QDialogButtonBox |
|
|
|
|
|
import sys |
|
|
|
|
|
|
|
|
class UnsavedMessageBox(QMessageBox): |
|
|
class UnsavedMessageBox(QMessageBox): |
|
|
""" |
|
|
""" |
|
@ -15,7 +16,12 @@ class UnsavedMessageBox(QMessageBox): |
|
|
self.setStandardButtons( |
|
|
self.setStandardButtons( |
|
|
QMessageBox.Save | QMessageBox.Discard | QMessageBox.Cancel) |
|
|
QMessageBox.Save | QMessageBox.Discard | QMessageBox.Cancel) |
|
|
self.setDefaultButton(QMessageBox.Save) |
|
|
self.setDefaultButton(QMessageBox.Save) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# If we are running on Haiku, use the MacOS button style to fit in more |
|
|
|
|
|
# with native applications |
|
|
|
|
|
if sys.platform.startswith("haiku"): |
|
|
|
|
|
buttonBox = self.findChild(QDialogButtonBox) |
|
|
|
|
|
buttonBox.setStyleSheet("* { button-layout: 1}") |
|
|
|
|
|
|
|
|
class UnreadableMessageBox(QMessageBox): |
|
|
class UnreadableMessageBox(QMessageBox): |
|
|
""" |
|
|
""" |
|
|