aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-01-16 17:35:08 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2017-01-16 17:35:08 +0100
commit06c640ce4b69fd2abe6df35cdb6a0387795e4220 (patch)
treeec2d1c3c5fa6a99220e6c92e4e39a751840935e5 /src/mainwindow.cpp
parentrenamed scripts/ to util/ (diff)
downloadsmolbote-06c640ce4b69fd2abe6df35cdb6a0387795e4220.tar.xz
Added About dialog
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 1a52ee2..f97f8b0 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -50,22 +50,27 @@ MainWindow::MainWindow(Browser *instance, QUrl defaultUrl, QWidget *parent) :
resize(settings.value("window/width", 800).toInt(), settings.value("window/height", 600).toInt());
// Browser menu
- browserMenu = new QMenu(qApp->applicationName(), ui->menuBar);
+ QMenu *browserMenu = new QMenu(qApp->applicationName(), ui->menuBar);
ui->menuBar->addMenu(browserMenu);
browserMenu->addAction(tr("New Window"), this, SLOT(handleNewWindow()), QKeySequence(tr("Ctrl+N")));
browserMenu->addAction(tr("New Tab"), this, SLOT(createNewTab()), QKeySequence(tr("Ctrl+T")));
browserMenu->addSeparator();
+ browserMenu->addAction(tr("About"), this, SLOT(about()), QKeySequence(tr("F1")));
browserMenu->addAction(tr("About Qt"), qApp, SLOT(aboutQt()));
browserMenu->addAction(tr("Quit"), qApp, SLOT(quit()), QKeySequence(tr("Ctrl+Q")));
+ // Tools menu
+ QMenu *toolsMenu = new QMenu(tr("Tools"), ui->menuBar);
+ ui->menuBar->addMenu(toolsMenu);
+ toolsMenu->addAction(tr("Downloads"), downloadManager, SLOT(show()));
+
// Profile menu
QMenuBar *rightBar = new QMenuBar(ui->menuBar);
profileMenu = new QMenu(tr("Profile: ") + profileName);
rightBar->addMenu(profileMenu);
ui->menuBar->setCornerWidget(rightBar);
- profileMenu->addAction(tr("Edit profile"), this, SLOT(createProfileDialog()));
- profileMenu->addAction(tr("Load profile"), this, SLOT(handleLoadProfile()));
- profileMenu->addAction(tr("Downloads"), downloadManager, SLOT(show()));
+ profileMenu->addAction(tr("Edit profile"), this, SLOT(execProfileEditor()));
+ profileMenu->addAction(tr("Load profile"), this, SLOT(loadProfileGUI()));
//profileMenu->addAction(tr("Settings"));
//profileMenu->addAction(tr("Cookies"));
@@ -107,6 +112,15 @@ void MainWindow::closeEvent(QCloseEvent *event)
QMainWindow::closeEvent(event);
}
+void MainWindow::about()
+{
+ QMessageBox::about(this, tr("About"), tr("<h3>smolbote</h3>"
+ "<p><i>yet another Qute browser</i></p>"
+ "<p>Copyright (C) 2017 Xian Nox</p>"
+ "<p>This program comes with ABSOLUTELY NO WARRANTY. "
+ "This is free software, and you are welcome to redistribute it under the conditions set by the GNU GPLv3.</p>"));
+}
+
void MainWindow::loadProfile(const QString &name)
{
if(profile) {
@@ -126,7 +140,7 @@ void MainWindow::loadProfile(const QString &name)
connect(profile, SIGNAL(downloadRequested(QWebEngineDownloadItem*)), downloadManager, SLOT(addDownload(QWebEngineDownloadItem*)));
}
-void MainWindow::handleLoadProfile()
+void MainWindow::loadProfileGUI()
{
bool ok;
QString name = QInputDialog::getText(this, tr("Load Profile"), tr("Enter Profile name"), QLineEdit::Normal, QString(""), &ok);
@@ -169,7 +183,7 @@ void MainWindow::handleTitleUpdated(const QString &title)
setWindowTitle(title + settings.value("window/title").toString());
}
-void MainWindow::createProfileDialog()
+void MainWindow::execProfileEditor()
{
ProfileDialog *dialog = new ProfileDialog(profile, this);
dialog->exec();