From be44e1adae3dba216ff8c326a9d9cfdd6a7af775 Mon Sep 17 00:00:00 2001 From: Dan Date: Sat, 18 Apr 2020 14:44:14 -0500 Subject: [PATCH] bug fixes and such --- python2.7libs/searcher/Untitled.json | 14 ++ python2.7libs/searcher/about.py | 1 - python2.7libs/searcher/bugreport.py | 90 +++++++--- python2.7libs/searcher/bugreport_ui.py | 72 +++----- python2.7libs/searcher/bugsubmit.html | 18 +- python2.7libs/searcher/searcher_settings.py | 11 +- .../searcher/searcher_settings_ui.py | 22 ++- python2.7libs/searcher/theme.py | 6 +- python2.7libs/searcher/ui_files/bugreport.py | 72 ++++---- python2.7libs/searcher/ui_files/bugreport.ui | 159 ++++++++---------- python_panels/searcher.pypanel | 6 +- toolbar/searcher_tool.shelf | 28 ++- 12 files changed, 264 insertions(+), 235 deletions(-) create mode 100644 python2.7libs/searcher/Untitled.json diff --git a/python2.7libs/searcher/Untitled.json b/python2.7libs/searcher/Untitled.json new file mode 100644 index 0000000..4d9eec8 --- /dev/null +++ b/python2.7libs/searcher/Untitled.json @@ -0,0 +1,14 @@ +{ + "env": [ + { + "MODELER": "C:/Users/PATH/TO/modeler/" + }, + { + "HOUDINI_PATH" : + { + "value": "$MODELER/", + "method": "append" + } + }, + ] +} \ No newline at end of file diff --git a/python2.7libs/searcher/about.py b/python2.7libs/searcher/about.py index 25952bd..3bcbd62 100644 --- a/python2.7libs/searcher/about.py +++ b/python2.7libs/searcher/about.py @@ -28,7 +28,6 @@ def __init__(self, parent=None): self.ui.retranslateUi(self) self.installEventFilter(self) - # ------------------------------------------------------------- Events # SECTION Events ----------------------------------------------------- def eventFilter(self, obj, event): diff --git a/python2.7libs/searcher/bugreport.py b/python2.7libs/searcher/bugreport.py index 4f0e035..f7ccebc 100644 --- a/python2.7libs/searcher/bugreport.py +++ b/python2.7libs/searcher/bugreport.py @@ -27,7 +27,7 @@ elif pyside == 'PySide': from PySide.QtWebKit import QWebView - +reload(bugreport_ui) scriptpath = os.path.dirname(os.path.realpath(__file__)) @@ -42,27 +42,73 @@ def __init__(self, parent=None): self.ui = bugreport_ui.Ui_BugReport() self.ui.setupUi(self) self.ui.retranslateUi(self) - self.issuetitle = "" - - self.ui.pushButton.pressed.connect(self.doweb) - + self._webview = None + self.blocker = False + self.html_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "bugsubmit.html")) + self.base_url = QtCore.QUrl(self.html_path) self.installEventFilter(self) + self.ui.title.installEventFilter(self) + + def initmenu(self): + self.resize(self.width(), self.parentwindow.height() - 300) + self._webview = None + self.isediting = True + self.html = None + self.html_out = "" + self.html_str = "" + self.priortext = "" + self.ui.title.setText("") + self.ui.edittitle_btn.pressed.connect(self.doweb) + + self.ui.title.setFocus() + + def edittitle_cb(self): + if not self.blocker: + self.blocker = True + if (hou.ui.displayMessage( + title='Edit Title?', + text='Bug report text will be reset.', + buttons=("Ok", "Cancel")) == 0): + self.isediting = True + self.enabletitleedit() + self.blocker = False + + def enabletitleedit(self): + self._webview.hide() + self.resize(self.width(), self.parentwindow.height() - 300) + self.ui.title.setReadOnly(False) + self.ui.edittitle_btn.setText("Set Title") + + def enablereporttext(self): + self.resize(self.width(), self.parentwindow.height() - 50) + self.ui.title.setReadOnly(True) + self.ui.edittitle_btn.setText("Edit Title") def doweb(self): - issue = "Issue2" - self._webview = QtWebEngineWidgets.QWebEngineView(self) - self._webview.setGeometry(QtCore.QRect(0, 0, self.width(), self.height())) - self.issuetitle = issue - #set html content - html_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "bugsubmit.html")) - base_url = QtCore.QUrl(html_path) - - - html = codecs.open(html_path, 'r') - html_str = html.read() - html_out = html_str.replace('ISSUE_TITLE', self.issuetitle) - self._webview.setHtml(html_out, base_url) + if self.ui.title.text() == "": + self.parentwindow.parentwindow.setstatusmsg("Please enter a title for your bug report", "ImportantMessage") + if hou.isUIAvailable(): + hou.ui.setStatusMessage( + "Please enter a title for your bug report.", severity=hou.severityType.Warning) + return + + if self.isediting: + self.enablereporttext() + else: + self.edittitle_cb() + return + + if self._webview is None: + self._webview = QtWebEngineWidgets.QWebEngineView(self.ui.webview) + self._webview.setGeometry(QtCore.QRect(-10, 0, self.width(), self.height())) + + self.html = codecs.open(self.html_path, 'r') + self.html_str = self.html.read() + self.html_out = self.html_str.replace('ISSUE_TITLE', self.ui.title.text()) + # self._webview.setHtml(self.html_out, self.base_url) + self._webview.load(QtCore.QUrl("https://instance.id/searcher/bugsubmit.html")) self._webview.show() + self.isediting = False # ------------------------------------------------------------- Events # SECTION Events ----------------------------------------------------- @@ -72,7 +118,13 @@ def eventFilter(self, obj, event): # ---------------------------------------- Keypress # NOTE Keypress ----------------------------------- if event_type == QtCore.QEvent.KeyPress: + self.priortext = self.ui.title.text() if event.key() == QtCore.Qt.Key_Escape: self.parentwindow.closeroutine() + return True + + if event_type == QtCore.QEvent.Close: + self._webview = None + self.isediting = True - return QtCore.QObject.eventFilter(self, obj, event) \ No newline at end of file + return QtCore.QObject.eventFilter(self, obj, event) diff --git a/python2.7libs/searcher/bugreport_ui.py b/python2.7libs/searcher/bugreport_ui.py index 203103a..f7d9b00 100644 --- a/python2.7libs/searcher/bugreport_ui.py +++ b/python2.7libs/searcher/bugreport_ui.py @@ -8,76 +8,54 @@ class Ui_BugReport(object): def setupUi(self, BugReport): BugReport.setObjectName("BugReport") BugReport.setWindowModality(QtCore.Qt.NonModal) - BugReport.resize(450, 300) + BugReport.resize(450, 20) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(BugReport.sizePolicy().hasHeightForWidth()) BugReport.setSizePolicy(sizePolicy) - BugReport.setMinimumSize(QtCore.QSize(100, 0)) + BugReport.setMinimumSize(QtCore.QSize(25, 0)) BugReport.setBaseSize(QtCore.QSize(0, 0)) + BugReport.setContentsMargins(-1, -1, -1,-1) BugReport.setStyleSheet("") self.gridLayout = QtWidgets.QGridLayout(BugReport) - self.gridLayout.setContentsMargins(-1, -1, -1, 6) - self.gridLayout.setSpacing(6) + self.gridLayout.setContentsMargins(-1, -1, -1, -1) + self.gridLayout.setSpacing(0) self.gridLayout.setObjectName("gridLayout") self.verticalLayout_4 = QtWidgets.QVBoxLayout() self.verticalLayout_4.setObjectName("verticalLayout_4") - self.horizontalLayout = QtWidgets.QHBoxLayout() - self.horizontalLayout.setObjectName("horizontalLayout") - self.verticalLayout = QtWidgets.QVBoxLayout() - self.verticalLayout.setObjectName("verticalLayout") self.secondrow = QtWidgets.QHBoxLayout() self.secondrow.setObjectName("secondrow") self.title = QtWidgets.QLineEdit(BugReport) self.title.setMinimumSize(QtCore.QSize(175, 0)) self.title.setObjectName("title") self.secondrow.addWidget(self.title) - self.verticalLayout.addLayout(self.secondrow) - self.headerrow = QtWidgets.QHBoxLayout() - self.headerrow.setObjectName("headerrow") - self.webview = QtWidgets.QWidget(BugReport) - self.webview.setObjectName("webview") - self.headerrow.addWidget(self.webview) - self.verticalLayout.addLayout(self.headerrow) - self.horizontalLayout_2 = QtWidgets.QHBoxLayout() - self.horizontalLayout_2.setObjectName("horizontalLayout_2") - spacerItem = QtWidgets.QSpacerItem(0, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - self.horizontalLayout_2.addItem(spacerItem) - self.verticalLayout.addLayout(self.horizontalLayout_2) - self.horizontalLayout.addLayout(self.verticalLayout) - self.verticalLayout_2 = QtWidgets.QVBoxLayout() - self.verticalLayout_2.setObjectName("verticalLayout_2") - self.horizontalLayout_3 = QtWidgets.QHBoxLayout() - self.horizontalLayout_3.setObjectName("horizontalLayout_3") - self.logo = QtWidgets.QLabel(BugReport) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) + self.edittitle_btn = QtWidgets.QPushButton(BugReport) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.edittitle_btn.sizePolicy().hasHeightForWidth()) + self.edittitle_btn.setSizePolicy(sizePolicy) + self.edittitle_btn.setMaximumSize(QtCore.QSize(75, 16777215)) + self.edittitle_btn.setObjectName("edittitle") + self.secondrow.addWidget(self.edittitle_btn) + self.verticalLayout_4.addLayout(self.secondrow) + self.webview = QtWidgets.QLabel(BugReport) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.logo.sizePolicy().hasHeightForWidth()) - self.logo.setSizePolicy(sizePolicy) - self.logo.setMaximumSize(QtCore.QSize(120, 120)) - self.logo.setText("") - self.logo.setPixmap(QtGui.QPixmap("C:/Users/mosthated/Downloads/483688212.png")) - self.logo.setScaledContents(True) - self.logo.setObjectName("logo") - self.horizontalLayout_3.addWidget(self.logo) - self.verticalLayout_2.addLayout(self.horizontalLayout_3) - self.horizontalLayout_4 = QtWidgets.QHBoxLayout() - self.horizontalLayout_4.setObjectName("horizontalLayout_4") - self.pushButton = QtWidgets.QPushButton(BugReport) - self.pushButton.setObjectName("pushButton") - self.horizontalLayout_4.addWidget(self.pushButton) - self.verticalLayout_2.addLayout(self.horizontalLayout_4) - self.horizontalLayout.addLayout(self.verticalLayout_2) - self.verticalLayout_4.addLayout(self.horizontalLayout) + sizePolicy.setHeightForWidth(self.webview.sizePolicy().hasHeightForWidth()) + self.webview.setSizePolicy(sizePolicy) + self.webview.setObjectName("webview") + self.verticalLayout_4.addWidget(self.webview) self.gridLayout.addLayout(self.verticalLayout_4, 0, 0, 1, 1) - + self.retranslateUi(BugReport) QtCore.QMetaObject.connectSlotsByName(BugReport) def retranslateUi(self, BugReport): _translate = QtCore.QCoreApplication.translate BugReport.setWindowTitle(_translate("BugReport", "Form")) - self.title.setPlaceholderText(_translate("BugReport", "Issue Title:")) - self.pushButton.setText(_translate("BugReport", "Submit Bug")) \ No newline at end of file + self.edittitle_btn.setText(_translate("BugReport", "Set Title")) + self.title.setPlaceholderText(_translate("BugReport", "Please enter descriptive bug report title:")) + # self.continue_btn.setText(_translate("BugReport", "Continue")) diff --git a/python2.7libs/searcher/bugsubmit.html b/python2.7libs/searcher/bugsubmit.html index 97592f5..7c6d2c2 100644 --- a/python2.7libs/searcher/bugsubmit.html +++ b/python2.7libs/searcher/bugsubmit.html @@ -3,20 +3,18 @@ - ISSUE_TITLE - - - - \ No newline at end of file diff --git a/python2.7libs/searcher/searcher_settings.py b/python2.7libs/searcher/searcher_settings.py index 00445d5..382ed5b 100644 --- a/python2.7libs/searcher/searcher_settings.py +++ b/python2.7libs/searcher/searcher_settings.py @@ -120,7 +120,7 @@ def __init__(self, handler, width, height, parent=None): | QtCore.Qt.FramelessWindowHint | QtCore.Qt.CustomizeWindowHint ) - self.bugreport.resize(width, height - 15) + self.bugreport.resize(width, height - 300) self.theme = theme.Theme(self) self.theme.setAttribute(QtCore.Qt.WA_StyledBackground, True) @@ -291,13 +291,8 @@ def window_cb(self, toggled): s = self.sender() if toggled == True and not getattr(self, s.objectName()).isVisible(): - if s.objectName() == "about": - self.mapposition(0, 0, s) if self.animatedsettings.isChecked() else self.mapposition(0, 0, s) - elif s.objectName() == "bugreport": - self.mapposition(0, 0, s) if self.animatedsettings.isChecked() else self.mapposition(0, 0, s) - self.bugreport.doweb() - elif s.objectName() == "theme": - self.mapposition(0, 0, s) if self.animatedsettings.isChecked() else self.mapposition(0, 0, s) + self.mapposition(0, 0, s) if self.animatedsettings.isChecked() else self.mapposition(0, 0, s) + getattr(self, s.objectName()).initmenu() else: if s.objectName() in self.windowlist: getattr(self, s.objectName()).close() diff --git a/python2.7libs/searcher/searcher_settings_ui.py b/python2.7libs/searcher/searcher_settings_ui.py index f35aabe..24d0e64 100644 --- a/python2.7libs/searcher/searcher_settings_ui.py +++ b/python2.7libs/searcher/searcher_settings_ui.py @@ -151,17 +151,17 @@ def setupUi(self, SearcherSettings, width, height, animated): self.maint_lbl.setObjectName("maint_lbl") self.fifthrow.addWidget(self.maint_lbl) - self.metrics_chk = QtWidgets.QCheckBox(SearcherSettings) - self.metrics_chk.setLayoutDirection(QtCore.Qt.RightToLeft) - self.metrics_chk.setTristate(False) - self.metrics_chk.setObjectName("metrics_chk") - self.fifthrow.addWidget(self.metrics_chk) + # self.metrics_chk = QtWidgets.QCheckBox(SearcherSettings) + # self.metrics_chk.setLayoutDirection(QtCore.Qt.RightToLeft) + # self.metrics_chk.setTristate(False) + # self.metrics_chk.setObjectName("metrics_chk") + # self.fifthrow.addWidget(self.metrics_chk) self.cleardata_btn = QtWidgets.QPushButton(SearcherSettings) self.cleardata_btn.setObjectName("cleardata_btn") self.fifthrow.addWidget(self.cleardata_btn) - self.verticallayout.addLayout(self.fifthrow) + # self.verticallayout.addLayout(self.fifthrow) # ---------------------------------------------------- Spacer self.line2 = QtWidgets.QFrame(SearcherSettings) @@ -191,6 +191,14 @@ def setupUi(self, SearcherSettings, width, height, animated): spacerItem1 = QtWidgets.QSpacerItem(40, 25, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) self.sixthrow.addItem(spacerItem1) + + self.metrics_chk = QtWidgets.QCheckBox(SearcherSettings) + self.metrics_chk.setLayoutDirection(QtCore.Qt.RightToLeft) + self.metrics_chk.setTristate(False) + self.metrics_chk.setObjectName("metrics_chk") + self.sixthrow.addWidget(self.metrics_chk) + + self.debuglevel_cbx = QtWidgets.QComboBox(SearcherSettings) self.debuglevel_cbx.setObjectName("debuglevel_cbx") self.sixthrow.addWidget(self.debuglevel_cbx) @@ -244,13 +252,13 @@ def retranslateUi(self, SearcherSettings): # -------------------------------------------------- fifthrow self.maint_lbl.setText(_translate("SearcherSettings", "Maintenance utilities:")) - self.metrics_chk.setText(_translate("SearcherSettings", "Enable performance metrics")) self.cleardata_btn.setText(_translate("SearcherSettings", "Clear Data")) # ------------------------------------------------- sixthrow self.about_btn.setText(_translate("SearcherSettings", "...")) self.bug_btn.setText(_translate("SearcherSettings", "...")) self.theme_btn.setText(_translate("SearcherSettings", "...")) + self.metrics_chk.setText(_translate("SearcherSettings", "Metrics")) self.debugflag_chk.setText(_translate("SearcherSettings", "Debug Mode")) self.discard_btn.setText(_translate("SearcherSettings", "Discard")) self.save_btn.setText(_translate("SearcherSettings", "Save")) diff --git a/python2.7libs/searcher/theme.py b/python2.7libs/searcher/theme.py index b33d020..a1d77b4 100644 --- a/python2.7libs/searcher/theme.py +++ b/python2.7libs/searcher/theme.py @@ -50,6 +50,9 @@ def __init__(self, parent=None): self.setParent(parent) self.parentwindow = parent self.ui = theme_ui.Ui_Theme() + # !SECTION Init + + self.ui.setupUi(self) self.ui.retranslateUi(self) self.colorfield = {} @@ -94,11 +97,10 @@ def __init__(self, parent=None): self.discard = self.ui.discardtheme self.discard.pressed.connect(self.discard_cb) + def initmenu(self): self.curTabChange(0) self.installEventFilter(self) - # !SECTION Init - # ------------------------------------------------------------- Callbacks # SECTION Callbacks ----------------------------------------------------- # ---------------------------------------- curTabChange diff --git a/python2.7libs/searcher/ui_files/bugreport.py b/python2.7libs/searcher/ui_files/bugreport.py index 4e5e382..7a42c03 100644 --- a/python2.7libs/searcher/ui_files/bugreport.py +++ b/python2.7libs/searcher/ui_files/bugreport.py @@ -29,55 +29,40 @@ def setupUi(self, BugReport): self.gridLayout.setObjectName("gridLayout") self.verticalLayout_4 = QtWidgets.QVBoxLayout() self.verticalLayout_4.setObjectName("verticalLayout_4") - self.horizontalLayout = QtWidgets.QHBoxLayout() - self.horizontalLayout.setObjectName("horizontalLayout") - self.verticalLayout = QtWidgets.QVBoxLayout() - self.verticalLayout.setObjectName("verticalLayout") self.secondrow = QtWidgets.QHBoxLayout() self.secondrow.setObjectName("secondrow") self.title = QtWidgets.QLineEdit(BugReport) self.title.setMinimumSize(QtCore.QSize(175, 0)) self.title.setObjectName("title") self.secondrow.addWidget(self.title) - self.verticalLayout.addLayout(self.secondrow) - self.label = QtWidgets.QLabel(BugReport) - self.label.setObjectName("label") - self.verticalLayout.addWidget(self.label) - self.headerrow = QtWidgets.QHBoxLayout() - self.headerrow.setObjectName("headerrow") - self.verticalLayout.addLayout(self.headerrow) - self.horizontalLayout_2 = QtWidgets.QHBoxLayout() - self.horizontalLayout_2.setObjectName("horizontalLayout_2") - spacerItem = QtWidgets.QSpacerItem(0, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - self.horizontalLayout_2.addItem(spacerItem) - self.verticalLayout.addLayout(self.horizontalLayout_2) - self.horizontalLayout.addLayout(self.verticalLayout) - self.verticalLayout_2 = QtWidgets.QVBoxLayout() - self.verticalLayout_2.setObjectName("verticalLayout_2") - self.horizontalLayout_3 = QtWidgets.QHBoxLayout() - self.horizontalLayout_3.setObjectName("horizontalLayout_3") - self.logo = QtWidgets.QLabel(BugReport) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) + self.edittitle_btn = QtWidgets.QPushButton(BugReport) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.edittitle_btn.sizePolicy().hasHeightForWidth()) + self.edittitle_btn.setSizePolicy(sizePolicy) + self.edittitle_btn.setMaximumSize(QtCore.QSize(55, 16777215)) + self.edittitle_btn.setObjectName("edittitle") + self.secondrow.addWidget(self.edittitle_btn) + self.verticalLayout_4.addLayout(self.secondrow) + self.webview = QtWidgets.QLabel(BugReport) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.logo.sizePolicy().hasHeightForWidth()) - self.logo.setSizePolicy(sizePolicy) - self.logo.setMaximumSize(QtCore.QSize(120, 120)) - self.logo.setText("") - self.logo.setPixmap(QtGui.QPixmap("C:/Users/mosthated/Downloads/483688212.png")) - self.logo.setScaledContents(True) - self.logo.setObjectName("logo") - self.horizontalLayout_3.addWidget(self.logo) - self.verticalLayout_2.addLayout(self.horizontalLayout_3) - self.horizontalLayout_4 = QtWidgets.QHBoxLayout() - self.horizontalLayout_4.setObjectName("horizontalLayout_4") - self.pushButton = QtWidgets.QPushButton(BugReport) - self.pushButton.setObjectName("pushButton") - self.horizontalLayout_4.addWidget(self.pushButton) - self.verticalLayout_2.addLayout(self.horizontalLayout_4) - self.horizontalLayout.addLayout(self.verticalLayout_2) - self.verticalLayout_4.addLayout(self.horizontalLayout) + sizePolicy.setHeightForWidth(self.webview.sizePolicy().hasHeightForWidth()) + self.webview.setSizePolicy(sizePolicy) + self.webview.setObjectName("webview") + self.verticalLayout_4.addWidget(self.webview) self.gridLayout.addLayout(self.verticalLayout_4, 0, 0, 1, 1) + self.horizontalLayout = QtWidgets.QHBoxLayout() + self.horizontalLayout.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint) + self.horizontalLayout.setObjectName("horizontalLayout") + spacerItem = QtWidgets.QSpacerItem(40, 10, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontalLayout.addItem(spacerItem) + self.continue_btn = QtWidgets.QPushButton(BugReport) + self.continue_btn.setObjectName("continue_btn") + self.horizontalLayout.addWidget(self.continue_btn) + self.gridLayout.addLayout(self.horizontalLayout, 1, 0, 1, 1) self.retranslateUi(BugReport) QtCore.QMetaObject.connectSlotsByName(BugReport) @@ -85,6 +70,7 @@ def setupUi(self, BugReport): def retranslateUi(self, BugReport): _translate = QtCore.QCoreApplication.translate BugReport.setWindowTitle(_translate("BugReport", "Form")) - self.title.setPlaceholderText(_translate("BugReport", "Issue Title:")) - self.label.setText(_translate("BugReport", "TextLabel")) - self.pushButton.setText(_translate("BugReport", "Submit Bug")) + self.title.setPlaceholderText(_translate("BugReport", "Please enter descriptive bug report title")) + self.edittitle_btn.setText(_translate("BugReport", "Edit")) + self.webview.setText(_translate("BugReport", "TextLabel")) + self.continue_btn.setText(_translate("BugReport", "Continue")) diff --git a/python2.7libs/searcher/ui_files/bugreport.ui b/python2.7libs/searcher/ui_files/bugreport.ui index 95f7033..d436a0f 100644 --- a/python2.7libs/searcher/ui_files/bugreport.ui +++ b/python2.7libs/searcher/ui_files/bugreport.ui @@ -47,102 +47,81 @@ - + - - - - - - - - 175 - 0 - - - - Issue Title: - - - - - - - - - - - TextLabel - - - - - - - - - - - Qt::Vertical - - - - 0 - 40 - - - - - - - + + + + 175 + 0 + + + + Please enter descriptive bug report title + + - - - - - - - - 0 - 0 - - - - - 120 - 120 - - - - - - - C:/Users/mosthated/Downloads/483688212.png - - - true - - - - - - - - - - - Submit Bug - - - - - - + + + + 0 + 0 + + + + + 55 + 16777215 + + + + Edit Title + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + + QLayout::SetDefaultConstraint + + + + + Qt::Horizontal + + + + 40 + 10 + + + + + + + + Continue + + + diff --git a/python_panels/searcher.pypanel b/python_panels/searcher.pypanel index 8a86663..e02af81 100644 --- a/python_panels/searcher.pypanel +++ b/python_panels/searcher.pypanel @@ -6,13 +6,13 @@ same interface or of the interfaces menu are not allowed in a single file. --> - + return bugreport.BugReport()]]> diff --git a/toolbar/searcher_tool.shelf b/toolbar/searcher_tool.shelf index 0d1c84a..8af7c2c 100644 --- a/toolbar/searcher_tool.shelf +++ b/toolbar/searcher_tool.shelf @@ -18,18 +18,36 @@ import toolutils import os reload(searcher) +import sys + outputpath = os.path.join( - hou.homeHoudiniDirectory(), 'Searcher', "err.json" + hou.homeHoudiniDirectory(), 'Searcher', "err.log" ) +class Logger(object): + def __init__(self): + self.terminal = sys.stdout + self.log = open(outputpath, "a") + + def write(self, message): + self.terminal.write(message) + self.log.write(message) + + def flush(self): + #this flush method is needed for python 3 compatibility. + #this handles the flush command by doing nothing. + #you might want to specify some extra behavior here. + pass + +sys.stdout = Logger() + + + try: searcher.CreateSearcherPanel(**kwargs) except(AttributeError, TypeError) as e: - log = open(outputpath, 'w') - print(e, file = log) - log.close() hou.ui.setStatusMessage( - ("Check Searcher Error Log: %s" % outputpath), + ("Check Searcher Error Log: %s" % str(e)), severity=hou.severityType.Warning )]]>