Merge branch 'small_design'

the small design for texter is much better
This commit is contained in:
Stefan Kögl 2014-04-17 15:33:48 +02:00
commit be8835b94e
24 changed files with 3386 additions and 1811 deletions

4
TODO
View File

@ -3,4 +3,8 @@
* install netplug on all servers * install netplug on all servers
* verkabelungsanleitung für die sensoren schreiben * verkabelungsanleitung für die sensoren schreiben
* server restartsicher machen * server restartsicher machen
* anne texter erklären und installieren
*
11:30 Termin

View File

@ -0,0 +1,19 @@
[Desktop Entry]
Comment[en_US]=
Comment=
Exec=ffmpeg -f x11grab -s 768x576 -r 30 -i :0.0+9,89 -vcodec mjpeg -vcodec mjpeg http://localhost:8090/webcam.ffm
GenericName[en_US]=Grabs a desktop region
GenericName=Grabs a desktop region
Icon=exec
MimeType=
Name[en_US]=4.48 Desktop Grabber
Name=4.48 Desktop Grabber
Path=
StartupNotify=true
Terminal=true
TerminalOptions=\s--noclose
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-KDE-SubstituteUID=false
X-KDE-Username=

View File

@ -0,0 +1,19 @@
[Desktop Entry]
Comment[en_US]=
Comment=
Exec=ffserver -d -f /etc/ffserver.conf -v debug\n
GenericName[en_US]=Streams desktop casts
GenericName=Streams desktop casts
Icon=exec
MimeType=
Name[en_US]=4.48 Streamer
Name=4.48 Streamer
Path=
StartupNotify=true
Terminal=true
TerminalOptions=\s--noclose
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=

View File

@ -0,0 +1,19 @@
Port 8090
BindAddress 0.0.0.0
MaxClients 10
MaxBandwidth 1000000
CustomLog /tmp/ffserver.log
<Feed textcast.ffm>
file /tmp/textcast.ffm
FileMaxSize 10M
ACL allow 127.0.0.1
</Feed>
<Stream textcast.mjpeg>
Feed textcast.ffm
Format mjpeg
VideoFrameRate 25
VideoSize 768x576
Noaudio
</Stream>

View File

@ -136,17 +136,25 @@ class OSCThread(threading.Thread):
def run(self): def run(self):
while self.running: while self.running:
try:
reads, writes, errs = select.select([self.osc_sock], [], [], 0.05) reads, writes, errs = select.select([self.osc_sock], [], [], 0.05)
except Exception, e:
print "select error", e
pass
else:
if reads: if reads:
osc_input = self.osc_sock.recv(256) try:
osc_input, address = self.osc_sock.recvfrom(8192)
osc_address, typetags, messages = decode_osc(osc_input, 0, len(osc_input)) osc_address, typetags, messages = decode_osc(osc_input, 0, len(osc_input))
#print "thread osc_address", osc_address
if osc_address.find("ekg") != -1 or osc_address.find("plot") != -1: if osc_address.find("ekg") != -1 or osc_address.find("plot") != -1:
queue.put_nowait((osc_address, messages)) queue.put_nowait((osc_address, messages))
except Exception, e:
print "recvfrom error", e
else: else:
queue.put_nowait(("/bjoern/ekg", [0])) queue.put_nowait(("/bjoern/ekg", [0]))
queue.put_nowait(("/merle/ekg", [0])) queue.put_nowait(("/merle/ekg", [0]))
queue.put_nowait(("/uwe/ekg", [0])) queue.put_nowait(("/uwe/ekg", [0]))
self.unsubscribe_me() self.unsubscribe_me()
print "OSCThread is going down" print "OSCThread is going down"
@ -237,11 +245,11 @@ class Actor(object):
class EkgPlot(object): class EkgPlot(object):
def __init__(self, actor_names, num_data, colors): def __init__(self, actor_names, num_data, colors):
self.plot = pg.PlotWidget(title="<h1>EKG</h1>") self.plot = pg.PlotWidget()
self.plot.hide() self.plot.hide()
self.plot.setLabel('left', "<h2>Amplitude</h2>") #self.plot.setLabel('left', "<h2>Amplitude</h2>")
self.plot.setLabel('bottom', "<h2><sup>Time</sup></h2>") #self.plot.setLabel('bottom', "<h2><sup>Time</sup></h2>")
self.plot.showGrid(True, True) self.plot.showGrid(False, False)
self.plot.setYRange(0, 255) self.plot.setYRange(0, 255)
self.plot.setXRange(0, num_data) self.plot.setXRange(0, num_data)
self.plot.resize(1280, 720) self.plot.resize(1280, 720)
@ -354,7 +362,7 @@ class MyHandler(BaseHTTPRequestHandler):
self.thread = thread = OSCThread(self.server.args) self.thread = thread = OSCThread(self.server.args)
thread.daemon = True thread.daemon = True
thread.start() thread.start()
actor_names = ["bjoern", "merle", "uwe"] actor_names = ["merle", "bjoern", "uwe"]
num_data = 100 num_data = 100
colors = ["r", "g", "b"] colors = ["r", "g", "b"]
qtapp = QtGui.QApplication([]) qtapp = QtGui.QApplication([])
@ -374,7 +382,7 @@ class MyHandler(BaseHTTPRequestHandler):
osc_address, args = queue.get_nowait() osc_address, args = queue.get_nowait()
except Queue.Empty: except Queue.Empty:
break break
else:
plotter.update(osc_address, args[0]) plotter.update(osc_address, args[0])
exporter = pg.exporters.ImageExporter.ImageExporter(plotter.plot.plotItem) exporter = pg.exporters.ImageExporter.ImageExporter(plotter.plot.plotItem)
@ -386,10 +394,10 @@ class MyHandler(BaseHTTPRequestHandler):
JpegData = buffer.data() JpegData = buffer.data()
self.wfile.write("--aaboundary\r\nContent-Type: image/jpeg\r\nContent-length: %d\r\n\r\n%s\r\n\r\n\r\n" % (len(JpegData), JpegData)) self.wfile.write("--aaboundary\r\nContent-Type: image/jpeg\r\nContent-length: %d\r\n\r\n%s\r\n\r\n\r\n" % (len(JpegData), JpegData))
del JpegData JpegData = None
del buffer buffer = None
del img img = None
del exporter exporter = None
#now = time.time() #now = time.time()
#dt = now - lastTime #dt = now - lastTime
#lastTime = now #lastTime = now
@ -410,16 +418,19 @@ class MyHandler(BaseHTTPRequestHandler):
return return
except (KeyboardInterrupt, SystemError): except (KeyboardInterrupt, SystemError):
print "queue size", queue.qsize() print "queue size", queue.qsize()
if hasattr(self, "thread"): if hasattr(self, "thread") and self.thread is not None:
self.thread.running = False self.thread.running = False
self.thread.join() self.thread.join()
del self.thread self.thread = None
except IOError, e: except IOError, e:
if hasattr(self, "thread"): print "ioerror", e, e[0]
print dir(e)
if e[0] in (32, 104):
if hasattr(self, "thread") and self.thread is not None:
self.thread.running = False self.thread.running = False
self.thread.join() self.thread.join()
del self.thread self.thread = None
print "ioerror", e else:
print '-'*40 print '-'*40
print 'Exception happened during processing of request from' print 'Exception happened during processing of request from'
traceback.print_exc() # XXX But this goes to stderr! traceback.print_exc() # XXX But this goes to stderr!

View File

