# Path: l5r/util/settings.py
# class L5RCMSettings(object):
#     """A QSettings wrapper for easy access to application settings"""
# 
#     def __init__(self):
#         self._qsettings = QSettings()
# 
#         # Application settings
#         self._app = L5RCMSettings_App(self._qsettings)
#         # UI settings
#         self._ui = L5RCMSettings_UI(self._qsettings)
#         # PC export PDF generation settings
#         self._pc_export = L5RCMSettings_PcExport(self._qsettings)
#         # NPC export PDF generation settings
#         self._npc_export = L5RCMSettings_NpcExport(self._qsettings)
# 
#     @property
#     def app(self):
#         return self._app
# 
#     @property
#     def ui(self):
#         return self._ui
# 
#     @property
#     def pc_export(self):
#         return self._pc_export
# 
#     @property
#     def npc_export(self):
#         return self._npc_export
# 
#     def sync(self):
#         self._qsettings.sync()
# 
#     def load_defaults(self):
#         self._app.load_defaults()
#         self._ui.load_defaults()
#         self._pc_export.load_defaults()
#         self._npc_export.load_defaults()


from PyQt5 import QtCore, QtGui, QtWidgets
from l5r.util.settings import L5RCMSettings
        from copy import deepcopy
        self.build_ui()
        self.load_data()

    def build_ui(self):
        self.setWindowTitle(self.tr("Data Pack Manager"))

        vbox = QtWidgets.QVBoxLayout(self)

        grp = QtWidgets.QGroupBox(self.tr("Available data packs"))
        self.view = QtWidgets.QTableView(self)
        vbox2 = QtWidgets.QVBoxLayout(grp)
        vbox2.addWidget(self.view)

        bts = QtWidgets.QDialogButtonBox()

        bts.addButton(self.tr("Discard"), QtWidgets.QDialogButtonBox.RejectRole)
        bts.addButton(self.tr("Save"), QtWidgets.QDialogButtonBox.AcceptRole)

        vbox.addWidget(grp)
        vbox.addWidget(bts)

        bts.accepted.connect(self.on_accept)
        bts.rejected.connect(self.reject)

        self.setMinimumSize(QtCore.QSize(440, 330))

    def load_data(self):
        self.packs = deepcopy(self.dstore.packs)
        model = DataPackModel(self)
        for pack in self.packs:

# Path: l5r/util/settings.py
# class L5RCMSettings(object):
#     """A QSettings wrapper for easy access to application settings"""
# 
#     def __init__(self):
#         self._qsettings = QSettings()
# 
#         # Application settings
#         self._app = L5RCMSettings_App(self._qsettings)
#         # UI settings
#         self._ui = L5RCMSettings_UI(self._qsettings)
#         # PC export PDF generation settings
#         self._pc_export = L5RCMSettings_PcExport(self._qsettings)
#         # NPC export PDF generation settings
#         self._npc_export = L5RCMSettings_NpcExport(self._qsettings)
# 
#     @property
#     def app(self):
#         return self._app
# 
#     @property
#     def ui(self):
#         return self._ui
# 
#     @property
#     def pc_export(self):
#         return self._pc_export
# 
#     @property
#     def npc_export(self):
#         return self._npc_export
# 
#     def sync(self):
#         self._qsettings.sync()
# 
#     def load_defaults(self):
#         self._app.load_defaults()
#         self._ui.load_defaults()
#         self._pc_export.load_defaults()
#         self._npc_export.load_defaults()


# Path: l5r/dialogs/managedatapack.py
from PyQt5 import QtCore, QtGui, QtWidgets
from l5r.util.settings import L5RCMSettings
        from copy import deepcopy

        self.build_ui()
        self.load_data()

    def build_ui(self):
        self.setWindowTitle(self.tr("Data Pack Manager"))

        vbox = QtWidgets.QVBoxLayout(self)

        grp = QtWidgets.QGroupBox(self.tr("Available data packs"))
        self.view = QtWidgets.QTableView(self)
        vbox2 = QtWidgets.QVBoxLayout(grp)
        vbox2.addWidget(self.view)

        bts = QtWidgets.QDialogButtonBox()

        bts.addButton(self.tr("Discard"), QtWidgets.QDialogButtonBox.RejectRole)
        bts.addButton(self.tr("Save"), QtWidgets.QDialogButtonBox.AcceptRole)

        vbox.addWidget(grp)
        vbox.addWidget(bts)

        bts.accepted.connect(self.on_accept)
        bts.rejected.connect(self.reject)

        self.setMinimumSize(QtCore.QSize(440, 330))

    def load_data(self):
        self.packs = deepcopy(self.dstore.packs)
        model = DataPackModel(self)
        for pack in self.packs:

            model.add_item(pack)