| 66 | self.setupUI() |
| 67 | |
| 68 | def setupUI(self): |
| 69 | self.textLayout.setSpacing(12) |
| 70 | |
| 71 | # 模式切换 |
| 72 | modeLayout = QHBoxLayout() |
| 73 | modeLayout.addWidget(StrongBodyLabel("生成模式:", self)) |
| 74 | self.modeCombo = ComboBox(self) |
| 75 | self.modeCombo.addItems(["简易模式", "专业模式"]) |
| 76 | self.modeCombo.currentIndexChanged.connect(self.onModeChanged) |
| 77 | modeLayout.addWidget(self.modeCombo, 1) |
| 78 | self.textLayout.addLayout(modeLayout) |
| 79 | |
| 80 | # 简易模式容器 |
| 81 | self.simpleWidget = QWidget(self) |
| 82 | simpleLayout = QVBoxLayout(self.simpleWidget) |
| 83 | simpleLayout.setContentsMargins(0, 0, 0, 0) |
| 84 | simpleLayout.setSpacing(8) |
| 85 | |
| 86 | # 预设选项 |
| 87 | presetLayout = QHBoxLayout() |
| 88 | presetLayout.addWidget(StrongBodyLabel("时间间隔:", self)) |
| 89 | self.presetCombo = ComboBox(self) |
| 90 | self.presetCombo.addItems([ |
| 91 | "自定义", |
| 92 | "每分钟", |
| 93 | "每5分钟", |
| 94 | "每15分钟", |
| 95 | "每30分钟", |
| 96 | "每小时", |
| 97 | "每2小时", |
| 98 | "每6小时", |
| 99 | "每12小时", |
| 100 | "每天", |
| 101 | "每周", |
| 102 | "每月", |
| 103 | ]) |
| 104 | self.presetCombo.currentIndexChanged.connect(self.onPresetChanged) |
| 105 | presetLayout.addWidget(self.presetCombo, 1) |
| 106 | simpleLayout.addLayout(presetLayout) |
| 107 | |
| 108 | # 自定义时间选项(默认隐藏) |
| 109 | self.customTimeWidget = QWidget(self) |
| 110 | customTimeLayout = QGridLayout(self.customTimeWidget) |
| 111 | customTimeLayout.setContentsMargins(0, 0, 0, 0) |
| 112 | |
| 113 | customTimeLayout.addWidget(StrongBodyLabel("每隔:", self), 0, 0) |
| 114 | self.intervalSpin = SpinBox(self) |
| 115 | self.intervalSpin.setRange(1, 999) |
| 116 | self.intervalSpin.setValue(1) |
| 117 | customTimeLayout.addWidget(self.intervalSpin, 0, 1) |
| 118 | |
| 119 | self.unitCombo = ComboBox(self) |
| 120 | self.unitCombo.addItems(["分钟", "小时", "天"]) |
| 121 | customTimeLayout.addWidget(self.unitCombo, 0, 2) |
| 122 | |
| 123 | self.customTimeWidget.setVisible(False) |
| 124 | simpleLayout.addWidget(self.customTimeWidget) |
| 125 | |