@ -1,189 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
import PyQt4.uic
from PyQt4 import QtCore, QtGui
from PyKDE4.kdeui import KActionCollection, KRichTextWidget
MainWindowForm, MainWindowBase = PyQt4.uic.loadUiType('texter.ui')
from operator import itemgetter
import cPickle
class MainWindow(MainWindowBase, MainWindowForm):
def __init__(self, parent = None):
super(MainWindow, self).__init__(parent)
# setup the ui
self.setupUi(self)
self.show_private_text.setRichTextSupport(KRichTextWidget.RichTextSupport(0xffffffff))
self.edit_private_text.setRichTextSupport(KRichTextWidget.RichTextSupport(0xffffffff))
self.edit_action_collection = KActionCollection(self)
self.edit_private_text.createActions(self.edit_action_collection)
for action in self.edit_action_collection.actions():
self.toolBar.addAction(action)
print dir(self)
self.tabWidget.currentChanged.connect(self.slot_toggleToolbox)
self.add_button.clicked.connect(self.slot_addText)
self.save_button.clicked.connect(self.slot_save)
self.publish_button.clicked.connect(self.slot_publish)
self.clear_button.clicked.connect(self.slot_clear)
self.remove_item_button.clicked.connect(self.slot_removeItem)
self.edit_item_selection.activated.connect(self.slot_editLoadItem)
self.item_list.currentRowChanged.connect(self.slot_showLoadItem)
self.items = dict()
self.slot_load()
self.next_button.setShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Space))
self.next_button.clicked.connect(self.slot_next_item)
self.previous_button.setShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Backspace))
self.previous_button.clicked.connect(self.slot_previous_item)
def slot_next_item(self):
print "slot_next_item"
index = (self.item_list.currentRow() + 1) % self.item_list.count()
self.item_list.setCurrentRow(index)
self.edit_item_selection.setCurrentIndex(index)
self.slot_editLoadItem(index)
self.slot_showLoadItem(index)
def slot_previous_item(self):
print "slot_previous_item"
index = (self.item_list.currentRow() - 1) % self.item_list.count()
self.item_list.setCurrentRow(index)
self.edit_item_selection.setCurrentIndex(index)
self.slot_editLoadItem(index)
self.slot_showLoadItem(index)
def slot_toggleToolbox(self, index):
if index == 0:
self.toolBar.setEnabled(True)
else:
self.toolBar.setEnabled(False)
def slot_publish(self):
#QPropertyAnimation animation(self.public_text.palette(), "geometry");
#animation.setDuration(10000);
#animation.setStartValue(QRect(0, 0, 100, 30));
#animation.setEndValue(QRect(250, 250, 100, 30));
#animation.start();
print "slot_publish"
self.show_public_text.setTextOrHtml(self.show_private_text.textOrHtml())
def slot_clear(self):
self.show_public_text.clear()
def slot_removeItem(self):
text = self.edit_item_selection.currentText()
index = self.edit_item_selection.currentIndex()
title = text.split(": ")[1]
del self.items[title]
self.edit_item_selection.removeItem(index)
self.show_item_selection.removeItem(index)
def slot_editLoadItem(self, index):
print "slot_editLoadItem", index
itemText = self.edit_item_selection.itemText(index)
position, title = itemText.split(": ", 1)
text, position = self.items[title]
self.edit_private_text.setTextOrHtml(text)
self.item_title.setText(title)
self.item_position_input.setValue(position)
def slot_showLoadItem(self, index):
public_rect = self.show_public_text.geometry()
global_rect = QtCore.QRect(self.mapToGlobal(public_rect.topLeft()), self.mapToGlobal(public_rect.bottomRight()))
print "slot_showLoadItem", global_rect
item = self.item_list.item(index)
if item is None:
return
title = item.text()
text, index = self.items[title]
self.show_private_text.setHtml(text)
if self.auto_publish_checkbox.isChecked():
self.show_public_text.setHtml(text)
def title_by_index(self, ix):
for title, (text, index) in self.items.iteritems():
if index == ix:
return title
return None
def slot_changeItem(self, old_title):
print "slot_changeItem"
text, index = self.items.pop(old_title)
new_text = self.edit_private_text.textOrHtml()
new_title = self.item_title.text()
self.items[new_title] = (new_text, index)
self.show_public_text.setTextOrHtml(new_text)
self.item_title.setText(new_title)
self.edit_item_selection.setItemText(index, "%d: %s" % (index, new_title))
self.item_list.item(index).setText(new_title)
def slot_addText(self):
print "slot add"
index = self.item_position_input.value()
if index - self.item_list.count() > 1:
old_title = self.edit_item_selection.currentText().split(": ")[1]
self.item_title.setText(old_title)
text, index = self.items[old_title]
self.edit_private_text.setTextOrHtml(text)
self.item_position_input.setValue(index)
return
old_title = self.title_by_index(index)
if old_title is not None:
self.slot_changeItem(old_title)
return
title = self.item_title.text()
text = self.edit_private_text.textOrHtml()
self.items[title] = (text, index)
self.edit_item_selection.insertItem(index, "%d: %s" % (index, title))
self.item_list.insertItem(index, title)
self.edit_item_selection.setCurrentIndex(index)
self.item_list.setCurrentRow(index)
def slot_save(self):
cPickle.dump(self.items, open("448_texter.db", "w"), cPickle.HIGHEST_PROTOCOL)
def slot_load(self):
try:
self.items = cPickle.load(open("448_texter.db"))
except Exception, e:
print e
data = list()
for title, (text, index) in self.items.iteritems():
data.append((title, text, index))
data = sorted(data, key=itemgetter(2))
for title, text, index in data:
self.edit_item_selection.addItem("%d: %s" % (index, title))
self.item_list.addItem(title)
self.edit_item_selection.setCurrentIndex(0)
self.item_list.setCurrentRow(0)
title, text, position = data[0]
self.edit_private_text.setTextOrHtml(text)
self.show_private_text.setTextOrHtml(text)
self.item_position_input.setValue(position)
self.item_title.setText(title)
if ( __name__ == '__main__' ):
app = None
if ( not app ):
app = QtGui.QApplication([])
window = MainWindow()
window.show()
if ( app ):
app.exec_()

58
texter/setup.py Normal file
View File

@ -0,0 +1,58 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
from distribute_setup import use_setuptools
use_setuptools()
import sys
from setuptools import find_packages, setup
if sys.version_info >= (3,):
extras['use_2to3'] = True
setup(
name='texter',
version="0.1",
packages=find_packages(exclude=["scripts",]),
include_package_data = True,
package_data = {
"texter" : ["*.ui", "*.qrc", "*.png"]},
exclude_package_data = {'': ['.gitignore']},
#install_requires=[],
data_files=[
('/usr/share/applications', ['texter/texter.desktop']),
('/usr/share/icons/hicolor/32x32/apps/texter_icon.png', ['texter/icon.png'])],
# installing unzipped
zip_safe = False,
# predefined extension points, e.g. for plugins
entry_points = """
[console_scripts]
texter = texter.main:main
""",
# pypi metadata
author = "Stefan Kögl",
# FIXME: add author email
author_email = "hotte@ctdo.de",
description = "live text tool",
# FIXME: add long_description
long_description = """
""",
# FIXME: add license
license = "LGPL",
# FIXME: add keywords
keywords = "",
# FIXME: add download url
url = "",
test_suite='tests'
)

File diff suppressed because it is too large Load Diff

BIN
texter/texter/448_texter.db Normal file

Binary file not shown.

View File

@ -0,0 +1 @@
import texter_rc

2
texter/texter/build.sh Normal file
View File

@ -0,0 +1,2 @@
# pykdeuic4-python2.7 -o texter_ui.py texter3.ui
pykdeuic4-python2.7 -o text_sorter_ui.py texter4.ui

BIN
texter/texter/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

660
texter/texter/main.py Normal file
View File

