コード例 #1
0
 def _finder_clicked(self, item: QListWidgetItem):
     text = item.text()
     key = text.split()[0]
     # xpose = pitchclass(key)
     chord_name = text[len(key):].strip()
     self._ui.combo_chord_list.setCurrentText(chord_name)
     self._ui.combo_key.setCurrentIndex(pitchclass(key))
コード例 #2
0
 def onAssetItemClick(self, item: QtWidgets.QListWidgetItem):
     if item is not None:
         self.loadAssetButton.setEnabled(True)
         if re_project._RE_DCC_APP != '':
             asset_path: Path = re_project.get_asset_path(item.text())
             self.openAssetFileButton.setEnabled(False)
             self.UpdateFileList(asset_path, self.assetFileList)
コード例 #3
0
 def onShotItemClick(self, item: QtWidgets.QListWidgetItem):
     if item is not None:
         self.loadShotButton.setEnabled(True)
         if re_project._RE_DCC_APP != '':
             shot_data = re_project.get_shot_data_from_name(item.text())
             shot_path: Path = re_project.get_shot_path(
                 shot_data[0], shot_data[1])
             self.openShotFileButton.setEnabled(False)
             self.UpdateFileList(shot_path, self.shotFileList)
コード例 #4
0
    def edit_item(self, item: QListWidgetItem):
        """
        编辑IP和端口

        :param item: 选中的item
        :return: None
        """
        src, des = item.text().split(' -> ')
        src_ip, src_port = src.split(':')
        des_ip, des_port = des.split(':')
        self.ui.listenaddress.setCurrentText(src_ip)
        self.ui.listenport.setText(src_port)
        self.ui.connectaddress.setCurrentText(des_ip)
        self.ui.connectport.setText(des_port)
コード例 #5
0
    def addItemsCompleter(self, list_, icon=None):

        if os.getenv("PINGUINO_PYTHON") is "2":
            if not icon: icon = None
            elif type(icon) in [str, unicode]: icon = getattr(self.icons, icon)
        elif os.getenv("PINGUINO_PYTHON") is "3":
            if not icon: icon = None
            elif type(icon) == str: icon = getattr(self.icons, icon)

        for text in list_:
            if not text in self.itemsListName:
                item = QListWidgetItem()
                if icon != None: item.setIcon(icon)
                item.setText(text)
                self.addItem(item)
                self.itemsList.append(item)
                self.itemsListName.append(item.text())
    def __attach_double_clicked_save_it(self, item: QListWidgetItem):
        self.__timer.stop()
        item_num = self.ui.listWidget_attch_files.currentRow()
        item = self.ui.listWidget_attch_files.item(item_num)
        file_save_name_path = self.__attach2fullpath[item.text()]

        options = QFileDialog.Options()
        options |= QFileDialog.DontUseNativeDialog
        file, _ = QFileDialog.getSaveFileName(
            self,
            "QFileDialog.getOpenFileNames()",
            "",
            "All Files (*);;Python Files (*.py)",
            options=options)

        if file:
            shutil.copyfile(file_save_name_path, file)
コード例 #7
0
ファイル: page1.py プロジェクト: chusopr/musync
    def __add_tracks(self, side, tracks):
        # Now add the tracks
        trackList = self.findChild(QListWidget, "Tracklist{}".format(side))

        self.__items[side] = []
        for t in tracks:
            self.__items[side].append(t)
            li = QListWidgetItem("{} - {}".format(t["artist"], t["title"]),
                                 trackList)
            li.track = t
            li.setToolTip(li.text())

        p0 = self.findChild(QComboBox, "Playlist0")
        p1 = self.findChild(QComboBox, "Playlist1")
        t0 = self.findChild(QListWidget, "Tracklist0")
        t1 = self.findChild(QListWidget, "Tracklist1")

        # Check both playlists are set and loaded to compare them
        if not (p0.currentData() is None or p1.currentData() is None
                or self.__threads[0].isAlive() or self.__threads[1].isAlive()):
            # Check that at least one playlist is writable
            if p0.currentData()["writable"] or p1.currentData()["writable"]:
                # If there is some empty playlist, check it's not the only writable one
                if (t0.count() > 0 or p0.currentData()["writable"]) and (
                        t1.count() > 0 or p1.currentData()["writable"]):
                    self.__threads["compare"] = threading.Thread(
                        target=self.__compare_playlists)
                    self.__threads["compare"].start()
                else:
                    if t0.count() == 0:
                        p = p0.currentText()
                        a = self.findChild(QLabel, "SourceLabel0").text()
                    else:
                        p = p1.currentText()
                        a = self.findChild(QLabel, "SourceLabel1").text()
                    self.status.emit(
                        "Playlist {} in {} has no items and no new content can be added since it's read-only"
                        .format(p, a))
                    self.__change_next_tooltip.emit(
                        "The two selected playlists don't allow continuing")
            else:
                self.status.emit("Both playlist are read-only")
                self.__change_next_tooltip.emit(
                    "Cannot continue as both playlists are read-only")
コード例 #8
0
    def show_balance(self, item: QtWidgets.QListWidgetItem = None):
        if not item:
            item = self.listWidget.currentItem()

        if not self.algod_client:
            QtWidgets.QMessageBox.critical(self, "algod settings",
                                           "Please check algod settings.")
            return

        try:
            account_info = self.algod_client.account_info(item.text())
        except Exception as e:
            if __debug__:
                print(type(e), str(e), file=stderr)
            QtWidgets.QMessageBox.critical(self, "Could not load balance",
                                           str(e))
        else:
            dialog = BalanceWindow(self, account_info)
            dialog.exec_()
コード例 #9
0
 def select_category(self, item: QListWidgetItem):
     select_category = item.text()
     event_dispatcher.emit_event(event_key.SELECT_CATEGORY_FILTER_ITEM,
                                 select_category)
コード例 #10
0
 def item_double_clicked(self, item: QtWidgets.QListWidgetItem):
     self.open_controller(item.text())
コード例 #11
0
 def internal(item: QListWidgetItem):
     idx = self.__get_item_idx(self._instance.currentItem())
     callback(idx, item.text())