Begin working on Configure Blocks/Items dialog
This commit is contained in:
parent
53606be7e5
commit
ee5665a477
@ -18,6 +18,7 @@ from mcedit2.util.load_ui import load_ui
|
||||
from mcedit2.util.objgraphwidget import ObjGraphWidget
|
||||
from mcedit2.util.resources import resourcePath
|
||||
from mcedit2.util.worldloader import LoaderTimer
|
||||
from mcedit2.widgets import prefsdialog, configureblocksdialog
|
||||
from mcedit2.widgets.blocktype_list import BlockListWidget
|
||||
from mcedit2.editorsession import EditorSession
|
||||
from mcedit2.widgets.layout import setWidgetError
|
||||
@ -105,6 +106,12 @@ class MCEditApp(QtGui.QApplication):
|
||||
self.tabWidget.tabCloseRequested.connect(self.tabCloseRequested)
|
||||
self.tabWidget.currentChanged.connect(self.tabChanged)
|
||||
|
||||
# --- App Dialogs ---
|
||||
|
||||
self.prefsDialog = prefsdialog.PrefsDialog()
|
||||
self.configureBlocksDialog = configureblocksdialog.ConfigureBlocksDialog()
|
||||
|
||||
|
||||
# --- Sessions ---
|
||||
|
||||
self._currentSession = None
|
||||
@ -232,6 +239,7 @@ class MCEditApp(QtGui.QApplication):
|
||||
self.enableLightingChanged(EnableLightingSetting.value())
|
||||
|
||||
mainWindow.actionPreferences.triggered.connect(self.showPrefsDialog)
|
||||
mainWindow.actionConfigure_Blocks_Items.triggered.connect(self.showConfigureBlocksDialog)
|
||||
|
||||
|
||||
# --- World List ---
|
||||
@ -720,3 +728,6 @@ class MCEditApp(QtGui.QApplication):
|
||||
|
||||
def showPrefsDialog(self):
|
||||
self.prefsDialog.exec_()
|
||||
|
||||
def showConfigureBlocksDialog(self):
|
||||
self.configureBlocksDialog.exec_()
|
||||
|
72
src/mcedit2/ui/configure_blocks_dialog.ui
Normal file
72
src/mcedit2/ui/configure_blocks_dialog.ui
Normal file
@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog</class>
|
||||
<widget class="QDialog" name="Dialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>749</width>
|
||||
<height>703</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Configure Blocks/Items</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="blocksTab">
|
||||
<attribute name="title">
|
||||
<string>Blocks</string>
|
||||
</attribute>
|
||||
<widget class="QTreeView" name="blocksView">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
<width>661</width>
|
||||
<height>341</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWidget" name="itemsTab">
|
||||
<attribute name="title">
|
||||
<string>Items</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="okButton">
|
||||
<property name="text">
|
||||
<string>OK</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
35
src/mcedit2/widgets/configureblocksdialog.py
Normal file
35
src/mcedit2/widgets/configureblocksdialog.py
Normal file
@ -0,0 +1,35 @@
|
||||
"""
|
||||
configureblocksdialog.py
|
||||
"""
|
||||
from __future__ import absolute_import, division, print_function
|
||||
import logging
|
||||
from PySide import QtGui, QtCore
|
||||
from mcedit2.util.load_ui import load_ui
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
class ConfigureBlocksItemDelegate(QtGui.QStyledItemDelegate):
|
||||
pass
|
||||
|
||||
class ConfigureBlocksItemModel(QtCore.QAbstractItemModel):
|
||||
def columnCount(self, index):
|
||||
return 0
|
||||
|
||||
def rowCount(self, index):
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
class ConfigureBlocksDialog(QtGui.QDialog):
|
||||
def __init__(self):
|
||||
super(ConfigureBlocksDialog, self).__init__()
|
||||
load_ui("configure_blocks_dialog.ui", baseinstance=self)
|
||||
self.okButton.clicked.connect(self.accept)
|
||||
|
||||
self.model = ConfigureBlocksItemModel()
|
||||
self.itemDelegate = ConfigureBlocksItemDelegate()
|
||||
|
||||
self.blocksView.setModel(self.model)
|
||||
self.blocksView.setItemDelegate(self.itemDelegate)
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
"""
|
||||
optionsdialog.py
|
||||
prefsdialog.py
|
||||
"""
|
||||
from __future__ import absolute_import, division, print_function
|
||||
import logging
|
||||
|
Reference in New Issue
Block a user