Enable VibeChat UTUN service and package the Wintun driver
Add a settings button to open the current config in an external editor. Wait for core, UTUN and chat startup before reporting readiness; verify startup failures and restarts. Include Wintun DLL and license notices in Windows builds and installers.
This commit is contained in:
1 parent
bdb6bf80a4
commit
ffe563bb9f
13 files changed
+253
-26
No files matched your search
@@ -37,6 +37,10 @@ extern "C" {
|
||||
#include <QScrollArea>
|
||||
#include <QSpinBox>
|
||||
#include <QSettings>
|
||||
#include <QDesktopServices>
|
||||
#include <QFileInfo>
|
||||
#include <QProcess>
|
||||
#include <QUrl>
|
||||
|
||||
SettingsDialog::SettingsDialog(const QString& configPath, DbManager* db, UtunNode* node,
|
||||
AudioRecorder* recorder, QWidget* parent)
|
||||
@@ -246,6 +250,10 @@ SettingsDialog::SettingsDialog(const QString& configPath, DbManager* db, UtunNod
|
||||
// --- Bottom buttons ---
|
||||
auto* btnLayout = new QHBoxLayout();
|
||||
btnLayout->setSpacing(8);
|
||||
auto* editConfigBtn = new QPushButton(QCoreApplication::translate("ChatGui", "Edit config"), rightPanel);
|
||||
editConfigBtn->setObjectName(QStringLiteral("editConfig"));
|
||||
connect(editConfigBtn, &QPushButton::clicked, this, &SettingsDialog::onEditConfig);
|
||||
btnLayout->addWidget(editConfigBtn);
|
||||
btnLayout->addStretch();
|
||||
|
||||
auto* cancelBtn = new QPushButton(QCoreApplication::translate("ChatGui", "Cancel"), rightPanel);
|
||||
@@ -494,6 +502,30 @@ void SettingsDialog::onSave() {
|
||||
accept();
|
||||
}
|
||||
|
||||
void SettingsDialog::onEditConfig() {
|
||||
const QString path = QFileInfo(m_configPath).absoluteFilePath();
|
||||
#ifdef Q_OS_WIN
|
||||
QProcess editor;
|
||||
editor.setProgram(QStringLiteral("notepad.exe"));
|
||||
editor.setArguments({path});
|
||||
const bool opened = editor.startDetached();
|
||||
if (!opened) {
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_CONFIG, "Settings: cannot start Notepad path=%s error=%s", qPrintable(path), qPrintable(editor.errorString()));
|
||||
}
|
||||
#else
|
||||
const bool opened = QDesktopServices::openUrl(QUrl::fromLocalFile(path));
|
||||
if (!opened) {
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_CONFIG, "Settings: desktop service could not open config path=%s", qPrintable(path));
|
||||
}
|
||||
#endif
|
||||
if (!opened) {
|
||||
QMessageBox::warning(this, QCoreApplication::translate("ChatGui", "Edit config"),
|
||||
QCoreApplication::translate("ChatGui", "Could not open the configuration file in a text editor:\n%1").arg(path));
|
||||
return;
|
||||
}
|
||||
DEBUG_INFO(DEBUG_CATEGORY_CONFIG, "Settings: config editor launched path=%s", qPrintable(path));
|
||||
}
|
||||
|
||||
void SettingsDialog::onOpenConnMonitor() {
|
||||
if (m_connMonitorWindow) {
|
||||
m_connMonitorWindow->raise();
|
||||
|
||||
@@ -33,6 +33,8 @@ public:
|
||||
private slots:
|
||||
void onCategoryChanged(int row);
|
||||
void onSave();
|
||||
// Открывает текущий конфиг во внешнем текстовом редакторе; ошибки показывает пользователю.
|
||||
void onEditConfig();
|
||||
void onOpenConnMonitor();
|
||||
|
||||
private:
|
||||
|
||||
Reference in new issue
Block a user