aboutsummaryrefslogtreecommitdiff
path: root/src/subwindow/subwindow.h
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-12-15 15:48:28 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2018-12-15 15:48:28 +0100
commit4066c1f093b572b949f9b1f5b0dc1c1a646b7552 (patch)
treed1b220e65ac6e8c527c107dc7386a38afb930374 /src/subwindow/subwindow.h
parentAdd SaveSessionDialog (diff)
downloadsmolbote-4066c1f093b572b949f9b1f5b0dc1c1a646b7552.tar.xz
Move tab actions to Subwindow menu
Diffstat (limited to 'src/subwindow/subwindow.h')
-rw-r--r--src/subwindow/subwindow.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/subwindow/subwindow.h b/src/subwindow/subwindow.h
index 1fc0097..eb7973f 100644
--- a/src/subwindow/subwindow.h
+++ b/src/subwindow/subwindow.h
@@ -22,9 +22,16 @@ class SubWindow : public QMdiSubWindow
Q_OBJECT
public:
+ struct TabData
+ {
+ bool closeLocked = false;
+ bool refreshLocked = false;
+ };
+
explicit SubWindow(const Configuration *config, QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
~SubWindow() override;
+ int currentTabIndex() const;
WebView *currentView();
WebView *view(int index) const;
int tabCount() const;
@@ -32,13 +39,19 @@ public:
void setProfile(WebProfile *profile);
WebProfile *profile() const;
+ void setTabData(TabData &data, int index);
+ TabData tabData(int index) const;
+
signals:
void currentViewChanged(WebView *view);
void showStatusMessage(const QString &message, int timeout = 0);
public slots:
int addTab(const QUrl &url = QUrl(), WebProfile *profile = nullptr);
+ void closeTab(int index);
+
void setCurrentTab(int index);
+ void moveTab(int from, int to);
int restoreLastTab();
void restoreTabMenu(QMenu *menu);
@@ -51,4 +64,6 @@ private:
QMetaObject::Connection linkHoveredConnection;
};
+Q_DECLARE_METATYPE(SubWindow::TabData)
+
#endif // SMOLBOTE_SUBWINDOW_H