2014-03-10 16:55:11 +01:00
|
|
|
/* ============================================================
|
2017-08-25 17:11:29 +02:00
|
|
|
* Falkon - Qt web browser
|
2018-01-02 14:53:43 +01:00
|
|
|
* Copyright (C) 2014-2018 David Rosca <nowrep@gmail.com>
|
2014-03-10 16:55:11 +01:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
* ============================================================ */
|
|
|
|
#ifndef MAINMENU_H
|
|
|
|
#define MAINMENU_H
|
|
|
|
|
|
|
|
#include <QMenu>
|
|
|
|
#include <QHash>
|
|
|
|
#include <QPointer>
|
|
|
|
|
|
|
|
#include "qzcommon.h"
|
|
|
|
|
|
|
|
class QMenuBar;
|
|
|
|
|
2014-11-07 17:16:22 +01:00
|
|
|
class Preferences;
|
2014-03-10 16:55:11 +01:00
|
|
|
class HistoryMenu;
|
|
|
|
class BookmarksMenu;
|
|
|
|
class BrowserWindow;
|
|
|
|
|
2017-08-25 17:11:29 +02:00
|
|
|
class FALKON_EXPORT MainMenu : public QMenu
|
2014-03-10 16:55:11 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit MainMenu(BrowserWindow* window, QWidget* parent = 0);
|
|
|
|
|
|
|
|
|
|
|
|
void initMenuBar(QMenuBar* menuBar) const;
|
|
|
|
void initSuperMenu(QMenu* superMenu) const;
|
|
|
|
|
|
|
|
QAction* action(const QString &name) const;
|
|
|
|
|
2018-02-25 13:33:07 +01:00
|
|
|
public Q_SLOTS:
|
2017-03-20 09:07:33 +01:00
|
|
|
void setWindow(BrowserWindow* window);
|
|
|
|
|
2018-02-25 13:33:07 +01:00
|
|
|
private Q_SLOTS:
|
2014-03-10 16:55:11 +01:00
|
|
|
// Standard actions
|
|
|
|
void showAboutDialog();
|
|
|
|
void showPreferences();
|
|
|
|
void quitApplication();
|
|
|
|
|
|
|
|
// File menu
|
|
|
|
void newTab();
|
|
|
|
void newWindow();
|
|
|
|
void newPrivateWindow();
|
|
|
|
void openLocation();
|
|
|
|
void openFile();
|
|
|
|
void closeWindow();
|
2016-09-18 12:09:38 +02:00
|
|
|
void savePageAs();
|
2014-03-10 16:55:11 +01:00
|
|
|
void sendLink();
|
|
|
|
void printPage();
|
|
|
|
|
|
|
|
// Edit menu
|
|
|
|
void editUndo();
|
|
|
|
void editRedo();
|
|
|
|
void editCut();
|
|
|
|
void editCopy();
|
|
|
|
void editPaste();
|
|
|
|
void editSelectAll();
|
|
|
|
void editFind();
|
|
|
|
|
|
|
|
// View menu
|
|
|
|
void showStatusBar();
|
|
|
|
void stop();
|
|
|
|
void reload();
|
|
|
|
void zoomIn();
|
|
|
|
void zoomOut();
|
|
|
|
void zoomReset();
|
|
|
|
void showPageSource();
|
|
|
|
void showFullScreen();
|
|
|
|
|
|
|
|
// Tools menu
|
|
|
|
void webSearch();
|
|
|
|
void showSiteInfo();
|
|
|
|
void showDownloadManager();
|
|
|
|
void showCookieManager();
|
2015-09-29 23:35:16 +02:00
|
|
|
void toggleWebInspector();
|
2014-03-10 16:55:11 +01:00
|
|
|
void showClearRecentHistoryDialog();
|
|
|
|
|
|
|
|
// Help menu
|
|
|
|
void aboutQt();
|
|
|
|
void showInfoAboutApp();
|
|
|
|
void showConfigInfo();
|
|
|
|
void reportIssue();
|
|
|
|
|
|
|
|
// Other actions
|
|
|
|
void restoreClosedTab();
|
|
|
|
|
|
|
|
void aboutToShowFileMenu();
|
|
|
|
void aboutToShowViewMenu();
|
|
|
|
void aboutToShowEditMenu();
|
|
|
|
void aboutToShowToolsMenu();
|
2015-04-09 20:07:56 +02:00
|
|
|
void aboutToShowSuperMenu();
|
2014-03-10 16:55:11 +01:00
|
|
|
|
|
|
|
void aboutToShowToolbarsMenu();
|
|
|
|
void aboutToShowSidebarsMenu();
|
|
|
|
void aboutToShowEncodingMenu();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void init();
|
|
|
|
void addActionsToWindow();
|
2014-03-10 19:41:44 +01:00
|
|
|
void callSlot(const char* slot);
|
2014-03-10 16:55:11 +01:00
|
|
|
|
|
|
|
QHash<QString, QAction*> m_actions;
|
|
|
|
QPointer<BrowserWindow> m_window;
|
2014-11-07 17:16:22 +01:00
|
|
|
QPointer<Preferences> m_preferences;
|
2014-03-10 16:55:11 +01:00
|
|
|
|
|
|
|
QMenu* m_menuFile;
|
|
|
|
QMenu* m_menuEdit;
|
|
|
|
QMenu* m_menuView;
|
|
|
|
QMenu* m_menuTools;
|
|
|
|
QMenu* m_menuHelp;
|
2015-10-13 02:34:47 +02:00
|
|
|
QMenu* m_submenuExtensions;
|
2014-03-10 16:55:11 +01:00
|
|
|
HistoryMenu* m_menuHistory;
|
|
|
|
BookmarksMenu* m_menuBookmarks;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAINMENU_H
|