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
|
||||
m_settings->registerSetting("FTBAppInstancesPath", "");
|
||||
|
||||
// Custom Techinc Client ID
|
||||
m_settings->registerSetting("TechincClientID", "");
|
||||
|
||||
// Init page provider
|
||||
{
|
||||
m_globalSettingsProvider = std::make_shared<GenericPageProvider>(tr("Settings"));
|
||||
|
@ -143,6 +143,7 @@ void APIPage::loadSettings()
|
||||
ui->modrinthToken->setText(modrinthToken);
|
||||
QString customUserAgent = s->get("UserAgentOverride").toString();
|
||||
ui->userAgentLineEdit->setText(customUserAgent);
|
||||
ui->techicClientID->setText(s->get("TechincClientID").toString());
|
||||
}
|
||||
|
||||
void APIPage::applySettings()
|
||||
@ -172,6 +173,7 @@ void APIPage::applySettings()
|
||||
QString modrinthToken = ui->modrinthToken->text();
|
||||
s->set("ModrinthToken", modrinthToken);
|
||||
s->set("UserAgentOverride", ui->userAgentLineEdit->text());
|
||||
s->set("TechincClientID", ui->techicClientID->text());
|
||||
}
|
||||
|
||||
bool APIPage::apply()
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
<width>841</width>
|
||||
<height>620</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
@ -288,6 +288,36 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</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>
|
||||
<spacer name="verticalSpacer">
|
||||
<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);
|
||||
searchMode = List;
|
||||
}
|
||||
auto clientId = APPLICATION->settings()->get("TechincClientID").toString();
|
||||
if (!clientId.isEmpty()) {
|
||||
searchUrl += "?cid=" + clientId;
|
||||
}
|
||||
netJob->addNetAction(Net::ApiDownload::makeByteArray(QUrl(searchUrl), response));
|
||||
jobPtr = netJob;
|
||||
jobPtr->start();
|
||||
|
Loading…
Reference in New Issue
Block a user