aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/widgets/TextEdit.cpp
diff options
context:
space:
mode:
authorSaturn&Eric <[email protected]>2021-12-07 08:37:54 +0000
committerGitHub <[email protected]>2021-12-07 08:37:54 +0000
commitcc89ad54ab3dd4aeb3ed7afeed59a80b6e61649c (patch)
tree865d2298d836c8eb36584b5d268325bca4a66a78 /src/ui/widgets/TextEdit.cpp
parentMerge pull request #26 from saturneric/develop (diff)
parentFix Bugs on KeyUploadDialog (diff)
downloadGpgFrontend-cc89ad54ab3dd4aeb3ed7afeed59a80b6e61649c.tar.gz
GpgFrontend-cc89ad54ab3dd4aeb3ed7afeed59a80b6e61649c.zip
Merge pull request #28 from saturneric/develop
Diffstat (limited to 'src/ui/widgets/TextEdit.cpp')
-rw-r--r--src/ui/widgets/TextEdit.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/ui/widgets/TextEdit.cpp b/src/ui/widgets/TextEdit.cpp
index 8d4ea4a0..ec6c6c7a 100644
--- a/src/ui/widgets/TextEdit.cpp
+++ b/src/ui/widgets/TextEdit.cpp
@@ -51,7 +51,8 @@ void TextEdit::slotNewTab() {
QString header = _("untitled") + QString::number(++countPage) + ".txt";
auto* page = new EditorPage();
- tabWidget->addTab(page, header);
+ auto index = tabWidget->addTab(page, header);
+ tabWidget->setTabIcon(index, QIcon(":file.png"));
tabWidget->setCurrentIndex(tabWidget->count() - 1);
page->getTextPage()->setFocus();
connect(page->getTextPage()->document(), SIGNAL(modificationChanged(bool)),
@@ -66,10 +67,12 @@ 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, "[Browser]");
+ auto index = tabWidget->addTab(page, QString());
+ tabWidget->setTabIcon(index, QIcon(":file-browser.png"));
tabWidget->setCurrentIndex(tabWidget->count() - 1);
- connect(page, SIGNAL(pathChanged(const QString&)), this,
- SLOT(slotFilePagePathChanged(const QString&)));
+ connect(page, &FilePage::pathChanged, this,
+ &TextEdit::slotFilePagePathChanged);
+ page->slotGoPath();
}
void TextEdit::slotOpenFile(QString& path) {
@@ -580,7 +583,6 @@ void TextEdit::slotFilePagePathChanged(const QString& path) const {
} else {
mPath = tPath;
}
- mPath.prepend("[Browser] ");
tabWidget->setTabText(index, mPath);
}