diff --git a/GetItemGroups.py b/GetItemGroups.py index 4fa75e1..6e51a27 100644 --- a/GetItemGroups.py +++ b/GetItemGroups.py @@ -48,9 +48,9 @@ def getItemGroups(): itemGroups = RefreshTools.refreshToolbars(doLoadAllWorkbenches=False) else: - import Serialize + import Serialize_SearchBar - itemGroups = Serialize.deserialize(serializedItemGroups) + itemGroups = Serialize_SearchBar.deserialize(serializedItemGroups) # Aggregate the tools (cached) and document objects (not cached), and assign an index to each import SearchResults diff --git a/RefreshTools.py b/RefreshTools.py index 041c5d7..b97887f 100644 --- a/RefreshTools.py +++ b/RefreshTools.py @@ -41,18 +41,18 @@ def gatherTools(): def writeCacheTools(): - import Serialize + import Serialize_SearchBar - serializedItemGroups = Serialize.serialize(gatherTools()) + serializedItemGroups = Serialize_SearchBar.serialize(gatherTools()) # Todo: use wb and a specific encoding. with open(cachePath(), "w") as cache: cache.write(serializedItemGroups) # I prefer to systematically deserialize, instead of taking the original version, # this avoids possible inconsistencies between the original and the cache and # makes sure cache-related bugs are noticed quickly. - import Serialize + import Serialize_SearchBar - itemGroups = Serialize.deserialize(serializedItemGroups) + itemGroups = Serialize_SearchBar.deserialize(serializedItemGroups) print("SearchBox: Cache has been written.") return itemGroups @@ -61,9 +61,9 @@ def readCacheTools(): # Todo: use rb and a specific encoding. with open(cachePath(), "r") as cache: serializedItemGroups = cache.read() - import Serialize + import Serialize_SearchBar - itemGroups = Serialize.deserialize(serializedItemGroups) + itemGroups = Serialize_SearchBar.deserialize(serializedItemGroups) print("SearchBox: Tools were loaded from the cache.") return itemGroups diff --git a/ResultsPreferences.py b/ResultsPreferences.py index f45d549..5d313a7 100644 --- a/ResultsPreferences.py +++ b/ResultsPreferences.py @@ -2,7 +2,7 @@ import os import FreeCAD as App import FreeCADGui from PySide import QtGui -import Serialize +import Serialize_SearchBar genericToolIcon = QtGui.QIcon(QtGui.QIcon(os.path.dirname(__file__) + "/Tango-Tools-spanner-hammer.svg")) diff --git a/ResultsRefreshTools.py b/ResultsRefreshTools.py index cfa8515..0f10396 100644 --- a/ResultsRefreshTools.py +++ b/ResultsRefreshTools.py @@ -1,6 +1,6 @@ import os from PySide import QtGui -import Serialize +import Serialize_SearchBar def refreshToolsAction(nfo): @@ -11,7 +11,7 @@ def refreshToolsAction(nfo): def refreshToolsToolTip(nfo, setParent): return ( - Serialize.iconToHTML(genericToolIcon) + Serialize_SearchBar.iconToHTML(genericToolIcon) + "
Load all workbenches to refresh this list of tools. This may take a minute, depending on the number of installed workbenches.
" ) diff --git a/ResultsToolbar.py b/ResultsToolbar.py index 4e38d79..ec41db2 100644 --- a/ResultsToolbar.py +++ b/ResultsToolbar.py @@ -1,6 +1,6 @@ from PySide import QtGui import FreeCADGui -import Serialize +import Serialize_SearchBar def toolbarAction(nfo): @@ -61,7 +61,10 @@ def subToolAction(nfo): def toolbarToolTip(nfo, setParent): workbenches = FreeCADGui.listWorkbenches() in_workbenches = [ - "" + nfo["toolTip"] + "
" + return Serialize_SearchBar.iconToHTML(nfo["icon"], 32) + "" + nfo["toolTip"] + "
" def getAllToolbars(): diff --git a/Serialize.py b/Serialize_SearchBar.py similarity index 100% rename from Serialize.py rename to Serialize_SearchBar.py diff --git a/package.xml b/package.xml index 6bc9f7d..ac7d3c0 100644 --- a/package.xml +++ b/package.xml @@ -5,7 +5,7 @@