mirror of https://gitlab.com/openlp/openlp.git
Correct settingsSection naming convention
This commit is contained in:
parent
b81160768b
commit
5a7e36b5bc
|
@ -98,7 +98,7 @@ class MediaManagerItem(QtGui.QWidget):
|
||||||
"""
|
"""
|
||||||
QtGui.QWidget.__init__(self)
|
QtGui.QWidget.__init__(self)
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.settings_section = title.lower()
|
self.settingsSection = title.lower()
|
||||||
if type(icon) is QtGui.QIcon:
|
if type(icon) is QtGui.QIcon:
|
||||||
self.icon = icon
|
self.icon = icon
|
||||||
elif type(icon) is types.StringType:
|
elif type(icon) is types.StringType:
|
||||||
|
@ -331,15 +331,15 @@ class MediaManagerItem(QtGui.QWidget):
|
||||||
def onFileClick(self):
|
def onFileClick(self):
|
||||||
files = QtGui.QFileDialog.getOpenFileNames(
|
files = QtGui.QFileDialog.getOpenFileNames(
|
||||||
self, self.OnNewPrompt,
|
self, self.OnNewPrompt,
|
||||||
SettingsManager.get_last_dir(self.settings_section),
|
SettingsManager.get_last_dir(self.settingsSection),
|
||||||
self.OnNewFileMasks)
|
self.OnNewFileMasks)
|
||||||
log.info(u'New files(s) %s', unicode(files))
|
log.info(u'New files(s) %s', unicode(files))
|
||||||
if files:
|
if files:
|
||||||
self.loadList(files)
|
self.loadList(files)
|
||||||
dir = os.path.split(unicode(files[0]))[0]
|
dir = os.path.split(unicode(files[0]))[0]
|
||||||
SettingsManager.set_last_dir(self.settings_section, dir)
|
SettingsManager.set_last_dir(self.settingsSection, dir)
|
||||||
SettingsManager.set_list(self.settings_section,
|
SettingsManager.set_list(self.settingsSection,
|
||||||
self.settings_section, self.getFileList())
|
self.settingsSection, self.getFileList())
|
||||||
|
|
||||||
def getFileList(self):
|
def getFileList(self):
|
||||||
count = 0
|
count = 0
|
||||||
|
|
|
@ -51,7 +51,7 @@ class Plugin(QtCore.QObject):
|
||||||
``version``
|
``version``
|
||||||
The version number of this iteration of the plugin.
|
The version number of this iteration of the plugin.
|
||||||
|
|
||||||
``settings_section``
|
``settingsSection``
|
||||||
The namespace to store settings for the plugin.
|
The namespace to store settings for the plugin.
|
||||||
|
|
||||||
``icon``
|
``icon``
|
||||||
|
@ -116,7 +116,7 @@ class Plugin(QtCore.QObject):
|
||||||
self.name = name
|
self.name = name
|
||||||
if version:
|
if version:
|
||||||
self.version = version
|
self.version = version
|
||||||
self.settings_section = self.name.lower()
|
self.settingsSection = self.name.lower()
|
||||||
self.icon = None
|
self.icon = None
|
||||||
self.weight = 0
|
self.weight = 0
|
||||||
self.status = PluginStatus.Inactive
|
self.status = PluginStatus.Inactive
|
||||||
|
@ -147,7 +147,7 @@ class Plugin(QtCore.QObject):
|
||||||
Sets the status of the plugin
|
Sets the status of the plugin
|
||||||
"""
|
"""
|
||||||
self.status = QtCore.QSettings().value(
|
self.status = QtCore.QSettings().value(
|
||||||
self.settings_section + u'/status',
|
self.settingsSection + u'/status',
|
||||||
QtCore.QVariant(PluginStatus.Inactive)).toInt()[0]
|
QtCore.QVariant(PluginStatus.Inactive)).toInt()[0]
|
||||||
|
|
||||||
def toggle_status(self, new_status):
|
def toggle_status(self, new_status):
|
||||||
|
@ -156,7 +156,7 @@ class Plugin(QtCore.QObject):
|
||||||
"""
|
"""
|
||||||
self.status = new_status
|
self.status = new_status
|
||||||
QtCore.QSettings().setValue(
|
QtCore.QSettings().setValue(
|
||||||
self.settings_section + u'/status', QtCore.QVariant(self.status))
|
self.settingsSection + u'/status', QtCore.QVariant(self.status))
|
||||||
|
|
||||||
def is_active(self):
|
def is_active(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -40,7 +40,7 @@ class SettingsTab(QtGui.QWidget):
|
||||||
QtGui.QWidget.__init__(self)
|
QtGui.QWidget.__init__(self)
|
||||||
self.tabTitle = title
|
self.tabTitle = title
|
||||||
self.tabTitleVisible = None
|
self.tabTitleVisible = None
|
||||||
self.settings_section = self.tabTitle.lower()
|
self.settingsSection = self.tabTitle.lower()
|
||||||
self.setupUi()
|
self.setupUi()
|
||||||
self.retranslateUi()
|
self.retranslateUi()
|
||||||
self.initialise()
|
self.initialise()
|
||||||
|
|
|
@ -178,7 +178,7 @@ class DisplayTab(SettingsTab):
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(self.settings_section)
|
settings.beginGroup(self.settingsSection)
|
||||||
self.Xpos.setText(unicode(self.screens.current[u'size'].x()))
|
self.Xpos.setText(unicode(self.screens.current[u'size'].x()))
|
||||||
self.Ypos.setText(unicode(self.screens.current[u'size'].y()))
|
self.Ypos.setText(unicode(self.screens.current[u'size'].y()))
|
||||||
self.Height.setText(unicode(self.screens.current[u'size'].height()))
|
self.Height.setText(unicode(self.screens.current[u'size'].height()))
|
||||||
|
@ -208,7 +208,7 @@ class DisplayTab(SettingsTab):
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(self.settings_section)
|
settings.beginGroup(self.settingsSection)
|
||||||
settings.setValue('x position',
|
settings.setValue('x position',
|
||||||
QtCore.QVariant(self.XposEdit.text()))
|
QtCore.QVariant(self.XposEdit.text()))
|
||||||
settings.setValue('y position',
|
settings.setValue('y position',
|
||||||
|
|
|
@ -42,7 +42,7 @@ class GeneralTab(SettingsTab):
|
||||||
If not set before default to last screen.
|
If not set before default to last screen.
|
||||||
"""
|
"""
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(self.settings_section)
|
settings.beginGroup(self.settingsSection)
|
||||||
self.MonitorNumber = settings.value(u'monitor',
|
self.MonitorNumber = settings.value(u'monitor',
|
||||||
QtCore.QVariant(self.screens.monitor_number)).toInt()[0]
|
QtCore.QVariant(self.screens.monitor_number)).toInt()[0]
|
||||||
self.screens.set_current_display(self.MonitorNumber)
|
self.screens.set_current_display(self.MonitorNumber)
|
||||||
|
@ -229,7 +229,7 @@ class GeneralTab(SettingsTab):
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(self.settings_section)
|
settings.beginGroup(self.settingsSection)
|
||||||
for screen in self.screens.screen_list:
|
for screen in self.screens.screen_list:
|
||||||
screen_name = u'%s %d' % (self.trUtf8('Screen'),
|
screen_name = u'%s %d' % (self.trUtf8('Screen'),
|
||||||
screen[u'number'] + 1)
|
screen[u'number'] + 1)
|
||||||
|
@ -268,7 +268,7 @@ class GeneralTab(SettingsTab):
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(self.settings_section)
|
settings.beginGroup(self.settingsSection)
|
||||||
settings.setValue(u'monitor', QtCore.QVariant(self.MonitorNumber))
|
settings.setValue(u'monitor', QtCore.QVariant(self.MonitorNumber))
|
||||||
settings.setValue(u'display on monitor',
|
settings.setValue(u'display on monitor',
|
||||||
QtCore.QVariant(self.DisplayOnMonitor))
|
QtCore.QVariant(self.DisplayOnMonitor))
|
||||||
|
|
|
@ -426,10 +426,10 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
self.applicationVersion = applicationVersion
|
self.applicationVersion = applicationVersion
|
||||||
# Set up settings sections for the main application
|
# Set up settings sections for the main application
|
||||||
# (not for use by plugins)
|
# (not for use by plugins)
|
||||||
self.ui_settings_section = u'user interface'
|
self.uiSettingsSection = u'user interface'
|
||||||
self.general_settings_section = u'general'
|
self.generalSettingsSection = u'general'
|
||||||
self.service_settings_section = u'servicemanager'
|
self.serviceSettingsSection = u'servicemanager'
|
||||||
self.songs_settings_section = u'songs'
|
self.songsSettingsSection = u'songs'
|
||||||
self.serviceNotSaved = False
|
self.serviceNotSaved = False
|
||||||
self.settingsmanager = SettingsManager(screens)
|
self.settingsmanager = SettingsManager(screens)
|
||||||
self.displayManager = DisplayManager(screens)
|
self.displayManager = DisplayManager(screens)
|
||||||
|
@ -576,7 +576,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
self.displayManager.mainDisplay.setFocus()
|
self.displayManager.mainDisplay.setFocus()
|
||||||
self.activateWindow()
|
self.activateWindow()
|
||||||
if QtCore.QSettings().value(
|
if QtCore.QSettings().value(
|
||||||
self.general_settings_section + u'/auto open',
|
self.generalSettingsSection + u'/auto open',
|
||||||
QtCore.QVariant(False)).toBool():
|
QtCore.QVariant(False)).toBool():
|
||||||
self.ServiceManagerContents.onLoadService(True)
|
self.ServiceManagerContents.onLoadService(True)
|
||||||
|
|
||||||
|
@ -586,7 +586,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
Triggered by delay thread.
|
Triggered by delay thread.
|
||||||
"""
|
"""
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(self.general_settings_section)
|
settings.beginGroup(self.generalSettingsSection)
|
||||||
if settings.value(u'screen blank', QtCore.QVariant(False)).toBool() \
|
if settings.value(u'screen blank', QtCore.QVariant(False)).toBool() \
|
||||||
and settings.value(u'blank warning', QtCore.QVariant(False)).toBool():
|
and settings.value(u'blank warning', QtCore.QVariant(False)).toBool():
|
||||||
self.LiveController.onBlankDisplay(True)
|
self.LiveController.onBlankDisplay(True)
|
||||||
|
@ -731,10 +731,10 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
def loadSettings(self):
|
def loadSettings(self):
|
||||||
log.debug(u'Loading QSettings')
|
log.debug(u'Loading QSettings')
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(self.general_settings_section)
|
settings.beginGroup(self.generalSettingsSection)
|
||||||
self.recentFiles = settings.value(u'recent files').toStringList()
|
self.recentFiles = settings.value(u'recent files').toStringList()
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
settings.beginGroup(self.ui_settings_section)
|
settings.beginGroup(self.uiSettingsSection)
|
||||||
self.move(settings.value(u'main window position',
|
self.move(settings.value(u'main window position',
|
||||||
QtCore.QVariant(QtCore.QPoint(0, 0))).toPoint())
|
QtCore.QVariant(QtCore.QPoint(0, 0))).toPoint())
|
||||||
self.restoreGeometry(
|
self.restoreGeometry(
|
||||||
|
@ -745,12 +745,12 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
def saveSettings(self):
|
def saveSettings(self):
|
||||||
log.debug(u'Saving QSettings')
|
log.debug(u'Saving QSettings')
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(self.general_settings_section)
|
settings.beginGroup(self.generalSettingsSection)
|
||||||
recentFiles = QtCore.QVariant(self.recentFiles) \
|
recentFiles = QtCore.QVariant(self.recentFiles) \
|
||||||
if self.recentFiles else QtCore.QVariant()
|
if self.recentFiles else QtCore.QVariant()
|
||||||
settings.setValue(u'recent files', recentFiles)
|
settings.setValue(u'recent files', recentFiles)
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
settings.beginGroup(self.ui_settings_section)
|
settings.beginGroup(self.uiSettingsSection)
|
||||||
settings.setValue(u'main window position',
|
settings.setValue(u'main window position',
|
||||||
QtCore.QVariant(self.pos()))
|
QtCore.QVariant(self.pos()))
|
||||||
settings.setValue(u'main window state',
|
settings.setValue(u'main window state',
|
||||||
|
@ -780,7 +780,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
|
|
||||||
def addRecentFile(self, filename):
|
def addRecentFile(self, filename):
|
||||||
recentFileCount = QtCore.QSettings().value(
|
recentFileCount = QtCore.QSettings().value(
|
||||||
self.general_settings_section + u'/max recent files',
|
self.generalSettingsSection + u'/max recent files',
|
||||||
QtCore.QVariant(4)).toInt()[0]
|
QtCore.QVariant(4)).toInt()[0]
|
||||||
if filename and not self.recentFiles.contains(filename):
|
if filename and not self.recentFiles.contains(filename):
|
||||||
self.recentFiles.prepend(QtCore.QString(filename))
|
self.recentFiles.prepend(QtCore.QString(filename))
|
||||||
|
|
|
@ -45,7 +45,7 @@ class MediaDockManager(object):
|
||||||
log.debug(u'Inserting %s dock' % media_item.title)
|
log.debug(u'Inserting %s dock' % media_item.title)
|
||||||
match = False
|
match = False
|
||||||
for dock_index in range(0, self.media_dock.count()):
|
for dock_index in range(0, self.media_dock.count()):
|
||||||
if self.media_dock.widget(dock_index).settings_section == \
|
if self.media_dock.widget(dock_index).settingsSection == \
|
||||||
media_item.title.lower():
|
media_item.title.lower():
|
||||||
match = True
|
match = True
|
||||||
break
|
break
|
||||||
|
@ -56,6 +56,6 @@ class MediaDockManager(object):
|
||||||
log.debug(u'remove %s dock' % name)
|
log.debug(u'remove %s dock' % name)
|
||||||
for dock_index in range(0, self.media_dock.count()):
|
for dock_index in range(0, self.media_dock.count()):
|
||||||
if self.media_dock.widget(dock_index):
|
if self.media_dock.widget(dock_index):
|
||||||
if self.media_dock.widget(dock_index).settings_section == name:
|
if self.media_dock.widget(dock_index).settingsSection == name:
|
||||||
self.media_dock.widget(dock_index).hide()
|
self.media_dock.widget(dock_index).hide()
|
||||||
self.media_dock.removeItem(dock_index)
|
self.media_dock.removeItem(dock_index)
|
||||||
|
|
|
@ -191,7 +191,7 @@ class ServiceManager(QtGui.QWidget):
|
||||||
QtCore.SIGNAL(u'config_updated'), self.regenerateServiceItems)
|
QtCore.SIGNAL(u'config_updated'), self.regenerateServiceItems)
|
||||||
# Last little bits of setting up
|
# Last little bits of setting up
|
||||||
self.service_theme = unicode(QtCore.QSettings().value(
|
self.service_theme = unicode(QtCore.QSettings().value(
|
||||||
self.parent.service_settings_section + u'/service theme',
|
self.parent.serviceSettingsSection + u'/service theme',
|
||||||
QtCore.QVariant(u'')).toString())
|
QtCore.QVariant(u'')).toString())
|
||||||
self.servicePath = AppLocation.get_section_data_path(u'servicemanager')
|
self.servicePath = AppLocation.get_section_data_path(u'servicemanager')
|
||||||
#build the context menu
|
#build the context menu
|
||||||
|
@ -404,7 +404,7 @@ class ServiceManager(QtGui.QWidget):
|
||||||
Clear the list to create a new service
|
Clear the list to create a new service
|
||||||
"""
|
"""
|
||||||
if self.parent.serviceNotSaved and QtCore.QSettings().value(
|
if self.parent.serviceNotSaved and QtCore.QSettings().value(
|
||||||
self.parent.general_settings_section + u'/save prompt',
|
self.parent.generalSettingsSection + u'/save prompt',
|
||||||
QtCore.QVariant(False)).toBool():
|
QtCore.QVariant(False)).toBool():
|
||||||
ret = QtGui.QMessageBox.question(self,
|
ret = QtGui.QMessageBox.question(self,
|
||||||
self.trUtf8('Save Changes to Service?'),
|
self.trUtf8('Save Changes to Service?'),
|
||||||
|
@ -489,11 +489,11 @@ class ServiceManager(QtGui.QWidget):
|
||||||
if not quick or self.isNew:
|
if not quick or self.isNew:
|
||||||
filename = QtGui.QFileDialog.getSaveFileName(self,
|
filename = QtGui.QFileDialog.getSaveFileName(self,
|
||||||
self.trUtf8(u'Save Service'),
|
self.trUtf8(u'Save Service'),
|
||||||
SettingsManager.get_last_dir(self.parent.service_settings_section),
|
SettingsManager.get_last_dir(self.parent.serviceSettingsSection),
|
||||||
self.trUtf8(u'OpenLP Service Files (*.osz)'))
|
self.trUtf8(u'OpenLP Service Files (*.osz)'))
|
||||||
else:
|
else:
|
||||||
filename = SettingsManager.get_last_dir(
|
filename = SettingsManager.get_last_dir(
|
||||||
self.parent.service_settings_section)
|
self.parent.serviceSettingsSection)
|
||||||
if filename:
|
if filename:
|
||||||
splittedFile = filename.split(u'.')
|
splittedFile = filename.split(u'.')
|
||||||
if splittedFile[-1] != u'osz':
|
if splittedFile[-1] != u'osz':
|
||||||
|
@ -501,7 +501,7 @@ class ServiceManager(QtGui.QWidget):
|
||||||
filename = unicode(filename)
|
filename = unicode(filename)
|
||||||
self.isNew = False
|
self.isNew = False
|
||||||
SettingsManager.set_last_dir(
|
SettingsManager.set_last_dir(
|
||||||
self.parent.service_settings_section,
|
self.parent.serviceSettingsSection,
|
||||||
os.path.split(filename)[0])
|
os.path.split(filename)[0])
|
||||||
service = []
|
service = []
|
||||||
servicefile = filename + u'.osd'
|
servicefile = filename + u'.osd'
|
||||||
|
@ -544,12 +544,12 @@ class ServiceManager(QtGui.QWidget):
|
||||||
def onLoadService(self, lastService=False):
|
def onLoadService(self, lastService=False):
|
||||||
if lastService:
|
if lastService:
|
||||||
filename = SettingsManager.get_last_dir(
|
filename = SettingsManager.get_last_dir(
|
||||||
self.parent.service_settings_section)
|
self.parent.serviceSettingsSection)
|
||||||
else:
|
else:
|
||||||
filename = QtGui.QFileDialog.getOpenFileName(
|
filename = QtGui.QFileDialog.getOpenFileName(
|
||||||
self, self.trUtf8('Open Service'),
|
self, self.trUtf8('Open Service'),
|
||||||
SettingsManager.get_last_dir(
|
SettingsManager.get_last_dir(
|
||||||
self.parent.service_settings_section), u'Services (*.osz)')
|
self.parent.serviceSettingsSection), u'Services (*.osz)')
|
||||||
self.loadService(filename)
|
self.loadService(filename)
|
||||||
|
|
||||||
def loadService(self, filename=None):
|
def loadService(self, filename=None):
|
||||||
|
@ -579,7 +579,7 @@ class ServiceManager(QtGui.QWidget):
|
||||||
name = filename.split(os.path.sep)
|
name = filename.split(os.path.sep)
|
||||||
if filename:
|
if filename:
|
||||||
SettingsManager.set_last_dir(
|
SettingsManager.set_last_dir(
|
||||||
self.parent.service_settings_section,
|
self.parent.serviceSettingsSection,
|
||||||
os.path.split(filename)[0])
|
os.path.split(filename)[0])
|
||||||
zip = None
|
zip = None
|
||||||
f = None
|
f = None
|
||||||
|
@ -650,7 +650,7 @@ class ServiceManager(QtGui.QWidget):
|
||||||
self.service_theme = unicode(self.ThemeComboBox.currentText())
|
self.service_theme = unicode(self.ThemeComboBox.currentText())
|
||||||
self.parent.RenderManager.set_service_theme(self.service_theme)
|
self.parent.RenderManager.set_service_theme(self.service_theme)
|
||||||
QtCore.QSettings().setValue(
|
QtCore.QSettings().setValue(
|
||||||
self.parent.service_settings_section + u'/service theme',
|
self.parent.serviceSettingsSection + u'/service theme',
|
||||||
QtCore.QVariant(self.service_theme))
|
QtCore.QVariant(self.service_theme))
|
||||||
self.regenerateServiceItems()
|
self.regenerateServiceItems()
|
||||||
|
|
||||||
|
@ -734,7 +734,7 @@ class ServiceManager(QtGui.QWidget):
|
||||||
self.parent.LiveController.addServiceManagerItem(
|
self.parent.LiveController.addServiceManagerItem(
|
||||||
self.serviceItems[item][u'service_item'], count)
|
self.serviceItems[item][u'service_item'], count)
|
||||||
if QtCore.QSettings().value(
|
if QtCore.QSettings().value(
|
||||||
self.parent.general_settings_section + u'/auto preview',
|
self.parent.generalSettingsSection + u'/auto preview',
|
||||||
QtCore.QVariant(False)).toBool():
|
QtCore.QVariant(False)).toBool():
|
||||||
item += 1
|
item += 1
|
||||||
if self.serviceItems and item < len(self.serviceItems) and \
|
if self.serviceItems and item < len(self.serviceItems) and \
|
||||||
|
|
|
@ -396,7 +396,7 @@ class SlideController(QtGui.QWidget):
|
||||||
if item.is_text():
|
if item.is_text():
|
||||||
self.Toolbar.makeWidgetsInvisible(self.loop_list)
|
self.Toolbar.makeWidgetsInvisible(self.loop_list)
|
||||||
if QtCore.QSettings().value(
|
if QtCore.QSettings().value(
|
||||||
self.parent.songs_settings_section + u'/show songbar',
|
self.parent.songsSettingsSection + u'/show songbar',
|
||||||
QtCore.QVariant(True)).toBool() and len(self.slideList) > 0:
|
QtCore.QVariant(True)).toBool() and len(self.slideList) > 0:
|
||||||
self.Toolbar.makeWidgetsVisible([u'Song Menu'])
|
self.Toolbar.makeWidgetsVisible([u'Song Menu'])
|
||||||
if item.is_capable(ItemCapabilities.AllowsLoop) and \
|
if item.is_capable(ItemCapabilities.AllowsLoop) and \
|
||||||
|
@ -585,7 +585,7 @@ class SlideController(QtGui.QWidget):
|
||||||
self.hideButton.setChecked(False)
|
self.hideButton.setChecked(False)
|
||||||
self.themeButton.setChecked(False)
|
self.themeButton.setChecked(False)
|
||||||
QtCore.QSettings().setValue(
|
QtCore.QSettings().setValue(
|
||||||
self.parent.general_settings_section + u'/screen blank',
|
self.parent.generalSettingsSection + u'/screen blank',
|
||||||
QtCore.QVariant(checked))
|
QtCore.QVariant(checked))
|
||||||
if checked:
|
if checked:
|
||||||
Receiver.send_message(u'maindisplay_hide', HideMode.Blank)
|
Receiver.send_message(u'maindisplay_hide', HideMode.Blank)
|
||||||
|
|
|
@ -47,7 +47,7 @@ class ThemeManager(QtGui.QWidget):
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
QtGui.QWidget.__init__(self, parent)
|
QtGui.QWidget.__init__(self, parent)
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.settings_section = u'themes'
|
self.settingsSection = u'themes'
|
||||||
self.Layout = QtGui.QVBoxLayout(self)
|
self.Layout = QtGui.QVBoxLayout(self)
|
||||||
self.Layout.setSpacing(0)
|
self.Layout.setSpacing(0)
|
||||||
self.Layout.setMargin(0)
|
self.Layout.setMargin(0)
|
||||||
|
@ -106,14 +106,14 @@ class ThemeManager(QtGui.QWidget):
|
||||||
QtCore.SIGNAL(u'theme_update_global'), self.changeGlobalFromTab)
|
QtCore.SIGNAL(u'theme_update_global'), self.changeGlobalFromTab)
|
||||||
#Variables
|
#Variables
|
||||||
self.themelist = []
|
self.themelist = []
|
||||||
self.path = AppLocation.get_section_data_path(self.settings_section)
|
self.path = AppLocation.get_section_data_path(self.settingsSection)
|
||||||
self.checkThemesExists(self.path)
|
self.checkThemesExists(self.path)
|
||||||
self.thumbPath = os.path.join(self.path, u'thumbnails')
|
self.thumbPath = os.path.join(self.path, u'thumbnails')
|
||||||
self.checkThemesExists(self.thumbPath)
|
self.checkThemesExists(self.thumbPath)
|
||||||
self.amendThemeForm.path = self.path
|
self.amendThemeForm.path = self.path
|
||||||
# Last little bits of setting up
|
# Last little bits of setting up
|
||||||
self.global_theme = unicode(QtCore.QSettings().value(
|
self.global_theme = unicode(QtCore.QSettings().value(
|
||||||
self.settings_section + u'/global theme',
|
self.settingsSection + u'/global theme',
|
||||||
QtCore.QVariant(u'')).toString())
|
QtCore.QVariant(u'')).toString())
|
||||||
|
|
||||||
def changeGlobalFromTab(self, themeName):
|
def changeGlobalFromTab(self, themeName):
|
||||||
|
@ -147,7 +147,7 @@ class ThemeManager(QtGui.QWidget):
|
||||||
name = u'%s (%s)' % (self.global_theme, self.trUtf8('default'))
|
name = u'%s (%s)' % (self.global_theme, self.trUtf8('default'))
|
||||||
self.ThemeListWidget.item(count).setText(name)
|
self.ThemeListWidget.item(count).setText(name)
|
||||||
QtCore.QSettings().setValue(
|
QtCore.QSettings().setValue(
|
||||||
self.settings_section + u'/global theme',
|
self.settingsSection + u'/global theme',
|
||||||
QtCore.QVariant(self.global_theme))
|
QtCore.QVariant(self.global_theme))
|
||||||
Receiver.send_message(u'theme_update_global', self.global_theme)
|
Receiver.send_message(u'theme_update_global', self.global_theme)
|
||||||
self.pushThemes()
|
self.pushThemes()
|
||||||
|
@ -170,7 +170,7 @@ class ThemeManager(QtGui.QWidget):
|
||||||
|
|
||||||
def onDeleteTheme(self):
|
def onDeleteTheme(self):
|
||||||
self.global_theme = unicode(QtCore.QSettings().value(
|
self.global_theme = unicode(QtCore.QSettings().value(
|
||||||
self.settings_section + u'/global theme',
|
self.settingsSection + u'/global theme',
|
||||||
QtCore.QVariant(u'')).toString())
|
QtCore.QVariant(u'')).toString())
|
||||||
item = self.ThemeListWidget.currentItem()
|
item = self.ThemeListWidget.currentItem()
|
||||||
if item:
|
if item:
|
||||||
|
@ -224,10 +224,10 @@ class ThemeManager(QtGui.QWidget):
|
||||||
theme = unicode(item.data(QtCore.Qt.UserRole).toString())
|
theme = unicode(item.data(QtCore.Qt.UserRole).toString())
|
||||||
path = QtGui.QFileDialog.getExistingDirectory(self,
|
path = QtGui.QFileDialog.getExistingDirectory(self,
|
||||||
unicode(self.trUtf8('Save Theme - (%s)')) % theme,
|
unicode(self.trUtf8('Save Theme - (%s)')) % theme,
|
||||||
SettingsManager.get_last_dir(self.settings_section, 1))
|
SettingsManager.get_last_dir(self.settingsSection, 1))
|
||||||
path = unicode(path)
|
path = unicode(path)
|
||||||
if path:
|
if path:
|
||||||
SettingsManager.set_last_dir(self.settings_section, path, 1)
|
SettingsManager.set_last_dir(self.settingsSection, path, 1)
|
||||||
themePath = os.path.join(path, theme + u'.theme')
|
themePath = os.path.join(path, theme + u'.theme')
|
||||||
zip = None
|
zip = None
|
||||||
try:
|
try:
|
||||||
|
@ -247,12 +247,12 @@ class ThemeManager(QtGui.QWidget):
|
||||||
def onImportTheme(self):
|
def onImportTheme(self):
|
||||||
files = QtGui.QFileDialog.getOpenFileNames(
|
files = QtGui.QFileDialog.getOpenFileNames(
|
||||||
self, self.trUtf8('Select Theme Import File'),
|
self, self.trUtf8('Select Theme Import File'),
|
||||||
SettingsManager.get_last_dir(self.settings_section), u'Theme (*.*)')
|
SettingsManager.get_last_dir(self.settingsSection), u'Theme (*.*)')
|
||||||
log.info(u'New Themes %s', unicode(files))
|
log.info(u'New Themes %s', unicode(files))
|
||||||
if files:
|
if files:
|
||||||
for file in files:
|
for file in files:
|
||||||
SettingsManager.set_last_dir(
|
SettingsManager.set_last_dir(
|
||||||
self.settings_section, unicode(file))
|
self.settingsSection, unicode(file))
|
||||||
self.unzipTheme(file, self.path)
|
self.unzipTheme(file, self.path)
|
||||||
self.loadThemes()
|
self.loadThemes()
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,7 @@ class ThemesTab(SettingsTab):
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(self.settings_section)
|
settings.beginGroup(self.settingsSection)
|
||||||
self.theme_level = settings.value(
|
self.theme_level = settings.value(
|
||||||
u'theme level', QtCore.QVariant(ThemeLevel.Global)).toInt()[0]
|
u'theme level', QtCore.QVariant(ThemeLevel.Global)).toInt()[0]
|
||||||
self.global_theme = unicode(settings.value(
|
self.global_theme = unicode(settings.value(
|
||||||
|
@ -139,7 +139,7 @@ class ThemesTab(SettingsTab):
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(self.settings_section)
|
settings.beginGroup(self.settingsSection)
|
||||||
settings.setValue(u'theme level',
|
settings.setValue(u'theme level',
|
||||||
QtCore.QVariant(self.theme_level))
|
QtCore.QVariant(self.theme_level))
|
||||||
settings.setValue(u'global theme',
|
settings.setValue(u'global theme',
|
||||||
|
@ -179,7 +179,7 @@ class ThemesTab(SettingsTab):
|
||||||
"""
|
"""
|
||||||
#reload as may have been triggered by the ThemeManager
|
#reload as may have been triggered by the ThemeManager
|
||||||
self.global_theme = unicode(QtCore.QSettings().value(
|
self.global_theme = unicode(QtCore.QSettings().value(
|
||||||
self.settings_section + u'/global theme',
|
self.settingsSection + u'/global theme',
|
||||||
QtCore.QVariant(u'')).toString())
|
QtCore.QVariant(u'')).toString())
|
||||||
self.DefaultComboBox.clear()
|
self.DefaultComboBox.clear()
|
||||||
for theme in theme_list:
|
for theme in theme_list:
|
||||||
|
|
|
@ -84,7 +84,7 @@ class alertsPlugin(Plugin):
|
||||||
def togglealertsState(self):
|
def togglealertsState(self):
|
||||||
self.alertsActive = not self.alertsActive
|
self.alertsActive = not self.alertsActive
|
||||||
QtCore.QSettings().setValue(
|
QtCore.QSettings().setValue(
|
||||||
self.settings_section + u'/active',
|
self.settingsSection + u'/active',
|
||||||
QtCore.QVariant(self.alertsActive))
|
QtCore.QVariant(self.alertsActive))
|
||||||
|
|
||||||
def onAlertsTrigger(self):
|
def onAlertsTrigger(self):
|
||||||
|
|
|
@ -229,7 +229,7 @@ class AlertsTab(SettingsTab):
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(self.settings_section)
|
settings.beginGroup(self.settingsSection)
|
||||||
self.timeout = settings.value(u'timeout', QtCore.QVariant(5)).toInt()[0]
|
self.timeout = settings.value(u'timeout', QtCore.QVariant(5)).toInt()[0]
|
||||||
self.font_color = unicode(settings.value(
|
self.font_color = unicode(settings.value(
|
||||||
u'font color', QtCore.QVariant(u'#ffffff')).toString())
|
u'font color', QtCore.QVariant(u'#ffffff')).toString())
|
||||||
|
@ -260,7 +260,7 @@ class AlertsTab(SettingsTab):
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(self.settings_section)
|
settings.beginGroup(self.settingsSection)
|
||||||
self.font_face = self.FontComboBox.currentFont().family()
|
self.font_face = self.FontComboBox.currentFont().family()
|
||||||
settings.setValue(u'background color', QtCore.QVariant(self.bg_color))
|
settings.setValue(u'background color', QtCore.QVariant(self.bg_color))
|
||||||
settings.setValue(u'font color', QtCore.QVariant(self.font_color))
|
settings.setValue(u'font color', QtCore.QVariant(self.font_color))
|
||||||
|
|
|
@ -274,7 +274,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
||||||
|
|
||||||
def setDefaults(self):
|
def setDefaults(self):
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(self.bibleplugin.settings_section)
|
settings.beginGroup(self.bibleplugin.settingsSection)
|
||||||
self.setField(u'source_format', QtCore.QVariant(0))
|
self.setField(u'source_format', QtCore.QVariant(0))
|
||||||
self.setField(u'osis_location', QtCore.QVariant(''))
|
self.setField(u'osis_location', QtCore.QVariant(''))
|
||||||
self.setField(u'csv_booksfile', QtCore.QVariant(''))
|
self.setField(u'csv_booksfile', QtCore.QVariant(''))
|
||||||
|
@ -345,11 +345,11 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
||||||
|
|
||||||
def getFileName(self, title, editbox):
|
def getFileName(self, title, editbox):
|
||||||
filename = QtGui.QFileDialog.getOpenFileName(self, title,
|
filename = QtGui.QFileDialog.getOpenFileName(self, title,
|
||||||
SettingsManager.get_last_dir(self.bibleplugin.settings_section, 1))
|
SettingsManager.get_last_dir(self.bibleplugin.settingsSection, 1))
|
||||||
if filename:
|
if filename:
|
||||||
editbox.setText(filename)
|
editbox.setText(filename)
|
||||||
SettingsManager.set_last_dir(
|
SettingsManager.set_last_dir(
|
||||||
self.bibleplugin.settings_section, filename, 1)
|
self.bibleplugin.settingsSection, filename, 1)
|
||||||
|
|
||||||
def incrementProgressBar(self, status_text):
|
def incrementProgressBar(self, status_text):
|
||||||
log.debug(u'IncrementBar %s', status_text)
|
log.debug(u'IncrementBar %s', status_text)
|
||||||
|
|
|
@ -189,7 +189,7 @@ class BiblesTab(SettingsTab):
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(self.settings_section)
|
settings.beginGroup(self.settingsSection)
|
||||||
self.show_new_chapters = settings.value(
|
self.show_new_chapters = settings.value(
|
||||||
u'display new chapter', QtCore.QVariant(False)).toBool()
|
u'display new chapter', QtCore.QVariant(False)).toBool()
|
||||||
self.display_style = settings.value(
|
self.display_style = settings.value(
|
||||||
|
@ -208,7 +208,7 @@ class BiblesTab(SettingsTab):
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(self.settings_section)
|
settings.beginGroup(self.settingsSection)
|
||||||
settings.setValue(u'display new chapter',
|
settings.setValue(u'display new chapter',
|
||||||
QtCore.QVariant(self.show_new_chapters))
|
QtCore.QVariant(self.show_new_chapters))
|
||||||
settings.setValue(u'display brackets',
|
settings.setValue(u'display brackets',
|
||||||
|
|
|
@ -109,12 +109,12 @@ class BibleManager(object):
|
||||||
"""
|
"""
|
||||||
log.debug(u'Bible Initialising')
|
log.debug(u'Bible Initialising')
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.settings_section = u'bibles'
|
self.settingsSection = u'bibles'
|
||||||
self.web = u'Web'
|
self.web = u'Web'
|
||||||
self.db_cache = None
|
self.db_cache = None
|
||||||
self.path = AppLocation.get_section_data_path(self.settings_section)
|
self.path = AppLocation.get_section_data_path(self.settingsSection)
|
||||||
self.proxy_name = unicode(
|
self.proxy_name = unicode(
|
||||||
QtCore.QSettings().value(self.settings_section + u'/proxy name',
|
QtCore.QSettings().value(self.settingsSection + u'/proxy name',
|
||||||
QtCore.QVariant(u'')).toString())
|
QtCore.QVariant(u'')).toString())
|
||||||
self.suffix = u'.sqlite'
|
self.suffix = u'.sqlite'
|
||||||
self.import_wizard = None
|
self.import_wizard = None
|
||||||
|
@ -128,7 +128,7 @@ class BibleManager(object):
|
||||||
BibleDB class.
|
BibleDB class.
|
||||||
"""
|
"""
|
||||||
log.debug(u'Reload bibles')
|
log.debug(u'Reload bibles')
|
||||||
files = SettingsManager.get_files(self.settings_section, self.suffix)
|
files = SettingsManager.get_files(self.settingsSection, self.suffix)
|
||||||
log.debug(u'Bible Files %s', files)
|
log.debug(u'Bible Files %s', files)
|
||||||
self.db_cache = {}
|
self.db_cache = {}
|
||||||
for filename in files:
|
for filename in files:
|
||||||
|
|
|
@ -275,7 +275,7 @@ class BibleMediaItem(MediaManagerItem):
|
||||||
self.SearchProgress.setObjectName(u'SearchProgress')
|
self.SearchProgress.setObjectName(u'SearchProgress')
|
||||||
|
|
||||||
def configUpdated(self):
|
def configUpdated(self):
|
||||||
if QtCore.QSettings().value(self.settings_section + u'/dual bibles',
|
if QtCore.QSettings().value(self.settingsSection + u'/dual bibles',
|
||||||
QtCore.QVariant(False)).toBool():
|
QtCore.QVariant(False)).toBool():
|
||||||
self.AdvancedSecondBibleLabel.setVisible(True)
|
self.AdvancedSecondBibleLabel.setVisible(True)
|
||||||
self.AdvancedSecondBibleComboBox.setVisible(True)
|
self.AdvancedSecondBibleComboBox.setVisible(True)
|
||||||
|
|
|
@ -67,10 +67,10 @@ class CustomTab(SettingsTab):
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
self.displayFooter = QtCore.QSettings().value(
|
self.displayFooter = QtCore.QSettings().value(
|
||||||
self.settings_section + u'/display footer',
|
self.settingsSection + u'/display footer',
|
||||||
QtCore.QVariant(True)).toBool()
|
QtCore.QVariant(True)).toBool()
|
||||||
self.DisplayFooterCheckBox.setChecked(self.displayFooter)
|
self.DisplayFooterCheckBox.setChecked(self.displayFooter)
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
QtCore.QSettings().setValue(self.settings_section + u'/display footer',
|
QtCore.QSettings().setValue(self.settingsSection + u'/display footer',
|
||||||
QtCore.QVariant(self.displayFooter))
|
QtCore.QVariant(self.displayFooter))
|
||||||
|
|
|
@ -163,7 +163,7 @@ class CustomMediaItem(MediaManagerItem):
|
||||||
service_item.title = title
|
service_item.title = title
|
||||||
for slide in raw_slides:
|
for slide in raw_slides:
|
||||||
service_item.add_from_text(slide[:30], slide)
|
service_item.add_from_text(slide[:30], slide)
|
||||||
if QtCore.QSettings().value(self.settings_section + u'/display footer',
|
if QtCore.QSettings().value(self.settingsSection + u'/display footer',
|
||||||
QtCore.QVariant(True)).toBool() or credit:
|
QtCore.QVariant(True)).toBool() or credit:
|
||||||
raw_footer.append(title + u' ' + credit)
|
raw_footer.append(title + u' ' + credit)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -72,12 +72,12 @@ class ImageTab(SettingsTab):
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
self.loop_delay = QtCore.QSettings().value(
|
self.loop_delay = QtCore.QSettings().value(
|
||||||
self.settings_section + u'/loop delay',
|
self.settingsSection + u'/loop delay',
|
||||||
QtCore.QVariant(5)).toInt()[0]
|
QtCore.QVariant(5)).toInt()[0]
|
||||||
self.TimeoutSpinBox.setValue(self.loop_delay)
|
self.TimeoutSpinBox.setValue(self.loop_delay)
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
QtCore.QSettings().setValue(self.settings_section + u'/loop delay',
|
QtCore.QSettings().setValue(self.settingsSection + u'/loop delay',
|
||||||
QtCore.QVariant(self.loop_delay))
|
QtCore.QVariant(self.loop_delay))
|
||||||
Receiver.send_message(u'slidecontroller_live_spin_delay',
|
Receiver.send_message(u'slidecontroller_live_spin_delay',
|
||||||
self.loop_delay)
|
self.loop_delay)
|
||||||
|
|
|
@ -77,12 +77,12 @@ class ImageMediaItem(MediaManagerItem):
|
||||||
QtGui.QAbstractItemView.ExtendedSelection)
|
QtGui.QAbstractItemView.ExtendedSelection)
|
||||||
self.ListView.setIconSize(QtCore.QSize(88,50))
|
self.ListView.setIconSize(QtCore.QSize(88,50))
|
||||||
self.servicePath = os.path.join(
|
self.servicePath = os.path.join(
|
||||||
AppLocation.get_section_data_path(self.settings_section),
|
AppLocation.get_section_data_path(self.settingsSection),
|
||||||
u'thumbnails')
|
u'thumbnails')
|
||||||
if not os.path.exists(self.servicePath):
|
if not os.path.exists(self.servicePath):
|
||||||
os.mkdir(self.servicePath)
|
os.mkdir(self.servicePath)
|
||||||
self.loadList(SettingsManager.load_list(
|
self.loadList(SettingsManager.load_list(
|
||||||
self.settings_section, self.settings_section))
|
self.settingsSection, self.settingsSection))
|
||||||
|
|
||||||
def addListViewToToolBar(self):
|
def addListViewToToolBar(self):
|
||||||
MediaManagerItem.addListViewToToolBar(self)
|
MediaManagerItem.addListViewToToolBar(self)
|
||||||
|
@ -121,8 +121,8 @@ class ImageMediaItem(MediaManagerItem):
|
||||||
#if not present do not worry
|
#if not present do not worry
|
||||||
pass
|
pass
|
||||||
self.ListView.takeItem(item.row())
|
self.ListView.takeItem(item.row())
|
||||||
SettingsManager.set_list(self.settings_section,
|
SettingsManager.set_list(self.settingsSection,
|
||||||
self.settings_section, self.getFileList())
|
self.settingsSection, self.getFileList())
|
||||||
|
|
||||||
def loadList(self, list):
|
def loadList(self, list):
|
||||||
for file in list:
|
for file in list:
|
||||||
|
|
|
@ -131,15 +131,15 @@ class MediaMediaItem(MediaManagerItem):
|
||||||
QtGui.QAbstractItemView.ExtendedSelection)
|
QtGui.QAbstractItemView.ExtendedSelection)
|
||||||
self.ListView.setIconSize(QtCore.QSize(88,50))
|
self.ListView.setIconSize(QtCore.QSize(88,50))
|
||||||
self.loadList(SettingsManager.load_list(
|
self.loadList(SettingsManager.load_list(
|
||||||
self.settings_section, self.settings_section))
|
self.settingsSection, self.settingsSection))
|
||||||
|
|
||||||
def onDeleteClick(self):
|
def onDeleteClick(self):
|
||||||
item = self.ListView.currentItem()
|
item = self.ListView.currentItem()
|
||||||
if item:
|
if item:
|
||||||
row = self.ListView.row(item)
|
row = self.ListView.row(item)
|
||||||
self.ListView.takeItem(row)
|
self.ListView.takeItem(row)
|
||||||
SettingsManager.set_list(self.settings_section,
|
SettingsManager.set_list(self.settingsSection,
|
||||||
self.settings_section, self.getFileList())
|
self.settingsSection, self.getFileList())
|
||||||
|
|
||||||
def loadList(self, list):
|
def loadList(self, list):
|
||||||
for file in list:
|
for file in list:
|
||||||
|
|
|
@ -106,13 +106,13 @@ class PresentationMediaItem(MediaManagerItem):
|
||||||
|
|
||||||
def initialise(self):
|
def initialise(self):
|
||||||
self.servicePath = os.path.join(
|
self.servicePath = os.path.join(
|
||||||
AppLocation.get_section_data_path(self.settings_section),
|
AppLocation.get_section_data_path(self.settingsSection),
|
||||||
u'thumbnails')
|
u'thumbnails')
|
||||||
self.ListView.setIconSize(QtCore.QSize(88,50))
|
self.ListView.setIconSize(QtCore.QSize(88,50))
|
||||||
if not os.path.exists(self.servicePath):
|
if not os.path.exists(self.servicePath):
|
||||||
os.mkdir(self.servicePath)
|
os.mkdir(self.servicePath)
|
||||||
list = SettingsManager.load_list(
|
list = SettingsManager.load_list(
|
||||||
self.settings_section, u'presentations')
|
self.settingsSection, u'presentations')
|
||||||
self.loadList(list)
|
self.loadList(list)
|
||||||
for item in self.controllers:
|
for item in self.controllers:
|
||||||
#load the drop down selection
|
#load the drop down selection
|
||||||
|
@ -141,12 +141,12 @@ class PresentationMediaItem(MediaManagerItem):
|
||||||
for controller in self.controllers:
|
for controller in self.controllers:
|
||||||
thumbPath = os.path.join(
|
thumbPath = os.path.join(
|
||||||
AppLocation.get_section_data_path(
|
AppLocation.get_section_data_path(
|
||||||
self.settings_section),
|
self.settingsSection),
|
||||||
u'thumbnails', controller, filename)
|
u'thumbnails', controller, filename)
|
||||||
thumb = os.path.join(thumbPath, u'slide1.png')
|
thumb = os.path.join(thumbPath, u'slide1.png')
|
||||||
preview = os.path.join(
|
preview = os.path.join(
|
||||||
AppLocation.get_section_data_path(
|
AppLocation.get_section_data_path(
|
||||||
self.settings_section),
|
self.settingsSection),
|
||||||
controller, u'thumbnails', filename, u'slide1.png')
|
controller, u'thumbnails', filename, u'slide1.png')
|
||||||
if os.path.exists(preview):
|
if os.path.exists(preview):
|
||||||
if os.path.exists(thumb):
|
if os.path.exists(thumb):
|
||||||
|
@ -170,8 +170,8 @@ class PresentationMediaItem(MediaManagerItem):
|
||||||
if item:
|
if item:
|
||||||
row = self.ListView.row(item)
|
row = self.ListView.row(item)
|
||||||
self.ListView.takeItem(row)
|
self.ListView.takeItem(row)
|
||||||
SettingsManager.set_list(self.settings_section,
|
SettingsManager.set_list(self.settingsSection,
|
||||||
self.settings_section, self.getFileList())
|
self.settingsSection, self.getFileList())
|
||||||
filepath = unicode((item.data(QtCore.Qt.UserRole)).toString())
|
filepath = unicode((item.data(QtCore.Qt.UserRole)).toString())
|
||||||
#not sure of this has errors
|
#not sure of this has errors
|
||||||
#John please can you look at .
|
#John please can you look at .
|
||||||
|
|
|
@ -100,16 +100,16 @@ class PresentationController(object):
|
||||||
self.docs = []
|
self.docs = []
|
||||||
self.plugin = plugin
|
self.plugin = plugin
|
||||||
self.name = name
|
self.name = name
|
||||||
self.settings_section = self.plugin.settings_section
|
self.settingsSection = self.plugin.settingsSection
|
||||||
self.available = self.check_available()
|
self.available = self.check_available()
|
||||||
if self.available:
|
if self.available:
|
||||||
self.enabled = QtCore.QSettings().value(
|
self.enabled = QtCore.QSettings().value(
|
||||||
self.settings_section + u'/' + name,
|
self.settingsSection + u'/' + name,
|
||||||
QtCore.Qt.Unchecked).toInt()[0] == QtCore.Qt.Checked
|
QtCore.Qt.Unchecked).toInt()[0] == QtCore.Qt.Checked
|
||||||
else:
|
else:
|
||||||
self.enabled = False
|
self.enabled = False
|
||||||
self.thumbnailroot = os.path.join(
|
self.thumbnailroot = os.path.join(
|
||||||
AppLocation.get_section_data_path(self.settings_section),
|
AppLocation.get_section_data_path(self.settingsSection),
|
||||||
name, u'thumbnails')
|
name, u'thumbnails')
|
||||||
self.thumbnailprefix = u'slide'
|
self.thumbnailprefix = u'slide'
|
||||||
if not os.path.isdir(self.thumbnailroot):
|
if not os.path.isdir(self.thumbnailroot):
|
||||||
|
|
|
@ -101,7 +101,7 @@ class PresentationTab(SettingsTab):
|
||||||
if controller.available:
|
if controller.available:
|
||||||
checkbox = self.PresenterCheckboxes[controller.name]
|
checkbox = self.PresenterCheckboxes[controller.name]
|
||||||
checkbox.setChecked(QtCore.QSettings().value(
|
checkbox.setChecked(QtCore.QSettings().value(
|
||||||
self.settings_section + u'/' + controller.name,
|
self.settingsSection + u'/' + controller.name,
|
||||||
QtCore.QVariant(0)).toInt()[0])
|
QtCore.QVariant(0)).toInt()[0])
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
|
@ -109,5 +109,5 @@ class PresentationTab(SettingsTab):
|
||||||
controller = self.controllers[key]
|
controller = self.controllers[key]
|
||||||
checkbox = self.PresenterCheckboxes[controller.name]
|
checkbox = self.PresenterCheckboxes[controller.name]
|
||||||
QtCore.QSettings().setValue(
|
QtCore.QSettings().setValue(
|
||||||
self.settings_section + u'/' + controller.name,
|
self.settingsSection + u'/' + controller.name,
|
||||||
QtCore.QVariant(checkbox.checkState()))
|
QtCore.QVariant(checkbox.checkState()))
|
||||||
|
|
|
@ -57,9 +57,9 @@ class RemoteTab(SettingsTab):
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
self.RemotePortSpinBox.setValue(
|
self.RemotePortSpinBox.setValue(
|
||||||
QtCore.QSettings().value(self.settings_section + u'/remote port',
|
QtCore.QSettings().value(self.settingsSection + u'/remote port',
|
||||||
QtCore.QVariant(4316)).toInt()[0])
|
QtCore.QVariant(4316)).toInt()[0])
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
QtCore.QSettings().setValue(self.settings_section + u'/remote port',
|
QtCore.QSettings().setValue(self.settingsSection + u'/remote port',
|
||||||
QtCore.QVariant(self.RemotePortSpinBox.value()))
|
QtCore.QVariant(self.RemotePortSpinBox.value()))
|
||||||
|
|
|
@ -46,7 +46,7 @@ class RemotesPlugin(Plugin):
|
||||||
self.insert_toolbox_item()
|
self.insert_toolbox_item()
|
||||||
self.server = QtNetwork.QUdpSocket()
|
self.server = QtNetwork.QUdpSocket()
|
||||||
self.server.bind(
|
self.server.bind(
|
||||||
QtCore.QSettings().value(self.settings_section + u'/remote port',
|
QtCore.QSettings().value(self.settingsSection + u'/remote port',
|
||||||
QtCore.QVariant(4316)).toInt()[0])
|
QtCore.QVariant(4316)).toInt()[0])
|
||||||
QtCore.QObject.connect(self.server,
|
QtCore.QObject.connect(self.server,
|
||||||
QtCore.SIGNAL(u'readyRead()'), self.readData)
|
QtCore.SIGNAL(u'readyRead()'), self.readData)
|
||||||
|
|
|
@ -133,7 +133,7 @@ class SongMediaItem(MediaManagerItem):
|
||||||
|
|
||||||
def configUpdated(self):
|
def configUpdated(self):
|
||||||
self.searchAsYouType = QtCore.QSettings().value(
|
self.searchAsYouType = QtCore.QSettings().value(
|
||||||
self.settings_section + u'/search as type',
|
self.settingsSection + u'/search as type',
|
||||||
QtCore.QVariant(u'False')).toBool()
|
QtCore.QVariant(u'False')).toBool()
|
||||||
|
|
||||||
def retranslateUi(self):
|
def retranslateUi(self):
|
||||||
|
|
|
@ -81,7 +81,7 @@ class SongsTab(SettingsTab):
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(self.settings_section)
|
settings.beginGroup(self.settingsSection)
|
||||||
self.song_search = settings.value(
|
self.song_search = settings.value(
|
||||||
u'search as type', QtCore.QVariant(False)).toBool()
|
u'search as type', QtCore.QVariant(False)).toBool()
|
||||||
self.song_bar = settings.value(
|
self.song_bar = settings.value(
|
||||||
|
@ -92,7 +92,7 @@ class SongsTab(SettingsTab):
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(self.settings_section)
|
settings.beginGroup(self.settingsSection)
|
||||||
settings.setValue(u'search as type', QtCore.QVariant(self.song_search))
|
settings.setValue(u'search as type', QtCore.QVariant(self.song_search))
|
||||||
settings.setValue(u'display songbar', QtCore.QVariant(self.song_bar))
|
settings.setValue(u'display songbar', QtCore.QVariant(self.song_bar))
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
|
|
|
@ -56,15 +56,15 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog):
|
||||||
self.FromDate.setSelectedDate(fromDate)
|
self.FromDate.setSelectedDate(fromDate)
|
||||||
self.ToDate.setSelectedDate(toDate)
|
self.ToDate.setSelectedDate(toDate)
|
||||||
self.FileLineEdit.setText(
|
self.FileLineEdit.setText(
|
||||||
SettingsManager.get_last_dir(self.parent.settings_section, 1))
|
SettingsManager.get_last_dir(self.parent.settingsSection, 1))
|
||||||
|
|
||||||
def defineOutputLocation(self):
|
def defineOutputLocation(self):
|
||||||
path = QtGui.QFileDialog.getExistingDirectory(self,
|
path = QtGui.QFileDialog.getExistingDirectory(self,
|
||||||
self.trUtf8('Output File Location'),
|
self.trUtf8('Output File Location'),
|
||||||
SettingsManager.get_last_dir(self.parent.settings_section, 1))
|
SettingsManager.get_last_dir(self.parent.settingsSection, 1))
|
||||||
path = unicode(path)
|
path = unicode(path)
|
||||||
if path != u'':
|
if path != u'':
|
||||||
SettingsManager.set_last_dir(self.parent.settings_section, path, 1)
|
SettingsManager.set_last_dir(self.parent.settingsSection, path, 1)
|
||||||
self.FileLineEdit.setText(path)
|
self.FileLineEdit.setText(path)
|
||||||
|
|
||||||
def accept(self):
|
def accept(self):
|
||||||
|
|
|
@ -111,7 +111,7 @@ class SongUsagePlugin(Plugin):
|
||||||
QtCore.SIGNAL(u'slidecontroller_live_started'),
|
QtCore.SIGNAL(u'slidecontroller_live_started'),
|
||||||
self.onReceiveSongUsage)
|
self.onReceiveSongUsage)
|
||||||
self.SongUsageActive = QtCore.QSettings().value(
|
self.SongUsageActive = QtCore.QSettings().value(
|
||||||
self.settings_section + u'/active',
|
self.settingsSection + u'/active',
|
||||||
QtCore.QVariant(False)).toBool()
|
QtCore.QVariant(False)).toBool()
|
||||||
self.SongUsageStatus.setChecked(self.SongUsageActive)
|
self.SongUsageStatus.setChecked(self.SongUsageActive)
|
||||||
if self.songusagemanager is None:
|
if self.songusagemanager is None:
|
||||||
|
@ -128,7 +128,7 @@ class SongUsagePlugin(Plugin):
|
||||||
|
|
||||||
def toggleSongUsageState(self):
|
def toggleSongUsageState(self):
|
||||||
self.SongUsageActive = not self.SongUsageActive
|
self.SongUsageActive = not self.SongUsageActive
|
||||||
QtCore.QSettings().setValue(self.settings_section + u'/active',
|
QtCore.QSettings().setValue(self.settingsSection + u'/active',
|
||||||
QtCore.QVariant(self.SongUsageActive))
|
QtCore.QVariant(self.SongUsageActive))
|
||||||
|
|
||||||
def onReceiveSongUsage(self, items):
|
def onReceiveSongUsage(self, items):
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
hiddenimports = ['lxml.etree']
|
hiddenimports = ['lxml.etree']
|
||||||
|
|
Loading…
Reference in New Issue