summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-12-12 22:50:01 -0500
committerGitHub <noreply@github.com>2019-12-12 22:50:01 -0500
commit8cf24923bb510360d18f6dd0bd1a2a57ea1a2bca (patch)
treea4ec63db3781b2d76592b14b0581ab6c3c840bda /src
parent1d0b202ee64fe12d23922e816812749e8fe40bf6 (diff)
parent0f67ee4fcd8a2735751eaed738244327e5571239 (diff)
Merge pull request #936 from isanae/rc3-fixes
rc3 fixes
Diffstat (limited to 'src')
-rw-r--r--src/filterlist.cpp38
-rw-r--r--src/filterlist.h1
-rw-r--r--src/organizer_en.ts17
-rw-r--r--src/sanitychecks.cpp24
-rw-r--r--src/stylesheets/dark.qss2
-rw-r--r--src/version.rc2
6 files changed, 55 insertions, 29 deletions
diff --git a/src/filterlist.cpp b/src/filterlist.cpp
index 6a85bcaa..69aca4c5 100644
--- a/src/filterlist.cpp
+++ b/src/filterlist.cpp
@@ -275,10 +275,7 @@ void FilterList::addSpecialCriteria(int type)
void FilterList::refresh()
{
- QStringList selectedItems;
- for (QTreeWidgetItem *item : ui->filters->selectedItems()) {
- selectedItems.append(item->text(0));
- }
+ const auto oldSelection = selectedCriteria();
ui->filters->clear();
@@ -315,33 +312,30 @@ void FilterList::refresh()
}
addCategoryCriteria(nullptr, categoriesUsed, 0);
-
- for (const QString &item : selectedItems) {
- QList<QTreeWidgetItem*> matches = ui->filters->findItems(
- item, Qt::MatchFixedString | Qt::MatchRecursive);
-
- if (matches.size() > 0) {
- matches.at(0)->setSelected(true);
- }
- }
+ setSelection(oldSelection);
}
void FilterList::setSelection(const std::vector<Criteria>& criteria)
{
for (int i = 0; i < ui->filters->topLevelItemCount(); ++i) {
- const auto* item = dynamic_cast<CriteriaItem*>(
- ui->filters->topLevelItem(i));
-
+ auto* item = dynamic_cast<CriteriaItem*>(ui->filters->topLevelItem(i));
if (!item) {
continue;
}
+ bool found = false;
+
for (auto&& c : criteria) {
if (item->type() == c.type && item->id() == c.id) {
- ui->filters->setCurrentItem(ui->filters->topLevelItem(i));
+ item->setState(c.inverse ? CriteriaItem::Inverted : CriteriaItem::Active);
+ found = true;
break;
}
}
+
+ if (!found) {
+ item->setState(CriteriaItem::Inactive);
+ }
}
}
@@ -378,7 +372,7 @@ bool FilterList::cycleItem(QTreeWidgetItem* item, int direction)
return true;
}
-void FilterList::checkCriteria()
+std::vector<ModListSortProxy::Criteria> FilterList::selectedCriteria() const
{
std::vector<Criteria> criteria;
@@ -395,7 +389,12 @@ void FilterList::checkCriteria()
}
}
- emit criteriaChanged(criteria);
+ return criteria;
+}
+
+void FilterList::checkCriteria()
+{
+ emit criteriaChanged(selectedCriteria());
}
void FilterList::editCategories()
@@ -404,6 +403,7 @@ void FilterList::editCategories()
if (dialog.exec() == QDialog::Accepted) {
dialog.commitChanges();
+ refresh();
}
}
diff --git a/src/filterlist.h b/src/filterlist.h
index 72cbe8bf..b0ebc9a4 100644
--- a/src/filterlist.h
+++ b/src/filterlist.h
@@ -39,6 +39,7 @@ private:
void editCategories();
void checkCriteria();
+ std::vector<ModListSortProxy::Criteria> selectedCriteria() const;
bool cycleItem(QTreeWidgetItem* item, int direction);
QTreeWidgetItem* addCriteriaItem(
diff --git a/src/organizer_en.ts b/src/organizer_en.ts
index 95854200..593e4457 100644
--- a/src/organizer_en.ts
+++ b/src/organizer_en.ts
@@ -6754,6 +6754,23 @@ You can restart Mod Organizer as administrator and try launching the program aga
<source>Exit Now</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <location filename="sanitychecks.cpp" line="113"/>
+ <source>&apos;%1&apos;: file is blocked (%2)</source>
+ <oldsource>&apos;%1&apos;: file is blocked (&apos;%2&apos;)</oldsource>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="sanitychecks.cpp" line="206"/>
+ <source>&apos;%1&apos; seems to be missing, an antivirus may have deleted it</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="sanitychecks.cpp" line="239"/>
+ <source>%1 is loaded. This program is known to cause issues with Mod Organizer, such as freezing or blank windows. Consider uninstalling it.</source>
+ <oldsource>%1 is loaded. This program is known to cause issues with Mod Organizer, such as freezing or blank windows. Consider uninstalling it. (%2)</oldsource>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QueryOverwriteDialog</name>
diff --git a/src/sanitychecks.cpp b/src/sanitychecks.cpp
index 330735ed..6da42e79 100644
--- a/src/sanitychecks.cpp
+++ b/src/sanitychecks.cpp
@@ -110,7 +110,11 @@ bool isFileBlocked(const QFileInfo& fi)
}
// file is blocked
- log::warn("'{}': file is blocked, zone id is {}", path, toString(z));
+ log::warn("{}", QObject::tr(
+ "'%1': file is blocked (%2)")
+ .arg(path)
+ .arg(toString(z)));
+
return true;
}
@@ -199,9 +203,9 @@ int checkMissingFiles()
const QFileInfo file(dir + "/" + name);
if (!file.exists()) {
- log::warn(
- "'{}' seems to be missing, an antivirus may have deleted it",
- file.absoluteFilePath());
+ log::warn("{}", QObject::tr(
+ "'%1' seems to be missing, an antivirus may have deleted it")
+ .arg(file.absoluteFilePath()));
++n;
}
@@ -223,7 +227,8 @@ int checkIncompatibleModule(const env::Module& m)
static const std::map<QString, QString> names = {
{"NahimicOSD.dll", "Nahimic"},
{"RTSSHooks64.dll", "RivaTuner Statistics Server"},
- {"SSAudioOSD.dll", "SteelSeries Audio"}
+ {"SSAudioOSD.dll", "SteelSeries Audio"},
+ {"SS3DevProps.dll", "Sonic Suite 3"}
};
const QFileInfo file(m.path());
@@ -231,10 +236,13 @@ int checkIncompatibleModule(const env::Module& m)
for (auto&& p : names) {
if (file.fileName().compare(p.first, Qt::CaseInsensitive) == 0) {
- log::warn(
- "{} is loaded. This program is known to cause issues with "
+ log::warn("{}", QObject::tr(
+ "%1 is loaded. This program is known to cause issues with "
"Mod Organizer, such as freezing or blank windows. Consider "
- "uninstalling it. ({})", p.second, file.absoluteFilePath());
+ "uninstalling it.")
+ .arg(p.second));
+
+ log::warn("{}", file.absoluteFilePath());
++n;
}
diff --git a/src/stylesheets/dark.qss b/src/stylesheets/dark.qss
index 9d11109d..91f808bc 100644
--- a/src/stylesheets/dark.qss
+++ b/src/stylesheets/dark.qss
@@ -349,7 +349,7 @@ QToolButton:hover
padding-bottom: 2px;
}
-QTreeView
+QTreeView, QListView
{
color: #E9E6E4;
background-color: #3F4041;
diff --git a/src/version.rc b/src/version.rc
index 1544451e..4220f50f 100644
--- a/src/version.rc
+++ b/src/version.rc
@@ -4,7 +4,7 @@
// 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.2rc2\0"
+#define VER_FILEVERSION_STR "2.2.2rc3\0"
VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION