diff options
author | Saturneric <[email protected]> | 2021-07-20 16:42:50 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2021-07-20 16:42:50 +0000 |
commit | c57feb6a678e27140bb9ae7d132b641947514c31 (patch) | |
tree | 5ed7a7728c084214ce858323a4eccdcba98200b6 /src/ui/widgets/TextEdit.cpp | |
parent | Update Workflow (diff) | |
parent | Fix problem that macos cannot use multi-languages. (diff) | |
download | GpgFrontend-c57feb6a678e27140bb9ae7d132b641947514c31.tar.gz GpgFrontend-c57feb6a678e27140bb9ae7d132b641947514c31.zip |
Merge branch 'develop' into develop-ci
Diffstat (limited to 'src/ui/widgets/TextEdit.cpp')
-rw-r--r-- | src/ui/widgets/TextEdit.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/ui/widgets/TextEdit.cpp b/src/ui/widgets/TextEdit.cpp index 26cc3834..eab0f799 100644 --- a/src/ui/widgets/TextEdit.cpp +++ b/src/ui/widgets/TextEdit.cpp @@ -37,9 +37,6 @@ TextEdit::TextEdit(QWidget *parent) : QWidget(parent) { layout->setSpacing(0); setLayout(layout); - // Front in same width - this->setFont({"Courier"}); - connect(tabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(removeTab(int))); connect(this, &TextEdit::insertTargetTextPage, this, @@ -73,7 +70,7 @@ void TextEdit::slotNewHelpTab(const QString &title, const QString &path) const { void TextEdit::slotNewFileTab() const { auto *page = new FilePage(qobject_cast<QWidget *>(parent())); - tabWidget->addTab(page, "[File Browser]"); + tabWidget->addTab(page, "[Browser]"); tabWidget->setCurrentIndex(tabWidget->count() - 1); connect(page, SIGNAL(pathChanged(const QString &)), this, SLOT(slotFilePagePathChanged(const QString &))); @@ -132,6 +129,7 @@ void TextEdit::slotInsertTargetTextPage(const QString &pagePtr, auto *taregtTextPage = qobject_cast<EditorPage *>(it.value()); if (taregtTextPage != nullptr) { taregtTextPage->getTextPage()->insertPlainText(text); + taregtTextPage->getTextPage()->document()->setModified(false); } } } @@ -164,6 +162,7 @@ void TextEdit::slotReadTargetTextPageDone(const QString &pagePtr) { tabWidget->setTabText(index, strippedName(taregtTextPage->getFilePath())); } + taregtTextPage->getTextPage()->document()->setModified(false); connect(taregtTextPage->getTextPage()->document(), SIGNAL(modificationChanged(bool)), this, SLOT(slotShowModified())); @@ -638,13 +637,13 @@ void TextEdit::slotFilePagePathChanged(const QString &path) { int index = tabWidget->currentIndex(); QString mPath; QFileInfo fileInfo(path); - QString tPath = fileInfo.path(); + QString tPath = fileInfo.absoluteFilePath(); if (path.size() > 18) { mPath = tPath.mid(tPath.size() - 18, 18).prepend("..."); } else { mPath = tPath; } - mPath.prepend("[File Browser] "); + mPath.prepend("[Browser] "); mPath.append("/"); tabWidget->setTabText(index, mPath); } |