def __init__(self, viewer):
        super(KnechtImageViewerSendController, self).__init__(viewer)
        global LOGGER
        LOGGER = init_logging(__name__)

        self.viewer = viewer
        self.thread = KnechtImageViewerSendThread(self)
Esempio n. 2
0
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with RenderKnecht Strink Kerker.  If not, see <http://www.gnu.org/licenses/>.

"""
import logging
from PyQt5 import QtWidgets
from PyQt5.QtCore import Qt
from PyQt5.uic import loadUi
from modules.app_globals import HELPER_DIR, UI_FILE_SEARCH_DIALOG, COLUMN_NAMES, ItemColumn
from modules.knecht_log import init_logging

# Initialize logging for this module
LOGGER = init_logging(__name__)


class SearchReplace(QtWidgets.QDialog):
    """ Search and replace dialog """
    def __init__(self, ui, widget_list, current_tree: int = 0):
        """ Init ui as parent """
        super(SearchReplace, self).__init__(ui)
        self.ui = ui
        self.widget_list = widget_list

        # Hide context help
        self.setWindowFlag(Qt.WindowContextHelpButtonHint, False)

        # Avoid UIC Debug messages
        log_level = LOGGER.getEffectiveLevel()
Esempio n. 3
0
    def __init__(self, app, ui):
        super(KnechtImageViewer, self).__init__(
            flags=Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint | Qt.CustomizeWindowHint
            )
        global LOGGER
        LOGGER = init_logging(__name__)

        self.app, self.ui = app, ui

        self.setWindowIcon(QIcon(QPixmap(self.ICON)))
        self.setAutoFillBackground(True)
        self.setAttribute(Qt.WA_TranslucentBackground)
        self.setAttribute(Qt.WA_AcceptDrops, True)
        self.setWindowTitle('Image Viewer')
        self.setStyleSheet("QWidget{background-color: darkgray;}")
        self.setFocusPolicy(Qt.StrongFocus)

        self.animation = AnimateWindowOpacity(self, 200)

        self.img_dir = Path('.')
        self.current_img = None
        self.img_list = list()
        self.img_index = 0
        self.img_size_factor = 1.0
        self.img_size = QSize(*self.DEFAULT_SIZE)
        self.img_loader = None  # will be the loader thread

        # Save window position for drag
        self.oldPos = self.pos()

        self.current_opacity = 1.0
        self.setWindowOpacity(1.0)

        self.control = ControllerWidget(self)

        # DG Send thread controller
        self.dg_thread = KnechtImageViewerSendController(self)

        # Image canvas
        self.setLayout(QtWidgets.QHBoxLayout())
        self.layout().setContentsMargins(0, 0, 0, 0)
        self.layout().setSpacing(0)
        self.img_canvas = QtWidgets.QLabel(self)
        self.layout().addWidget(self.img_canvas)
        self.img_canvas.setSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Ignored)
        self.img_canvas.setScaledContents(True)
        self.img_canvas.setObjectName('img_canvas')
        self.set_default_image()

        # Overlay
        self.overlay = InfoOverlay(self.img_canvas)

        # App logic
        self.path_dlg = SetDirectoryPath(app, ui,
                                         mode='file',
                                         line_edit=self.control.line_edit,
                                         tool_button=self.control.path_btn,
                                         parent=self)
        self.path_dlg.path_changed.connect(self.set_img_path)

        self.slider_timeout.timeout.connect(self.set_opacity_from_slider)
        self.control.slider.sliderReleased.connect(self.slider_timeout.start)
        self.control.slider.valueChanged.connect(self.slider_timeout.start)

        self.control.size_box.currentIndexChanged.connect(self.combo_box_size)

        self.control.bck_btn.pressed.connect(self.iterate_bck)
        self.control.fwd_btn.pressed.connect(self.iterate_fwd)

        self.control.min_btn.released.connect(self.minimize)

        self.control.toggle_btn.pressed.connect(self.toggle_img_canvas)
        self.control.toggle_dg_btn.pressed.connect(self.dg_toggle_sync)
        self.control.toggle_pull_btn.pressed.connect(self.dg_toggle_pull)

        self.control.help_btn.pressed.connect(self.display_shortcut_overlay)

        self.shortcuts = ViewerShortcuts(self, self.control)
        self.shortcuts.set_shortcuts(self)
        self.shortcuts.set_shortcuts(self.control)

        self.file_dropped.connect(self.path_dropped)
        self.control.file_dropped.connect(self.path_dropped)

        self.load_timeout.timeout.connect(self.kill_load_thread)
        self.place_in_screen_center()
"""
knecht_fakom_lutscher for py_knecht. Provides Fakom Lutscher tools.
Copyright (C) 2017 Stefan Tapper, All rights reserved.
    This file is part of RenderKnecht Strink Kerker.
    RenderKnecht Strink Kerker is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    RenderKnecht Strink Kerker is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with RenderKnecht Strink Kerker.  If not, see <http://www.gnu.org/licenses/>.
