Theme changes, mostly.

This commit is contained in:
BuildTools 2021-04-09 01:14:54 +02:00
parent 307a45b443
commit bed5581187
9 changed files with 48 additions and 19 deletions

View file

@ -3,6 +3,11 @@
## [v2.1.0] - 2021-4-4 ## [v2.1.0] - 2021-4-4
### Fixed
- Fixed current mood icon not showing up.
- Fixed "CHUMHANDLE:" not fitting on some themes.
- Fixed console capitalization.
### Added ### Added
- Server prompt - Server prompt

View file

@ -8,7 +8,6 @@
- Any remaining unicode-related crashes. - Any remaining unicode-related crashes.
- Exclude unnecessary imports for builds. - Exclude unnecessary imports for builds.
- Icon is crusty...? - Icon is crusty...?
- Mood doesn't show up next to handle
- "CHUMHANDLE" is cut off on pchum2.5 theme. - "CHUMHANDLE" is cut off on pchum2.5 theme.
- Mask & target not being passed to ``_max_msg_len``. - Mask & target not being passed to ``_max_msg_len``.
- No error message when Pesterchum fails to join a channel. (For example, when the channel name length is over CHANNELLEN) - No error message when Pesterchum fails to join a channel. (For example, when the channel name length is over CHANNELLEN)

View file

@ -92,7 +92,7 @@ class IRCClient:
server_file.close() server_file.close()
server_obj = json.loads(read_file) server_obj = json.loads(read_file)
TLS = server_obj['TLS'] TLS = server_obj['TLS']
print("TLS-status is: " + str(TLS)) #print("TLS-status is: " + str(TLS))
if TLS == False: if TLS == False:
#print("false") #print("false")
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@ -103,7 +103,7 @@ class IRCClient:
self.bare_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.bare_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.socket = self.context.wrap_socket(self.bare_socket) self.socket = self.context.wrap_socket(self.bare_socket)
except: except:
print("TLS except.") #print("TLS except.")
self.context = ssl.create_default_context() self.context = ssl.create_default_context()
self.context.check_hostname = False self.context.check_hostname = False
self.context.verify_mode = ssl.CERT_NONE self.context.verify_mode = ssl.CERT_NONE
@ -258,7 +258,7 @@ class IRCClient:
# Why does this only work 33% of the time </3 # Why does this only work 33% of the time </3
# Somehow, kinda fixed :') # Somehow, kinda fixed :')
print("QUIT") logging.info("QUIT")
self.socket.send(bytes(msg + "\n", "UTF-8")) self.socket.send(bytes(msg + "\n", "UTF-8"))
class IRCApp: class IRCApp:

View file

