mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-14 09:52:27 +12:00
Fixes bug: tabs are not properly closed
This commit is contained in:
parent
644d0c1c7b
commit
465c387284
|
@ -374,14 +374,16 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
self.stack.setCurrentIndex(1)
|
||||
|
||||
def closeProject(self):
|
||||
|
||||
# Close open tabs in editor
|
||||
self.mainEditor.closeAllTabs()
|
||||
|
||||
# Save datas
|
||||
self.saveDatas()
|
||||
|
||||
self.currentProject = None
|
||||
QSettings().setValue("lastProject", "")
|
||||
|
||||
# FIXME: close all opened tabs in mainEditor
|
||||
|
||||
# Clear datas
|
||||
self.loadEmptyDatas()
|
||||
self.saveTimer.stop()
|
||||
|
|
|
@ -78,11 +78,15 @@ class mainEditor(QWidget, Ui_mainEditor):
|
|||
self.updateThingsVisible(index)
|
||||
|
||||
def closeTab(self, index):
|
||||
# FIXME: submit data if textedit?
|
||||
w = self.tab.widget(index)
|
||||
self.tab.removeTab(index)
|
||||
w.setCurrentModelIndex(QModelIndex())
|
||||
w.deleteLater()
|
||||
|
||||
def closeAllTabs(self):
|
||||
while(self.tab.count()):
|
||||
self.closeTab(0)
|
||||
|
||||
def allTabs(self):
|
||||
return [self.tab.widget(i) for i in range(self.tab.count())]
|
||||
|
||||
|
|
Loading…
Reference in a new issue