# You should have received a copy of the GNU General Public License # along with QWeeChat. If not, see <http://www.gnu.org/licenses/>. # # # This script requires WeeChat 0.3.7 or newer, running on local or remote host. # # History: # # 2011-05-27, Sebastien Helleu <*****@*****.**>: # start dev # import sys import qt_compat QtCore = qt_compat.import_module('QtCore') QtGui = qt_compat.import_module('QtGui') from mainwindow import MainWindow NAME = 'QWeeChat' VERSION = '0.0.1-dev' AUTHOR = 'Sébastien Helleu' AUTHOR_MAIL= '*****@*****.**' WEECHAT_SITE = 'http://www.weechat.org/' # number of lines in buffer for debug window DEBUG_NUM_LINES = 50 if __name__ == "__main__": app = QtGui.QApplication(sys.argv) app.setStyle(QtGui.QStyleFactory.create('Cleanlooks'))
# QWeeChat is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with QWeeChat. If not, see <http://www.gnu.org/licenses/>. # from pkg_resources import resource_filename import qt_compat from chat import ChatTextEdit from input import InputLineEdit import weechat.color as color QtCore = qt_compat.import_module('QtCore') QtGui = qt_compat.import_module('QtGui') class GenericListWidget(QtGui.QListWidget): """Generic QListWidget with dynamic size.""" def __init__(self, *args): QtGui.QListWidget.__init__(*(self, ) + args) self.setMaximumWidth(100) self.setTextElideMode(QtCore.Qt.ElideNone) self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.setFocusPolicy(QtCore.Qt.NoFocus) pal = self.palette() pal.setColor(QtGui.QPalette.Highlight, QtGui.QColor('#ddddff')) pal.setColor(QtGui.QPalette.HighlightedText, QtGui.QColor('black')) self.setPalette(pal)
# (at your option) any later version. # # QWeeChat is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with QWeeChat. If not, see <http://www.gnu.org/licenses/>. # import qt_compat from chat import ChatTextEdit from input import InputLineEdit QtGui = qt_compat.import_module('QtGui') class DebugDialog(QtGui.QDialog): """Debug dialog.""" def __init__(self, *args): QtGui.QDialog.__init__(*(self,) + args) self.resize(640, 480) self.setWindowTitle('Debug console') self.chat = ChatTextEdit(debug=True) self.input = InputLineEdit(self.chat) vbox = QtGui.QVBoxLayout() vbox.addWidget(self.chat)
#!/usr/bin/env python from __future__ import with_statement from __future__ import division import logging import qt_compat QtCore = qt_compat.QtCore QtGui = qt_compat.import_module("QtGui") import qore_utils import qui_utils import misc as misc_utils import linux as linux_utils _moduleLogger = logging.getLogger(__name__) class ApplicationWrapper(object): DEFAULT_ORIENTATION = "Default" AUTO_ORIENTATION = "Auto" LANDSCAPE_ORIENTATION = "Landscape" PORTRAIT_ORIENTATION = "Portrait" ORIENTATIONS = [ DEFAULT_ORIENTATION, AUTO_ORIENTATION, LANDSCAPE_ORIENTATION, PORTRAIT_ORIENTATION,
# (at your option) any later version. # # QWeeChat is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with QWeeChat. If not, see <http://www.gnu.org/licenses/>. # import struct import qt_compat import config QtCore = qt_compat.import_module('QtCore') QtNetwork = qt_compat.import_module('QtNetwork') _PROTO_INIT_CMD = ['init password=%(password)s'] _PROTO_SYNC_CMDS = [ '(listbuffers) hdata buffer:gui_buffers(*) number,full_name,short_name,' 'type,nicklist,title,local_variables', '(listlines) hdata buffer:gui_buffers(*)/own_lines/last_line(-%(lines)d)/' 'data date,displayed,prefix,message', '(nicklist) nicklist', 'sync', '' ] class Network(QtCore.QObject): """I/O with WeeChat/relay."""
# it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # QWeeChat is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with QWeeChat. If not, see <http://www.gnu.org/licenses/>. # import qt_compat QtGui = qt_compat.import_module('QtGui') class ConnectionDialog(QtGui.QDialog): """Connection window.""" def __init__(self, values, *args): QtGui.QDialog.__init__(*(self, ) + args) self.values = values self.setModal(True) grid = QtGui.QGridLayout() grid.setSpacing(10) self.fields = {} for line, field in enumerate(('server', 'port', 'password', 'lines')): grid.addWidget(QtGui.QLabel(field.capitalize()), line, 0)
# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # QWeeChat is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with QWeeChat. If not, see <http://www.gnu.org/licenses/>. # import struct import qt_compat QtCore = qt_compat.import_module("QtCore") QtNetwork = qt_compat.import_module("QtNetwork") _PROTO_INIT_CMD = ["init password=%(password)s"] _PROTO_SYNC_CMDS = [ "(listbuffers) hdata buffer:gui_buffers(*) number,full_name,short_name,type,nicklist,title,local_variables", "(listlines) hdata buffer:gui_buffers(*)/own_lines/first_line(*)/data date,displayed,prefix,message", "(nicklist) nicklist", "sync", "", ] class Network(QtCore.QObject): """I/O with WeeChat/relay."""
# it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # QWeeChat is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with QWeeChat. If not, see <http://www.gnu.org/licenses/>. # import struct import qt_compat QtCore = qt_compat.import_module('QtCore') QtNetwork = qt_compat.import_module('QtNetwork') import config _PROTO_INIT_CMD = ['init password=%(password)s'] _PROTO_SYNC_CMDS = [ '(listbuffers) hdata buffer:gui_buffers(*) number,full_name,short_name,' 'type,nicklist,title,local_variables', '(listlines) hdata buffer:gui_buffers(*)/own_lines/last_line(-%(lines)d)/' 'data date,displayed,prefix,message', '(nicklist) nicklist', 'sync',
#!/usr/bin/env python from __future__ import division import os import warnings import qt_compat QtGui = qt_compat.import_module("QtGui") import qtpie class PieKeyboard(object): SLICE_CENTER = -1 SLICE_NORTH = 0 SLICE_NORTH_WEST = 1 SLICE_WEST = 2 SLICE_SOUTH_WEST = 3 SLICE_SOUTH = 4 SLICE_SOUTH_EAST = 5 SLICE_EAST = 6 SLICE_NORTH_EAST = 7 MAX_ANGULAR_SLICES = 8 SLICE_DIRECTIONS = [ SLICE_CENTER, SLICE_NORTH,
Use Loader [1] Keep QML files small [1] [1] http://sf2011.meego.com/program/sessions/performance-tips-and-tricks-qtqml-applications-0 [2] http://doc.qt.nokia.com/4.7/qdeclarativeperformance.html """ from __future__ import with_statement from __future__ import division import os import logging import qt_compat QtCore = qt_compat.QtCore QtGui = qt_compat.import_module("QtGui") QtDeclarative = qt_compat.import_module("QtDeclarative") _moduleLogger = logging.getLogger(__name__) class DeclarativeView(QtDeclarative.QDeclarativeView): def __init__(self): QtDeclarative.QDeclarativeView.__init__(self) closing = qt_compat.Signal() def closeEvent(self, event): self.closing.emit()
It requires requires WeeChat 0.3.7 or newer, running on local or remote host. """ # # History: # # 2011-05-27, Sébastien Helleu <*****@*****.**>: # start dev # import sys import traceback from pkg_resources import resource_filename import qt_compat QTCORE = qt_compat.import_module('QtCore') QTGUI = qt_compat.import_module('QtGui') import config import weechat.protocol as protocol from network import Network from connection import ConnectionDialog from buffer import BufferListWidget, Buffer from debug import DebugDialog from about import AboutDialog from version import qweechat_version NAME = 'QWeeChat' AUTHOR = 'Sébastien Helleu' AUTHOR_MAIL = '*****@*****.**' WEECHAT_SITE = 'http://weechat.org/'
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with QWeeChat. If not, see <http://www.gnu.org/licenses/>. # import qt_compat import datetime from pkg_resources import resource_filename import os from subprocess import call import utils import weechat.color as color QtCore = qt_compat.import_module('QtCore') QtGui = qt_compat.import_module('QtGui') Phonon = qt_compat.import_module('phonon').Phonon Qt = QtCore.Qt class NotificationManager(QtCore.QObject): """Notifications.""" statusChanged = qt_compat.Signal(str, str) messageFromWeechat = qt_compat.Signal(QtCore.QByteArray) def __init__(self, parent, *args): QtCore.QObject.__init__(*(self,) + args) self.records = {} self.taskbar_activity = set()
It requires requires WeeChat 0.3.7 or newer, running on local or remote host. """ # # History: # # 2011-05-27, Sébastien Helleu <*****@*****.**>: # start dev # import sys import traceback from pkg_resources import resource_filename import qt_compat QTCORE = qt_compat.import_module('QtCore') QTGUI = qt_compat.import_module('QtGui') import config import weechat.protocol as protocol from network import Network from connection import ConnectionDialog from buffer import BufferListWidget, Buffer from debug import DebugDialog from about import AboutDialog from version import qweechat_version NAME = 'QWeeChat' AUTHOR = 'Sébastien Helleu' AUTHOR_MAIL = '*****@*****.**' WEECHAT_SITE = 'https://weechat.org/'