Compare commits

..
10 Commits
Author SHA1 Message Date
Chris Bessent 6c6734fcf4 Set version for new instances 2020-01-12 14:35:40 -07:00
Chris Bessent 9fc7a1bf85 Fix downloading files that have no file name
Somehow some mods on the Nexus have no file name in certain API
responses.  Previously, MO assumed the last part of the URL is
the file name.  This worked until the Nexus started adding URL
query stuff to the URL (?md5=xxx).

Now, strip out all the URL query stuff to get a valid file name.
2020-01-11 09:24:23 -07:00
Chris Bessent 3cfa7bbe74 Don't ask for the game when there's only one game 2020-01-10 17:18:45 -07:00
Chris Bessent 08410deece Use the old query info logic when MD5 query is ambiguous
An author accidentally uploaded a mod's files to a different mod.
This resulted in querying info finding the wrong mod/file.
2020-01-10 17:18:45 -07:00
Chris Bessent 07e5ce1e0e Merge pull request #967 from Al12rs/master
Fixed log timestamp size for bigger font.
2020-01-10 08:41:10 -07:00
AL c5b809b486 Fixed log timestamp size for bigger font. 2020-01-10 16:07:58 +01:00
Chris Bessent ae22b41f96 Update version to 2.2.2.1 2020-01-09 19:01:42 -07:00
AL 85bb3dfbde Updated translations
(cherry picked from commit 62a6b1ce5e)
2020-01-09 18:43:12 -07:00
AL da441e2b71 Add headers with tooltips to Filter view.
(cherry picked from commit 3c6804c502)
2020-01-09 18:43:11 -07:00
AL 340b2e766f List all categories flatly in filters view as nestled ones would otherwise not be accessible.
(cherry picked from commit 734bd0ed20)
2020-01-09 18:43:11 -07:00
7 changed files with 289 additions and 262 deletions
+34 -24
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -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
View File
@@ -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