mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-15 10:22:26 +12:00
MainEditor getting even smarter
This commit is contained in:
parent
7a7f102490
commit
3dc5217554
|
@ -275,7 +275,7 @@ class settingsWindow(QWidget, Ui_Settings):
|
|||
settings.corkBackground["color"] = color.name()
|
||||
self.updateCorkColor()
|
||||
# Update Cork view
|
||||
self.mw.redacEditor.corkView.updateBackground()
|
||||
self.mw.mainEditor.updateCorkBackground()
|
||||
|
||||
def updateCorkColor(self):
|
||||
self.btnCorkColor.setStyleSheet("background:{};".format(settings.corkBackground["color"]))
|
||||
|
@ -287,7 +287,7 @@ class settingsWindow(QWidget, Ui_Settings):
|
|||
else:
|
||||
settings.corkBackground["image"] = ""
|
||||
# Update Cork view
|
||||
self.mw.redacEditor.corkView.updateBackground()
|
||||
self.mw.mainEditor.updateCorkBackground()
|
||||
|
||||
def populatesCmbBackgrounds(self, cmb):
|
||||
#self.cmbDelegate = cmbPixmapDelegate()
|
||||
|
|
|
@ -216,7 +216,7 @@ class editorWidget(QWidget, Ui_editorWidget_ui):
|
|||
mw = mainWindow()
|
||||
if not mw: return
|
||||
|
||||
mw.mainEditor.updateStats(self.currentIndex)
|
||||
mw.mainEditor.updateStats()
|
||||
|
||||
def toggleSpellcheck(self, v):
|
||||
self.spellcheck = v
|
||||
|
|
|
@ -52,6 +52,8 @@ class mainEditor(QWidget, Ui_mainEditor):
|
|||
self._updating = True
|
||||
self.mw.treeRedacOutline.setCurrentIndex(index)
|
||||
self._updating = False
|
||||
|
||||
self.updateStats()
|
||||
|
||||
def closeTab(self, index):
|
||||
#FIXME: submit data if textedit?
|
||||
|
@ -133,8 +135,13 @@ class mainEditor(QWidget, Ui_mainEditor):
|
|||
elif view == "outline":
|
||||
self.btnRedacFolderOutline.setChecked(True)
|
||||
|
||||
def updateStats(self, index=None):
|
||||
if index:
|
||||
def updateStats(self):
|
||||
|
||||
if not self.currentEditor():
|
||||
return
|
||||
|
||||
index = self.currentEditor().currentIndex
|
||||
if index.isValid():
|
||||
item = index.internalPointer()
|
||||
else:
|
||||
item = self.mw.mdlOutline.rootItem
|
||||
|
@ -176,24 +183,20 @@ class mainEditor(QWidget, Ui_mainEditor):
|
|||
#self.redacEditor.setFolderView(settings.folderView)
|
||||
|
||||
def setCorkSizeFactor(self, val):
|
||||
#FIXME
|
||||
pass
|
||||
#self.redacEditor.setCorkSizeFactor
|
||||
for w in self.allTabs():
|
||||
w.setCorkSizeFactor(val)
|
||||
|
||||
def updateCorkView(self):
|
||||
pass
|
||||
#FIXME
|
||||
#self.redacEditor.corkView.viewport().update()
|
||||
for w in self.allTabs():
|
||||
w.corkView.viewport().update()
|
||||
|
||||
def updateCorkBackground(self):
|
||||
pass
|
||||
#FIXME
|
||||
#self.redacEditor.corkView.updateBackground()
|
||||
for w in self.allTabs():
|
||||
w.corkView.updateBackground()
|
||||
|
||||
def updateTreeView(self):
|
||||
pass
|
||||
#FIXME
|
||||
#self.redacEditor.outlineView.viewport().update()
|
||||
for w in self.allTabs():
|
||||
w.corkView.outlineView.viewport().update()
|
||||
|
||||
def showFullScreen(self):
|
||||
pass
|
||||
|
|
|
@ -132,17 +132,17 @@ class textEditView(QTextEdit):
|
|||
self._textFormat = "text"
|
||||
return
|
||||
|
||||
#if self._column != Outline.text.value:
|
||||
#self._textFormat = "text"
|
||||
#return
|
||||
|
||||
item = index.internalPointer()
|
||||
if item.isHTML():
|
||||
self._textFormat = "html"
|
||||
elif item.isT2T():
|
||||
self._textFormat = "t2t"
|
||||
else:
|
||||
if self._column != Outline.text.value:
|
||||
self._textFormat = "text"
|
||||
|
||||
else:
|
||||
item = index.internalPointer()
|
||||
if item.isHTML():
|
||||
self._textFormat = "html"
|
||||
elif item.isT2T():
|
||||
self._textFormat = "t2t"
|
||||
else:
|
||||
self._textFormat = "text"
|
||||
|
||||
# Accept richtext maybe
|
||||
if self._textFormat == "html":
|
||||
|
|
Loading…
Reference in a new issue