Skip to content

Commit

Permalink
implementação dos menus
Browse files Browse the repository at this point in the history
  • Loading branch information
Davipcrs committed Jan 13, 2023
1 parent 320c777 commit 93b792e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gui/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ def __init__(self):
self.selectionList = self.ui.listView.selectionModel()
self.selectionList.selectionChanged.connect(self.getFileNameWithClick)
self.listviewAddElement()
self.arr = []
##TextEditor Events
self.txt = TextEditor()
self.txt.wClosed.connect(self.refreshWindow)
self.txt.wClosed.connect(self.txt.ui.mainEditor.clear)
self.txt.wClosed.connect(self.show)
self.txt.ui.actionNew.triggered.connect(self.createNewTextEditor)
self.ui.label.setText("Quantidade de arquivos: " + str(self.model.rowCount()))
self.ui.label_2.setText("")


def changeWindow(self):
self.txt.passFileName(None)
Expand Down Expand Up @@ -78,4 +82,8 @@ def getFileNameWithClick(self):
self.filename = aux_str.data()


def createNewTextEditor(self):
txt = TextEditor()
self.arr.append(txt)
self.arr[self.arr.__len__()-1].show()

7 changes: 7 additions & 0 deletions gui/textEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ def __init__(self):
self.str = None
self.ui.actionSave.triggered.connect(self.f_getTextFromEditor)
self.ui.actionSaveAs.triggered.connect(self.f_ActionSaveAs)
self.ui.actionReturn.setText("Desfazer")
self.ui.actionRFoward.setText("Refazer")
self.ui.actionReturn.triggered.connect(self.ui.mainEditor.undo)
self.ui.actionRFoward.triggered.connect(self.ui.mainEditor.redo)
self.ui.actionClear.triggered.connect(self.ui.mainEditor.clear)
self.ui.actionClose.triggered.connect(self.closeEvent)


def f_getTextFromEditor(self):
if self.prevName == None:
Expand Down
1 change: 1 addition & 0 deletions text/dwadawd.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Teste

0 comments on commit 93b792e

Please sign in to comment.