forked from openlp/openlp
r1420
This commit is contained in:
commit
4c81c55918
22
openlp.pyw
22
openlp.pyw
@ -71,14 +71,12 @@ class OpenLP(QtGui.QApplication):
|
|||||||
The core application class. This class inherits from Qt's QApplication
|
The core application class. This class inherits from Qt's QApplication
|
||||||
class in order to provide the core of the application.
|
class in order to provide the core of the application.
|
||||||
"""
|
"""
|
||||||
log.info(u'OpenLP Application Loaded')
|
app_version = None
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
"""
|
"""
|
||||||
Run the OpenLP application.
|
Run the OpenLP application.
|
||||||
"""
|
"""
|
||||||
app_version = get_application_version(
|
|
||||||
u'--dev-version' in sys.argv or u'-d' in sys.argv)
|
|
||||||
# provide a listener for widgets to reqest a screen update.
|
# provide a listener for widgets to reqest a screen update.
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'openlp_process_events'), self.processEvents)
|
QtCore.SIGNAL(u'openlp_process_events'), self.processEvents)
|
||||||
@ -86,10 +84,6 @@ class OpenLP(QtGui.QApplication):
|
|||||||
QtCore.SIGNAL(u'cursor_busy'), self.setBusyCursor)
|
QtCore.SIGNAL(u'cursor_busy'), self.setBusyCursor)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'cursor_normal'), self.setNormalCursor)
|
QtCore.SIGNAL(u'cursor_normal'), self.setNormalCursor)
|
||||||
self.setOrganizationName(u'OpenLP')
|
|
||||||
self.setOrganizationDomain(u'openlp.org')
|
|
||||||
self.setApplicationName(u'OpenLP')
|
|
||||||
self.setApplicationVersion(app_version[u'version'])
|
|
||||||
# Decide how many screens we have and their size
|
# Decide how many screens we have and their size
|
||||||
screens = ScreenList(self.desktop())
|
screens = ScreenList(self.desktop())
|
||||||
# First time checks in settings
|
# First time checks in settings
|
||||||
@ -109,7 +103,8 @@ class OpenLP(QtGui.QApplication):
|
|||||||
# make sure Qt really display the splash screen
|
# make sure Qt really display the splash screen
|
||||||
self.processEvents()
|
self.processEvents()
|
||||||
# start the main app window
|
# start the main app window
|
||||||
self.mainWindow = MainWindow(screens, app_version, self.clipboard())
|
self.mainWindow = MainWindow(screens, self.app_version,
|
||||||
|
self.clipboard())
|
||||||
self.mainWindow.show()
|
self.mainWindow.show()
|
||||||
if show_splash:
|
if show_splash:
|
||||||
# now kill the splashscreen
|
# now kill the splashscreen
|
||||||
@ -121,7 +116,7 @@ class OpenLP(QtGui.QApplication):
|
|||||||
update_check = QtCore.QSettings().value(
|
update_check = QtCore.QSettings().value(
|
||||||
u'general/update check', QtCore.QVariant(True)).toBool()
|
u'general/update check', QtCore.QVariant(True)).toBool()
|
||||||
if update_check:
|
if update_check:
|
||||||
VersionThread(self.mainWindow, app_version).start()
|
VersionThread(self.mainWindow, self.app_version).start()
|
||||||
return self.exec_()
|
return self.exec_()
|
||||||
|
|
||||||
def hookException(self, exctype, value, traceback):
|
def hookException(self, exctype, value, traceback):
|
||||||
@ -196,11 +191,12 @@ def main():
|
|||||||
qInitResources()
|
qInitResources()
|
||||||
# Now create and actually run the application.
|
# Now create and actually run the application.
|
||||||
app = OpenLP(qt_args)
|
app = OpenLP(qt_args)
|
||||||
# Define the settings environment
|
app.setOrganizationName(u'OpenLP')
|
||||||
settings = QtCore.QSettings(u'OpenLP', u'OpenLP')
|
app.setOrganizationDomain(u'openlp.org')
|
||||||
|
app.setApplicationName(u'OpenLP')
|
||||||
|
app.setApplicationVersion(app.get_version()[u'version'])
|
||||||
# First time checks in settings
|
# First time checks in settings
|
||||||
# Use explicit reference as not inside a QT environment yet
|
if not QtCore.QSettings().value(u'general/has run wizard',
|
||||||
if not settings.value(u'general/has run wizard',
|
|
||||||
QtCore.QVariant(False)).toBool():
|
QtCore.QVariant(False)).toBool():
|
||||||
if not FirstTimeLanguageForm().exec_():
|
if not FirstTimeLanguageForm().exec_():
|
||||||
# if cancel then stop processing
|
# if cancel then stop processing
|
||||||
|
@ -256,7 +256,6 @@ class Ui_MainWindow(object):
|
|||||||
u':/system/system_about.png')
|
u':/system/system_about.png')
|
||||||
mainWindow.actionList.add_action(self.HelpAboutItem, u'Help')
|
mainWindow.actionList.add_action(self.HelpAboutItem, u'Help')
|
||||||
self.HelpOnlineHelpItem = base_action(mainWindow, u'HelpOnlineHelpItem')
|
self.HelpOnlineHelpItem = base_action(mainWindow, u'HelpOnlineHelpItem')
|
||||||
self.HelpOnlineHelpItem.setEnabled(False)
|
|
||||||
mainWindow.actionList.add_action(self.HelpOnlineHelpItem, u'Help')
|
mainWindow.actionList.add_action(self.HelpOnlineHelpItem, u'Help')
|
||||||
self.helpWebSiteItem = base_action(mainWindow, u'helpWebSiteItem')
|
self.helpWebSiteItem = base_action(mainWindow, u'helpWebSiteItem')
|
||||||
mainWindow.actionList.add_action(self.helpWebSiteItem, u'Help')
|
mainWindow.actionList.add_action(self.helpWebSiteItem, u'Help')
|
||||||
@ -304,7 +303,6 @@ class Ui_MainWindow(object):
|
|||||||
self.ExportLanguageItem.setVisible(False)
|
self.ExportLanguageItem.setVisible(False)
|
||||||
self.SettingsShortcutsItem.setVisible(False)
|
self.SettingsShortcutsItem.setVisible(False)
|
||||||
self.HelpDocumentationItem.setVisible(False)
|
self.HelpDocumentationItem.setVisible(False)
|
||||||
self.HelpOnlineHelpItem.setVisible(False)
|
|
||||||
|
|
||||||
def retranslateUi(self, mainWindow):
|
def retranslateUi(self, mainWindow):
|
||||||
"""
|
"""
|
||||||
@ -430,6 +428,9 @@ class Ui_MainWindow(object):
|
|||||||
translate('OpenLP.MainWindow', 'Ctrl+F1'))
|
translate('OpenLP.MainWindow', 'Ctrl+F1'))
|
||||||
self.HelpOnlineHelpItem.setText(
|
self.HelpOnlineHelpItem.setText(
|
||||||
translate('OpenLP.MainWindow', '&Online Help'))
|
translate('OpenLP.MainWindow', '&Online Help'))
|
||||||
|
# Uncomment after 1.9.5 beta string freeze
|
||||||
|
#self.HelpOnlineHelpItem.setShortcut(
|
||||||
|
# translate('OpenLP.MainWindow', 'F1'))
|
||||||
self.helpWebSiteItem.setText(
|
self.helpWebSiteItem.setText(
|
||||||
translate('OpenLP.MainWindow', '&Web Site'))
|
translate('OpenLP.MainWindow', '&Web Site'))
|
||||||
for item in self.LanguageGroup.actions():
|
for item in self.LanguageGroup.actions():
|
||||||
@ -530,6 +531,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
self.ViewThemeManagerItem.setChecked)
|
self.ViewThemeManagerItem.setChecked)
|
||||||
QtCore.QObject.connect(self.helpWebSiteItem,
|
QtCore.QObject.connect(self.helpWebSiteItem,
|
||||||
QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked)
|
QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked)
|
||||||
|
QtCore.QObject.connect(self.HelpOnlineHelpItem,
|
||||||
|
QtCore.SIGNAL(u'triggered()'), self.onHelpOnLineHelpClicked)
|
||||||
QtCore.QObject.connect(self.HelpAboutItem,
|
QtCore.QObject.connect(self.HelpAboutItem,
|
||||||
QtCore.SIGNAL(u'triggered()'), self.onHelpAboutItemClicked)
|
QtCore.SIGNAL(u'triggered()'), self.onHelpAboutItemClicked)
|
||||||
QtCore.QObject.connect(self.ToolsOpenDataFolder,
|
QtCore.QObject.connect(self.ToolsOpenDataFolder,
|
||||||
@ -720,6 +723,13 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
import webbrowser
|
import webbrowser
|
||||||
webbrowser.open_new(u'http://openlp.org/')
|
webbrowser.open_new(u'http://openlp.org/')
|
||||||
|
|
||||||
|
def onHelpOnLineHelpClicked(self):
|
||||||
|
"""
|
||||||
|
Load the online OpenLP manual
|
||||||
|
"""
|
||||||
|
import webbrowser
|
||||||
|
webbrowser.open_new(u'http://manual.openlp.org/')
|
||||||
|
|
||||||
def onHelpAboutItemClicked(self):
|
def onHelpAboutItemClicked(self):
|
||||||
"""
|
"""
|
||||||
Show the About form
|
Show the About form
|
||||||
|
@ -123,9 +123,7 @@ class LanguageManager(object):
|
|||||||
language = unicode(qm_list[action_name])
|
language = unicode(qm_list[action_name])
|
||||||
if LanguageManager.auto_language:
|
if LanguageManager.auto_language:
|
||||||
language = u'[%s]' % language
|
language = u'[%s]' % language
|
||||||
# This needs to be here for the setValue to work
|
QtCore.QSettings().setValue(
|
||||||
settings = QtCore.QSettings(u'OpenLP', u'OpenLP')
|
|
||||||
settings.setValue(
|
|
||||||
u'general/language', QtCore.QVariant(language))
|
u'general/language', QtCore.QVariant(language))
|
||||||
log.info(u'Language file: \'%s\' written to conf file' % language)
|
log.info(u'Language file: \'%s\' written to conf file' % language)
|
||||||
if message:
|
if message:
|
||||||
|
Loading…
Reference in New Issue
Block a user