Skip to content

Commit

Permalink
Show help and about menu.
Browse files Browse the repository at this point in the history
  • Loading branch information
ponchio committed Nov 30, 2024
1 parent b6c756d commit 2b5bbe5
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
28 changes: 27 additions & 1 deletion relightlab/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "rtiframe.h"
#include "normalsframe.h"
#include "queueframe.h"

#include "helpbutton.h"

#include <QMessageBox>
#include <QDebug>
Expand Down Expand Up @@ -85,6 +85,24 @@ void MainWindow::createMenu() {
menuFile->addSeparator();
menuFile->addAction(qRelightApp->action("exit"));

QMenu *menuView= new QMenu(menubar);
menuView->setTitle("View");

menuView->addAction(qRelightApp->action("view_rti"));
menubar->addAction(menuView->menuAction());

QMenu *menuHelp = new QMenu(menubar);
menuHelp->setTitle("Help");

QAction *help = qRelightApp->action("help");
connect(help, SIGNAL(triggered()), this, SLOT(showHelp()));
menuHelp->addAction(help);

QAction *about = qRelightApp->action("about");
connect(about, SIGNAL(triggered()), this, SLOT(showAbout()));
menuHelp->addAction(about);
menubar->addAction(menuHelp->menuAction());

setMenuBar(menubar);
}

Expand Down Expand Up @@ -127,4 +145,12 @@ void MainWindow::init() {
rti_frame->init();
}

void MainWindow::showHelp() {
HelpDialog &dialog = HelpDialog::instance();
dialog.showPage("index");
}

void MainWindow::showAbout() {
HelpDialog &dialog = HelpDialog::instance();
dialog.showPage("about");
}
2 changes: 2 additions & 0 deletions relightlab/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class MainWindow: public QMainWindow {

public slots:
void showQueue();
void showHelp();
void showAbout();

protected:

Expand Down
5 changes: 5 additions & 0 deletions relightlab/relightapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ RelightApp::RelightApp(int &argc, char **argv): QApplication(argc, argv) {
addAction("show_list", "Show list", "list", "");
addAction("show_grid", "Show grid", "grid", "");

addAction("view_rti", "View RTI", "cast", "");

addAction("help", "Help", "help-circle", "");
addAction("about", "About", "info", "");


if(QSystemTrayIcon::isSystemTrayAvailable()) {
QIcon icon(":/relight.png");
Expand Down
2 changes: 2 additions & 0 deletions relightlab/res.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<file>icons/dark/index.theme</file>
<file>icons/dark/scalable/grid.svg</file>
<file>icons/dark/scalable/help-circle.svg</file>
<file>icons/dark/scalable/info.svg</file>
<file>icons/dark/scalable/rotate-ccw</file>
<file>icons/dark/scalable/rotate-ccw.svg</file>
<file>icons/dark/scalable/rotate-cw</file>
Expand All @@ -51,6 +52,7 @@
<file>icons/light/scalable/folder.svg</file>
<file>icons/light/scalable/grid.svg</file>
<file>icons/light/scalable/help-circle.svg</file>
<file>icons/light/scalable/info.svg</file>
<file>icons/light/scalable/highlight.svg</file>
<file>icons/light/scalable/home.svg</file>
<file>icons/light/scalable/image.svg</file>
Expand Down

0 comments on commit 2b5bbe5

Please sign in to comment.