From efebf8c5e807d3e8982e82147f90d35b9836a1e9 Mon Sep 17 00:00:00 2001 From: evgeny Date: Thu, 8 Oct 2026 00:04:41 +0200 Subject: [PATCH] Fix settings drafts, enlarge avatars, and show desktop version --- .../utun/chat/ui/components/ConversationMessages.kt | 4 ++-- tools/chatgui/CMakeLists.txt | 2 +- tools/chatgui/src/channellist.cpp | 4 ++++ tools/chatgui/src/main.cpp | 2 ++ tools/chatgui/src/settingsdialog.cpp | 10 +++++----- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/tools/chatgui-android/app/src/main/java/com/utun/chat/ui/components/ConversationMessages.kt b/tools/chatgui-android/app/src/main/java/com/utun/chat/ui/components/ConversationMessages.kt index 1f41b0e2..54ebb8de 100644 --- a/tools/chatgui-android/app/src/main/java/com/utun/chat/ui/components/ConversationMessages.kt +++ b/tools/chatgui-android/app/src/main/java/com/utun/chat/ui/components/ConversationMessages.kt @@ -84,7 +84,7 @@ fun ConversationMessages(target: ConversationTarget, messages: List, st val group = (target as? ConversationTarget.Channel)?.id Row(Modifier.fillMaxWidth(), verticalAlignment = Alignment.Bottom) { if (!message.isOutgoing) UserAvatar(group, message.authorNodeId, message.author, - modifier = Modifier.padding(start = 8.dp, bottom = 4.dp), size = 32.dp) + modifier = Modifier.padding(start = 8.dp, bottom = 4.dp), size = 54.4.dp) Box(Modifier.weight(1f)) { Column { val footer: @Composable () -> Unit = { @@ -98,7 +98,7 @@ fun ConversationMessages(target: ConversationTarget, messages: List, st } } if (message.isOutgoing) UserAvatar(group, message.authorNodeId, message.author, - modifier = Modifier.padding(end = 8.dp, bottom = 4.dp), size = 32.dp) + modifier = Modifier.padding(end = 8.dp, bottom = 4.dp), size = 54.4.dp) } } } diff --git a/tools/chatgui/CMakeLists.txt b/tools/chatgui/CMakeLists.txt index 68cc1937..4bed0cfc 100644 --- a/tools/chatgui/CMakeLists.txt +++ b/tools/chatgui/CMakeLists.txt @@ -216,7 +216,7 @@ add_executable(vibechat add_dependencies(vibechat chatgui_translations) target_include_directories(vibechat PRIVATE ${CMAKE_SOURCE_DIR}/../../lib ${CMAKE_SOURCE_DIR}/../../src ${CMAKE_SOURCE_DIR}/db ${CMAKE_SOURCE_DIR}/../../lib/libopus/include ${FFMPEG_INCLUDE_DIRS}) -target_compile_definitions(vibechat PRIVATE SQLITE_THREADSAFE=1 USE_SQLITE) +target_compile_definitions(vibechat PRIVATE SQLITE_THREADSAFE=1 USE_SQLITE VIBECHAT_VERSION="${PROJECT_VERSION}") # Лицензии лежат рядом с бинарником при сборке и устанавливаются с приложением. set(UTUN_LICENSE_FILES diff --git a/tools/chatgui/src/channellist.cpp b/tools/chatgui/src/channellist.cpp index 43f3bb94..bbb33796 100644 --- a/tools/chatgui/src/channellist.cpp +++ b/tools/chatgui/src/channellist.cpp @@ -199,6 +199,10 @@ ChannelList::ChannelList(DbManager* db, QWidget *parent) fl->addStretch(); + auto* versionLabel = new QLabel(QStringLiteral("v%1").arg(QCoreApplication::applicationVersion()), footer); + versionLabel->setStyleSheet("font-size: 10px; color: palette(mid);"); + fl->addWidget(versionLabel); + auto *createBtn = new QPushButton(QCoreApplication::translate("ChatGui", "GRP"), footer); createBtn->setFixedSize(36, 28); createBtn->setToolTip(QCoreApplication::translate("ChatGui", "Create group")); diff --git a/tools/chatgui/src/main.cpp b/tools/chatgui/src/main.cpp index 60d9a250..ede51b60 100644 --- a/tools/chatgui/src/main.cpp +++ b/tools/chatgui/src/main.cpp @@ -79,6 +79,7 @@ int main(int argc, char *argv[]) { #endif QApplication app(argc, argv); app.setApplicationName("vibechat"); + app.setApplicationVersion(QStringLiteral(VIBECHAT_VERSION)); app.setDesktopFileName("org.utun.vibechat"); app.setWindowIcon(QIcon(":/icons/app_icon.png")); app.setQuitOnLastWindowClosed(false); @@ -181,6 +182,7 @@ int main(int argc, char *argv[]) { QString lvl = cfg.debugLevel().trimmed(); if (lvl.isEmpty()) lvl = QStringLiteral("info"); debug_apply_global_level(lvl.toUtf8().constData()); + DEBUG_INFO(DEBUG_CATEGORY_GENERAL, "vibechat: version=%s", qPrintable(app.applicationVersion())); DEBUG_INFO(DEBUG_CATEGORY_CONFIG, "GUI language: preference=%s system=%s selected=%s", qPrintable(cfg.language()), qPrintable(QLocale::system().uiLanguages().join(',')), qPrintable(language)); diff --git a/tools/chatgui/src/settingsdialog.cpp b/tools/chatgui/src/settingsdialog.cpp index 48e9dca8..33e87387 100644 --- a/tools/chatgui/src/settingsdialog.cpp +++ b/tools/chatgui/src/settingsdialog.cpp @@ -245,7 +245,7 @@ SettingsDialog::SettingsDialog(const QString& configPath, DbManager* db, UtunNod connect(m_categoryList, &QListWidget::currentRowChanged, this, &SettingsDialog::onCategoryChanged); - // Load current values + // Черновик всех редактируемых страниц загружаем один раз на время жизни диалога. loadProfileFromConfig(m_configPath); if (db) { int sortMode = db->getUiStateInt("channel_sort", 0); @@ -255,7 +255,9 @@ SettingsDialog::SettingsDialog(const QString& configPath, DbManager* db, UtunNod m_autoConnectCheck->setChecked(db->getUiStateInt("group_autoconnect", 1) != 0); } m_networkPage->loadFromConfig(m_configPath); + m_storagePage->loadFromDb(); m_soundPage->loadFromDb(); + DEBUG_DEBUG(DEBUG_CATEGORY_CONFIG, "Settings: draft initialized; editable pages retain values until Save or Cancel"); m_categoryList->setCurrentRow(0); } @@ -276,13 +278,11 @@ void SettingsDialog::loadProfileFromConfig(const QString& path) { void SettingsDialog::onCategoryChanged(int row) { m_pages->setCurrentIndex(row); - if (row == 1) m_storagePage->loadFromDb(); + DEBUG_DEBUG(DEBUG_CATEGORY_CONFIG, "Settings: selected page=%d; draft retained", row); + // При переключении обновляем только диагностические страницы. if (row == 4) m_databasePage->refreshStatus(); if (row == 5) m_statusPage->refreshStatus(); if (row == 6) m_nodesPage->refreshNodes(); - if (row == 7) m_soundPage->loadFromDb(); - if (row == 8) m_audioDevicePage->loadFromDb(); - if (row == 9) m_radioPage->loadFromDb(); } void SettingsDialog::onSave() {