Compare commits
No commits in common. "b1f0ad4bd8b732bbf389805d7a2ccfe628995aa0" and "3b0947c9efd6266bc8ce8738f1050ad0b6ea7582" have entirely different histories.
b1f0ad4bd8
...
3b0947c9ef
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@ -14,7 +14,6 @@ jobs:
|
|||||||
- "3.7"
|
- "3.7"
|
||||||
- "3.8"
|
- "3.8"
|
||||||
- "3.9"
|
- "3.9"
|
||||||
- "3.10"
|
|
||||||
|
|
||||||
name: Python ${{ matrix.python-version }}
|
name: Python ${{ matrix.python-version }}
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
4
AUTHORS
4
AUTHORS
@ -20,5 +20,5 @@ Alphabetically:
|
|||||||
|
|
||||||
Developers are connected to IRC:
|
Developers are connected to IRC:
|
||||||
|
|
||||||
* server: irc.libera.chat
|
* server: 'irc.freenode.net'
|
||||||
* channels: #weechat (English) and #weechat-fr (French)
|
* channels: '#weechat' (English) and '#weechat-fr' (French)
|
||||||
|
2
Makefile
2
Makefile
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2021-2022 Sébastien Helleu <flashcode@flashtux.org>
|
# Copyright (C) 2021 Sébastien Helleu <flashcode@flashtux.org>
|
||||||
#
|
#
|
||||||
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
||||||
#
|
#
|
||||||
|
@ -20,7 +20,7 @@ Homepage: https://weechat.org/
|
|||||||
QWeeChat requires:
|
QWeeChat requires:
|
||||||
|
|
||||||
- Python ≥ 3.7
|
- Python ≥ 3.7
|
||||||
- PyQt5
|
- [PySide6](https://pypi.org/project/PySide6/)
|
||||||
- [WeeChat](https://weechat.org) ≥ 0.3.7, on local or remote machine, with relay plugin enabled and listening on a port with protocol "weechat"
|
- [WeeChat](https://weechat.org) ≥ 0.3.7, on local or remote machine, with relay plugin enabled and listening on a port with protocol "weechat"
|
||||||
|
|
||||||
### Install via source distribution
|
### Install via source distribution
|
||||||
@ -42,7 +42,7 @@ You have to add a relay port in WeeChat, for example on port 1234:
|
|||||||
|
|
||||||
In QWeeChat, click on connect and enter fields:
|
In QWeeChat, click on connect and enter fields:
|
||||||
|
|
||||||
- `hostname`: the IP address or hostname of your machine with WeeChat running
|
- `server`: the IP address or hostname of your machine with WeeChat running
|
||||||
- `port`: the relay port (defined in WeeChat)
|
- `port`: the relay port (defined in WeeChat)
|
||||||
- `password`: the relay password (defined in WeeChat)
|
- `password`: the relay password (defined in WeeChat)
|
||||||
- `totp`: the Time-Based One-Time Password (optional, to set if required by WeeChat)
|
- `totp`: the Time-Based One-Time Password (optional, to set if required by WeeChat)
|
||||||
@ -51,7 +51,7 @@ Options can be changed in file `~/.config/qweechat/qweechat.conf`.
|
|||||||
|
|
||||||
## Copyright
|
## Copyright
|
||||||
|
|
||||||
Copyright © 2011-2022 [Sébastien Helleu](https://github.com/flashcode)
|
Copyright © 2011-2021 [Sébastien Helleu](https://github.com/flashcode)
|
||||||
|
|
||||||
This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011-2022 Sébastien Helleu <flashcode@flashtux.org>
|
# Copyright (C) 2011-2021 Sébastien Helleu <flashcode@flashtux.org>
|
||||||
#
|
#
|
||||||
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
||||||
#
|
#
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# about.py - about dialog box
|
# about.py - about dialog box
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011-2022 Sébastien Helleu <flashcode@flashtux.org>
|
# Copyright (C) 2011-2021 Sébastien Helleu <flashcode@flashtux.org>
|
||||||
#
|
#
|
||||||
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
||||||
#
|
#
|
||||||
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
"""About dialog box."""
|
"""About dialog box."""
|
||||||
|
|
||||||
from PyQt5 import QtCore, QtWidgets as QtGui
|
from PySide6 import QtCore, QtWidgets as QtGui
|
||||||
|
|
||||||
from qweechat.version import qweechat_version
|
from qweechat.version import qweechat_version
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ class AboutDialog(QtGui.QDialog):
|
|||||||
vbox = QtGui.QVBoxLayout()
|
vbox = QtGui.QVBoxLayout()
|
||||||
messages = [
|
messages = [
|
||||||
f'<b>{app_name}</b> {qweechat_version()}',
|
f'<b>{app_name}</b> {qweechat_version()}',
|
||||||
f'© 2011-2022 {author}',
|
f'© 2011-2021 {author}',
|
||||||
'',
|
'',
|
||||||
f'<a href="{weechat_site}">{weechat_site}</a>',
|
f'<a href="{weechat_site}">{weechat_site}</a>',
|
||||||
'',
|
'',
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# buffer.py - management of WeeChat buffers/nicklist
|
# buffer.py - management of WeeChat buffers/nicklist
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011-2022 Sébastien Helleu <flashcode@flashtux.org>
|
# Copyright (C) 2011-2021 Sébastien Helleu <flashcode@flashtux.org>
|
||||||
#
|
#
|
||||||
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
||||||
#
|
#
|
||||||
@ -24,9 +24,7 @@
|
|||||||
|
|
||||||
from pkg_resources import resource_filename
|
from pkg_resources import resource_filename
|
||||||
|
|
||||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
from PySide6 import QtCore, QtGui, QtWidgets
|
||||||
from PyQt5.QtCore import pyqtSignal
|
|
||||||
Signal = pyqtSignal
|
|
||||||
|
|
||||||
from qweechat.chat import ChatTextEdit
|
from qweechat.chat import ChatTextEdit
|
||||||
from qweechat.input import InputLineEdit
|
from qweechat.input import InputLineEdit
|
||||||
@ -147,7 +145,7 @@ class BufferWidget(QtWidgets.QWidget):
|
|||||||
class Buffer(QtCore.QObject):
|
class Buffer(QtCore.QObject):
|
||||||
"""A WeeChat buffer."""
|
"""A WeeChat buffer."""
|
||||||
|
|
||||||
bufferInput = Signal(str, str)
|
bufferInput = QtCore.Signal(str, str)
|
||||||
|
|
||||||
def __init__(self, data=None):
|
def __init__(self, data=None):
|
||||||
QtCore.QObject.__init__(self)
|
QtCore.QObject.__init__(self)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# chat.py - chat area
|
# chat.py - chat area
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011-2022 Sébastien Helleu <flashcode@flashtux.org>
|
# Copyright (C) 2011-2021 Sébastien Helleu <flashcode@flashtux.org>
|
||||||
#
|
#
|
||||||
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
||||||
#
|
#
|
||||||
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from PyQt5 import QtCore, QtWidgets, QtGui
|
from PySide6 import QtCore, QtWidgets, QtGui
|
||||||
|
|
||||||
from qweechat import config
|
from qweechat import config
|
||||||
from qweechat.weechat import color
|
from qweechat.weechat import color
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# config.py - configuration for QWeeChat
|
# config.py - configuration for QWeeChat
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011-2022 Sébastien Helleu <flashcode@flashtux.org>
|
# Copyright (C) 2011-2021 Sébastien Helleu <flashcode@flashtux.org>
|
||||||
#
|
#
|
||||||
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
||||||
#
|
#
|
||||||
@ -33,14 +33,14 @@ CONFIG_FILENAME = '%s/qweechat.conf' % CONFIG_DIR
|
|||||||
CONFIG_DEFAULT_RELAY_LINES = 50
|
CONFIG_DEFAULT_RELAY_LINES = 50
|
||||||
|
|
||||||
CONFIG_DEFAULT_SECTIONS = ('relay', 'look', 'color')
|
CONFIG_DEFAULT_SECTIONS = ('relay', 'look', 'color')
|
||||||
CONFIG_DEFAULT_OPTIONS = (('relay.hostname', '127.0.0.1'),
|
CONFIG_DEFAULT_OPTIONS = (('relay.server', ''),
|
||||||
('relay.port', '9000'),
|
('relay.port', ''),
|
||||||
('relay.ssl', 'off'),
|
('relay.ssl', 'off'),
|
||||||
('relay.password', ''),
|
('relay.password', ''),
|
||||||
('relay.autoconnect', 'off'),
|
('relay.autoconnect', 'off'),
|
||||||
('relay.lines', str(CONFIG_DEFAULT_RELAY_LINES)),
|
('relay.lines', str(CONFIG_DEFAULT_RELAY_LINES)),
|
||||||
('look.debug', 'off'),
|
('look.debug', 'off'),
|
||||||
('look.statusbar', 'on'))
|
('look.statusbar', 'off'))
|
||||||
|
|
||||||
# Default colors for WeeChat color options (option name, #rgb value)
|
# Default colors for WeeChat color options (option name, #rgb value)
|
||||||
CONFIG_DEFAULT_COLOR_OPTIONS = (
|
CONFIG_DEFAULT_COLOR_OPTIONS = (
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# connection.py - connection window
|
# connection.py - connection window
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011-2022 Sébastien Helleu <flashcode@flashtux.org>
|
# Copyright (C) 2011-2021 Sébastien Helleu <flashcode@flashtux.org>
|
||||||
#
|
#
|
||||||
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
||||||
#
|
#
|
||||||
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
"""Connection window."""
|
"""Connection window."""
|
||||||
|
|
||||||
from PyQt5 import QtGui, QtWidgets
|
from PySide6 import QtGui, QtWidgets
|
||||||
|
|
||||||
|
|
||||||
class ConnectionDialog(QtWidgets.QDialog):
|
class ConnectionDialog(QtWidgets.QDialog):
|
||||||
@ -40,16 +40,16 @@ class ConnectionDialog(QtWidgets.QDialog):
|
|||||||
self.fields = {}
|
self.fields = {}
|
||||||
focus = None
|
focus = None
|
||||||
|
|
||||||
# hostname
|
# server
|
||||||
grid.addWidget(QtWidgets.QLabel('<b>Hostname</b>'), 0, 0)
|
grid.addWidget(QtWidgets.QLabel('<b>Server</b>'), 0, 0)
|
||||||
line_edit = QtWidgets.QLineEdit()
|
line_edit = QtWidgets.QLineEdit()
|
||||||
line_edit.setFixedWidth(200)
|
line_edit.setFixedWidth(200)
|
||||||
value = self.values.get('hostname', '')
|
value = self.values.get('server', '')
|
||||||
line_edit.insert(value)
|
line_edit.insert(value)
|
||||||
grid.addWidget(line_edit, 0, 1)
|
grid.addWidget(line_edit, 0, 1)
|
||||||
self.fields['hostname'] = line_edit
|
self.fields['server'] = line_edit
|
||||||
if not focus and not value:
|
if not focus and not value:
|
||||||
focus = 'hostname'
|
focus = 'server'
|
||||||
|
|
||||||
# port / SSL
|
# port / SSL
|
||||||
grid.addWidget(QtWidgets.QLabel('<b>Port</b>'), 1, 0)
|
grid.addWidget(QtWidgets.QLabel('<b>Port</b>'), 1, 0)
|
||||||
|
@ -4,7 +4,7 @@ Copyright and license for images
|
|||||||
|
|
||||||
Files: weechat.png, bullet_green_8x8.png, bullet_yellow_8x8.png
|
Files: weechat.png, bullet_green_8x8.png, bullet_yellow_8x8.png
|
||||||
|
|
||||||
Copyright (C) 2011-2022 Sébastien Helleu <flashcode@flashtux.org>
|
Copyright (C) 2011-2021 Sébastien Helleu <flashcode@flashtux.org>
|
||||||
Released under GPLv3.
|
Released under GPLv3.
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# debug.py - debug window
|
# debug.py - debug window
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011-2022 Sébastien Helleu <flashcode@flashtux.org>
|
# Copyright (C) 2011-2021 Sébastien Helleu <flashcode@flashtux.org>
|
||||||
#
|
#
|
||||||
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
||||||
#
|
#
|
||||||
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
"""Debug window."""
|
"""Debug window."""
|
||||||
|
|
||||||
from PyQt5 import QtWidgets
|
from PySide6 import QtWidgets
|
||||||
|
|
||||||
from qweechat.chat import ChatTextEdit
|
from qweechat.chat import ChatTextEdit
|
||||||
from qweechat.input import InputLineEdit
|
from qweechat.input import InputLineEdit
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# input.py - input line for chat and debug window
|
# input.py - input line for chat and debug window
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011-2022 Sébastien Helleu <flashcode@flashtux.org>
|
# Copyright (C) 2011-2021 Sébastien Helleu <flashcode@flashtux.org>
|
||||||
#
|
#
|
||||||
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
||||||
#
|
#
|
||||||
@ -22,16 +22,15 @@
|
|||||||
|
|
||||||
"""Input line for chat and debug window."""
|
"""Input line for chat and debug window."""
|
||||||
|
|
||||||
from PyQt5 import QtCore, QtWidgets
|
from PySide6 import QtCore, QtWidgets
|
||||||
from PyQt5.QtCore import pyqtSignal
|
|
||||||
Signal = pyqtSignal
|
|
||||||
|
|
||||||
class InputLineEdit(QtWidgets.QLineEdit):
|
class InputLineEdit(QtWidgets.QLineEdit):
|
||||||
"""Input line."""
|
"""Input line."""
|
||||||
|
|
||||||
bufferSwitchPrev = Signal()
|
bufferSwitchPrev = QtCore.Signal()
|
||||||
bufferSwitchNext = Signal()
|
bufferSwitchNext = QtCore.Signal()
|
||||||
textSent = Signal(str)
|
textSent = QtCore.Signal(str)
|
||||||
|
|
||||||
def __init__(self, scroll_widget):
|
def __init__(self, scroll_widget):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# network.py - I/O with WeeChat/relay
|
# network.py - I/O with WeeChat/relay
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011-2022 Sébastien Helleu <flashcode@flashtux.org>
|
# Copyright (C) 2011-2021 Sébastien Helleu <flashcode@flashtux.org>
|
||||||
#
|
#
|
||||||
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
||||||
#
|
#
|
||||||
@ -26,9 +26,7 @@ import hashlib
|
|||||||
import secrets
|
import secrets
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
from PyQt5 import QtCore, QtNetwork
|
from PySide6 import QtCore, QtNetwork
|
||||||
from PyQt5.QtCore import pyqtSignal
|
|
||||||
Signal = pyqtSignal
|
|
||||||
|
|
||||||
from qweechat import config
|
from qweechat import config
|
||||||
from qweechat.debug import DebugDialog
|
from qweechat.debug import DebugDialog
|
||||||
@ -49,13 +47,13 @@ _HASH_ALGOS = ':'.join(_HASH_ALGOS_LIST)
|
|||||||
_PROTO_HANDSHAKE = f'(handshake) handshake password_hash_algo={_HASH_ALGOS}\n'
|
_PROTO_HANDSHAKE = f'(handshake) handshake password_hash_algo={_HASH_ALGOS}\n'
|
||||||
|
|
||||||
# initialize with the password (plain text)
|
# initialize with the password (plain text)
|
||||||
_PROTO_INIT_PWD = 'init password=%(password)s%(totp)s\n' # nosec
|
_PROTO_INIT_PWD = 'init password=%(password)s%(totp)s\n'
|
||||||
|
|
||||||
# initialize with the hashed password
|
# initialize with the hashed password
|
||||||
_PROTO_INIT_HASH = ('init password_hash='
|
_PROTO_INIT_HASH = ('init password_hash='
|
||||||
'%(algo)s:%(salt)s%(iter)s:%(hash)s%(totp)s\n')
|
'%(algo)s:%(salt)s%(iter)s:%(hash)s%(totp)s\n')
|
||||||
|
|
||||||
_PROTO_SYNC_CMDS = [
|
_PROTO_SYNC = [
|
||||||
# get buffers
|
# get buffers
|
||||||
'(listbuffers) hdata buffer:gui_buffers(*) number,full_name,short_name,'
|
'(listbuffers) hdata buffer:gui_buffers(*) number,full_name,short_name,'
|
||||||
'type,nicklist,title,local_variables',
|
'type,nicklist,title,local_variables',
|
||||||
@ -100,8 +98,8 @@ NETWORK_STATUS = {
|
|||||||
class Network(QtCore.QObject):
|
class Network(QtCore.QObject):
|
||||||
"""I/O with WeeChat/relay."""
|
"""I/O with WeeChat/relay."""
|
||||||
|
|
||||||
statusChanged = Signal(str, str)
|
statusChanged = QtCore.Signal(str, str)
|
||||||
messageFromWeechat = Signal(QtCore.QByteArray)
|
messageFromWeechat = QtCore.Signal(QtCore.QByteArray)
|
||||||
|
|
||||||
def __init__(self, *args):
|
def __init__(self, *args):
|
||||||
super().__init__(*args)
|
super().__init__(*args)
|
||||||
@ -117,7 +115,7 @@ class Network(QtCore.QObject):
|
|||||||
|
|
||||||
def _init_connection(self):
|
def _init_connection(self):
|
||||||
self.status = STATUS_DISCONNECTED
|
self.status = STATUS_DISCONNECTED
|
||||||
self._hostname = None
|
self._server = None
|
||||||
self._port = None
|
self._port = None
|
||||||
self._ssl = None
|
self._ssl = None
|
||||||
self._password = None
|
self._password = None
|
||||||
@ -181,7 +179,7 @@ class Network(QtCore.QObject):
|
|||||||
|
|
||||||
def _build_sync_command(self):
|
def _build_sync_command(self):
|
||||||
"""Build the sync commands to send to WeeChat."""
|
"""Build the sync commands to send to WeeChat."""
|
||||||
cmd = '\n'.join(_PROTO_SYNC_CMDS) + '\n'
|
cmd = '\n'.join(_PROTO_SYNC) + '\n'
|
||||||
return cmd % {'lines': self._lines}
|
return cmd % {'lines': self._lines}
|
||||||
|
|
||||||
def handshake_timer_expired(self):
|
def handshake_timer_expired(self):
|
||||||
@ -238,9 +236,9 @@ class Network(QtCore.QObject):
|
|||||||
"""Return True if SSL is used, False otherwise."""
|
"""Return True if SSL is used, False otherwise."""
|
||||||
return self._ssl
|
return self._ssl
|
||||||
|
|
||||||
def connect_weechat(self, hostname, port, ssl, password, totp, lines):
|
def connect_weechat(self, server, port, ssl, password, totp, lines):
|
||||||
"""Connect to WeeChat."""
|
"""Connect to WeeChat."""
|
||||||
self._hostname = hostname
|
self._server = server
|
||||||
try:
|
try:
|
||||||
self._port = int(port)
|
self._port = int(port)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
@ -258,9 +256,9 @@ class Network(QtCore.QObject):
|
|||||||
self._socket.abort()
|
self._socket.abort()
|
||||||
if self._ssl:
|
if self._ssl:
|
||||||
self._socket.ignoreSslErrors()
|
self._socket.ignoreSslErrors()
|
||||||
self._socket.connectToHostEncrypted(self._hostname, self._port)
|
self._socket.connectToHostEncrypted(self._server, self._port)
|
||||||
else:
|
else:
|
||||||
self._socket.connectToHost(self._hostname, self._port)
|
self._socket.connectToHost(self._server, self._port)
|
||||||
self.set_status(STATUS_CONNECTING)
|
self.set_status(STATUS_CONNECTING)
|
||||||
|
|
||||||
def disconnect_weechat(self):
|
def disconnect_weechat(self):
|
||||||
@ -318,7 +316,7 @@ class Network(QtCore.QObject):
|
|||||||
def get_options(self):
|
def get_options(self):
|
||||||
"""Get connection options."""
|
"""Get connection options."""
|
||||||
return {
|
return {
|
||||||
'hostname': self._hostname,
|
'server': self._server,
|
||||||
'port': self._port,
|
'port': self._port,
|
||||||
'ssl': 'on' if self._ssl else 'off',
|
'ssl': 'on' if self._ssl else 'off',
|
||||||
'password': self._password,
|
'password': self._password,
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# preferences.py - preferences dialog box
|
# preferences.py - preferences dialog box
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011-2022 Sébastien Helleu <flashcode@flashtux.org>
|
# Copyright (C) 2011-2021 Sébastien Helleu <flashcode@flashtux.org>
|
||||||
#
|
#
|
||||||
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
||||||
#
|
#
|
||||||
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
"""Preferences dialog box."""
|
"""Preferences dialog box."""
|
||||||
|
|
||||||
from PyQt5 import QtCore, QtWidgets as QtGui
|
from PySide6 import QtCore, QtWidgets as QtGui
|
||||||
|
|
||||||
|
|
||||||
class PreferencesDialog(QtGui.QDialog):
|
class PreferencesDialog(QtGui.QDialog):
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# qweechat.py - WeeChat remote GUI using Qt toolkit
|
# qweechat.py - WeeChat remote GUI using Qt toolkit
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011-2022 Sébastien Helleu <flashcode@flashtux.org>
|
# Copyright (C) 2011-2021 Sébastien Helleu <flashcode@flashtux.org>
|
||||||
#
|
#
|
||||||
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
||||||
#
|
#
|
||||||
@ -37,13 +37,13 @@ import sys
|
|||||||
import traceback
|
import traceback
|
||||||
from pkg_resources import resource_filename
|
from pkg_resources import resource_filename
|
||||||
|
|
||||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
from PySide6 import QtCore, QtGui, QtWidgets
|
||||||
|
|
||||||
from qweechat import config
|
from qweechat import config
|
||||||
from qweechat.about import AboutDialog
|
from qweechat.about import AboutDialog
|
||||||
from qweechat.buffer import BufferListWidget, Buffer
|
from qweechat.buffer import BufferListWidget, Buffer
|
||||||
from qweechat.connection import ConnectionDialog
|
from qweechat.connection import ConnectionDialog
|
||||||
from qweechat.network import Network, STATUS_DISCONNECTED
|
from qweechat.network import Network, STATUS_DISCONNECTED, NETWORK_STATUS
|
||||||
from qweechat.preferences import PreferencesDialog
|
from qweechat.preferences import PreferencesDialog
|
||||||
from qweechat.weechat import protocol
|
from qweechat.weechat import protocol
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ APP_NAME = 'QWeeChat'
|
|||||||
AUTHOR = 'Sébastien Helleu'
|
AUTHOR = 'Sébastien Helleu'
|
||||||
WEECHAT_SITE = 'https://weechat.org/'
|
WEECHAT_SITE = 'https://weechat.org/'
|
||||||
|
|
||||||
# not QFrame
|
|
||||||
class MainWindow(QtWidgets.QMainWindow):
|
class MainWindow(QtWidgets.QMainWindow):
|
||||||
"""Main window."""
|
"""Main window."""
|
||||||
|
|
||||||
@ -87,16 +87,10 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
splitter.addWidget(self.list_buffers)
|
splitter.addWidget(self.list_buffers)
|
||||||
splitter.addWidget(self.stacked_buffers)
|
splitter.addWidget(self.stacked_buffers)
|
||||||
|
|
||||||
self.list_buffers.setSizePolicy(QtWidgets.QSizePolicy.Preferred,
|
|
||||||
QtWidgets.QSizePolicy.Preferred)
|
|
||||||
self.stacked_buffers.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
|
|
||||||
QtWidgets.QSizePolicy.Expanding)
|
|
||||||
# MainWindow
|
|
||||||
self.setCentralWidget(splitter)
|
self.setCentralWidget(splitter)
|
||||||
|
|
||||||
if self.config.getboolean('look', 'statusbar'):
|
if self.config.getboolean('look', 'statusbar'):
|
||||||
self.statusBar().visible = True
|
self.statusBar().visible = True
|
||||||
self.statusBar().visible = True
|
|
||||||
|
|
||||||
# actions for menu and toolbar
|
# actions for menu and toolbar
|
||||||
actions_def = {
|
actions_def = {
|
||||||
@ -145,7 +139,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
}
|
}
|
||||||
self.actions = {}
|
self.actions = {}
|
||||||
for name, action in list(actions_def.items()):
|
for name, action in list(actions_def.items()):
|
||||||
self.actions[name] = QtWidgets.QAction(
|
self.actions[name] = QtGui.QAction(
|
||||||
QtGui.QIcon(
|
QtGui.QIcon(
|
||||||
resource_filename(__name__, 'data/icons/%s' % action[0])),
|
resource_filename(__name__, 'data/icons/%s' % action[0])),
|
||||||
name.capitalize(), self)
|
name.capitalize(), self)
|
||||||
@ -170,22 +164,20 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
self.network_status.setFixedWidth(200)
|
self.network_status.setFixedWidth(200)
|
||||||
self.network_status.setContentsMargins(0, 0, 10, 0)
|
self.network_status.setContentsMargins(0, 0, 10, 0)
|
||||||
self.network_status.setAlignment(QtCore.Qt.AlignRight)
|
self.network_status.setAlignment(QtCore.Qt.AlignRight)
|
||||||
if hasattr(self, 'menuBar'):
|
if hasattr(self.menu, 'setCornerWidget'):
|
||||||
if hasattr(self.menu, 'setCornerWidget'):
|
self.menu.setCornerWidget(self.network_status,
|
||||||
self.menu.setCornerWidget(self.network_status,
|
QtCore.Qt.TopRightCorner)
|
||||||
QtCore.Qt.TopRightCorner)
|
|
||||||
self.network_status_set(STATUS_DISCONNECTED)
|
self.network_status_set(STATUS_DISCONNECTED)
|
||||||
|
|
||||||
# toolbar
|
# toolbar
|
||||||
if hasattr(self, 'addToolBar'):
|
toolbar = self.addToolBar('toolBar')
|
||||||
toolbar = self.addToolBar('toolBar')
|
toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonTextUnderIcon)
|
||||||
toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonTextUnderIcon)
|
toolbar.addActions([self.actions['connect'],
|
||||||
toolbar.addActions([self.actions['connect'],
|
self.actions['disconnect'],
|
||||||
self.actions['disconnect'],
|
self.actions['debug'],
|
||||||
self.actions['debug'],
|
self.actions['preferences'],
|
||||||
self.actions['preferences'],
|
self.actions['about'],
|
||||||
self.actions['about'],
|
self.actions['quit']])
|
||||||
self.actions['quit']])
|
|
||||||
|
|
||||||
self.buffers[0].widget.input.setFocus()
|
self.buffers[0].widget.input.setFocus()
|
||||||
|
|
||||||
@ -196,12 +188,12 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
# auto-connect to relay
|
# auto-connect to relay
|
||||||
if self.config.getboolean('relay', 'autoconnect'):
|
if self.config.getboolean('relay', 'autoconnect'):
|
||||||
self.network.connect_weechat(
|
self.network.connect_weechat(
|
||||||
hostname=self.config.get('relay', 'hostname', fallback=''),
|
server=self.config.get('relay', 'server'),
|
||||||
port=self.config.get('relay', 'port', fallback=''),
|
port=self.config.get('relay', 'port'),
|
||||||
ssl=self.config.getboolean('relay', 'ssl', fallback=''),
|
ssl=self.config.getboolean('relay', 'ssl'),
|
||||||
password=self.config.get('relay', 'password', fallback=''),
|
password=self.config.get('relay', 'password'),
|
||||||
totp=None,
|
totp=None,
|
||||||
lines=self.config.get('relay', 'lines', fallback=''),
|
lines=self.config.get('relay', 'lines'),
|
||||||
)
|
)
|
||||||
|
|
||||||
self.show()
|
self.show()
|
||||||
@ -238,8 +230,8 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
def open_connection_dialog(self):
|
def open_connection_dialog(self):
|
||||||
"""Open a dialog with connection settings."""
|
"""Open a dialog with connection settings."""
|
||||||
values = {}
|
values = {}
|
||||||
for option in ('hostname', 'port', 'ssl', 'password', 'lines'):
|
for option in ('server', 'port', 'ssl', 'password', 'lines'):
|
||||||
values[option] = self.config.get('relay', option, fallback='')
|
values[option] = self.config.get('relay', option)
|
||||||
self.connection_dialog = ConnectionDialog(values, self)
|
self.connection_dialog = ConnectionDialog(values, self)
|
||||||
self.connection_dialog.dialog_buttons.accepted.connect(
|
self.connection_dialog.dialog_buttons.accepted.connect(
|
||||||
self.connect_weechat)
|
self.connect_weechat)
|
||||||
@ -247,7 +239,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
def connect_weechat(self):
|
def connect_weechat(self):
|
||||||
"""Connect to WeeChat."""
|
"""Connect to WeeChat."""
|
||||||
self.network.connect_weechat(
|
self.network.connect_weechat(
|
||||||
hostname=self.connection_dialog.fields['hostname'].text(),
|
server=self.connection_dialog.fields['server'].text(),
|
||||||
port=self.connection_dialog.fields['port'].text(),
|
port=self.connection_dialog.fields['port'].text(),
|
||||||
ssl=self.connection_dialog.fields['ssl'].isChecked(),
|
ssl=self.connection_dialog.fields['ssl'].isChecked(),
|
||||||
password=self.connection_dialog.fields['password'].text(),
|
password=self.connection_dialog.fields['password'].text(),
|
||||||
@ -266,12 +258,8 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
def network_status_set(self, status):
|
def network_status_set(self, status):
|
||||||
"""Set the network status."""
|
"""Set the network status."""
|
||||||
pal = self.network_status.palette()
|
pal = self.network_status.palette()
|
||||||
try:
|
pal.setColor(self.network_status.foregroundRole(),
|
||||||
pal.setColor(self.network_status.foregroundRole(),
|
|
||||||
self.network.status_color(status))
|
self.network.status_color(status))
|
||||||
except:
|
|
||||||
# dunno
|
|
||||||
pass
|
|
||||||
ssl = ' (SSL)' if status != STATUS_DISCONNECTED \
|
ssl = ' (SSL)' if status != STATUS_DISCONNECTED \
|
||||||
and self.network.is_ssl() else ''
|
and self.network.is_ssl() else ''
|
||||||
self.network_status.setPalette(pal)
|
self.network_status.setPalette(pal)
|
||||||
@ -537,7 +525,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
if self.network.debug_dialog:
|
if self.network.debug_dialog:
|
||||||
self.network.debug_dialog.close()
|
self.network.debug_dialog.close()
|
||||||
config.write(self.config)
|
config.write(self.config)
|
||||||
QtWidgets.QFrame.closeEvent(self, event)
|
QtWidgets.QMainWindow.closeEvent(self, event)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# version.py - version of QWeeChat
|
# version.py - version of QWeeChat
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011-2022 Sébastien Helleu <flashcode@flashtux.org>
|
# Copyright (C) 2011-2021 Sébastien Helleu <flashcode@flashtux.org>
|
||||||
#
|
#
|
||||||
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
||||||
#
|
#
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011-2022 Sébastien Helleu <flashcode@flashtux.org>
|
# Copyright (C) 2011-2021 Sébastien Helleu <flashcode@flashtux.org>
|
||||||
#
|
#
|
||||||
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
||||||
#
|
#
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# color.py - remove/replace colors in WeeChat strings
|
# color.py - remove/replace colors in WeeChat strings
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011-2022 Sébastien Helleu <flashcode@flashtux.org>
|
# Copyright (C) 2011-2021 Sébastien Helleu <flashcode@flashtux.org>
|
||||||
#
|
#
|
||||||
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
||||||
#
|
#
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# protocol.py - decode binary messages received from WeeChat/relay
|
# protocol.py - decode binary messages received from WeeChat/relay
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011-2022 Sébastien Helleu <flashcode@flashtux.org>
|
# Copyright (C) 2011-2021 Sébastien Helleu <flashcode@flashtux.org>
|
||||||
#
|
#
|
||||||
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
||||||
#
|
#
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# testproto.py - command-line program for testing WeeChat/relay protocol
|
# testproto.py - command-line program for testing WeeChat/relay protocol
|
||||||
#
|
#
|
||||||
# Copyright (C) 2013-2022 Sébastien Helleu <flashcode@flashtux.org>
|
# Copyright (C) 2013-2021 Sébastien Helleu <flashcode@flashtux.org>
|
||||||
#
|
#
|
||||||
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
||||||
#
|
#
|
||||||
|
@ -1,2 +1 @@
|
|||||||
PyQt5
|
PySide6
|
||||||
|
|
||||||
|
2
setup.py
2
setup.py
@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011-2022 Sébastien Helleu <flashcode@flashtux.org>
|
# Copyright (C) 2011-2021 Sébastien Helleu <flashcode@flashtux.org>
|
||||||
#
|
#
|
||||||
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
# This file is part of QWeeChat, a Qt remote GUI for WeeChat.
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user