mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-14 18:02:23 +12:00
Settings dialog, and color picker for labels
This commit is contained in:
parent
38ca551e22
commit
dfa1702efb
|
@ -12,6 +12,7 @@ SOURCES += ../src/ui/editors/customTextEdit.py
|
|||
SOURCES += ../src/ui/editors/editorWidget.py
|
||||
SOURCES += ../src/ui/views/corkDelegate.py
|
||||
SOURCES += ../src/ui/views/outlineBasics.py
|
||||
SOURCES += ../src/settingsWindow.py
|
||||
|
||||
|
||||
TRANSLATIONS += snowflaQe_fr.ts
|
||||
|
|
|
@ -52,4 +52,12 @@ def mainWindow():
|
|||
|
||||
def iconColor(icon):
|
||||
"Returns a QRgb from a QIcon, assuming its all the same color"
|
||||
return QColor(QImage(icon.pixmap(5, 5)).pixel(2, 2))
|
||||
return QColor(QImage(icon.pixmap(5, 5)).pixel(2, 2))
|
||||
|
||||
def iconFromColor(color):
|
||||
px = QPixmap(32, 32)
|
||||
px.fill(color)
|
||||
return QIcon(px)
|
||||
|
||||
def iconFromColorString(string):
|
||||
return iconFromColor(QColor(string))
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
|
||||
from qt import *
|
||||
|
||||
from functions import *
|
||||
from lxml import etree as ET
|
||||
|
||||
def saveStandardItemModelXML(mdl, xml):
|
||||
|
@ -35,6 +35,8 @@ def saveStandardItemModelXML(mdl, xml):
|
|||
for y in range(mdl.columnCount()):
|
||||
col = ET.SubElement(row, "col")
|
||||
col.attrib["col"] = str(y)
|
||||
if mdl.data(mdl.index(x, y), Qt.DecorationRole) != None:
|
||||
col.attrib["color"] = iconColor(mdl.data(mdl.index(x, y), Qt.DecorationRole)).name(QColor.HexArgb)
|
||||
if mdl.data(mdl.index(x, y)) != "":
|
||||
col.text = mdl.data(mdl.index(x, y))
|
||||
|
||||
|
@ -75,5 +77,7 @@ def loadStandardItemModelXML(mdl, xml):
|
|||
c = int(col.attrib["col"])
|
||||
if col.text:
|
||||
mdl.setData(mdl.index(r, c), col.text)
|
||||
|
||||
if "color" in col.attrib:
|
||||
mdl.item(r, c).setIcon(iconFromColorString(col.attrib["color"]))
|
||||
|
||||
print("OK")
|
|
@ -13,6 +13,7 @@ from enums import *
|
|||
from models.outlineModel import *
|
||||
from models.persosProxyModel import *
|
||||
from functions import *
|
||||
from settingsWindow import *
|
||||
|
||||
# Spell checker support
|
||||
try:
|
||||
|
@ -143,9 +144,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
(Qt.blue, "Chapter"),
|
||||
(Qt.red, "Scene")
|
||||
]:
|
||||
px = QPixmap(32, 32)
|
||||
px.fill(color)
|
||||
self.mdlLabels.appendRow(QStandardItem(QIcon(px), text))
|
||||
self.mdlLabels.appendRow(QStandardItem(iconFromColor(color), text))
|
||||
|
||||
|
||||
# Outline
|
||||
|
@ -219,6 +218,11 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
self.btnRedacFolderCork.clicked.connect(lambda v: self.redacEditor.setFolderView("cork"))
|
||||
self.btnRedacFolderOutline.clicked.connect(lambda v: self.redacEditor.setFolderView("outline"))
|
||||
|
||||
# Main Menu
|
||||
self.actLabels.triggered.connect(self.settingsLabel)
|
||||
self.actStatus.triggered.connect(self.settingsStatus)
|
||||
self.actQuit.triggered.connect(self.close)
|
||||
|
||||
#Debug
|
||||
self.mdlFlatData.setVerticalHeaderLabels(["Infos générales", "Summary"])
|
||||
self.tblDebugFlatData.setModel(self.mdlFlatData)
|
||||
|
@ -476,4 +480,28 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
self.dictChanged.emit(i.text().replace("&", ""))
|
||||
|
||||
def openPyEnchantWebPage(self):
|
||||
QDesktopServices.openUrl(QUrl("http://pythonhosted.org/pyenchant/"))
|
||||
QDesktopServices.openUrl(QUrl("http://pythonhosted.org/pyenchant/"))
|
||||
|
||||
|
||||
####################################################################################################
|
||||
# SETTINGS #
|
||||
####################################################################################################
|
||||
|
||||
def settingsLabel(self):
|
||||
self.settingsWindow(0)
|
||||
|
||||
def settingsStatus(self):
|
||||
self.settingsWindow(1)
|
||||
|
||||
def settingsWindow(self, tab=None):
|
||||
self.sw = settingsWindow(self)
|
||||
self.sw.hide()
|
||||
self.sw.setWindowModality(Qt.ApplicationModal)
|
||||
self.sw.setWindowFlags(Qt.Dialog)
|
||||
r = self.sw.geometry()
|
||||
r2 = self.geometry()
|
||||
self.sw.move(r2.center() - r.center())
|
||||
if tab:
|
||||
self.sw.tabWidget.setCurrentIndex(tab)
|
||||
self.sw.show()
|
||||
|
|
@ -132,6 +132,7 @@ class persosProxyModel(QAbstractProxyModel):
|
|||
f.setWeight(QFont.Bold)
|
||||
return f
|
||||
else:
|
||||
#FIXME: sometimes, the name of the character is not displayed
|
||||
return self.sourceModel().data(self.mapToSource(index), role)
|
||||
|
||||
def index(self, row, column, parent):
|
||||
|
|
55
src/settingsWindow.py
Normal file
55
src/settingsWindow.py
Normal file
|
@ -0,0 +1,55 @@
|
|||
#!/usr/bin/env python
|
||||
#--!-- coding: utf8 --!--
|
||||
|
||||
from qt import *
|
||||
|
||||
from ui.settings import *
|
||||
from enums import *
|
||||
from functions import *
|
||||
|
||||
# Spell checker support
|
||||
try:
|
||||
import enchant
|
||||
except ImportError:
|
||||
enchant = None
|
||||
|
||||
class settingsWindow(QWidget, Ui_Settings):
|
||||
|
||||
def __init__(self, mainWindow):
|
||||
QWidget.__init__(self)
|
||||
self.setupUi(self)
|
||||
|
||||
self.mw = mainWindow
|
||||
|
||||
# Labels
|
||||
self.lstLabels.setModel(self.mw.mdlLabels)
|
||||
self.lstLabels.setRowHidden(0, True)
|
||||
self.lstLabels.clicked.connect(self.updateLabelColor)
|
||||
self.btnLabelAdd.clicked.connect(self.addLabel)
|
||||
self.btnLabelRemove.clicked.connect(self.removeLabel)
|
||||
self.btnLabelColor.clicked.connect(self.setLabelColor)
|
||||
|
||||
def updateLabelColor(self, index):
|
||||
px = QPixmap(64, 64)
|
||||
px.fill(iconColor(self.mw.mdlLabels.item(index.row()).icon()))
|
||||
self.btnLabelColor.setIcon(QIcon(px))
|
||||
self.btnLabelColor.setEnabled(True)
|
||||
|
||||
def addLabel(self):
|
||||
px = QPixmap(32, 32)
|
||||
px.fill(Qt.transparent)
|
||||
self.mw.mdlLabels.appendRow(QStandardItem(QIcon(px), self.tr("New label")))
|
||||
|
||||
def removeLabel(self):
|
||||
for i in self.lstLabels.selectedIndexes():
|
||||
self.mw.mdlLabels.removeRows(i.row(), 1)
|
||||
|
||||
def setLabelColor(self):
|
||||
index = self.lstLabels.currentIndex()
|
||||
color = iconColor(self.mw.mdlLabels.item(index.row()).icon())
|
||||
self.colorDialog = QColorDialog(color, self)
|
||||
color = self.colorDialog.getColor(color)
|
||||
px = QPixmap(32, 32)
|
||||
px.fill(color)
|
||||
self.mw.mdlLabels.item(index.row()).setIcon(QIcon(px))
|
||||
|
|
@ -16,7 +16,7 @@ class cmbOutlineLabelChoser(QComboBox):
|
|||
|
||||
def setModels(self, mdlLabels, mdlOutline):
|
||||
self.mdlLabels = mdlLabels
|
||||
self.mdlLabels.dataChanged.connect(self.updateItems)
|
||||
self.mdlLabels.dataChanged.connect(self.updateItems) # Not emiting?
|
||||
self.mdlOutline = mdlOutline
|
||||
self.mdlOutline.dataChanged.connect(self.updateSelectedItem)
|
||||
self.updateItems()
|
||||
|
@ -36,13 +36,16 @@ class cmbOutlineLabelChoser(QComboBox):
|
|||
|
||||
def setCurrentModelIndex(self, idx):
|
||||
self.currentModelIndex = idx
|
||||
self.updateItems()
|
||||
self.updateSelectedItem()
|
||||
|
||||
def updateItems(self):
|
||||
def updateItems(self, topLeft=None, bottomRight=None, roles=None):
|
||||
self.clear()
|
||||
for i in range(self.mdlLabels.rowCount()):
|
||||
self.addItem(self.mdlLabels.item(i, 0).icon(),
|
||||
self.mdlLabels.item(i, 0).text())
|
||||
item = self.mdlLabels.item(i, 0)
|
||||
if item:
|
||||
self.addItem(item.icon(),
|
||||
item.text())
|
||||
|
||||
if self.currentModelIndex:
|
||||
self.updateSelectedItem()
|
|
@ -1105,46 +1105,48 @@ class Ui_MainWindow(object):
|
|||
self.menubar = QtWidgets.QMenuBar(MainWindow)
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 1103, 31))
|
||||
self.menubar.setObjectName("menubar")
|
||||
self.menu_Fichier = QtWidgets.QMenu(self.menubar)
|
||||
self.menu_Fichier.setObjectName("menu_Fichier")
|
||||
self.menuFile = QtWidgets.QMenu(self.menubar)
|
||||
self.menuFile.setObjectName("menuFile")
|
||||
self.menuMode = QtWidgets.QMenu(self.menubar)
|
||||
self.menuMode.setObjectName("menuMode")
|
||||
self.menu_Aide = QtWidgets.QMenu(self.menubar)
|
||||
self.menu_Aide.setObjectName("menu_Aide")
|
||||
self.menuHelp = QtWidgets.QMenu(self.menubar)
|
||||
self.menuHelp.setObjectName("menuHelp")
|
||||
self.menuTools = QtWidgets.QMenu(self.menubar)
|
||||
self.menuTools.setObjectName("menuTools")
|
||||
self.menuEdit = QtWidgets.QMenu(self.menubar)
|
||||
self.menuEdit.setObjectName("menuEdit")
|
||||
MainWindow.setMenuBar(self.menubar)
|
||||
self.statusbar = QtWidgets.QStatusBar(MainWindow)
|
||||
self.statusbar.setObjectName("statusbar")
|
||||
MainWindow.setStatusBar(self.statusbar)
|
||||
self.actionOuvrir = QtWidgets.QAction(MainWindow)
|
||||
self.actOpen = QtWidgets.QAction(MainWindow)
|
||||
icon = QtGui.QIcon.fromTheme("document-open")
|
||||
self.actionOuvrir.setIcon(icon)
|
||||
self.actionOuvrir.setObjectName("actionOuvrir")
|
||||
self.action_R_cents = QtWidgets.QAction(MainWindow)
|
||||
self.actOpen.setIcon(icon)
|
||||
self.actOpen.setObjectName("actOpen")
|
||||
self.actRecents = QtWidgets.QAction(MainWindow)
|
||||
icon = QtGui.QIcon.fromTheme("document-open-recent")
|
||||
self.action_R_cents.setIcon(icon)
|
||||
self.action_R_cents.setObjectName("action_R_cents")
|
||||
self.actionEnregistrer = QtWidgets.QAction(MainWindow)
|
||||
self.actRecents.setIcon(icon)
|
||||
self.actRecents.setObjectName("actRecents")
|
||||
self.actSave = QtWidgets.QAction(MainWindow)
|
||||
icon = QtGui.QIcon.fromTheme("document-save")
|
||||
self.actionEnregistrer.setIcon(icon)
|
||||
self.actionEnregistrer.setObjectName("actionEnregistrer")
|
||||
self.actionEnregistrer_sous = QtWidgets.QAction(MainWindow)
|
||||
self.actSave.setIcon(icon)
|
||||
self.actSave.setObjectName("actSave")
|
||||
self.actSaveAs = QtWidgets.QAction(MainWindow)
|
||||
icon = QtGui.QIcon.fromTheme("document-save-as")
|
||||
self.actionEnregistrer_sous.setIcon(icon)
|
||||
self.actionEnregistrer_sous.setObjectName("actionEnregistrer_sous")
|
||||
self.actionQuitter = QtWidgets.QAction(MainWindow)
|
||||
self.actSaveAs.setIcon(icon)
|
||||
self.actSaveAs.setObjectName("actSaveAs")
|
||||
self.actQuit = QtWidgets.QAction(MainWindow)
|
||||
icon = QtGui.QIcon.fromTheme("application-exit")
|
||||
self.actionQuitter.setIcon(icon)
|
||||
self.actionQuitter.setObjectName("actionQuitter")
|
||||
self.actionSnowflakeMode = QtWidgets.QAction(MainWindow)
|
||||
self.actionSnowflakeMode.setCheckable(True)
|
||||
self.actionSnowflakeMode.setChecked(True)
|
||||
self.actionSnowflakeMode.setObjectName("actionSnowflakeMode")
|
||||
self.actionNouveau = QtWidgets.QAction(MainWindow)
|
||||
self.actQuit.setIcon(icon)
|
||||
self.actQuit.setObjectName("actQuit")
|
||||
self.actSnowflakeMode = QtWidgets.QAction(MainWindow)
|
||||
self.actSnowflakeMode.setCheckable(True)
|
||||
self.actSnowflakeMode.setChecked(True)
|
||||
self.actSnowflakeMode.setObjectName("actSnowflakeMode")
|
||||
self.actNew = QtWidgets.QAction(MainWindow)
|
||||
icon = QtGui.QIcon.fromTheme("document-new")
|
||||
self.actionNouveau.setIcon(icon)
|
||||
self.actionNouveau.setObjectName("actionNouveau")
|
||||
self.actNew.setIcon(icon)
|
||||
self.actNew.setObjectName("actNew")
|
||||
self.actShowHelp = QtWidgets.QAction(MainWindow)
|
||||
self.actShowHelp.setCheckable(True)
|
||||
self.actShowHelp.setChecked(True)
|
||||
|
@ -1157,20 +1159,27 @@ class Ui_MainWindow(object):
|
|||
icon = QtGui.QIcon.fromTheme("tools-check-spelling")
|
||||
self.actSpellcheck.setIcon(icon)
|
||||
self.actSpellcheck.setObjectName("actSpellcheck")
|
||||
self.menu_Fichier.addAction(self.actionNouveau)
|
||||
self.menu_Fichier.addAction(self.actionOuvrir)
|
||||
self.menu_Fichier.addAction(self.action_R_cents)
|
||||
self.menu_Fichier.addAction(self.actionEnregistrer)
|
||||
self.menu_Fichier.addAction(self.actionEnregistrer_sous)
|
||||
self.menu_Fichier.addSeparator()
|
||||
self.menu_Fichier.addAction(self.actionQuitter)
|
||||
self.menuMode.addAction(self.actionSnowflakeMode)
|
||||
self.menu_Aide.addAction(self.actShowHelp)
|
||||
self.actLabels = QtWidgets.QAction(MainWindow)
|
||||
self.actLabels.setObjectName("actLabels")
|
||||
self.actStatus = QtWidgets.QAction(MainWindow)
|
||||
self.actStatus.setObjectName("actStatus")
|
||||
self.menuFile.addAction(self.actNew)
|
||||
self.menuFile.addAction(self.actOpen)
|
||||
self.menuFile.addAction(self.actRecents)
|
||||
self.menuFile.addAction(self.actSave)
|
||||
self.menuFile.addAction(self.actSaveAs)
|
||||
self.menuFile.addSeparator()
|
||||
self.menuFile.addAction(self.actQuit)
|
||||
self.menuMode.addAction(self.actSnowflakeMode)
|
||||
self.menuHelp.addAction(self.actShowHelp)
|
||||
self.menuTools.addAction(self.actSpellcheck)
|
||||
self.menubar.addAction(self.menu_Fichier.menuAction())
|
||||
self.menuEdit.addAction(self.actLabels)
|
||||
self.menuEdit.addAction(self.actStatus)
|
||||
self.menubar.addAction(self.menuFile.menuAction())
|
||||
self.menubar.addAction(self.menuEdit.menuAction())
|
||||
self.menubar.addAction(self.menuMode.menuAction())
|
||||
self.menubar.addAction(self.menuTools.menuAction())
|
||||
self.menubar.addAction(self.menu_Aide.menuAction())
|
||||
self.menubar.addAction(self.menuHelp.menuAction())
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
self.tabMain.setCurrentIndex(6)
|
||||
|
@ -1332,34 +1341,37 @@ class Ui_MainWindow(object):
|
|||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_20), _translate("MainWindow", "Outline"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("MainWindow", "Labels"))
|
||||
self.tabMain.setTabText(self.tabMain.indexOf(self.lytTabDebug), _translate("MainWindow", "Debug"))
|
||||
self.menu_Fichier.setTitle(_translate("MainWindow", "File"))
|
||||
self.menuFile.setTitle(_translate("MainWindow", "File"))
|
||||
self.menuMode.setTitle(_translate("MainWindow", "Mode"))
|
||||
self.menu_Aide.setTitle(_translate("MainWindow", "Help"))
|
||||
self.menuHelp.setTitle(_translate("MainWindow", "Help"))
|
||||
self.menuTools.setTitle(_translate("MainWindow", "Tools"))
|
||||
self.actionOuvrir.setText(_translate("MainWindow", "Open"))
|
||||
self.actionOuvrir.setShortcut(_translate("MainWindow", "Ctrl+O"))
|
||||
self.action_R_cents.setText(_translate("MainWindow", "Recents"))
|
||||
self.action_R_cents.setShortcut(_translate("MainWindow", "Ctrl+R"))
|
||||
self.actionEnregistrer.setText(_translate("MainWindow", "Save"))
|
||||
self.actionEnregistrer.setShortcut(_translate("MainWindow", "Ctrl+S"))
|
||||
self.actionEnregistrer_sous.setText(_translate("MainWindow", "Save as..."))
|
||||
self.actionEnregistrer_sous.setShortcut(_translate("MainWindow", "Ctrl+Shift+S"))
|
||||
self.actionQuitter.setText(_translate("MainWindow", "Quit"))
|
||||
self.actionQuitter.setShortcut(_translate("MainWindow", "Ctrl+Q"))
|
||||
self.actionSnowflakeMode.setText(_translate("MainWindow", "&Snowflake"))
|
||||
self.actionNouveau.setText(_translate("MainWindow", "New"))
|
||||
self.actionNouveau.setShortcut(_translate("MainWindow", "Ctrl+N"))
|
||||
self.menuEdit.setTitle(_translate("MainWindow", "Edit"))
|
||||
self.actOpen.setText(_translate("MainWindow", "Open"))
|
||||
self.actOpen.setShortcut(_translate("MainWindow", "Ctrl+O"))
|
||||
self.actRecents.setText(_translate("MainWindow", "Recents"))
|
||||
self.actRecents.setShortcut(_translate("MainWindow", "Ctrl+R"))
|
||||
self.actSave.setText(_translate("MainWindow", "Save"))
|
||||
self.actSave.setShortcut(_translate("MainWindow", "Ctrl+S"))
|
||||
self.actSaveAs.setText(_translate("MainWindow", "Save as..."))
|
||||
self.actSaveAs.setShortcut(_translate("MainWindow", "Ctrl+Shift+S"))
|
||||
self.actQuit.setText(_translate("MainWindow", "Quit"))
|
||||
self.actQuit.setShortcut(_translate("MainWindow", "Ctrl+Q"))
|
||||
self.actSnowflakeMode.setText(_translate("MainWindow", "&Snowflake"))
|
||||
self.actNew.setText(_translate("MainWindow", "New"))
|
||||
self.actNew.setShortcut(_translate("MainWindow", "Ctrl+N"))
|
||||
self.actShowHelp.setText(_translate("MainWindow", "Show help texts"))
|
||||
self.actShowHelp.setShortcut(_translate("MainWindow", "Ctrl+Shift+B"))
|
||||
self.actSpellcheck.setText(_translate("MainWindow", "Spellcheck"))
|
||||
self.actSpellcheck.setShortcut(_translate("MainWindow", "F8"))
|
||||
self.actLabels.setText(_translate("MainWindow", "Labels..."))
|
||||
self.actStatus.setText(_translate("MainWindow", "Status..."))
|
||||
|
||||
from ui.collapsibleGroupBox2 import collapsibleGroupBox2
|
||||
from ui.chkOutlineCompile import chkOutlineCompile
|
||||
from ui.views.treeView import treeView
|
||||
from ui.cmbOutlinePersoChoser import cmbOutlinePersoChoser
|
||||
from ui.sldImportance import sldImportance
|
||||
from ui.cmbOutlineStatusChoser import cmbOutlineStatusChoser
|
||||
from ui.editors.editorWidget import editorWidget
|
||||
from ui.cmbOutlineLabelChoser import cmbOutlineLabelChoser
|
||||
from ui.chkOutlineCompile import chkOutlineCompile
|
||||
from ui.views.outlineView import outlineView
|
||||
from ui.cmbOutlinePersoChoser import cmbOutlinePersoChoser
|
||||
from ui.cmbOutlineStatusChoser import cmbOutlineStatusChoser
|
||||
from ui.sldImportance import sldImportance
|
||||
from ui.editors.editorWidget import editorWidget
|
||||
from ui.collapsibleGroupBox2 import collapsibleGroupBox2
|
||||
from ui.views.treeView import treeView
|
||||
|
|
|
@ -2159,25 +2159,25 @@
|
|||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menu_Fichier">
|
||||
<widget class="QMenu" name="menuFile">
|
||||
<property name="title">
|
||||
<string>File</string>
|
||||
</property>
|
||||
<addaction name="actionNouveau"/>
|
||||
<addaction name="actionOuvrir"/>
|
||||
<addaction name="action_R_cents"/>
|
||||
<addaction name="actionEnregistrer"/>
|
||||
<addaction name="actionEnregistrer_sous"/>
|
||||
<addaction name="actNew"/>
|
||||
<addaction name="actOpen"/>
|
||||
<addaction name="actRecents"/>
|
||||
<addaction name="actSave"/>
|
||||
<addaction name="actSaveAs"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionQuitter"/>
|
||||
<addaction name="actQuit"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuMode">
|
||||
<property name="title">
|
||||
<string>Mode</string>
|
||||
</property>
|
||||
<addaction name="actionSnowflakeMode"/>
|
||||
<addaction name="actSnowflakeMode"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menu_Aide">
|
||||
<widget class="QMenu" name="menuHelp">
|
||||
<property name="title">
|
||||
<string>Help</string>
|
||||
</property>
|
||||
|
@ -2189,13 +2189,21 @@
|
|||
</property>
|
||||
<addaction name="actSpellcheck"/>
|
||||
</widget>
|
||||
<addaction name="menu_Fichier"/>
|
||||
<widget class="QMenu" name="menuEdit">
|
||||
<property name="title">
|
||||
<string>Edit</string>
|
||||
</property>
|
||||
<addaction name="actLabels"/>
|
||||
<addaction name="actStatus"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuEdit"/>
|
||||
<addaction name="menuMode"/>
|
||||
<addaction name="menuTools"/>
|
||||
<addaction name="menu_Aide"/>
|
||||
<addaction name="menuHelp"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
<action name="actionOuvrir">
|
||||
<action name="actOpen">
|
||||
<property name="icon">
|
||||
<iconset theme="document-open">
|
||||
<normaloff/>
|
||||
|
@ -2208,7 +2216,7 @@
|
|||
<string>Ctrl+O</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_R_cents">
|
||||
<action name="actRecents">
|
||||
<property name="icon">
|
||||
<iconset theme="document-open-recent">
|
||||
<normaloff/>
|
||||
|
@ -2221,7 +2229,7 @@
|
|||
<string>Ctrl+R</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionEnregistrer">
|
||||
<action name="actSave">
|
||||
<property name="icon">
|
||||
<iconset theme="document-save">
|
||||
<normaloff/>
|
||||
|
@ -2234,7 +2242,7 @@
|
|||
<string>Ctrl+S</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionEnregistrer_sous">
|
||||
<action name="actSaveAs">
|
||||
<property name="icon">
|
||||
<iconset theme="document-save-as">
|
||||
<normaloff/>
|
||||
|
@ -2247,7 +2255,7 @@
|
|||
<string>Ctrl+Shift+S</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionQuitter">
|
||||
<action name="actQuit">
|
||||
<property name="icon">
|
||||
<iconset theme="application-exit">
|
||||
<normaloff/>
|
||||
|
@ -2260,7 +2268,7 @@
|
|||
<string>Ctrl+Q</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSnowflakeMode">
|
||||
<action name="actSnowflakeMode">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
|
@ -2271,7 +2279,7 @@
|
|||
<string>&Snowflake</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNouveau">
|
||||
<action name="actNew">
|
||||
<property name="icon">
|
||||
<iconset theme="document-new">
|
||||
<normaloff/>
|
||||
|
@ -2322,6 +2330,16 @@
|
|||
<string>F8</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actLabels">
|
||||
<property name="text">
|
||||
<string>Labels...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actStatus">
|
||||
<property name="text">
|
||||
<string>Status...</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
|
102
src/ui/settings.py
Normal file
102
src/ui/settings.py
Normal file
|
@ -0,0 +1,102 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'src/ui/settings.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.4.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_Settings(object):
|
||||
def setupUi(self, Settings):
|
||||
Settings.setObjectName("Settings")
|
||||
Settings.resize(485, 379)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(Settings)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.tabWidget = QtWidgets.QTabWidget(Settings)
|
||||
self.tabWidget.setObjectName("tabWidget")
|
||||
self.tab = QtWidgets.QWidget()
|
||||
self.tab.setObjectName("tab")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.tab)
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.lstLabels = QtWidgets.QListView(self.tab)
|
||||
self.lstLabels.setObjectName("lstLabels")
|
||||
self.horizontalLayout_2.addWidget(self.lstLabels)
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.btnLabelColor = QtWidgets.QPushButton(self.tab)
|
||||
self.btnLabelColor.setEnabled(False)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.btnLabelColor.sizePolicy().hasHeightForWidth())
|
||||
self.btnLabelColor.setSizePolicy(sizePolicy)
|
||||
self.btnLabelColor.setMinimumSize(QtCore.QSize(64, 64))
|
||||
self.btnLabelColor.setMaximumSize(QtCore.QSize(64, 64))
|
||||
self.btnLabelColor.setText("")
|
||||
self.btnLabelColor.setIconSize(QtCore.QSize(64, 64))
|
||||
self.btnLabelColor.setObjectName("btnLabelColor")
|
||||
self.verticalLayout_2.addWidget(self.btnLabelColor)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.verticalLayout_2.addItem(spacerItem)
|
||||
self.horizontalLayout_2.addLayout(self.verticalLayout_2)
|
||||
self.verticalLayout_3.addLayout(self.horizontalLayout_2)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.btnLabelAdd = QtWidgets.QPushButton(self.tab)
|
||||
self.btnLabelAdd.setText("")
|
||||
icon = QtGui.QIcon.fromTheme("list-add")
|
||||
self.btnLabelAdd.setIcon(icon)
|
||||
self.btnLabelAdd.setObjectName("btnLabelAdd")
|
||||
self.horizontalLayout.addWidget(self.btnLabelAdd)
|
||||
self.btnLabelRemove = QtWidgets.QPushButton(self.tab)
|
||||
self.btnLabelRemove.setText("")
|
||||
icon = QtGui.QIcon.fromTheme("list-remove")
|
||||
self.btnLabelRemove.setIcon(icon)
|
||||
self.btnLabelRemove.setObjectName("btnLabelRemove")
|
||||
self.horizontalLayout.addWidget(self.btnLabelRemove)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem1)
|
||||
self.verticalLayout_3.addLayout(self.horizontalLayout)
|
||||
self.tabWidget.addTab(self.tab, "")
|
||||
self.tab_2 = QtWidgets.QWidget()
|
||||
self.tab_2.setObjectName("tab_2")
|
||||
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.tab_2)
|
||||
self.verticalLayout_4.setObjectName("verticalLayout_4")
|
||||
self.lstStatus = QtWidgets.QListWidget(self.tab_2)
|
||||
self.lstStatus.setObjectName("lstStatus")
|
||||
self.verticalLayout_4.addWidget(self.lstStatus)
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.btnStatusAdd = QtWidgets.QPushButton(self.tab_2)
|
||||
self.btnStatusAdd.setText("")
|
||||
icon = QtGui.QIcon.fromTheme("list-add")
|
||||
self.btnStatusAdd.setIcon(icon)
|
||||
self.btnStatusAdd.setObjectName("btnStatusAdd")
|
||||
self.horizontalLayout_3.addWidget(self.btnStatusAdd)
|
||||
self.btnStatusRemove = QtWidgets.QPushButton(self.tab_2)
|
||||
self.btnStatusRemove.setText("")
|
||||
icon = QtGui.QIcon.fromTheme("list-remove")
|
||||
self.btnStatusRemove.setIcon(icon)
|
||||
self.btnStatusRemove.setObjectName("btnStatusRemove")
|
||||
self.horizontalLayout_3.addWidget(self.btnStatusRemove)
|
||||
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout_3.addItem(spacerItem2)
|
||||
self.verticalLayout_4.addLayout(self.horizontalLayout_3)
|
||||
self.tabWidget.addTab(self.tab_2, "")
|
||||
self.verticalLayout.addWidget(self.tabWidget)
|
||||
|
||||
self.retranslateUi(Settings)
|
||||
self.tabWidget.setCurrentIndex(0)
|
||||
QtCore.QMetaObject.connectSlotsByName(Settings)
|
||||
|
||||
def retranslateUi(self, Settings):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Settings.setWindowTitle(_translate("Settings", "Form"))
|
||||
self.btnLabelColor.setShortcut(_translate("Settings", "Ctrl+S"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("Settings", "Labels"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("Settings", "Status"))
|
||||
|
184
src/ui/settings.ui
Normal file
184
src/ui/settings.ui
Normal file
|
@ -0,0 +1,184 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Settings</class>
|
||||
<widget class="QWidget" name="Settings">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>485</width>
|
||||
<height>379</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>Labels</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QListView" name="lstLabels"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnLabelColor">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>64</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>64</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>64</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+S</string>
|
||||
</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>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnLabelAdd">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="list-add"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnLabelRemove">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="list-remove"/>
|
||||
</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>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<attribute name="title">
|
||||
<string>Status</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QListWidget" name="lstStatus"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnStatusAdd">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="list-add">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnStatusRemove">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="list-remove">
|
||||
<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>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -7,6 +7,8 @@
|
|||
<label row="2" text="3"/>
|
||||
<label row="3" text="4"/>
|
||||
<label row="4" text="5"/>
|
||||
<label row="5" text="6"/>
|
||||
<label row="6" text="7"/>
|
||||
</vertical>
|
||||
<horizontal>
|
||||
<label row="0" text="1"/>
|
||||
|
@ -14,19 +16,25 @@
|
|||
</header>
|
||||
<data>
|
||||
<row row="0">
|
||||
<col col="0"/>
|
||||
<col col="0" color="#ff000000"/>
|
||||
</row>
|
||||
<row row="1">
|
||||
<col col="0">Idea</col>
|
||||
<col col="0" color="#ffffff00">Ideas</col>
|
||||
</row>
|
||||
<row row="2">
|
||||
<col col="0">Note</col>
|
||||
<col col="0" color="#ff00ff00">Notes</col>
|
||||
</row>
|
||||
<row row="3">
|
||||
<col col="0">Chapter</col>
|
||||
<col col="0" color="#ff0000ff">Chapter</col>
|
||||
</row>
|
||||
<row row="4">
|
||||
<col col="0">Scene</col>
|
||||
<col col="0" color="#ffff0000">Scene</col>
|
||||
</row>
|
||||
<row row="5">
|
||||
<col col="0" color="#fffa4eec">New label</col>
|
||||
</row>
|
||||
<row row="6">
|
||||
<col col="0" color="#ff7ef8f4">New label</col>
|
||||
</row>
|
||||
</data>
|
||||
</model>
|
||||
|
|
|
@ -59,5 +59,5 @@
|
|||
<outlineItem title="Titre cool" type="scene" POV="0" label="0" compile="2" text="asdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasd asd aasdasd asd asd asd asd asdasd asdaasd " wordCount="58" setGoal="50"/>
|
||||
<outlineItem title="Titre cool" type="scene" POV="0" label="0" compile="2" text="asdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasd asd aasdasd asd asd asd asd asdasd asdaasd " wordCount="58" setGoal="50"/>
|
||||
</outlineItem>
|
||||
<outlineItem title="Titre cool" type="scene" POV="0" label="0" compile="2" text="asdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasd asd aasdasd asd asd asd asd asdasd asdaasd " wordCount="58" setGoal="50"/>
|
||||
<outlineItem title="Titre cool" type="scene" POV="2" label="5" compile="2" text="asdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasdasdasd asd asd asd asd asdasd asdaasd asdasd asd aasdasd asd asd asd asd asdasd asdaasd " wordCount="58" setGoal="50"/>
|
||||
</outlineItem>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
</header>
|
||||
<data>
|
||||
<row row="0">
|
||||
<col col="0">Albert</col>
|
||||
<col col="0">Albert le vert</col>
|
||||
<col col="1">0</col>
|
||||
<col col="2">2</col>
|
||||
<col col="3"/>
|
||||
|
@ -51,9 +51,9 @@ Pour voir.</col>
|
|||
<col col="10"/>
|
||||
</row>
|
||||
<row row="2">
|
||||
<col col="0">Nouveau perso avec un nom pas très long mais franchement ennuyeux</col>
|
||||
<col col="0">Nouveau perso avec un nom très très long pour voir comment ça fait</col>
|
||||
<col col="1">2</col>
|
||||
<col col="2">0</col>
|
||||
<col col="2"/>
|
||||
<col col="3"/>
|
||||
<col col="4"/>
|
||||
<col col="5"/>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<col col="0">Age</col>
|
||||
<col col="1">42</col>
|
||||
<col col="2">12</col>
|
||||
<col col="3">11</col>
|
||||
<col col="3"/>
|
||||
</row>
|
||||
<row row="2">
|
||||
<col col="0">Animal préféré</col>
|
||||
|
|
Loading…
Reference in a new issue