(self)
| 111 | return |
| 112 | |
| 113 | def GetNasInfo(self): |
| 114 | nasInfo = NasInfoItem() |
| 115 | nasInfo.nasId = self.nextId |
| 116 | address = self.addressEdit.text() |
| 117 | title = self.titleEdit.text() |
| 118 | path = self.pathEdit.text() |
| 119 | user = self.userEdit.text() |
| 120 | password = self.passEdit.text() |
| 121 | isWaifu2x = self.isWaifu2x.isChecked() |
| 122 | index = self.buttonGroup.checkedId() |
| 123 | compressId = self.compressGroup.checkedId() |
| 124 | type = int(self.comboBox.currentIndex()) |
| 125 | if type != 2: |
| 126 | if not address or not title or not path or not user or not password : |
| 127 | return None |
| 128 | else: |
| 129 | if not title or not path: |
| 130 | return None |
| 131 | nasInfo.address = address |
| 132 | nasInfo.title = title |
| 133 | nasInfo.passwd = password |
| 134 | nasInfo.user = user |
| 135 | nasInfo.path = path |
| 136 | nasInfo.is_waifu2x = isWaifu2x |
| 137 | nasInfo.dir_index = index |
| 138 | nasInfo.compress_index = compressId |
| 139 | nasInfo.type = int(self.comboBox.currentIndex()) |
| 140 | if self.portEdit.text(): |
| 141 | nasInfo.port = int(self.portEdit.text()) |
| 142 | return nasInfo |
| 143 | |
| 144 | def Save(self): |
| 145 | nasInfo = self.GetNasInfo() |
no test coverage detected