@ -0,0 +1,660 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
import cPickle
import os.path
import re
import subprocess
import sys
from math import pow
from operator import itemgetter
from PyQt4 import QtCore, QtGui
from PyKDE4.kdecore import ki18n, KCmdLineArgs, KAboutData
from PyKDE4.kdeui import KDialog, KActionCollection, KRichTextWidget, KComboBox, KPushButton, KRichTextWidget, KMainWindow, KToolBar, KApplication, KAction, KToolBarSpacerAction, KSelectAction, KToggleAction, KShortcut
from texter_ui import Ui_MainWindow, _fromUtf8
from text_sorter_ui import Ui_TextSorterDialog
from text_model import TextModel
appName = "texter"
catalog = "448texter"
programName = ki18n("4.48 Psychose Texter")
version = "0.1"
aboutData = KAboutData(appName, catalog, programName, version)
KCmdLineArgs.init (sys.argv, aboutData)
app = KApplication()
for path in QtGui.QIcon.themeSearchPaths():
print "%s/%s" % (path, QtGui.QIcon.themeName())
# NOTE: if the QIcon.fromTheme method does not find any icons, you can set a theme
# in your local icon directory:
# ln -s /your/icon/theme/directory $HOME/.icons/hicolor
class TextSorterDialog(QtGui.QWidget, Ui_TextSorterDialog):
def __init__(self, parent = None):
super(TextSorterDialog, self).__init__(parent)
self.setupUi(self)
self.fill_list()
self.text_list.clicked.connect(self.slot_show_text)
self.remove_button.clicked.connect(self.slot_removeItem)
self.move_up_button.clicked.connect(self.slot_text_up)
self.move_down_button.clicked.connect(self.slot_text_down)
self.text_list.clicked.connect(self.slot_toggle_buttons)
self.move_up_button.setEnabled(False)
self.move_down_button.setEnabled(False)
def slot_toggle_buttons(self, index):
row = index.row()
if row <= 0:
self.move_up_button.setEnabled(False)
else:
self.move_up_button.setEnabled(True)
if row >= len(self.model.text_db) - 1:
self.move_down_button.setEnabled(False)
else:
self.move_down_button.setEnabled(True)
def fill_list(self):
self.model = self.parent().parent().model
self.text_list.setModel(self.model)
def slot_text_up(self):
row = self.text_list.currentIndex().row()
if row <= 0:
return False
text_db = self.model.text_db
text_db[row-1], text_db[row] = text_db[row], text_db[row-1]
self.text_list.setCurrentIndex(self.model.index(row - 1, 0))
self.text_list.clicked.emit(self.model.index(row - 1, 0))
return True
def slot_text_down(self):
text_db = self.model.text_db
row = self.text_list.currentIndex().row()
if row >= len(text_db) - 1:
return False
text_db[row], text_db[row+1] = text_db[row+1], text_db[row]
index = self.model.index(row + 1, 0)
self.text_list.setCurrentIndex(index)
self.text_list.clicked.emit(index)
return True
def slot_show_text(self, model_index):
self.text_preview.setTextOrHtml(self.parent().parent().model.text_db[model_index.row()][1])
def slot_removeItem(self):
index = self.text_list.currentIndex().row()
print "remote index", index
self.model.removeRows(index, 1)
index = self.model.index(0, 0)
self.text_list.setCurrentIndex(index)
self.text_list.clicked.emit(index)
class MainWindow(KMainWindow, Ui_MainWindow):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
self.is_streaming = False
self.ffserver = None
self.ffmpeg = None
self.live_center_action = None
self.preview_center_action = None
self.live_size_action = None
self.preview_font_action = None
self.live_font_action = None
self.preview_size_action = None
self.default_size = 28
self.default_align_text = "format_align_center"
self.preview_actions = list()
self.live_actions = list()
self.current = 0
self.model = TextModel(self)
self.is_auto_publish = False
self.setupUi(self)
self.font = QtGui.QFont("monospace", self.default_size)
self.font.setStyleHint(QtGui.QFont.TypeWriter)
self.toolbar = KToolBar(self, True, True)
self.toolbar.setAllowedAreas(QtCore.Qt.BottomToolBarArea)
self.toolbar.setMovable(False)
self.toolbar.setFloatable(False)
self.toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonTextUnderIcon)
self.addToolBar(QtCore.Qt.BottomToolBarArea, self.toolbar)
self.createLiveActions()
self.createPreviewActions()
self.slot_load()
self.preview_text.document().setDefaultFont(self.font)
self.preview_text.setFont(self.font)
self.preview_text.setRichTextSupport(KRichTextWidget.RichTextSupport(0xffffffff))
self.preview_editor_collection = KActionCollection(self)
self.preview_text.createActions(self.preview_editor_collection)
self.live_text.setRichTextSupport(KRichTextWidget.RichTextSupport(0xffffffff))
self.live_text.document().setDefaultFont(self.font)
self.live_text.setFont(self.font)
self.live_editor_collection = KActionCollection(self)
self.live_text.createActions(self.live_editor_collection)
self.filter_editor_actions()
self.toolbar.insertSeparator(self.publish_action)
self.toolbar.addSeparator()
self.show()
self.save_action.triggered.connect(self.slot_save)
#self.valign_action.triggered.connect(self.slot_valign)
self.publish_action.triggered.connect(self.slot_publish)
self.clear_live_action.triggered.connect(self.slot_clear_live)
self.clear_preview_action.triggered.connect(self.slot_clear_preview)
#self.remove_item_button.triggered.connect(self.slot_removeItem)
self.text_combo.triggered[int].connect(self.slot_load_preview_text)
app.focusChanged.connect(self.focusChanged)
self.text_editor_action.triggered.connect(self.slot_open_dialog)
self.save_live_action.triggered.connect(self.slot_save_live_text)
self.save_preview_action.triggered.connect(self.slot_save_preview_text)
self.streaming_action.triggered.connect(self.slot_toggle_streaming)
self.auto_publish_action.toggled.connect(self.slot_auto_publish)
self.preview_size_action.triggered[QtGui.QAction].connect(self.slot_preview_font_size)
self.live_size_action.triggered[QtGui.QAction].connect(self.slot_live_font_size)
self.next_action.triggered.connect(self.slot_next_item)
self.previous_action.triggered.connect(self.slot_previous_item)
app.aboutToQuit.connect(self.kill_streaming)
self.getLiveCoords()
print "desktop", app.desktop().availableGeometry()
def getLiveCoords(self):
public_rect = self.live_text.geometry()
global_rect = QtCore.QRect(self.mapToGlobal(public_rect.topLeft()), self.mapToGlobal(public_rect.bottomRight()))
x = global_rect.x()
y = global_rect.y()
self.statusBar().showMessage("live text editor dimensions: x=%r, y=%r, width=%r, height=%r" % (x, y, global_rect.width(), global_rect.height()))
def getPreviewCoords(self):
public_rect = self.preview_text.geometry()
global_rect = QtCore.QRect(self.mapToGlobal(public_rect.topLeft()), self.mapToGlobal(public_rect.bottomRight()))
return global_rect.x(), global_rect.y()
def filter_editor_actions(self):
disabled_action_names = [
"action_to_plain_text",
"format_painter",
"direction_ltr",
"direction_rtl",
"format_font_family",
#"format_font_size",
"format_text_background_color",
"format_list_indent_more",
"format_list_indent_less",
"format_text_bold",
"format_text_underline",
"format_text_strikeout",
"format_text_italic",
"format_align_right",
"format_align_justify",
"manage_link",
"format_text_subscript",
"format_text_superscript",
"insert_horizontal_rule"
]
for action in self.live_editor_collection.actions():
text = str(action.objectName())
if text in disabled_action_names:
action.setVisible(False)
if text == self.default_align_text:
self.live_center_action = action
elif text == "format_font_size":
self.live_size_action = action
elif text == "format_font_family":
self.live_font_action = action
for action in self.preview_editor_collection.actions():
text = str(action.objectName())
if text in disabled_action_names:
action.setVisible(False)
if text == self.default_align_text:
self.preview_center_action = action
elif text == "format_font_size":
self.preview_size_action = action
elif text == "format_font_family":
self.preview_font_action = action
self.slot_set_preview_defaults()
self.slot_set_live_defaults()
def createLiveActions(self):
self.toolbar.show()
self.live_text_collection = KActionCollection(self)
self.live_text_collection.addAssociatedWidget(self.toolbar)
self.clear_live_action = self.live_text_collection.addAction("clear_live_action")
icon = QtGui.QIcon.fromTheme(_fromUtf8("edit-clear"))
self.clear_live_action.setIcon(icon)
self.clear_live_action.setIconText("clear live")
self.clear_live_action.setShortcut(KShortcut(QtGui.QKeySequence(QtCore.Qt.ALT + QtCore.Qt.Key_Q)), KAction.ShortcutTypes(KAction.ActiveShortcut | KAction.DefaultShortcut))
self.save_live_action = self.live_text_collection.addAction("save_live_action")
icon = QtGui.QIcon.fromTheme(_fromUtf8("document-new"))
self.save_live_action.setIcon(icon)
self.save_live_action.setIconText("save live")
self.save_live_action.setShortcut(KShortcut(QtGui.QKeySequence(QtCore.Qt.ALT + QtCore.Qt.Key_W)), KAction.ShortcutTypes(KAction.ActiveShortcut | KAction.DefaultShortcut))
def createPreviewActions(self):
self.toolbar.show()
self.preview_text_collection = KActionCollection(self)
self.preview_text_collection.addAssociatedWidget(self.toolbar)
self.clear_preview_action = self.preview_text_collection.addAction("clear_preview_action")
icon = QtGui.QIcon.fromTheme(_fromUtf8("edit-clear"))
self.clear_preview_action.setIcon(icon)
self.clear_preview_action.setIconText("clear preview")
#self.clear_preview_action.setObjectName("clear_preview")
self.clear_preview_action.setShortcut(KShortcut(QtGui.QKeySequence(QtCore.Qt.ALT + QtCore.Qt.Key_A)), KAction.ShortcutTypes(KAction.ActiveShortcut | KAction.DefaultShortcut))
self.save_preview_action = self.preview_text_collection.addAction("save_preview_action")
icon = QtGui.QIcon.fromTheme(_fromUtf8("document-new"))
self.save_preview_action.setIcon(icon)
self.save_preview_action.setIconText("save preview")
self.save_preview_action.setShortcut(KShortcut(QtGui.QKeySequence(QtCore.Qt.ALT + QtCore.Qt.Key_S)), KAction.ShortcutTypes(KAction.ActiveShortcut | KAction.DefaultShortcut))
self.publish_action = self.preview_text_collection.addAction("publish_action")
icon = QtGui.QIcon.fromTheme(_fromUtf8("media-playback-start"))
self.publish_action.setIcon(icon)
self.publish_action.setIconText("publish")
self.publish_action.setShortcutConfigurable(True)
self.publish_action.setShortcut(KShortcut(QtGui.QKeySequence(QtCore.Qt.ALT + QtCore.Qt.Key_Return)), KAction.ShortcutTypes(KAction.ActiveShortcut | KAction.DefaultShortcut))
self.previous_action = self.preview_text_collection.addAction("previous_action")
icon = QtGui.QIcon.fromTheme(_fromUtf8("media-skip-backward"))
self.previous_action.setIcon(icon)
self.previous_action.setIconText("previous")
self.previous_action.setShortcut(KShortcut(QtGui.QKeySequence(QtCore.Qt.ALT + QtCore.Qt.Key_Left)), KAction.ShortcutTypes(KAction.ActiveShortcut | KAction.DefaultShortcut))
self.next_action = self.preview_text_collection.addAction("next_action")
icon = QtGui.QIcon.fromTheme(_fromUtf8("media-skip-forward"))
self.next_action.setIcon(icon)
self.next_action.setIconText("next")
self.next_action.setShortcut(KShortcut(QtGui.QKeySequence(QtCore.Qt.ALT + QtCore.Qt.Key_Right)), KAction.ShortcutTypes(KAction.ActiveShortcut | KAction.DefaultShortcut))
self.text_editor_action = KToggleAction(self.preview_text_collection)
icon = QtGui.QIcon.fromTheme(_fromUtf8("document-open"))
self.text_editor_action.setIcon(icon)
self.text_editor_action.setIconText("sort")
self.preview_text_collection.addAction("text editor", self.text_editor_action)
self.text_editor_action.setObjectName("text_editor_action")
self.text_editor_action.setShortcut(KShortcut(QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_O)), KAction.ShortcutTypes(KAction.ActiveShortcut | KAction.DefaultShortcut))
self.auto_publish_action = KToggleAction(self.preview_text_collection)
self.preview_text_collection.addAction("auto publish", self.auto_publish_action)
icon = QtGui.QIcon.fromTheme(_fromUtf8("view-refresh"))
self.auto_publish_action.setIcon(icon)
self.auto_publish_action.setObjectName("auto_publish_action")
self.auto_publish_action.setIconText("auto publish")
self.save_action = self.preview_text_collection.addAction("save_action")
icon = QtGui.QIcon.fromTheme(_fromUtf8("document-save"))
self.save_action.setIcon(icon)
self.save_action.setIconText("save")
self.save_action.setShortcut(KShortcut(QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_S)), KAction.ShortcutTypes(KAction.ActiveShortcut | KAction.DefaultShortcut))
self.streaming_action = KToggleAction(self.preview_text_collection)
icon = QtGui.QIcon.fromTheme(_fromUtf8("media-record"))
self.streaming_action.setIcon(icon)
self.streaming_action.setIconText("stream")
self.streaming_action.setObjectName("stream")
self.streaming_action.setShortcut(KShortcut(QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_1)), KAction.ShortcutTypes(KAction.ActiveShortcut | KAction.DefaultShortcut))
self.preview_text_collection.addAction("stream", self.streaming_action)
#self.valign_action = self.preview_text_collection.addAction("valign_action")
#icon = QtGui.QIcon.fromTheme(_fromUtf8("media-stop"))
#self.valign_action.setIcon(icon)
#self.valign_action.setIconText("valign")
#self.valign_action.setShortcut(KShortcut(QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_Plus)), KAction.ShortcutTypes(KAction.ActiveShortcut | KAction.DefaultShortcut))
self.spacer = KToolBarSpacerAction(self.preview_text_collection)
self.preview_text_collection.addAction("spacer", self.spacer)
self.text_combo = KSelectAction(self.preview_text_collection)
self.text_combo.setEditable(False)
icon = QtGui.QIcon.fromTheme(_fromUtf8("document-open-recent"))
self.text_combo.setIcon(icon)
self.text_combo.setIconText("saved texts")
self.text_combo.setObjectName("text_combo")
self.preview_text_collection.addAction("saved texts", self.text_combo)
def slot_auto_publish(self, state):
self.is_auto_publish = bool(state)
def slot_toggle_streaming(self):
if self.ffserver is None:
self.start_streaming()
else:
self.kill_streaming()
def kill_streaming(self):
self.is_streaming = False
if self.ffmpeg is not None:
self.ffmpeg.kill()
self.ffmpeg = None
if self.ffserver is not None:
self.ffserver.kill()
self.ffserver = None
def start_streaming(self):
public_rect = self.live_text.geometry()
global_rect = QtCore.QRect(self.mapToGlobal(public_rect.topLeft()), self.mapToGlobal(public_rect.bottomRight()))
self.ffserver = subprocess.Popen("ffserver -f /etc/ffserver.conf", shell=True, close_fds=True)
self.ffmpeg = subprocess.Popen("ffmpeg -f x11grab -s 768x576 -r 25 -i :0.0+%d,%d -vcodec mjpeg -pix_fmt yuvj422p -r 25 -aspect 4:3 http://localhost:8090/webcam.ffm" % (global_rect.x()+1, global_rect.y()+1), shell=True, close_fds=True)
self.is_streaming = True
def focusChanged(self, old, new):
if new == self.preview_text:
self.live_editor_collection.clearAssociatedWidgets()
self.preview_editor_collection.addAssociatedWidget(self.toolbar)
elif new == self.live_text:
self.preview_editor_collection.clearAssociatedWidgets()
self.live_editor_collection.addAssociatedWidget(self.toolbar)
def custom_clear(self, cursor):
cursor.beginEditBlock()
cursor.movePosition(QtGui.QTextCursor.Start);
cursor.movePosition(QtGui.QTextCursor.End, QtGui.QTextCursor.KeepAnchor);
cursor.removeSelectedText()
cursor.endEditBlock()
def get_preview_text(self, text):
return re.sub(" +", " ", text.replace("\n", " ")).strip()[:20]
def slot_next_item(self):
self.current = (self.text_combo.currentItem() + 1) % len(self.model.text_db)
self.text_combo.setCurrentItem(self.current)
self.slot_load_preview_text(self.current)
def slot_previous_item(self):
self.current = (self.text_combo.currentItem() - 1) % len(self.model.text_db)
self.text_combo.setCurrentItem(self.current)
self.slot_load_preview_text(self.current)
def slot_toggleToolbox(self, index):
if index == 0:
self.toolBar.setEnabled(True)
else:
self.toolBar.setEnabled(False)
def slot_publish(self):
self.live_text.setTextOrHtml(self.preview_text.textOrHtml())
def slot_live_font_size(self, action):
print "font_size"
self.default_size = self.live_size_action.fontSize()
self.slot_set_preview_defaults()
self.slot_set_live_defaults()
def slot_preview_font_size(self, action):
print "font_size"
self.default_size = self.preview_size_action.fontSize()
self.slot_set_live_defaults()
self.slot_set_preview_defaults()
def slot_toggle_publish(self, state=None):
if state:
self.slot_publish()
else:
self.slot_clear_live()
def slot_set_preview_defaults(self):
self.preview_center_action.setChecked(True)
self.preview_text.alignCenter()
self.font.setPointSize(self.default_size)
self.preview_text.setFontSize(self.default_size)
self.preview_text.setFont(self.font)
self.preview_size_action.setFontSize(self.default_size)
self.preview_text.document().setDefaultFont(self.font)
def slot_set_live_defaults(self):
self.live_center_action.setChecked(True)
self.live_text.alignCenter()
self.font.setPointSize(self.default_size)
self.live_text.setFontSize(self.default_size)
self.live_text.setFont(self.font)
self.live_size_action.setFontSize(self.default_size)
self.live_text.document().setDefaultFont(self.font)
def slot_clear_live(self):
self.live_text.clear()
self.slot_set_live_defaults()
def slot_clear_preview(self):
self.preview_text.clear()
self.slot_set_preview_defaults()
def fill_combo_box(self):
print "fill_combo_box"
self.text_combo.clear()
for preview, text in self.model.text_db:
self.text_combo.addAction(preview)
self.text_combo.setCurrentItem(0)
self.slot_load_preview_text(0)
def slot_removeItem(self):
text = self.edit_item_selection.currentText()
index = self.edit_item_selection.currentIndex()
title = text.split(": ")[1]
del self.items[title]
self.edit_item_selection.removeItem(index)
new_index = self.edit_item_selection.currentIndex()
if new_index != -1:
self.slot_editLoadItem()
else:
self.item_title.clear()
self.item_position_input.setValue(0)
def slot_load_preview_text(self, index):
try:
preview, text = self.model.text_db[index]
except IndexError:
return
self.preview_text.setTextOrHtml(text)
if self.is_auto_publish:
self.live_text.setTextOrHtml(text)
def slot_save_live_text(self):
text = self.live_text.toHtml()
preview = self.get_preview_text(unicode(self.live_text.toPlainText()))
if not preview:
return
old_item = self.model.text_by_preview(preview)
if old_item is not None:
suffix = 1
while 1:
tmp_preview = "%s_%d" % (preview, suffix)
tmp = self.model.text_by_preview(tmp_preview)
if tmp is None:
preview = tmp_preview
break
else:
suffix += 1
self.model.text_db.append([preview, text])
self.model.modelReset.emit()
action = self.text_combo.addAction(preview)
self.text_combo.setCurrentAction(action)
def slot_save_preview_text(self):
text = self.preview_text.toHtml()
preview = self.get_preview_text(unicode(self.preview_text.toPlainText()))
if not preview:
return
old_item = self.model.text_by_preview(preview)
if old_item is not None:
suffix = 1
while 1:
tmp_preview = "%s_%d" % (preview, suffix)
tmp = self.model.text_by_preview(tmp_preview)
if tmp is None:
preview = tmp_preview
break
else:
suffix += 1
self.model.text_db.append([preview, text])
self.model.modelReset.emit()
action = self.text_combo.addAction(preview)
self.text_combo.setCurrentAction(action)
def slot_save(self):
path = os.path.expanduser("~/.texter")
if not os.path.isdir(path):
os.mkdir(path)
try:
f = open(os.path.join(path, "texter.db"), "w")
except IOError:
return
else:
cPickle.dump(self.model.text_db, f, cPickle.HIGHEST_PROTOCOL)
#def slot_valign(self):
#fm = QtGui.QFontMetrics(self.font)
##h = fn.height()
##max_lines = 576 / h
##text = unicode(self.preview_text.toPlainText())
##text = text.strip().strip("\n")
##lines = text.count("\n") + 1
##self.preview_text.setTextOrHtml("\n" * ((max_lines - lines) / 2) + text)
##self.statusBar().showMessage("text lines = %d, line height = %d, max lines = %d" % (lines, h, max_lines))
#text_layout = QtGui.QTextLayout(self.preview_text.textOrHtml(), self.font, self.preview_text)
##self.text_combo.setCurrentAction(action)
#margin = 10.
#radius = min(self.preview_text.width()/2.0, self.preview_text.height()/2.0) - margin
#print "radius", type(radius), radius
#lineHeight = float(fm.height())
#print "lineHeight", type(lineHeight), lineHeight
#y = 0.
#text_layout.beginLayout()
#while 1:
#line = text_layout.createLine()
#if not line.isValid():
#break
#x1 = max(0.0, pow(pow(radius,2)-pow(radius-y,2), 0.5))
#x2 = max(0.0, pow(pow(radius,2)-pow(radius-(y+lineHeight),2), 0.5))
#x = max(x1, x2) + margin
#lineWidth = (self.preview_text.width() - margin) - x
#line.setLineWidth(lineWidth)
#line.setPosition(QtCore.QPointF(x, margin+y))
#y += line.height()
#text_layout.endLayout()
#painter = QtGui.QPainter()
#painter.begin(self.preview_text)
#painter.setRenderHint(QtGui.QPainter.Antialiasing)
#painter.fillRect(self.rect(), QtCore.Qt.black)
#painter.setBrush(QtGui.QBrush(QtCore.Qt.white))
#painter.setPen(QtGui.QPen(QtCore.Qt.white))
#text_layout.draw(painter, QtCore.QPoint(0,0))
#painter.setBrush(QtGui.QBrush(QtGui.QColor("#a6ce39")))
#painter.setPen(QtGui.QPen(QtCore.Qt.black))
#painter.drawEllipse(QtCore.QRectF(-radius, margin, 2*radius, 2*radius))
#painter.end()
def slot_open_dialog(self):
self.dialog = KDialog(self)
self.dialog_widget = TextSorterDialog(self.dialog)
self.dialog.setMainWidget(self.dialog_widget)
pos_x, pos_y = self.getPreviewCoords()
self.dialog.move(pos_x, 0)
rect = app.desktop().availableGeometry()
global_width = rect.width()
global_height = rect.height()
x = global_width - pos_x - 10
self.dialog.setFixedSize(x, global_height-40);
self.dialog.exec_()
self.fill_combo_box()
def slot_load(self):
path = os.path.expanduser("~/.texter")
if not os.path.isdir(path):
os.mkdir(path)
try:
f = open(os.path.join(path, "texter.db"))
except IOError:
return
try:
self.model.text_db = [list(i) for i in cPickle.load(f)]
except Exception, e:
print e
self.fill_combo_box()
self.text_combo.setCurrentItem(0)
self.slot_load_preview_text(0)
self.slot_load_preview_text(0)
def main():
window = MainWindow()
app.exec_()
if ( __name__ == '__main__' ):
main()

