gui: premium reminder feature
This commit is contained in:
parent
6919b68947
commit
6f97f1d186
|
@ -78,6 +78,57 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="m_pWidgetPremium" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="leftMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>7</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_pIconPremium">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="Synergy.qrc">:/res/icons/16x16/money.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_pLabelPremium">
|
||||
<property name="text">
|
||||
<string>Please help us <a href="https://synergy-foss.org/premium/register/?source=gui-notice">fund this project</a> if you like Synergy.</string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="m_pSpacerPremium">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="m_pGroupServer">
|
||||
<property name="sizePolicy">
|
||||
|
|
|
@ -50,5 +50,6 @@
|
|||
<file>lang/gui_zh-CN.qm</file>
|
||||
<file>lang/gui_zh-TW.qm</file>
|
||||
<file>lang/Languages.xml</file>
|
||||
<file>icons/16x16/money.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 738 B |
|
@ -84,6 +84,8 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) :
|
|||
m_pLabelScreenName->setText(getScreenName());
|
||||
m_pLabelIpAddresses->setText(getIPAddresses());
|
||||
|
||||
updatePremiumInfo();
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
// ipc must always be enabled, so that we can disable command when switching to desktop mode.
|
||||
connect(&m_IpcClient, SIGNAL(readLogLine(const QString&)), this, SLOT(appendLogRaw(const QString&)));
|
||||
|
@ -749,6 +751,7 @@ void MainWindow::changeEvent(QEvent* event)
|
|||
case QEvent::LanguageChange:
|
||||
retranslateUi(this);
|
||||
retranslateMenuBar();
|
||||
updatePremiumInfo();
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -757,6 +760,20 @@ void MainWindow::changeEvent(QEvent* event)
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::updatePremiumInfo()
|
||||
{
|
||||
if (m_AppConfig.isPremium())
|
||||
{
|
||||
m_pWidgetPremium->hide();
|
||||
setWindowTitle(tr("Synergy Premium"));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pWidgetPremium->show();
|
||||
setWindowTitle(tr("Synergy"));
|
||||
}
|
||||
}
|
||||
|
||||
bool MainWindow::on_m_pButtonBrowseConfigFile_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Browse for a synergys config file"), QString(), synergyConfigFilter);
|
||||
|
@ -812,6 +829,7 @@ void MainWindow::on_m_pActionWizard_triggered()
|
|||
{
|
||||
SetupWizard wizard(*this, false);
|
||||
wizard.exec();
|
||||
updatePremiumInfo();
|
||||
}
|
||||
|
||||
void MainWindow::on_m_pElevateCheckBox_toggled(bool checked)
|
||||
|
|
|
@ -144,6 +144,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
|
|||
void setFormEnabled(bool enabled);
|
||||
void changeEvent(QEvent* event);
|
||||
void retranslateMenuBar();
|
||||
void updatePremiumInfo();
|
||||
|
||||
private:
|
||||
QSettings& m_Settings;
|
||||
|
|
|
@ -26,8 +26,9 @@
|
|||
#include <QNetworkRequest>
|
||||
#include <QNetworkReply>
|
||||
|
||||
#define PREMIUM_AUTH_URL "https://synergy-foss.org/premium/json/auth/"
|
||||
//#define PREMIUM_AUTH_URL "http://localhost/synergy/premium/json/auth/"
|
||||
#define PREMIUM_AUTH_URL "https://synergy-foss.org/premium/json/auth/"
|
||||
#define PREMIUM_REGISTER_URL "https://synergy-foss.org/premium/register/?source=gui-wizard"
|
||||
|
||||
SetupWizard::SetupWizard(MainWindow& mainWindow, bool startMain) :
|
||||
m_MainWindow(mainWindow),
|
||||
|
@ -112,7 +113,7 @@ bool SetupWizard::validateCurrentPage()
|
|||
}
|
||||
else if (m_pRadioButtonPremiumRegister->isChecked())
|
||||
{
|
||||
const QUrl url(QString("https://synergy-foss.org/premium/register/?source=gui"));
|
||||
const QUrl url(QString(PREMIUM_REGISTER_URL));
|
||||
QDesktopServices::openUrl(url);
|
||||
m_pRadioButtonPremiumLogin->setChecked(true);
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue