diff options
-rw-r--r-- | src/mainwindow/window.cpp | 6 | ||||
-rw-r--r-- | src/mainwindow/window.h | 2 |
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; |