Annother fix

This commit is contained in:
Philip Ridout 2017-05-07 19:39:17 +01:00
parent 7485e53a72
commit 04063a4371

View File

@ -22,7 +22,7 @@
import logging import logging
import re import re
from enum import Enum, unique from enum import IntEnum, unique
from PyQt5 import QtCore, QtWidgets from PyQt5 import QtCore, QtWidgets
@ -50,7 +50,7 @@ def get_reference_separators():
@unique @unique
class BibleSearch(Enum): class BibleSearch(IntEnum):
""" """
Enumeration class for the different search types for the "Search" tab. Enumeration class for the different search types for the "Search" tab.
""" """
@ -60,7 +60,7 @@ class BibleSearch(Enum):
@unique @unique
class ResultsTab(Enum): class ResultsTab(IntEnum):
""" """
Enumeration class for the different tabs for the results list. Enumeration class for the different tabs for the results list.
""" """
@ -69,7 +69,7 @@ class ResultsTab(Enum):
@unique @unique
class SearchStatus(Enum): class SearchStatus(IntEnum):
""" """
Enumeration class for the different search methods. Enumeration class for the different search methods.
""" """
@ -79,7 +79,7 @@ class SearchStatus(Enum):
@unique @unique
class SearchTabs(Enum): class SearchTabs(IntEnum):
""" """
Enumeration class for the tabs on the media item. Enumeration class for the tabs on the media item.
""" """
@ -110,7 +110,7 @@ class BibleMediaItem(MediaManagerItem):
self.second_bible = None self.second_bible = None
self.saved_results = [] self.saved_results = []
self.current_results = [] self.current_results = []
self.search_status = SearchStatus().SearchButton self.search_status = SearchStatus.SearchButton
# TODO: Make more central and clean up after! # TODO: Make more central and clean up after!
self.search_timer = QtCore.QTimer() self.search_timer = QtCore.QTimer()
self.search_timer.setInterval(200) self.search_timer.setInterval(200)
@ -690,7 +690,7 @@ class BibleMediaItem(MediaManagerItem):
:return: None :return: None
""" """
self.search_timer.stop() self.search_timer.stop()
self.search_status = SearchStatus().SearchButton self.search_status = SearchStatus.SearchButton
if not self.bible: if not self.bible:
self.main_window.information_message(UiStrings().BibleNoBiblesTitle, UiStrings().BibleNoBibles) self.main_window.information_message(UiStrings().BibleNoBiblesTitle, UiStrings().BibleNoBibles)
return return
@ -794,7 +794,7 @@ class BibleMediaItem(MediaManagerItem):
self.text_reference_search(text) self.text_reference_search(text)
else: else:
# It can only be a 'Combined' search without a valid reference, or a 'Text' search # It can only be a 'Combined' search without a valid reference, or a 'Text' search
if self.search_status == SearchStatus().SearchAsYouType: if self.search_status == SearchStatus.SearchAsYouType:
if len(text) <= 8: if len(text) <= 8:
self.search_status = SearchStatus.NotEnoughText self.search_status = SearchStatus.NotEnoughText
self.display_results() self.display_results()
@ -823,7 +823,7 @@ class BibleMediaItem(MediaManagerItem):
:return: None :return: None
""" """
self.search_status = SearchStatus().SearchAsYouType self.search_status = SearchStatus.SearchAsYouType
self.text_search() self.text_search()
self.results_view_tab.setCurrentIndex(ResultsTab.Search) self.results_view_tab.setCurrentIndex(ResultsTab.Search)