summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-06-17 04:29:15 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2019-07-02 10:10:17 -0400
commitb96f154625a0a139e722731b055f022bc90c2058 (patch)
treecfa694223331d2bc5530f54d667b5a057785f9c0
parent10f9fd041cefb14659f07c2163ef27796fae7e3e (diff)
removed unused ini tweaks widgets
splitter in ini tab
-rw-r--r--src/modinfodialog.cpp90
-rw-r--r--src/modinfodialog.h6
-rw-r--r--src/modinfodialog.ui233
3 files changed, 122 insertions, 207 deletions
diff --git a/src/modinfodialog.cpp b/src/modinfodialog.cpp
index 7e72653f..23b8f4d8 100644
--- a/src/modinfodialog.cpp
+++ b/src/modinfodialog.cpp
@@ -359,7 +359,6 @@ ModInfoDialog::ModInfoDialog(ModInfo::Ptr modInfo, const DirectoryEntry *directo
addCategories(CategoryFactory::instance(), modInfo->getCategories(), ui->categoriesTree->invisibleRootItem(), 0);
refreshPrimaryCategoriesBox();
}
- initINITweaks();
ui->tabWidget->setTabEnabled(TAB_CONFLICTS, m_Origin != nullptr);
@@ -421,7 +420,6 @@ ModInfoDialog::~ModInfoDialog()
else
m_ModInfo->setNotes(ui->notesEdit->toHtml());
saveCategories(ui->categoriesTree->invisibleRootItem());
- saveIniTweaks(); // ini tweaks are written to the ini file directly. This is the only information not managed by ModInfo
delete ui->descriptionView->page();
delete ui->descriptionView;
delete ui;
@@ -436,19 +434,6 @@ int ModInfoDialog::exec()
return TutorableDialog::exec();
}
-void ModInfoDialog::initINITweaks()
-{
- int numTweaks = m_Settings->beginReadArray("INI Tweaks");
- for (int i = 0; i < numTweaks; ++i) {
- m_Settings->setArrayIndex(i);
- QList<QListWidgetItem*> items = ui->iniTweaksList->findItems(m_Settings->value("name").toString(), Qt::MatchFixedString);
- if (items.size() != 0) {
- items.at(0)->setCheckState(Qt::Checked);
- }
- }
- m_Settings->endArray();
-}
-
void ModInfoDialog::initFiletree(ModInfo::Ptr modInfo)
{
ui->fileTree = findChild<QTreeView*>("fileTree");
@@ -855,7 +840,6 @@ void ModInfoDialog::refreshFiles()
tab->clear();
}
- ui->iniTweaksList->clear();
ui->iniFileList->clear();
ui->inactiveESPList->clear();
ui->activeESPList->clear();
@@ -882,15 +866,7 @@ void ModInfoDialog::refreshFiles()
if ((fileName.endsWith(".ini", Qt::CaseInsensitive) || fileName.endsWith(".cfg", Qt::CaseInsensitive)) &&
!fileName.endsWith("meta.ini")) {
QString namePart = fileName.mid(m_RootPath.length() + 1);
- if (namePart.startsWith("INI Tweaks", Qt::CaseInsensitive)) {
- QListWidgetItem *newItem = new QListWidgetItem(namePart.mid(11), ui->iniTweaksList);
- newItem->setData(Qt::UserRole, namePart);
- newItem->setFlags(newItem->flags() | Qt::ItemIsUserCheckable);
- newItem->setCheckState(Qt::Unchecked);
- ui->iniTweaksList->addItem(newItem);
- } else {
- ui->iniFileList->addItem(namePart);
- }
+ ui->iniFileList->addItem(namePart);
} else if (fileName.endsWith(".esp", Qt::CaseInsensitive) ||
fileName.endsWith(".esm", Qt::CaseInsensitive) ||
fileName.endsWith(".esl", Qt::CaseInsensitive)) {
@@ -1038,23 +1014,6 @@ void ModInfoDialog::openIniFile(const QString &fileName)
ui->saveButton->setEnabled(false);
}
-
-void ModInfoDialog::saveIniTweaks()
-{
- m_Settings->remove("INI Tweaks");
- m_Settings->beginWriteArray("INI Tweaks");
-
- int countEnabled = 0;
- for (int i = 0; i < ui->iniTweaksList->count(); ++i) {
- if (ui->iniTweaksList->item(i)->checkState() == Qt::Checked) {
- m_Settings->setArrayIndex(countEnabled++);
- m_Settings->setValue("name", ui->iniTweaksList->item(i)->text());
- }
- }
- m_Settings->endArray();
-}
-
-
void ModInfoDialog::on_iniFileList_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous)
{
QString fullPath = m_RootPath + "/" + current->text();
@@ -1072,25 +1031,6 @@ void ModInfoDialog::on_iniFileList_currentItemChanged(QListWidgetItem *current,
}
}
-
-void ModInfoDialog::on_iniTweaksList_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous)
-{
- QString fullPath = m_RootPath + "/" + current->data(Qt::UserRole).toString();
-
- QVariant currentFile = ui->iniFileView->property("currentFile");
- if (currentFile.isValid() && (currentFile.toString() == fullPath)) {
- // the new file is the same as the currently displayed file. May be the result of a cancelation
- return;
- }
-
- if (allowNavigateFromINI()) {
- openIniFile(fullPath);
- } else {
- ui->iniFileList->setCurrentItem(previous, QItemSelectionModel::Current);
- }
-
-}
-
void ModInfoDialog::on_saveButton_clicked()
{
saveCurrentIniFile();
@@ -2129,31 +2069,3 @@ void ModInfoDialog::on_prevButton_clicked()
emit modOpenPrev(tab);
this->accept();
}
-
-
-void ModInfoDialog::createTweak()
-{
- QString name = QInputDialog::getText(this, tr("Name"), tr("Please enter a name"));
- if (name.isNull()) {
- return;
- } else if (!fixDirectoryName(name)) {
- QMessageBox::critical(this, tr("Error"), tr("Invalid name. Must be a valid file name"));
- return;
- } else if (ui->iniTweaksList->findItems(name, Qt::MatchFixedString).count() != 0) {
- QMessageBox::critical(this, tr("Error"), tr("A tweak by that name exists"));
- return;
- }
-
- QListWidgetItem *newTweak = new QListWidgetItem(name + ".ini");
- newTweak->setData(Qt::UserRole, "INI Tweaks/" + name + ".ini");
- newTweak->setFlags(newTweak->flags() | Qt::ItemIsUserCheckable);
- newTweak->setCheckState(Qt::Unchecked);
- ui->iniTweaksList->addItem(newTweak);
-}
-
-void ModInfoDialog::on_iniTweaksList_customContextMenuRequested(const QPoint &pos)
-{
- QMenu menu;
- menu.addAction(tr("Create Tweak"), this, SLOT(createTweak()));
- menu.exec(ui->iniTweaksList->mapToGlobal(pos));
-}
diff --git a/src/modinfodialog.h b/src/modinfodialog.h
index 97ab9a38..0d54177a 100644
--- a/src/modinfodialog.h
+++ b/src/modinfodialog.h
@@ -153,7 +153,6 @@ public slots:
private:
void initFiletree(ModInfo::Ptr modInfo);
- void initINITweaks();
void refreshLists();
@@ -166,7 +165,6 @@ private:
QString getFileCategory(int categoryID);
bool recursiveDelete(const QModelIndex &index);
void deleteFile(const QModelIndex &index);
- void saveIniTweaks();
void saveCategories(QTreeWidgetItem *currentNode);
void saveCurrentIniFile();
void openIniFile(const QString &fileName);
@@ -208,7 +206,6 @@ private slots:
void on_primaryCategoryBox_currentIndexChanged(int index);
void on_categoriesTree_itemChanged(QTreeWidgetItem *item, int column);
void on_iniFileList_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);
- void on_iniTweaksList_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);
void on_overwriteTree_itemDoubleClicked(QTreeWidgetItem *item, int column);
void on_overwrittenTree_itemDoubleClicked(QTreeWidgetItem *item, int column);
void on_overwriteTree_customContextMenuRequested(const QPoint &pos);
@@ -225,9 +222,6 @@ private slots:
void on_prevButton_clicked();
- void on_iniTweaksList_customContextMenuRequested(const QPoint &pos);
-
- void createTweak();
private:
using FileEntry = MOShared::FileEntry;
diff --git a/src/modinfodialog.ui b/src/modinfodialog.ui
index 785fdeb4..10ebbb33 100644
--- a/src/modinfodialog.ui
+++ b/src/modinfodialog.ui
@@ -38,15 +38,58 @@
<property name="childrenCollapsible">
<bool>false</bool>
</property>
- <widget class="QListWidget" name="textFileList">
- <property name="toolTip">
- <string>A list of text-files in the mod directory.</string>
- </property>
- <property name="whatsThis">
- <string>A list of text-files in the mod directory like readmes. </string>
- </property>
+ <widget class="QWidget" name="widget_6" native="true">
+ <layout class="QVBoxLayout" name="verticalLayout_16">
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>Text Files</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QListWidget" name="textFileList">
+ <property name="toolTip">
+ <string>A list of text-files in the mod directory.</string>
+ </property>
+ <property name="whatsThis">
+ <string>A list of text-files in the mod directory like readmes. </string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="widget_7" native="true">
+ <layout class="QVBoxLayout" name="verticalLayout_17">
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="TextEditor" name="textFileView"/>
+ </item>
+ </layout>
</widget>
- <widget class="TextEditor" name="textFileView"/>
</widget>
</item>
</layout>
@@ -55,113 +98,79 @@
<attribute name="title">
<string>INI-Files</string>
</attribute>
- <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <layout class="QVBoxLayout" name="verticalLayout_9">
<item>
- <layout class="QVBoxLayout" name="verticalLayout_5" stretch="0,0,0,0">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="sizeConstraint">
- <enum>QLayout::SetMinimumSize</enum>
+ <widget class="QSplitter" name="splitter">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
</property>
- <item>
- <widget class="QLabel" name="label_6">
- <property name="text">
- <string>Ini Files</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QListWidget" name="iniFileList">
- <property name="maximumSize">
- <size>
- <width>228</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="toolTip">
- <string>This is a list of .ini files in the mod.</string>
- </property>
- <property name="whatsThis">
- <string>This is a list of .ini files in the mod. These are usually used to configure the behaviour of mods if there are configurable parameters.</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="label_5">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>Ini Tweaks *This feature is non-functional*</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QListWidget" name="iniTweaksList">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="maximumSize">
- <size>
- <width>228</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="contextMenuPolicy">
- <enum>Qt::CustomContextMenu</enum>
- </property>
- <property name="toolTip">
- <string>This is a list of ini tweaks (ini modifications that can be toggled).</string>
- </property>
- <property name="whatsThis">
- <string>This is a list of ini tweaks. Ini Tweaks are (usually small) fragments of ini files that are applied over existing settings in skyrim.ini/skyrimprefs.ini. Each tweak can be toggled individually. You should check the description of the mod whether the tweaks are really optional.</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QVBoxLayout" name="verticalLayout_4" stretch="0,0">
- <item>
- <widget class="QTextBrowser" name="iniFileView">
- <property name="toolTip">
- <string/>
- </property>
- <property name="whatsThis">
- <string/>
- </property>
- <property name="undoRedoEnabled">
- <bool>true</bool>
- </property>
- <property name="readOnly">
- <bool>false</bool>
- </property>
- <property name="acceptRichText">
- <bool>false</bool>
- </property>
- <property name="openLinks">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="saveButton">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="toolTip">
- <string>Save changes to the file.</string>
- </property>
- <property name="whatsThis">
- <string>Save changes to the file. This overwrites the original. There is no automatic backup!</string>
- </property>
- <property name="text">
- <string>Save</string>
+ <widget class="QWidget" name="">
+ <layout class="QVBoxLayout" name="verticalLayout_5" stretch="0,0">
+ <property name="spacing">
+ <number>6</number>
</property>
- </widget>
- </item>
- </layout>
+ <item>
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string>Ini Files</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QListWidget" name="iniFileList">
+ <property name="toolTip">
+ <string>This is a list of .ini files in the mod.</string>
+ </property>
+ <property name="whatsThis">
+ <string>This is a list of .ini files in the mod. These are usually used to configure the behaviour of mods if there are configurable parameters.</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="">
+ <layout class="QVBoxLayout" name="verticalLayout_4" stretch="0,0">
+ <item>
+ <widget class="QTextBrowser" name="iniFileView">
+ <property name="toolTip">
+ <string/>
+ </property>
+ <property name="whatsThis">
+ <string/>
+ </property>
+ <property name="undoRedoEnabled">
+ <bool>true</bool>
+ </property>
+ <property name="readOnly">
+ <bool>false</bool>
+ </property>
+ <property name="acceptRichText">
+ <bool>false</bool>
+ </property>
+ <property name="openLinks">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="saveButton">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip">
+ <string>Save changes to the file.</string>
+ </property>
+ <property name="whatsThis">
+ <string>Save changes to the file. This overwrites the original. There is no automatic backup!</string>
+ </property>
+ <property name="text">
+ <string>Save</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
</item>
</layout>
</widget>