Added some fixes for bugs discovered when testing with PySide2
This commit is contained in:
@@ -23,11 +23,6 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
class GuiDocDetails(QFrame):
|
||||
|
||||
C_NAME = 0
|
||||
C_COUNT = 1
|
||||
C_FLAGS = 2
|
||||
C_HANDLE = 3
|
||||
|
||||
def __init__(self, theParent, theProject):
|
||||
QFrame.__init__(self, theParent)
|
||||
|
||||
|
||||
@@ -86,13 +86,13 @@ class GuiSearchBar(QFrame):
|
||||
if not self.isVisible():
|
||||
self.setVisible(True)
|
||||
self.searchBox.setText(theText)
|
||||
self.searchBox.setFocus(True)
|
||||
self.searchBox.setFocus()
|
||||
logger.verbose("Setting search text to '%s'" % theText)
|
||||
return True
|
||||
|
||||
def setReplaceText(self, theText):
|
||||
self._replaceVisible(True)
|
||||
self.replaceBox.setFocus(True)
|
||||
self.replaceBox.setFocus()
|
||||
self.replaceBox.setText(theText)
|
||||
return True
|
||||
|
||||
|
||||
+2
-2
@@ -78,7 +78,7 @@ class GuiMainMenu(QMenuBar):
|
||||
if recentProject == "": continue
|
||||
menuItem = QAction("%s" % recentProject, self.projMenu)
|
||||
menuItem.triggered.connect(
|
||||
lambda menuItem, n=n : self.openRecentProject(menuItem, n)
|
||||
lambda a1=menuItem, a2=n : self.openRecentProject(a1, a2)
|
||||
)
|
||||
self.recentMenu.addAction(menuItem)
|
||||
|
||||
@@ -255,7 +255,7 @@ class GuiMainMenu(QMenuBar):
|
||||
self.rootItems[itemClass].triggered.connect(
|
||||
lambda nCount, itemClass=itemClass : self._newTreeItem(nwItemType.ROOT, itemClass)
|
||||
)
|
||||
self.rootMenu.addActions(self.rootItems.values())
|
||||
self.rootMenu.addAction(self.rootItems[itemClass])
|
||||
|
||||
# Project > New Folder
|
||||
self.aCreateFolder = QAction("Create Folder", self)
|
||||
|
||||
+7
-12
@@ -17,7 +17,7 @@ import nw
|
||||
from os import path
|
||||
|
||||
from PyQt5.QtCore import Qt, QTimer
|
||||
from PyQt5.QtGui import QIcon, QPixmap, QColor
|
||||
from PyQt5.QtGui import QIcon, QPixmap, QColor, QKeySequence
|
||||
from PyQt5.QtWidgets import (
|
||||
qApp, QMainWindow, QVBoxLayout, QFrame, QSplitter, QFileDialog, QShortcut,
|
||||
QMessageBox, QProgressDialog, QDialog
|
||||
@@ -152,17 +152,12 @@ class GuiMain(QMainWindow):
|
||||
|
||||
# Shortcuts and Actions
|
||||
self._connectMenuActions()
|
||||
QShortcut(
|
||||
Qt.Key_Return,
|
||||
self.treeView,
|
||||
context=Qt.WidgetShortcut,
|
||||
activated=self._treeKeyPressReturn
|
||||
)
|
||||
QShortcut(
|
||||
Qt.Key_Escape,
|
||||
self,
|
||||
activated=self._keyPressEscape
|
||||
)
|
||||
keyReturn = QShortcut(self.treeView)
|
||||
keyReturn.setKey(QKeySequence(Qt.Key_Return))
|
||||
keyReturn.activated.connect(self._treeKeyPressReturn)
|
||||
keyEscape = QShortcut(self)
|
||||
keyEscape.setKey(QKeySequence(Qt.Key_Escape))
|
||||
keyEscape.activated.connect(self._keyPressEscape)
|
||||
|
||||
# Forward Functions
|
||||
self.setStatus = self.statusBar.setStatus
|
||||
|
||||
@@ -4,3 +4,4 @@ markers =
|
||||
core: Core functionality tests
|
||||
gui: Qt5 GUI tests
|
||||
serial
|
||||
qt_api = pyqt5
|
||||
|
||||
Reference in New Issue
Block a user