diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2020-08-17 12:05:40 +0200 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2020-08-17 12:05:40 +0200 |
| commit | 3d1f480798f8708a85785d16f10ae10ed997bfeb (patch) | |
| tree | 5d0a944ed5f3e83241de7b2ef0913b9270af48a6 /src/mainwindow.cpp | |
| parent | 68e1e48c63be4889d3c6c00c382c65e8d15596d8 (diff) | |
| download | kristall-3d1f480798f8708a85785d16f10ae10ed997bfeb.tar.gz | |
Adds 'show document source' menu item. Closes #11.
Diffstat (limited to 'src/mainwindow.cpp')
| -rw-r--r-- | src/mainwindow.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ba80651..ee79efa 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -62,7 +62,9 @@ MainWindow::MainWindow(QApplication * app, QWidget *parent) : for(QAction * act : this->ui->menuView->actions()) { auto * dock = qvariant_cast<QDockWidget*>(act->data()); - act->setChecked(dock->isVisible()); + if(dock != nullptr) { + act->setChecked(dock->isVisible()); + } } }); @@ -456,3 +458,11 @@ void MainWindow::on_actionManage_Certificates_triggered() kristall::saveSettings(); } + +void MainWindow::on_actionShow_document_source_triggered() +{ + BrowserTab * tab = qobject_cast<BrowserTab*>(this->ui->browser_tabs->currentWidget()); + if(tab != nullptr) { + tab->openSourceView(); + } +} |
