diff --git a/texter/texter/build.sh b/texter/texter/build.sh
new file mode 100644
index 0000000..8bd8f91
--- /dev/null
+++ b/texter/texter/build.sh
@@ -0,0 +1,2 @@
+pyuic4 -o texter_ui.py texter2.ui
+pyuic4 -o text_sorter_ui.py text_sorter.ui
diff --git a/texter/texter/main.py b/texter/texter/main.py
index 109f3a6..0699560 100644
--- a/texter/texter/main.py
+++ b/texter/texter/main.py
@@ -8,13 +8,53 @@ from PyQt4 import QtCore, QtGui
from PyKDE4.kdeui import KActionCollection, KRichTextWidget
from texter_ui import Ui_MainWindow
-
+from text_sorter_ui import Ui_text_sorter_dialog
from operator import itemgetter
import cPickle
app = QtGui.QApplication([])
+
+class TextSorterDialog(QtGui.QDialog, Ui_text_sorter_dialog):
+ def __init__(self, parent = None):
+ super(TextSorterDialog, self).__init__(parent)
+
+ # setup the ui
+ self.setupUi(self)
+ self.fill_list()
+
+ self.text_list.listView().clicked.connect(self.slot_show_text)
+ self.accepted.connect(self.slot_saveToDb)
+
+ def fill_list(self):
+ for preview, text in self.parent().text_db:
+ self.text_list.insertItem(preview)
+
+ def slot_text_up(self):
+ pass
+
+ def slot_text_down(self):
+ pass
+
+ def slot_show_text(self, model_index):
+ self.text_preview.setTextOrHtml(self.parent().text_db[model_index.row()][1])
+
+ def slot_saveToDb(self):
+ data = list()
+ def findInDb(title):
+ for preview, text in self.parent().text_db:
+ if title == preview:
+ return text
+ return None
+
+ for i in self.text_list.items():
+ text = findInDb(i)
+ data.append((i, text))
+ self.parent().text_db = data
+ print self.parent().text_db
+
+
class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
def __init__(self, parent = None):
super(MainWindow, self).__init__(parent)
@@ -53,6 +93,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self.show()
self.is_published = False
+ self.current = 0
#self.add_button.clicked.connect(self.slot_addText)
#self.save_button.clicked.connect(self.slot_save)
@@ -63,15 +104,18 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
#self.edit_item_selection.activated.connect(self.slot_editLoadItem)
#self.auto_publish_checkbox.clicked.connect(self.slot_publish)
app.focusChanged.connect(self.focusChanged)
+ self.text_open_button.clicked.connect(self.slot_open_dialog)
+ self.live_save_button.clicked.connect(self.slot_save_live)
+ self.preview_save_button.clicked.connect(self.slot_save_preview)
- self.items = dict()
+ self.text_db = list()
#self.slot_load()
- #self.next_button.setShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Space))
- #self.next_button.clicked.connect(self.slot_next_item)
+ 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)
+ self.previous_button.setShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Backspace))
+ self.previous_button.clicked.connect(self.slot_previous_item)
public_rect = self.live_text.geometry()
global_rect = QtCore.QRect(self.mapToGlobal(public_rect.topLeft()), self.mapToGlobal(public_rect.bottomRight()))
self.statusBar().showMessage("geometry to cast: %d, %d, %d, %d" % (global_rect.x(), global_rect.y(), global_rect.width(), global_rect.height()))
@@ -111,20 +155,17 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
def slot_next_item(self):
print "slot_next_item"
#print "current_title", self.current_title, self.current_text
- #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)
+ self.current = (self.current + 1) % len(self.text_db)
+ self.preview_text.setTextOrHtml(self.text_db[self.current][1])
+ print "current", self.current
def slot_previous_item(self):
print "slot_previous_item"
- ##print "current_title", self.current_title, self.current_text
- #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)
+ #print "current_title", self.current_title, self.current_text
+ self.current = (self.current - 1) % len(self.text_db)
+ self.preview_text.setTextOrHtml(self.text_db[self.current][1])
+
+ print "current", self.current
def slot_toggleToolbox(self, index):
print "slot_toggleToolbox"
@@ -216,24 +257,27 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self.item_title.setText(new_title)
self.edit_item_selection.setItemText(index, "%d: %s" % (index, new_title))
-
- def slot_addText(self):
- print "slot add"
- index = self.item_position_input.value()
-
- old_title = self.title_by_index(index)
- if old_title is not None:
- self.slot_changeItem(old_title)
- return
-
- title = self.item_title.text()
+ def slot_save_live(self):
+ print "slot save live text"
+ text = self.live_text.toHtml()
+ preview = self.live_text.toPlainText()[:10]
+ print "represent", preview
+ self.text_db.append((preview, text))
+
+ def slot_save_preview(self):
+ print "slot save live text"
text = self.preview_text.toHtml()
- self.items[title] = (text, index)
- self.edit_item_selection.insertItem(index, "%d: %s" % (index, title))
- self.edit_item_selection.setCurrentIndex(index)
+ preview = self.preview_text.toPlainText()[:10]
+ print "represent", preview
+ self.text_db.append((preview, text))
def slot_save(self):
cPickle.dump(self.items, open("448_texter.db", "w"), cPickle.HIGHEST_PROTOCOL)
+
+ def slot_open_dialog(self):
+ self.dialog = TextSorterDialog(self)
+ print "modal", self.dialog.isModal()
+ self.dialog.open()
def slot_load(self):
try:
diff --git a/texter/texter/text_sorter.ui b/texter/texter/text_sorter.ui
new file mode 100644
index 0000000..fd34eea
--- /dev/null
+++ b/texter/texter/text_sorter.ui
@@ -0,0 +1,96 @@
+
+
+ text_sorter_dialog
+
+
+
+ 0
+ 0
+ 612
+ 280
+
+
+
+ Dialog
+
+
+ -
+
+
-
+
+
+ -
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QDialogButtonBox::Cancel|QDialogButtonBox::Ok
+
+
+
+
+
+
+
+ KEditListWidget
+ QWidget
+
+
+
+ KRichTextEdit
+ KTextEdit
+
+
+
+ KTextEdit
+ QTextEdit
+
+
+
+ KRichTextWidget
+ KRichTextEdit
+
+
+
+
+
+
+ buttonBox
+ accepted()
+ text_sorter_dialog
+ accept()
+
+
+ 248
+ 254
+
+
+ 157
+ 274
+
+
+
+
+ buttonBox
+ rejected()
+ text_sorter_dialog
+ reject()
+
+
+ 316
+ 260
+
+
+ 286
+ 274
+
+
+
+
+
diff --git a/texter/texter/text_sorter_ui.py b/texter/texter/text_sorter_ui.py
new file mode 100644
index 0000000..ff3790d
--- /dev/null
+++ b/texter/texter/text_sorter_ui.py
@@ -0,0 +1,55 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'text_sorter.ui'
+#
+# Created: Sat Apr 12 14:47:10 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_text_sorter_dialog(object):
+ def setupUi(self, text_sorter_dialog):
+ text_sorter_dialog.setObjectName(_fromUtf8("text_sorter_dialog"))
+ text_sorter_dialog.resize(612, 280)
+ self.verticalLayout = QtGui.QVBoxLayout(text_sorter_dialog)
+ self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
+ self.horizontalLayout = QtGui.QHBoxLayout()
+ self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
+ self.text_list = KEditListWidget(text_sorter_dialog)
+ self.text_list.setObjectName(_fromUtf8("text_list"))
+ self.horizontalLayout.addWidget(self.text_list)
+ self.text_preview = KRichTextWidget(text_sorter_dialog)
+ self.text_preview.setObjectName(_fromUtf8("text_preview"))
+ self.horizontalLayout.addWidget(self.text_preview)
+ self.verticalLayout.addLayout(self.horizontalLayout)
+ self.buttonBox = QtGui.QDialogButtonBox(text_sorter_dialog)
+ self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
+ self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
+ self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
+ self.verticalLayout.addWidget(self.buttonBox)
+
+ self.retranslateUi(text_sorter_dialog)
+ QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), text_sorter_dialog.accept)
+ QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), text_sorter_dialog.reject)
+ QtCore.QMetaObject.connectSlotsByName(text_sorter_dialog)
+
+ def retranslateUi(self, text_sorter_dialog):
+ text_sorter_dialog.setWindowTitle(_translate("text_sorter_dialog", "Dialog", None))
+
+from PyKDE4.kdeui import KEditListWidget, KRichTextWidget
diff --git a/texter/texter/texter2.ui b/texter/texter/texter2.ui
index cd81024..b177683 100644
--- a/texter/texter/texter2.ui
+++ b/texter/texter/texter2.ui
@@ -7,66 +7,12 @@
0
0
1554
- 636
+ 658
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 0
- 0
- 255
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
@@ -76,70 +22,7 @@
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
- 0
- 0
- 255
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 255
- 255
- 220
-
-
-
-
0
@@ -150,60 +33,6 @@
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 0
- 0
- 255
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
@@ -213,70 +42,7 @@
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
- 0
- 0
- 255
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 255
- 255
- 220
-
-
-
-
0
@@ -287,138 +53,21 @@
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 0
- 0
- 255
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 0
- 0
- 0
+ 169
+ 167
+ 167
- 0
- 0
- 0
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
-
- 255
- 255
- 220
-
-
-
-
-
-
- 0
- 0
- 0
+ 244
+ 244
+ 244
@@ -484,13 +133,29 @@
clear live text
-
+
+
+
F1
+ -
+
+
+
+
+
+
+ -
+
+
+ background
+
+
+
-
@@ -564,7 +229,9 @@
whatsthis2
-
+
+
+
F2
@@ -577,13 +244,57 @@
go live with text
-
+
+
+
F4
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ -
+
+
+ background
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
-
@@ -611,6 +322,11 @@
KTextEdit
+
+ KColorButton
+ QPushButton
+
+
KPushButton
QPushButton
diff --git a/texter/texter/texter_ui.py b/texter/texter/texter_ui.py
index 1d83afe..ec9116f 100644
--- a/texter/texter/texter_ui.py
+++ b/texter/texter/texter_ui.py
@@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'texter2.ui'
#
-# Created: Sat Apr 12 09:29:22 2014
+# Created: Sat Apr 12 14:47:10 2014
# by: PyQt4 UI code generator 4.10.3
#
# WARNING! All changes made in this file will be lost!
@@ -26,143 +26,26 @@ except AttributeError:
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
- MainWindow.resize(1554, 636)
+ MainWindow.resize(1554, 658)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 255))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush)
- 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(255, 255, 255))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush)
- brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 255))
+ 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.Shadow, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush)
- brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush)
- brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 255))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, 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(255, 255, 255))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush)
- brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 255))
+ 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.Shadow, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush)
- brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 255))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
+ 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(255, 255, 255))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
+ brush = QtGui.QBrush(QtGui.QColor(244, 244, 244))
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.Shadow, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush)
- brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush)
- brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush)
MainWindow.setPalette(palette)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/texter/icon.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
@@ -194,6 +77,14 @@ class Ui_MainWindow(object):
self.clear_live_button.setIcon(icon)
self.clear_live_button.setObjectName(_fromUtf8("clear_live_button"))
self.horizontalLayout_2.addWidget(self.clear_live_button)
+ self.live_save_button = KPushButton(self.centralwidget)
+ icon = QtGui.QIcon.fromTheme(_fromUtf8("document-save"))
+ self.live_save_button.setIcon(icon)
+ self.live_save_button.setObjectName(_fromUtf8("live_save_button"))
+ self.horizontalLayout_2.addWidget(self.live_save_button)
+ self.live_color = KColorButton(self.centralwidget)
+ self.live_color.setObjectName(_fromUtf8("live_color"))
+ self.horizontalLayout_2.addWidget(self.live_color)
spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem)
self.verticalLayout.addLayout(self.horizontalLayout_2)
@@ -226,6 +117,34 @@ class Ui_MainWindow(object):
self.publish_button.setIcon(icon)
self.publish_button.setObjectName(_fromUtf8("publish_button"))
self.horizontalLayout.addWidget(self.publish_button)
+ self.previous_button = KPushButton(self.centralwidget)
+ icon = QtGui.QIcon.fromTheme(_fromUtf8("media-skip-backward"))
+ self.previous_button.setIcon(icon)
+ self.previous_button.setObjectName(_fromUtf8("previous_button"))
+ self.horizontalLayout.addWidget(self.previous_button)
+ self.next_button = KPushButton(self.centralwidget)
+ icon = QtGui.QIcon.fromTheme(_fromUtf8("media-skip-forward"))
+ self.next_button.setIcon(icon)
+ self.next_button.setObjectName(_fromUtf8("next_button"))
+ self.horizontalLayout.addWidget(self.next_button)
+ self.line = QtGui.QFrame(self.centralwidget)
+ self.line.setFrameShape(QtGui.QFrame.VLine)
+ self.line.setFrameShadow(QtGui.QFrame.Sunken)
+ self.line.setObjectName(_fromUtf8("line"))
+ self.horizontalLayout.addWidget(self.line)
+ self.preview_color = KColorButton(self.centralwidget)
+ self.preview_color.setObjectName(_fromUtf8("preview_color"))
+ self.horizontalLayout.addWidget(self.preview_color)
+ self.preview_save_button = KPushButton(self.centralwidget)
+ icon = QtGui.QIcon.fromTheme(_fromUtf8("document-save"))
+ self.preview_save_button.setIcon(icon)
+ self.preview_save_button.setObjectName(_fromUtf8("preview_save_button"))
+ self.horizontalLayout.addWidget(self.preview_save_button)
+ self.text_open_button = KPushButton(self.centralwidget)
+ icon = QtGui.QIcon.fromTheme(_fromUtf8("document-open"))
+ self.text_open_button.setIcon(icon)
+ self.text_open_button.setObjectName(_fromUtf8("text_open_button"))
+ self.horizontalLayout.addWidget(self.text_open_button)
spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem1)
self.verticalLayout_2.addLayout(self.horizontalLayout)
@@ -247,6 +166,7 @@ class Ui_MainWindow(object):
self.live_text.setToolTip(_translate("MainWindow", "live text", "tooltip1"))
self.clear_live_button.setToolTip(_translate("MainWindow", "clear live text", None))
self.clear_live_button.setShortcut(_translate("MainWindow", "F1", None))
+ self.live_color.setText(_translate("MainWindow", "background", None))
self.preview_text.setToolTip(_translate("MainWindow", "preview text", None))
self.clear_preview_button.setToolTip(_translate("MainWindow", "clear preview text", None))
self.clear_preview_button.setStatusTip(_translate("MainWindow", "status tip2", None))
@@ -254,6 +174,7 @@ class Ui_MainWindow(object):
self.clear_preview_button.setShortcut(_translate("MainWindow", "F2", None))
self.publish_button.setToolTip(_translate("MainWindow", "go live with text", None))
self.publish_button.setShortcut(_translate("MainWindow", "F4", None))
+ self.preview_color.setText(_translate("MainWindow", "background", None))
-from PyKDE4.kdeui import KPushButton, KRichTextWidget
+from PyKDE4.kdeui import KColorButton, KPushButton, KRichTextWidget
import texter_rc