From 879296fc690c4e583daec69a030cc5042622ebe8 Mon Sep 17 00:00:00 2001 From: ambition_echo Date: Wed, 23 Nov 2022 17:54:02 +0800 Subject: [PATCH] =?UTF-8?q?feat(wallhaven):=20=E6=B7=BB=E5=8A=A0=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E5=85=B3=E9=94=AE=E8=AF=8D=E5=92=8C=E9=A2=9C=E8=89=B2?= =?UTF-8?q?=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/notify.yml | 4 +- earth_wallpaper/about.py | 2 +- earth_wallpaper/config.py | 86 ++++- earth_wallpaper/interfaces/utils/settings.py | 6 + earth_wallpaper/interfaces/wallhaven.py | 9 +- earth_wallpaper/ui/UI_config.py | 240 ++++++++------ earth_wallpaper/ui/config.ui | 332 +++++++++++-------- 7 files changed, 421 insertions(+), 258 deletions(-) diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index 8be4cc1..b237a38 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -1,5 +1,5 @@ name: Notify -on: +on: issues: types: opened issue_comment: @@ -14,7 +14,7 @@ jobs: - name: get issue_comment content if: github.event_name == 'issue_comment' run: | - echo "CONTENT=${{ github.event.comment.body }}" >> $GITHUB_ENV + echo "CONTENT=\"${{ github.event.comment.body }}\"" >> $GITHUB_ENV - name: get issues content if: github.event_name == 'issues' run: | diff --git a/earth_wallpaper/about.py b/earth_wallpaper/about.py index 70467a7..c0c6a81 100644 --- a/earth_wallpaper/about.py +++ b/earth_wallpaper/about.py @@ -11,7 +11,7 @@ def get_version(): - return "2.0.9" + return "2.1.3" def compare(remote, local): diff --git a/earth_wallpaper/config.py b/earth_wallpaper/config.py index 0891265..81037b3 100644 --- a/earth_wallpaper/config.py +++ b/earth_wallpaper/config.py @@ -1,7 +1,7 @@ import shutil from PySide6.QtCore import Qt, QSettings, Signal -from PySide6.QtGui import QIcon +from PySide6.QtGui import QIcon, QPixmap, QPainter, QColor from PySide6.QtWidgets import QWidget, QMessageBox, QFileDialog from earth_wallpaper.ui.UI_config import Ui_Config from earth_wallpaper.utils.platformInfo import PlatformInfo @@ -33,7 +33,8 @@ def __init__(self): self.setAttribute(Qt.WA_DeleteOnClose) self.config_path = PlatformInfo.config_path() self.path = os.path.split(os.path.realpath(__file__))[0] - self.setWindowIcon(QIcon(os.path.join(self.path, "resource/earth-wallpaper.png"))) + self.setWindowIcon( + QIcon(os.path.join(self.path, "resource/earth-wallpaper.png"))) self.setupUi(self) self.initUI() self.check() @@ -56,18 +57,24 @@ def initUI(self): self.sorting.addItem("Favorites") self.sorting.addItem("Toplist") self.sorting.addItem("Hot") + self.init_color_select() def _update_layout_(self): updateTimeGroup = [self.updateTime, self.updateTime_l] earthSizeGroup = [self.earthSize, self.earthSize_l] - wallpaperDirGroup = [self.wallpaperDir, self.wallpaperDir_l, self.selectDir] - wallpaperFileGroup = [self.wallpaperFile, self.wallpaperFile_l, self.selectFile] + wallpaperDirGroup = [self.wallpaperDir, + self.wallpaperDir_l, self.selectDir] + wallpaperFileGroup = [self.wallpaperFile, + self.wallpaperFile_l, self.selectFile] apikeyGroup = [self.apikey_l, self.apikey] - categoriesGroup = [self.categories_l, self.General, self.Anime, self.People] + categoriesGroup = [self.categories_l, + self.General, self.Anime, self.People] purityGroup = [self.purity_l, self.SFW, self.Sketchy, self.NSFW] sortingGroup = [self.sorting_l, self.sorting] + searchkeyGroup = [self.searchkey_l, self.searchkey] + colorGroup = [self.color_l, self.color] all_layout = [updateTimeGroup, earthSizeGroup, wallpaperDirGroup, wallpaperFileGroup, apikeyGroup, - categoriesGroup, purityGroup, sortingGroup] + categoriesGroup, purityGroup, sortingGroup, searchkeyGroup, colorGroup] class_name = _get_class_name_(self.source.currentText()) layout_list = getattr(interfaces, class_name).layout() for i in all_layout: @@ -109,6 +116,7 @@ def set_default_config(self): settings.setValue("Sketchy", False) settings.setValue("NSFW", False) settings.setValue("sorting", "Random") + settings.setValue("color", "不选择") settings.endGroup() settings.beginGroup("System") @@ -140,6 +148,8 @@ def read_config(self): self.Sketchy.setChecked(trans(str(settings.value("Sketchy")))) self.NSFW.setChecked(trans(str(settings.value("NSFW")))) self.sorting.setCurrentText(settings.value("sorting")) + self.searchkey.setText(settings.value("searchkey")) + self.color.setCurrentText(settings.value("color")) settings.endGroup() settings.beginGroup("System") @@ -171,6 +181,8 @@ def write_config(self): settings.setValue("Sketchy", self.Sketchy.isChecked()) settings.setValue("NSFW", self.NSFW.isChecked()) settings.setValue("sorting", self.sorting.currentText()) + settings.setValue("searchkey", self.searchkey.text()) + settings.setValue("color", self.color.currentText()) settings.endGroup() settings.beginGroup("System") @@ -208,3 +220,65 @@ def clear_cache(): logger.info(f"删除缓存目录: {cache}") message = QMessageBox() QMessageBox.information(message, "清理缓存", "已删除全部缓存壁纸", QMessageBox.Yes) + + def init_color_select(self): + pix = QPixmap(16, 16) + painter = QPainter(pix) + painter.fillRect(0, 0, 16, 16, QColor("#660000")) + self.color.addItem(QIcon(pix), "660000") + painter.fillRect(0, 0, 16, 16, QColor("#990000")) + self.color.addItem(QIcon(pix), "990000") + painter.fillRect(0, 0, 16, 16, QColor("#cc0000")) + self.color.addItem(QIcon(pix), "cc0000") + painter.fillRect(0, 0, 16, 16, QColor("#cc3333")) + self.color.addItem(QIcon(pix), "cc3333") + painter.fillRect(0, 0, 16, 16, QColor("#ea4c88")) + self.color.addItem(QIcon(pix), "ea4c88") + painter.fillRect(0, 0, 16, 16, QColor("#993399")) + self.color.addItem(QIcon(pix), "993399") + painter.fillRect(0, 0, 16, 16, QColor("#663399")) + self.color.addItem(QIcon(pix), "663399") + painter.fillRect(0, 0, 16, 16, QColor("#333399")) + self.color.addItem(QIcon(pix), "333399") + painter.fillRect(0, 0, 16, 16, QColor("#0066cc")) + self.color.addItem(QIcon(pix), "0066cc") + painter.fillRect(0, 0, 16, 16, QColor("#0099cc")) + self.color.addItem(QIcon(pix), "0099cc") + painter.fillRect(0, 0, 16, 16, QColor("#66cccc")) + self.color.addItem(QIcon(pix), "66cccc") + painter.fillRect(0, 0, 16, 16, QColor("#77cc33")) + self.color.addItem(QIcon(pix), "77cc33") + painter.fillRect(0, 0, 16, 16, QColor("#669900")) + self.color.addItem(QIcon(pix), "669900") + painter.fillRect(0, 0, 16, 16, QColor("#336600")) + self.color.addItem(QIcon(pix), "336600") + painter.fillRect(0, 0, 16, 16, QColor("#666600")) + self.color.addItem(QIcon(pix), "666600") + painter.fillRect(0, 0, 16, 16, QColor("#cccc33")) + self.color.addItem(QIcon(pix), "cccc33") + painter.fillRect(0, 0, 16, 16, QColor("#ffff00")) + self.color.addItem(QIcon(pix), "ffff00") + painter.fillRect(0, 0, 16, 16, QColor("#ffcc33")) + self.color.addItem(QIcon(pix), "ffcc33") + painter.fillRect(0, 0, 16, 16, QColor("#ff9900")) + self.color.addItem(QIcon(pix), "ff9900") + painter.fillRect(0, 0, 16, 16, QColor("#ff6600")) + self.color.addItem(QIcon(pix), "ff6600") + painter.fillRect(0, 0, 16, 16, QColor("#cc6633")) + self.color.addItem(QIcon(pix), "cc6633") + painter.fillRect(0, 0, 16, 16, QColor("#996633")) + self.color.addItem(QIcon(pix), "996633") + painter.fillRect(0, 0, 16, 16, QColor("#663300")) + self.color.addItem(QIcon(pix), "663300") + painter.fillRect(0, 0, 16, 16, QColor("#000000")) + self.color.addItem(QIcon(pix), "000000") + painter.fillRect(0, 0, 16, 16, QColor("#999999")) + self.color.addItem(QIcon(pix), "999999") + painter.fillRect(0, 0, 16, 16, QColor("#cccccc")) + self.color.addItem(QIcon(pix), "cccccc") + painter.fillRect(0, 0, 16, 16, QColor("#ffffff")) + self.color.addItem(QIcon(pix), "ffffff") + painter.fillRect(0, 0, 16, 16, QColor("#424153")) + self.color.addItem(QIcon(pix), "424153") + self.color.addItem("不选择") + painter.end() diff --git a/earth_wallpaper/interfaces/utils/settings.py b/earth_wallpaper/interfaces/utils/settings.py index e7f8998..96e5c56 100644 --- a/earth_wallpaper/interfaces/utils/settings.py +++ b/earth_wallpaper/interfaces/utils/settings.py @@ -61,6 +61,12 @@ def nsfw(self): def sorting(self): return self.settings.value("APP/sorting").lower().replace(" ", "_") + def searchkey(self): + return self.settings.value("APP/searchkey") + + def color(self): + return self.settings.value("APP/color") + @staticmethod def desktop_res() -> (int, int): desktop = QApplication.primaryScreen() diff --git a/earth_wallpaper/interfaces/wallhaven.py b/earth_wallpaper/interfaces/wallhaven.py index 94ad3f3..73134d3 100644 --- a/earth_wallpaper/interfaces/wallhaven.py +++ b/earth_wallpaper/interfaces/wallhaven.py @@ -21,6 +21,8 @@ def __init__(self): self.sketchy = Settings().sketchy() self.nsfw = Settings().nsfw() self.sorting = Settings().sorting() + self.searchkey = Settings().searchkey() + self.color = Settings().color() self.download_path = PlatformInfo().download_path(".png") def build_search_url(self): @@ -41,6 +43,10 @@ def build_search_url(self): purity[2] = '1' self.search_url += f"&purity={''.join(purity)}" self.search_url += f"&sorting={self.sorting}" + if not len(self.searchkey) == 0: + self.search_url += f"&q={self.searchkey}" + if not self.color == "不选择": + self.search_url += f"&colors={self.color}" if not len(self.apikey) == 0: self.search_url += f"&apikey={self.apikey}" logger.info(f"search_url构造完成:{self.search_url}") @@ -81,5 +87,6 @@ def name(): @staticmethod def layout(): - layout_list = ["updateTimeGroup", "apikeyGroup", "categoriesGroup", "purityGroup", "sortingGroup"] + layout_list = ["updateTimeGroup", "apikeyGroup", "categoriesGroup", "purityGroup", "sortingGroup", + "searchkeyGroup", "colorGroup"] return layout_list diff --git a/earth_wallpaper/ui/UI_config.py b/earth_wallpaper/ui/UI_config.py index 8e4c180..04692a1 100644 --- a/earth_wallpaper/ui/UI_config.py +++ b/earth_wallpaper/ui/UI_config.py @@ -24,113 +24,108 @@ class Ui_Config(object): def setupUi(self, Config): if not Config.objectName(): Config.setObjectName(u"Config") - Config.resize(346, 572) + Config.resize(344, 640) self.gridLayout_3 = QGridLayout(Config) self.gridLayout_3.setObjectName(u"gridLayout_3") self.AppSettings = QGroupBox(Config) self.AppSettings.setObjectName(u"AppSettings") self.gridLayout_2 = QGridLayout(self.AppSettings) self.gridLayout_2.setObjectName(u"gridLayout_2") - self.apikey = QLineEdit(self.AppSettings) - self.apikey.setObjectName(u"apikey") + self.source_l = QLabel(self.AppSettings) + self.source_l.setObjectName(u"source_l") - self.gridLayout_2.addWidget(self.apikey, 5, 2, 1, 2) + self.gridLayout_2.addWidget(self.source_l, 0, 0, 1, 2) - self.earthSize = QSpinBox(self.AppSettings) - self.earthSize.setObjectName(u"earthSize") - self.earthSize.setMinimum(20) - self.earthSize.setMaximum(100) + self.source = QComboBox(self.AppSettings) + self.source.setObjectName(u"source") + sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.source.sizePolicy().hasHeightForWidth()) + self.source.setSizePolicy(sizePolicy) - self.gridLayout_2.addWidget(self.earthSize, 2, 2, 1, 2) + self.gridLayout_2.addWidget(self.source, 0, 2, 1, 3) - self.earthSize_l = QLabel(self.AppSettings) - self.earthSize_l.setObjectName(u"earthSize_l") + self.updateTime_l = QLabel(self.AppSettings) + self.updateTime_l.setObjectName(u"updateTime_l") - self.gridLayout_2.addWidget(self.earthSize_l, 2, 0, 1, 1) + self.gridLayout_2.addWidget(self.updateTime_l, 1, 0, 1, 2) self.updateTime = QSpinBox(self.AppSettings) self.updateTime.setObjectName(u"updateTime") + sizePolicy.setHeightForWidth(self.updateTime.sizePolicy().hasHeightForWidth()) + self.updateTime.setSizePolicy(sizePolicy) self.updateTime.setMinimum(1) self.updateTime.setMaximum(1440) self.updateTime.setValue(30) - self.gridLayout_2.addWidget(self.updateTime, 1, 2, 1, 2) + self.gridLayout_2.addWidget(self.updateTime, 1, 2, 1, 3) - self.purityGroup = QHBoxLayout() - self.purityGroup.setObjectName(u"purityGroup") - self.purity_l = QLabel(self.AppSettings) - self.purity_l.setObjectName(u"purity_l") + self.earthSize_l = QLabel(self.AppSettings) + self.earthSize_l.setObjectName(u"earthSize_l") - self.purityGroup.addWidget(self.purity_l) + self.gridLayout_2.addWidget(self.earthSize_l, 2, 0, 1, 1) - self.SFW = QCheckBox(self.AppSettings) - self.SFW.setObjectName(u"SFW") - self.SFW.setStyleSheet(u"font: 700;\n" -"color: #447744;") + self.earthSize = QSpinBox(self.AppSettings) + self.earthSize.setObjectName(u"earthSize") + sizePolicy.setHeightForWidth(self.earthSize.sizePolicy().hasHeightForWidth()) + self.earthSize.setSizePolicy(sizePolicy) + self.earthSize.setMinimum(20) + self.earthSize.setMaximum(100) - self.purityGroup.addWidget(self.SFW) + self.gridLayout_2.addWidget(self.earthSize, 2, 3, 1, 2) - self.Sketchy = QCheckBox(self.AppSettings) - self.Sketchy.setObjectName(u"Sketchy") - self.Sketchy.setStyleSheet(u"font: 700;\n" -"color: #777744;") + self.wallpaperDir_l = QLabel(self.AppSettings) + self.wallpaperDir_l.setObjectName(u"wallpaperDir_l") - self.purityGroup.addWidget(self.Sketchy) + self.gridLayout_2.addWidget(self.wallpaperDir_l, 3, 0, 1, 3) - self.NSFW = QCheckBox(self.AppSettings) - self.NSFW.setObjectName(u"NSFW") - self.NSFW.setStyleSheet(u"font: 700;\n" -"color: #774444;") + self.wallpaperDir = QLineEdit(self.AppSettings) + self.wallpaperDir.setObjectName(u"wallpaperDir") - self.purityGroup.addWidget(self.NSFW) + self.gridLayout_2.addWidget(self.wallpaperDir, 3, 3, 1, 1) + self.selectDir = QPushButton(self.AppSettings) + self.selectDir.setObjectName(u"selectDir") + self.selectDir.setMinimumSize(QSize(80, 0)) - self.gridLayout_2.addLayout(self.purityGroup, 7, 0, 1, 4) + self.gridLayout_2.addWidget(self.selectDir, 3, 4, 1, 1) - self.updateTime_l = QLabel(self.AppSettings) - self.updateTime_l.setObjectName(u"updateTime_l") + self.wallpaperFile_l = QLabel(self.AppSettings) + self.wallpaperFile_l.setObjectName(u"wallpaperFile_l") - self.gridLayout_2.addWidget(self.updateTime_l, 1, 0, 1, 1) + self.gridLayout_2.addWidget(self.wallpaperFile_l, 4, 0, 1, 1) - self.sorting_l = QLabel(self.AppSettings) - self.sorting_l.setObjectName(u"sorting_l") + self.wallpaperFile = QLineEdit(self.AppSettings) + self.wallpaperFile.setObjectName(u"wallpaperFile") - self.gridLayout_2.addWidget(self.sorting_l, 8, 0, 1, 2) + self.gridLayout_2.addWidget(self.wallpaperFile, 4, 3, 1, 1) + + self.selectFile = QPushButton(self.AppSettings) + self.selectFile.setObjectName(u"selectFile") + self.selectFile.setMinimumSize(QSize(80, 0)) + + self.gridLayout_2.addWidget(self.selectFile, 4, 4, 1, 1) self.apikey_l = QLabel(self.AppSettings) self.apikey_l.setObjectName(u"apikey_l") self.gridLayout_2.addWidget(self.apikey_l, 5, 0, 1, 1) - self.wallpaperFile_l = QLabel(self.AppSettings) - self.wallpaperFile_l.setObjectName(u"wallpaperFile_l") - - self.gridLayout_2.addWidget(self.wallpaperFile_l, 4, 0, 1, 1) + self.apikey = QLineEdit(self.AppSettings) + self.apikey.setObjectName(u"apikey") - self.wallpaperDir_l = QLabel(self.AppSettings) - self.wallpaperDir_l.setObjectName(u"wallpaperDir_l") + self.gridLayout_2.addWidget(self.apikey, 5, 2, 1, 3) - self.gridLayout_2.addWidget(self.wallpaperDir_l, 3, 0, 1, 2) + self.searchkey_l = QLabel(self.AppSettings) + self.searchkey_l.setObjectName(u"searchkey_l") - self.source_l = QLabel(self.AppSettings) - self.source_l.setObjectName(u"source_l") + self.gridLayout_2.addWidget(self.searchkey_l, 6, 0, 1, 1) - self.gridLayout_2.addWidget(self.source_l, 0, 0, 1, 1) + self.searchkey = QLineEdit(self.AppSettings) + self.searchkey.setObjectName(u"searchkey") - self.source = QComboBox(self.AppSettings) - self.source.setObjectName(u"source") - sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.source.sizePolicy().hasHeightForWidth()) - self.source.setSizePolicy(sizePolicy) - - self.gridLayout_2.addWidget(self.source, 0, 2, 1, 2) - - self.sorting = QComboBox(self.AppSettings) - self.sorting.setObjectName(u"sorting") - - self.gridLayout_2.addWidget(self.sorting, 8, 2, 1, 2) + self.gridLayout_2.addWidget(self.searchkey, 6, 1, 1, 4) self.categoriesGroup = QHBoxLayout() self.categoriesGroup.setObjectName(u"categoriesGroup") @@ -155,46 +150,65 @@ def setupUi(self, Config): self.categoriesGroup.addWidget(self.People) - self.gridLayout_2.addLayout(self.categoriesGroup, 6, 0, 1, 4) + self.gridLayout_2.addLayout(self.categoriesGroup, 7, 0, 1, 5) - self.selectFile = QPushButton(self.AppSettings) - self.selectFile.setObjectName(u"selectFile") - self.selectFile.setMinimumSize(QSize(80, 0)) + self.purityGroup = QHBoxLayout() + self.purityGroup.setObjectName(u"purityGroup") + self.purity_l = QLabel(self.AppSettings) + self.purity_l.setObjectName(u"purity_l") - self.gridLayout_2.addWidget(self.selectFile, 4, 3, 1, 1) + self.purityGroup.addWidget(self.purity_l) - self.selectDir = QPushButton(self.AppSettings) - self.selectDir.setObjectName(u"selectDir") - self.selectDir.setMinimumSize(QSize(80, 0)) + self.SFW = QCheckBox(self.AppSettings) + self.SFW.setObjectName(u"SFW") + self.SFW.setStyleSheet(u"font: 700;\n" +"color: #447744;") - self.gridLayout_2.addWidget(self.selectDir, 3, 3, 1, 1) + self.purityGroup.addWidget(self.SFW) - self.wallpaperFile = QLineEdit(self.AppSettings) - self.wallpaperFile.setObjectName(u"wallpaperFile") + self.Sketchy = QCheckBox(self.AppSettings) + self.Sketchy.setObjectName(u"Sketchy") + self.Sketchy.setStyleSheet(u"font: 700;\n" +"color: #777744;") - self.gridLayout_2.addWidget(self.wallpaperFile, 4, 1, 1, 2) + self.purityGroup.addWidget(self.Sketchy) - self.wallpaperDir = QLineEdit(self.AppSettings) - self.wallpaperDir.setObjectName(u"wallpaperDir") + self.NSFW = QCheckBox(self.AppSettings) + self.NSFW.setObjectName(u"NSFW") + self.NSFW.setStyleSheet(u"font: 700;\n" +"color: #774444;") - self.gridLayout_2.addWidget(self.wallpaperDir, 3, 2, 1, 1) + self.purityGroup.addWidget(self.NSFW) - self.gridLayout_3.addWidget(self.AppSettings, 0, 0, 1, 3) + self.gridLayout_2.addLayout(self.purityGroup, 8, 0, 1, 5) - self.applySpacer = QSpacerItem(57, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) + self.sorting_l = QLabel(self.AppSettings) + self.sorting_l.setObjectName(u"sorting_l") - self.gridLayout_3.addItem(self.applySpacer, 2, 0, 1, 1) + self.gridLayout_2.addWidget(self.sorting_l, 9, 0, 1, 1) - self.applyBtn = QPushButton(Config) - self.applyBtn.setObjectName(u"applyBtn") + self.sorting = QComboBox(self.AppSettings) + self.sorting.setObjectName(u"sorting") + sizePolicy.setHeightForWidth(self.sorting.sizePolicy().hasHeightForWidth()) + self.sorting.setSizePolicy(sizePolicy) - self.gridLayout_3.addWidget(self.applyBtn, 2, 1, 1, 1) + self.gridLayout_2.addWidget(self.sorting, 9, 2, 1, 3) - self.closeBtn = QPushButton(Config) - self.closeBtn.setObjectName(u"closeBtn") + self.color_l = QLabel(self.AppSettings) + self.color_l.setObjectName(u"color_l") - self.gridLayout_3.addWidget(self.closeBtn, 2, 2, 1, 1) + self.gridLayout_2.addWidget(self.color_l, 10, 0, 1, 1) + + self.color = QComboBox(self.AppSettings) + self.color.setObjectName(u"color") + sizePolicy.setHeightForWidth(self.color.sizePolicy().hasHeightForWidth()) + self.color.setSizePolicy(sizePolicy) + + self.gridLayout_2.addWidget(self.color, 10, 1, 1, 4) + + + self.gridLayout_3.addWidget(self.AppSettings, 0, 0, 1, 3) self.SystemSettings = QGroupBox(Config) self.SystemSettings.setObjectName(u"SystemSettings") @@ -270,6 +284,20 @@ def setupUi(self, Config): self.gridLayout_3.addWidget(self.SystemSettings, 1, 0, 1, 3) + self.applySpacer = QSpacerItem(57, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) + + self.gridLayout_3.addItem(self.applySpacer, 2, 0, 1, 1) + + self.applyBtn = QPushButton(Config) + self.applyBtn.setObjectName(u"applyBtn") + + self.gridLayout_3.addWidget(self.applyBtn, 2, 1, 1, 1) + + self.closeBtn = QPushButton(Config) + self.closeBtn.setObjectName(u"closeBtn") + + self.gridLayout_3.addWidget(self.closeBtn, 2, 2, 1, 1) + self.retranslateUi(Config) @@ -279,31 +307,31 @@ def setupUi(self, Config): def retranslateUi(self, Config): Config.setWindowTitle(QCoreApplication.translate("Config", u"\u8bbe\u7f6e", None)) self.AppSettings.setTitle(QCoreApplication.translate("Config", u"\u5e94\u7528\u8bbe\u7f6e", None)) + self.source_l.setText(QCoreApplication.translate("Config", u"\u58c1\u7eb8\u6765\u6e90\uff1a", None)) + self.updateTime_l.setText(QCoreApplication.translate("Config", u"\u66f4\u65b0\u95f4\u9694\uff1a", None)) + self.updateTime.setSuffix(QCoreApplication.translate("Config", u"(\u5206\u949f)", None)) + self.updateTime.setPrefix("") + self.earthSize_l.setText(QCoreApplication.translate("Config", u"\u5730\u7403\u5927\u5c0f\uff1a", None)) + self.earthSize.setSuffix(QCoreApplication.translate("Config", u"%", None)) + self.wallpaperDir_l.setText(QCoreApplication.translate("Config", u"\u58c1\u7eb8\u6587\u4ef6\u5939\uff1a", None)) + self.selectDir.setText(QCoreApplication.translate("Config", u"\u6d4f\u89c8", None)) + self.wallpaperFile_l.setText(QCoreApplication.translate("Config", u"\u58c1\u7eb8\u6587\u4ef6\uff1a", None)) + self.selectFile.setText(QCoreApplication.translate("Config", u"\u6d4f\u89c8", None)) + self.apikey_l.setText(QCoreApplication.translate("Config", u"apiKey\uff1a", None)) self.apikey.setInputMask("") self.apikey.setText("") self.apikey.setPlaceholderText(QCoreApplication.translate("Config", u"\u4f7f\u7528NSFW\u9700\u8981\u63d0\u4f9bapikey", None)) - self.earthSize.setSuffix(QCoreApplication.translate("Config", u"%", None)) - self.earthSize_l.setText(QCoreApplication.translate("Config", u"\u5730\u7403\u5927\u5c0f\uff1a", None)) - self.updateTime.setSuffix(QCoreApplication.translate("Config", u"(\u5206\u949f)", None)) - self.updateTime.setPrefix("") + self.searchkey_l.setText(QCoreApplication.translate("Config", u"\u5173\u952e\u8bcd\uff1a", None)) + self.categories_l.setText(QCoreApplication.translate("Config", u"\u5206\u7c7b\uff1a", None)) + self.General.setText(QCoreApplication.translate("Config", u"General", None)) + self.Anime.setText(QCoreApplication.translate("Config", u"Anime", None)) + self.People.setText(QCoreApplication.translate("Config", u"People", None)) self.purity_l.setText(QCoreApplication.translate("Config", u"\u5206\u7ea7\uff1a", None)) self.SFW.setText(QCoreApplication.translate("Config", u"SFW", None)) self.Sketchy.setText(QCoreApplication.translate("Config", u"Sketchy", None)) self.NSFW.setText(QCoreApplication.translate("Config", u"NSFW", None)) - self.updateTime_l.setText(QCoreApplication.translate("Config", u"\u66f4\u65b0\u95f4\u9694\uff1a", None)) self.sorting_l.setText(QCoreApplication.translate("Config", u"\u968f\u673a\u5217\u8868\uff1a", None)) - self.apikey_l.setText(QCoreApplication.translate("Config", u"apiKey\uff1a", None)) - self.wallpaperFile_l.setText(QCoreApplication.translate("Config", u"\u58c1\u7eb8\u6587\u4ef6\uff1a", None)) - self.wallpaperDir_l.setText(QCoreApplication.translate("Config", u"\u58c1\u7eb8\u6587\u4ef6\u5939\uff1a", None)) - self.source_l.setText(QCoreApplication.translate("Config", u"\u58c1\u7eb8\u6765\u6e90\uff1a", None)) - self.categories_l.setText(QCoreApplication.translate("Config", u"\u5206\u7c7b\uff1a", None)) - self.General.setText(QCoreApplication.translate("Config", u"General", None)) - self.Anime.setText(QCoreApplication.translate("Config", u"Anime", None)) - self.People.setText(QCoreApplication.translate("Config", u"People", None)) - self.selectFile.setText(QCoreApplication.translate("Config", u"\u6d4f\u89c8", None)) - self.selectDir.setText(QCoreApplication.translate("Config", u"\u6d4f\u89c8", None)) - self.applyBtn.setText(QCoreApplication.translate("Config", u"\u5e94\u7528", None)) - self.closeBtn.setText(QCoreApplication.translate("Config", u"\u5173\u95ed", None)) + self.color_l.setText(QCoreApplication.translate("Config", u"\u989c\u8272\uff1a", None)) self.SystemSettings.setTitle(QCoreApplication.translate("Config", u"\u7cfb\u7edf\u8bbe\u7f6e", None)) self.proxy_l.setText(QCoreApplication.translate("Config", u"\u7f51\u7edc\u4ee3\u7406\uff1a", None)) self.proxyNone.setText(QCoreApplication.translate("Config", u"\u65e0", None)) @@ -312,5 +340,7 @@ def retranslateUi(self, Config): self.add_l.setText(QCoreApplication.translate("Config", u"\u5730\u5740\uff1a", None)) self.port_l.setText(QCoreApplication.translate("Config", u":", None)) self.clearCache.setText(QCoreApplication.translate("Config", u"\u5220\u9664\u7f13\u5b58", None)) + self.applyBtn.setText(QCoreApplication.translate("Config", u"\u5e94\u7528", None)) + self.closeBtn.setText(QCoreApplication.translate("Config", u"\u5173\u95ed", None)) # retranslateUi diff --git a/earth_wallpaper/ui/config.ui b/earth_wallpaper/ui/config.ui index 52bbd23..86edd4b 100644 --- a/earth_wallpaper/ui/config.ui +++ b/earth_wallpaper/ui/config.ui @@ -6,8 +6,8 @@ 0 0 - 346 - 572 + 344 + 640 @@ -20,41 +20,38 @@ 应用设置 - - - - - + + - - - - 使用NSFW需要提供apikey + 壁纸来源: - - - - % - - - 20 - - - 100 + + + + + 0 + 0 + - - + + - 地球大小: + 更新间隔: - + + + + 0 + 0 + + (分钟) @@ -72,68 +69,52 @@ - - - - - - 分级: - - - - - - - font: 700; -color: #447744; - - - SFW - - - - - - - font: 700; -color: #777744; - - - Sketchy - - - - - - - font: 700; -color: #774444; - - - NSFW - - - - - - - + + - 更新间隔: + 地球大小: - - + + + + + 0 + 0 + + + + % + + + 20 + + + 100 + + + + + - 随机列表: + 壁纸文件夹: - - + + + + + + + + 80 + 0 + + - apiKey: + 浏览 @@ -144,34 +125,53 @@ color: #774444; - - + + + + + + + + 80 + 0 + + - 壁纸文件夹: + 浏览 - - + + - 壁纸来源: + apiKey: - - - - - 0 - 0 - + + + + + + + + + + 使用NSFW需要提供apikey - - + + + + 关键词: + + + + + - + @@ -203,68 +203,87 @@ color: #774444; - - - - - 80 - 0 - - + + + + + + 分级: + + + + + + + font: 700; +color: #447744; + + + SFW + + + + + + + font: 700; +color: #777744; + + + Sketchy + + + + + + + font: 700; +color: #774444; + + + NSFW + + + + + + + - 浏览 + 随机列表: - - - - - 80 - 0 - + + + + + 0 + 0 + + + + + - 浏览 + 颜色: - - - - - + + + + + 0 + 0 + + + - - - - Qt::Horizontal - - - - 57 - 20 - - - - - - - - 应用 - - - - - - - 关闭 - - - @@ -359,6 +378,33 @@ color: #774444; + + + + Qt::Horizontal + + + + 57 + 20 + + + + + + + + 应用 + + + + + + + 关闭 + + +