From 54f425f4013938d1736aad220bb6a48703bfeae7 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Mon, 28 May 2018 11:54:11 +0200 Subject: Show profile name in window title --- src/mainwindow/window.cpp | 6 ++++++ src/mainwindow/window.h | 2 ++ 2 files changed, 8 insertions(+) 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(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(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 &config, QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags()); ~Window() override; + void setWindowTitle(const QString &title); + WebView *currentView(); WebView *view(int index) const; -- cgit v1.2.1