View File

@ -0,0 +1,81 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
from PyQt4 import QtCore, QtGui
from operator import itemgetter
class TextModel(QtCore.QAbstractTableModel):
def __init__(self, parent=None):
super(TextModel, self).__init__(parent)
self.text_db = list()
self.default_size = 32
self.font = QtGui.QFont("monospace", self.default_size)
self.font.setStyleHint(QtGui.QFont.TypeWriter)
def rowCount(self, parent=QtCore.QModelIndex()):
return len(self.text_db)
def columnCount(self, parent=QtCore.QModelIndex()):
return 2
def data(self, index, role):
if not index.isValid() or \
not 0 <= index.row() < self.rowCount():
return QVariant()
row = index.row()
column = index.column()
if role == QtCore.Qt.DisplayRole:
return self.text_db[row][column]
#return "foo bar"
return QtCore.QVariant()
def headerData(self, section, orientation=QtCore.Qt.Horizontal, role=QtCore.Qt.DisplayRole):
if orientation == QtCore.Qt.Horizontal:
if section == 0:
return "Preview"
else:
return "Text"
return QtCore.QVariant()
def setData(self, index, value, role):
if role == QtCore.Qt.EditRole:
self.text_db[index.row()][index.column()] = value.toString()
return True
def flags(self, index):
return QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEditable | QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsDragEnabled | QtCore.Qt.ItemIsDropEnabled
def supportedDropActions(self):
return QtCore.Qt.MoveAction
def insertRows(self, row, count, parent=QtCore.QModelIndex()):
self.beginInsertRows(parent, row, row+count+1)
for i in range(row, row+count):
self.text_db.insert(parent.child(i).data())
self.endInsertRows()
return True
def removeRows(self, row, count, parent=QtCore.QModelIndex()):
print "removeRows", row, count
print map(itemgetter(0), self.text_db)
self.beginRemoveRows(QtCore.QModelIndex(), row, row+count+1)
for i in range(row, row+count):
print "del", i, self.text_db[row]
self.text_db.pop(row)
print "after"
print map(itemgetter(0), self.text_db)
self.endRemoveRows()
return True
def text_by_preview(self, preview):
for title, text in self.text_db:
if title == preview:
return title, text
return None

