Remove AboutWidget
DELETE
src/aboutwidget.cpp
-#include "aboutwidget.h"
-#include "ui_aboutwidget.h"
-
-namespace Ripes {
-
-AboutWidget::AboutWidget(QWidget* parent) : QDialog(parent), ui(new Ui::AboutWidget) {
- ui->setupUi(this);
- ui->icon->setPixmap(QPixmap(":/icons/logo.svg"));
-}
-
-AboutWidget::~AboutWidget() {
- delete ui;
-}
-} // namespace Ripes

DELETE
src/aboutwidget.h
-#pragma once
-
-#include <QDialog>
-
-namespace Ripes {
-
-namespace Ui {
-class AboutWidget;
-}
-
-class AboutWidget : public QDialog {
- Q_OBJECT
-
-public:
- explicit AboutWidget(QWidget* parent = nullptr);
- ~AboutWidget() override;
-
-private:
- Ui::AboutWidget* ui;
-};
-} // namespace Ripes

DELETE
src/aboutwidget.ui
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>Ripes::AboutWidget</class>
- <widget class="QDialog" name="Ripes::AboutWidget">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>400</width>
- <height>300</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>About</string>
- </property>
- <property name="windowIcon">
- <iconset>
- <normaloff>:/logos/logo.png</normaloff>:/logos/logo.png</iconset>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QLabel" name="label">
- <property name="font">
- <font>
- <pointsize>10</pointsize>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
- <property name="text">
- <string>Ripes</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="description">
- <property name="text">
- <string>A 5-stage RISC-V pipeline simulator with assembly development environment.
-https://github.com/mortbopet/Ripes</string>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="verticalSpacer_2">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QLabel" name="icon">
- <property name="maximumSize">
- <size>
- <width>250</width>
- <height>250</height>
- </size>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="scaledContents">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>

MODIFY
src/mainwindow.cpp
src/mainwindow.cpp
#include "mainwindow.h"
#include "ui_mainwindow.h"
-#include "aboutwidget.h"
#include "defines.h"
#include "edittab.h"
#include "loaddialog.h"
@@ -28,6 +27,7 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), m_ui(new Ui::Main
m_ui->setupUi(this);
setWindowTitle("Ripes");
setWindowIcon(QIcon(":/icons/logo.svg"));
+ m_ui->actionOpen_wiki->setIcon(QIcon(":/icons/info.svg"));
showMaximized();
// Initialize processor handler
@@ -75,7 +75,6 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), m_ui(new Ui::Main
connect(ProcessorHandler::get(), &ProcessorHandler::exit, m_processorTab, &ProcessorTab::processorFinished);
connect(ProcessorHandler::get(), &ProcessorHandler::runFinished, m_processorTab, &ProcessorTab::runFinished);
- connect(m_ui->actionAbout, &QAction::triggered, this, &MainWindow::about);
connect(m_ui->actionOpen_wiki, &QAction::triggered, this, &MainWindow::wiki);
}
@@ -157,11 +156,6 @@ void MainWindow::loadFileTriggered() {
m_hasSavedFile = false;
}
-void MainWindow::about() {
- AboutWidget about;
- about.exec();
-}
-
void MainWindow::wiki() {
QDesktopServices::openUrl(QUrl(QString("https://github.com/mortbopet/Ripes/wiki")));
}

MODIFY
src/mainwindow.h
src/mainwindow.h
@@ -29,7 +29,6 @@ public:
private slots:
void exit();
- void about();
void wiki();
void loadFileTriggered();

MODIFY
src/mainwindow.ui
src/mainwindow.ui
<property name="title">
<string>Help</string>
</property>
- <addaction name="actionAbout"/>
<addaction name="actionOpen_wiki"/>
</widget>
<addaction name="menuFile"/>
<addaction name="menuHelp"/>
</widget>
- <action name="actionAbout">
- <property name="icon">
- <iconset>
- <normaloff>:/icons/info.svg</normaloff>:/icons/info.svg</iconset>
- </property>
- <property name="text">
- <string>About</string>
- </property>
- </action>
<action name="actionOpen_wiki">
<property name="text">
<string>Wiki</string>

Remove AboutWidget