@ -1156,9 +1156,16 @@ class PesterWindow(MovingWindow):
self.menu.setNativeMenuBar(False) self.menu.setNativeMenuBar(False)
self.menu.setObjectName("mainmenu") self.menu.setObjectName("mainmenu")
if self.theme.has_key("main/menus/client/console"):
self.console = AttrDict(dict( self.console = AttrDict(dict(
window = None, window = None,
action = QtWidgets.QAction("Console".upper(), self), action = QtWidgets.QAction(self.theme["main/menus/client/console"], self),
is_open = False
))
else:
self.console = AttrDict(dict(
window = None,
action = QtWidgets.QAction("Console", self),
is_open = False is_open = False
)) ))
self.console.shortcuts = AttrDict(dict( self.console.shortcuts = AttrDict(dict(
@ -1266,8 +1273,8 @@ class PesterWindow(MovingWindow):
self.moodsLabel = QtWidgets.QLabel(self.theme["main/moodlabel/text"], self) self.moodsLabel = QtWidgets.QLabel(self.theme["main/moodlabel/text"], self)
self.moodsLabel.setObjectName("moodlabel") self.moodsLabel.setObjectName("moodlabel")
# Padding so it fits. I, don't know how to fix this properly :/
self.mychumhandleLabel = QtWidgets.QLabel(self.theme["main/mychumhandle/label/text"], self) self.mychumhandleLabel = QtWidgets.QLabel(self.theme["main/mychumhandle/label/text"] + " ", self)
self.mychumhandleLabel.setObjectName("myhandlelabel") self.mychumhandleLabel.setObjectName("myhandlelabel")
self.mychumhandle = QtWidgets.QPushButton(self.profile().handle, self) self.mychumhandle = QtWidgets.QPushButton(self.profile().handle, self)
self.mychumhandle.setFlat(True) self.mychumhandle.setFlat(True)
@ -1282,6 +1289,8 @@ class PesterWindow(MovingWindow):
self.initTheme(self.theme) self.initTheme(self.theme)
#self.mychumhandleLabel.setStyleSheet("QLabel {);};")
self.hide() self.hide()
self.waitingMessages = waitingMessageHolder(self) self.waitingMessages = waitingMessageHolder(self)
@ -1710,6 +1719,17 @@ class PesterWindow(MovingWindow):
self.nickServAction.setText(self.theme["main/menus/help/nickserv"]) self.nickServAction.setText(self.theme["main/menus/help/nickserv"])
self.helpmenu.setTitle(self.theme["main/menus/help/_name"]) self.helpmenu.setTitle(self.theme["main/menus/help/_name"])
# Console
## if self.theme.has_key("main/menus/client/console"):
## self.console.action.setText(self.theme["main/menus/client/console"])
## else:
## self.console.action.setText("Console")
# has_key doesn't work out here for some reason, possibly because of inherits?
try:
self.console.action.setText(self.theme["main/menus/client/console"])
except:
self.console.action.setText("Console")
# moods # moods
self.moodsLabel.setText(theme["main/moodlabel/text"]) self.moodsLabel.setText(theme["main/moodlabel/text"])
self.moodsLabel.move(*theme["main/moodlabel/loc"]) self.moodsLabel.move(*theme["main/moodlabel/loc"])
@ -1755,7 +1775,9 @@ class PesterWindow(MovingWindow):
self.mychumcolor.resize(*theme["main/mychumhandle/colorswatch/size"]) self.mychumcolor.resize(*theme["main/mychumhandle/colorswatch/size"])
self.mychumcolor.move(*theme["main/mychumhandle/colorswatch/loc"]) self.mychumcolor.move(*theme["main/mychumhandle/colorswatch/loc"])
self.mychumcolor.setStyleSheet("background: %s" % (self.profile().colorhtml())) self.mychumcolor.setStyleSheet("background: %s" % (self.profile().colorhtml()))
if "main/mychumhandle/currentMood" in self.theme: # I don't know why "if "main/mychumhandle/currentMood" in self.theme:" doesn't work,
# But this seems to work just as well :3c
if self.theme.has_key("main/mychumhandle/currentMood"):
moodicon = self.profile().mood.icon(theme) moodicon = self.profile().mood.icon(theme)
if hasattr(self, 'currentMoodIcon') and self.currentMoodIcon: if hasattr(self, 'currentMoodIcon') and self.currentMoodIcon:
self.currentMoodIcon.hide() self.currentMoodIcon.hide()

View file

@ -299,7 +299,7 @@ class userConfig(object):
server_file.close() server_file.close()
server_obj = json.loads(read_file) server_obj = json.loads(read_file)
server = str(server_obj['server']) server = str(server_obj['server'])
print("Server is: " + server) #print("Server is: " + server)
return server return server
except: except:
try: try:
@ -312,7 +312,7 @@ class userConfig(object):
server_file.write(json.dumps(json_server_file, indent = 4) ) server_file.write(json.dumps(json_server_file, indent = 4) )
server_file.close() server_file.close()
server = "irc.pesterchum.xyz" server = "irc.pesterchum.xyz"
print("Failed to read server, defaulting to irc.pesterchum.xyz") #print("Failed to read server, defaulting to irc.pesterchum.xyz")
except: except:
return self.config.get('server', "irc.pesterchum.xyz") return self.config.get('server', "irc.pesterchum.xyz")
def port(self): def port(self):
@ -324,7 +324,7 @@ class userConfig(object):
server_file.close() server_file.close()
server_obj = json.loads(read_file) server_obj = json.loads(read_file)
port = str(server_obj['port']) port = str(server_obj['port'])
print("Port is: " + port) #print("Port is: " + port)
return port return port
except: except:
return self.config.get('port', '6697') return self.config.get('port', '6697')

View file

@ -29,7 +29,8 @@
"import": "Import", "import": "Import",
"reconnect": "Reconnect", "reconnect": "Reconnect",
"idle": "Idle", "idle": "Idle",
"exit": "Exit"}, "exit": "Exit",
"console": "Console"},
"profile": {"_name": "Profile", "profile": {"_name": "Profile",
"switch": "Switch", "switch": "Switch",
"color": "Color", "color": "Color",

View file

@ -30,7 +30,8 @@
"import": "IMPORT", "import": "IMPORT",
"reconnect": "RECONNECT", "reconnect": "RECONNECT",
"idle": "IDLE", "idle": "IDLE",
"exit": "EXIT"}, "exit": "EXIT",
"console": "CONSOLE"},
"profile": {"_name": "PROFILE", "profile": {"_name": "PROFILE",
"switch": "SWITCH", "switch": "SWITCH",
"color": "COLOR", "color": "COLOR",

View file

@ -20,7 +20,7 @@
"mychumhandle": { "label": "mychumhandle": { "label":
{ "text": "CHUMHANDLE:", { "text": "CHUMHANDLE:",
"loc": [12,415], "loc": [12,415],
"style": "color: black ;font:bold; font-family: 'Courier';" "style": "color: black; font:bold; font-family: 'Courier';"
}, },
"handle": { "loc": [15,435], "handle": { "loc": [15,435],
"size": [240, 25], "size": [240, 25],

View file

@ -28,7 +28,8 @@
"import": "import U2;", "import": "import U2;",
"reconnect": "Reconnect", "reconnect": "Reconnect",
"idle": "Idle", "idle": "Idle",
"exit": "Abscond"}, "exit": "Abscond",
"console": "Console"},
"profile": {"_name": "View", "profile": {"_name": "View",
"switch": "Trolltag", "switch": "Trolltag",
"theme": "Theme", "theme": "Theme",