Fix settings drafts, enlarge avatars, and show desktop version
This commit is contained in:
1 parent
f408abcf4e
commit
efebf8c5e8
5 files changed
+14
-8
No files matched your search
@@ -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"));
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in new issue
Block a user