diff options
author | Ken Moore <ken@ixsystems.com> | 2018-05-21 15:23:07 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2018-05-21 15:23:07 -0400 |
commit | ebe83b1f96ca2df76d0d7e41e853911625c9c25f (patch) | |
tree | 688bd68a8ac27b0d83aec9c464fc13917f38f165 /src-qt5/desktop-utils/lumina-textedit/MainUI.cpp | |
parent | Couple quick updates to lumina-textedit: (diff) | |
download | lumina-ebe83b1f96ca2df76d0d7e41e853911625c9c25f.tar.gz lumina-ebe83b1f96ca2df76d0d7e41e853911625c9c25f.tar.bz2 lumina-ebe83b1f96ca2df76d0d7e41e853911625c9c25f.zip |
A couple more cleanup operations for lumina textedit
Main change being that when opening the file select dialog it will automatically re-highlight the current file.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-textedit/MainUI.cpp')
-rw-r--r-- | src-qt5/desktop-utils/lumina-textedit/MainUI.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp b/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp index 50b83ee8..71c4d173 100644 --- a/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp @@ -194,6 +194,13 @@ PlainTextEditor* MainUI::currentEditor(){ return static_cast<PlainTextEditor*>( tabWidget->currentWidget() ); } +QString MainUI::currentFile(){ + PlainTextEditor* cur = currentEditor(); + if(cur!=0){ + return cur->currentFile(); + } + return ""; +} QString MainUI::currentFileDir(){ PlainTextEditor* cur = currentEditor(); QString dir; @@ -228,7 +235,7 @@ void MainUI::OpenFile(QString file){ QStringList files; if(file.isEmpty()){ //Prompt for a file to open - files = QFileDialog::getOpenFileNames(this, tr("Open File(s)"), currentFileDir(), tr("Text Files (*)") ); + files = QFileDialog::getOpenFileNames(this, tr("Open File(s)"), currentFile(), tr("Text Files (*)") ); if(files.isEmpty()){ return; } //cancelled }else{ files << file; |