From 2b78252fc378b99545149ded7ddc9df2b4701fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20K=C3=B6gl?= Date: Thu, 17 Apr 2014 01:43:34 +0200 Subject: [PATCH] new version --- texter/texter/main.py | 6 +- texter/texter/texter3.ui | 136 +++++++++++++++++++++++++++++++++++-- texter/texter/texter_ui.py | 69 +++++++++++++++---- 3 files changed, 188 insertions(+), 23 deletions(-) diff --git a/texter/texter/main.py b/texter/texter/main.py index 4b9411f..837bde2 100644 --- a/texter/texter/main.py +++ b/texter/texter/main.py @@ -119,7 +119,7 @@ class MainWindow(KMainWindow, Ui_MainWindow): self.preview_font_action = None self.live_font_action = None self.preview_size_action = None - self.default_size = 48 + self.default_size = 28 self.default_align_text = "format_align_center" self.preview_actions = list() self.live_actions = list() @@ -378,8 +378,8 @@ class MainWindow(KMainWindow, Ui_MainWindow): 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("/usr/bin/ffserver -f /etc/ffserver.conf", shell=True, close_fds=True) - self.ffmpeg = subprocess.Popen("/usr/bin/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(), global_rect.y()), shell=True, close_fds=True) + 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): diff --git a/texter/texter/texter3.ui b/texter/texter/texter3.ui index 5318dac..bb7834f 100644 --- a/texter/texter/texter3.ui +++ b/texter/texter/texter3.ui @@ -89,19 +89,37 @@ - 769 - 577 + 775 + 578 - 769 - 577 + 775 + 578 + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + @@ -122,6 +140,24 @@ + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + @@ -142,6 +178,24 @@ + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + @@ -167,7 +221,13 @@ BlankCursor - false + true + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff true @@ -200,6 +260,70 @@ 577 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + Qt::ActionsContextMenu @@ -207,7 +331,7 @@ preview text - false + true QFrame::StyledPanel diff --git a/texter/texter/texter_ui.py b/texter/texter/texter_ui.py index c6c0bac..730e3c3 100644 --- a/texter/texter/texter_ui.py +++ b/texter/texter/texter_ui.py @@ -1,11 +1,12 @@ -#!/usr/bin/env python -# coding=UTF-8 +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'texter3.ui' # -# Generated by pykdeuic4 from texter3.ui on Wed Apr 16 00:07:33 2014 +# Created: Wed Apr 16 20:48:51 2014 +# by: PyQt4 UI code generator 4.10.3 # -# WARNING! All changes to this file will be lost. -from PyKDE4 import kdecore -from PyKDE4 import kdeui +# WARNING! All changes made in this file will be lost! + from PyQt4 import QtCore, QtGui try: @@ -56,30 +57,50 @@ class Ui_MainWindow(object): self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) self.live_text = KRichTextWidget(self.centralwidget) - self.live_text.setMinimumSize(QtCore.QSize(769, 577)) - self.live_text.setMaximumSize(QtCore.QSize(769, 577)) + 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(False) + 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)) @@ -92,9 +113,29 @@ class Ui_MainWindow(object): 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(769, 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(False) + 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) @@ -113,8 +154,8 @@ class Ui_MainWindow(object): MainWindow.setTabOrder(self.live_text, self.preview_text) def retranslateUi(self, MainWindow): - MainWindow.setWindowTitle(kdecore.i18n(_fromUtf8("4.48 Texter"))) - self.preview_text.setToolTip(kdecore.i18n(_fromUtf8("preview text"))) + MainWindow.setWindowTitle(_translate("MainWindow", "4.48 Texter", None)) + self.preview_text.setToolTip(_translate("MainWindow", "preview text", None)) from PyKDE4.kdeui import KRichTextWidget -import texter +import texter_rc