mirror of
https://github.com/ModOrganizer2/modorganizer.git
synced 2026-07-27 13:58:24 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c6734fcf4 | ||
|
|
9fc7a1bf85 | ||
|
|
3cfa7bbe74 | ||
|
|
08410deece | ||
|
|
07e5ce1e0e | ||
|
|
c5b809b486 | ||
|
|
ae22b41f96 | ||
|
|
85bb3dfbde | ||
|
|
da441e2b71 | ||
|
|
340b2e766f |
+34
-24
@@ -432,6 +432,13 @@ bool DownloadManager::addDownload(QNetworkReply *reply, const QStringList &URLs,
|
||||
}
|
||||
}
|
||||
|
||||
// baseName could be a URL at this point so strip out the URL query
|
||||
int queryIndex = baseName.indexOf("?");
|
||||
if (queryIndex >= 0)
|
||||
{
|
||||
baseName.truncate(queryIndex);
|
||||
}
|
||||
|
||||
startDisableDirWatcher();
|
||||
newDownload->setName(getDownloadFileName(baseName), false);
|
||||
endDisableDirWatcher();
|
||||
@@ -951,13 +958,20 @@ void DownloadManager::queryInfo(int index)
|
||||
SelectionDialog selection(tr("Please select the source game code for %1").arg(getFileName(index)));
|
||||
|
||||
std::vector<std::pair<QString, QString>> choices = m_NexusInterface->getGameChoices(m_ManagedGame);
|
||||
for (auto choice : choices) {
|
||||
selection.addChoice(choice.first, choice.second, choice.first);
|
||||
if (choices.size() == 1)
|
||||
{
|
||||
info->m_FileInfo->gameName = choices[0].first;
|
||||
}
|
||||
if (selection.exec() == QDialog::Accepted) {
|
||||
info->m_FileInfo->gameName = selection.getChoiceData().toString();
|
||||
} else {
|
||||
info->m_FileInfo->gameName = m_ManagedGame->gameShortName();
|
||||
else {
|
||||
for (auto choice : choices) {
|
||||
selection.addChoice(choice.first, choice.second, choice.first);
|
||||
}
|
||||
if (selection.exec() == QDialog::Accepted) {
|
||||
info->m_FileInfo->gameName = selection.getChoiceData().toString();
|
||||
}
|
||||
else {
|
||||
info->m_FileInfo->gameName = m_ManagedGame->gameShortName();
|
||||
}
|
||||
}
|
||||
}
|
||||
info->m_ReQueried = true;
|
||||
@@ -1823,8 +1837,14 @@ void DownloadManager::nxmFileInfoFromMd5Available(QString gameName, QVariant use
|
||||
auto fileDetails = results["file_details"].toMap();
|
||||
|
||||
if (fileDetails["file_name"].toString().compare(info->m_FileName, Qt::CaseInsensitive) == 0) {
|
||||
chosenIdx = i;
|
||||
break;
|
||||
if (chosenIdx < 0) {
|
||||
chosenIdx = i; //intentional to not break in order to check other results
|
||||
}
|
||||
else {
|
||||
log::debug("Multiple files with same name found during MD5 search.");
|
||||
chosenIdx = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1839,7 +1859,7 @@ void DownloadManager::nxmFileInfoFromMd5Available(QString gameName, QVariant use
|
||||
if (chosenIdx < 0) {
|
||||
chosenIdx = i; //intentional to not break in order to check other results
|
||||
} else {
|
||||
log::debug("Multiple active files found during MD5 search. Defaulting to time stamps...");
|
||||
log::debug("Multiple active files found during MD5 search.");
|
||||
chosenIdx = -1;
|
||||
break;
|
||||
}
|
||||
@@ -1847,24 +1867,14 @@ void DownloadManager::nxmFileInfoFromMd5Available(QString gameName, QVariant use
|
||||
}
|
||||
}
|
||||
|
||||
//Look for the most recent one
|
||||
//Unable to determine the correct mod / file. Revert to the old method
|
||||
if (chosenIdx < 0) {
|
||||
int mostRecentTime = INT_MIN;
|
||||
for (int i = 0; i < resultlist.count(); i++) {
|
||||
auto results = resultlist[i].toMap();
|
||||
auto fileDetails = results["file_details"].toMap();
|
||||
|
||||
int fileTime = fileDetails["uploaded_timestamp"].toInt();
|
||||
if (fileTime > mostRecentTime) {
|
||||
chosenIdx = i;
|
||||
mostRecentTime = fileTime;
|
||||
}
|
||||
}
|
||||
//don't use the normal state set function as we don't want to create a meta file
|
||||
info->m_State = DownloadManager::STATE_READY;
|
||||
queryInfo(m_ActiveDownloads.indexOf(info));
|
||||
return;
|
||||
}
|
||||
|
||||
//If nothing is preferred, just use the first one
|
||||
if (chosenIdx < 0) chosenIdx = 0;
|
||||
|
||||
auto results = resultlist[chosenIdx].toMap();
|
||||
auto fileDetails = results["file_details"].toMap();
|
||||
auto modDetails = results["mod"].toMap();
|
||||
|
||||
+4
-6
@@ -199,7 +199,7 @@ FilterList::FilterList(Ui::MainWindow* ui, CategoryFactory& factory)
|
||||
[&]{ onOptionsChanged(); });
|
||||
|
||||
ui->filters->header()->setMinimumSectionSize(0);
|
||||
ui->filters->header()->setSectionResizeMode(0, QHeaderView::Fixed);
|
||||
ui->filters->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
|
||||
ui->filters->header()->resizeSection(0, 30);
|
||||
ui->categoriesSplitter->setCollapsible(0, false);
|
||||
ui->categoriesSplitter->setCollapsible(1, false);
|
||||
@@ -225,11 +225,9 @@ QTreeWidgetItem* FilterList::addCriteriaItem(
|
||||
{
|
||||
auto* item = new CriteriaItem(this, name, type, categoryID);
|
||||
|
||||
if (root != nullptr) {
|
||||
root->addChild(item);
|
||||
} else {
|
||||
ui->filters->addTopLevelItem(item);
|
||||
}
|
||||
// For now list all categories flatly without nestling them as there is
|
||||
// no way to espand nodes in the filter view since clicking changes state.
|
||||
ui->filters->addTopLevelItem(item);
|
||||
|
||||
item->setTextAlignment(0, Qt::AlignCenter);
|
||||
|
||||
|
||||
+1
-4
@@ -162,12 +162,9 @@ LogList::LogList(QWidget* parent)
|
||||
{
|
||||
setModel(&LogModel::instance());
|
||||
|
||||
const QFontMetrics fm(font());
|
||||
const int timestampWidth = fm.horizontalAdvance("00:00:00.000");
|
||||
|
||||
header()->setMinimumSectionSize(0);
|
||||
header()->resizeSection(0, 20);
|
||||
header()->resizeSection(1, timestampWidth + 8);
|
||||
header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
|
||||
|
||||
setAutoScroll(true);
|
||||
scrollToBottom();
|
||||
|
||||
+9
-3
@@ -101,19 +101,25 @@
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="headerVisible">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="headerCascadingSectionResizes">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string/>
|
||||
<string>State</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>State of the filter, can either be Disabled, Enabled or Inverted.</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string notr="true">Category</string>
|
||||
<string notr="true">Filter</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Filter to apply to the modlist.</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
|
||||
+238
-223
File diff suppressed because it is too large
Load Diff
@@ -93,6 +93,7 @@ void Settings::processUpdates(
|
||||
const QVersionNumber& currentVersion, const QVersionNumber& lastVersion)
|
||||
{
|
||||
if (firstStart()) {
|
||||
set(m_Settings, "General", "version", currentVersion.toString());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@
|
||||
// If VS_FF_PRERELEASE is not set, MO labels the build as a release and uses VER_FILEVERSION to determine version number.
|
||||
// Otherwise, if letters are used in VER_FILEVERSION_STR, uses the full MOBase::VersionInfo parser
|
||||
// Otherwise, uses the numbers from VER_FILEVERSION and sets the release type as pre-alpha
|
||||
#define VER_FILEVERSION 2,2,2
|
||||
#define VER_FILEVERSION_STR "2.2.2\0"
|
||||
#define VER_FILEVERSION 2,2,2,1
|
||||
#define VER_FILEVERSION_STR "2.2.2.1\0"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION VER_FILEVERSION
|
||||
|
||||
Reference in New Issue
Block a user