"""
import time
import re
import lxml.etree as Et
from pathlib import Path
from PyQt5 import QtWidgets, QtCore
from modules.app_globals import Msg, ItemColumn, PACKAGE_FILTER, HELPER_DIR
from modules.knecht_log import init_logging
from modules.knecht_xml import XML
from modules.tree_methods import lead_zeros, update_tree_ids, generate_number_outside_set
from modules.knecht_threads import ExcelConversionThread
LOGGER = init_logging(__name__)

class FakomLutscher(QtCore.QObject):
    # Signal for preset wizard
    # Success:bool, Vplus file path:str or Path
Esempio n. 5
0
"""
py_knecht package for creating RenderKnecht functionality eg. DeltaGen batch rendering and extending this
with features for Autodesks Maya.
Copyright (C) 2017-2018 Stefan Tapper, All rights reserved.
    This file is part of RenderKnecht Strink Kerker.
    RenderKnecht Strink Kerker is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    RenderKnecht Strink Kerker is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with RenderKnecht Strink Kerker.  If not, see <http://www.gnu.org/licenses/>.
Freeze Instructions:
    - PyQt5 Fix window style in frozen:
      pip install https://github.com/bjones1/pyinstaller/archive/pyqt5_fix.zip
    - from:
      https://stackoverflow.com/questions/48626999/packaging-with-pyinstaller-pyqt5-setstyle-ignored
    - GitHub:
      https://github.com/pyinstaller/pyinstaller/pull/3233#issuecomment-362094587
    - Visual Studio 14 dll's:
      Add your VS Install to Path:
      C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/Remote Debugger/x64
"""
__author__ = 'Stefan Tapper'
__copyright__ = 'Copyright 2017 - 2018 Stefan Tapper'
__credits__ = [
    'Python Community', 'Stackoverflow', 'The Webs',
Esempio n. 6
0
    You should have received a copy of the GNU General Public License
    along with RenderKnecht Strink Kerker.  If not, see <http://www.gnu.org/licenses/>.

"""
import sys
import logging
from functools import partial
from PyQt5 import QtWidgets
from PyQt5.uic import loadUi
from modules.knecht_log import init_logging
from modules.knecht_log import QPlainTextEditHandler
from modules.app_globals import UI_FILE_LOG_WINDOW
from modules.knecht_settings import knechtSettings

# Initialize logging for this module
LOGGER = init_logging('gui_logger')


class LogWindow(QtWidgets.QWidget):
    """ Log Window that displays log entries """
    gui_handler = None

    def __init__(self, action_widget=None):
        super(LogWindow, self).__init__()

        # Avoid UIC Debug messages
        log_level = LOGGER.getEffectiveLevel()
        logging.root.setLevel(20)

        loadUi(UI_FILE_LOG_WINDOW, self)