aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/widgets/TextEdit.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-07-20 16:42:50 +0000
committerSaturneric <[email protected]>2021-07-20 16:42:50 +0000
commitc57feb6a678e27140bb9ae7d132b641947514c31 (patch)
tree5ed7a7728c084214ce858323a4eccdcba98200b6 /src/ui/widgets/TextEdit.cpp
parentUpdate Workflow (diff)
parentFix problem that macos cannot use multi-languages. (diff)
downloadGpgFrontend-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.cpp11
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);
}