Pesterchum QDB button in log viewer

This commit is contained in:
Kiooeht 2011-04-21 01:08:04 -07:00
parent 926efa748e
commit c9737f7f63

View file

@ -164,12 +164,16 @@ class PesterLogViewer(QtGui.QDialog):
if len(self.logList) > 0: self.loadLog(self.logList[0])
self.qdb = QtGui.QPushButton("Pesterchum QDB", self)
self.connect(self.qdb, QtCore.SIGNAL('clicked()'),
self, QtCore.SLOT('openQDB()'))
self.ok = QtGui.QPushButton("CLOSE", self)
self.ok.setDefault(True)
self.ok.setFixedWidth(80)
self.connect(self.ok, QtCore.SIGNAL('clicked()'),
self, QtCore.SLOT('reject()'))
layout_ok = QtGui.QHBoxLayout()
layout_ok.addWidget(self.qdb)
layout_ok.addWidget(self.ok)
layout_ok.setAlignment(self.ok, QtCore.Qt.AlignRight)
@ -189,6 +193,10 @@ class PesterLogViewer(QtGui.QDialog):
if len(self.tree.currentItem().text(0)) > len("September 2011"):
self.loadLog(self.timeToFile(self.tree.currentItem().text(0)))
@QtCore.pyqtSlot()
def openQDB(self):
QtGui.QDesktopServices.openUrl(QtCore.QUrl("http://qdb.pesterchum.net/index.php?p=browse", QtCore.QUrl.TolerantMode))
def loadLog(self, fname):
fp = codecs.open("%s/%s/%s/%s/%s" % (self.logpath, self.handle, self.chum, self.format, fname), encoding='utf-8', mode='r')
self.textArea.clear()