Пример #1
0
    def __init__(self,
                 message='This is a message',
                 time=4000,
                 sound=1,
                 image=defaults._check_icon_):

        super(popup, self).__init__()
        self.user = user()

        self.message = message
        self.image = image
        self.time = time
        self.sound = sound

        # Build the ui from ui converted file
        self.ui = Ui_Form()
        self.ui.setupUi(self)

        self.setup_infos()

        self.setWindowFlags(QtCore.Qt.SplashScreen
                            | QtCore.Qt.FramelessWindowHint
                            | QtCore.Qt.WindowStaysOnTopHint)
        # self.setMinimumSize(QtCore.QSize(300, 100))
        self.animation = QtCore.QPropertyAnimation(self, b"windowOpacity",
                                                   self)
        self.displace_animation = QtCore.QPropertyAnimation(self, b"pos", self)
        self.animation.finished.connect(self.hide)
        self.timer = QtCore.QTimer()
        self.timer.timeout.connect(self.hideAnimation)
        '''
Пример #2
0
    def __init__(self):
        self.user = user()
        self.site = site()

        self.app = QtWidgets.QApplication(sys.argv)
        self.app.setWindowIcon(QtGui.QIcon(defaults._server_ico_black_))

        self.ui_main_server = ui_main_server.Main()
        build.launch_stray_server(self.ui_main_server, self.app)
Пример #3
0
 def __init__(self, parent):
     super(Main, self).__init__()
     self.site = site()
     self.user = user()
     QtWidgets.QDialog.__init__(self, parent)
     self.ui = Ui_Dialog()
     self.ui.setupUi(self)
     self.connect_functions()
     self.update_users()
Пример #4
0
 def __init__(self):
     self.popup_prefs_dic = user().get_popup_prefs()
     self.enable = self.popup_prefs_dic[defaults._popup_enable_key_]
     self.sound = self.popup_prefs_dic[defaults._popup_sound_key_]
     self.duration = int(
         self.popup_prefs_dic[defaults._popup_duration_key_]) * 1000
     self.creation = self.popup_prefs_dic[defaults._popup_creation_key_]
     self.publish = self.popup_prefs_dic[defaults._popup_publish_key_]
     self.playblast = self.popup_prefs_dic[defaults._popup_playblast_key_]
     self.save = self.popup_prefs_dic[defaults._popup_save_key_]
     self.message = self.popup_prefs_dic[defaults._popup_message_key_]
 def __init__(self):
     super(Main, self).__init__()
     # Build the ui from ui converted file
     self.site = site()
     self.user = user()
     self.ui = Ui_Dialog()
     self.ui.setupUi(self)
     self.connect_functions()
     self.init_show_pass_icon()
     qtHandler = log_to_gui.log_viewer(self.ui)
     logger.main_logger.addHandler(qtHandler)
     self.show = 0
Пример #6
0
    def __init__(self, widget, app, title):

        self.widget = widget

        self.main = widget
        self.main.setStyleSheet(load_stylesheet())
        #QtWidgets.QApplication.setStyle('Windows')
        self.main.setWindowTitle(title)
        #widget.setAttribute(QtCore.Qt.WA_TranslucentBackground)

        shutter = user().get_shutter()

        if shutter:
            widget.setWindowFlags(QtCore.Qt.FramelessWindowHint
                                  )  # | QtCore.Qt.WindowStaysOnTopHint)

        tray_icon = QtWidgets.QSystemTrayIcon(self.main)
        tray_icon.setIcon(QtGui.QIcon(defaults._wizard_ico_))
        if shutter:
            tray_icon.activated.connect(self.systemIcon)

        show_action = QAction("Open", self.main)
        quit_action = QAction("Exit", self.main)
        hide_action = QAction("Hide", self.main)

        if shutter:
            show_action.triggered.connect(self.main.show_animation)
            hide_action.triggered.connect(self.main.hide_animation)
        quit_action.triggered.connect(self.main.close)

        tray_menu = QMenu()

        if shutter:
            tray_menu.addAction(show_action)
            tray_menu.addAction(hide_action)
        tray_menu.addAction(quit_action)
        tray_icon.setContextMenu(tray_menu)
        tray_menu.setStyleSheet(load_stylesheet())

        if not shutter:
            pass
            self.main.show()
            self.main.setWindowState(QtCore.Qt.WindowMaximized)
        else:
            self.main.show()

        if shutter:
            self.main.move_window()
            self.main.show_animation()

        tray_icon.show()
        sys.exit(app.exec_())
Пример #7
0
 def __init__(self, main_ui):
     super(Main, self).__init__()
     # Build the ui from ui converted file
     self.ui = Ui_Form()
     self.ui.setupUi(self)
     self.user = user()
     self.main_ui = main_ui
     self.popup_dic = self.user.get_popup_prefs()
     self.init_windows_prefs()
     self.connect_buttons()
     self.set_icons()
     self.init_listWidget()
     self.init_show_pass_icon()
Пример #8
0
 def __init__(self, user_name=None):
     self.database = util.database()
     if not user_name:
         self.user_name = user().get_user()
     else:
         self.user_name = user_name
     if self.user_name:
         self.stats_file = os.path.join(os.environ[defaults._stats_var_],
                                        (self.user_name + '.wd'))
         if not self.is_file():
             self.create_user()
         else:
             self.read()
Пример #9
0
 def move_ui(self):
     screen_geometry = QtWidgets.QApplication.desktop().availableGeometry()
     screen_size = (screen_geometry.width(), screen_geometry.height())
     win_size = (self.frameSize().width(), self.frameSize().height())
     position = (user().get_popup_prefs())[defaults._popup_position_key_]
     if position == defaults._bt_r_key_ or position == defaults._tp_r_key_:
         x = screen_size[0] - win_size[0] - 20
     else:
         x = 20
     if position == defaults._bt_l_key_ or position == defaults._bt_r_key_:
         y = screen_size[1] - win_size[1] - 20
     else:
         y = 20
     self.move(x, y)
Пример #10
0
 def __init__(
     self,
     software=None,
 ):
     self.database = util.database()
     self.site = site()
     self.user = user()
     # Check if the given software is valid
     if not software or software not in defaults._softwares_list_:
         logger.warning('Please give a default software...')
     else:
         self.software = software
         # Read the software prefs
         self.settings = self.read_prefs()
Пример #11
0
def load_stylesheet(theme=None, chat_theme=None):

    user_prefs = user()

    with open(defaults._stylesheet_template_, 'r') as f:
        stylesheet = f.read()

    if theme == None:
        theme = user_prefs.get_theme()

    if chat_theme == None:
        chat_theme = user_prefs.get_chat_theme()

    stylesheet = conform_stylesheet(stylesheet, theme, chat_theme)

    return stylesheet
Пример #12
0
 def __init__(self):
     super(Main, self).__init__()
     # Build the ui from ui converted file
     self.ui = Ui_Dialog()
     self.ui.setupUi(self)
     self.site = site()
     self.user = user()
     self.clean_projects()
     self.connect_functions()
     qtHandler = log_to_gui.log_viewer(self.ui)
     logger.main_logger.addHandler(qtHandler)
     self.ui.project_path_pushButton.setIcon(
         QtGui.QIcon(defaults._folder_icon_))
     self.project_path = None
     self.project_name = None
     self.password = None
Пример #13
0
    def __init__(self, time=4000, sound=1):

        super(popup, self).__init__()

        self.user = user()
        self.time = time
        self.sound = sound

        # Build the ui from ui converted file
        self.ui = Ui_Form()
        self.ui.setupUi(self)

        self.setup_infos()

        self.setWindowFlags(QtCore.Qt.SplashScreen
                            | QtCore.Qt.FramelessWindowHint
                            | QtCore.Qt.WindowStaysOnTopHint)
        self.animation = QtCore.QPropertyAnimation(self, b"windowOpacity",
                                                   self)
        self.displace_animation = QtCore.QPropertyAnimation(self, b"pos", self)
        self.animation.finished.connect(self.hide)
        self.timer = QtCore.QTimer()
        self.timer.timeout.connect(self.hideAnimation)
Пример #14
0
# Wizard variables modules
from wizard.vars import defaults
# Wizard prefs modules
from wizard.prefs.user import user
# Wizard asset modules
from wizard.asset.folder import folder

from wizard.prefs import project as project_prefs

import traceback

import shutil
# Create the main logger
logger = log.pipe_log(__name__)

user = user()


class category():
    def __init__(self, asset):
        self.database = util.database()
        self.asset = asset
        self.path = folder(self.asset).category
        self.file = os.path.join(self.path, defaults._category_prefs_)
        self.settings = self.read_settings()

    def write(self):
        if self.path:
            write_prefs(self.database, self.file, self.settings)
        else:
            logger.debug("Can't write category prefs")
Пример #15
0
from wizard.prefs import asset as asset_prefs
from wizard.prefs import project as project_prefs
from wizard.prefs.user import user
from wizard.prefs.site import site
from wizard.prefs import software as software_prefs
from wizard.prefs.user_events import user_events
from wizard.tools import log
from wizard.vars import defaults
import os

user_prefs = user()
site_prefs = site()

logger = log.pipe_log(__name__)

class prefs:
    def __init__(self):
        self.site = self.site()

    @property
    def user(self):
        return user_prefs.get_user()

    def set_user(self, user_name):
        user_prefs.set_user(user_name)

    @property
    def chat_seen(self):
        return user_prefs.get_seen_dict()

    def set_seen(self, room, message_key):