# Path: l5r/util/log.py
# def log_setup(base_path, base_name):
# 
# Path: l5r/util/osutil.py
# def detect_desktop_environment():
# def portable_open(what):
# def get_system_font():
# def get_user_data_path(rel_path=''):


from PyQt5 import QtCore, QtGui, QtWidgets
from l5r.util import log, osutil
import os
import l5r.models as models
import l5r.dialogs as dialogs
import l5r.widgets as widgets
import l5rdal as dal
import l5rdal.query
import l5r.api as api
import l5r.api.character
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.







class Sink4(QtCore.QObject):

    def __init__(self, parent=None):
        super(Sink4, self).__init__(parent)
        self.form = parent

    def add_new_modifier(self):
        item = models.ModifierModel()
        self.form.pc.add_modifier(item)
        dlg = dialogs.ModifierDialog(self.form.pc, self.form)
        dlg.set_modifier(item)
        if dlg.exec_() == QtWidgets.QDialog.Accepted:
            self.form.update_from_model()

    def edit_selected_modifier(self):
        index = self.form.mod_view.selectionModel().currentIndex()
        if not index.isValid():
            return

# Path: l5r/util/log.py
# def log_setup(base_path, base_name):
# 
# Path: l5r/util/osutil.py
# def detect_desktop_environment():
# def portable_open(what):
# def get_system_font():
# def get_user_data_path(rel_path=''):


# Path: l5r/sinks/sink_4.py
from PyQt5 import QtCore, QtGui, QtWidgets
from l5r.util import log, osutil
import os
import l5r.models as models
import l5r.dialogs as dialogs
import l5r.widgets as widgets
import l5rdal as dal
import l5rdal.query
import l5r.api as api
import l5r.api.character

# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.







class Sink4(QtCore.QObject):

    def __init__(self, parent=None):
        super(Sink4, self).__init__(parent)
        self.form = parent

    def add_new_modifier(self):
        item = models.ModifierModel()
        self.form.pc.add_modifier(item)
        dlg = dialogs.ModifierDialog(self.form.pc, self.form)
        dlg.set_modifier(item)
        if dlg.exec_() == QtWidgets.QDialog.Accepted:
            self.form.update_from_model()

    def edit_selected_modifier(self):
        index = self.form.mod_view.selectionModel().currentIndex()
        if not index.isValid():
            return

        item = index.model().data(index, QtCore.Qt.UserRole)