aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow/mainwindow.h
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-07-01 18:13:01 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-07-01 18:13:01 +0200
commitaa8198eec380659fd3538e058b50c24b0f88743c (patch)
treeb9ae32ac4192de87054a8892d4e654a45737a04e /src/mainwindow/mainwindow.h
parentAdd browser.locale and browser.translation (diff)
downloadsmolbote-aa8198eec380659fd3538e058b50c24b0f88743c.tar.xz
Code cleanup
Clean up MainWindow Configuration is now a std::unique_ptr Connect downloads and request interceptor to all profiles
Diffstat (limited to 'src/mainwindow/mainwindow.h')
-rw-r--r--src/mainwindow/mainwindow.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mainwindow/mainwindow.h b/src/mainwindow/mainwindow.h
index 287602a..d695dd8 100644
--- a/src/mainwindow/mainwindow.h
+++ b/src/mainwindow/mainwindow.h
@@ -22,6 +22,11 @@ class SearchForm;
class WebView;
class NavigationBar;
class WebProfile;
+
+namespace Ui {
+class MainWindow;
+}
+
class MainWindow : public QMainWindow
{
friend class Browser;
@@ -33,12 +38,10 @@ public:
ToolsMenu
};
- explicit MainWindow(std::shared_ptr<Configuration> &config, QWidget *parent = nullptr);
+ explicit MainWindow(const std::unique_ptr<Configuration> &config, QWidget *parent = nullptr);
Q_DISABLE_COPY(MainWindow)
~MainWindow() override;
- void createMenuBar();
-
void addAction(ActionLocation where, QAction *action);
void addDockWidget(Qt::DockWidgetArea area, QWidget *widget);
void removeDockWidget(QWidget *widget);
@@ -48,15 +51,16 @@ public:
public slots:
void createTab(const QUrl &url);
- SubWindow *createSubWindow(WebProfile *profile);
- SubWindow *createSubWindow(const QString &url = QString());
+ SubWindow *createSubWindow(const std::unique_ptr<Configuration> &config, WebProfile *profile);
+private slots:
void setView(WebView *view);
protected:
void closeEvent(QCloseEvent *event) override;
private:
+ Ui::MainWindow *ui;
QAction *subWindowAction = nullptr;
QMenu *toolsMenu = nullptr;
@@ -67,8 +71,6 @@ private:
QMdiArea *mdiArea;
WebView *currentView = nullptr;
- std::shared_ptr<Configuration> m_config;
-
QMetaObject::Connection viewChangedConnection;
QMetaObject::Connection searchBoxConnection;
QMetaObject::Connection statusBarConnection;