def __init__(self, widget_manager, info): # init Widget.__init__(self, widget_manager, info) QWidget.__init__(self) self.conf = {} self.lang = info.lang self.settings_win = None # setup window with open(os.path.join(RES, 'timer', 'style.css'), encoding='utf-8') as file: self.setStyleSheet(file.read()) # setup menu self.menu = QMenu(self) start_action = self.menu.addAction(QIcon(PLAY), self.lang['start']) start_action.triggered.connect(self._start) pause_action = self.menu.addAction(QIcon(PAUSE), self.lang['pause']) pause_action.triggered.connect(self._pause) reset_action = self.menu.addAction(QIcon(STOP), self.lang['reset']) reset_action.triggered.connect(self._reset) # all setups self.timer = QTimer(self) self.timer.timeout.connect(self._tick) self._last = 0 self.list = [] self.shows = {} self.v_box = QVBoxLayout(self) self.v_box.setContentsMargins(0, 0, 0, 0) self.v_box.setSpacing(1) self.setLayout(self.v_box) # constants self.TICK = os.path.join(RES, 'timer', 'tick.ogg') self.TACK = os.path.join(RES, 'timer', 'tack.ogg') self.ALARM = os.path.join(RES, 'timer', 'alarm.ogg')
def __init__(self, widget_manager, info): # init Widget.__init__(self, widget_manager, info) QWidget.__init__(self) self.conf = {} self.lang = info.lang self.note_win = None self.settings_win = None # setup image self.image = QLabel(self) self.image.setScaledContents(True) self.image.setPixmap(ICON_PIXMAP) self.image.mousePressEvent = self._click self.image.show() # setup timer self.timer = QTimer(self) self.timer.timeout.connect(self._timeout) # setup grid layout self.g_box = QGridLayout(self) self.g_box.setSpacing(0) self.g_box.setContentsMargins(0, 0, 0, 0) self.g_box.addWidget(self.image) self.setLayout(self.g_box) # setup vars self._setup_vars()
def __init__(self, widget_manager, info): # init Widget.__init__(self, widget_manager, info) Note.__init__(self, self, 0) self.conf = {} self.lang = info.lang # setup vars self.settings_win = None self.__setup_vars()
def __init__(self, widget_manager, info): # init Widget.__init__(self, widget_manager, info) DTime.__init__(self, self, 0) self.conf = {} self.lang = info.lang self.settings_win = None # setup timer self.timer = QTimer(self) self.timer.timeout.connect(self._timeout) self.destroyed.connect(self.timer.stop) # setup vars self.__setup_vars()
def __init__(self, widget_manager, info): Widget.__init__(self, widget_manager, info) QWidget.__init__(self) self.servers = [] self.timer_interval = 30000 self.lang = info.lang self.show_more = None self.settings_win = None # setup stylesheet with open(os.path.join(RES, 'minecraft', 'style.css'), encoding='utf-8') as file: style = file.read() self.setStyleSheet(style) # setup list self.list = QListWidget(self) self.list.setStyleSheet(style) self.list.setContextMenuPolicy(Qt.CustomContextMenu) self.list.customContextMenuRequested.connect(self._show_list_menu) self.list.itemDoubleClicked.connect(self._list_double_click) self.list.setIconSize(QSize(64, 64)) self.list.setWordWrap(True) self.list.setSelectionMode(QListWidget.NoSelection) # setup list menu self.list_menu = QMenu(self) reload_action = self.list_menu.addAction( QIcon(RELOAD), self.widget_manager.lang['MINECRAFT']['reload']) reload_action.triggered.connect(self._list_fill) # setup v box layout self.v_box = QVBoxLayout(self) self.v_box.addWidget(self.list) self.v_box.setContentsMargins(0, 0, 0, 0) # setup timer self.update_timer = QTimer(self) self.update_timer.timeout.connect(self._list_fill) self.start_timer = QTimer(self) self.start_timer.timeout.connect(self._list_fill) # buffer self.__manager = Manager() self.list_buffer = self.__manager.dict() # other self.__procs = []
def __init__(self, widget_manager, info): # init Widget.__init__(self, widget_manager, info) QWidget.__init__(self) self.conf = {} self.lang = info.lang self.settings_win = None # setup layout self.setLayout(QVBoxLayout(self)) self.layout().setContentsMargins(0, 0, 0, 0) # setup stylesheet with open(os.path.join(RES, 'ram', 'style.css'), encoding='utf-8') as file: style = file.read() self.setStyleSheet(style) self.setAttribute(Qt.WA_TranslucentBackground) # setup timer self.timer = QTimer(self) self.timer.timeout.connect(self.setup_ui) # setup vars self._widgets = [] self._setup_vars()
def __init__(self, widget_manager, info): # init Widget.__init__(self, widget_manager, info) QWidget.__init__(self)