Add "Snapshots" option to minecraft installs dialog
This commit is contained in:
parent
9fdf601d19
commit
20533b63c1
@ -120,6 +120,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="snapshotsCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Snapshots</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -21,7 +21,7 @@ multiMCInstallsOption = settings.Settings().getOption("minecraft_installs/multim
|
|||||||
currentInstallOption = settings.Settings().getOption("minecraft_installs/current_install_path", unicode, "")
|
currentInstallOption = settings.Settings().getOption("minecraft_installs/current_install_path", unicode, "")
|
||||||
currentVersionOption = settings.Settings().getOption("minecraft_installs/current_version", unicode, "")
|
currentVersionOption = settings.Settings().getOption("minecraft_installs/current_version", unicode, "")
|
||||||
currentResourcePackOption = settings.Settings().getOption("minecraft_installs/current_resource_pack", unicode, "")
|
currentResourcePackOption = settings.Settings().getOption("minecraft_installs/current_resource_pack", unicode, "")
|
||||||
allowSnapshotsOption = settings.Settings().getOption("minecraft_installs/allow_snapshots", int, 0)
|
allowSnapshotsOption = settings.Settings().getOption("minecraft_installs/allow_snapshots_", bool, False)
|
||||||
|
|
||||||
_installs = None
|
_installs = None
|
||||||
|
|
||||||
@ -492,6 +492,8 @@ class MinecraftInstallsDialog(QtGui.QDialog, Ui_installsWidget):
|
|||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(MinecraftInstallsDialog, self).__init__(*args, **kwargs)
|
super(MinecraftInstallsDialog, self).__init__(*args, **kwargs)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
|
||||||
|
|
||||||
# populate list view
|
# populate list view
|
||||||
path = currentInstallOption.value()
|
path = currentInstallOption.value()
|
||||||
for i, install in enumerate(GetInstalls().installs):
|
for i, install in enumerate(GetInstalls().installs):
|
||||||
@ -508,6 +510,10 @@ class MinecraftInstallsDialog(QtGui.QDialog, Ui_installsWidget):
|
|||||||
self.selectButton.clicked.connect(self.selectInstall)
|
self.selectButton.clicked.connect(self.selectInstall)
|
||||||
self.okButton.clicked.connect(self.ok)
|
self.okButton.clicked.connect(self.ok)
|
||||||
|
|
||||||
|
self.snapshotsCheckBox.setChecked(allowSnapshotsOption.value())
|
||||||
|
self.snapshotsCheckBox.toggled.connect(allowSnapshotsOption.setValue)
|
||||||
|
allowSnapshotsOption.valueChanged.connect(self.allowSnapshotsChanged)
|
||||||
|
|
||||||
self.addMMCButton.clicked.connect(self.addMMCInstall)
|
self.addMMCButton.clicked.connect(self.addMMCInstall)
|
||||||
self.removeMMCButton.clicked.connect(self.removeMMCInstall)
|
self.removeMMCButton.clicked.connect(self.removeMMCInstall)
|
||||||
|
|
||||||
@ -519,6 +525,14 @@ class MinecraftInstallsDialog(QtGui.QDialog, Ui_installsWidget):
|
|||||||
if column == 2:
|
if column == 2:
|
||||||
install.path = text # xxxx validate me!
|
install.path = text # xxxx validate me!
|
||||||
|
|
||||||
|
def allowSnapshotsChanged(self):
|
||||||
|
installs = GetInstalls().installs
|
||||||
|
for row in range(self.minecraftInstallsTable.rowCount()):
|
||||||
|
install = installs[row]
|
||||||
|
versionsString = ", ".join(sorted(install.versions, reverse=True))
|
||||||
|
versionsItem = self.minecraftInstallsTable.item(row, 1)
|
||||||
|
versionsItem.setText(versionsString)
|
||||||
|
|
||||||
def _addInstall(self, install):
|
def _addInstall(self, install):
|
||||||
minecraftInstallsTable = self.minecraftInstallsTable
|
minecraftInstallsTable = self.minecraftInstallsTable
|
||||||
row = minecraftInstallsTable.rowCount()
|
row = minecraftInstallsTable.rowCount()
|
||||||
@ -531,7 +545,7 @@ class MinecraftInstallsDialog(QtGui.QDialog, Ui_installsWidget):
|
|||||||
versionsString = ", ".join(sorted(install.versions, reverse=True))
|
versionsString = ", ".join(sorted(install.versions, reverse=True))
|
||||||
versionsItem = QtGui.QTableWidgetItem(versionsString)
|
versionsItem = QtGui.QTableWidgetItem(versionsString)
|
||||||
versionsItem.setFlags(versionsItem.flags() & ~Qt.ItemIsEditable)
|
versionsItem.setFlags(versionsItem.flags() & ~Qt.ItemIsEditable)
|
||||||
minecraftInstallsTable.setItem(row, 1, versionsItem)
|
self.minecraftInstallsTable.setItem(row, 1, versionsItem)
|
||||||
|
|
||||||
pathItem = PathItem(install.path)
|
pathItem = PathItem(install.path)
|
||||||
if install.name == "(Default)":
|
if install.name == "(Default)":
|
||||||
|
Reference in New Issue
Block a user