Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
Add message informing about recommended migration (#416)
Browse files Browse the repository at this point in the history
* Add button opening antimicrox website

* Add popup with deprecation information

* Add warning icon to resources
  • Loading branch information
pktiuk authored Nov 6, 2022
1 parent 8187062 commit 1f0dfad
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 11 deletions.
Binary file added src/icons/16x16/actions/dialog-warning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ MainWindow::MainWindow(QMap<SDL_JoystickID, InputDevice*> *joysticks,
connect(ui->actionGitHubPage, SIGNAL(triggered()), this, SLOT(openGitHubPage()));
connect(ui->actionOptions, SIGNAL(triggered()), this, SLOT(openMainSettingsDialog()));
connect(ui->actionWiki, SIGNAL(triggered()), this, SLOT(openWikiPage()));
connect(ui->updateButton, &QPushButton::pressed, this, &MainWindow::updateButtonPressed);

#ifdef USE_SDL_2
connect(ui->actionGameController_Mapping, SIGNAL(triggered()), this, SLOT(openGameControllerMappingWindow()));
Expand Down Expand Up @@ -1174,6 +1175,26 @@ void MainWindow::changeStartSetNumber(unsigned int startSetNumber, unsigned int
}
}

void MainWindow::updateButtonPressed() {
QMessageBox *box = new QMessageBox(this);
box->setText(
tr("AntiMicro is no longer maintained anymore, it won't get any new "
"features or bug fixes. This is the last release of AntiMicro.\nIt is "
"recommended to migrate to new, currently developed version of this "
"app called AntiMicroX. It contains a lot of bug fixes and new "
"features like: showing battery status, mapping gamepad moves with "
"gyroscope, proper calibration and many more...\nPress Open to to open "
"AntiMicroX website."));
box->setWindowTitle(tr("Deprecation Notice"));
box->setStandardButtons(QMessageBox::Cancel | QMessageBox::Open);
int ret = box->exec();
if (ret == QMessageBox::Open) {
qInfo() << "Opening antimicrox website";
QDesktopServices::openUrl(
QUrl("https://github.com/antiMicroX/antimicrox/"));
}
}

/**
* @brief Build list of current input devices and pass it to settings dialog
* instance. Open Settings dialog.
Expand Down
1 change: 1 addition & 0 deletions src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class MainWindow : public QMainWindow

private:
Ui::MainWindow *ui;
void updateButtonPressed();

signals:
void joystickRefreshRequested();
Expand Down
37 changes: 27 additions & 10 deletions src/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,16 @@ QPushButton#namesPushButton[isDisplayingNames=&quot;true&quot;] {
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
Expand Down Expand Up @@ -159,6 +168,18 @@ QPushButton#namesPushButton[isDisplayingNames=&quot;true&quot;] {
</widget>
</widget>
</item>
<item>
<widget class="QPushButton" name="updateButton">
<property name="text">
<string>AntiMicro is no longer maintained and won't receive any more updates.
Click here to get AntiMicroX, an updated fork of this app.</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icons/16x16/actions/dialog-warning.png</normaloff>:/icons/16x16/actions/dialog-warning.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="uacPushButton">
<property name="text">
Expand All @@ -183,7 +204,7 @@ QPushButton#namesPushButton[isDisplayingNames=&quot;true&quot;] {
<x>0</x>
<y>0</y>
<width>650</width>
<height>21</height>
<height>20</height>
</rect>
</property>
<widget class="QMenu" name="menuQuit">
Expand Down Expand Up @@ -221,8 +242,7 @@ QPushButton#namesPushButton[isDisplayingNames=&quot;true&quot;] {
<action name="actionQuit">
<property name="icon">
<iconset theme="application-exit">
<normaloff/>
</iconset>
<normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>&amp;Quit</string>
Expand All @@ -237,8 +257,7 @@ QPushButton#namesPushButton[isDisplayingNames=&quot;true&quot;] {
</property>
<property name="icon">
<iconset theme="view-refresh">
<normaloff/>
</iconset>
<normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>&amp;Update Joysticks</string>
Expand All @@ -250,8 +269,7 @@ QPushButton#namesPushButton[isDisplayingNames=&quot;true&quot;] {
<action name="actionHide">
<property name="icon">
<iconset theme="view-restore">
<normaloff/>
</iconset>
<normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>&amp;Hide</string>
Expand All @@ -263,8 +281,7 @@ QPushButton#namesPushButton[isDisplayingNames=&quot;true&quot;] {
<action name="actionAbout">
<property name="icon">
<iconset theme="help-about">
<normaloff/>
</iconset>
<normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>&amp;About</string>
Expand Down
3 changes: 2 additions & 1 deletion src/resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
<file>Changelog</file>
<file>icons/16x16/actions/document-save.png</file>
<file>icons/16x16/actions/document-open-folder.png</file>
<file>icons/16x16/actions/dialog-warning.png</file>
</qresource>
</RCC>
</RCC>
1 change: 1 addition & 0 deletions src/resources_windows.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
<file>icons/16x16/actions/edit-table-insert-row-below.png</file>
<file>icons/16x16/actions/help-about.png</file>
<file>icons/16x16/actions/view-fullscreen.png</file>
<file>icons/16x16/actions/dialog-warning.png</file>
</qresource>
</RCC>

0 comments on commit 1f0dfad

Please sign in to comment.