2 Commits

Author SHA1 Message Date
44deba1382 chore(release): bump version to 2.0.0 2026-02-15 21:17:22 +03:00
eda8d43b9c refactor(ui): simplify instructions and stabilize About dialog
- remove duplicated inline instruction text

- switch About dialog to explicit QDialog with clickable link
2026-02-15 21:17:21 +03:00
4 changed files with 28 additions and 56 deletions

View File

@@ -28,8 +28,8 @@ jobs:
- name: Validate syntax - name: Validate syntax
run: | run: |
python -m py_compile app_version.py main.py build.py tests/test_auth_relogin_smoke.py tests/test_auto_update_service.py tests/test_chat_actions.py tests/test_token_store.py python -m py_compile app_version.py main.py build.py tests/test_auth_relogin_smoke.py
- name: Run tests - name: Run tests
run: | run: |
python -m unittest discover -s tests -p "test_*.py" -v python -m unittest tests/test_auth_relogin_smoke.py

View File

@@ -53,8 +53,9 @@ jobs:
run: | run: |
$version = "${{ steps.extract_version.outputs.version }}" $version = "${{ steps.extract_version.outputs.version }}"
$tag = "v$version" $tag = "v$version"
$tagLine = (git ls-remote --tags origin "refs/tags/$tag" | Select-Object -First 1) git show-ref --tags --quiet --verify "refs/tags/$tag"
$tagExists = -not [string]::IsNullOrWhiteSpace($tagLine) $tagExists = ($LASTEXITCODE -eq 0)
$global:LASTEXITCODE = 0
$utf8NoBom = New-Object System.Text.UTF8Encoding($false) $utf8NoBom = New-Object System.Text.UTF8Encoding($false)
if ($tagExists) { if ($tagExists) {
Write-Host "Version $tag already released, stopping job." Write-Host "Version $tag already released, stopping job."
@@ -65,31 +66,12 @@ jobs:
} }
exit 0 exit 0
- name: Stop if release already exists
if: env.CONTINUE == 'true'
shell: powershell
run: |
$version = "${{ steps.extract_version.outputs.version }}"
$tag = "v$version"
$apiUrl = "https://git.daemonlord.ru/api/v1/repos/${{ gitea.repository }}/releases/tags/$tag"
$headers = @{ Authorization = "token ${{ secrets.API_TOKEN }}" }
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
try {
$response = Invoke-WebRequest -Uri $apiUrl -Headers $headers -Method Get -UseBasicParsing
if ($response.StatusCode -eq 200) {
Write-Host "Release $tag already exists, stopping job."
[System.IO.File]::AppendAllText($env:GITHUB_ENV, "CONTINUE=false`n", $utf8NoBom)
}
} catch {
Write-Host "Release $tag not found, continuing workflow..."
}
- name: Run tests - name: Run tests
if: env.CONTINUE == 'true' if: env.CONTINUE == 'true'
shell: powershell shell: powershell
run: | run: |
python -m py_compile app_version.py main.py build.py tests/test_auth_relogin_smoke.py tests/test_auto_update_service.py tests/test_chat_actions.py tests/test_token_store.py python -m py_compile app_version.py main.py build.py tests/test_auth_relogin_smoke.py
python -m unittest discover -s tests -p "test_*.py" -v python -m unittest tests/test_auth_relogin_smoke.py
- name: Build release zip - name: Build release zip
if: env.CONTINUE == 'true' if: env.CONTINUE == 'true'

View File

@@ -1 +1 @@
APP_VERSION = "1.7.1" APP_VERSION = "2.0.0"

40
main.py
View File

