diff --git a/Help/searcher/index.txt b/Help/searcher/index.txt
new file mode 100644
index 0000000..3bb6638
--- /dev/null
+++ b/Help/searcher/index.txt
@@ -0,0 +1,73 @@
+= Searcher =
+
+#bestbet: network parameter parameters
+#billboard: /images/billboards/blueprint.png
+#style: background-color: #303030; background-size: auto;
+
+"""How to use the network and parameter editors to work in Houdini."""
+
+*Nodes are the building blocks of the scene*. The Houdini scene is built from nodes organized in networks. Different network types control different parts of Houdini.
+
+*Using the [shelf tools|/shelf/] automatically creates nodes*. For example, when you click the [Box tool|Node:sop/box] on the __Create__ shelf tab, Houdini creates a new [Geometry container object|Node:obj/geo] with a [Box node|Node:sop/box] inside. You can also create nodes manually in the network editor. This is how advanced work is often done in Houdini. Pressing ((Tab)) in the network editor opens a menu of all nodes available in the current network type.
+
+*Some nodes can contain other nodes*. For example, a _Geometry Container object_ node lives at the scene level. It contains a network of _surface nodes_ that define the geometry of the object. See [node navigation|navigate] for information on how you move inside and out of container nodes.
+
+*Each node in a network performs a specific function*. In geometry, compositing, and CHOP networks, each node creates or modifies data passing through the node. At the scene level, nodes represent objects (such as props, bones, lights, and cameras) with transforms and parenting relationships. In the render network, nodes represent rendered outputs (images or animation), and links between the nodes define render dependencies.
+
+@subtopics
+
+:col:
+ == Networks ==
+
+ :: [nodes]
+ :: [navigate]
+ :: [wire]
+ :: [flags]
+ :: [badges]
+ :: [find]
+
+:col:
+ == Editing parameters ==
+
+ :: [parms]
+ :: [ramps]
+ :: [patterns]
+ :: [edit_interface]
+ :: [copying]
+
+~~
+
+:col:
+ == Next steps ==
+
+ :: [layout]
+ :: [organize]
+ :: [paths]
+ :: [dependencies]
+ :: [options]
+ :: [shortcuts]
+ :: [rename]
+
+:col:
+ == Expressions ==
+
+ :: [Parameter expressions|expressions]
+ :: [Expressions in filenames|/render/expressions]
+ :: [Spare parameters|spare]
+ :: [Expression cookbook|/ref/expression_cookbook]
+ :: [List of expression functions|/expressions/]
+
+~~
+
+:col:
+ == Guru level ==
+
+ :: [motioneffects]
+ :: [expression_functions]
+
+:col:
+ == Reference ==
+
+ :: [menus]
+ :: [/ref/panes/parms]
+
diff --git a/Help/searcher/main.txt b/Help/searcher/main.txt
new file mode 100644
index 0000000..3bb6638
--- /dev/null
+++ b/Help/searcher/main.txt
@@ -0,0 +1,73 @@
+= Searcher =
+
+#bestbet: network parameter parameters
+#billboard: /images/billboards/blueprint.png
+#style: background-color: #303030; background-size: auto;
+
+"""How to use the network and parameter editors to work in Houdini."""
+
+*Nodes are the building blocks of the scene*. The Houdini scene is built from nodes organized in networks. Different network types control different parts of Houdini.
+
+*Using the [shelf tools|/shelf/] automatically creates nodes*. For example, when you click the [Box tool|Node:sop/box] on the __Create__ shelf tab, Houdini creates a new [Geometry container object|Node:obj/geo] with a [Box node|Node:sop/box] inside. You can also create nodes manually in the network editor. This is how advanced work is often done in Houdini. Pressing ((Tab)) in the network editor opens a menu of all nodes available in the current network type.
+
+*Some nodes can contain other nodes*. For example, a _Geometry Container object_ node lives at the scene level. It contains a network of _surface nodes_ that define the geometry of the object. See [node navigation|navigate] for information on how you move inside and out of container nodes.
+
+*Each node in a network performs a specific function*. In geometry, compositing, and CHOP networks, each node creates or modifies data passing through the node. At the scene level, nodes represent objects (such as props, bones, lights, and cameras) with transforms and parenting relationships. In the render network, nodes represent rendered outputs (images or animation), and links between the nodes define render dependencies.
+
+@subtopics
+
+:col:
+ == Networks ==
+
+ :: [nodes]
+ :: [navigate]
+ :: [wire]
+ :: [flags]
+ :: [badges]
+ :: [find]
+
+:col:
+ == Editing parameters ==
+
+ :: [parms]
+ :: [ramps]
+ :: [patterns]
+ :: [edit_interface]
+ :: [copying]
+
+~~
+
+:col:
+ == Next steps ==
+
+ :: [layout]
+ :: [organize]
+ :: [paths]
+ :: [dependencies]
+ :: [options]
+ :: [shortcuts]
+ :: [rename]
+
+:col:
+ == Expressions ==
+
+ :: [Parameter expressions|expressions]
+ :: [Expressions in filenames|/render/expressions]
+ :: [Spare parameters|spare]
+ :: [Expression cookbook|/ref/expression_cookbook]
+ :: [List of expression functions|/expressions/]
+
+~~
+
+:col:
+ == Guru level ==
+
+ :: [motioneffects]
+ :: [expression_functions]
+
+:col:
+ == Reference ==
+
+ :: [menus]
+ :: [/ref/panes/parms]
+
diff --git a/scripts/456.py b/scripts/456.py
index c50c93f..e6845f6 100644
--- a/scripts/456.py
+++ b/scripts/456.py
@@ -1,5 +1,7 @@
from __future__ import print_function
from searcher import searcher_data
+from searcher import util
+
from peewee import *
from playhouse.sqlite_ext import SqliteExtDatabase, SearchField, FTSModel
# from playhouse.apsw_ext import APSWDatabase
@@ -234,7 +236,12 @@ def getlastusedhk(cur):
def updatechangeindex(indexval, new=False):
try:
if new is True:
- defaultkey = (u"Ctrl+Alt+Shift+F7")
+ defaultkey = ""
+ for i in range(len(util.HOTKEYLIST)):
+ result = hou.hotkeys.findConflicts("h", util.HOTKEYLIST[i])
+ if not result:
+ defaultkey = util.HOTKEYLIST[i]
+
settings.insert(indexvalue=indexval,
defaulthotkey=defaultkey, searchdescription=0, searchprefix=0, searchcurrentcontext=0, lastused="", id=1).execute()
else:
diff --git a/scripts/python/searcher/HelpButton.py b/scripts/python/searcher/HelpButton.py
new file mode 100644
index 0000000..9b20f35
--- /dev/null
+++ b/scripts/python/searcher/HelpButton.py
@@ -0,0 +1,54 @@
+
+# region Imports
+from __future__ import print_function
+from __future__ import absolute_import
+import weakref
+import hou
+import os
+import sys
+
+hver = 0
+if os.environ["HFS"] != "":
+ ver = os.environ["HFS"]
+ hver = int(ver[ver.rindex('.')+1:])
+ from hutil.Qt import QtCore
+ from hutil.Qt import QtWidgets
+
+# ----------------------------------------------------------------- Help
+# NOTE -----------------------------------------------------------------
+
+
+class HelpButton(QtWidgets.QPushButton):
+ """Generic Help button."""
+
+ def __init__(self, name, parent=None):
+ super(HelpButton, self).__init__(
+ hou.qt.createIcon("BUTTONS_help"), "", parent=parent
+ )
+
+ self._name = name
+
+ self.setToolTip("Open Help Page.")
+ self.setIconSize(QtCore.QSize(16, 16))
+ self.setMaximumSize(QtCore.QSize(16, 16))
+ self.setFlat(True)
+
+ self.clicked.connect(self.display_help)
+
+ def display_help(self):
+ """Display help page."""
+ # Look for an existing, float help browser.
+ for pane_tab in hou.ui.paneTabs():
+ if isinstance(pane_tab, hou.HelpBrowser):
+ if pane_tab.isFloating():
+ browser = pane_tab
+ break
+
+ # Didn't find one, so create a new floating browser.
+ else:
+ desktop = hou.ui.curDesktop()
+ browser = desktop.createFloatingPaneTab(
+ hou.paneTabType.HelpBrowser)
+
+ browser.displayHelpPath("/searcher/{}".format(self._name))
+# endregion
diff --git a/scripts/python/searcher/SearcherSettings.py b/scripts/python/searcher/SearcherSettings.py
new file mode 100644
index 0000000..faac6f3
--- /dev/null
+++ b/scripts/python/searcher/SearcherSettings.py
@@ -0,0 +1,204 @@
+# -*- coding: utf-8 -*-
+
+################################################################################
+## Form generated from reading UI file 'SearcherSettings.ui'
+##
+## Created by: Qt User Interface Compiler version 5.14.1
+##
+## WARNING! All changes made in this file will be lost when recompiling UI file!
+################################################################################
+
+from PySide2.QtCore import (QCoreApplication, QMetaObject, QObject, QPoint,
+ QRect, QSize, QUrl, Qt)
+from PySide2.QtGui import (QBrush, QColor, QConicalGradient, QCursor, QFont,
+ QFontDatabase, QIcon, QLinearGradient, QPalette, QPainter, QPixmap,
+ QRadialGradient)
+from PySide2.QtWidgets import *
+
+
+class Ui_SearcherSettings(object):
+ def setupUi(self, SearcherSettings):
+ if SearcherSettings.objectName():
+ SearcherSettings.setObjectName(u"SearcherSettings")
+ SearcherSettings.setWindowModality(Qt.NonModal)
+ SearcherSettings.resize(600, 185)
+ sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(SearcherSettings.sizePolicy().hasHeightForWidth())
+ SearcherSettings.setSizePolicy(sizePolicy)
+ SearcherSettings.setMinimumSize(QSize(600, 0))
+ SearcherSettings.setBaseSize(QSize(0, 0))
+ self.gridLayout = QGridLayout(SearcherSettings)
+ self.gridLayout.setObjectName(u"gridLayout")
+ self.verticalLayout_4 = QVBoxLayout()
+ self.verticalLayout_4.setObjectName(u"verticalLayout_4")
+ self.horizontalLayout_4 = QHBoxLayout()
+ self.horizontalLayout_4.setObjectName(u"horizontalLayout_4")
+ self.projectTitle = QLabel(SearcherSettings)
+ self.projectTitle.setObjectName(u"projectTitle")
+ font = QFont()
+ font.setPointSize(15)
+ self.projectTitle.setFont(font)
+ self.projectTitle.setAlignment(Qt.AlignCenter)
+
+ self.horizontalLayout_4.addWidget(self.projectTitle)
+
+ self.horizontalSpacer_3 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
+
+ self.horizontalLayout_4.addItem(self.horizontalSpacer_3)
+
+ self.inmemory_chk = QCheckBox(SearcherSettings)
+ self.inmemory_chk.setObjectName(u"inmemory_chk")
+ self.inmemory_chk.setLayoutDirection(Qt.RightToLeft)
+ self.inmemory_chk.setTristate(False)
+
+ self.horizontalLayout_4.addWidget(self.inmemory_chk)
+
+ self.windowsize_chk = QCheckBox(SearcherSettings)
+ self.windowsize_chk.setObjectName(u"windowsize_chk")
+ self.windowsize_chk.setLayoutDirection(Qt.RightToLeft)
+
+ self.horizontalLayout_4.addWidget(self.windowsize_chk)
+
+
+ self.verticalLayout_4.addLayout(self.horizontalLayout_4)
+
+ self.horizontalLayout_5 = QHBoxLayout()
+ self.horizontalLayout_5.setObjectName(u"horizontalLayout_5")
+ self.horizontalSpacer_2 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
+
+ self.horizontalLayout_5.addItem(self.horizontalSpacer_2)
+
+ self.label_2 = QLabel(SearcherSettings)
+ self.label_2.setObjectName(u"label_2")
+
+ self.horizontalLayout_5.addWidget(self.label_2)
+
+ self.hkinput_txt = QLineEdit(SearcherSettings)
+ self.hkinput_txt.setObjectName(u"hkinput_txt")
+ self.hkinput_txt.setReadOnly(True)
+
+ self.horizontalLayout_5.addWidget(self.hkinput_txt)
+
+ self.hotkey_icon = QToolButton(SearcherSettings)
+ self.hotkey_icon.setObjectName(u"hotkey_icon")
+ self.hotkey_icon.setPopupMode(QToolButton.InstantPopup)
+
+ self.horizontalLayout_5.addWidget(self.hotkey_icon)
+
+
+ self.verticalLayout_4.addLayout(self.horizontalLayout_5)
+
+ self.horizontalLayout_7 = QHBoxLayout()
+ self.horizontalLayout_7.setObjectName(u"horizontalLayout_7")
+ self.label = QLabel(SearcherSettings)
+ self.label.setObjectName(u"label")
+
+ self.horizontalLayout_7.addWidget(self.label)
+
+ self.databasepath_txt = QLineEdit(SearcherSettings)
+ self.databasepath_txt.setObjectName(u"databasepath_txt")
+
+ self.horizontalLayout_7.addWidget(self.databasepath_txt)
+
+ self.dbpath_icon = QToolButton(SearcherSettings)
+ self.dbpath_icon.setObjectName(u"dbpath_icon")
+
+ self.horizontalLayout_7.addWidget(self.dbpath_icon)
+
+
+ self.verticalLayout_4.addLayout(self.horizontalLayout_7)
+
+ self.horizontalLayout = QHBoxLayout()
+ self.horizontalLayout.setObjectName(u"horizontalLayout")
+ self.label_4 = QLabel(SearcherSettings)
+ self.label_4.setObjectName(u"label_4")
+
+ self.horizontalLayout.addWidget(self.label_4)
+
+ self.test1_btn = QPushButton(SearcherSettings)
+ self.test1_btn.setObjectName(u"test1_btn")
+
+ self.horizontalLayout.addWidget(self.test1_btn)
+
+ self.test_context_btn = QPushButton(SearcherSettings)
+ self.test_context_btn.setObjectName(u"test_context_btn")
+
+ self.horizontalLayout.addWidget(self.test_context_btn)
+
+ self.cleardata_btn = QPushButton(SearcherSettings)
+ self.cleardata_btn.setObjectName(u"cleardata_btn")
+
+ self.horizontalLayout.addWidget(self.cleardata_btn)
+
+
+ self.verticalLayout_4.addLayout(self.horizontalLayout)
+
+ self.horizontalLayout_2 = QHBoxLayout()
+ self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
+ self.label_3 = QLabel(SearcherSettings)
+ self.label_3.setObjectName(u"label_3")
+
+ self.horizontalLayout_2.addWidget(self.label_3)
+
+
+ self.verticalLayout_4.addLayout(self.horizontalLayout_2)
+
+ self.horizontalLayout_3 = QHBoxLayout()
+ self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
+ self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
+
+ self.horizontalLayout_3.addItem(self.horizontalSpacer)
+
+ self.debugflag_chk = QCheckBox(SearcherSettings)
+ self.debugflag_chk.setObjectName(u"debugflag_chk")
+ self.debugflag_chk.setLayoutDirection(Qt.RightToLeft)
+
+ self.horizontalLayout_3.addWidget(self.debugflag_chk)
+
+ self.discard_btn = QPushButton(SearcherSettings)
+ self.discard_btn.setObjectName(u"discard_btn")
+
+ self.horizontalLayout_3.addWidget(self.discard_btn)
+
+ self.save_btn = QPushButton(SearcherSettings)
+ self.save_btn.setObjectName(u"save_btn")
+
+ self.horizontalLayout_3.addWidget(self.save_btn)
+
+
+ self.verticalLayout_4.addLayout(self.horizontalLayout_3)
+
+
+ self.gridLayout.addLayout(self.verticalLayout_4, 1, 0, 1, 1)
+
+
+ self.retranslateUi(SearcherSettings)
+
+ QMetaObject.connectSlotsByName(SearcherSettings)
+ # setupUi
+
+ def retranslateUi(self, SearcherSettings):
+ SearcherSettings.setWindowTitle(QCoreApplication.translate("SearcherSettings", u"Form", None))
+ self.projectTitle.setText(QCoreApplication.translate("SearcherSettings", u"Searcher Settings", None))
+ self.inmemory_chk.setText(QCoreApplication.translate("SearcherSettings", u"Use In-Memory Database", None))
+ self.windowsize_chk.setText(QCoreApplication.translate("SearcherSettings", u"Remember Search Window Size", None))
+ self.label_2.setText(QCoreApplication.translate("SearcherSettings", u"Hotkey to use for opening unassigned items: ", None))
+#if QT_CONFIG(tooltip)
+ self.hkinput_txt.setToolTip("")
+#endif // QT_CONFIG(tooltip)
+ self.hkinput_txt.setPlaceholderText(QCoreApplication.translate("SearcherSettings", u"Double Click", None))
+ self.hotkey_icon.setText(QCoreApplication.translate("SearcherSettings", u"...", None))
+ self.label.setText(QCoreApplication.translate("SearcherSettings", u"Database location: ", None))
+ self.dbpath_icon.setText(QCoreApplication.translate("SearcherSettings", u"...", None))
+ self.label_4.setText(QCoreApplication.translate("SearcherSettings", u"Maintenance utilities:", None))
+ self.test1_btn.setText(QCoreApplication.translate("SearcherSettings", u"Test Button 1", None))
+ self.test_context_btn.setText(QCoreApplication.translate("SearcherSettings", u"Test HContext", None))
+ self.cleardata_btn.setText(QCoreApplication.translate("SearcherSettings", u"Clear Data", None))
+ self.label_3.setText("")
+ self.debugflag_chk.setText(QCoreApplication.translate("SearcherSettings", u"Debug Mode", None))
+ self.discard_btn.setText(QCoreApplication.translate("SearcherSettings", u"Discard", None))
+ self.save_btn.setText(QCoreApplication.translate("SearcherSettings", u"Save", None))
+ # retranslateUi
+
diff --git a/scripts/python/searcher/_conversion/searcher.py b/scripts/python/searcher/_conversion/searcher.py
new file mode 100644
index 0000000..9896c2a
--- /dev/null
+++ b/scripts/python/searcher/_conversion/searcher.py
@@ -0,0 +1,831 @@
+# region Imports
+from __future__ import print_function
+from __future__ import absolute_import
+import weakref
+
+from searcher import util
+from searcher import database
+from searcher import datahandler
+from searcher import searcher_ui
+from searcher import searcher_data
+from searcher import searcher_settings
+
+from pyautogui import press, typewrite, hotkey
+import hou
+from husdui.common import error_print, debug_print
+import toolutils
+import drivertoolutils
+import platform
+import objecttoolutils
+import os
+import sys
+import hdefereval as hd
+import stateutils
+hver = 0
+if os.environ["HFS"] != "":
+ ver = os.environ["HFS"]
+ hver = int(ver[ver.rindex('.')+1:])
+ from hutil.Qt import QtGui
+ from hutil.Qt import QtCore
+ from hutil.Qt import QtWidgets
+ if int(hver) >= 391:
+ from hutil.Qt import _QtUiTools
+ elif int(hver) < 391:
+ from hutil.Qt import QtUiTools
+
+reload(searcher_settings)
+reload(searcher_data)
+reload(searcher_ui)
+reload(datahandler)
+reload(database)
+reload(util)
+# endregion
+
+# region ------------------------------------------------------------- App Info
+__package__ = "Searcher"
+__version__ = "0.1b"
+__author__ = "instance.id"
+__copyright__ = "2020 All rights reserved. See LICENSE for more details."
+__status__ = "Prototype"
+# endregion
+
+# region ------------------------------------------------------------- Variables / Constants
+kwargs = {}
+settings = {}
+hasran = False
+isdebug = False
+mousePos = None
+cur_screen = QtWidgets.QDesktopWidget().screenNumber(
+ QtWidgets.QDesktopWidget().cursor().pos()
+)
+screensize = QtWidgets.QDesktopWidget().screenGeometry(cur_screen)
+centerPoint = QtWidgets.QDesktopWidget().availableGeometry(cur_screen).center()
+
+sys.path.append(os.path.join(os.path.dirname(__file__)))
+script_path = os.path.dirname(os.path.realpath(__file__))
+name = "Searcher"
+
+parent_widget = hou.qt.mainWindow()
+searcher_window = QtWidgets.QMainWindow()
+# endregion
+
+# region ------------------------------------------------------------- Class Functions
+
+
+def keyconversion(key):
+ for i in range(len(key)):
+ if key[i] in util.KEYCONVERSIONS:
+ key[i] = util.KEYCONVERSIONS[key[i]]
+ return key
+# endregion
+
+# region ------------------------------------------------------------- Searcher Class
+
+
+class Searcher(QtWidgets.QWidget):
+ """instance.id Searcher for Houdini"""
+
+ def __init__(self, kwargs, settings, windowsettings):
+ super(Searcher, self).__init__(hou.qt.mainWindow())
+ mainui = searcher_ui.Ui_Searcher()
+ mainui.setupUi(self)
+ mainui.retranslateUi(self)
+
+ self._drag_active = False
+
+ # Setting vars
+ kwargs = kwargs
+ self.settingdata = settings
+ self.windowsettings = windowsettings
+ self.isdebug = util.bc(self.settingdata[util.SETTINGS_KEYS[4]])
+ self.menuopened = False
+ self.windowispin = util.bc(self.settingdata[util.SETTINGS_KEYS[5]])
+ self.originalsize = self.settingdata[util.SETTINGS_KEYS[3]]
+
+ # if hver >= 391:
+ self.app = QtWidgets.QApplication.instance()
+
+ # UI Vars
+ self.handler, self.tmpkey = self.initialsetup()
+ self.ui = searcher_settings.SearcherSettings(self.handler, self.tmpkey)
+
+ # Functional Vars
+ self.lastused = {}
+ self.tmpsymbol = None
+ self.searching = False
+ self.ctxsearch = False
+ self.showglobal = True
+ self.previous_pos = None
+ self.searchprefix = False
+ self.keys_changed = False
+ self.searchdescription = False
+ self.searchcurrentcontext = False
+
+ # Functionals
+ hou.hotkeys._createBackupTables()
+ self.uisetup(mainui)
+
+ # Event System Initialization
+ self.installEventFilter(self)
+ self.searchbox.installEventFilter(self)
+ self.pinwindow.installEventFilter(self)
+ self.searchfilter.installEventFilter(self)
+ self.opensettingstool.installEventFilter(self)
+ self.searchresultstree.installEventFilter(self)
+
+ # region ------------------------------------------------------------- Settings
+ def open_settings(self):
+ self.ui.setWindowTitle('Searcher - Settings')
+ self.ui.show()
+ self.ui.setFocus()
+ # endregion
+
+ # region ------------------------------------------------------------- UI
+ def setupContext(self):
+ cols = 4
+ self.searchresultstree.setColumnCount(cols)
+ self.searchresultstree.setColumnWidth(0, 250)
+ if self.isdebug:
+ self.searchresultstree.setColumnWidth(1, 350)
+ else:
+ self.searchresultstree.setColumnWidth(1, 450)
+ self.searchresultstree.setColumnWidth(2, 100)
+ self.searchresultstree.setColumnWidth(3, 150)
+ if self.isdebug:
+ self.searchresultstree.setColumnWidth(4, 150)
+ self.searchresultstree.setHeaderLabels([
+ "Label",
+ "Description",
+ "Assignments",
+ "Symbol",
+ "Context"
+ ])
+ else:
+ self.searchresultstree.setHeaderLabels([
+ "Label",
+ "Description",
+ "Assignments",
+ "Symbol"
+ ])
+
+ def uisetup(self, mainui):
+ self.main_widget = QtWidgets.QWidget(self)
+
+ # Load UI File
+ loader = None
+ if int(hver) >= 391:
+ loader = _QtUiTools.QUiLoader()
+ else:
+ loader = QtUiTools.QUiLoader()
+
+ # mainui = loader.load(script_path + "/searcher_ui.py")
+ # mainui = loader.load(script_path + "/searcher_ui.py")
+
+ names = ["open", "save", "hotkey", "perference"]
+ self.completer = QtWidgets.QCompleter(names)
+
+ # Get UI Elements
+ # self.searchfilter = mainui.findChild(
+ # QtWidgets.QToolButton,
+ # "searchfilter_btn"
+ # )
+
+ # self.searchfilter = mainui(
+ # QtWidgets.QToolButton,
+ # "searchfilter_btn"
+ # )
+
+ # self.pinwindow = mainui.findChild(
+ # QtWidgets.QToolButton,
+ # "pinwindow_btn"
+ # )
+ # self.opensettingstool = mainui.findChild(
+ # QtWidgets.QToolButton,
+ # "opensettings_btn"
+ # )
+ # self.searchresultstree = mainui.findChild(
+ # QtWidgets.QTreeWidget,
+ # "searchresults_tree"
+ # )
+ # self.searchbox = mainui.findChild(
+ # QtWidgets.QLineEdit,
+ # "searchbox_txt"
+ # )
+ # self.infolbl = mainui.findChild(
+ # QtWidgets.QLabel,
+ # "info_lbl"
+ # )
+ #
+
+ self.searchfilter = mainui.searchfilter_btn
+ self.pinwindow = mainui.pinwindow_btn
+ self.opensettingstool = mainui.opensettings_btn
+ self.searchresultstree = mainui.searchresults_tree
+ self.searchbox = mainui.searchbox_txt
+ self.infolbl = mainui.info_lbl
+
+ self.searchbox.setPlaceholderText(" Search..")
+ self.searchbox.setFocusPolicy(QtCore.Qt.StrongFocus)
+ self.searchbox.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
+ self.searchbox.setClearButtonEnabled(True)
+
+ self.searchfilter.clicked.connect(self.searchfilter_cb)
+ searchfilter_button_size = hou.ui.scaledSize(12)
+ self.searchfilter.setProperty("flat", True)
+ self.searchfilter.setIcon(util.SEARCH_ICON)
+ self.searchfilter.setIconSize(QtCore.QSize(
+ searchfilter_button_size,
+ searchfilter_button_size
+ ))
+
+ self.pinwindow.clicked.connect(self.pinwindow_cb)
+ self.setpinicon()
+ pinwindow_button_size = hou.ui.scaledSize(16)
+ self.pinwindow.setProperty("flat", True)
+ self.pinwindow.setIconSize(QtCore.QSize(
+ pinwindow_button_size,
+ pinwindow_button_size
+ ))
+
+ self.opensettingstool.clicked.connect(self.opensettings_cb)
+ opensettingstool_button_size = hou.ui.scaledSize(16)
+ self.opensettingstool.setProperty("flat", True)
+ self.opensettingstool.setIcon(util.SETTINGS_ICON)
+ self.opensettingstool.setIconSize(QtCore.QSize(
+ opensettingstool_button_size,
+ opensettingstool_button_size
+ ))
+
+ self.searchbox.textChanged.connect(self.textchange_cb)
+ self.searchbox.customContextMenuRequested.connect(self.openmenu)
+ self.searchresultstree.itemActivated.connect(self.searchclick_cb)
+
+ # Layout
+ mainlayout = QtWidgets.QVBoxLayout()
+ mainlayout.setAlignment(QtCore.Qt.AlignBottom)
+ mainlayout.setContentsMargins(0, 0, 0, 0)
+ mainlayout.setGeometry(QtCore.QRect(0, 0, 1400, 1200))
+
+ mainlayout.addWidget(HelpButton("main"))
+ mainlayout.addWidget(self.searchfilter)
+ mainlayout.addWidget(self.pinwindow)
+ mainlayout.addWidget(self.opensettingstool)
+ mainlayout.addWidget(self.searchresultstree)
+ mainlayout.addWidget(self.searchbox)
+ mainlayout.addWidget(self.infolbl)
+ self.setLayout(mainlayout)
+
+ self.searchbox.setToolTip(
+ 'Begin typing to search or click magnifying glass icon to display options')
+ self.pinwindow.setToolTip(
+ 'Pin the search window to keep it from closing automatically when losing focus')
+ self.searchfilter.setToolTip(
+ 'Select a predefined filter')
+ self.opensettingstool.setToolTip(
+ 'General application settings')
+ self.searchresultstree.setToolTip(
+ 'Double click an action to attempt to perform it. Some actions only work in specific contexts')
+
+ self.setupContext()
+ self.searchbox.setFocus()
+ self.searchbox.grabKeyboard()
+
+ # endregion
+
+ # region ------------------------------------------------------------- Initial Setup
+
+ def initialsetup(self):
+ self.handler = datahandler.DataHandler(self.isdebug)
+ currentidx = hou.hotkeys.changeIndex()
+ chindex = self.handler.getchangeindex()
+
+ if len(chindex) == 0:
+ chindex = int(currentidx)
+ self.handler.updatechangeindex(chindex, True)
+ self.handler.updatedataasync()
+ hou.ui.setStatusMessage(
+ "Searcher database created",
+ severity=hou.severityType.Message
+ )
+ else:
+ chindex = int(chindex[0][0])
+
+ if int(currentidx) != chindex:
+ self.handler.updatedataasync()
+ self.handler.updatechangeindex(int(currentidx))
+
+ tmpkey = self.handler.getdefaulthotkey()
+ self.tmpkey = tmpkey[0][0]
+ return self.handler, self.tmpkey
+
+ def getnode(self):
+ nodeSelect = hou.selectedNodes()
+ for node in nodeSelect:
+ getName = node.name()
+ print(getName)
+
+ def getpane(self):
+ try:
+ return hou.ui.paneTabUnderCursor().type()
+ except (AttributeError, TypeError) as e:
+ hou.ui.setStatusMessage(
+ ("No context options to display" + str(e)),
+ severity=hou.severityType.Message
+ )
+
+ # endregion
+ # region ------------------------------------------------------------- Callbacks
+ def searchfilter_cb(self):
+ self.openmenu()
+
+ def pinwindow_cb(self):
+ self.windowispin = not self.windowispin
+ self.settingdata[util.SETTINGS_KEYS[5]] = self.windowispin
+ searcher_data.savesettings(self.settingdata)
+ self.setpinicon()
+
+ def setpinicon(self):
+ if self.windowispin:
+ self.pinwindow.setIcon(util.PIN_IN_ICON)
+ else:
+ self.pinwindow.setIcon(util.PIN_OUT_ICON)
+
+ def opensettings_cb(self):
+ self.open_settings()
+
+ def globalkeysearch(self):
+ self.ctxsearch = True
+ ctx = []
+ ctx.append("h")
+ results = self.handler.searchctx(ctx)
+ self.searchtablepopulate(results)
+ self.ctxsearch = False
+
+ def ctxsearcher(self, ctx=None):
+ results = None
+ ctxresult = []
+
+ if ctx is None:
+ self.ctxsearch = True
+ if self.isdebug:
+ print(self.getpane())
+ ctxresult = util.PANETYPES[self.getpane()]
+ results = self.handler.searchctx(ctxresult)
+
+ elif ctx == ":v":
+ self.ctxsearch = True
+ ctxresult.append("h.pane")
+ results = self.handler.searchctx(ctxresult)
+
+ elif ctx == ":c":
+ self.ctxsearch = True
+ ctxresult = util.PANETYPES[self.getpane()]
+ if self.isdebug:
+ print(self.getpane())
+ results = self.handler.searchctx(ctxresult)
+
+ elif ctx == ":g":
+ self.ctxsearch = True
+ ctxresult.append("h")
+ results = self.handler.searchctx(ctxresult)
+
+ self.searchtablepopulate(results)
+ self.ctxsearch = False
+ self.searchbox.clearFocus()
+ self.searchresultstree.setFocus()
+ self.searchresultstree.setCurrentItem(
+ self.searchresultstree.topLevelItem(0).child(0)
+ )
+
+ def textchange_cb(self, text):
+ if len(text) > 0:
+ self.infolbl.setText(self.searchresultstree.toolTip())
+ if text in util.CTXSHOTCUTS:
+ self.ctxsearcher(text)
+ elif len(text) > 1 and text not in util.CTXSHOTCUTS:
+ self.searching = True
+ txt = self.handler.searchtext(text)
+ self.searchtablepopulate(txt)
+ else:
+ self.searching = False
+ self.searchresultstree.clear()
+ self.infolbl.setText(
+ "Begin typing to search or click magnifying glass icon to display options")
+
+ def searchclick_cb(self, item, column):
+ hk = item.text(2)
+ self.tmpsymbol = item.text(3)
+
+ if hk == "":
+ self.chindex = hou.hotkeys.changeIndex()
+ result = self.createtemphotkey(self.tmpsymbol)
+ if result is True:
+ self.chindex = hou.hotkeys.changeIndex()
+ hk = hou.hotkeys.assignments(self.tmpsymbol)
+ self.processkey(hk, True)
+ else:
+ hk = hou.hotkeys.assignments(self.tmpsymbol)
+ self.processkey(hk)
+ self.tmpsymbol = None
+ return
+ # endregion
+
+ # region ------------------------------------------------------------- Searchbar Menu
+ def openmenu(self):
+ self.menuopened = True
+ self.searchmenu = QtWidgets.QMenu()
+ self.searchmenu.setProperty('flat', True)
+ self.searchmenu.setStyleSheet(util.MENUSTYLE)
+ self.searchmenu.setWindowFlags(
+ self.searchmenu.windowFlags() |
+ QtCore.Qt.NoDropShadowWindowHint
+ )
+ self.globalprefix = self.searchmenu.addAction("Global items")
+ self.contextprefix = self.searchmenu.addAction("Context items")
+ self.viewprefix = self.searchmenu.addAction("View items")
+
+ self.globalprefix.setToolTip(
+ "View application-wide actions")
+
+ self.contextprefix.setToolTip(
+ "Shows possible actions for the view in which the mouse was in when the window was opened")
+
+ self.viewprefix.setToolTip(
+ "Shows the available view panes (ex. Scene View, Render View, Composit View, etc")
+
+ self.searchmenu.hovered.connect(self.handlemenuhovered)
+
+ self.action = self.searchmenu.exec_(
+ self.searchbox.mapToGlobal(QtCore.QPoint(0, 20)))
+ if self.action == self.globalprefix:
+ self.searchbox.setText(":g")
+ if self.action == self.contextprefix:
+ self.searchbox.setText(":c")
+ if self.action == self.viewprefix:
+ self.searchbox.setText(":v")
+
+ self.searchmenu.installEventFilter(self)
+
+ def handlemenuhovered(self, action):
+ self.infolbl.setText(action.toolTip())
+
+ def getContext(self, ctx):
+ """Return Houdini context string."""
+ try:
+ hou_context = ctx.pwd().childTypeCategory().name()
+ except:
+ return None
+
+ print ("Hou Context: ", hou_context)
+ return util.CONTEXTTYPE[hou_context]
+
+ # endregion
+
+ # region ------------------------------------------------------------- Search Functionality
+ def searchtablepopulate(self, data):
+ if len(data) > 0:
+ self.searchresultstree.clear()
+ hotkeys = []
+ context_list = []
+ hcontext_tli = {}
+
+ for i in range(len(data)):
+ if data[i][4] not in context_list:
+ if self.ctxsearch:
+ context_list.append(data[i][4])
+ else:
+ context_list.append(data[i][4])
+
+ result = self.handler.gethcontextod(context_list)
+
+ for hc in range(len(result)):
+ hcontext_tli[result[hc][2]] = (QtWidgets.QTreeWidgetItem(
+ self.searchresultstree, [
+ result[hc][0],
+ result[hc][1]
+ ]
+ ))
+ self.searchresultstree.expandItem(hcontext_tli[result[hc][2]])
+
+ base_keys = hcontext_tli.keys()
+ for i in range(len(data)):
+ for j in range(len(base_keys)):
+ if base_keys[j] in data[i][4]:
+ if self.isdebug:
+ hotkeys.append(QtWidgets.QTreeWidgetItem(
+ hcontext_tli[base_keys[j]], [
+ data[i][0],
+ data[i][1],
+ data[i][2],
+ data[i][3],
+ data[i][4]
+ ]
+ ))
+ else:
+ hotkeys.append(QtWidgets.QTreeWidgetItem(
+ hcontext_tli[base_keys[j]], [
+ data[i][0],
+ data[i][1],
+ data[i][2],
+ data[i][3]
+ ]
+ ))
+ # endregion
+
+ # region ------------------------------------------------------------- Hotkey Processing
+
+ def processkey(self, key, tmphk=False):
+ hk = key
+ if tmphk:
+ lastkey = (str(self.tmpsymbol) + " " + str(hk[0]))
+ self.handler.updatelasthk(lastkey)
+
+ key = key[0].split('+')
+
+ mods = []
+ skey = None
+ ikey = None
+ key = keyconversion(key)
+ modifiers = util.MODIFIERS
+ mod_flag = QtCore.Qt.KeyboardModifiers()
+ for i in range(len(key)):
+ if str(key[i]) in modifiers:
+ mod_flag = mod_flag | util.MODIFIERS[str(key[i])]
+ else:
+ skey = key[i]
+ ikey = util.KEY_DICT[str(key[i])]
+
+ keypress = QtGui.QKeyEvent(
+ QtGui.QKeyEvent.KeyPress, # Keypress event identifier
+ ikey, # Qt key identifier
+ mod_flag, # Qt key modifier
+ skey # String of Qt key identifier
+ )
+
+ hou.ui.mainQtWindow().setFocus()
+ try:
+ hd.executeDeferred(self.app.sendEvent,
+ hou.ui.mainQtWindow(), keypress)
+ self.close()
+
+ except(AttributeError, TypeError) as e:
+ hou.ui.setStatusMessage(
+ ("Could not trigger hotkey event: " + str(e)),
+ severity=hou.severityType.Warning
+ )
+
+ def setKeysChanged(self, changed):
+ if self.keys_changed and not changed:
+ if not hou.hotkeys.saveOverrides():
+ print("ERROR: Couldn't save hotkey override file.")
+ self.keys_changed = changed
+ self.chindex = hou.hotkeys.changeIndex()
+ self.handler.updatechangeindex(self.chindex)
+
+ def createtemphotkey(self, symbol):
+ hou.hotkeys._createBackupTables()
+ result = hou.hotkeys.addAssignment(symbol, self.tmpkey)
+ self.keys_changed = True
+ self.setKeysChanged(False)
+ return result
+
+ def removetemphotkey(self, symbol, tmpkey):
+ hou.hotkeys._restoreBackupTables()
+ hou.hotkeys.revertToDefaults(symbol, True)
+ self.keys_changed = True
+ self.setKeysChanged(False)
+ # endregion
+
+ # region ------------------------------------------------------------- Events
+ def checktooltip(self, obj):
+ if obj == self.searchresultstree:
+ if self.searching:
+ self.infolbl.setText(obj.toolTip())
+ else:
+ self.infolbl.setText(self.searchbox.toolTip())
+ else:
+ self.infolbl.setText(obj.toolTip())
+
+ def eventFilter(self, obj, event):
+ # ---------------------------------------------------- Mouse
+ if event.type() == QtCore.QEvent.Enter:
+ self.checktooltip(obj)
+ elif event.type() == QtCore.QEvent.Leave:
+ self.infolbl.setText("")
+ if event.type() == QtCore.QEvent.ToolTip:
+ return True
+
+ if event.type() == QtCore.QEvent.MouseButtonPress:
+ if obj == self.searchbox:
+ return QtCore.QObject.eventFilter(self, obj, event)
+ else:
+ self.previous_pos = event.globalPos()
+ return QtCore.QObject.eventFilter(self, obj, event)
+
+ if event.type() == QtCore.QEvent.MouseMove:
+ if obj == self:
+ delta = event.globalPos() - self.previous_pos
+ self.move(self.x() + delta.x(), self.y()+delta.y())
+ self.previous_pos = event.globalPos()
+ self._drag_active = True
+ else:
+ return QtCore.QObject.eventFilter(self, obj, event)
+
+ if event.type() == QtCore.QEvent.MouseButtonRelease:
+ if self._drag_active:
+ self._drag_active = False
+
+ # ------------------------------------------------- Keypress
+ if event.type() == QtCore.QEvent.KeyPress:
+ if event.key() == QtCore.Qt.Key_Tab:
+ if self.searching:
+ self.searchbox.releaseKeyboard()
+ self.searchbox.clearFocus()
+ self.searchresultstree.setFocus()
+ self.searchresultstree.setCurrentItem(
+ self.searchresultstree.topLevelItem(0).child(0))
+ return True
+ else:
+ # self.searchbox.releaseKeyboard()
+ # self.searchbox.clearFocus()
+ if self.menuopened:
+ self.searchmenu.setFocus()
+ else:
+ self.searchbox.setText(":c")
+ self.ctxsearcher()
+ self.searchresultstree.setFocus()
+ self.searchresultstree.setCurrentItem(
+ self.searchresultstree.topLevelItem(0).child(0))
+ return True
+ if event.key() == QtCore.Qt.Key_Escape:
+ if self.ui.isVisible():
+ pass
+ else:
+ if self.menuopened:
+ if self.searchmenu.isVisible():
+ self.searchmenu.setVisible(False)
+ return QtCore.QObject.eventFilter(self, obj, event)
+ else:
+ self.menuopened = False
+ else:
+ self.close()
+ if event.key() == QtCore.Qt.Key_Colon:
+ if self.searchbox.text() == "":
+ self.searchbox.releaseKeyboard()
+ self.searchbox.clearFocus()
+ self.openmenu()
+ return True
+
+ # ------------------------------------------------- Window
+ if event.type() == QtCore.QEvent.WindowActivate:
+ self.searchbox.grabKeyboard()
+ elif event.type() == QtCore.QEvent.WindowDeactivate:
+ if self.ui.isVisible():
+ self.searchbox.releaseKeyboard()
+ return QtCore.QObject.eventFilter(self, obj, event)
+ if self.windowispin:
+ return QtCore.QObject.eventFilter(self, obj, event)
+ else:
+ self.close()
+ elif event.type() == QtCore.QEvent.FocusIn:
+ if obj == self.window:
+ self.searchbox.grabKeyboard()
+ elif event.type() == QtCore.QEvent.FocusOut:
+ pass
+
+ # ------------------------------------------------- Close
+ if event.type() == QtCore.QEvent.Close:
+ try:
+ if util.bc(self.settingdata[util.SETTINGS_KEYS[2]]):
+ self.windowsettings.setValue(
+ "geometry",
+ self.saveGeometry()
+ )
+ except (AttributeError, TypeError) as e:
+ if hou.isUIAvailable():
+ hou.ui.setStatusMessage(
+ ("Could not save window dimensions: " + str(e)),
+ severity=hou.severityType.Warning
+ )
+ else:
+ print("Could not save window dimensions: " + str(e))
+
+ if self.menuopened:
+ self.searchmenu.setVisible(False)
+
+ if self.tmpsymbol is not None:
+ hd.executeDeferred(
+ self.removetemphotkey,
+ self.tmpsymbol,
+ self.tmpkey
+ )
+ self.searchbox.releaseKeyboard()
+ try:
+ self.parent().setFocus()
+ self.setParent(None)
+ self.deleteLater()
+ except:
+ self.setParent(None)
+ self.deleteLater()
+ return QtCore.QObject.eventFilter(self, obj, event)
+
+ # endregion
+# endregion
+
+
+# region ----------------------------------------------------------------- Help
+class HelpButton(QtWidgets.QPushButton):
+ """Generic Help button."""
+
+ def __init__(self, name, parent=None):
+ super(HelpButton, self).__init__(
+ hou.qt.createIcon("BUTTONS_help"), "", parent=parent
+ )
+
+ self._name = name
+
+ self.setToolTip("Show Help.")
+ self.setIconSize(QtCore.QSize(14, 14))
+ self.setMaximumSize(QtCore.QSize(14, 14))
+ self.setFlat(True)
+
+ self.clicked.connect(self.display_help)
+
+ # -------------------------------------------------------------------------
+ # METHODS
+ # -------------------------------------------------------------------------
+
+ def display_help(self):
+ """Display help page."""
+ # Look for an existing, float help browser.
+ for pane_tab in hou.ui.paneTabs():
+ if isinstance(pane_tab, hou.HelpBrowser):
+ if pane_tab.isFloating():
+ browser = pane_tab
+ break
+
+ # Didn't find one, so create a new floating browser.
+ else:
+ desktop = hou.ui.curDesktop()
+ browser = desktop.createFloatingPaneTab(
+ hou.paneTabType.HelpBrowser)
+
+ browser.displayHelpPath("/searcher/{}".format(self._name))
+# endregion
+
+
+# region ----------------------------------------------------------------- Setup Functions
+
+
+def center():
+ return parent_widget.mapToGlobal(
+ QtCore.QPoint(
+ parent_widget.rect().center().x(),
+ parent_widget.rect().center().y()
+ )
+ )
+
+
+def CreateSearcherPanel(kwargs, searcher_window=None):
+ kwargs = kwargs
+ try:
+ searcher_window.close()
+ searcher_window.deleteLater()
+ except:
+ pass
+
+ settings = searcher_data.loadsettings()
+ windowsettings = QtCore.QSettings("instance.id", "Searcher")
+
+ searcher_window = Searcher(kwargs, settings, windowsettings)
+ searcher_window.setWindowFlags(
+ # searcher_window.windowFlags() |
+ QtCore.Qt.Tool |
+ # QtCore.Qt.WindowSystemMenuHint |
+ # QtCore.Qt.WindowTitleHint |
+ QtCore.Qt.CustomizeWindowHint |
+ # QtCore.Qt.FramelessWindowHint
+ QtCore.Qt.WindowStaysOnTopHint
+ )
+
+ # util.SETTINGS_KEYS[2] = savewindowsize
+ # util.SETTINGS_KEYS[3] = windowsize
+ if util.bc(settings[util.SETTINGS_KEYS[2]]) and windowsettings.value("geometry") is not None:
+ searcher_window.restoreGeometry(windowsettings.value("geometry"))
+ else:
+ searcher_window.resize(
+ int(settings[util.SETTINGS_KEYS[3]][0]),
+ int(settings[util.SETTINGS_KEYS[3]][1])
+ )
+ pos = center()
+ searcher_window.setGeometry(
+ pos.x() - (searcher_window.width() / 2),
+ pos.y() - (searcher_window.height() / 2),
+ searcher_window.width(),
+ searcher_window.height()
+ )
+ searcher_window.searchbox.setFocus()
+ searcher_window.setWindowTitle('Searcher')
+ searcher_window.show()
+ searcher_window.activateWindow()
+# endregion
diff --git a/scripts/python/searcher/_conversion/searcher_ui.py b/scripts/python/searcher/_conversion/searcher_ui.py
new file mode 100644
index 0000000..358cb3f
--- /dev/null
+++ b/scripts/python/searcher/_conversion/searcher_ui.py
@@ -0,0 +1,196 @@
+# -*- coding: utf-8 -*-
+
+################################################################################
+# Form generated from reading UI file 'searcher_ui.ui'
+##
+# Created by: Qt User Interface Compiler version 5.14.1
+##
+# WARNING! All changes made in this file will be lost when recompiling UI file!
+################################################################################
+
+# from PySide2.QtCore import (QCoreApplication, QMetaObject, QObject, QPoint,
+# QRect, QSize, QUrl, Qt)
+# from PySide2.QtGui import (QBrush, QColor, QConicalGradient, QCursor, QFont,
+# QFontDatabase, QIcon, QLinearGradient, QPalette, QPainter, QPixmap,
+# QRadialGradient)
+# from PySide2.QtWidgets import *
+
+from hutil.Qt.QtCore import (QCoreApplication, QMetaObject, QObject, QPoint,
+ QRect, QSize, QUrl, Qt)
+from hutil.Qt.QtGui import (QBrush, QColor, QConicalGradient, QCursor, QFont,
+ QFontDatabase, QIcon, QLinearGradient, QPalette, QPainter, QPixmap,
+ QRadialGradient)
+from hutil.Qt.QtWidgets import *
+
+
+class Ui_Searcher(object):
+ def setupUi(self, Searcher):
+ if Searcher.objectName():
+ Searcher.setObjectName(u"Searcher")
+ Searcher.setWindowModality(Qt.WindowModal)
+ Searcher.resize(1000, 329)
+ sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(Searcher.sizePolicy().hasHeightForWidth())
+ Searcher.setSizePolicy(sizePolicy)
+ Searcher.setMinimumSize(QSize(0, 0))
+ Searcher.setBaseSize(QSize(1000, 350))
+ Searcher.setStyleSheet(u"QTreeWidget QHeaderView::section {\n"
+ " font-size: 9pt;\n"
+ "}")
+ self.gridLayout = QGridLayout(Searcher)
+ self.gridLayout.setSpacing(0)
+ self.gridLayout.setObjectName(u"gridLayout")
+ self.gridLayout.setContentsMargins(0, 0, 0, 0)
+ self.verticalLayout = QVBoxLayout()
+ self.verticalLayout.setSpacing(0)
+ self.verticalLayout.setObjectName(u"verticalLayout")
+ self.horizontalLayout = QHBoxLayout()
+ self.horizontalLayout.setSpacing(0)
+ self.horizontalLayout.setObjectName(u"horizontalLayout")
+ self.horizontalSpacer_2 = QSpacerItem(
+ 8, 2, QSizePolicy.Fixed, QSizePolicy.Minimum)
+
+ self.horizontalLayout.addItem(self.horizontalSpacer_2)
+
+ self.projectTitle = QLabel(Searcher)
+ self.projectTitle.setObjectName(u"projectTitle")
+ sizePolicy1 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred)
+ sizePolicy1.setHorizontalStretch(0)
+ sizePolicy1.setVerticalStretch(0)
+ sizePolicy1.setHeightForWidth(
+ self.projectTitle.sizePolicy().hasHeightForWidth())
+ self.projectTitle.setSizePolicy(sizePolicy1)
+ font = QFont()
+ font.setPointSize(15)
+ self.projectTitle.setFont(font)
+ self.projectTitle.setAlignment(Qt.AlignCenter)
+
+ self.horizontalLayout.addWidget(self.projectTitle)
+
+ self.horizontalSpacer = QSpacerItem(
+ 40, 5, QSizePolicy.Expanding, QSizePolicy.Minimum)
+
+ self.horizontalLayout.addItem(self.horizontalSpacer)
+
+ self.pinwindow_btn = QToolButton(Searcher)
+ self.pinwindow_btn.setObjectName(u"pinwindow_btn")
+
+ self.horizontalLayout.addWidget(self.pinwindow_btn)
+
+ self.opensettings_btn = QToolButton(Searcher)
+ self.opensettings_btn.setObjectName(u"opensettings_btn")
+
+ self.horizontalLayout.addWidget(self.opensettings_btn)
+
+ self.horizontalSpacer_3 = QSpacerItem(
+ 8, 2, QSizePolicy.Fixed, QSizePolicy.Minimum)
+
+ self.horizontalLayout.addItem(self.horizontalSpacer_3)
+
+ self.verticalLayout.addLayout(self.horizontalLayout)
+
+ self.horizontalLayout_3 = QHBoxLayout()
+ self.horizontalLayout_3.setSpacing(0)
+ self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
+ self.frame = QFrame(Searcher)
+ self.frame.setObjectName(u"frame")
+ sizePolicy2 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
+ sizePolicy2.setHorizontalStretch(2)
+ sizePolicy2.setVerticalStretch(0)
+ sizePolicy2.setHeightForWidth(
+ self.frame.sizePolicy().hasHeightForWidth())
+ self.frame.setSizePolicy(sizePolicy2)
+ self.frame.setMinimumSize(QSize(0, 20))
+ self.frame.setFrameShape(QFrame.StyledPanel)
+ self.frame.setFrameShadow(QFrame.Raised)
+ self.searchfilter_btn = QToolButton(self.frame)
+ self.searchfilter_btn.setObjectName(u"searchfilter_btn")
+ self.searchfilter_btn.setGeometry(QRect(0, 0, 26, 20))
+ self.searchfilter_btn.setBaseSize(QSize(16, 16))
+ self.searchfilter_btn.setStyleSheet(
+ u"background-color: rgb(19, 19, 19);")
+ self.searchfilter_btn.setArrowType(Qt.NoArrow)
+
+ self.horizontalLayout_3.addWidget(self.frame)
+
+ self.searchbox_txt = QLineEdit(Searcher)
+ self.searchbox_txt.setObjectName(u"searchbox_txt")
+ sizePolicy3 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Minimum)
+ sizePolicy3.setHorizontalStretch(99)
+ sizePolicy3.setVerticalStretch(0)
+ sizePolicy3.setHeightForWidth(
+ self.searchbox_txt.sizePolicy().hasHeightForWidth())
+ self.searchbox_txt.setSizePolicy(sizePolicy3)
+ self.searchbox_txt.setMinimumSize(QSize(50, 0))
+ self.searchbox_txt.setMouseTracking(False)
+ self.searchbox_txt.setStyleSheet(u"background-color: rgb(19, 19, 19);")
+ self.searchbox_txt.setFrame(False)
+
+ self.horizontalLayout_3.addWidget(self.searchbox_txt)
+
+ self.verticalLayout.addLayout(self.horizontalLayout_3)
+
+ self.searchresults_tree = QTreeWidget(Searcher)
+ __qtreewidgetitem = QTreeWidgetItem()
+ __qtreewidgetitem.setText(0, u"1")
+ self.searchresults_tree.setHeaderItem(__qtreewidgetitem)
+ self.searchresults_tree.setObjectName(u"searchresults_tree")
+ sizePolicy4 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding)
+ sizePolicy4.setHorizontalStretch(0)
+ sizePolicy4.setVerticalStretch(0)
+ sizePolicy4.setHeightForWidth(
+ self.searchresults_tree.sizePolicy().hasHeightForWidth())
+ self.searchresults_tree.setSizePolicy(sizePolicy4)
+ font1 = QFont()
+ font1.setPointSize(9)
+ self.searchresults_tree.setFont(font1)
+ self.searchresults_tree.setMouseTracking(False)
+ self.searchresults_tree.setFocusPolicy(Qt.NoFocus)
+ self.searchresults_tree.setFrameShadow(QFrame.Sunken)
+ self.searchresults_tree.setLineWidth(0)
+ self.searchresults_tree.setSizeAdjustPolicy(
+ QAbstractScrollArea.AdjustToContents)
+ self.searchresults_tree.setAlternatingRowColors(True)
+ self.searchresults_tree.setSelectionMode(
+ QAbstractItemView.SingleSelection)
+ self.searchresults_tree.setSelectionBehavior(
+ QAbstractItemView.SelectRows)
+
+ self.verticalLayout.addWidget(self.searchresults_tree)
+
+ self.gridLayout.addLayout(self.verticalLayout, 1, 0, 1, 1)
+
+ self.info_lbl = QLabel(Searcher)
+ self.info_lbl.setObjectName(u"info_lbl")
+ font2 = QFont()
+ font2.setPointSize(8)
+ font2.setBold(False)
+ font2.setWeight(50)
+ self.info_lbl.setFont(font2)
+ self.info_lbl.setStyleSheet(u"background-color: rgb(26, 26, 26);")
+ self.info_lbl.setMargin(2)
+ self.info_lbl.setIndent(5)
+
+ self.gridLayout.addWidget(self.info_lbl, 2, 0, 1, 1)
+
+ self.retranslateUi(Searcher)
+
+ QMetaObject.connectSlotsByName(Searcher)
+ # setupUi
+
+ def retranslateUi(self, Searcher):
+ Searcher.setWindowTitle(QCoreApplication.translate(
+ "Searcher", u"Searcher", None))
+ self.projectTitle.setText(
+ QCoreApplication.translate("Searcher", u"Searcher", None))
+ self.pinwindow_btn.setText(
+ QCoreApplication.translate("Searcher", u"...", None))
+ self.opensettings_btn.setText(
+ QCoreApplication.translate("Searcher", u"...", None))
+ self.searchfilter_btn.setText(
+ QCoreApplication.translate("Searcher", u"...", None))
+ self.info_lbl.setText(QCoreApplication.translate(
+ "Searcher", u"Begin typing to search or click magnifying glass icon to display options", None))
+ # retranslateUi
diff --git a/scripts/python/searcher/database.py b/scripts/python/searcher/database.py
index ae74074..48de46a 100644
--- a/scripts/python/searcher/database.py
+++ b/scripts/python/searcher/database.py
@@ -1,5 +1,14 @@
+# region Imports
+from __future__ import print_function
+from __future__ import absolute_import
+import weakref
+
import hou
import os
+
+from searcher import util
+
+
from peewee import *
from playhouse.sqlite_ext import SqliteExtDatabase, SearchField, FTSModel
import time
@@ -189,7 +198,7 @@ def updatechangeindex(self, indexval, new=False):
def updatetmphk(self, tmpkey):
try:
- result = settings.update(
+ _ = settings.update(
defaulthotkey=tmpkey).where(id == 1).execute()
return
except(AttributeError, TypeError) as e:
@@ -198,7 +207,7 @@ def updatetmphk(self, tmpkey):
def updatelastkey(self, lastkey):
try:
- result = settings.update(
+ _ = settings.update(
lastused=lastkey).where(id == 1).execute()
return
except(AttributeError, TypeError) as e:
diff --git a/scripts/python/searcher/searcher.py b/scripts/python/searcher/searcher.py
index 272424f..05c51c7 100644
--- a/scripts/python/searcher/searcher.py
+++ b/scripts/python/searcher/searcher.py
@@ -8,18 +8,13 @@
from searcher import datahandler
from searcher import searcher_data
from searcher import searcher_settings
+from searcher import HelpButton
-from pyautogui import press, typewrite, hotkey
import hou
-from husdui.common import error_print, debug_print
-import toolutils
-import drivertoolutils
import platform
-import objecttoolutils
import os
import sys
import hdefereval as hd
-import stateutils
hver = 0
if os.environ["HFS"] != "":
ver = os.environ["HFS"]
@@ -27,14 +22,11 @@
from hutil.Qt import QtGui
from hutil.Qt import QtCore
from hutil.Qt import QtWidgets
- if int(hver) >= 391:
- from hutil.Qt import _QtUiTools
- elif int(hver) < 391:
- from hutil.Qt import QtUiTools
reload(searcher_settings)
reload(searcher_data)
reload(datahandler)
+reload(HelpButton)
reload(database)
reload(util)
# endregion
@@ -82,6 +74,7 @@ def keyconversion(key):
class Searcher(QtWidgets.QWidget):
"""instance.id Searcher for Houdini"""
+ # SECTION Class init
def __init__(self, kwargs, settings, windowsettings):
super(Searcher, self).__init__(hou.qt.mainWindow())
@@ -109,6 +102,7 @@ def __init__(self, kwargs, settings, windowsettings):
self.searching = False
self.ctxsearch = False
self.showglobal = True
+ self.previous_pos = None
self.searchprefix = False
self.keys_changed = False
self.searchdescription = False
@@ -121,7 +115,12 @@ def __init__(self, kwargs, settings, windowsettings):
# Event System Initialization
self.installEventFilter(self)
self.searchbox.installEventFilter(self)
+ self.pinwindow.installEventFilter(self)
+ self.helpButton.installEventFilter(self)
+ self.searchfilter.installEventFilter(self)
+ self.opensettingstool.installEventFilter(self)
self.searchresultstree.installEventFilter(self)
+ # !SECTION
# region ------------------------------------------------------------- Settings
def open_settings(self):
@@ -130,6 +129,7 @@ def open_settings(self):
self.ui.setFocus()
# endregion
+ # SECTION uisetup
# region ------------------------------------------------------------- UI
def setupContext(self):
cols = 4
@@ -161,52 +161,169 @@ def setupContext(self):
def uisetup(self):
self.main_widget = QtWidgets.QWidget(self)
- # Load UI File
- loader = None
- if int(hver) >= 391:
- loader = _QtUiTools.QUiLoader()
- else:
- loader = QtUiTools.QUiLoader()
-
- mainui = loader.load(script_path + "/searcher.ui")
-
names = ["open", "save", "hotkey", "perference"]
self.completer = QtWidgets.QCompleter(names)
- # Get UI Elements
- self.closebtn = mainui.findChild(
- QtWidgets.QToolButton,
- "close_btn"
+ # Layout
+ self.gridLayout = QtWidgets.QGridLayout()
+ self.gridLayout.setSpacing(0)
+ self.gridLayout.setContentsMargins(0, 0, 0, 0)
+ self.verticalLayout = QtWidgets.QVBoxLayout()
+ self.verticalLayout.setSpacing(0)
+
+ mainlayout = QtWidgets.QVBoxLayout()
+
+ self.titlerow = QtWidgets.QHBoxLayout()
+ self.titlerow.setSpacing(5)
+
+ self.titlespacer1 = QtWidgets.QSpacerItem(
+ 8, 0,
+ QtWidgets.QSizePolicy.Fixed,
+ QtWidgets.QSizePolicy.Minimum
)
- self.searchfilter = mainui.findChild(
- QtWidgets.QToolButton,
- "searchfilter_btn"
+
+ self.searcherlbl = QtWidgets.QLabel("Searcher")
+ font = QtGui.QFont()
+ font.setPointSize(15)
+ self.searcherlbl.setFont(font)
+ self.searcherlbl.setAlignment(QtCore.Qt.AlignCenter)
+
+ self.titlespacer2 = QtWidgets.QSpacerItem(
+ 40, 0,
+ QtWidgets.QSizePolicy.Expanding,
+ QtWidgets.QSizePolicy.Minimum
)
- self.pinwindow = mainui.findChild(
- QtWidgets.QToolButton,
- "pinwindow_btn"
+
+ self.helpButton = HelpButton.HelpButton("main")
+ self.pinwindow_btn = QtWidgets.QToolButton()
+ self.opensettings_btn = QtWidgets.QToolButton()
+
+ self.titlespacer3 = QtWidgets.QSpacerItem(
+ 8, 0,
+ QtWidgets.QSizePolicy.Fixed,
+ QtWidgets.QSizePolicy.Minimum
)
- self.opensettingstool = mainui.findChild(
- QtWidgets.QToolButton,
- "opensettings_btn"
+
+ # ------------------------------------------------------- Search Filter
+ # NOTE Search Filter --------------------------------------------------
+ self.searchrow = QtWidgets.QHBoxLayout()
+ self.searchrow.setSpacing(0)
+ self.frame = QtWidgets.QFrame()
+ searchframe_details = QtWidgets.QSizePolicy(
+ QtWidgets.QSizePolicy.Preferred,
+ QtWidgets.QSizePolicy.Preferred
)
- self.searchresultstree = mainui.findChild(
- QtWidgets.QTreeWidget,
- "searchresults_tree"
+ searchframe_details.setHorizontalStretch(2)
+ searchframe_details.setVerticalStretch(0)
+ searchframe_details.setHeightForWidth(
+ self.frame.sizePolicy().hasHeightForWidth())
+ self.frame.setSizePolicy(searchframe_details)
+ self.frame.setMinimumSize(QtCore.QSize(0, 20))
+ self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
+ self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
+ self.searchfilter_btn = QtWidgets.QToolButton(self.frame)
+ self.searchfilter_btn.setGeometry(QtCore.QRect(0, 0, 26, 20))
+ self.searchfilter_btn.setBaseSize(QtCore.QSize(16, 16))
+ self.searchfilter_btn.setStyleSheet(
+ u"background-color: rgb(19, 19, 19);")
+ self.searchfilter_btn.setArrowType(QtCore.Qt.NoArrow)
+
+ # ---------------------------------------------------------- Search Box
+ # NOTE Search Box -----------------------------------------------------
+ self.searchbox_txt = QtWidgets.QLineEdit()
+ searchbox_details = QtWidgets.QSizePolicy(
+ QtWidgets.QSizePolicy.Expanding,
+ QtWidgets.QSizePolicy.Minimum
)
- self.searchbox = mainui.findChild(
- QtWidgets.QLineEdit,
- "searchbox_txt"
+ searchbox_details.setHorizontalStretch(99)
+ searchbox_details.setVerticalStretch(0)
+ searchbox_details.setHeightForWidth(
+ self.searchbox_txt.sizePolicy().hasHeightForWidth())
+ self.searchbox_txt.setSizePolicy(searchbox_details)
+ self.searchbox_txt.setMinimumSize(QtCore.QSize(50, 0))
+ self.searchbox_txt.setMouseTracking(False)
+ self.searchbox_txt.setStyleSheet(u"background-color: rgb(19, 19, 19);")
+ self.searchbox_txt.setFrame(False)
+
+ # -------------------------------------------------------- Results Tree
+ # NOTE Results Tree ---------------------------------------------------
+ self.searchresults_tree = QtWidgets.QTreeWidget()
+ __qtreewidgetitem = QtWidgets.QTreeWidgetItem()
+ __qtreewidgetitem.setText(0, u"1")
+ self.searchresults_tree.setHeaderItem(__qtreewidgetitem)
+ resultstree_details = QtWidgets.QSizePolicy(
+ QtWidgets.QSizePolicy.Preferred,
+ QtWidgets.QSizePolicy.Expanding
)
-
- self.searchbox.setPlaceholderText(
- "Search.. <-- or click search icon to display options")
+ resultstree_details.setHorizontalStretch(0)
+ resultstree_details.setVerticalStretch(0)
+ resultstree_details.setHeightForWidth(
+ self.searchresults_tree.sizePolicy().hasHeightForWidth())
+ self.searchresults_tree.setSizePolicy(resultstree_details)
+ resultstree_font = QtGui.QFont()
+ resultstree_font.setPointSize(9)
+ self.searchresults_tree.setFont(resultstree_font)
+ self.searchresults_tree.setMouseTracking(False)
+ self.searchresults_tree.setFocusPolicy(QtCore.Qt.NoFocus)
+ self.searchresults_tree.setFrameShadow(QtWidgets.QFrame.Sunken)
+ self.searchresults_tree.setLineWidth(0)
+ self.searchresults_tree.setSizeAdjustPolicy(
+ QtWidgets.QAbstractScrollArea.AdjustToContents)
+ self.searchresults_tree.setAlternatingRowColors(True)
+ self.searchresults_tree.setSelectionMode(
+ QtWidgets.QAbstractItemView.SingleSelection)
+ self.searchresults_tree.setSelectionBehavior(
+ QtWidgets.QAbstractItemView.SelectRows)
+
+ # NOTE Info Panel --------------------------------------------------- Info Panel
+ self.info_lbl = QtWidgets.QLabel()
+ self.infolbl_font = QtGui.QFont()
+ self.infolbl_font.setPointSize(8)
+ self.infolbl_font.setBold(False)
+ self.infolbl_font.setWeight(50)
+ self.info_lbl.setFont(self.infolbl_font)
+ self.info_lbl.setStyleSheet(u"background-color: rgb(26, 26, 26);")
+ self.info_lbl.setMargin(2)
+ self.info_lbl.setIndent(5)
+ self.overlay = overlayLabel(self.info_lbl)
+ self.overlay.setFont(self.infolbl_font)
+ self.overlay.setStyleSheet(u"background-color: rgb(26, 26, 26);")
+ self.overlay.setMargin(2)
+ self.overlay.setIndent(5)
+
+ # NOTE Layout Implementation ------------------------------------------ Layout Implementation
+ self.titlerow.addItem(self.titlespacer1)
+ self.titlerow.addWidget(self.searcherlbl)
+ self.titlerow.addItem(self.titlespacer2)
+ self.titlerow.addWidget(self.helpButton)
+ self.titlerow.addWidget(self.pinwindow_btn)
+ self.titlerow.addWidget(self.opensettings_btn)
+ self.titlerow.addItem(self.titlespacer3)
+ self.verticalLayout.addLayout(self.titlerow)
+ self.searchrow.addWidget(self.frame)
+ self.searchrow.addWidget(self.searchbox_txt)
+ self.verticalLayout.addLayout(self.searchrow)
+ self.verticalLayout.addWidget(self.searchresults_tree)
+ self.gridLayout.addLayout(self.verticalLayout, 1, 0, 1, 1)
+ self.gridLayout.addWidget(self.overlay, 2, 0, 1, 1)
+ self.gridLayout.addWidget(self.info_lbl, 2, 0, 1, 1)
+
+ # NOTE Layout to functionality connection -----------------------------
+ self.searchfilter = self.searchfilter_btn
+ self.pinwindow = self.pinwindow_btn
+ self.opensettingstool = self.opensettings_btn
+ self.searchresultstree = self.searchresults_tree
+ self.searchbox = self.searchbox_txt
+ self.infolbl = self.info_lbl
+
+ # NOTE Settings and details -------------------------------------------
+ self.searchbox.setPlaceholderText(" Begin typing to search..")
self.searchbox.setFocusPolicy(QtCore.Qt.StrongFocus)
self.searchbox.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
self.searchbox.setClearButtonEnabled(True)
self.searchfilter.clicked.connect(self.searchfilter_cb)
- searchfilter_button_size = hou.ui.scaledSize(14)
+ searchfilter_button_size = hou.ui.scaledSize(12)
self.searchfilter.setProperty("flat", True)
self.searchfilter.setIcon(util.SEARCH_ICON)
self.searchfilter.setIconSize(QtCore.QSize(
@@ -236,20 +353,28 @@ def uisetup(self):
self.searchbox.customContextMenuRequested.connect(self.openmenu)
self.searchresultstree.itemActivated.connect(self.searchclick_cb)
- # Layout
- mainlayout = QtWidgets.QVBoxLayout()
mainlayout.setAlignment(QtCore.Qt.AlignBottom)
mainlayout.setContentsMargins(0, 0, 0, 0)
mainlayout.setGeometry(QtCore.QRect(0, 0, 1400, 1200))
- mainlayout.addWidget(mainui)
+
+ mainlayout.addLayout(self.gridLayout)
self.setLayout(mainlayout)
+ self.searchbox.setToolTip(
+ 'Begin typing to search or click magnifying glass icon to display options')
+ self.pinwindow.setToolTip(
+ 'Pin the search window to keep it from closing automatically when losing focus')
+ self.searchfilter.setToolTip(
+ 'Select a predefined filter')
+ self.opensettingstool.setToolTip(
+ 'General application settings')
+ self.searchresultstree.setToolTip(
+ 'Double click an action to attempt to perform it. Some actions only work in specific contexts')
+
self.setupContext()
- # self.activateWindow()
self.searchbox.setFocus()
self.searchbox.grabKeyboard()
-
- # endregion
+ # !SECTION
# region ------------------------------------------------------------- Initial Setup
@@ -294,9 +419,6 @@ def getpane(self):
# endregion
# region ------------------------------------------------------------- Callbacks
- def close_cb(self):
- self.close()
-
def searchfilter_cb(self):
self.openmenu()
@@ -346,6 +468,11 @@ def ctxsearcher(self, ctx=None):
print(self.getpane())
results = self.handler.searchctx(ctxresult)
+ elif ctx == ":g":
+ self.ctxsearch = True
+ ctxresult.append("h")
+ results = self.handler.searchctx(ctxresult)
+
self.searchtablepopulate(results)
self.ctxsearch = False
self.searchbox.clearFocus()
@@ -355,8 +482,8 @@ def ctxsearcher(self, ctx=None):
)
def textchange_cb(self, text):
- # if len(text) > 0:
- # self.searchfilter.setVisible(False)
+ if len(text) > 0:
+ self.infolbl.setText(self.searchresultstree.toolTip())
if text in util.CTXSHOTCUTS:
self.ctxsearcher(text)
elif len(text) > 1 and text not in util.CTXSHOTCUTS:
@@ -366,7 +493,8 @@ def textchange_cb(self, text):
else:
self.searching = False
self.searchresultstree.clear()
- # self.searchfilter.setVisible(True)
+ self.infolbl.setText(
+ "Begin typing to search or click magnifying glass icon to display options")
def searchclick_cb(self, item, column):
hk = item.text(2)
@@ -390,20 +518,30 @@ def searchclick_cb(self, item, column):
def openmenu(self):
self.menuopened = True
self.searchmenu = QtWidgets.QMenu()
- self.searchmenu.setProperty("flat", True)
+ self.searchmenu.setProperty('flat', True)
self.searchmenu.setStyleSheet(util.MENUSTYLE)
self.searchmenu.setWindowFlags(
self.searchmenu.windowFlags() |
QtCore.Qt.NoDropShadowWindowHint
)
- self.globalrefix = self.searchmenu.addAction("Global items")
+ self.globalprefix = self.searchmenu.addAction("Global items")
self.contextprefix = self.searchmenu.addAction("Context items")
self.viewprefix = self.searchmenu.addAction("View items")
- self.searchmenu.setDefaultAction(self.globalrefix)
+
+ self.globalprefix.setToolTip(
+ "View application-wide actions")
+
+ self.contextprefix.setToolTip(
+ "Shows possible actions for the view in which the mouse was in when the window was opened")
+
+ self.viewprefix.setToolTip(
+ "Shows the available view panes (ex. Scene View, Render View, Composit View, etc")
+
+ self.searchmenu.hovered.connect(self.handlemenuhovered)
self.action = self.searchmenu.exec_(
self.searchbox.mapToGlobal(QtCore.QPoint(0, 20)))
- if self.action == self.globalrefix:
+ if self.action == self.globalprefix:
self.searchbox.setText(":g")
if self.action == self.contextprefix:
self.searchbox.setText(":c")
@@ -412,8 +550,11 @@ def openmenu(self):
self.searchmenu.installEventFilter(self)
+ def handlemenuhovered(self, action):
+ self.infolbl.setText(action.toolTip())
+
def getContext(self, ctx):
- """Return houdini context string."""
+ """Return Houdini context string."""
try:
hou_context = ctx.pwd().childTypeCategory().name()
except:
@@ -485,7 +626,6 @@ def processkey(self, key, tmphk=False):
key = key[0].split('+')
- mods = []
skey = None
ikey = None
key = keyconversion(key)
@@ -540,19 +680,75 @@ def removetemphotkey(self, symbol, tmpkey):
# endregion
# region ------------------------------------------------------------- Events
+ # SECTION Events
+ def fade_in(self, target, duration):
+ self.effect = QtWidgets.QGraphicsOpacityEffect()
+ self.tar = target
+ self.tar.setGraphicsEffect(self.effect)
+ self.an = QtCore.QPropertyAnimation(self.effect, b"opacity")
+ self.an.setDuration(duration)
+ self.an.setStartValue(0)
+ self.an.setEndValue(1)
+ self.an.start()
+
+ def fade_out(self, target, duration):
+ self.effect = QtWidgets.QGraphicsOpacityEffect()
+ self.tar = target
+ self.tar.setGraphicsEffect(self.effect)
+ self.an = QtCore.QPropertyAnimation(self.effect, b"opacity")
+ self.an.setDuration(duration)
+ self.an.setStartValue(1)
+ self.an.setEndValue(0)
+ self.an.start()
+
+ def info_fade(self, fadein):
+ self.animation = QtCore.QPropertyAnimation(
+ self.infolbl_font, b'opacity')
+ self.animation.setDuration(200)
+ if fadein:
+ self.animation.setStartValue(0.0)
+ self.animation.setEndValue(1.0)
+ if not fadein:
+ self.animation.setStartValue(1.0)
+ self.animation.setEndValue(0.0)
+ self.animation.setEasingCurve(QtGui.QEasingCurve.OutQuad)
+ self.animation.start()
+
+ def checktooltip(self, obj):
+ if obj == self.searchresultstree:
+ if self.searching:
+ self.infolbl.setText(obj.toolTip())
+ else:
+ self.infolbl.setText(self.searchbox.toolTip())
+ else:
+ self.fade_in(self.infolbl, 200)
+ self.infolbl.setText(obj.toolTip())
+
def eventFilter(self, obj, event):
# ---------------------------------------------------- Mouse
+ if event.type() == QtCore.QEvent.Enter:
+ self.checktooltip(obj)
+ if event.type() == QtCore.QEvent.Leave:
+ self.fade_out(self.infolbl, 200)
+ self.infolbl.setText("")
+ if event.type() == QtCore.QEvent.ToolTip:
+ return True
+
if event.type() == QtCore.QEvent.MouseButtonPress:
if obj == self.searchbox:
return QtCore.QObject.eventFilter(self, obj, event)
- elif obj == self:
+ else:
self.previous_pos = event.globalPos()
+ return QtCore.QObject.eventFilter(self, obj, event)
if event.type() == QtCore.QEvent.MouseMove:
- delta = event.globalPos() - self.previous_pos
- self.move(self.x() + delta.x(), self.y()+delta.y())
- self.previous_pos = event.globalPos()
- self._drag_active = True
+ if obj == self:
+ delta = event.globalPos() - self.previous_pos
+ self.move(self.x() + delta.x(), self.y()+delta.y())
+ self.previous_pos = event.globalPos()
+ self._drag_active = True
+ else:
+ return QtCore.QObject.eventFilter(self, obj, event)
if event.type() == QtCore.QEvent.MouseButtonRelease:
if self._drag_active:
@@ -651,10 +847,16 @@ def eventFilter(self, obj, event):
self.setParent(None)
self.deleteLater()
return QtCore.QObject.eventFilter(self, obj, event)
-
- # endregion
+ # !SECTION
+ # endregion
# endregion
+
+class overlayLabel(QtWidgets.QLabel):
+ def __init__(self, parent=None):
+ super(overlayLabel, self).__init__(parent)
+ self.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter)
+
# region ----------------------------------------------------------------- Setup Functions
@@ -679,7 +881,6 @@ def CreateSearcherPanel(kwargs, searcher_window=None):
windowsettings = QtCore.QSettings("instance.id", "Searcher")
searcher_window = Searcher(kwargs, settings, windowsettings)
- # searcher_window.setAttribute(QtCore.Qt.WA_)
searcher_window.setWindowFlags(
# searcher_window.windowFlags() |
QtCore.Qt.Tool |
diff --git a/scripts/python/searcher/searcher.ui b/scripts/python/searcher/searcher.ui
deleted file mode 100644
index c1ee4fb..0000000
--- a/scripts/python/searcher/searcher.ui
+++ /dev/null
@@ -1,231 +0,0 @@
-
-
- Searcher
-
-
- Qt::WindowModal
-
-
-
- 0
- 0
- 1000
- 328
-
-
-
-
- 0
- 0
-
-
-
-
- 0
- 0
-
-
-
-
- 1000
- 350
-
-
-
- Searcher
-
-
- QTreeWidget QHeaderView::section {
- font-size: 9pt;
-}
-
-
-
- 8
-
-
- 2
-
-
- 8
-
-
- 8
-
-
- 2
-
- -
-
-
-
-
-
-
- 0
- 0
-
-
-
-
- 15
-
-
-
- Searcher
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 5
-
-
-
-
- -
-
-
- ...
-
-
-
- -
-
-
- ...
-
-
-
-
-
- -
-
-
-
-
-
-
- 0
- 0
-
-
-
-
- 0
- 20
-
-
-
-
- 0
- 50
-
-
-
- background-color: rgb(19, 19, 19);
-
-
- QFrame::StyledPanel
-
-
- QFrame::Raised
-
-
- 0
-
-
-
-
- 0
- 0
- 26
- 20
-
-
-
- ...
-
-
- Qt::NoArrow
-
-
-
-
-
- 29
- 0
- 1971
- 20
-
-
-
- false
-
-
-
-
-
- false
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 9
-
-
-
- false
-
-
- Qt::NoFocus
-
-
- QFrame::Sunken
-
-
- 0
-
-
- QAbstractScrollArea::AdjustToContents
-
-
- true
-
-
- QAbstractItemView::SingleSelection
-
-
- QAbstractItemView::SelectRows
-
-
-
- 1
-
-
-
-
-
-
-
-
-
-
-
diff --git a/scripts/python/searcher/searcher_settings.py b/scripts/python/searcher/searcher_settings.py
index f111314..93fd8a0 100644
--- a/scripts/python/searcher/searcher_settings.py
+++ b/scripts/python/searcher/searcher_settings.py
@@ -3,6 +3,10 @@
from __future__ import absolute_import
import weakref
+from searcher import searcher_data
+from searcher import util
+from inspect import currentframe
+
from builtins import range
from past.utils import old_div
import platform
@@ -19,10 +23,11 @@
from hutil.Qt import QtGui
from hutil.Qt import QtCore
from hutil.Qt import QtWidgets
- if int(hver) >= 391:
+ if hver >= 395:
+ from hutil.Qt import QtUiTools
+ elif hver <= 394 and hver >= 391:
from hutil.Qt import _QtUiTools
-
- elif int(hver) < 391:
+ elif hver < 391 and hver >= 348:
from hutil.Qt import QtUiTools
# else:
# os.environ['QT_API'] = 'pyside2'
@@ -31,9 +36,6 @@
# from qtpy import QtCore
# from qtpy import QtWidgets
-from inspect import currentframe
-from searcher import util
-from searcher import searcher_data
the_scaled_icon_size = hou.ui.scaledSize(16)
the_icon_size = 16
@@ -41,7 +43,7 @@
num = 0
# info
__author__ = "instance.id"
-__copyright__ = "2020 All rights reserved. See LICENSE for more details."
+__copyright__ = "2020 All rights reserved."
__status__ = "Prototype"
scriptpath = os.path.dirname(os.path.realpath(__file__))
@@ -83,22 +85,16 @@ def __init__(self, handler, tmphotkey, parent=None):
self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
self.settings = searcher_data.loadsettings()
self.isdebug = bc(self.settings[util.SETTINGS_KEYS[4]])
-
+
# Load UI File
loader = None
- if int(hver) >= 391:
+ if int(hver) >= 391 and int(hver) <= 394:
loader = _QtUiTools.QUiLoader()
else:
loader = QtUiTools.QUiLoader()
self.ui = loader.load(scriptpath + '/searchersettings.ui')
# Get UI Elements
-
- tooltip = hou.qt.ToolTip()
- tooltip.setTitle("Tooltip Example - SOP Torus Help")
- tooltip.setText("This tooltip links to the SOP Torus help page.")
- tooltip.setHelpUrl("/nodes/sop/torus")
-
self.hotkey_icon = self.ui.findChild(
QtWidgets.QToolButton,
"hotkey_icon"
@@ -146,7 +142,6 @@ def __init__(self, handler, tmphotkey, parent=None):
mainlayout = QtWidgets.QVBoxLayout()
mainlayout.addWidget(self.ui)
- mainlayout.addWidget(hou.qt.createHelpButton("/ref/panes/lightmixer"))
# ------------------------------------------------- Create Connections
# self.in_memory_db.stateChanged.connect(self.toggledebug)
@@ -160,8 +155,6 @@ def __init__(self, handler, tmphotkey, parent=None):
info_button_size
))
- tooltip.setTargetWidget(self.hotkey_icon)
-
self.hkinput.setText(self.tmphotkey)
self.hkinput.setStatusTip("Status Tip?")
self.hkinput.setWhatsThis("Whats this?")
@@ -205,6 +198,10 @@ def test1_cb(self):
hkeys = []
for i in range(len(util.HOTKEYLIST)):
result = hou.hotkeys.findConflicts("h", util.HOTKEYLIST[i])
+ if result:
+ print ("Confliction found: {}".format(result))
+ else:
+ print("No Confliction: {}".format(result))
hkeys.append(result)
print (hkeys)
diff --git a/scripts/python/searcher/searcher_ui.py b/scripts/python/searcher/searcher_ui.py
new file mode 100644
index 0000000..8c0b147
--- /dev/null
+++ b/scripts/python/searcher/searcher_ui.py
@@ -0,0 +1,185 @@
+# -*- coding: utf-8 -*-
+
+################################################################################
+## Form generated from reading UI file 'searcher_ui.ui'
+##
+## Created by: Qt User Interface Compiler version 5.14.1
+##
+## WARNING! All changes made in this file will be lost when recompiling UI file!
+################################################################################
+
+from PySide2.QtCore import (QCoreApplication, QMetaObject, QObject, QPoint,
+ QRect, QSize, QUrl, Qt)
+from PySide2.QtGui import (QBrush, QColor, QConicalGradient, QCursor, QFont,
+ QFontDatabase, QIcon, QLinearGradient, QPalette, QPainter, QPixmap,
+ QRadialGradient)
+from PySide2.QtWidgets import *
+
+from .HelpButton import HelpButton
+
+
+class Ui_Searcher(object):
+ def setupUi(self, Searcher):
+ if Searcher.objectName():
+ Searcher.setObjectName(u"Searcher")
+ Searcher.setWindowModality(Qt.WindowModal)
+ Searcher.resize(1000, 329)
+ sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(Searcher.sizePolicy().hasHeightForWidth())
+ Searcher.setSizePolicy(sizePolicy)
+ Searcher.setMinimumSize(QSize(0, 0))
+ Searcher.setBaseSize(QSize(1000, 350))
+ Searcher.setStyleSheet(u"QTreeWidget QHeaderView::section {\n"
+" font-size: 9pt;\n"
+"}")
+ self.gridLayout = QGridLayout(Searcher)
+ self.gridLayout.setSpacing(0)
+ self.gridLayout.setObjectName(u"gridLayout")
+ self.gridLayout.setContentsMargins(0, 0, 0, 0)
+ self.verticalLayout = QVBoxLayout()
+ self.verticalLayout.setSpacing(0)
+ self.verticalLayout.setObjectName(u"verticalLayout")
+ self.horizontalLayout = QHBoxLayout()
+ self.horizontalLayout.setSpacing(0)
+ self.horizontalLayout.setObjectName(u"horizontalLayout")
+ self.horizontalSpacer_2 = QSpacerItem(8, 2, QSizePolicy.Fixed, QSizePolicy.Minimum)
+
+ self.horizontalLayout.addItem(self.horizontalSpacer_2)
+
+ self.projectTitle = QLabel(Searcher)
+ self.projectTitle.setObjectName(u"projectTitle")
+ sizePolicy1 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred)
+ sizePolicy1.setHorizontalStretch(0)
+ sizePolicy1.setVerticalStretch(0)
+ sizePolicy1.setHeightForWidth(self.projectTitle.sizePolicy().hasHeightForWidth())
+ self.projectTitle.setSizePolicy(sizePolicy1)
+ font = QFont()
+ font.setPointSize(15)
+ self.projectTitle.setFont(font)
+ self.projectTitle.setAlignment(Qt.AlignCenter)
+
+ self.horizontalLayout.addWidget(self.projectTitle)
+
+ self.horizontalSpacer = QSpacerItem(40, 5, QSizePolicy.Expanding, QSizePolicy.Minimum)
+
+ self.horizontalLayout.addItem(self.horizontalSpacer)
+
+ self.HelpButton = HelpButton(Searcher)
+ self.HelpButton.setObjectName(u"HelpButton")
+
+ self.horizontalLayout.addWidget(self.HelpButton)
+
+ self.pinwindow_btn = QToolButton(Searcher)
+ self.pinwindow_btn.setObjectName(u"pinwindow_btn")
+
+ self.horizontalLayout.addWidget(self.pinwindow_btn)
+
+ self.opensettings_btn = QToolButton(Searcher)
+ self.opensettings_btn.setObjectName(u"opensettings_btn")
+
+ self.horizontalLayout.addWidget(self.opensettings_btn)
+
+ self.horizontalSpacer_3 = QSpacerItem(8, 2, QSizePolicy.Fixed, QSizePolicy.Minimum)
+
+ self.horizontalLayout.addItem(self.horizontalSpacer_3)
+
+
+ self.verticalLayout.addLayout(self.horizontalLayout)
+
+ self.horizontalLayout_3 = QHBoxLayout()
+ self.horizontalLayout_3.setSpacing(0)
+ self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
+ self.frame = QFrame(Searcher)
+ self.frame.setObjectName(u"frame")
+ sizePolicy2 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
+ sizePolicy2.setHorizontalStretch(2)
+ sizePolicy2.setVerticalStretch(0)
+ sizePolicy2.setHeightForWidth(self.frame.sizePolicy().hasHeightForWidth())
+ self.frame.setSizePolicy(sizePolicy2)
+ self.frame.setMinimumSize(QSize(0, 20))
+ self.frame.setFrameShape(QFrame.StyledPanel)
+ self.frame.setFrameShadow(QFrame.Raised)
+ self.searchfilter_btn = QToolButton(self.frame)
+ self.searchfilter_btn.setObjectName(u"searchfilter_btn")
+ self.searchfilter_btn.setGeometry(QRect(0, 0, 26, 20))
+ self.searchfilter_btn.setBaseSize(QSize(16, 16))
+ self.searchfilter_btn.setStyleSheet(u"background-color: rgb(19, 19, 19);")
+ self.searchfilter_btn.setArrowType(Qt.NoArrow)
+
+ self.horizontalLayout_3.addWidget(self.frame)
+
+ self.searchbox_txt = QLineEdit(Searcher)
+ self.searchbox_txt.setObjectName(u"searchbox_txt")
+ sizePolicy3 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Minimum)
+ sizePolicy3.setHorizontalStretch(99)
+ sizePolicy3.setVerticalStretch(0)
+ sizePolicy3.setHeightForWidth(self.searchbox_txt.sizePolicy().hasHeightForWidth())
+ self.searchbox_txt.setSizePolicy(sizePolicy3)
+ self.searchbox_txt.setMinimumSize(QSize(50, 0))
+ self.searchbox_txt.setMouseTracking(False)
+ self.searchbox_txt.setStyleSheet(u"background-color: rgb(19, 19, 19);")
+ self.searchbox_txt.setFrame(False)
+
+ self.horizontalLayout_3.addWidget(self.searchbox_txt)
+
+
+ self.verticalLayout.addLayout(self.horizontalLayout_3)
+
+ self.searchresults_tree = QTreeWidget(Searcher)
+ __qtreewidgetitem = QTreeWidgetItem()
+ __qtreewidgetitem.setText(0, u"1");
+ self.searchresults_tree.setHeaderItem(__qtreewidgetitem)
+ self.searchresults_tree.setObjectName(u"searchresults_tree")
+ sizePolicy4 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding)
+ sizePolicy4.setHorizontalStretch(0)
+ sizePolicy4.setVerticalStretch(0)
+ sizePolicy4.setHeightForWidth(self.searchresults_tree.sizePolicy().hasHeightForWidth())
+ self.searchresults_tree.setSizePolicy(sizePolicy4)
+ font1 = QFont()
+ font1.setPointSize(9)
+ self.searchresults_tree.setFont(font1)
+ self.searchresults_tree.setMouseTracking(False)
+ self.searchresults_tree.setFocusPolicy(Qt.NoFocus)
+ self.searchresults_tree.setFrameShadow(QFrame.Sunken)
+ self.searchresults_tree.setLineWidth(0)
+ self.searchresults_tree.setSizeAdjustPolicy(QAbstractScrollArea.AdjustToContents)
+ self.searchresults_tree.setAlternatingRowColors(True)
+ self.searchresults_tree.setSelectionMode(QAbstractItemView.SingleSelection)
+ self.searchresults_tree.setSelectionBehavior(QAbstractItemView.SelectRows)
+
+ self.verticalLayout.addWidget(self.searchresults_tree)
+
+
+ self.gridLayout.addLayout(self.verticalLayout, 1, 0, 1, 1)
+
+ self.info_lbl = QLabel(Searcher)
+ self.info_lbl.setObjectName(u"info_lbl")
+ font2 = QFont()
+ font2.setPointSize(8)
+ font2.setBold(False)
+ font2.setWeight(50)
+ self.info_lbl.setFont(font2)
+ self.info_lbl.setStyleSheet(u"background-color: rgb(26, 26, 26);")
+ self.info_lbl.setMargin(2)
+ self.info_lbl.setIndent(5)
+
+ self.gridLayout.addWidget(self.info_lbl, 2, 0, 1, 1)
+
+
+ self.retranslateUi(Searcher)
+
+ QMetaObject.connectSlotsByName(Searcher)
+ # setupUi
+
+ def retranslateUi(self, Searcher):
+ Searcher.setWindowTitle(QCoreApplication.translate("Searcher", u"Searcher", None))
+ self.projectTitle.setText(QCoreApplication.translate("Searcher", u"Searcher", None))
+ self.HelpButton.setText(QCoreApplication.translate("Searcher", u"...", None))
+ self.pinwindow_btn.setText(QCoreApplication.translate("Searcher", u"...", None))
+ self.opensettings_btn.setText(QCoreApplication.translate("Searcher", u"...", None))
+ self.searchfilter_btn.setText(QCoreApplication.translate("Searcher", u"...", None))
+ self.info_lbl.setText(QCoreApplication.translate("Searcher", u"Begin typing to search or click magnifying glass icon to display options", None))
+ # retranslateUi
+
diff --git a/scripts/python/searcher/searcher_ui.ui b/scripts/python/searcher/searcher_ui.ui
new file mode 100644
index 0000000..baa6881
--- /dev/null
+++ b/scripts/python/searcher/searcher_ui.ui
@@ -0,0 +1,215 @@
+
+
+ Searcher
+
+
+ Qt::WindowModal
+
+
+
+ 0
+ 0
+ 1000
+ 329
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 1000
+ 350
+
+
+
+ Searcher
+
+
+ QTreeWidget QHeaderView::section {
+ font-size: 9pt;
+}
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+ -
+
+
+ 0
+
+
-
+
+
+ 0
+
+
-
+
+
+
+ 2
+ 0
+
+
+
+
+ 0
+ 20
+
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Raised
+
+
+
+
+ 0
+ 0
+ 26
+ 20
+
+
+
+
+ 16
+ 16
+
+
+
+ background-color: rgb(19, 19, 19);
+
+
+ ...
+
+
+ Qt::NoArrow
+
+
+
+
+ -
+
+
+
+ 99
+ 0
+
+
+
+
+ 50
+ 0
+
+
+
+ false
+
+
+ background-color: rgb(19, 19, 19);
+
+
+ false
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 9
+
+
+
+ false
+
+
+ Qt::NoFocus
+
+
+ QFrame::Sunken
+
+
+ 0
+
+
+ QAbstractScrollArea::AdjustToContents
+
+
+ true
+
+
+ QAbstractItemView::SingleSelection
+
+
+ QAbstractItemView::SelectRows
+
+
+
+ 1
+
+
+
+
+
+
+ -
+
+
+
+ 8
+ 50
+ false
+
+
+
+ background-color: rgb(26, 26, 26);
+
+
+ Begin typing to search or click magnifying glass icon to display options
+
+
+ 2
+
+
+ 5
+
+
+
+
+
+
+
+
diff --git a/scripts/python/searcher/searcher_ui.ui.bak b/scripts/python/searcher/searcher_ui.ui.bak
new file mode 100644
index 0000000..519e1e7
--- /dev/null
+++ b/scripts/python/searcher/searcher_ui.ui.bak
@@ -0,0 +1,316 @@
+
+
+ Searcher
+
+
+ Qt::WindowModal
+
+
+
+ 0
+ 0
+ 1000
+ 329
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 1000
+ 350
+
+
+
+ Searcher
+
+
+ QTreeWidget QHeaderView::section {
+ font-size: 9pt;
+}
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+ -
+
+
+ 0
+
+
-
+
+
+ 0
+
+
-
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Fixed
+
+
+
+ 8
+ 2
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 15
+
+
+
+ Searcher
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 5
+
+
+
+
+ -
+
+
+ ...
+
+
+
+ -
+
+
+ ...
+
+
+
+ -
+
+
+ ...
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Fixed
+
+
+
+ 8
+ 2
+
+
+
+
+
+
+ -
+
+
+ 0
+
+
-
+
+
+
+ 2
+ 0
+
+
+
+
+ 0
+ 20
+
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Raised
+
+
+
+
+ 0
+ 0
+ 26
+ 20
+
+
+
+
+ 16
+ 16
+
+
+
+ background-color: rgb(19, 19, 19);
+
+
+ ...
+
+
+ Qt::NoArrow
+
+
+
+
+ -
+
+
+
+ 99
+ 0
+
+
+
+
+ 50
+ 0
+
+
+
+ false
+
+
+ background-color: rgb(19, 19, 19);
+
+
+ false
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 9
+
+
+
+ false
+
+
+ Qt::NoFocus
+
+
+ QFrame::Sunken
+
+
+ 0
+
+
+ QAbstractScrollArea::AdjustToContents
+
+
+ true
+
+
+ QAbstractItemView::SingleSelection
+
+
+ QAbstractItemView::SelectRows
+
+
+
+ 1
+
+
+
+
+
+
+ -
+
+
+
+ 8
+ 50
+ false
+
+
+
+ background-color: rgb(26, 26, 26);
+
+
+ Begin typing to search or click magnifying glass icon to display options
+
+
+ 2
+
+
+ 5
+
+
+
+
+
+
+
+ HelpButton
+ QPushButton
+
+
+
+
+
+
diff --git a/scripts/python/searcher/searcher_util.py b/scripts/python/searcher/searcher_util.py
new file mode 100644
index 0000000..34e4aed
--- /dev/null
+++ b/scripts/python/searcher/searcher_util.py
@@ -0,0 +1,124 @@
+# -*- coding: utf-8 -*-
+
+################################################################################
+## Form generated from reading UI file 'searcher_util.ui'
+##
+## Created by: Qt User Interface Compiler version 5.14.1
+##
+## WARNING! All changes made in this file will be lost when recompiling UI file!
+################################################################################
+
+from PySide2.QtCore import (QCoreApplication, QMetaObject, QObject, QPoint,
+ QRect, QSize, QUrl, Qt)
+from PySide2.QtGui import (QBrush, QColor, QConicalGradient, QCursor, QFont,
+ QFontDatabase, QIcon, QLinearGradient, QPalette, QPainter, QPixmap,
+ QRadialGradient)
+from PySide2.QtWidgets import *
+
+
+class Ui_Searcher(object):
+ def setupUi(self, Searcher):
+ if Searcher.objectName():
+ Searcher.setObjectName(u"Searcher")
+ Searcher.setWindowModality(Qt.NonModal)
+ Searcher.resize(1000, 113)
+ sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(Searcher.sizePolicy().hasHeightForWidth())
+ Searcher.setSizePolicy(sizePolicy)
+ Searcher.setMinimumSize(QSize(0, 0))
+ Searcher.setBaseSize(QSize(1000, 350))
+ self.gridLayout = QGridLayout(Searcher)
+ self.gridLayout.setObjectName(u"gridLayout")
+ self.verticalLayout_4 = QVBoxLayout()
+ self.verticalLayout_4.setObjectName(u"verticalLayout_4")
+ self.horizontalLayout_4 = QHBoxLayout()
+ self.horizontalLayout_4.setObjectName(u"horizontalLayout_4")
+ self.projectTitle = QLabel(Searcher)
+ self.projectTitle.setObjectName(u"projectTitle")
+ font = QFont()
+ font.setPointSize(15)
+ self.projectTitle.setFont(font)
+ self.projectTitle.setAlignment(Qt.AlignCenter)
+
+ self.horizontalLayout_4.addWidget(self.projectTitle)
+
+ self.gocommand_txt = QLineEdit(Searcher)
+ self.gocommand_txt.setObjectName(u"gocommand_txt")
+
+ self.horizontalLayout_4.addWidget(self.gocommand_txt)
+
+ self.sendgocommand_btn = QPushButton(Searcher)
+ self.sendgocommand_btn.setObjectName(u"sendgocommand_btn")
+
+ self.horizontalLayout_4.addWidget(self.sendgocommand_btn)
+
+
+ self.verticalLayout_4.addLayout(self.horizontalLayout_4)
+
+ self.horizontalLayout = QHBoxLayout()
+ self.horizontalLayout.setObjectName(u"horizontalLayout")
+ self.opensearchwindow_btn = QPushButton(Searcher)
+ self.opensearchwindow_btn.setObjectName(u"opensearchwindow_btn")
+
+ self.horizontalLayout.addWidget(self.opensearchwindow_btn)
+
+ self.gethotkeys_btn = QPushButton(Searcher)
+ self.gethotkeys_btn.setObjectName(u"gethotkeys_btn")
+
+ self.horizontalLayout.addWidget(self.gethotkeys_btn)
+
+ self.updatehotkeys_btn = QPushButton(Searcher)
+ self.updatehotkeys_btn.setObjectName(u"updatehotkeys_btn")
+
+ self.horizontalLayout.addWidget(self.updatehotkeys_btn)
+
+ self.loadhotkeys_btn = QPushButton(Searcher)
+ self.loadhotkeys_btn.setObjectName(u"loadhotkeys_btn")
+
+ self.horizontalLayout.addWidget(self.loadhotkeys_btn)
+
+
+ self.verticalLayout_4.addLayout(self.horizontalLayout)
+
+
+ self.gridLayout.addLayout(self.verticalLayout_4, 1, 0, 1, 1)
+
+ self.horizontalLayout_2 = QHBoxLayout()
+ self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
+ self.callgo_btn = QPushButton(Searcher)
+ self.callgo_btn.setObjectName(u"callgo_btn")
+
+ self.horizontalLayout_2.addWidget(self.callgo_btn)
+
+ self.other_btn = QPushButton(Searcher)
+ self.other_btn.setObjectName(u"other_btn")
+
+ self.horizontalLayout_2.addWidget(self.other_btn)
+
+
+ self.gridLayout.addLayout(self.horizontalLayout_2, 2, 0, 1, 1)
+
+ self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
+
+ self.gridLayout.addItem(self.verticalSpacer, 3, 0, 1, 1)
+
+
+ self.retranslateUi(Searcher)
+
+ QMetaObject.connectSlotsByName(Searcher)
+ # setupUi
+
+ def retranslateUi(self, Searcher):
+ Searcher.setWindowTitle(QCoreApplication.translate("Searcher", u"Form", None))
+ self.projectTitle.setText(QCoreApplication.translate("Searcher", u"Searcher Settings", None))
+ self.sendgocommand_btn.setText(QCoreApplication.translate("Searcher", u"Send Go Cmd", None))
+ self.opensearchwindow_btn.setText(QCoreApplication.translate("Searcher", u"Open Search", None))
+ self.gethotkeys_btn.setText(QCoreApplication.translate("Searcher", u"Get Hotkeys", None))
+ self.updatehotkeys_btn.setText(QCoreApplication.translate("Searcher", u"Update HotKeys", None))
+ self.loadhotkeys_btn.setText(QCoreApplication.translate("Searcher", u"Load Hotkeys", None))
+ self.callgo_btn.setText(QCoreApplication.translate("Searcher", u"Call Go", None))
+ self.other_btn.setText(QCoreApplication.translate("Searcher", u"Clear Data", None))
+ # retranslateUi
+
diff --git a/scripts/python/searcher/searchersettings.ui b/scripts/python/searcher/searchersettings.ui
index a13093d..a87aead 100644
--- a/scripts/python/searcher/searchersettings.ui
+++ b/scripts/python/searcher/searchersettings.ui
@@ -10,7 +10,7 @@
0
0
600
- 185
+ 164
@@ -192,17 +192,6 @@
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/scripts/python/searcher/widgets/__init__py b/scripts/python/searcher/widgets/__init__py
new file mode 100644
index 0000000..e69de29
diff --git a/toolbar/searchertool.shelf b/toolbar/searchertool.shelf
index 7c74823..4cab482 100644
--- a/toolbar/searchertool.shelf
+++ b/toolbar/searchertool.shelf
@@ -7,6 +7,6 @@
-
+