refactor(navigation): simplify main tab labels
This commit is contained in:
@@ -100,7 +100,7 @@ class MainWindow(QMainWindow):
|
||||
self.setWindowTitle(display_name())
|
||||
_fit_and_center_window(self)
|
||||
self.setStyleSheet(BUTTON_BASE_STYLE)
|
||||
self._settings_tab_index = TAB_TITLES.index("⑤ 设置")
|
||||
self._settings_tab_index = TAB_TITLES.index("设置")
|
||||
self._last_tab_index = 0
|
||||
self._reverting_tab_change = False
|
||||
self.tabs = QTabWidget()
|
||||
@@ -109,7 +109,6 @@ class MainWindow(QMainWindow):
|
||||
self.tabs.currentChanged.connect(self._on_tab_changed)
|
||||
for title in TAB_TITLES:
|
||||
self.tabs.addTab(self._build_tab(title), title)
|
||||
self.tabs.setTabIcon(TAB_TITLES.index("③ 更新蝦皮"), _warning_dot_icon())
|
||||
self.setCentralWidget(self.tabs)
|
||||
self.show_status("就绪", level="muted")
|
||||
if startup_status:
|
||||
@@ -153,20 +152,20 @@ class MainWindow(QMainWindow):
|
||||
open_accounts_callback=lambda: self.open_accounts_tab(),
|
||||
open_settings_callback=lambda: self.open_settings_tab(),
|
||||
)
|
||||
if title == "④ 账号管理":
|
||||
if title == "账号管理":
|
||||
return AccountsTab(
|
||||
db_path=self.db_path,
|
||||
config=self.config,
|
||||
status_callback=self.show_status,
|
||||
)
|
||||
if title == "⑤ 设置":
|
||||
if title == "设置":
|
||||
return SettingsTab(
|
||||
config=self.config,
|
||||
config_path=self.config_path,
|
||||
ai_models_path=self.ai_models_path,
|
||||
status_callback=self.show_status,
|
||||
)
|
||||
if title == "⑥ 商品套图":
|
||||
if title == "商品套图":
|
||||
return ProductSuiteTab(
|
||||
db_path=self.db_path,
|
||||
config=self.config,
|
||||
@@ -209,7 +208,7 @@ class MainWindow(QMainWindow):
|
||||
return True
|
||||
box = QMessageBox(self)
|
||||
box.setWindowTitle("未保存更改")
|
||||
box.setText("⑤ 设置有未保存更改。要先保存再离开吗?")
|
||||
box.setText("设置有未保存更改。要先保存再离开吗?")
|
||||
save_button = box.addButton("保存", QMessageBox.AcceptRole)
|
||||
discard_button = box.addButton("放弃", QMessageBox.DestructiveRole)
|
||||
box.addButton("取消", QMessageBox.RejectRole)
|
||||
@@ -229,7 +228,7 @@ class MainWindow(QMainWindow):
|
||||
event.ignore()
|
||||
|
||||
def open_accounts_tab(self):
|
||||
self.tabs.setCurrentIndex(TAB_TITLES.index("④ 账号管理"))
|
||||
self.tabs.setCurrentIndex(TAB_TITLES.index("账号管理"))
|
||||
|
||||
def open_settings_tab(self):
|
||||
self.tabs.setCurrentIndex(TAB_TITLES.index("⑤ 设置"))
|
||||
self.tabs.setCurrentIndex(TAB_TITLES.index("设置"))
|
||||
|
||||
Reference in New Issue
Block a user