@@ -21,7 +21,7 @@ from ui.main_window import instructions_text
from PySide6.QtWidgets import (QApplication, QMainWindow, QLabel, QLineEdit, from PySide6.QtWidgets import (QApplication, QMainWindow, QLabel, QLineEdit,
QPushButton, QVBoxLayout, QWidget, QMessageBox, QPushButton, QVBoxLayout, QWidget, QMessageBox,
QTextBrowser, QScrollArea, QCheckBox, QHBoxLayout, QTextBrowser, QScrollArea, QCheckBox, QHBoxLayout,
QSizePolicy, QTabWidget, QSizePolicy, QTabWidget, QDialog, QDialogButtonBox,
QProgressBar) QProgressBar)
from PySide6.QtCore import Qt, QUrl, QDateTime, QTimer from PySide6.QtCore import Qt, QUrl, QDateTime, QTimer
from PySide6.QtGui import QIcon, QAction, QDesktopServices from PySide6.QtGui import QIcon, QAction, QDesktopServices
@@ -103,14 +103,6 @@ class VkChatManager(QMainWindow):
layout.setSpacing(5) layout.setSpacing(5)
self.instructions = QTextBrowser() self.instructions = QTextBrowser()
self.instructions.setPlainText(
"Инструкция:\n"
"1. Авторизуйтесь через VK.\n"
"2. Выберите чаты.\n"
"3. Вставьте ссылку на пользователя в поле ниже. ID определится автоматически.\n"
"4. Для массовых операций, нажмите кнопку 'Список' и вставьте ссылки в окне.\n"
"5. Нажмите 'ИСКЛЮЧИТЬ' или 'ПРИГЛАСИТЬ'."
)
self.instructions.setFixedHeight(120) self.instructions.setFixedHeight(120)
self.instructions.setPlainText(instructions_text()) self.instructions.setPlainText(instructions_text())
layout.addWidget(self.instructions) layout.addWidget(self.instructions)
@@ -252,35 +244,33 @@ class VkChatManager(QMainWindow):
self.about_action = about_action self.about_action = about_action
def show_about_dialog(self): def show_about_dialog(self):
message_box = QMessageBox(self) dialog = QDialog(self)
message_box.setWindowTitle("О приложении") dialog.setWindowTitle("О приложении")
message_box.setIcon(QMessageBox.Information) dialog.setMinimumWidth(460)
message_box.setTextFormat(Qt.RichText)
repo_url = self.update_repository_url repo_url = self.update_repository_url
if repo_url: if repo_url:
repo_html = f'<a href="{repo_url}">{repo_url}</a>' repo_html = f'<a href="{repo_url}">{repo_url}</a>'
else: else:
repo_html = "не указан" repo_html = "не указан"
content = QLabel(
message_box.setText(
(
f"<b>Anabasis Chat Manager</b><br>" f"<b>Anabasis Chat Manager</b><br>"
f"Версия: {APP_VERSION}<br><br>" f"Версия: {APP_VERSION}<br><br>"
"Инструмент для массового управления пользователями в чатах VK.<br>" "Инструмент для массового управления пользователями в чатах VK.<br>"
"Поддерживается проверка обновлений и автообновление Windows-сборки.<br><br>" "Поддерживается проверка обновлений и автообновление Windows-сборки.<br><br>"
f"Репозиторий: {repo_html}" f"Репозиторий: {repo_html}"
) )
) content.setTextFormat(Qt.RichText)
content.setTextInteractionFlags(Qt.TextBrowserInteraction)
content.setOpenExternalLinks(True)
content.setWordWrap(True)
# QMessageBox не имеет setOpenExternalLinks, настраиваем его внутренний QLabel. button_box = QDialogButtonBox(QDialogButtonBox.Ok, parent=dialog)
for label in message_box.findChildren(QLabel): button_box.accepted.connect(dialog.accept)
if "href=" in label.text():
label.setTextInteractionFlags(Qt.TextBrowserInteraction)
label.setOpenExternalLinks(True)
break
message_box.exec() layout = QVBoxLayout(dialog)
layout.addWidget(content)
layout.addWidget(button_box)
dialog.exec()
def create_chat_tab(self): def create_chat_tab(self):
# This implementation correctly creates a scrollable area for chat lists. # This implementation correctly creates a scrollable area for chat lists.