mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-04-07 15:37:33 -04:00
Remove extra pages from AddDeviceDialog
This commit is contained in:
@@ -65,7 +65,6 @@ void AddDeviceDialog::setScanButtons(bool scan)
|
||||
|
||||
ui->ButtonScanBack->setVisible(!scan);
|
||||
ui->ButtonScanRescan->setVisible(!scan);
|
||||
ui->ButtonScanNotFound->setVisible(!scan);
|
||||
if(scan)
|
||||
{
|
||||
ui->ButtonScanBeginning->hide();
|
||||
@@ -104,35 +103,6 @@ void AddDeviceDialog::rescan()
|
||||
ResourceManager::get()->DetectDevices();
|
||||
}
|
||||
|
||||
void AddDeviceDialog::help()
|
||||
{
|
||||
if(helpFromPage == -1)
|
||||
{
|
||||
helpFromPage = ui->stackedWidget->currentIndex();
|
||||
}
|
||||
|
||||
// Show the "Nothing we can do" page
|
||||
// The usefulness on it heavily depends on the contents of the "Issue Text" field
|
||||
// The caller must fill it with appropriate text (device IDs, connection type, manufacturer, etc.)
|
||||
if(ui->helpIssueText->toPlainText().isEmpty())
|
||||
{
|
||||
ui->helpIssueText->hide();
|
||||
ui->ButtonClipboard->hide();
|
||||
ui->LabelGitlab->setText(tr("We would really appreciate if you could file an issue on <a href=\"gitlab\">Gitlab</a>, providing the device name and a link to a description on manufacturer's website."));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->helpIssueText->show();
|
||||
ui->ButtonClipboard->show();
|
||||
ui->LabelGitlab->setText(tr("We would really appreciate if you could send us this info, by filing an issue on Gitlab. "
|
||||
"You can do that by clicking the button below (you need to be logged in to Gitlab in your "
|
||||
"default web-browser), or by navigating to the <a href=\"gitlab\">Project's page on Gitlab</a>, "
|
||||
"then \"Issues\", clicking \"New issue\", and pasting in the text from the field above."));
|
||||
}
|
||||
|
||||
ui->stackedWidget->slideInWgt(ui->PageHelp, SlidingStackedWidget::RIGHT2LEFT);
|
||||
}
|
||||
|
||||
void AddDeviceDialog::configure(QWidget* entry)
|
||||
{
|
||||
configureFromPage = ui->stackedWidget->currentIndex();
|
||||
@@ -279,45 +249,6 @@ void AddDeviceDialog::on_ButtonScanClose_clicked()
|
||||
close();
|
||||
}
|
||||
|
||||
// ===== HELP =====
|
||||
|
||||
void AddDeviceDialog::on_ButtonHelpBack_clicked()
|
||||
{
|
||||
ui->stackedWidget->slideInIdx(helpFromPage, SlidingStackedWidget::LEFT2RIGHT);
|
||||
helpFromPage = -1;
|
||||
}
|
||||
|
||||
void AddDeviceDialog::on_ButtonHelpIssue_clicked()
|
||||
{
|
||||
QByteArray issueText = ui->helpIssueText->toPlainText().toUtf8();
|
||||
QString issueUrl("https://gitlab.com/CalcProgrammer1/OpenRGB/-/issues/new");
|
||||
QByteArray issueTitle = "[New Device][Helper]";
|
||||
if(!title.empty())
|
||||
{
|
||||
issueTitle.append(" ");
|
||||
issueTitle.append(title.c_str());
|
||||
}
|
||||
if(!issueText.isEmpty())
|
||||
{
|
||||
issueUrl.append("?issue[title]=");
|
||||
issueUrl.append(issueTitle.toPercentEncoding());
|
||||
issueUrl.append("&issue[description]=");
|
||||
issueUrl.append(issueText.toPercentEncoding());
|
||||
}
|
||||
QDesktopServices::openUrl (QUrl(issueUrl));
|
||||
}
|
||||
|
||||
void AddDeviceDialog::on_ButtonHelpBeginning_clicked()
|
||||
{
|
||||
home();
|
||||
}
|
||||
|
||||
void AddDeviceDialog::on_LabelGitlab_linkActivated(const QString &link)
|
||||
{
|
||||
QString issueUrl("https://gitlab.com/CalcProgrammer1/OpenRGB/-/issues/new");
|
||||
QDesktopServices::openUrl (QUrl(issueUrl));
|
||||
}
|
||||
|
||||
void AddDeviceDialog::onDetectionProgressChanged()
|
||||
{
|
||||
ui->progressBar->setValue(ResourceManager::get()->GetDetectionPercent());
|
||||
|
||||
@@ -48,11 +48,6 @@ private slots:
|
||||
void on_ButtonScanBeginning_clicked();
|
||||
void on_ButtonScanClose_clicked();
|
||||
|
||||
void on_ButtonHelpBack_clicked();
|
||||
void on_ButtonHelpIssue_clicked();
|
||||
void on_ButtonHelpBeginning_clicked();
|
||||
void on_LabelGitlab_linkActivated(const QString &link);
|
||||
|
||||
void onDetectionProgressChanged();
|
||||
void onDetectionEnded();
|
||||
|
||||
@@ -60,7 +55,6 @@ private:
|
||||
Ui::AddDeviceDialog *ui;
|
||||
void home();
|
||||
void rescan();
|
||||
void help();
|
||||
void setScanButtons(bool scan);
|
||||
void configure(QWidget* entry);
|
||||
|
||||
@@ -68,9 +62,6 @@ private:
|
||||
int helpFromPage = -1;
|
||||
int configureFromPage = -1;
|
||||
|
||||
//device_type filterDevType;
|
||||
//connection_type filterConnType;
|
||||
|
||||
std::string title; // Cached device name & manufacturer from Hardware IDs
|
||||
std::vector<std::string> cachedDevices;
|
||||
};
|
||||
|
||||
@@ -200,13 +200,6 @@ Anything not listed here should be detected automatically, if supported</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ButtonScanNotFound">
|
||||
<property name="text">
|
||||
<string>Still not found</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ButtonScanBeginning">
|
||||
<property name="text">
|
||||
@@ -263,87 +256,6 @@ Anything not listed here should be detected automatically, if supported</string>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="PageHelp">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string><h2>Not the end of the world</h2>
|
||||
The device seems to be unsupported by OpenRGB - yet! With your help, we can fix that.
|
||||
First, let's gather some information:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="helpIssueText">
|
||||
<property name="plainText">
|
||||
<string>Sample text for issue
|
||||
|
||||
```
|
||||
Matching hardware IDs
|
||||
```</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ButtonClipboard">
|
||||
<property name="text">
|
||||
<string>Copy to Clipboard</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="LabelGitlab">
|
||||
<property name="text">
|
||||
<string>We would really appreciate if you could send us this info, by filing an issue on Gitlab. </string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<widget class="QPushButton" name="ButtonHelpBack">
|
||||
<property name="text">
|
||||
<string>Back</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ButtonHelpIssue">
|
||||
<property name="text">
|
||||
<string>File an issue</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ButtonHelpBeginning">
|
||||
<property name="text">
|
||||
<string>Try another device</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
Reference in New Issue
Block a user