View File

@ -0,0 +1,157 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>text_sorter_dialog</class>
<widget class="QDialog" name="text_sorter_dialog">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QListView" name="text_list">
<property name="minimumSize">
<size>
<width>0</width>
<height>576</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>576</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="KButtonGroup" name="kbuttongroup">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="KPushButton" name="remove_button">
<property name="text">
<string>Remove</string>
</property>
<property name="icon">
<iconset theme="edit-delete"/>
</property>
</widget>
</item>
<item>
<widget class="KArrowButton" name="move_up_button"/>
</item>
<item>
<widget class="KArrowButton" name="move_down_button">
<property name="arrowType" stdset="0">
<number>2</number>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="KRichTextWidget" name="text_preview"/>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KArrowButton</class>
<extends>QPushButton</extends>
<header>karrowbutton.h</header>
</customwidget>
<customwidget>
<class>KRichTextEdit</class>
<extends>KTextEdit</extends>
<header>krichtextedit.h</header>
</customwidget>
<customwidget>
<class>KButtonGroup</class>
<extends>QGroupBox</extends>
<header>kbuttongroup.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>KPushButton</class>
<extends>QPushButton</extends>
<header>kpushbutton.h</header>
</customwidget>
<customwidget>
<class>KTextEdit</class>
<extends>QTextEdit</extends>
<header>ktextedit.h</header>
</customwidget>
<customwidget>
<class>KRichTextWidget</class>
<extends>KRichTextEdit</extends>
<header>krichtextwidget.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>text_sorter_dialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>text_sorter_dialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -0,0 +1,103 @@
#!/usr/bin/env python
# coding=UTF-8
#
# Generated by pykdeuic4 from texter4.ui on Wed Apr 16 00:27:54 2014
#
# WARNING! All changes to this file will be lost.
from PyKDE4 import kdecore
from PyKDE4 import kdeui
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
class Ui_TextSorterDialog(object):
def setupUi(self, TextSorterDialog):
TextSorterDialog.setObjectName(_fromUtf8("TextSorterDialog"))
TextSorterDialog.resize(662, 716)
self.verticalLayout = QtGui.QVBoxLayout(TextSorterDialog)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.horizontalLayout_2 = QtGui.QHBoxLayout()
self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
self.text_list = QtGui.QListView(TextSorterDialog)
self.text_list.setMinimumSize(QtCore.QSize(0, 576))
self.text_list.setMaximumSize(QtCore.QSize(16777215, 576))
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(128, 125, 123))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
self.text_list.setPalette(palette)
self.text_list.setObjectName(_fromUtf8("text_list"))
self.horizontalLayout_2.addWidget(self.text_list)
self.text_preview = KRichTextWidget(TextSorterDialog)
self.text_preview.setMinimumSize(QtCore.QSize(0, 576))
self.text_preview.setMaximumSize(QtCore.QSize(16777215, 576))
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
self.text_preview.setPalette(palette)
self.text_preview.setReadOnly(True)
self.text_preview.setObjectName(_fromUtf8("text_preview"))
self.horizontalLayout_2.addWidget(self.text_preview)
self.verticalLayout.addLayout(self.horizontalLayout_2)
self.kbuttongroup = KButtonGroup(TextSorterDialog)
self.kbuttongroup.setObjectName(_fromUtf8("kbuttongroup"))
self.horizontalLayout = QtGui.QHBoxLayout(self.kbuttongroup)
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
self.move_down_button = KArrowButton(self.kbuttongroup)
self.move_down_button.setProperty("arrowType", 2)
self.move_down_button.setObjectName(_fromUtf8("move_down_button"))
self.horizontalLayout.addWidget(self.move_down_button)
self.move_up_button = KArrowButton(self.kbuttongroup)
self.move_up_button.setObjectName(_fromUtf8("move_up_button"))
self.horizontalLayout.addWidget(self.move_up_button)
self.remove_button = KPushButton(self.kbuttongroup)
icon = QtGui.QIcon.fromTheme(_fromUtf8("edit-delete"))
self.remove_button.setIcon(icon)
self.remove_button.setObjectName(_fromUtf8("remove_button"))
self.horizontalLayout.addWidget(self.remove_button)
self.verticalLayout.addWidget(self.kbuttongroup)
spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem)
self.retranslateUi(TextSorterDialog)
QtCore.QMetaObject.connectSlotsByName(TextSorterDialog)
def retranslateUi(self, TextSorterDialog):
TextSorterDialog.setWindowTitle(kdecore.i18n(_fromUtf8("Form")))
self.remove_button.setText(kdecore.i18n(_fromUtf8("Remove")))
from PyKDE4.kdeui import KButtonGroup, KArrowButton, KPushButton, KRichTextWidget

