Moved over to using UiStrings

This commit is contained in:
Philip Ridout 2016-11-12 10:00:36 +00:00
parent 7a2df5eab3
commit 6a3982bab9
2 changed files with 6 additions and 7 deletions

View File

@ -112,6 +112,7 @@ class UiStrings(object):
self.NFSp = translate('OpenLP.Ui', 'No Files Selected', 'Plural')
self.NISs = translate('OpenLP.Ui', 'No Item Selected', 'Singular')
self.NISp = translate('OpenLP.Ui', 'No Items Selected', 'Plural')
self.NoResults = translate('OpenLP.Ui', 'No Search Results')
self.OLP = translate('OpenLP.Ui', 'OpenLP')
self.OLPV2 = "{name} {version}".format(name=self.OLP, version="2")
self.OLPV2x = "{name} {version}".format(name=self.OLP, version="2.4")
@ -139,6 +140,7 @@ class UiStrings(object):
self.Settings = translate('OpenLP.Ui', 'Settings')
self.SaveService = translate('OpenLP.Ui', 'Save Service')
self.Service = translate('OpenLP.Ui', 'Service')
self.ShortResults = translate('OpenLP.Ui', 'Please type more text to use \'Search As You Type\'')
self.Split = translate('OpenLP.Ui', 'Optional &Split')
self.SplitToolTip = translate('OpenLP.Ui',
'Split a slide into two only if it does not fit on the screen as one slide.')

View File

@ -26,10 +26,7 @@ import os
from PyQt5 import QtCore, QtGui, QtWidgets
from openlp.core.common import Registry, translate
NO_RESULTS = translate('OpenLP.ListWidgetWithDnD', 'No Search Results')
SHORT_RESULTS = translate('OpenLP.ListWidgetWithDnD', 'Please type more text to use \'Search As You Type\'')
from openlp.core.common import Registry, UiStrings
class ListWidgetWithDnD(QtWidgets.QListWidget):
@ -42,7 +39,7 @@ class ListWidgetWithDnD(QtWidgets.QListWidget):
"""
super().__init__(parent)
self.mime_data_text = name
self.no_results_text = NO_RESULTS
self.no_results_text = UiStrings().NoResults
def activateDnD(self):
"""
@ -60,9 +57,9 @@ class ListWidgetWithDnD(QtWidgets.QListWidget):
:return: None
"""
if search_while_typing:
self.no_results_text = SHORT_RESULTS
self.no_results_text = UiStrings().ShortResults
else:
self.no_results_text = NO_RESULTS
self.no_results_text = UiStrings().NoResults
super().clear()
def mouseMoveEvent(self, event):