aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt10
-rw-r--r--src/browser.cpp2
-rw-r--r--src/mainwindow/mainwindow.cpp18
-rw-r--r--src/mainwindow/mainwindow.h1
-rw-r--r--src/mainwindow/mainwindow.ui28
-rw-r--r--src/session.cpp2
-rw-r--r--src/subwindow/subwindow.cpp (renamed from src/mainwindow/subwindow.cpp)17
-rw-r--r--src/subwindow/subwindow.h (renamed from src/mainwindow/subwindow.h)0
-rw-r--r--src/subwindow/tabwidget.cpp (renamed from src/mainwindow/widgets/tabwidget.cpp)0
-rw-r--r--src/subwindow/tabwidget.h (renamed from src/mainwindow/widgets/tabwidget.h)0
-rw-r--r--src/webengine/webview.cpp2
11 files changed, 42 insertions, 38 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5c7b6df..4549155 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -21,8 +21,6 @@ set(poi_SRC
mainwindow/mainwindow.cpp
mainwindow/mainwindow.h
mainwindow/mainwindow.ui
- mainwindow/subwindow.cpp
- mainwindow/subwindow.h
mainwindow/widgets/dockwidget.cpp
mainwindow/widgets/dockwidget.h
mainwindow/widgets/navigationbar.cpp
@@ -30,8 +28,12 @@ set(poi_SRC
mainwindow/widgets/searchform.cpp
mainwindow/widgets/searchform.h
mainwindow/widgets/searchform.ui
- mainwindow/widgets/tabwidget.cpp
- mainwindow/widgets/tabwidget.h
+
+ # subwindow
+ subwindow/subwindow.cpp
+ subwindow/subwindow.h
+ subwindow/tabwidget.cpp
+ subwindow/tabwidget.h
# webengine
webengine/urlinterceptor.cpp
diff --git a/src/browser.cpp b/src/browser.cpp
index 46018fb..375796c 100644
--- a/src/browser.cpp
+++ b/src/browser.cpp
@@ -9,7 +9,7 @@
#include "browser.h"
#include "addressbar/addressbar.h"
#include "mainwindow/mainwindow.h"
-#include "mainwindow/subwindow.h"
+#include "subwindow/subwindow.h"
#include "webengine/urlinterceptor.h"
#include <QAction>
#include <QDir>
diff --git a/src/mainwindow/mainwindow.cpp b/src/mainwindow/mainwindow.cpp
index 6cf3f84..7f9cdcc 100644
--- a/src/mainwindow/mainwindow.cpp
+++ b/src/mainwindow/mainwindow.cpp
@@ -10,7 +10,7 @@
#include "ui_mainwindow.h"
#include "addressbar/addressbar.h"
#include "browser.h"
-#include "subwindow.h"
+#include "subwindow/subwindow.h"
#include "webengine/webview.h"
#include "widgets/dockwidget.h"
#include "widgets/navigationbar.h"
@@ -137,13 +137,11 @@ MainWindow::MainWindow(const std::unique_ptr<Configuration> &config, QWidget *pa
// connect window menu
{
- connect(ui->actionTileWindows, &QAction::triggered, mdiArea, &QMdiArea::tileSubWindows);
- config->setShortcut(ui->actionTileWindows, "mainwindow.shortcuts.tileWindows");
+ connect(ui->actionTileSubwindows, &QAction::triggered, mdiArea, &QMdiArea::tileSubWindows);
+ config->setShortcut(ui->actionTileSubwindows, "mainwindow.shortcuts.tileWindows");
- connect(ui->actionCascadeWindows, &QAction::triggered, mdiArea, &QMdiArea::cascadeSubWindows);
- config->setShortcut(ui->actionCascadeWindows, "mainwindow.shortcuts.cascadeWindows");
-
- subWindowAction = ui->actionCurrentWindow;
+ connect(ui->actionCascadeSubwindows, &QAction::triggered, mdiArea, &QMdiArea::cascadeSubWindows);
+ config->setShortcut(ui->actionCascadeSubwindows, "mainwindow.shortcuts.cascadeWindows");
}
// connect page menu
@@ -205,16 +203,16 @@ MainWindow::MainWindow(const std::unique_ptr<Configuration> &config, QWidget *pa
disconnect(viewChangedConnection);
disconnect(searchBoxConnection);
disconnect(statusBarConnection);
- subWindowAction->setMenu(nullptr);
+ ui->actionCurrentSubwindow->setMenu(nullptr);
auto *w = qobject_cast<SubWindow *>(window);
if(w == nullptr) {
// no current subwindow, clear everything
setView(nullptr);
- subWindowAction->setMenu(nullptr);
+ ui->actionCurrentSubwindow->setMenu(nullptr);
} else {
setView(w->currentView());
- subWindowAction->setMenu(w->systemMenu());
+ ui->actionCurrentSubwindow->setMenu(w->systemMenu());
viewChangedConnection = connect(w, &SubWindow::currentViewChanged, this, &MainWindow::setView);
statusBarConnection = connect(w, &SubWindow::showStatusMessage, statusBar(), &QStatusBar::showMessage);
}
diff --git a/src/mainwindow/mainwindow.h b/src/mainwindow/mainwindow.h
index 3768348..3abeb39 100644
--- a/src/mainwindow/mainwindow.h
+++ b/src/mainwindow/mainwindow.h
@@ -65,7 +65,6 @@ protected:
private:
Ui::MainWindow *ui;
- QAction *subWindowAction = nullptr;
QMenu *toolsMenu = nullptr;
QMenu *pageLoadProfileMenu = nullptr;
diff --git a/src/mainwindow/mainwindow.ui b/src/mainwindow/mainwindow.ui
index d670b66..cb6d39e 100644
--- a/src/mainwindow/mainwindow.ui
+++ b/src/mainwindow/mainwindow.ui
@@ -37,19 +37,19 @@
</widget>
<widget class="QMenu" name="menuSession">
<property name="title">
- <string>Session</string>
+ <string>Sessio&amp;n</string>
</property>
<addaction name="actionSaveSession"/>
<addaction name="actionLoadSession"/>
</widget>
- <widget class="QMenu" name="menuWindow">
+ <widget class="QMenu" name="menuSubWindow">
<property name="title">
- <string>Wi&amp;ndow</string>
+ <string>S&amp;ubwindow</string>
</property>
- <addaction name="actionTileWindows"/>
- <addaction name="actionCascadeWindows"/>
+ <addaction name="actionTileSubwindows"/>
+ <addaction name="actionCascadeSubwindows"/>
<addaction name="separator"/>
- <addaction name="actionCurrentWindow"/>
+ <addaction name="actionCurrentSubwindow"/>
</widget>
<widget class="QMenu" name="menuTools">
<property name="title">
@@ -69,7 +69,7 @@
</widget>
<addaction name="menusmolbote"/>
<addaction name="menuSession"/>
- <addaction name="menuWindow"/>
+ <addaction name="menuSubWindow"/>
<addaction name="menuPage"/>
<addaction name="menuTools"/>
</widget>
@@ -109,19 +109,19 @@
<string>&amp;Load Session</string>
</property>
</action>
- <action name="actionTileWindows">
+ <action name="actionTileSubwindows">
<property name="text">
- <string>&amp;Tile Windows</string>
+ <string>&amp;Tile Subwindows</string>
</property>
</action>
- <action name="actionCascadeWindows">
+ <action name="actionCascadeSubwindows">
<property name="text">
- <string>&amp;Cascade Windows</string>
+ <string>&amp;Cascade Subwindows</string>
</property>
</action>
- <action name="actionCurrentWindow">
+ <action name="actionCurrentSubwindow">
<property name="text">
- <string>Current &amp;Window</string>
+ <string>Current &amp;Subwindow</string>
</property>
</action>
<action name="actionBookmarkPage">
@@ -146,7 +146,7 @@
</action>
<action name="actionDeveloperTools">
<property name="text">
- <string>Developer Tools</string>
+ <string>&amp;Developer Tools</string>
</property>
</action>
</widget>
diff --git a/src/session.cpp b/src/session.cpp
index 0cbb0e8..0781cd7 100644
--- a/src/session.cpp
+++ b/src/session.cpp
@@ -8,7 +8,7 @@
#include "session.h"
#include "mainwindow/mainwindow.h"
-#include "mainwindow/subwindow.h"
+#include "subwindow/subwindow.h"
#include <QJsonObject>
#include <QJsonArray>
#include "webengine/webview.h"
diff --git a/src/mainwindow/subwindow.cpp b/src/subwindow/subwindow.cpp
index bdb852a..580bf68 100644
--- a/src/mainwindow/subwindow.cpp
+++ b/src/subwindow/subwindow.cpp
@@ -9,7 +9,7 @@
#include "subwindow.h"
#include "browser.h"
#include "webengine/webview.h"
-#include "widgets/tabwidget.h"
+#include "tabwidget.h"
#include <QAction>
#include <QJsonArray>
#include <QJsonDocument>
@@ -36,12 +36,15 @@ SubWindow::SubWindow(const std::unique_ptr<Configuration> &config, QWidget *pare
// system menu
{
- auto *menu = systemMenu();
- menu->addSeparator();
+ QMenu *menu = systemMenu();
+ auto *firstAction = menu->actions().at(0);
- auto *profileName_action = menu->addAction(tr("Profile: %1").arg(m_profile->name()));
+ auto *profileName_action = new QAction(tr("Profile: %1").arg(m_profile->name()), menu);
profileName_action->setEnabled(false);
- auto *loadProfile_menu = menu->addMenu(tr("Load profile"));
+ menu->insertAction(firstAction, profileName_action);
+
+ auto *loadProfile_menu = new QMenu(tr("Load profile"), menu);
+ menu->insertMenu(firstAction, loadProfile_menu);
Browser *browser = qobject_cast<Browser *>(qApp);
Q_CHECK_PTR(browser);
@@ -49,7 +52,7 @@ SubWindow::SubWindow(const std::unique_ptr<Configuration> &config, QWidget *pare
ProfileIterator it(ProfileManager::profileList());
while(it.hasNext()) {
it.next();
- auto *profile =it.value();
+ auto *profile = it.value();
auto *loadAction = loadProfile_menu->addAction(profile->name());
connect(loadAction, &QAction::triggered, this, [=]() {
@@ -57,6 +60,8 @@ SubWindow::SubWindow(const std::unique_ptr<Configuration> &config, QWidget *pare
profileName_action->setText(tr("Profile: %1").arg(profile->name()));
});
}
+
+ menu->insertSeparator(firstAction);
}
// new tab button
diff --git a/src/mainwindow/subwindow.h b/src/subwindow/subwindow.h
index b7c4aee..b7c4aee 100644
--- a/src/mainwindow/subwindow.h
+++ b/src/subwindow/subwindow.h
diff --git a/src/mainwindow/widgets/tabwidget.cpp b/src/subwindow/tabwidget.cpp
index 1ddfc95..1ddfc95 100644
--- a/src/mainwindow/widgets/tabwidget.cpp
+++ b/src/subwindow/tabwidget.cpp
diff --git a/src/mainwindow/widgets/tabwidget.h b/src/subwindow/tabwidget.h
index 793e041..793e041 100644
--- a/src/mainwindow/widgets/tabwidget.h
+++ b/src/subwindow/tabwidget.h
diff --git a/src/webengine/webview.cpp b/src/webengine/webview.cpp
index 8e137de..14cb020 100644
--- a/src/webengine/webview.cpp
+++ b/src/webengine/webview.cpp
@@ -7,7 +7,7 @@
*/
#include "webview.h"
-#include "mainwindow/subwindow.h"
+#include "subwindow/subwindow.h"
#include "webpage.h"
#include "webprofile.h"
#include <QContextMenuEvent>