Reformatted a comment; Renamed NT to WIN; Made OpenLPMixin constructor slightly more robust.

This commit is contained in:
Raoul Snyman 2014-09-04 22:10:34 +02:00
parent ceeb1b0118
commit 496c12b2db
3 changed files with 8 additions and 11 deletions

View File

@ -36,10 +36,9 @@ if __name__ == '__main__':
"""
Instantiate and run the application.
"""
# Mac OS X passes arguments like '-psn_XXXX' to gui application.
# This argument is process serial number. However, this causes
# conflict with other OpenLP arguments. Since we do not use this
# argument we can delete it to avoid any potential conflicts.
# Mac OS X passes arguments like '-psn_XXXX' to the application. This argument is actually a process serial number.
# However, this causes a conflict with other OpenLP arguments. Since we do not use this argument we can delete it
# to avoid any potential conflicts.
if sys.platform.startswith('darwin'):
sys.argv = [x for x in sys.argv if not x.startswith('-psn')]
main()

View File

@ -59,7 +59,7 @@ __all__ = ['OpenLP', 'main']
log = logging.getLogger()
NT_REPAIR_STYLESHEET = """
WIN_REPAIR_STYLESHEET = """
QMainWindow::separator
{
border: none;
@ -127,7 +127,7 @@ class OpenLP(OpenLPMixin, QtGui.QApplication):
'QTableWidget, QListWidget, QTreeWidget {alternate-background-color: ' + base_color.name() + ';}\n'
application_stylesheet += alternate_rows_repair_stylesheet
if is_win():
application_stylesheet += NT_REPAIR_STYLESHEET
application_stylesheet += WIN_REPAIR_STYLESHEET
if application_stylesheet:
self.setStyleSheet(application_stylesheet)
show_splash = Settings().value('core/show splash')

View File

@ -33,6 +33,7 @@ import logging
import inspect
from openlp.core.common import trace_error_handler
DO_NOT_TRACE_EVENTS = ['timerEvent', 'paintEvent', 'drag_enter_event', 'drop_event', 'on_controller_size_changed',
'preview_size_changed', 'resizeEvent']
@ -41,11 +42,8 @@ class OpenLPMixin(object):
"""
Base Calling object for OpenLP classes.
"""
def __init__(self, parent):
try:
super(OpenLPMixin, self).__init__(parent)
except TypeError:
super(OpenLPMixin, self).__init__()
def __init__(self, *args, **kwargs):
super(OpenLPMixin, self).__init__(*args, **kwargs)
self.logger = logging.getLogger("%s.%s" % (self.__module__, self.__class__.__name__))
if self.logger.getEffectiveLevel() == logging.DEBUG:
for name, m in inspect.getmembers(self, inspect.ismethod):