mirror of
https://github.com/ModOrganizer2/modorganizer.git
synced 2026-07-27 13:58:24 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a3a15b1f6 | ||
|
|
1ea43586d8 | ||
|
|
fd51434e5e | ||
|
|
7eb4b33214 | ||
|
|
e1e367c7ea | ||
|
|
696bb3bc47 | ||
|
|
10be66a62a | ||
|
|
a02b920b19 | ||
|
|
2f8e5b4f69 | ||
|
|
385765ecdd | ||
|
|
447a2169fe | ||
|
|
fc8a6b358f | ||
|
|
edf608ab23 | ||
|
|
d02df7e4b4 | ||
|
|
cc63717060 | ||
|
|
8f28e0af36 | ||
|
|
e80bb3a837 | ||
|
|
f6ecb93d46 | ||
|
|
4f14598cfc | ||
|
|
ce2494ba20 | ||
|
|
d5f3bee642 | ||
|
|
b38957d853 | ||
|
|
f824d255a2 | ||
|
|
344b83957e | ||
|
|
023cacab7f | ||
|
|
35bbe0001e | ||
|
|
75478f68a1 | ||
|
|
5a0b8b431c | ||
|
|
61b33a8351 | ||
|
|
103e3f3098 | ||
|
|
872c33fe55 | ||
|
|
9ddb26ea51 | ||
|
|
1867c20f02 | ||
|
|
6552054e58 | ||
|
|
a830f3e09e | ||
|
|
eaf3655492 | ||
|
|
952f1fe8cd | ||
|
|
b4530eb843 | ||
|
|
f20a1f6a84 | ||
|
|
942e656a71 | ||
|
|
7f3dc586b0 | ||
|
|
2524d65441 | ||
|
|
5efddbd515 | ||
|
|
181de232f4 | ||
|
|
1f9103c24e | ||
|
|
2d49ba2bef | ||
|
|
e41c97b64f | ||
|
|
b7d6bbb451 | ||
|
|
4a765cc152 | ||
|
|
30f170c10d | ||
|
|
b6aa12b323 | ||
|
|
19d80cc23d | ||
|
|
0c4b1e9a92 | ||
|
|
cacf7e0542 | ||
|
|
f09ec53fcf | ||
|
|
ddb40b712e | ||
|
|
186f26b71e | ||
|
|
6d6444c126 | ||
|
|
4b66c6c1ef | ||
|
|
08f35d6519 | ||
|
|
6617be8ef9 | ||
|
|
5a5bfee712 | ||
|
|
2fc55ccc86 | ||
|
|
8731159bfb | ||
|
|
1c6543454e | ||
|
|
941c50bff9 | ||
|
|
1e6e055f39 | ||
|
|
81e329fb39 | ||
|
|
15db1b76f7 | ||
|
|
75e6c72ae4 | ||
|
|
9c1806cc74 | ||
|
|
8f905e1d49 | ||
|
|
2ee5f0e96d | ||
|
|
0d220b6b41 | ||
|
|
decbbb611e | ||
|
|
aeb0b42cde | ||
|
|
38391b10e9 |
@@ -40,7 +40,7 @@ int DownloadList::rowCount(const QModelIndex&) const
|
||||
|
||||
int DownloadList::columnCount(const QModelIndex&) const
|
||||
{
|
||||
return 3;
|
||||
return 4;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ QVariant DownloadList::headerData(int section, Qt::Orientation orientation, int
|
||||
switch (section) {
|
||||
case COL_NAME: return tr("Name");
|
||||
case COL_FILETIME: return tr("Filetime");
|
||||
case COL_SIZE: return tr("Size");
|
||||
default: return tr("Done");
|
||||
}
|
||||
} else {
|
||||
|
||||
+2
-1
@@ -39,7 +39,8 @@ public:
|
||||
enum EColumn {
|
||||
COL_NAME = 0,
|
||||
COL_FILETIME,
|
||||
COL_STATUS
|
||||
COL_STATUS,
|
||||
COL_SIZE
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
@@ -47,6 +47,8 @@ bool DownloadListSortProxy::lessThan(const QModelIndex &left,
|
||||
return m_Manager->getFileTime(leftIndex) < m_Manager->getFileTime(rightIndex);
|
||||
} else if (left.column() == DownloadList::COL_STATUS) {
|
||||
return m_Manager->getState(leftIndex) < m_Manager->getState(rightIndex);
|
||||
} else if(left.column() == DownloadList::COL_SIZE){
|
||||
return m_Manager->getFileSize(leftIndex) < m_Manager->getFileSize(rightIndex);
|
||||
} else {
|
||||
return leftIndex < rightIndex;
|
||||
}
|
||||
|
||||
+89
-16
@@ -82,11 +82,30 @@ void DownloadListWidgetDelegate::drawCache(QPainter *painter, const QStyleOption
|
||||
{
|
||||
QRect rect = option.rect;
|
||||
rect.setLeft(0);
|
||||
rect.setWidth(m_View->columnWidth(0) + m_View->columnWidth(1) + m_View->columnWidth(2));
|
||||
rect.setWidth(m_View->columnWidth(0) + m_View->columnWidth(1) + m_View->columnWidth(2) + m_View->columnWidth(3));
|
||||
painter->drawPixmap(rect, cache);
|
||||
}
|
||||
|
||||
|
||||
QString DownloadListWidgetDelegate::sizeFormat(quint64 size) const
|
||||
{
|
||||
qreal calc = size;
|
||||
QStringList list;
|
||||
list << "KB" << "MB" << "GB" << "TB";
|
||||
|
||||
QStringListIterator i(list);
|
||||
QString unit("byte(s)");
|
||||
|
||||
while (calc >= 1024.0 && i.hasNext())
|
||||
{
|
||||
unit = i.next();
|
||||
calc /= 1024.0;
|
||||
}
|
||||
|
||||
return QString().setNum(calc, 'f', 2) + " " + unit;
|
||||
}
|
||||
|
||||
|
||||
void DownloadListWidgetDelegate::paintPendingDownload(int downloadIndex) const
|
||||
{
|
||||
std::tuple<QString, int, int> nexusids = m_Manager->getPendingDownload(downloadIndex);
|
||||
@@ -106,9 +125,9 @@ void DownloadListWidgetDelegate::paintRegularDownload(int downloadIndex) const
|
||||
name.append("...");
|
||||
}
|
||||
m_NameLabel->setText(name);
|
||||
m_SizeLabel->setText(QString::number(m_Manager->getFileSize(downloadIndex) / 1024));
|
||||
m_SizeLabel->setText(sizeFormat(m_Manager->getFileSize(downloadIndex) ));
|
||||
DownloadManager::DownloadState state = m_Manager->getState(downloadIndex);
|
||||
if ((state == DownloadManager::STATE_PAUSED) || (state == DownloadManager::STATE_ERROR)) {
|
||||
if ((state == DownloadManager::STATE_PAUSED) || (state == DownloadManager::STATE_ERROR) || (state == DownloadManager::STATE_PAUSING)) {
|
||||
QPalette labelPalette;
|
||||
m_InstallLabel->setVisible(true);
|
||||
m_Progress->setVisible(false);
|
||||
@@ -174,7 +193,7 @@ void DownloadListWidgetDelegate::paint(QPainter *painter, const QStyleOptionView
|
||||
return;
|
||||
}
|
||||
|
||||
m_ItemWidget->resize(QSize(m_View->columnWidth(0) + m_View->columnWidth(1) + m_View->columnWidth(2), option.rect.height()));
|
||||
m_ItemWidget->resize(QSize(m_View->columnWidth(0) + m_View->columnWidth(1) + m_View->columnWidth(2) + m_View->columnWidth(3), option.rect.height()));
|
||||
|
||||
int downloadIndex = index.data().toInt();
|
||||
|
||||
@@ -226,7 +245,11 @@ void DownloadListWidgetDelegate::issueQueryInfo()
|
||||
|
||||
void DownloadListWidgetDelegate::issueDelete()
|
||||
{
|
||||
emit removeDownload(m_ContextRow, true);
|
||||
if (QMessageBox::question(nullptr, tr("Delete Files?"),
|
||||
tr("This will permanently delete the selected download."),
|
||||
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
|
||||
emit removeDownload(m_ContextRow, true);
|
||||
}
|
||||
}
|
||||
|
||||
void DownloadListWidgetDelegate::issueRemoveFromView()
|
||||
@@ -236,7 +259,22 @@ void DownloadListWidgetDelegate::issueRemoveFromView()
|
||||
|
||||
void DownloadListWidgetDelegate::issueRestoreToView()
|
||||
{
|
||||
emit restoreDownload(m_ContextRow);
|
||||
emit restoreDownload(m_ContextRow);
|
||||
}
|
||||
|
||||
void DownloadListWidgetDelegate::issueRestoreToViewAll()
|
||||
{
|
||||
emit restoreDownload(-1);
|
||||
}
|
||||
|
||||
void DownloadListWidgetDelegate::issueVisitOnNexus()
|
||||
{
|
||||
emit visitOnNexus(m_ContextRow);
|
||||
}
|
||||
|
||||
void DownloadListWidgetDelegate::issueOpenInDownloadsFolder()
|
||||
{
|
||||
emit openInDownloadsFolder(m_ContextRow);
|
||||
}
|
||||
|
||||
void DownloadListWidgetDelegate::issueCancel()
|
||||
@@ -256,7 +294,7 @@ void DownloadListWidgetDelegate::issueResume()
|
||||
|
||||
void DownloadListWidgetDelegate::issueDeleteAll()
|
||||
{
|
||||
if (QMessageBox::question(nullptr, tr("Are you sure?"),
|
||||
if (QMessageBox::question(nullptr, tr("Delete Files?"),
|
||||
tr("This will remove all finished downloads from this list and from disk."),
|
||||
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
|
||||
emit removeDownload(-1, true);
|
||||
@@ -265,13 +303,22 @@ void DownloadListWidgetDelegate::issueDeleteAll()
|
||||
|
||||
void DownloadListWidgetDelegate::issueDeleteCompleted()
|
||||
{
|
||||
if (QMessageBox::question(nullptr, tr("Are you sure?"),
|
||||
if (QMessageBox::question(nullptr, tr("Delete Files?"),
|
||||
tr("This will remove all installed downloads from this list and from disk."),
|
||||
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
|
||||
emit removeDownload(-2, true);
|
||||
}
|
||||
}
|
||||
|
||||
void DownloadListWidgetDelegate::issueDeleteUninstalled()
|
||||
{
|
||||
if (QMessageBox::question(nullptr, tr("Delete Files?"),
|
||||
tr("This will remove all uninstalled downloads from this list and from disk."),
|
||||
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
|
||||
emit removeDownload(-3, true);
|
||||
}
|
||||
}
|
||||
|
||||
void DownloadListWidgetDelegate::issueRemoveFromViewAll()
|
||||
{
|
||||
if (QMessageBox::question(nullptr, tr("Are you sure?"),
|
||||
@@ -290,6 +337,15 @@ void DownloadListWidgetDelegate::issueRemoveFromViewCompleted()
|
||||
}
|
||||
}
|
||||
|
||||
void DownloadListWidgetDelegate::issueRemoveFromViewUninstalled()
|
||||
{
|
||||
if (QMessageBox::question(nullptr, tr("Are you sure?"),
|
||||
tr("This will remove all uninstalled downloads from this list (but NOT from disk)."),
|
||||
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
|
||||
emit removeDownload(-3, false);
|
||||
}
|
||||
}
|
||||
|
||||
bool DownloadListWidgetDelegate::editorEvent(QEvent *event, QAbstractItemModel *model,
|
||||
const QStyleOptionViewItem &option, const QModelIndex &index)
|
||||
{
|
||||
@@ -298,7 +354,7 @@ bool DownloadListWidgetDelegate::editorEvent(QEvent *event, QAbstractItemModel *
|
||||
QModelIndex sourceIndex = qobject_cast<QSortFilterProxyModel*>(model)->mapToSource(index);
|
||||
if (m_Manager->getState(sourceIndex.row()) >= DownloadManager::STATE_READY) {
|
||||
emit installDownload(sourceIndex.row());
|
||||
} else if (m_Manager->getState(sourceIndex.row()) >= DownloadManager::STATE_PAUSED) {
|
||||
} else if ((m_Manager->getState(sourceIndex.row()) >= DownloadManager::STATE_PAUSED) || (m_Manager->getState(sourceIndex.row()) == DownloadManager::STATE_PAUSING)) {
|
||||
emit resumeDownload(sourceIndex.row());
|
||||
}
|
||||
return true;
|
||||
@@ -315,7 +371,14 @@ bool DownloadListWidgetDelegate::editorEvent(QEvent *event, QAbstractItemModel *
|
||||
menu.addAction(tr("Install"), this, SLOT(issueInstall()));
|
||||
if (m_Manager->isInfoIncomplete(m_ContextRow)) {
|
||||
menu.addAction(tr("Query Info"), this, SLOT(issueQueryInfo()));
|
||||
}else {
|
||||
menu.addAction(tr("Visit on Nexus"), this,SLOT(issueVisitOnNexus()));
|
||||
}
|
||||
|
||||
menu.addAction(tr("Show in Folder"), this, SLOT(issueOpenInDownloadsFolder()));
|
||||
|
||||
menu.addSeparator();
|
||||
|
||||
menu.addAction(tr("Delete"), this, SLOT(issueDelete()));
|
||||
if (hidden) {
|
||||
menu.addAction(tr("Un-Hide"), this, SLOT(issueRestoreToView()));
|
||||
@@ -325,20 +388,30 @@ bool DownloadListWidgetDelegate::editorEvent(QEvent *event, QAbstractItemModel *
|
||||
} else if (state == DownloadManager::STATE_DOWNLOADING){
|
||||
menu.addAction(tr("Cancel"), this, SLOT(issueCancel()));
|
||||
menu.addAction(tr("Pause"), this, SLOT(issuePause()));
|
||||
} else if ((state == DownloadManager::STATE_PAUSED) || (state == DownloadManager::STATE_ERROR)) {
|
||||
menu.addAction(tr("Remove"), this, SLOT(issueDelete()));
|
||||
menu.addAction(tr("Show in Folder"), this, SLOT(issueOpenInDownloadsFolder()));
|
||||
} else if ((state == DownloadManager::STATE_PAUSED) || (state == DownloadManager::STATE_ERROR) || (state == DownloadManager::STATE_PAUSING)) {
|
||||
menu.addAction(tr("Delete"), this, SLOT(issueDelete()));
|
||||
menu.addAction(tr("Resume"), this, SLOT(issueResume()));
|
||||
menu.addAction(tr("Show in Folder"), this, SLOT(issueOpenInDownloadsFolder()));
|
||||
}
|
||||
|
||||
menu.addSeparator();
|
||||
}
|
||||
menu.addAction(tr("Delete Installed..."), this, SLOT(issueDeleteCompleted()));
|
||||
menu.addAction(tr("Delete Uninstalled..."), this, SLOT(issueDeleteUninstalled()));
|
||||
menu.addAction(tr("Delete All..."), this, SLOT(issueDeleteAll()));
|
||||
if (!hidden) {
|
||||
menu.addSeparator();
|
||||
menu.addAction(tr("Hide Installed..."), this, SLOT(issueRemoveFromViewCompleted()));
|
||||
menu.addAction(tr("Hide All..."), this, SLOT(issueRemoveFromViewAll()));
|
||||
}
|
||||
|
||||
if (!hidden) {
|
||||
menu.addSeparator();
|
||||
menu.addAction(tr("Hide Installed..."), this, SLOT(issueRemoveFromViewCompleted()));
|
||||
menu.addAction(tr("Hide Uninstalled..."), this, SLOT(issueRemoveFromViewUninstalled()));
|
||||
menu.addAction(tr("Hide All..."), this, SLOT(issueRemoveFromViewAll()));
|
||||
}
|
||||
if (hidden) {
|
||||
menu.addSeparator();
|
||||
menu.addAction(tr("Un-Hide All..."), this, SLOT(issueRestoreToViewAll()));
|
||||
}
|
||||
|
||||
menu.exec(mouseEvent->globalPos());
|
||||
|
||||
event->accept();
|
||||
|
||||
@@ -71,14 +71,18 @@ signals:
|
||||
void cancelDownload(int index);
|
||||
void pauseDownload(int index);
|
||||
void resumeDownload(int index);
|
||||
void visitOnNexus(int index);
|
||||
void openInDownloadsFolder(int index);
|
||||
|
||||
protected:
|
||||
|
||||
QString sizeFormat(quint64 size) const;
|
||||
bool editorEvent(QEvent *event, QAbstractItemModel *model,
|
||||
const QStyleOptionViewItem &option, const QModelIndex &index);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
void drawCache(QPainter *painter, const QStyleOptionViewItem &option, const QPixmap &cache) const;
|
||||
|
||||
private slots:
|
||||
@@ -87,13 +91,18 @@ private slots:
|
||||
void issueDelete();
|
||||
void issueRemoveFromView();
|
||||
void issueRestoreToView();
|
||||
void issueRestoreToViewAll();
|
||||
void issueVisitOnNexus();
|
||||
void issueOpenInDownloadsFolder();
|
||||
void issueCancel();
|
||||
void issuePause();
|
||||
void issueResume();
|
||||
void issueDeleteAll();
|
||||
void issueDeleteCompleted();
|
||||
void issueDeleteUninstalled();
|
||||
void issueRemoveFromViewAll();
|
||||
void issueRemoveFromViewCompleted();
|
||||
void issueRemoveFromViewUninstalled();
|
||||
void issueQueryInfo();
|
||||
|
||||
void stateChanged(int row, DownloadManager::DownloadState);
|
||||
|
||||
@@ -86,6 +86,9 @@
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string notr="true">KB</string>
|
||||
</property>
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -81,18 +81,35 @@ void DownloadListWidgetCompactDelegate::drawCache(QPainter *painter, const QStyl
|
||||
{
|
||||
QRect rect = option.rect;
|
||||
rect.setLeft(0);
|
||||
rect.setWidth(m_View->columnWidth(0) + m_View->columnWidth(1) + m_View->columnWidth(2));
|
||||
rect.setWidth(m_View->columnWidth(0) + m_View->columnWidth(1) + m_View->columnWidth(2) + m_View->columnWidth(3));
|
||||
painter->drawPixmap(rect, cache);
|
||||
}
|
||||
|
||||
QString DownloadListWidgetCompactDelegate::sizeFormat(quint64 size) const
|
||||
{
|
||||
qreal calc = size;
|
||||
QStringList list;
|
||||
list << "KB" << "MB" << "GB" << "TB";
|
||||
|
||||
QStringListIterator i(list);
|
||||
QString unit("byte(s)");
|
||||
|
||||
while (calc >= 1024.0 && i.hasNext())
|
||||
{
|
||||
unit = i.next();
|
||||
calc /= 1024.0;
|
||||
}
|
||||
|
||||
return QString().setNum(calc, 'f', 2) + " " + unit;
|
||||
}
|
||||
|
||||
void DownloadListWidgetCompactDelegate::paintPendingDownload(int downloadIndex) const
|
||||
{
|
||||
std::tuple<QString, int, int> nexusids = m_Manager->getPendingDownload(downloadIndex);
|
||||
m_NameLabel->setText(tr("< game %1 mod %2 file %3 >").arg(std::get<0>(nexusids)).arg(std::get<1>(nexusids)).arg(std::get<2>(nexusids)));
|
||||
if (m_SizeLabel != nullptr) {
|
||||
m_SizeLabel->setText("???");
|
||||
}
|
||||
//if (m_SizeLabel != nullptr) {
|
||||
// m_SizeLabel->setText("???");
|
||||
//}
|
||||
m_DoneLabel->setVisible(true);
|
||||
m_DoneLabel->setText(tr("Pending"));
|
||||
m_Progress->setVisible(false);
|
||||
@@ -110,11 +127,15 @@ void DownloadListWidgetCompactDelegate::paintRegularDownload(int downloadIndex)
|
||||
|
||||
DownloadManager::DownloadState state = m_Manager->getState(downloadIndex);
|
||||
|
||||
if ((m_SizeLabel != nullptr) && (state >= DownloadManager::STATE_READY)) {
|
||||
m_SizeLabel->setText(QString::number(m_Manager->getFileSize(downloadIndex) / 1048576));
|
||||
if (m_SizeLabel != nullptr) {
|
||||
m_SizeLabel->setText(sizeFormat(m_Manager->getFileSize(downloadIndex)) + " ");
|
||||
m_SizeLabel->setVisible(true);
|
||||
}
|
||||
//else {
|
||||
// m_SizeLabel->setVisible(false);
|
||||
//}
|
||||
|
||||
if ((state == DownloadManager::STATE_PAUSED) || (state == DownloadManager::STATE_ERROR)) {
|
||||
if ((state == DownloadManager::STATE_PAUSED) || (state == DownloadManager::STATE_ERROR) || (state == DownloadManager::STATE_PAUSING)) {
|
||||
m_DoneLabel->setVisible(true);
|
||||
m_Progress->setVisible(false);
|
||||
m_DoneLabel->setText(QString("%1<img src=\":/MO/gui/inactive\">").arg(tr("Paused")));
|
||||
@@ -153,7 +174,7 @@ void DownloadListWidgetCompactDelegate::paint(QPainter *painter, const QStyleOpt
|
||||
return;
|
||||
}
|
||||
|
||||
m_ItemWidget->resize(QSize(m_View->columnWidth(0) + m_View->columnWidth(1) + m_View->columnWidth(2), option.rect.height()));
|
||||
m_ItemWidget->resize(QSize(m_View->columnWidth(0) + m_View->columnWidth(1) + m_View->columnWidth(2) + m_View->columnWidth(3), option.rect.height()));
|
||||
if (index.row() % 2 == 1) {
|
||||
m_ItemWidget->setBackgroundRole(QPalette::AlternateBase);
|
||||
} else {
|
||||
@@ -209,7 +230,11 @@ void DownloadListWidgetCompactDelegate::issueQueryInfo()
|
||||
|
||||
void DownloadListWidgetCompactDelegate::issueDelete()
|
||||
{
|
||||
emit removeDownload(m_ContextIndex.row(), true);
|
||||
if (QMessageBox::question(nullptr, tr("Are you sure?"),
|
||||
tr("This will permanently delete the selected download."),
|
||||
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
|
||||
emit removeDownload(m_ContextIndex.row(), true);
|
||||
}
|
||||
}
|
||||
|
||||
void DownloadListWidgetCompactDelegate::issueRemoveFromView()
|
||||
@@ -217,11 +242,27 @@ void DownloadListWidgetCompactDelegate::issueRemoveFromView()
|
||||
emit removeDownload(m_ContextIndex.row(), false);
|
||||
}
|
||||
|
||||
void DownloadListWidgetCompactDelegate::issueVisitOnNexus()
|
||||
{
|
||||
emit visitOnNexus(m_ContextIndex.row());
|
||||
}
|
||||
|
||||
void DownloadListWidgetCompactDelegate::issueOpenInDownloadsFolder()
|
||||
{
|
||||
emit openInDownloadsFolder(m_ContextIndex.row());
|
||||
}
|
||||
|
||||
void DownloadListWidgetCompactDelegate::issueRestoreToView()
|
||||
{
|
||||
emit restoreDownload(m_ContextIndex.row());
|
||||
emit restoreDownload(m_ContextIndex.row());
|
||||
}
|
||||
|
||||
void DownloadListWidgetCompactDelegate::issueRestoreToViewAll()
|
||||
{
|
||||
emit restoreDownload(-1);
|
||||
}
|
||||
|
||||
|
||||
void DownloadListWidgetCompactDelegate::issueCancel()
|
||||
{
|
||||
emit cancelDownload(m_ContextIndex.row());
|
||||
@@ -255,6 +296,15 @@ void DownloadListWidgetCompactDelegate::issueDeleteCompleted()
|
||||
}
|
||||
}
|
||||
|
||||
void DownloadListWidgetCompactDelegate::issueDeleteUninstalled()
|
||||
{
|
||||
if (QMessageBox::question(nullptr, tr("Are you sure?"),
|
||||
tr("This will remove all uninstalled downloads from this list and from disk."),
|
||||
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
|
||||
emit removeDownload(-3, true);
|
||||
}
|
||||
}
|
||||
|
||||
void DownloadListWidgetCompactDelegate::issueRemoveFromViewAll()
|
||||
{
|
||||
if (QMessageBox::question(nullptr, tr("Are you sure?"),
|
||||
@@ -273,6 +323,15 @@ void DownloadListWidgetCompactDelegate::issueRemoveFromViewCompleted()
|
||||
}
|
||||
}
|
||||
|
||||
void DownloadListWidgetCompactDelegate::issueRemoveFromViewUninstalled()
|
||||
{
|
||||
if (QMessageBox::question(nullptr, tr("Are you sure?"),
|
||||
tr("This will permanently remove all uninstalled downloads from this list (but NOT from disk)."),
|
||||
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
|
||||
emit removeDownload(-3, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool DownloadListWidgetCompactDelegate::editorEvent(QEvent *event, QAbstractItemModel *model,
|
||||
const QStyleOptionViewItem &option, const QModelIndex &index)
|
||||
@@ -282,7 +341,7 @@ bool DownloadListWidgetCompactDelegate::editorEvent(QEvent *event, QAbstractItem
|
||||
QModelIndex sourceIndex = qobject_cast<QSortFilterProxyModel*>(model)->mapToSource(index);
|
||||
if (m_Manager->getState(sourceIndex.row()) >= DownloadManager::STATE_READY) {
|
||||
emit installDownload(sourceIndex.row());
|
||||
} else if (m_Manager->getState(sourceIndex.row()) >= DownloadManager::STATE_PAUSED) {
|
||||
} else if ((m_Manager->getState(sourceIndex.row()) >= DownloadManager::STATE_PAUSED) || (m_Manager->getState(sourceIndex.row()) == DownloadManager::STATE_PAUSING)) {
|
||||
emit resumeDownload(sourceIndex.row());
|
||||
}
|
||||
return true;
|
||||
@@ -299,7 +358,11 @@ bool DownloadListWidgetCompactDelegate::editorEvent(QEvent *event, QAbstractItem
|
||||
menu.addAction(tr("Install"), this, SLOT(issueInstall()));
|
||||
if (m_Manager->isInfoIncomplete(m_ContextIndex.row())) {
|
||||
menu.addAction(tr("Query Info"), this, SLOT(issueQueryInfo()));
|
||||
}else {
|
||||
menu.addAction(tr("Visit on Nexus"), this, SLOT(issueVisitOnNexus()));
|
||||
}
|
||||
menu.addAction(tr("Show in Folder"), this, SLOT(issueOpenInDownloadsFolder()));
|
||||
menu.addSeparator();
|
||||
menu.addAction(tr("Delete"), this, SLOT(issueDelete()));
|
||||
if (hidden) {
|
||||
menu.addAction(tr("Un-Hide"), this, SLOT(issueRestoreToView()));
|
||||
@@ -309,20 +372,27 @@ bool DownloadListWidgetCompactDelegate::editorEvent(QEvent *event, QAbstractItem
|
||||
} else if (state == DownloadManager::STATE_DOWNLOADING){
|
||||
menu.addAction(tr("Cancel"), this, SLOT(issueCancel()));
|
||||
menu.addAction(tr("Pause"), this, SLOT(issuePause()));
|
||||
} else if ((state == DownloadManager::STATE_PAUSED) || (state == DownloadManager::STATE_ERROR)) {
|
||||
menu.addAction(tr("Show in Folder"), this, SLOT(issueOpenInDownloadsFolder()));
|
||||
} else if ((state == DownloadManager::STATE_PAUSED) || (state == DownloadManager::STATE_ERROR) || (state == DownloadManager::STATE_PAUSING)) {
|
||||
menu.addAction(tr("Remove"), this, SLOT(issueDelete()));
|
||||
menu.addAction(tr("Resume"), this, SLOT(issueResume()));
|
||||
menu.addAction(tr("Show in Folder"), this, SLOT(issueOpenInDownloadsFolder()));
|
||||
}
|
||||
|
||||
menu.addSeparator();
|
||||
}
|
||||
menu.addAction(tr("Delete Installed..."), this, SLOT(issueDeleteCompleted()));
|
||||
menu.addAction(tr("Delete Uninstalled..."), this, SLOT(issueDeleteUninstalled()));
|
||||
menu.addAction(tr("Delete All..."), this, SLOT(issueDeleteAll()));
|
||||
if (!hidden) {
|
||||
menu.addSeparator();
|
||||
menu.addAction(tr("Hide Installed..."), this, SLOT(issueRemoveFromViewCompleted()));
|
||||
menu.addAction(tr("Hide Uninstalled..."), this, SLOT(issueRemoveFromViewUninstalled()));
|
||||
menu.addAction(tr("Hide All..."), this, SLOT(issueRemoveFromViewAll()));
|
||||
}
|
||||
if (hidden) {
|
||||
menu.addSeparator();
|
||||
menu.addAction(tr("Un-Hide All..."), this, SLOT(issueRestoreToViewAll()));
|
||||
}
|
||||
menu.exec(mouseEvent->globalPos());
|
||||
|
||||
event->accept();
|
||||
@@ -335,4 +405,3 @@ bool DownloadListWidgetCompactDelegate::editorEvent(QEvent *event, QAbstractItem
|
||||
|
||||
return QItemDelegate::editorEvent(event, model, option, index);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ class DownloadListWidgetCompact;
|
||||
class DownloadListWidgetCompact : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
public:
|
||||
explicit DownloadListWidgetCompact(QWidget *parent = 0);
|
||||
~DownloadListWidgetCompact();
|
||||
@@ -69,9 +69,12 @@ signals:
|
||||
void cancelDownload(int index);
|
||||
void pauseDownload(int index);
|
||||
void resumeDownload(int index);
|
||||
void visitOnNexus(int index);
|
||||
void openInDownloadsFolder(int index);
|
||||
|
||||
protected:
|
||||
|
||||
QString sizeFormat(quint64 size) const;
|
||||
bool editorEvent(QEvent *event, QAbstractItemModel *model,
|
||||
const QStyleOptionViewItem &option, const QModelIndex &index);
|
||||
|
||||
@@ -87,13 +90,18 @@ private slots:
|
||||
void issueDelete();
|
||||
void issueRemoveFromView();
|
||||
void issueRestoreToView();
|
||||
void issueRestoreToViewAll();
|
||||
void issueVisitOnNexus();
|
||||
void issueOpenInDownloadsFolder();
|
||||
void issueCancel();
|
||||
void issuePause();
|
||||
void issueResume();
|
||||
void issueDeleteAll();
|
||||
void issueDeleteCompleted();
|
||||
void issueDeleteUninstalled();
|
||||
void issueRemoveFromViewAll();
|
||||
void issueRemoveFromViewCompleted();
|
||||
void issueRemoveFromViewUninstalled();
|
||||
void issueQueryInfo();
|
||||
|
||||
void stateChanged(int row, DownloadManager::DownloadState);
|
||||
@@ -119,4 +127,3 @@ private:
|
||||
};
|
||||
|
||||
#endif // DOWNLOADLISTWIDGETCOMPACT_H
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<property name="autoFillBackground">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,0,0">
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
@@ -58,18 +58,25 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<width>10</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="sizeLabel">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="doneLabel">
|
||||
<property name="sizePolicy">
|
||||
|
||||
+241
-38
File diff suppressed because it is too large
Load Diff
+34
-1
@@ -29,6 +29,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include <QFile>
|
||||
#include <QNetworkReply>
|
||||
#include <QTime>
|
||||
#include <QTimer>
|
||||
#include <QVector>
|
||||
#include <QMap>
|
||||
#include <QStringList>
|
||||
@@ -77,6 +78,7 @@ private:
|
||||
qint64 m_PreResumeSize;
|
||||
std::pair<int, QString> m_Progress;
|
||||
std::tuple<int, int, int, int, int> m_SpeedDiff;
|
||||
bool m_HasData;
|
||||
DownloadState m_State;
|
||||
int m_CurrentUrl;
|
||||
QStringList m_Urls;
|
||||
@@ -114,7 +116,7 @@ private:
|
||||
private:
|
||||
static unsigned int s_NextDownloadID;
|
||||
private:
|
||||
DownloadInfo() : m_TotalSize(0), m_ReQueried(false), m_Hidden(false), m_SpeedDiff(std::tuple<int,int,int,int,int>(0,0,0,0,0)) {}
|
||||
DownloadInfo() : m_TotalSize(0), m_ReQueried(false), m_Hidden(false), m_SpeedDiff(std::tuple<int,int,int,int,int>(0,0,0,0,0)), m_HasData(false) {}
|
||||
};
|
||||
|
||||
public:
|
||||
@@ -136,6 +138,13 @@ public:
|
||||
**/
|
||||
bool downloadsInProgress();
|
||||
|
||||
/**
|
||||
* @brief determine if a download is currently in progress, does not count paused ones.
|
||||
*
|
||||
* @return true if there is currently a download in progress (that is not paused already).
|
||||
**/
|
||||
bool downloadsInProgressNoPause();
|
||||
|
||||
/**
|
||||
* @brief set the output directory to write to
|
||||
*
|
||||
@@ -143,6 +152,17 @@ public:
|
||||
**/
|
||||
void setOutputDirectory(const QString &outputDirectory);
|
||||
|
||||
/**
|
||||
* @brief disables feedback from the downlods fileSystemWhatcher untill disableDownloadsWatcherEnd() is called
|
||||
*
|
||||
**/
|
||||
static void startDisableDirWatcher();
|
||||
|
||||
/**
|
||||
* @brief re-enables feedback from the downlods fileSystemWhatcher after disableDownloadsWatcherStart() was called
|
||||
**/
|
||||
static void endDisableDirWatcher();
|
||||
|
||||
/**
|
||||
* @return current download directory
|
||||
**/
|
||||
@@ -423,6 +443,10 @@ public slots:
|
||||
|
||||
void queryInfo(int index);
|
||||
|
||||
void visitOnNexus(int index);
|
||||
|
||||
void openInDownloadsFolder(int index);
|
||||
|
||||
void nxmDescriptionAvailable(QString gameName, int modID, QVariant userData, QVariant resultData, int requestID);
|
||||
|
||||
void nxmFilesAvailable(QString gameName, int modID, QVariant userData, QVariant resultData, int requestID);
|
||||
@@ -443,6 +467,7 @@ private slots:
|
||||
void downloadError(QNetworkReply::NetworkError error);
|
||||
void metaDataChanged();
|
||||
void directoryChanged(const QString &dirctory);
|
||||
void checkDownloadTimeout();
|
||||
|
||||
private:
|
||||
|
||||
@@ -517,6 +542,12 @@ private:
|
||||
|
||||
QFileSystemWatcher m_DirWatcher;
|
||||
|
||||
//The dirWatcher is actually triggering off normal Mo operations such as deleting downloads or editing .meta files
|
||||
//so it needs to be disabled during operations that are known to cause the creation or deletion of files in the Downloads folder.
|
||||
//Notably using QSettings to edit a file creates a temporarily .lock file that causes the Watcher to trigger multiple listRefreshes freezing the ui.
|
||||
static int m_DirWatcherDisabler;
|
||||
|
||||
|
||||
std::map<QString, int> m_DownloadFails;
|
||||
|
||||
bool m_ShowHidden;
|
||||
@@ -524,6 +555,8 @@ private:
|
||||
QRegExp m_DateExpression;
|
||||
|
||||
MOBase::IPluginGame const *m_ManagedGame;
|
||||
|
||||
QTimer m_TimeoutTimer;
|
||||
};
|
||||
|
||||
|
||||
|
||||
+32
-3
@@ -131,11 +131,12 @@ QString InstanceManager::manageInstances(const QStringList &instanceList) const
|
||||
QString InstanceManager::queryInstanceName(const QStringList &instanceList) const
|
||||
{
|
||||
QString instanceId;
|
||||
QString dialogText;
|
||||
while (instanceId.isEmpty()) {
|
||||
QInputDialog dialog;
|
||||
|
||||
dialog.setWindowTitle(QObject::tr("Enter a Name for the new Instance"));
|
||||
dialog.setLabelText(QObject::tr("Enter a new name or select one from the sugested list (only letters and numbers allowed):"));
|
||||
dialog.setWindowTitle(QObject::tr("Enter a Name for the new Instance"));
|
||||
dialog.setLabelText(QObject::tr("Enter a new name or select one from the suggested list:"));
|
||||
// would be neat if we could take the names from the game plugins but
|
||||
// the required initialization order requires the ini file to be
|
||||
// available *before* we load plugins
|
||||
@@ -146,7 +147,17 @@ QString InstanceManager::queryInstanceName(const QStringList &instanceList) cons
|
||||
if (dialog.exec() == QDialog::Rejected) {
|
||||
throw MOBase::MyException(QObject::tr("Canceled"));
|
||||
}
|
||||
instanceId = dialog.textValue().replace(QRegExp("[^0-9a-zA-Z ]"), "");
|
||||
dialogText = dialog.textValue();
|
||||
instanceId = sanitizeInstanceName(dialogText);
|
||||
if (instanceId != dialogText) {
|
||||
if (QMessageBox::question( nullptr,
|
||||
QObject::tr("Invalid instance name"),
|
||||
QObject::tr("The instance name \"%1\" is invalid. Use the name \"%2\" instead?").arg(dialogText,instanceId),
|
||||
QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) {
|
||||
instanceId="";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
bool alreadyExists=false;
|
||||
for (const QString &instance : instanceList) {
|
||||
@@ -296,3 +307,21 @@ QString InstanceManager::determineDataPath()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QString InstanceManager::sanitizeInstanceName(const QString &name) const
|
||||
{
|
||||
QString new_name = name;
|
||||
|
||||
// Restrict the allowed characters
|
||||
new_name = new_name.remove(QRegExp("[^A-Za-z0-9 _=+;!@#$%^'\\-\\.\\[\\]\\{\\}\\(\\)]"));
|
||||
|
||||
// Don't end in spaces and periods
|
||||
new_name = new_name.remove(QRegExp("\\.*$"));
|
||||
new_name = new_name.remove(QRegExp(" *$"));
|
||||
|
||||
// Recurse until stuff stops changing
|
||||
if (new_name != name) {
|
||||
return sanitizeInstanceName(new_name);
|
||||
}
|
||||
return new_name;
|
||||
}
|
||||
@@ -50,6 +50,7 @@ private:
|
||||
|
||||
QString manageInstances(const QStringList &instanceList) const;
|
||||
|
||||
QString sanitizeInstanceName(const QString &name) const;
|
||||
void setCurrentInstance(const QString &name);
|
||||
|
||||
QString queryInstanceName(const QStringList &instanceList) const;
|
||||
|
||||
+1
-5
@@ -446,11 +446,7 @@ static void preloadSsl()
|
||||
|
||||
static QString getVersionDisplayString()
|
||||
{
|
||||
VS_FIXEDFILEINFO version = GetFileVersion(ToWString(QApplication::applicationFilePath()));
|
||||
return VersionInfo(version.dwFileVersionMS >> 16,
|
||||
version.dwFileVersionMS & 0xFFFF,
|
||||
version.dwFileVersionLS >> 16,
|
||||
version.dwFileVersionLS & 0xFFFF).displayString();
|
||||
return createVersionInfo().displayString();
|
||||
}
|
||||
|
||||
int runApplication(MOApplication &application, SingleInstance &instance,
|
||||
|
||||
+220
-77
@@ -242,7 +242,28 @@ MainWindow::MainWindow(QSettings &initSettings
|
||||
|
||||
updateProblemsButton();
|
||||
|
||||
updateToolBar();
|
||||
// Setup toolbar
|
||||
QWidget *spacer = new QWidget(ui->toolBar);
|
||||
spacer->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
|
||||
QWidget *widget = ui->toolBar->widgetForAction(ui->actionTool);
|
||||
QToolButton *toolBtn = qobject_cast<QToolButton*>(widget);
|
||||
|
||||
if (toolBtn->menu() == nullptr) {
|
||||
actionToToolButton(ui->actionTool);
|
||||
}
|
||||
|
||||
actionToToolButton(ui->actionHelp);
|
||||
createHelpWidget();
|
||||
|
||||
for (QAction *action : ui->toolBar->actions()) {
|
||||
if (action->isSeparator()) {
|
||||
// insert spacers
|
||||
ui->toolBar->insertWidget(action, spacer);
|
||||
m_Sep = action;
|
||||
// m_Sep would only use the last seperator anyway, and we only have the one anyway?
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
TaskProgressManager::instance().tryCreateTaskbar();
|
||||
|
||||
@@ -379,7 +400,7 @@ MainWindow::MainWindow(QSettings &initSettings
|
||||
|
||||
new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Enter), this, SLOT(openExplorer_activated()));
|
||||
new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Return), this, SLOT(openExplorer_activated()));
|
||||
|
||||
|
||||
new QShortcut(QKeySequence::Refresh, this, SLOT(refreshProfile_activated()));
|
||||
|
||||
|
||||
@@ -560,41 +581,22 @@ void MainWindow::updateToolBar()
|
||||
for (QAction *action : ui->toolBar->actions()) {
|
||||
if (action->objectName().startsWith("custom__")) {
|
||||
ui->toolBar->removeAction(action);
|
||||
action->deleteLater();
|
||||
}
|
||||
}
|
||||
|
||||
QWidget *spacer = new QWidget(ui->toolBar);
|
||||
spacer->setObjectName("custom__spacer");
|
||||
spacer->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
|
||||
QWidget *widget = ui->toolBar->widgetForAction(ui->actionTool);
|
||||
QToolButton *toolBtn = qobject_cast<QToolButton*>(widget);
|
||||
|
||||
if (toolBtn->menu() == nullptr) {
|
||||
actionToToolButton(ui->actionTool);
|
||||
}
|
||||
|
||||
actionToToolButton(ui->actionHelp);
|
||||
createHelpWidget();
|
||||
|
||||
for (QAction *action : ui->toolBar->actions()) {
|
||||
if (action->isSeparator()) {
|
||||
// insert spacers
|
||||
ui->toolBar->insertWidget(action, spacer);
|
||||
|
||||
std::vector<Executable>::iterator begin, end;
|
||||
m_OrganizerCore.executablesList()->getExecutables(begin, end);
|
||||
for (auto iter = begin; iter != end; ++iter) {
|
||||
if (iter->isShownOnToolbar()) {
|
||||
QAction *exeAction = new QAction(iconForExecutable(iter->m_BinaryInfo.filePath()),
|
||||
iter->m_Title,
|
||||
ui->toolBar);
|
||||
exeAction->setObjectName(QString("custom__") + iter->m_Title);
|
||||
if (!connect(exeAction, SIGNAL(triggered()), this, SLOT(startExeAction()))) {
|
||||
qDebug("failed to connect trigger?");
|
||||
}
|
||||
ui->toolBar->insertAction(action, exeAction);
|
||||
}
|
||||
std::vector<Executable>::iterator begin, end;
|
||||
m_OrganizerCore.executablesList()->getExecutables(begin, end);
|
||||
for (auto iter = begin; iter != end; ++iter) {
|
||||
if (iter->isShownOnToolbar()) {
|
||||
QAction *exeAction = new QAction(iconForExecutable(iter->m_BinaryInfo.filePath()),
|
||||
iter->m_Title,
|
||||
ui->toolBar);
|
||||
exeAction->setObjectName(QString("custom__") + iter->m_Title);
|
||||
if (!connect(exeAction, SIGNAL(triggered()), this, SLOT(startExeAction()))) {
|
||||
qDebug("failed to connect trigger?");
|
||||
}
|
||||
ui->toolBar->insertAction(m_Sep, exeAction);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -881,7 +883,7 @@ void MainWindow::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
m_closing = true;
|
||||
|
||||
if (m_OrganizerCore.downloadManager()->downloadsInProgress()) {
|
||||
if (m_OrganizerCore.downloadManager()->downloadsInProgressNoPause()) {
|
||||
if (QMessageBox::question(this, tr("Downloads in progress"),
|
||||
tr("There are still downloads in progress, do you really want to quit?"),
|
||||
QMessageBox::Yes | QMessageBox::Cancel) == QMessageBox::Cancel) {
|
||||
@@ -2334,9 +2336,11 @@ void MainWindow::removeMod_clicked()
|
||||
tr("Remove the following mods?<br><ul>%1</ul>").arg(mods),
|
||||
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
|
||||
// use mod names instead of indexes because those become invalid during the removal
|
||||
DownloadManager::startDisableDirWatcher();
|
||||
for (QString name : modNames) {
|
||||
m_OrganizerCore.modList()->removeRowForce(ModInfo::getIndex(name), QModelIndex());
|
||||
}
|
||||
DownloadManager::endDisableDirWatcher();
|
||||
}
|
||||
} else {
|
||||
m_OrganizerCore.modList()->removeRow(m_ContextRow, QModelIndex());
|
||||
@@ -2498,7 +2502,7 @@ void MainWindow::displayModInformation(ModInfo::Ptr modInfo, unsigned int index,
|
||||
connect(&dialog, SIGNAL(modOpenPrev(int)), this, SLOT(modOpenPrev(int)), Qt::QueuedConnection);
|
||||
connect(&dialog, SIGNAL(originModified(int)), this, SLOT(originModified(int)));
|
||||
connect(&dialog, SIGNAL(endorseMod(ModInfo::Ptr)), this, SLOT(endorseMod(ModInfo::Ptr)));
|
||||
|
||||
|
||||
//Open the tab first if we want to use the standard indexes of the tabs.
|
||||
if (tab != -1) {
|
||||
dialog.openTab(tab);
|
||||
@@ -2615,20 +2619,44 @@ void MainWindow::displayModInformation(int row, int tab)
|
||||
|
||||
void MainWindow::ignoreMissingData_clicked()
|
||||
{
|
||||
ModInfo::Ptr info = ModInfo::getByIndex(m_ContextRow);
|
||||
QDir(info->absolutePath()).mkdir("textures");
|
||||
info->testValid();
|
||||
connect(this, SIGNAL(modListDataChanged(QModelIndex,QModelIndex)), m_OrganizerCore.modList(), SIGNAL(dataChanged(QModelIndex,QModelIndex)));
|
||||
QItemSelectionModel *selection = ui->modList->selectionModel();
|
||||
if (selection->hasSelection() && selection->selectedRows().count() > 1) {
|
||||
for (QModelIndex idx : selection->selectedRows()) {
|
||||
int row_idx = idx.data(Qt::UserRole + 1).toInt();
|
||||
ModInfo::Ptr info = ModInfo::getByIndex(row_idx);
|
||||
QDir(info->absolutePath()).mkdir("textures");
|
||||
info->testValid();
|
||||
connect(this, SIGNAL(modListDataChanged(QModelIndex, QModelIndex)), m_OrganizerCore.modList(), SIGNAL(dataChanged(QModelIndex, QModelIndex)));
|
||||
|
||||
emit modListDataChanged(m_OrganizerCore.modList()->index(m_ContextRow, 0), m_OrganizerCore.modList()->index(m_ContextRow, m_OrganizerCore.modList()->columnCount() - 1));
|
||||
emit modListDataChanged(m_OrganizerCore.modList()->index(row_idx, 0), m_OrganizerCore.modList()->index(row_idx, m_OrganizerCore.modList()->columnCount() - 1));
|
||||
}
|
||||
} else {
|
||||
ModInfo::Ptr info = ModInfo::getByIndex(m_ContextRow);
|
||||
QDir(info->absolutePath()).mkdir("textures");
|
||||
info->testValid();
|
||||
connect(this, SIGNAL(modListDataChanged(QModelIndex, QModelIndex)), m_OrganizerCore.modList(), SIGNAL(dataChanged(QModelIndex, QModelIndex)));
|
||||
|
||||
emit modListDataChanged(m_OrganizerCore.modList()->index(m_ContextRow, 0), m_OrganizerCore.modList()->index(m_ContextRow, m_OrganizerCore.modList()->columnCount() - 1));
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::markConverted_clicked()
|
||||
{
|
||||
ModInfo::Ptr info = ModInfo::getByIndex(m_ContextRow);
|
||||
info->markConverted(true);
|
||||
connect(this, SIGNAL(modListDataChanged(QModelIndex, QModelIndex)), m_OrganizerCore.modList(), SIGNAL(dataChanged(QModelIndex, QModelIndex)));
|
||||
emit modListDataChanged(m_OrganizerCore.modList()->index(m_ContextRow, 0), m_OrganizerCore.modList()->index(m_ContextRow, m_OrganizerCore.modList()->columnCount() - 1));
|
||||
QItemSelectionModel *selection = ui->modList->selectionModel();
|
||||
if (selection->hasSelection() && selection->selectedRows().count() > 1) {
|
||||
for (QModelIndex idx : selection->selectedRows()) {
|
||||
int row_idx = idx.data(Qt::UserRole + 1).toInt();
|
||||
ModInfo::Ptr info = ModInfo::getByIndex(row_idx);
|
||||
info->markConverted(true);
|
||||
connect(this, SIGNAL(modListDataChanged(QModelIndex, QModelIndex)), m_OrganizerCore.modList(), SIGNAL(dataChanged(QModelIndex, QModelIndex)));
|
||||
emit modListDataChanged(m_OrganizerCore.modList()->index(row_idx, 0), m_OrganizerCore.modList()->index(row_idx, m_OrganizerCore.modList()->columnCount() - 1));
|
||||
}
|
||||
} else {
|
||||
ModInfo::Ptr info = ModInfo::getByIndex(m_ContextRow);
|
||||
info->markConverted(true);
|
||||
connect(this, SIGNAL(modListDataChanged(QModelIndex, QModelIndex)), m_OrganizerCore.modList(), SIGNAL(dataChanged(QModelIndex, QModelIndex)));
|
||||
emit modListDataChanged(m_OrganizerCore.modList()->index(m_ContextRow, 0), m_OrganizerCore.modList()->index(m_ContextRow, m_OrganizerCore.modList()->columnCount() - 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2655,9 +2683,17 @@ void MainWindow::visitWebPage_clicked()
|
||||
|
||||
void MainWindow::openExplorer_clicked()
|
||||
{
|
||||
ModInfo::Ptr modInfo = ModInfo::getByIndex(m_ContextRow);
|
||||
|
||||
::ShellExecuteW(nullptr, L"explore", ToWString(modInfo->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
|
||||
QItemSelectionModel *selection = ui->modList->selectionModel();
|
||||
if (selection->hasSelection() && selection->selectedRows().count() > 1) {
|
||||
for (QModelIndex idx : selection->selectedRows()) {
|
||||
ModInfo::Ptr info = ModInfo::getByIndex(idx.data(Qt::UserRole + 1).toInt());
|
||||
::ShellExecuteW(nullptr, L"explore", ToWString(info->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ModInfo::Ptr modInfo = ModInfo::getByIndex(m_ContextRow);
|
||||
::ShellExecuteW(nullptr, L"explore", ToWString(modInfo->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::openExplorer_activated()
|
||||
@@ -2685,7 +2721,7 @@ void MainWindow::openExplorer_activated()
|
||||
QModelIndex idx = selection->currentIndex();
|
||||
QString fileName = idx.data().toString();
|
||||
|
||||
|
||||
|
||||
|
||||
ModInfo::Ptr modInfo = ModInfo::getByIndex(ModInfo::getIndex(m_OrganizerCore.pluginList()->origin(fileName)));
|
||||
std::vector<ModInfo::EFlag> flags = modInfo->getFlags();
|
||||
@@ -2825,13 +2861,83 @@ void MainWindow::on_modList_doubleClicked(const QModelIndex &index)
|
||||
return;
|
||||
}
|
||||
|
||||
Qt::KeyboardModifiers modifiers = QApplication::queryKeyboardModifiers();
|
||||
if (modifiers.testFlag(Qt::ControlModifier)) {
|
||||
try {
|
||||
m_ContextRow = m_ModListSortProxy->mapToSource(index).row();
|
||||
openExplorer_clicked();
|
||||
// workaround to cancel the editor that might have opened because of
|
||||
// selection-click
|
||||
ui->modList->closePersistentEditor(index);
|
||||
}
|
||||
catch (const std::exception &e) {
|
||||
reportError(e.what());
|
||||
}
|
||||
}
|
||||
else {
|
||||
try {
|
||||
m_ContextRow = m_ModListSortProxy->mapToSource(index).row();
|
||||
displayModInformation(sourceIdx.row());
|
||||
// workaround to cancel the editor that might have opened because of
|
||||
// selection-click
|
||||
ui->modList->closePersistentEditor(index);
|
||||
}
|
||||
catch (const std::exception &e) {
|
||||
reportError(e.what());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_espList_doubleClicked(const QModelIndex &index)
|
||||
{
|
||||
if (!index.isValid()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_OrganizerCore.pluginList()->timeElapsedSinceLastChecked() <= QApplication::doubleClickInterval()) {
|
||||
// don't interpret double click if we only just checked a plugin
|
||||
return;
|
||||
}
|
||||
|
||||
QModelIndex sourceIdx = mapToModel(m_OrganizerCore.pluginList(), index);
|
||||
if (!sourceIdx.isValid()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
m_ContextRow = m_ModListSortProxy->mapToSource(index).row();
|
||||
displayModInformation(sourceIdx.row());
|
||||
// workaround to cancel the editor that might have opened because of
|
||||
// selection-click
|
||||
ui->modList->closePersistentEditor(index);
|
||||
} catch (const std::exception &e) {
|
||||
|
||||
QItemSelectionModel *selection = ui->espList->selectionModel();
|
||||
|
||||
if (selection->hasSelection() && selection->selectedRows().count() == 1) {
|
||||
|
||||
QModelIndex idx = selection->currentIndex();
|
||||
QString fileName = idx.data().toString();
|
||||
|
||||
if (ModInfo::getIndex(m_OrganizerCore.pluginList()->origin(fileName)) == UINT_MAX)
|
||||
return;
|
||||
|
||||
ModInfo::Ptr modInfo = ModInfo::getByIndex(ModInfo::getIndex(m_OrganizerCore.pluginList()->origin(fileName)));
|
||||
std::vector<ModInfo::EFlag> flags = modInfo->getFlags();
|
||||
|
||||
if (modInfo->isRegular() || (std::find(flags.begin(), flags.end(), ModInfo::FLAG_OVERWRITE) != flags.end())) {
|
||||
|
||||
Qt::KeyboardModifiers modifiers = QApplication::queryKeyboardModifiers();
|
||||
if (modifiers.testFlag(Qt::ControlModifier)) {
|
||||
openExplorer_activated();
|
||||
// workaround to cancel the editor that might have opened because of
|
||||
// selection-click
|
||||
ui->espList->closePersistentEditor(index);
|
||||
}
|
||||
else {
|
||||
|
||||
displayModInformation(ModInfo::getIndex(m_OrganizerCore.pluginList()->origin(fileName)));
|
||||
// workaround to cancel the editor that might have opened because of
|
||||
// selection-click
|
||||
ui->espList->closePersistentEditor(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (const std::exception &e) {
|
||||
reportError(e.what());
|
||||
}
|
||||
}
|
||||
@@ -3072,14 +3178,32 @@ void MainWindow::changeVersioningScheme() {
|
||||
}
|
||||
|
||||
void MainWindow::ignoreUpdate() {
|
||||
ModInfo::Ptr info = ModInfo::getByIndex(m_ContextRow);
|
||||
info->ignoreUpdate(true);
|
||||
QItemSelectionModel *selection = ui->modList->selectionModel();
|
||||
if (selection->hasSelection() && selection->selectedRows().count() > 1) {
|
||||
for (QModelIndex idx : selection->selectedRows()) {
|
||||
ModInfo::Ptr info = ModInfo::getByIndex(idx.data(Qt::UserRole + 1).toInt());
|
||||
info->ignoreUpdate(true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ModInfo::Ptr info = ModInfo::getByIndex(m_ContextRow);
|
||||
info->ignoreUpdate(true);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::unignoreUpdate()
|
||||
{
|
||||
ModInfo::Ptr info = ModInfo::getByIndex(m_ContextRow);
|
||||
info->ignoreUpdate(false);
|
||||
QItemSelectionModel *selection = ui->modList->selectionModel();
|
||||
if (selection->hasSelection() && selection->selectedRows().count() > 1) {
|
||||
for (QModelIndex idx : selection->selectedRows()) {
|
||||
ModInfo::Ptr info = ModInfo::getByIndex(idx.data(Qt::UserRole + 1).toInt());
|
||||
info->ignoreUpdate(false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ModInfo::Ptr info = ModInfo::getByIndex(m_ContextRow);
|
||||
info->ignoreUpdate(false);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::addPrimaryCategoryCandidates(QMenu *primaryCategoryMenu,
|
||||
@@ -3153,6 +3277,13 @@ void MainWindow::openInstallFolder()
|
||||
::ShellExecuteW(nullptr, L"explore", ToWString(qApp->applicationDirPath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
|
||||
}
|
||||
|
||||
void MainWindow::openPluginsFolder()
|
||||
{
|
||||
QString pluginsPath = QCoreApplication::applicationDirPath() + "/" + ToQString(AppConfig::pluginPath());
|
||||
::ShellExecuteW(nullptr, L"explore", ToWString(pluginsPath).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::openProfileFolder()
|
||||
{
|
||||
::ShellExecuteW(nullptr, L"explore", ToWString(m_OrganizerCore.currentProfile()->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
|
||||
@@ -3163,6 +3294,11 @@ void MainWindow::openDownloadsFolder()
|
||||
::ShellExecuteW(nullptr, L"explore", ToWString(m_OrganizerCore.settings().getDownloadDirectory()).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
|
||||
}
|
||||
|
||||
void MainWindow::openModsFolder()
|
||||
{
|
||||
::ShellExecuteW(nullptr, L"explore", ToWString(m_OrganizerCore.settings().getModDirectory()).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
|
||||
}
|
||||
|
||||
void MainWindow::openGameFolder()
|
||||
{
|
||||
::ShellExecuteW(nullptr, L"explore", ToWString(m_OrganizerCore.managedGame()->gameDirectory().absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
|
||||
@@ -3356,6 +3492,8 @@ QMenu *MainWindow::openFolderMenu()
|
||||
|
||||
FolderMenu->addAction(tr("Open Instance folder"), this, SLOT(openInstanceFolder()));
|
||||
|
||||
FolderMenu->addAction(tr("Open Mods folder"), this, SLOT(openModsFolder()));
|
||||
|
||||
FolderMenu->addAction(tr("Open Profile folder"), this, SLOT(openProfileFolder()));
|
||||
|
||||
FolderMenu->addAction(tr("Open Downloads folder"), this, SLOT(openDownloadsFolder()));
|
||||
@@ -3364,17 +3502,11 @@ QMenu *MainWindow::openFolderMenu()
|
||||
|
||||
FolderMenu->addAction(tr("Open MO2 Install folder"), this, SLOT(openInstallFolder()));
|
||||
|
||||
FolderMenu->addAction(tr("Open MO2 Plugins folder"), this, SLOT(openPluginsFolder()));
|
||||
|
||||
FolderMenu->addAction(tr("Open MO2 Logs folder"), this, SLOT(openLogsFolder()));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return FolderMenu;
|
||||
}
|
||||
|
||||
@@ -4199,12 +4331,16 @@ void MainWindow::on_actionUpdate_triggered()
|
||||
|
||||
void MainWindow::on_actionEndorseMO_triggered()
|
||||
{
|
||||
// Normally this would be the managed game but MO2 is only uploaded to the Skyrim SE site right now
|
||||
IPluginGame * game = m_OrganizerCore.getGame("skyrimse");
|
||||
if (!game) return;
|
||||
|
||||
if (QMessageBox::question(this, tr("Endorse Mod Organizer"),
|
||||
tr("Do you want to endorse Mod Organizer on %1 now?").arg(
|
||||
NexusInterface::instance(&m_PluginContainer)->getGameURL(m_OrganizerCore.managedGame()->gameShortName())),
|
||||
NexusInterface::instance(&m_PluginContainer)->getGameURL(game->gameShortName())),
|
||||
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
|
||||
NexusInterface::instance(&m_PluginContainer)->requestToggleEndorsement(
|
||||
m_OrganizerCore.managedGame()->gameShortName(), m_OrganizerCore.managedGame()->nexusModOrganizerID(), true, this, QVariant(), QString());
|
||||
game->gameShortName(), game->nexusModOrganizerID(), true, this, QVariant(), QString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4231,11 +4367,13 @@ void MainWindow::updateDownloadListDelegate()
|
||||
connect(ui->downloadFilterEdit, SIGNAL(textChanged(QString)), this, SLOT(downloadFilterChanged(QString)));
|
||||
|
||||
ui->downloadView->setModel(sortProxy);
|
||||
ui->downloadView->sortByColumn(1, Qt::DescendingOrder);
|
||||
ui->downloadView->header()->resizeSections(QHeaderView::Fixed);
|
||||
//ui->downloadView->sortByColumn(1, Qt::DescendingOrder);
|
||||
ui->downloadView->header()->resizeSections(QHeaderView::Stretch);
|
||||
|
||||
connect(ui->downloadView->itemDelegate(), SIGNAL(installDownload(int)), &m_OrganizerCore, SLOT(installDownload(int)));
|
||||
connect(ui->downloadView->itemDelegate(), SIGNAL(queryInfo(int)), m_OrganizerCore.downloadManager(), SLOT(queryInfo(int)));
|
||||
connect(ui->downloadView->itemDelegate(), SIGNAL(visitOnNexus(int)), m_OrganizerCore.downloadManager(), SLOT(visitOnNexus(int)));
|
||||
connect(ui->downloadView->itemDelegate(), SIGNAL(openInDownloadsFolder(int)), m_OrganizerCore.downloadManager(), SLOT(openInDownloadsFolder(int)));
|
||||
connect(ui->downloadView->itemDelegate(), SIGNAL(removeDownload(int, bool)), m_OrganizerCore.downloadManager(), SLOT(removeDownload(int, bool)));
|
||||
connect(ui->downloadView->itemDelegate(), SIGNAL(restoreDownload(int)), m_OrganizerCore.downloadManager(), SLOT(restoreDownload(int)));
|
||||
connect(ui->downloadView->itemDelegate(), SIGNAL(cancelDownload(int)), m_OrganizerCore.downloadManager(), SLOT(cancelDownload(int)));
|
||||
@@ -4267,9 +4405,13 @@ void MainWindow::nxmUpdatesAvailable(const std::vector<int> &modIDs, QVariant us
|
||||
QVariantList resultList = resultData.toList();
|
||||
for (auto iter = resultList.begin(); iter != resultList.end(); ++iter) {
|
||||
QVariantMap result = iter->toMap();
|
||||
if (result["id"].toInt() == m_OrganizerCore.managedGame()->nexusModOrganizerID()
|
||||
&& result["game_id"].toInt() == m_OrganizerCore.managedGame()->nexusGameID()) {
|
||||
if (!result["voted_by_user"].toBool()) {
|
||||
// Normally this would be the managed game but MO2 is only uploaded to the Skyrim SE site right now
|
||||
IPluginGame * game = m_OrganizerCore.getGame("skyrimse");
|
||||
if (game
|
||||
&& result["id"].toInt() == game->nexusModOrganizerID()
|
||||
&& result["game_id"].toInt() == game->nexusGameID()) {
|
||||
if (result["voted_by_user"].type() != QVariant::Invalid &&
|
||||
!result["voted_by_user"].toBool()) {
|
||||
ui->actionEndorseMO->setVisible(true);
|
||||
}
|
||||
} else {
|
||||
@@ -4293,7 +4435,8 @@ void MainWindow::nxmUpdatesAvailable(const std::vector<int> &modIDs, QVariant us
|
||||
(*iter)->setNewestVersion(result["version"].toString());
|
||||
(*iter)->setNexusDescription(result["description"].toString());
|
||||
if (NexusInterface::instance(&m_PluginContainer)->getAccessManager()->loggedIn() &&
|
||||
result.contains("voted_by_user")) {
|
||||
result.contains("voted_by_user") &&
|
||||
result["voted_by_user"].type() != QVariant::Invalid) {
|
||||
// don't use endorsement info if we're not logged in or if the response doesn't contain it
|
||||
(*iter)->setIsEndorsed(result["voted_by_user"].toBool());
|
||||
}
|
||||
@@ -4319,7 +4462,7 @@ void MainWindow::nxmEndorsementToggled(QString, int, QVariant, QVariant resultDa
|
||||
{
|
||||
if (resultData.toBool()) {
|
||||
ui->actionEndorseMO->setVisible(false);
|
||||
QMessageBox::question(this, tr("Thank you!"), tr("Thank you for your endorsement!"));
|
||||
QMessageBox::information(this, tr("Thank you!"), tr("Thank you for your endorsement!"));
|
||||
}
|
||||
|
||||
if (!disconnect(sender(), SIGNAL(nxmEndorsementToggled(QString, int, QVariant, QVariant, int)),
|
||||
@@ -4637,7 +4780,7 @@ void MainWindow::on_espList_customContextMenuRequested(const QPoint &pos)
|
||||
menu.addAction(tr("Unlock load order"), this, SLOT(unlockESPIndex()));
|
||||
}
|
||||
if (hasUnlocked) {
|
||||
menu.addAction(tr("Lock load order"), this, SLOT(f()));
|
||||
menu.addAction(tr("Lock load order"), this, SLOT(lockESPIndex()));
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -4965,7 +5108,7 @@ bool MainWindow::createBackup(const QString &filePath, const QDateTime &time)
|
||||
QString outPath = filePath + "." + time.toString(PATTERN_BACKUP_DATE);
|
||||
if (shellCopy(QStringList(filePath), QStringList(outPath), this)) {
|
||||
QFileInfo fileInfo(filePath);
|
||||
removeOldFiles(fileInfo.absolutePath(), fileInfo.fileName() + PATTERN_BACKUP_GLOB, 3, QDir::Name);
|
||||
removeOldFiles(fileInfo.absolutePath(), fileInfo.fileName() + PATTERN_BACKUP_GLOB, 10, QDir::Name);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
||||
@@ -304,6 +304,8 @@ private:
|
||||
|
||||
Ui::MainWindow *ui;
|
||||
|
||||
QAction *m_Sep; // Executable Shortcuts are added after this. Non owning.
|
||||
|
||||
bool m_WasVisible;
|
||||
|
||||
MOBase::TutorialControl m_Tutorial;
|
||||
@@ -498,7 +500,9 @@ private slots:
|
||||
void openInstanceFolder();
|
||||
void openLogsFolder();
|
||||
void openInstallFolder();
|
||||
void openPluginsFolder();
|
||||
void openDownloadsFolder();
|
||||
void openModsFolder();
|
||||
void openProfileFolder();
|
||||
void openGameFolder();
|
||||
void openMyGamesFolder();
|
||||
@@ -571,6 +575,7 @@ private slots: // ui slots
|
||||
void on_executablesListBox_currentIndexChanged(int index);
|
||||
void on_modList_customContextMenuRequested(const QPoint &pos);
|
||||
void on_modList_doubleClicked(const QModelIndex &index);
|
||||
void on_espList_doubleClicked(const QModelIndex &index);
|
||||
void on_profileBox_currentIndexChanged(int index);
|
||||
void on_savegameList_customContextMenuRequested(const QPoint &pos);
|
||||
void on_startButton_clicked();
|
||||
|
||||
+41
-84
@@ -96,9 +96,9 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="clickBlankButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -194,7 +194,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="profileBox">
|
||||
<widget class="QComboBox" name="profileBox">
|
||||
<property name="toolTip">
|
||||
<string>Pick a module collection</string>
|
||||
</property>
|
||||
@@ -248,7 +248,7 @@ p, li { white-space: pre-wrap; }
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="openFolderMenu">
|
||||
@@ -265,16 +265,6 @@ p, li { white-space: pre-wrap; }
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<widget class="QPushButton" name="restoreModsButton">
|
||||
<property name="toolTip">
|
||||
<string>Restore Backup...</string>
|
||||
@@ -509,7 +499,7 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@@ -521,7 +511,7 @@ p, li { white-space: pre-wrap; }
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</item>
|
||||
<item alignment="Qt::AlignLeft">
|
||||
<widget class="QPushButton" name="clearFiltersButton">
|
||||
<property name="sizePolicy">
|
||||
@@ -536,12 +526,12 @@ p, li { white-space: pre-wrap; }
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="baseSize">
|
||||
<property name="baseSize">
|
||||
<size>
|
||||
<width>95</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</property>
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
@@ -567,7 +557,7 @@ p, li { white-space: pre-wrap; }
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
@@ -579,14 +569,14 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="groupCombo">
|
||||
<property name="baseSize">
|
||||
<item>
|
||||
<widget class="QComboBox" name="groupCombo">
|
||||
<property name="baseSize">
|
||||
<size>
|
||||
<width>220</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::ClickFocus</enum>
|
||||
</property>
|
||||
@@ -608,13 +598,13 @@ p, li { white-space: pre-wrap; }
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="MOBase::LineEditClear" name="modFilterEdit">
|
||||
<property name="baseSize">
|
||||
<widget class="MOBase::LineEditClear" name="modFilterEdit">
|
||||
<property name="baseSize">
|
||||
<size>
|
||||
<width>220</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Namefilter</string>
|
||||
</property>
|
||||
@@ -835,12 +825,12 @@ p, li { white-space: pre-wrap; }
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
<widget class="QPushButton" name="bossButton">
|
||||
<property name="visible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="visible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Sort</string>
|
||||
</property>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/MO/gui/sort</normaloff>:/MO/gui/sort</iconset>
|
||||
@@ -954,6 +944,9 @@ p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">This list contains the esps, esms, and esls contained in the active mods. These require their own load order. Use drag&amp;drop to modify this load order. Please note that MO will only save the load order for mods that are active/checked.<br />There is a great tool named &quot;BOSS&quot; to automatically sort these files.</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked</set>
|
||||
</property>
|
||||
<property name="dragEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@@ -987,6 +980,9 @@ p, li { white-space: pre-wrap; }
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="expandsOnDoubleClick">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="headerStretchLastSection">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
@@ -1009,15 +1005,12 @@ p, li { white-space: pre-wrap; }
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="bsaTab">
|
||||
|
||||
|
||||
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Archives</string>
|
||||
</attribute>
|
||||
<property name="visible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
@@ -1032,17 +1025,7 @@ p, li { white-space: pre-wrap; }
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_9" stretch="0,1">
|
||||
<!--<item>-->
|
||||
<!--<widget class="QCheckBox" name="manageArchivesBox">-->
|
||||
<!--<property name="text">-->
|
||||
<!--<string/>-->
|
||||
<!--</property>-->
|
||||
<!--<property name="checked">-->
|
||||
<!--<bool>true</bool>-->
|
||||
<!--</property>-->
|
||||
<!--</widget>-->
|
||||
<!--</item>-->
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_9" stretch="0">
|
||||
<item>
|
||||
<widget class="QLabel" name="managedArchiveLabel">
|
||||
<property name="toolTip">
|
||||
@@ -1072,50 +1055,24 @@ p, li { white-space: pre-wrap; }
|
||||
|
||||
BSAs checked here are loaded in such a way that your installation order is obeyed properly.</string>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="showDropIndicator" stdset="0">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="dragEnabled">
|
||||
<property name="dragEnabled" stdset="0">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="dragDropOverwriteMode">
|
||||
<property name="dragDropOverwriteMode" stdset="0">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="dragDropMode">
|
||||
<enum>QAbstractItemView::NoDragDrop</enum>
|
||||
</property>
|
||||
<property name="defaultDropAction">
|
||||
<enum>Qt::IgnoreAction</enum>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="indentation">
|
||||
<property name="indentation" stdset="0">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="itemsExpandable">
|
||||
<property name="itemsExpandable" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="columnCount">
|
||||
<property name="columnCount" stdset="0">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<attribute name="headerVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="headerDefaultSectionSize">
|
||||
<number>200</number>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>File</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -1286,7 +1243,7 @@ p, li { white-space: pre-wrap; }
|
||||
<enum>Qt::ScrollBarAlwaysOn</enum>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||
</property>
|
||||
<property name="dragEnabled">
|
||||
<bool>true</bool>
|
||||
@@ -1319,7 +1276,10 @@ p, li { white-space: pre-wrap; }
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="headerDefaultSectionSize">
|
||||
<number>100</number>
|
||||
<number>50</number>
|
||||
</attribute>
|
||||
<attribute name="headerMinimumSectionSize">
|
||||
<number>15</number>
|
||||
</attribute>
|
||||
<attribute name="headerStretchLastSection">
|
||||
<bool>true</bool>
|
||||
@@ -1601,9 +1561,6 @@ Right now this has very limited functionality</string>
|
||||
<property name="text">
|
||||
<string>Copy Log to Clipboard</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+C</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionChange_Game">
|
||||
<property name="icon">
|
||||
|
||||
+4
-3
@@ -102,6 +102,7 @@ QString ModInfo::getContentTypeName(int contentType)
|
||||
case CONTENT_SKSE: return tr("Script Extender");
|
||||
case CONTENT_SKYPROC: return tr("SkyProc Tools");
|
||||
case CONTENT_MCM: return tr("MCM Data");
|
||||
case CONTENT_INI: return tr("INI files");
|
||||
default: throw MyException(tr("invalid content type %1").arg(contentType));
|
||||
}
|
||||
}
|
||||
@@ -286,9 +287,9 @@ int ModInfo::checkAllForUpdate(PluginContainer *pluginContainer, QObject *receiv
|
||||
int result = 0;
|
||||
std::vector<int> modIDs;
|
||||
|
||||
//I ought to store this, it's used elsewhere
|
||||
IPluginGame const *game = qApp->property("managed_game").value<IPluginGame *>();
|
||||
if (game->nexusModOrganizerID()) {
|
||||
// Normally this would be the managed game but MO2 is only uploaded to the Skyrim SE site right now
|
||||
IPluginGame const *game = pluginContainer->managedGame("Skyrim Special Edition");
|
||||
if (game && game->nexusModOrganizerID()) {
|
||||
modIDs.push_back(game->nexusModOrganizerID());
|
||||
checkChunkForUpdate(pluginContainer, modIDs, receiver, game->gameShortName());
|
||||
modIDs.clear();
|
||||
|
||||
+3
-2
@@ -84,10 +84,11 @@ public:
|
||||
CONTENT_SCRIPT,
|
||||
CONTENT_SKSE,
|
||||
CONTENT_SKYPROC,
|
||||
CONTENT_MCM
|
||||
CONTENT_MCM,
|
||||
CONTENT_INI
|
||||
};
|
||||
|
||||
static const int NUM_CONTENT_TYPES = CONTENT_MCM + 1;
|
||||
static const int NUM_CONTENT_TYPES = CONTENT_INI + 1;
|
||||
|
||||
enum EHighlight {
|
||||
HIGHLIGHT_NONE = 0,
|
||||
|
||||
@@ -466,6 +466,10 @@ std::vector<ModInfo::EContent> ModInfoRegular::getContents() const
|
||||
if (dir.entryList(QStringList() << "*.bsa" << "*.ba2").size() > 0) {
|
||||
m_CachedContent.push_back(CONTENT_BSA);
|
||||
}
|
||||
//use >1 for ini files since there is meta.ini in all mods already.
|
||||
if (dir.entryList(QStringList() << "*.ini").size() > 1) {
|
||||
m_CachedContent.push_back(CONTENT_INI);
|
||||
}
|
||||
|
||||
ScriptExtender *extender = qApp->property("managed_game")
|
||||
.value<IPluginGame *>()
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user