Add techinc client ID
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
fa68428a90
commit
973b43ca7a
@ -777,6 +777,9 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
|||||||
// FTBApp instances
|
// FTBApp instances
|
||||||
m_settings->registerSetting("FTBAppInstancesPath", "");
|
m_settings->registerSetting("FTBAppInstancesPath", "");
|
||||||
|
|
||||||
|
// Custom Techinc Client ID
|
||||||
|
m_settings->registerSetting("TechincClientID", "");
|
||||||
|
|
||||||
// Init page provider
|
// Init page provider
|
||||||
{
|
{
|
||||||
m_globalSettingsProvider = std::make_shared<GenericPageProvider>(tr("Settings"));
|
m_globalSettingsProvider = std::make_shared<GenericPageProvider>(tr("Settings"));
|
||||||
|
@ -143,6 +143,7 @@ void APIPage::loadSettings()
|
|||||||
ui->modrinthToken->setText(modrinthToken);
|
ui->modrinthToken->setText(modrinthToken);
|
||||||
QString customUserAgent = s->get("UserAgentOverride").toString();
|
QString customUserAgent = s->get("UserAgentOverride").toString();
|
||||||
ui->userAgentLineEdit->setText(customUserAgent);
|
ui->userAgentLineEdit->setText(customUserAgent);
|
||||||
|
ui->techicClientID->setText(s->get("TechincClientID").toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
void APIPage::applySettings()
|
void APIPage::applySettings()
|
||||||
@ -172,6 +173,7 @@ void APIPage::applySettings()
|
|||||||
QString modrinthToken = ui->modrinthToken->text();
|
QString modrinthToken = ui->modrinthToken->text();
|
||||||
s->set("ModrinthToken", modrinthToken);
|
s->set("ModrinthToken", modrinthToken);
|
||||||
s->set("UserAgentOverride", ui->userAgentLineEdit->text());
|
s->set("UserAgentOverride", ui->userAgentLineEdit->text());
|
||||||
|
s->set("TechincClientID", ui->techicClientID->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool APIPage::apply()
|
bool APIPage::apply()
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>800</width>
|
<width>841</width>
|
||||||
<height>600</height>
|
<height>620</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
@ -288,6 +288,36 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>Techinc Client ID</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_11">
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p>Note: you only need to set this to access private data.</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="techicClientID">
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>(None)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_12">
|
||||||
|
<property name="text">
|
||||||
|
<string>Enter a custom GUID client ID for Techinc here.</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -154,6 +154,10 @@ void Technic::ListModel::performSearch()
|
|||||||
QString("%1search?build=%2&q=%3").arg(BuildConfig.TECHNIC_API_BASE_URL, BuildConfig.TECHNIC_API_BUILD, currentSearchTerm);
|
QString("%1search?build=%2&q=%3").arg(BuildConfig.TECHNIC_API_BASE_URL, BuildConfig.TECHNIC_API_BUILD, currentSearchTerm);
|
||||||
searchMode = List;
|
searchMode = List;
|
||||||
}
|
}
|
||||||
|
auto clientId = APPLICATION->settings()->get("TechincClientID").toString();
|
||||||
|
if (!clientId.isEmpty()) {
|
||||||
|
searchUrl += "?cid=" + clientId;
|
||||||
|
}
|
||||||
netJob->addNetAction(Net::ApiDownload::makeByteArray(QUrl(searchUrl), response));
|
netJob->addNetAction(Net::ApiDownload::makeByteArray(QUrl(searchUrl), response));
|
||||||
jobPtr = netJob;
|
jobPtr = netJob;
|
||||||
jobPtr->start();
|
jobPtr->start();
|
||||||
|
Loading…
Reference in New Issue
Block a user