aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-05-28 11:54:11 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-05-28 11:54:11 +0200
commit54f425f4013938d1736aad220bb6a48703bfeae7 (patch)
tree6a2d09e54e41b3a5c61cfbcd9f934017ed1b0f04
parentChanging Window profile (diff)
downloadsmolbote-54f425f4013938d1736aad220bb6a48703bfeae7.tar.xz
Show profile name in window title
-rw-r--r--src/mainwindow/window.cpp6
-rw-r--r--src/mainwindow/window.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/mainwindow/window.cpp b/src/mainwindow/window.cpp
index e3d5516..3d7d037 100644
--- a/src/mainwindow/window.cpp
+++ b/src/mainwindow/window.cpp
@@ -121,6 +121,11 @@ Window::~Window()
delete tabWidget;
}
+void Window::setWindowTitle(const QString &title)
+{
+ QMdiSubWindow::setWindowTitle(QString("%1 :%2").arg(title, profile->name()));
+}
+
WebView *Window::currentView()
{
return qobject_cast<WebView *>(tabWidget->currentWidget());
@@ -134,6 +139,7 @@ WebView *Window::view(int index) const
void Window::setProfile(WebProfile *profile)
{
Q_ASSERT_X(profile != nullptr, "Window::setProfile", "Tried to set null profile");
+ this->profile = profile;
for(int i = 0; i < tabWidget->count(); ++i) {
auto *view = qobject_cast<WebView *>(tabWidget->widget(i));
const auto url = view->url();
diff --git a/src/mainwindow/window.h b/src/mainwindow/window.h
index 6431466..4d15e8d 100644
--- a/src/mainwindow/window.h
+++ b/src/mainwindow/window.h
@@ -24,6 +24,8 @@ public:
explicit Window(const QHash<QString, QString> &config, QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
~Window() override;
+ void setWindowTitle(const QString &title);
+
WebView *currentView();
WebView *view(int index) const;