Fixed bug #7999411: Trap for some missing UNO constants on some systems.

Fixed bug #7432732: Add missing MetaModifier key check in the shortcuts dialog, so hopefully better shortcuts can be set on OS X.

bzr-revno: 1656
This commit is contained in:
Raoul Snyman 2011-06-24 12:14:50 +02:00
commit 7e91aad9e8
3 changed files with 16 additions and 8 deletions

View File

@ -98,6 +98,9 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
if event.modifiers() & QtCore.Qt.ShiftModifier == \
QtCore.Qt.ShiftModifier:
key_string = u'Shift+' + key_string
if event.modifiers() & QtCore.Qt.MetaModifier == \
QtCore.Qt.MetaModifier:
key_string = u'Meta+' + key_string
key_sequence = QtGui.QKeySequence(key_string)
if self._validiate_shortcut(self._currentItemAction(), key_sequence):
if self.primaryPushButton.isChecked():

View File

@ -37,14 +37,16 @@ log = logging.getLogger(__name__)
if os.name == u'nt':
from win32com.client import Dispatch
PAGE_BEFORE = 4
PAGE_AFTER = 5
PAGE_BOTH = 6
NoConnectException = Exception
else:
import uno
from com.sun.star.connection import NoConnectException
try:
from com.sun.star.style.BreakType import PAGE_BEFORE, PAGE_AFTER, PAGE_BOTH
except ImportError:
PAGE_BEFORE = 4
PAGE_AFTER = 5
PAGE_BOTH = 6
class OooImport(SongImport):
"""

View File

@ -41,20 +41,23 @@ from oooimport import OooImport
log = logging.getLogger(__name__)
if os.name == u'nt':
BOLD = 150.0
ITALIC = 2
from oooimport import PAGE_BEFORE, PAGE_AFTER, PAGE_BOTH
RuntimeException = Exception
else:
try:
from com.sun.star.awt.FontWeight import BOLD
from com.sun.star.awt.FontSlant import ITALIC
from com.sun.star.style.BreakType import PAGE_BEFORE, PAGE_AFTER, \
PAGE_BOTH
from com.sun.star.uno import RuntimeException
except ImportError:
pass
try:
from com.sun.star.awt.FontWeight import BOLD
except ImportError:
BOLD = 150.0
try:
from com.sun.star.awt.FontSlant import ITALIC
except ImportError:
ITALIC = 2
class SofImport(OooImport):
"""