Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 147988242f | |||
| 44deba1382 | |||
| eda8d43b9c | |||
| cf6d6bcbd0 | |||
| 61948a51c6 |
@@ -47,41 +47,39 @@ jobs:
|
||||
[System.IO.File]::AppendAllText($env:GITHUB_OUTPUT, "version=$version`n", $utf8NoBom)
|
||||
Write-Host "Detected version: $version"
|
||||
|
||||
- name: Stop if version already released
|
||||
id: stop
|
||||
- name: Initialize release flow
|
||||
id: flow_init
|
||||
shell: powershell
|
||||
run: |
|
||||
$version = "${{ steps.extract_version.outputs.version }}"
|
||||
$tag = "v$version"
|
||||
$tagLine = (git ls-remote --tags origin "refs/tags/$tag" | Select-Object -First 1)
|
||||
$tagExists = -not [string]::IsNullOrWhiteSpace($tagLine)
|
||||
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
|
||||
if ($tagExists) {
|
||||
Write-Host "Version $tag already released, stopping job."
|
||||
[System.IO.File]::AppendAllText($env:GITHUB_ENV, "CONTINUE=false`n", $utf8NoBom)
|
||||
} else {
|
||||
Write-Host "Version $tag not released yet, continuing workflow..."
|
||||
[System.IO.File]::AppendAllText($env:GITHUB_ENV, "CONTINUE=true`n", $utf8NoBom)
|
||||
}
|
||||
[System.IO.File]::AppendAllText($env:GITHUB_ENV, "CONTINUE=true`n", $utf8NoBom)
|
||||
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"
|
||||
$apiUrl = "https://git.daemonlord.ru/api/v1/repos/${{ gitea.repository }}/releases?page=1&limit=100"
|
||||
$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) {
|
||||
$response = Invoke-RestMethod -Uri $apiUrl -Headers $headers -Method Get
|
||||
$found = $false
|
||||
foreach ($release in $response) {
|
||||
if ($release.tag_name -eq $tag) {
|
||||
$found = $true
|
||||
break
|
||||
}
|
||||
}
|
||||
if ($found) {
|
||||
Write-Host "Release $tag already exists, stopping job."
|
||||
[System.IO.File]::AppendAllText($env:GITHUB_ENV, "CONTINUE=false`n", $utf8NoBom)
|
||||
} else {
|
||||
Write-Host "Release $tag not found, continuing workflow..."
|
||||
}
|
||||
} catch {
|
||||
Write-Host "Release $tag not found, continuing workflow..."
|
||||
Write-Host "Failed to query releases list, continuing workflow..."
|
||||
}
|
||||
|
||||
- name: Run tests
|
||||
@@ -132,8 +130,13 @@ jobs:
|
||||
run: |
|
||||
$version = "${{ steps.extract_version.outputs.version }}"
|
||||
$tag = "v$version"
|
||||
git tag "$tag"
|
||||
git push origin "$tag"
|
||||
$tagLine = (git ls-remote --tags origin "refs/tags/$tag" | Select-Object -First 1)
|
||||
if ([string]::IsNullOrWhiteSpace($tagLine)) {
|
||||
git tag "$tag"
|
||||
git push origin "$tag"
|
||||
} else {
|
||||
Write-Host "Tag $tag already exists on origin, skipping tag push."
|
||||
}
|
||||
|
||||
- name: Create Gitea Release
|
||||
if: env.CONTINUE == 'true'
|
||||
|
||||
@@ -1 +1 @@
|
||||
APP_VERSION = "1.7.1"
|
||||
APP_VERSION = "2.0.0"
|
||||
|
||||
50
main.py
50
main.py
@@ -21,7 +21,7 @@ from ui.main_window import instructions_text
|
||||
from PySide6.QtWidgets import (QApplication, QMainWindow, QLabel, QLineEdit,
|
||||
QPushButton, QVBoxLayout, QWidget, QMessageBox,
|
||||
QTextBrowser, QScrollArea, QCheckBox, QHBoxLayout,
|
||||
QSizePolicy, QTabWidget,
|
||||
QSizePolicy, QTabWidget, QDialog, QDialogButtonBox,
|
||||
QProgressBar)
|
||||
from PySide6.QtCore import Qt, QUrl, QDateTime, QTimer
|
||||
from PySide6.QtGui import QIcon, QAction, QDesktopServices
|
||||
@@ -103,14 +103,6 @@ class VkChatManager(QMainWindow):
|
||||
layout.setSpacing(5)
|
||||
|
||||
self.instructions = QTextBrowser()
|
||||
self.instructions.setPlainText(
|
||||
"Инструкция:\n"
|
||||
"1. Авторизуйтесь через VK.\n"
|
||||
"2. Выберите чаты.\n"
|
||||
"3. Вставьте ссылку на пользователя в поле ниже. ID определится автоматически.\n"
|
||||
"4. Для массовых операций, нажмите кнопку 'Список' и вставьте ссылки в окне.\n"
|
||||
"5. Нажмите 'ИСКЛЮЧИТЬ' или 'ПРИГЛАСИТЬ'."
|
||||
)
|
||||
self.instructions.setFixedHeight(120)
|
||||
self.instructions.setPlainText(instructions_text())
|
||||
layout.addWidget(self.instructions)
|
||||
@@ -252,35 +244,33 @@ class VkChatManager(QMainWindow):
|
||||
self.about_action = about_action
|
||||
|
||||
def show_about_dialog(self):
|
||||
message_box = QMessageBox(self)
|
||||
message_box.setWindowTitle("О приложении")
|
||||
message_box.setIcon(QMessageBox.Information)
|
||||
message_box.setTextFormat(Qt.RichText)
|
||||
|
||||
dialog = QDialog(self)
|
||||
dialog.setWindowTitle("О приложении")
|
||||
dialog.setMinimumWidth(460)
|
||||
repo_url = self.update_repository_url
|
||||
if repo_url:
|
||||
repo_html = f'<a href="{repo_url}">{repo_url}</a>'
|
||||
else:
|
||||
repo_html = "не указан"
|
||||
|
||||
message_box.setText(
|
||||
(
|
||||
f"<b>Anabasis Chat Manager</b><br>"
|
||||
f"Версия: {APP_VERSION}<br><br>"
|
||||
"Инструмент для массового управления пользователями в чатах VK.<br>"
|
||||
"Поддерживается проверка обновлений и автообновление Windows-сборки.<br><br>"
|
||||
f"Репозиторий: {repo_html}"
|
||||
)
|
||||
content = QLabel(
|
||||
f"<b>Anabasis Chat Manager</b><br>"
|
||||
f"Версия: {APP_VERSION}<br><br>"
|
||||
"Инструмент для массового управления пользователями в чатах VK.<br>"
|
||||
"Поддерживается проверка обновлений и автообновление Windows-сборки.<br><br>"
|
||||
f"Репозиторий: {repo_html}"
|
||||
)
|
||||
content.setTextFormat(Qt.RichText)
|
||||
content.setTextInteractionFlags(Qt.TextBrowserInteraction)
|
||||
content.setOpenExternalLinks(True)
|
||||
content.setWordWrap(True)
|
||||
|
||||
# QMessageBox не имеет setOpenExternalLinks, настраиваем его внутренний QLabel.
|
||||
for label in message_box.findChildren(QLabel):
|
||||
if "href=" in label.text():
|
||||
label.setTextInteractionFlags(Qt.TextBrowserInteraction)
|
||||
label.setOpenExternalLinks(True)
|
||||
break
|
||||
button_box = QDialogButtonBox(QDialogButtonBox.Ok, parent=dialog)
|
||||
button_box.accepted.connect(dialog.accept)
|
||||
|
||||
message_box.exec()
|
||||
layout = QVBoxLayout(dialog)
|
||||
layout.addWidget(content)
|
||||
layout.addWidget(button_box)
|
||||
dialog.exec()
|
||||
|
||||
def create_chat_tab(self):
|
||||
# This implementation correctly creates a scrollable area for chat lists.
|
||||
|
||||
Reference in New Issue
Block a user