Move profileChanged behavior to mainwindow
This commit is contained in:
parent
7c8e682c36
commit
d3c9b8eedf
2 changed files with 14 additions and 13 deletions
14
irc.py
14
irc.py
|
@ -413,16 +413,6 @@ class PesterIRC(QtCore.QThread):
|
||||||
"""Send convo cease message, slot is called from main thread."""
|
"""Send convo cease message, slot is called from main thread."""
|
||||||
self._send_irc.privmsg(handle, "PESTERCHUM:CEASE")
|
self._send_irc.privmsg(handle, "PESTERCHUM:CEASE")
|
||||||
|
|
||||||
@QtCore.pyqtSlot()
|
|
||||||
def update_profile(self):
|
|
||||||
"""....update profile? this shouldn't be a thing."""
|
|
||||||
self._send_irc.nick(self.mainwindow.profile().handle)
|
|
||||||
self.mainwindow.closeConversations(True)
|
|
||||||
self.mainwindow.doAutoIdentify()
|
|
||||||
self.mainwindow.autoJoinDone = False
|
|
||||||
self.mainwindow.doAutoJoins()
|
|
||||||
self.update_mood()
|
|
||||||
|
|
||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
def update_mood(self):
|
def update_mood(self):
|
||||||
"""Update and send mood, slot is called from main thread."""
|
"""Update and send mood, slot is called from main thread."""
|
||||||
|
@ -521,6 +511,10 @@ class PesterIRC(QtCore.QThread):
|
||||||
self._end = True
|
self._end = True
|
||||||
self._close()
|
self._close()
|
||||||
|
|
||||||
|
@QtCore.pyqtSlot(str)
|
||||||
|
def send_nick(self, nick: str):
|
||||||
|
self._send_irc.nick(nick)
|
||||||
|
|
||||||
def _notice(self, nick, chan, msg):
|
def _notice(self, nick, chan, msg):
|
||||||
"""Standard IRC 'NOTICE' message, primarily used for automated replies from services."""
|
"""Standard IRC 'NOTICE' message, primarily used for automated replies from services."""
|
||||||
handle = nick[0 : nick.find("!")]
|
handle = nick[0 : nick.find("!")]
|
||||||
|
|
|
@ -3587,7 +3587,14 @@ class PesterWindow(MovingWindow):
|
||||||
if hasattr(self, "trollslum") and self.trollslum:
|
if hasattr(self, "trollslum") and self.trollslum:
|
||||||
self.trollslum.close()
|
self.trollslum.close()
|
||||||
self.chooseprofile = None
|
self.chooseprofile = None
|
||||||
self.profileChanged.emit()
|
|
||||||
|
# Instead of emiting profileChanged, do:
|
||||||
|
self.changeNick.emit(self.profile().handle) # change nick
|
||||||
|
self.closeConversations(True)
|
||||||
|
self.doAutoIdentify()
|
||||||
|
self.autoJoinDone = True
|
||||||
|
self.doAutoJoins()
|
||||||
|
self.moodUpdated.emit()
|
||||||
|
|
||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
def showTrollSlum(self):
|
def showTrollSlum(self):
|
||||||
|
@ -4206,7 +4213,6 @@ class PesterWindow(MovingWindow):
|
||||||
sendNotice = QtCore.pyqtSignal(str, str)
|
sendNotice = QtCore.pyqtSignal(str, str)
|
||||||
sendCTCP = QtCore.pyqtSignal(str, str)
|
sendCTCP = QtCore.pyqtSignal(str, str)
|
||||||
convoClosed = QtCore.pyqtSignal(str)
|
convoClosed = QtCore.pyqtSignal(str)
|
||||||
profileChanged = QtCore.pyqtSignal()
|
|
||||||
animationSetting = QtCore.pyqtSignal(bool)
|
animationSetting = QtCore.pyqtSignal(bool)
|
||||||
moodRequest = QtCore.pyqtSignal(PesterProfile)
|
moodRequest = QtCore.pyqtSignal(PesterProfile)
|
||||||
moodsRequest = QtCore.pyqtSignal(PesterList)
|
moodsRequest = QtCore.pyqtSignal(PesterList)
|
||||||
|
@ -4230,6 +4236,7 @@ class PesterWindow(MovingWindow):
|
||||||
forbiddenChan = QtCore.pyqtSignal(str, str)
|
forbiddenChan = QtCore.pyqtSignal(str, str)
|
||||||
closeSignal = QtCore.pyqtSignal()
|
closeSignal = QtCore.pyqtSignal()
|
||||||
disconnectIRC = QtCore.pyqtSignal()
|
disconnectIRC = QtCore.pyqtSignal()
|
||||||
|
changeNick = QtCore.pyqtSignal(str)
|
||||||
gainAttention = QtCore.pyqtSignal(QtWidgets.QWidget)
|
gainAttention = QtCore.pyqtSignal(QtWidgets.QWidget)
|
||||||
pingServer = QtCore.pyqtSignal()
|
pingServer = QtCore.pyqtSignal()
|
||||||
setAway = QtCore.pyqtSignal(bool)
|
setAway = QtCore.pyqtSignal(bool)
|
||||||
|
@ -4399,7 +4406,6 @@ class MainProgram(QtCore.QObject):
|
||||||
(widget.sendCTCP, irc.send_ctcp),
|
(widget.sendCTCP, irc.send_ctcp),
|
||||||
(widget.newConvoStarted, irc.start_convo),
|
(widget.newConvoStarted, irc.start_convo),
|
||||||
(widget.convoClosed, irc.end_convo),
|
(widget.convoClosed, irc.end_convo),
|
||||||
(widget.profileChanged, irc.update_profile),
|
|
||||||
(widget.moodRequest, irc.get_mood),
|
(widget.moodRequest, irc.get_mood),
|
||||||
(widget.moodsRequest, irc.get_moods),
|
(widget.moodsRequest, irc.get_moods),
|
||||||
(widget.moodUpdated, irc.update_mood),
|
(widget.moodUpdated, irc.update_mood),
|
||||||
|
@ -4418,6 +4424,7 @@ class MainProgram(QtCore.QObject):
|
||||||
(widget.setAway, irc.set_away),
|
(widget.setAway, irc.set_away),
|
||||||
(widget.killSomeQuirks, irc.kill_some_quirks),
|
(widget.killSomeQuirks, irc.kill_some_quirks),
|
||||||
(widget.disconnectIRC, irc.disconnect_irc),
|
(widget.disconnectIRC, irc.disconnect_irc),
|
||||||
|
(widget.changeNick, irc.send_nick),
|
||||||
# Main window --> IRC
|
# Main window --> IRC
|
||||||
(irc.connected, widget.connected),
|
(irc.connected, widget.connected),
|
||||||
(irc.askToConnect, widget.connectAnyway),
|
(irc.askToConnect, widget.connectAnyway),
|
||||||
|
|
Loading…
Reference in a new issue