19
texter/texter/texter.desktop Executable file
View File

@ -0,0 +1,19 @@
[Desktop Entry]
Comment[de]=
Comment=
Exec=texter
GenericName[de]=Live Text Streaming
GenericName=Live Text Streaming
Icon=texter_icon
MimeType=
Name[de]=texter
Name=texter
Path=/usr/bin/texter
StartupNotify=true
Type=Application
Categories=AudioVideo;Recorder;
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-KDE-SubstituteUID=false
X-KDE-Username=
Keywords=Capture;Broadcast;

5
texter/texter/texter.qrc Normal file
View File

@ -0,0 +1,5 @@
<RCC>
<qresource prefix="texter">
<file>icon.png</file>
</qresource>
</RCC>

920
texter/texter/texter.ui Normal file
View File

@ -0,0 +1,920 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1207</width>
<height>634</height>
</rect>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="windowTitle">
<string>4.48 Texter</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>&amp;Title</string>
</property>
<property name="buddy">
<cstring>item_title</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="item_title">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>P&amp;osition</string>
</property>
<property name="buddy">
<cstring>item_position_input</cstring>
</property>
</widget>
</item>
<item>
<widget class="KIntNumInput" name="item_position_input">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>S&amp;election</string>
</property>
<property name="buddy">
<cstring>edit_item_selection</cstring>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="edit_item_selection">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="add_button">
<property name="text">
<string>&amp;Add / Change</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="remove_item_button">
<property name="text">
<string>&amp;Remove</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="save_button">
<property name="text">
<string>Sa&amp;ve</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="publish_button">
<property name="text">
<string>&amp;Publish</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="clear_live_button">
<property name="text">
<string>Clear Live</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="clear_preview_button">
<property name="text">
<string>Clear Preview</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="previous_button">
<property name="text">
<string>Previous</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="next_button">
<property name="text">
<string>Next</string>
</property>
<property name="shortcut">
<string comment=" "/>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="auto_publish_checkbox">
<property name="text">
<string>A&amp;uto Publish</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="KRichTextWidget" name="live_text">
<property name="minimumSize">
<size>
<width>768</width>
<height>576</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>768</width>
<height>576</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>128</red>
<green>125</green>
<blue>123</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>128</red>
<green>125</green>
<blue>123</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<family>Monospace</family>
<pointsize>22</pointsize>
</font>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="acceptRichText">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextEditable|Qt::TextEditorInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>
<widget class="KRichTextWidget" name="preview_text">
<property name="minimumSize">
<size>
<width>400</width>
<height>576</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>768</width>
<height>576</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>128</red>
<green>125</green>
<blue>123</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>128</red>
<green>125</green>
<blue>123</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<family>Monospace</family>
<pointsize>22</pointsize>
</font>
</property>
<property name="contextMenuPolicy">
<enum>Qt::ActionsContextMenu</enum>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="acceptRichText">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextEditable|Qt::TextEditorInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<customwidgets>
<customwidget>
<class>KRichTextEdit</class>
<extends>KTextEdit</extends>
<header>krichtextedit.h</header>
</customwidget>
<customwidget>
<class>KTextEdit</class>
<extends>QTextEdit</extends>
<header>ktextedit.h</header>
</customwidget>
<customwidget>
<class>KRichTextWidget</class>
<extends>KRichTextEdit</extends>
<header>krichtextwidget.h</header>
</customwidget>
<customwidget>
<class>KIntNumInput</class>
<extends>QWidget</extends>
<header>knuminput.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>item_title</tabstop>
<tabstop>item_position_input</tabstop>
<tabstop>remove_item_button</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

395
texter/texter/texter2.ui Normal file
View File

