Chum search for logs
This commit is contained in:
parent
123eeb4d40
commit
4883197a6f
2 changed files with 19 additions and 0 deletions
|
@ -26,6 +26,7 @@ CHANGELOG
|
|||
* Theme checking - Kiooeht [evacipatedBox]
|
||||
* Display (De)OP/Voice messages in memos - Kiooeht [evacipatedBox]
|
||||
* Advanced Mode: Alter IRC user mode - Kiooeht [evacipatedBox]
|
||||
* Logviewer chum search - Kiooeht [evacipatedBox]
|
||||
* Bug fixes
|
||||
* Logviewer updates - Kiooeht [evacipatedBox]
|
||||
* Memo scrollbar thing - Kiooeht [evacipatedBox]
|
||||
|
|
18
logviewer.py
18
logviewer.py
|
@ -7,6 +7,14 @@ from generic import RightClickList, RightClickTree
|
|||
from parsetools import convertTags
|
||||
from convo import PesterText
|
||||
|
||||
class PesterLogSearchInput(QtGui.QLineEdit):
|
||||
def __init__(self, theme, parent=None):
|
||||
QtGui.QLineEdit.__init__(self, parent)
|
||||
self.setStyleSheet(theme["convo/input/style"] + "margin-right:0px;")
|
||||
def keyPressEvent(self, event):
|
||||
QtGui.QLineEdit.keyPressEvent(self, event)
|
||||
self.parent().logSearch(self.text())
|
||||
|
||||
class PesterLogUserSelect(QtGui.QDialog):
|
||||
def __init__(self, config, theme, parent):
|
||||
QtGui.QDialog.__init__(self, parent)
|
||||
|
@ -44,6 +52,9 @@ class PesterLogUserSelect(QtGui.QDialog):
|
|||
item.setTextColor(QtGui.QColor(self.theme["main/chums/userlistcolor"]))
|
||||
self.chumsBox.addItem(item)
|
||||
|
||||
self.search = PesterLogSearchInput(theme, self)
|
||||
self.search.setFocus()
|
||||
|
||||
self.cancel = QtGui.QPushButton("CANCEL", self)
|
||||
self.connect(self.cancel, QtCore.SIGNAL('clicked()'),
|
||||
self, QtCore.SLOT('reject()'))
|
||||
|
@ -58,6 +69,7 @@ class PesterLogUserSelect(QtGui.QDialog):
|
|||
layout_0 = QtGui.QVBoxLayout()
|
||||
layout_0.addWidget(instructions)
|
||||
layout_0.addWidget(self.chumsBox)
|
||||
layout_0.addWidget(self.search)
|
||||
layout_0.addLayout(layout_ok)
|
||||
|
||||
self.setLayout(layout_0)
|
||||
|
@ -65,6 +77,12 @@ class PesterLogUserSelect(QtGui.QDialog):
|
|||
def selectedchum(self):
|
||||
return self.chumsBox.currentItem()
|
||||
|
||||
def logSearch(self, search):
|
||||
found = self.chumsBox.findItems(search, QtCore.Qt.MatchStartsWith)
|
||||
print found
|
||||
if len(found) > 0 and len(found) < self.chumsBox.count():
|
||||
self.chumsBox.setCurrentItem(found[0])
|
||||
|
||||
@QtCore.pyqtSlot()
|
||||
def viewActivatedLog(self):
|
||||
selectedchum = self.selectedchum().text()
|
||||
|
|
Loading…
Reference in a new issue