From 8e140bc9b7c85851889964647d93b2187ae46449 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Mon, 23 Jan 2017 16:59:50 +0100 Subject: Made Profile menu a regular menu --- src/data/icon.svg | 37 +++++++++++++++++++++++++++++++++++++ src/data/resources.qrc | 5 +++++ src/forms/profiledialog.cpp | 4 ++++ src/main.cpp | 1 + src/mainwindow.cpp | 9 +++------ src/mainwindow.h | 1 - src/smolbote.pro | 3 +++ test/blocklist.txt | 2 +- 8 files changed, 54 insertions(+), 8 deletions(-) create mode 100644 src/data/icon.svg create mode 100644 src/data/resources.qrc diff --git a/src/data/icon.svg b/src/data/icon.svg new file mode 100644 index 0000000..a2ae055 --- /dev/null +++ b/src/data/icon.svg @@ -0,0 +1,37 @@ + + + + Vector Toks, the Lanix Penguin + + + + + + image/svg+xml + + Vector Toks, the Lanix Penguin + 2015-08-01 + + + IBPX, originally by reddit.com/u/creed10 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/data/resources.qrc b/src/data/resources.qrc new file mode 100644 index 0000000..c29d7fe --- /dev/null +++ b/src/data/resources.qrc @@ -0,0 +1,5 @@ + + + icon.svg + + diff --git a/src/forms/profiledialog.cpp b/src/forms/profiledialog.cpp index 3d93dd0..a3e7c60 100644 --- a/src/forms/profiledialog.cpp +++ b/src/forms/profiledialog.cpp @@ -33,6 +33,10 @@ ProfileDialog::ProfileDialog(QWebEngineProfile *profile, QWidget *parent) : _profile = profile; ui->setupUi(this); + if(!_profile->storageName().isEmpty()) + setWindowTitle(_profile->storageName()); + else + setWindowTitle(tr("Off-the-record")); // http ui->userAgent->setPlainText(_profile->httpUserAgent()); diff --git a/src/main.cpp b/src/main.cpp index 698a4a4..2a28439 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -28,6 +28,7 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); app.setApplicationName("smolbote"); app.setApplicationVersion("0.0.0"); + app.setWindowIcon(QIcon(QLatin1String(":/icon.svg"))); QCommandLineParser parser; parser.setApplicationDescription("Test browser using QtWebEngine"); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 3f23448..2b7a2b9 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -65,11 +65,9 @@ MainWindow::MainWindow(Browser *instance, QUrl defaultUrl, QWidget *parent) : 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(execProfileEditor())); + QMenu *profileMenu = new QMenu(tr("Profile"), ui->menuBar); + ui->menuBar->addMenu(profileMenu); + profileMenu->addAction(tr("View profile"), this, SLOT(execProfileEditor())); profileMenu->addAction(tr("Load profile"), this, SLOT(loadProfileGUI())); //profileMenu->addAction(tr("Settings")); //profileMenu->addAction(tr("Cookies")); @@ -148,7 +146,6 @@ void MainWindow::loadProfileGUI() QString name = QInputDialog::getText(this, tr("Load Profile"), tr("Enter Profile name"), QLineEdit::Normal, QString(""), &ok); if(ok) { loadProfile(name); - profileMenu->setTitle(tr("Profile: ") + profileName); tabBar->setProfile(profile); } } diff --git a/src/mainwindow.h b/src/mainwindow.h index 0b01783..351a794 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -71,7 +71,6 @@ private: // ui Ui::MainWindow *ui; - QMenu *profileMenu; QToolBar *navigationToolBar, *tabToolBar; WebViewTabBar *tabBar; QLineEdit *urlLineEdit; diff --git a/src/smolbote.pro b/src/smolbote.pro index d7505c8..857a60a 100644 --- a/src/smolbote.pro +++ b/src/smolbote.pro @@ -38,3 +38,6 @@ FORMS += mainwindow.ui \ forms/profiledialog.ui \ forms/downloaddialog.ui \ webengine/downloaditemform.ui + +RESOURCES += \ + data/resources.qrc diff --git a/test/blocklist.txt b/test/blocklist.txt index a66bee5..376b168 100644 --- a/test/blocklist.txt +++ b/test/blocklist.txt @@ -11,4 +11,4 @@ ! or via e-mail (easylist.subscription@gmail.com). ! ! -----------------------General advert blocking filters-----------------------! -css +!css -- cgit v1.2.1