@ -0,0 +1,395 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1554</width>
<height>617</height>
</rect>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>169</red>
<green>167</green>
<blue>167</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>244</red>
<green>244</green>
<blue>244</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="windowTitle">
<string>4.48 Texter</string>
</property>
<property name="windowIcon">
<iconset resource="texter.qrc">
<normaloff>:/texter/icon.png</normaloff>:/texter/icon.png</iconset>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="KRichTextWidget" name="live_text">
<property name="minimumSize">
<size>
<width>768</width>
<height>576</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>768</width>
<height>576</height>
</size>
</property>
<property name="font">
<font>
<family>Monospace</family>
<pointsize>22</pointsize>
</font>
</property>
<property name="cursor" stdset="0">
<cursorShape>BlankCursor</cursorShape>
</property>
<property name="toolTip">
<string/>
</property>
<property name="statusTip">
<string/>
</property>
<property name="whatsThis">
<string/>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="acceptRichText">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextEditable|Qt::TextEditorInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="KPushButton" name="clear_live_button">
<property name="toolTip">
<string>clear live text [F1]</string>
</property>
<property name="icon">
<iconset theme="edit-clear">
<normaloff/>
</iconset>
</property>
<property name="shortcut">
<string>F1</string>
</property>
</widget>
</item>
<item>
<widget class="KPushButton" name="live_save_button">
<property name="toolTip">
<string>save live text [F2]</string>
</property>
<property name="icon">
<iconset theme="document-save">
<normaloff/>
</iconset>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="KPushButton" name="streaming_button">
<property name="toolTip">
<string>starts/stops live textfield streaming [F9]</string>
</property>
<property name="icon">
<iconset theme="media-record"/>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="KRichTextWidget" name="preview_text">
<property name="minimumSize">
<size>
<width>400</width>
<height>576</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>768</width>
<height>576</height>
</size>
</property>
<property name="font">
<font>
<family>Monospace</family>
<pointsize>22</pointsize>
</font>
</property>
<property name="contextMenuPolicy">
<enum>Qt::ActionsContextMenu</enum>
</property>
<property name="toolTip">
<string>preview text</string>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="acceptRichText">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextEditable|Qt::TextEditorInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="KPushButton" name="clear_preview_button">
<property name="toolTip">
<string>clear preview text [F4]</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="whatsThis">
<string/>
</property>
<property name="icon">
<iconset theme="edit-clear">
<normaloff/>
</iconset>
</property>
<property name="shortcut">
<string>F2</string>
</property>
</widget>
</item>
<item>
<widget class="KPushButton" name="preview_save_button">
<property name="icon">
<iconset theme="document-save">
<normaloff/>
</iconset>
</property>
</widget>
</item>
<item>
<widget class="KPushButton" name="publish_button">
<property name="cursor">
<cursorShape>ArrowCursor</cursorShape>
</property>
<property name="toolTip">
<string>go live with text [F5]</string>
</property>
<property name="icon">
<iconset theme="media-playback-start">
<normaloff/>
</iconset>
</property>
<property name="shortcut">
<string>F4</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="KPushButton" name="previous_button">
<property name="toolTip">
<string>load previous text [F6]</string>
</property>
<property name="icon">
<iconset theme="media-skip-backward">
<normaloff/>
</iconset>
</property>
</widget>
</item>
<item>
<widget class="KPushButton" name="next_button">
<property name="toolTip">
<string>load next text [F7]</string>
</property>
<property name="icon">
<iconset theme="media-skip-forward">
<normaloff/>
</iconset>
</property>
</widget>
</item>
<item>
<widget class="KComboBox" name="text_combo">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="KPushButton" name="text_open_button">
<property name="toolTip">
<string>edit sorting of saved texts [F10]</string>
</property>
<property name="icon">
<iconset theme="document-open">
<normaloff/>
</iconset>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
<customwidgets>
<customwidget>
<class>KRichTextEdit</class>
<extends>KTextEdit</extends>
<header>krichtextedit.h</header>
</customwidget>
<customwidget>
<class>KComboBox</class>
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
<customwidget>
<class>KPushButton</class>
<extends>QPushButton</extends>
<header>kpushbutton.h</header>
</customwidget>
<customwidget>
<class>KTextEdit</class>
<extends>QTextEdit</extends>
<header>ktextedit.h</header>
</customwidget>
<customwidget>
<class>KRichTextWidget</class>
<extends>KRichTextEdit</extends>
<header>krichtextwidget.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>live_text</tabstop>
<tabstop>preview_text</tabstop>
<tabstop>clear_preview_button</tabstop>
<tabstop>clear_live_button</tabstop>
</tabstops>
<resources>
<include location="texter.qrc"/>
</resources>
<connections/>
</ui>

409
texter/texter/texter3.ui Normal file
View File

@ -0,0 +1,409 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1475</width>
<height>651</height>
</rect>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>169</red>
<green>167</green>
<blue>167</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>244</red>
<green>244</green>
<blue>244</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="windowTitle">
<string>4.48 Texter</string>
</property>
<property name="windowIcon">
<iconset resource="texter.qrc">
<normaloff>:/texter/icon.png</normaloff>:/texter/icon.png</iconset>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="KRichTextWidget" name="live_text">
<property name="minimumSize">
<size>
<width>775</width>
<height>578</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>775</width>
<height>578</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Highlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Link">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Highlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Link">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Highlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Link">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="cursor" stdset="0">
<cursorShape>BlankCursor</cursorShape>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="acceptRichText">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextEditable|Qt::TextEditorInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
<property name="richTextSupport">
<set>KRichTextWidget::SupportAlignment|KRichTextWidget::SupportChangeListStyle|KRichTextWidget::SupportFontFamily|KRichTextWidget::SupportFontSize|KRichTextWidget::SupportIndentLists|KRichTextWidget::SupportTextForegroundColor</set>
</property>
</widget>
</item>
<item>
<widget class="KRichTextWidget" name="preview_text">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>10</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>300</width>
<height>577</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>769</width>
<height>577</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="contextMenuPolicy">
<enum>Qt::ActionsContextMenu</enum>
</property>
<property name="toolTip">
<string>preview text</string>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="acceptRichText">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextEditable|Qt::TextEditorInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
<property name="richTextSupport">
<set>KRichTextWidget::SupportAlignment|KRichTextWidget::SupportChangeListStyle|KRichTextWidget::SupportFontFamily|KRichTextWidget::SupportFontSize|KRichTextWidget::SupportTextForegroundColor</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
<customwidgets>
<customwidget>
<class>KRichTextEdit</class>
<extends>KTextEdit</extends>
<header>krichtextedit.h</header>
</customwidget>
<customwidget>
<class>KTextEdit</class>
<extends>QTextEdit</extends>
<header>ktextedit.h</header>
</customwidget>
<customwidget>
<class>KRichTextWidget</class>
<extends>KRichTextEdit</extends>
<header>krichtextwidget.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>live_text</tabstop>
<tabstop>preview_text</tabstop>
</tabstops>
<resources>
<include location="texter.qrc"/>
</resources>
<connections/>
</ui>

234
texter/texter/texter4.ui Normal file
View File

