Set several object names for unique GUI elements

This commit is contained in:
karxi 2017-01-25 10:50:09 -05:00
parent ae19966095
commit eda21fc872
2 changed files with 14 additions and 0 deletions

View file

@ -147,6 +147,7 @@ class PesterQuirkList(QtGui.QTreeWidget):
if not f.parent(): # group
msgbox = QtGui.QMessageBox()
msgbox.setStyleSheet(self.mainwindow.theme["main/defaultwindow/style"])
msgbox.setObjectName("delquirkwarning")
msgbox.setWindowTitle("WARNING!")
msgbox.setInformativeText("Are you sure you want to delete the quirk group: %s" % (f.text(0)))
msgbox.setStandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel)
@ -776,8 +777,10 @@ class PesterChooseProfile(QtGui.QDialog):
self.currentHandle = QtGui.QLabel("CHANGING FROM %s" % userprofile.chat.handle)
self.chumHandle = QtGui.QLineEdit(self)
self.chumHandle.setMinimumWidth(200)
self.chumHandle.setObjectName("setprofilehandle")
self.chumHandleLabel = QtGui.QLabel(self.theme["main/mychumhandle/label/text"], self)
self.chumColorButton = QtGui.QPushButton(self)
self.chumColorButton.setObjectName("setprofilecolor")
self.chumColorButton.resize(50, 20)
self.chumColorButton.setStyleSheet("background: %s" % (userprofile.chat.colorhtml()))
self.chumcolor = userprofile.chat.color
@ -835,6 +838,7 @@ class PesterChooseProfile(QtGui.QDialog):
layout_0.addWidget(self.delete)
layout_0.addLayout(layout_2)
self.errorMsg = QtGui.QLabel(self)
self.errorMsg.setObjectName("errormsg")
self.errorMsg.setStyleSheet("color:red;")
layout_0.addWidget(self.errorMsg)
self.setLayout(layout_0)
@ -870,12 +874,15 @@ class PesterChooseProfile(QtGui.QDialog):
handle = unicode(self.profileBox.currentText())
if handle == self.parent.profile().handle:
problem = QtGui.QMessageBox()
# karxi Will probably change this to its own name later.
problem.setObjectName("errmsg")
problem.setStyleSheet(self.theme["main/defaultwindow/style"])
problem.setWindowTitle("Problem!")
problem.setInformativeText("You can't delete the profile you're currently using!")
problem.setStandardButtons(QtGui.QMessageBox.Ok)
problem.exec_()
return
# TODO: Make this select 'no' as the default, as usual.
msgbox = QtGui.QMessageBox()
msgbox.setStyleSheet(self.theme["main/defaultwindow/style"])
msgbox.setWindowTitle("WARNING!")
@ -887,6 +894,7 @@ class PesterChooseProfile(QtGui.QDialog):
remove(_datadir+"profiles/%s.js" % (handle))
except OSError:
problem = QtGui.QMessageBox()
problem.setObjectName("errmsg")
problem.setStyleSheet(self.theme["main/defaultwindow/style"])
problem.setWindowTitle("Problem!")
problem.setInformativeText("There was a problem deleting the profile: %s" % (handle))

View file

@ -1183,6 +1183,7 @@ class PesterWindow(MovingWindow):
self.menu = QtGui.QMenuBar(self)
self.menu.setNativeMenuBar(False)
self.menu.setObjectName("mainmenu")
self.console = AttrDict(dict(
window = None,
@ -1304,18 +1305,23 @@ class PesterWindow(MovingWindow):
QtCore.SLOT('blockChum(QString)'))
self.addChumButton = QtGui.QPushButton(self.theme["main/addchum/text"], self)
self.addChumButton.setObjectName("addchumbtn")
self.connect(self.addChumButton, QtCore.SIGNAL('clicked()'),
self, QtCore.SLOT('addChumWindow()'))
self.pesterButton = QtGui.QPushButton(self.theme["main/pester/text"], self)
self.pesterButton.setObjectName("newpesterbtn")
self.connect(self.pesterButton, QtCore.SIGNAL('clicked()'),
self, QtCore.SLOT('pesterSelectedChum()'))
self.blockButton = QtGui.QPushButton(self.theme["main/block/text"], self)
self.blockButton.setObjectName("blockbtn")
self.connect(self.blockButton, QtCore.SIGNAL('clicked()'),
self, QtCore.SLOT('blockSelectedChum()'))
self.moodsLabel = QtGui.QLabel(self.theme["main/moodlabel/text"], self)
self.moodsLabel.setObjectName("moodlabel")
self.mychumhandleLabel = QtGui.QLabel(self.theme["main/mychumhandle/label/text"], self)
self.mychumhandleLabel.setObjectName("myhandlelabel")
self.mychumhandle = QtGui.QPushButton(self.profile().handle, self)
self.mychumhandle.setFlat(True)
self.connect(self.mychumhandle, QtCore.SIGNAL('clicked()'),