@ -0,0 +1,234 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>TextSorterDialog</class>
<widget class="QWidget" name="TextSorterDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>662</width>
<height>716</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QListView" name="text_list">
<property name="minimumSize">
<size>
<width>0</width>
<height>576</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>576</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>128</red>
<green>125</green>
<blue>123</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
</widget>
</item>
<item>
<widget class="KRichTextWidget" name="text_preview">
<property name="minimumSize">
<size>
<width>0</width>
<height>576</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>576</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="KButtonGroup" name="kbuttongroup">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="KArrowButton" name="move_down_button">
<property name="arrowType" stdset="0">
<number>2</number>
</property>
</widget>
</item>
<item>
<widget class="KArrowButton" name="move_up_button"/>
</item>
<item>
<widget class="KPushButton" name="remove_button">
<property name="text">
<string>Remove</string>
</property>
<property name="icon">
<iconset theme="edit-delete">
<normaloff>../../../../</normaloff>../../../../</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KArrowButton</class>
<extends>QPushButton</extends>
<header>karrowbutton.h</header>
</customwidget>
<customwidget>
<class>KRichTextEdit</class>
<extends>KTextEdit</extends>
<header>krichtextedit.h</header>
</customwidget>
<customwidget>
<class>KButtonGroup</class>
<extends>QGroupBox</extends>
<header>kbuttongroup.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>KPushButton</class>
<extends>QPushButton</extends>
<header>kpushbutton.h</header>
</customwidget>
<customwidget>
<class>KTextEdit</class>
<extends>QTextEdit</extends>
<header>ktextedit.h</header>
</customwidget>
<customwidget>
<class>KRichTextWidget</class>
<extends>KRichTextEdit</extends>
<header>krichtextwidget.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,75 @@
# -*- coding: utf-8 -*-
# Resource object code
#
# Created: Sa. Apr 12 08:49:54 2014
# by: The Resource Compiler for PyQt (Qt v4.8.5)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x02\x2c\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x20\x00\x00\x00\x20\x08\x06\x00\x00\x00\x73\x7a\x7a\xf4\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\x0d\xd7\
\x01\x42\x28\x9b\x78\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x01\xa9\x49\x44\
\x41\x54\x58\x85\xed\xd5\x4f\x88\xcd\x51\x14\xc0\xf1\xcf\x11\x13\
\x8a\x86\xb2\x65\x61\xc1\x42\xc9\x8a\x27\x1b\x1b\xb1\xb0\x92\x62\
\x27\x35\x3b\x59\xd8\x68\x1a\x29\x4b\x89\xa4\x69\xca\x5a\x59\x21\
\x93\x85\x89\x85\x48\x42\xcd\x42\x16\x4a\x9a\xa2\xc8\x66\x9a\x86\
\x31\x91\x3f\xc7\xe2\xfd\xde\x73\xc7\xbc\xc9\xcc\x2c\xbc\x59\xfc\
\x4e\x9d\x7e\x9d\x73\xef\x39\xf7\x7b\xce\x3d\xb7\x5f\x64\xa6\x6e\
\xca\xb2\xae\x9e\x5e\x03\xd4\x00\x35\x40\x0d\xb0\x24\x01\x22\xa2\
\x11\x11\x23\x11\xb1\x6f\x31\x09\x23\x62\xa0\x8a\x5f\x5e\xf8\x36\
\x44\x44\x7f\x44\x3c\x8f\x88\x5b\x11\x71\xa4\x1d\x90\x99\x6d\x45\
\x0f\x9e\xe1\x33\x8e\x97\x6b\xf3\x51\x34\xf0\x1e\x89\x9e\xc2\x3f\
\x88\xc7\xd8\x89\x43\x98\x42\x23\x33\x67\x01\x9c\x45\x7f\x95\x64\
\x41\x00\x58\x81\x51\xf4\x75\x00\x18\xc7\xd1\xc2\xbe\x8d\xa1\xcc\
\xfc\x73\x05\x11\xb1\x15\x87\x71\x71\x31\xad\xc7\x69\x8c\xe0\x4d\
\x87\xb5\x51\xec\xaa\xce\x59\x85\xed\x78\xda\xbe\x02\x04\x1e\xe1\
\x40\x65\x2f\xa8\x03\xd8\x82\xd7\x58\x8d\xbd\x1d\x3a\xb0\x1e\xf7\
\x30\x86\x4f\x38\x89\xc8\x4c\xad\x41\xe9\xc3\x44\x66\xde\x5d\x68\
\xd9\x11\x11\xb8\x8a\x81\xcc\x9c\x6e\x9a\xb3\xe4\x14\x7a\x71\x0e\
\x9b\x70\x02\x2f\xf1\xa0\x45\x38\x86\x9b\xb8\x5c\xe9\x14\xee\xe3\
\xd8\x3c\xaa\xdf\x8d\x2f\x45\xec\x8d\xaa\x03\x57\xb0\x0d\x6b\xf0\
\x0d\x7b\x8a\x98\x21\x0c\x97\x1d\x18\xc4\xda\x82\xf8\x17\xa6\xab\
\xc4\x65\xb5\x1b\xb1\x2e\x33\x5f\x14\xee\x0f\xb8\x50\xd8\xbd\xd5\
\x77\x12\xdf\xb1\x59\xf3\x75\x4d\x16\x7b\xc6\x35\xaf\xca\x5c\x55\
\x75\x9c\x01\x5c\xc3\x8f\x7f\x74\x64\xc6\x0c\x60\x25\xde\xe2\x0e\
\x76\xe0\x20\xde\xe1\xd2\x8c\x57\xf0\x97\x3c\xc1\xc7\x0e\xfe\x57\
\x78\x38\x47\x4c\x4b\x26\xaa\x3d\x59\x15\xf8\x15\xfb\xf1\x13\xc3\
\x38\x8f\xeb\x38\x43\x35\x89\xdd\x94\xa5\xf7\x2f\xa8\x01\x6a\x80\
\x1a\xa0\x06\xf8\xdf\xf2\x1b\xf1\xb2\x57\x16\x4f\x60\xf0\x28\x00\
\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
"
qt_resource_name = "\
\x00\x06\
\x07\xac\xfa\xc2\
\x00\x74\
\x00\x65\x00\x78\x00\x74\x00\x65\x00\x72\
\x00\x08\
\x0a\x61\x5a\xa7\
\x00\x69\
\x00\x63\x00\x6f\x00\x6e\x00\x2e\x00\x70\x00\x6e\x00\x67\
"
qt_resource_struct = "\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\
\x00\x00\x00\x12\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
"
def qInitResources():
QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
def qCleanupResources():
QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
qInitResources()

161
texter/texter/texter_ui.py Normal file
View File

@ -0,0 +1,161 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'texter3.ui'
#
# Created: Wed Apr 16 20:48:51 2014
# by: PyQt4 UI code generator 4.10.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(1475, 651)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(169, 167, 167))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(244, 244, 244))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
MainWindow.setPalette(palette)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/texter/icon.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
MainWindow.setWindowIcon(icon)
self.centralwidget = QtGui.QWidget(MainWindow)
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
self.verticalLayout = QtGui.QVBoxLayout(self.centralwidget)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
self.live_text = KRichTextWidget(self.centralwidget)
self.live_text.setMinimumSize(QtCore.QSize(772,580))
self.live_text.setMaximumSize(QtCore.QSize(772,580))
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Highlight, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Link, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Highlight, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Link, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Highlight, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Link, brush)
self.live_text.setPalette(palette)
self.live_text.viewport().setProperty("cursor", QtGui.QCursor(QtCore.Qt.BlankCursor))
self.live_text.setAutoFillBackground(True)
self.live_text.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.live_text.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.live_text.setAcceptRichText(True)
self.live_text.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByKeyboard|QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextBrowserInteraction|QtCore.Qt.TextEditable|QtCore.Qt.TextEditorInteraction|QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse)
self.live_text.setRichTextSupport(KRichTextWidget.RichTextSupportValues(KRichTextWidget.SupportAlignment|KRichTextWidget.SupportChangeListStyle|KRichTextWidget.SupportFontFamily|KRichTextWidget.SupportFontSize|KRichTextWidget.SupportTextForegroundColor))
self.live_text.setObjectName(_fromUtf8("live_text"))
self.horizontalLayout.addWidget(self.live_text)
self.preview_text = KRichTextWidget(self.centralwidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(10)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.preview_text.sizePolicy().hasHeightForWidth())
self.preview_text.setSizePolicy(sizePolicy)
self.preview_text.setMinimumSize(QtCore.QSize(300, 577))
self.preview_text.setMaximumSize(QtCore.QSize(772,580))
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush)
self.preview_text.setPalette(palette)
self.preview_text.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
self.preview_text.setAutoFillBackground(True)
self.preview_text.setFrameShape(QtGui.QFrame.StyledPanel)
self.preview_text.setAcceptRichText(True)
self.preview_text.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByKeyboard|QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextBrowserInteraction|QtCore.Qt.TextEditable|QtCore.Qt.TextEditorInteraction|QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse)
self.preview_text.setRichTextSupport(KRichTextWidget.RichTextSupportValues(KRichTextWidget.SupportAlignment|KRichTextWidget.SupportChangeListStyle|KRichTextWidget.SupportFontFamily|KRichTextWidget.SupportFontSize|KRichTextWidget.SupportTextForegroundColor))
self.preview_text.setObjectName(_fromUtf8("preview_text"))
self.horizontalLayout.addWidget(self.preview_text)
spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.verticalLayout.addLayout(self.horizontalLayout)
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem1)
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
MainWindow.setTabOrder(self.live_text, self.preview_text)
def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(_translate("MainWindow", "4.48 Texter", None))
self.preview_text.setToolTip(_translate("MainWindow", "preview text", None))
from PyKDE4.kdeui import KRichTextWidget
import texter_rc