Skip to content

Commit

Permalink
v9.28.11
Browse files Browse the repository at this point in the history
[MacOS]修复MacOS系统下,无法正常启动BUG,目前只测试MacOS13.5.1 intel版本。
[历史会话]优化删除会话时,同步删除相应的访问历史。
[SFTP]优化远程文件夹的图标显示。
[SFTP]优化不同系统下的远程文件默认编辑工具。
[RDP]修复Linux系统下的VNC文字复制和粘贴BUG。

[MacOS]Fixed a bug that could not start properly on the MacOS system. Currently, only the MacOS 13.5.1 Intel version is being tested.
[Session history]When optimizing the deletion of a session, synchronize the deletion of the corresponding access history.
[SFTP] Optimize the icon display of remote folders.
[SFTP] Optimize default editing tools for remote files under different systems.
[RDP] Fix VNC text copy and paste bugs in Linux systems.
  • Loading branch information
getwingm committed Sep 14, 2023
1 parent a4e80a3 commit 4c34b87
Show file tree
Hide file tree
Showing 26 changed files with 1,573 additions and 922 deletions.
777 changes: 485 additions & 292 deletions private/languages/woterm_zh.ts

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions woterm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,10 @@ set(SOURCE_FILES
qwodbgroupmergemodel.cpp
qwodbservermergemodel.cpp
qwodbsftpdownlistdialog.cpp
qwodbbackupdialog.cpp
qwodbsftpdetaildialog.cpp
qwodbrestoredialog.cpp
qwodbbackupdialog.cpp
qwodbpowerbackupdialog.cpp
qwodbpowerrestoredialog.cpp
qwobindportpermissiondialog.cpp
qwogroupinputdialog.cpp
Expand Down Expand Up @@ -313,9 +314,10 @@ set(HEADER_FILES
qwodbgroupmergemodel.h
qwodbservermergemodel.h
qwodbsftpdownlistdialog.h
qwodbbackupdialog.h
qwodbsftpdetaildialog.h
qwodbrestoredialog.h
qwodbbackupdialog.h
qwodbpowerbackupdialog.h
qwodbpowerrestoredialog.h
qwobindportpermissiondialog.h
qwogroupinputdialog.h
Expand Down Expand Up @@ -426,9 +428,10 @@ set(OTHER_FILES
qwosftpmovefiledialog.ui
qwovnctoolform.ui
qwovncftpwidget.ui
qwodbbackupdialog.ui
qwodbsftpdetaildialog.ui
qwodbrestoredialog.ui
qwodbbackupdialog.ui
qwodbpowerbackupdialog.ui
qwodbpowerrestoredialog.ui
qwoplaybookconsole.ui
qwobindportpermissiondialog.ui
Expand Down
239 changes: 78 additions & 161 deletions woterm/qwodbbackupdialog.cpp
Original file line number Diff line number Diff line change
@@ -1,161 +1,78 @@
/*******************************************************************************************
*
* Copyright (C) 2022 Guangzhou AoYiDuo Network Technology Co.,Ltd. All Rights Reserved.
*
* Contact: http://www.aoyiduo.com
*
* this file is used under the terms of the GPLv3[GNU GENERAL PUBLIC LICENSE v3]
* more information follow the website: https://www.gnu.org/licenses/gpl-3.0.en.html
*
*******************************************************************************************/

#include "qwodbbackupdialog.h"
#include "ui_qwodbbackupdialog.h"
#include "qwodbsftpdetaildialog.h"
#include "qwosetting.h"
#include "qkxmessagebox.h"
#include "qwosshconf.h"
#include "qwodbsftpuploadsync.h"

#include <QStringListModel>
#include <QTimer>
#include <QFileDialog>
#include <QFileInfo>

QWoDbBackupDialog::QWoDbBackupDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::QWoDbBackupDialog)
{
Qt::WindowFlags flags = windowFlags();
setWindowFlags(flags &~Qt::WindowContextHelpButtonHint);
ui->setupUi(this);
setWindowTitle(tr("Database backup"));
ui->backupType->setModel(new QStringListModel(QStringList() << tr("sftp server") << tr("local file"), this));
QObject::connect(ui->backupType, SIGNAL(currentIndexChanged(int)), this, SLOT(onCurrentIndexChanged()));
onCurrentIndexChanged();
QStringList crypts;
crypts.append("AES-CBC-256");
crypts.append("AES-CTR-256");
crypts.append("AES-GCM-256");
crypts.append("DES-CBC");
crypts.append("DES-ECB");
crypts.append("DES-OFB64");
crypts.append("RC4");
crypts.append("Blowfish");
ui->cryptType->setModel(new QStringListModel(crypts, this));
ui->sftpServer->setReadOnly(true);
QObject::connect(ui->btnSftpDetail, SIGNAL(clicked()), this, SLOT(onSftpDetailButtonClicked()));

QString lastFile = QWoSetting::value("DBBackup/lastLocalFile").toString();
ui->pathLocal->setText(lastFile);
ui->pathLocal->setReadOnly(true);

QString cryptType = QWoSetting::value("DBBackup/lastCryptType").toString();
if(cryptType.isEmpty()) {
ui->cryptType->setCurrentIndex(0);
}else{
ui->cryptType->setCurrentText(cryptType);
}
QString cryptKey = QWoSetting::value("DBBackup/lastCryptKey").toString();
ui->cryptKey->setText(cryptKey);

resetSftpUrl();

QObject::connect(ui->btnSave, SIGNAL(clicked()), this, SLOT(onFileSaveClicked()));
QObject::connect(ui->btnBrowser, SIGNAL(clicked()), this, SLOT(onFileBrowserClicked()));
QObject::connect(ui->btnUpload, SIGNAL(clicked()), this, SLOT(onFileUploadClicked()));
}

QWoDbBackupDialog::~QWoDbBackupDialog()
{
delete ui;
}

void QWoDbBackupDialog::onCurrentIndexChanged()
{
int idx = ui->backupType->currentIndex();
if(idx == 0) {
// sftp server.
ui->sftpArea->show();
ui->localArea->hide();
}else{
ui->sftpArea->hide();
ui->localArea->show();
}
QTimer::singleShot(0, this, SLOT(onAdjustLayout()));
}

void QWoDbBackupDialog::onAdjustLayout()
{
adjustSize();
}

void QWoDbBackupDialog::onSftpDetailButtonClicked()
{
QWoDbSftpDetailDialog dlg(this);
if(dlg.exec() == (QDialog::Accepted + 1)) {
resetSftpUrl();
}
}

void QWoDbBackupDialog::onFileSaveClicked()
{
QString lastFile = ui->pathLocal->text();
if(lastFile.isEmpty()) {
QKxMessageBox::information(this, tr("Parameter error"), tr("the local file should not be empty."));
return;
}
QWoSetting::setValue("DBBackup/lastLocalFile", lastFile);
if(!QWoSshConf::instance()->backup(lastFile)) {
QKxMessageBox::warning(this, tr("Failure"), tr("failed to backup the database."));
}else{
QKxMessageBox::information(this, tr("Success"), tr("success to backup the file."));
}
}

void QWoDbBackupDialog::onFileUploadClicked()
{
QString cryptType = ui->cryptType->currentText();
QString cryptKey = ui->cryptKey->text();
if(cryptKey.isEmpty()) {
QKxMessageBox::information(this, tr("Parameter error"), tr("the encryption key should not be empty."));
return;
}
QWoSetting::setValue("DBBackup/lastCryptType", cryptType);
QWoSetting::setValue("DBBackup/lastCryptKey", cryptKey);

if(m_sync == nullptr) {
m_sync = new QWoDBSftpUploadSync(this);
QObject::connect(m_sync, SIGNAL(infoArrived(int,int,QString)), this, SLOT(onInfoArrived(int,int,QString)));
}
m_sync->upload(cryptType, cryptKey);
}

void QWoDbBackupDialog::onFileBrowserClicked()
{
QString path = ui->pathLocal->text();
QString fileName = QFileDialog::getSaveFileName(this, tr("Save database file"), path, tr("SQLite (*.db)"));
if(fileName.isEmpty()) {
return;
}
if(!fileName.endsWith(".db")) {
fileName += ".db";
}
ui->pathLocal->setText(fileName);
}

void QWoDbBackupDialog::onInfoArrived(int action, int err, const QString &errDesc)
{
ui->info->setText(errDesc);
}

void QWoDbBackupDialog::resetSftpUrl()
{
QVariantMap dm = QWoSetting::value("DBBackup/sftpDetail").toMap();
QString host = dm.value("host").toString();
QString name = dm.value("name").toString();
QString path = dm.value("path", "~/woterm_db_backup").toString();
QString port = dm.value("port", 22).toString();
QString url = QString("sftp://%1@%2:%3?port=%4").arg(name, host, path, port);
ui->sftpServer->setText(url);
}
/*******************************************************************************************
*
* Copyright (C) 2023 Guangzhou AoYiDuo Network Technology Co.,Ltd. All Rights Reserved.
*
* Contact: http://www.aoyiduo.com
*
* this file is used under the terms of the GPLv3[GNU GENERAL PUBLIC LICENSE v3]
* more information follow the website: https://www.gnu.org/licenses/gpl-3.0.en.html
*
*******************************************************************************************/

#include "qwodbbackupdialog.h"
#include "ui_qwodbbackupdialog.h"

#include "qkxbuttonassist.h"

#include "qwosetting.h"
#include "qwosshconf.h"
#include "qkxmessagebox.h"

#include <QFileDialog>
#include <QDebug>

QWoDbBackupDialog::QWoDbBackupDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::QWoDbBackupDialog)
{
ui->setupUi(this);
setWindowTitle(tr("Database backup"));
Qt::WindowFlags flags = windowFlags();
setWindowFlags(flags &~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Database Restore"));

ui->filePath->setReadOnly(true);
QKxButtonAssist *assist = new QKxButtonAssist("../private/skins/black/folder.png", ui->filePath);
QObject::connect(assist, SIGNAL(clicked(int)), this, SLOT(onAssistButtonClicked(int)));
QObject::connect(ui->btnBackup, SIGNAL(clicked()), this, SLOT(onBackupButtonClicked()));
QObject::connect(ui->btnClose, SIGNAL(clicked()), this, SLOT(close()));
adjustSize();
}

QWoDbBackupDialog::~QWoDbBackupDialog()
{
delete ui;
}

void QWoDbBackupDialog::onBackupButtonClicked()
{
QString fileName = ui->filePath->text();
if(fileName.isEmpty()) {
QKxMessageBox::warning(this, tr("Information"), tr("Input a file path to backup."));
return;
}
if(!fileName.endsWith(".db")) {
fileName += ".db";
}
QFileInfo fi(fileName);
QString last = fi.absolutePath();
QWoSetting::setLastBackupPath(last);
if(!QWoSshConf::instance()->backup(fileName)) {
QKxMessageBox::warning(this, tr("Failure"), tr("failed to backup the session list."));
return;
}
QKxMessageBox::warning(this, tr("Success"), tr("backup success."));
}

void QWoDbBackupDialog::onAssistButtonClicked(int idx)
{
QString path = QWoSetting::lastBackupPath();
QString fileName = QFileDialog::getSaveFileName(this, tr("Backup Session Database"), path, "SQLite3 (*.db)");
if(fileName.isEmpty()) {
return;
}
if(!fileName.endsWith(".db")) {
fileName += ".db";
}
ui->filePath->setText(QDir::toNativeSeparators(fileName));
}
83 changes: 37 additions & 46 deletions woterm/qwodbbackupdialog.h
Original file line number Diff line number Diff line change
@@ -1,46 +1,37 @@
/*******************************************************************************************
*
* Copyright (C) 2022 Guangzhou AoYiDuo Network Technology Co.,Ltd. All Rights Reserved.
*
* Contact: http://www.aoyiduo.com
*
* this file is used under the terms of the GPLv3[GNU GENERAL PUBLIC LICENSE v3]
* more information follow the website: https://www.gnu.org/licenses/gpl-3.0.en.html
*
*******************************************************************************************/

#ifndef QWODBBACKUPDIALOG_H
#define QWODBBACKUPDIALOG_H

#include <QDialog>
#include <QPointer>

namespace Ui {
class QWoDbBackupDialog;
}

class QWoDBSftpUploadSync;
class QWoDbBackupDialog : public QDialog
{
Q_OBJECT

public:
explicit QWoDbBackupDialog(QWidget *parent = nullptr);
~QWoDbBackupDialog();

private slots:
void onCurrentIndexChanged();
void onAdjustLayout();
void onSftpDetailButtonClicked();
void onFileSaveClicked();
void onFileUploadClicked();
void onFileBrowserClicked();
void onInfoArrived(int action, int err, const QString& errDesc);
private:
void resetSftpUrl();
private:
Ui::QWoDbBackupDialog *ui;
QPointer<QWoDBSftpUploadSync> m_sync;
};

#endif // QWODBBACKUPDIALOG_H
/*******************************************************************************************
*
* Copyright (C) 2023 Guangzhou AoYiDuo Network Technology Co.,Ltd. All Rights Reserved.
*
* Contact: http://www.aoyiduo.com
*
* this file is used under the terms of the GPLv3[GNU GENERAL PUBLIC LICENSE v3]
* more information follow the website: https://www.gnu.org/licenses/gpl-3.0.en.html
*
*******************************************************************************************/


#ifndef QWODBBACKUPDIALOG_H
#define QWODBBACKUPDIALOG_H

#include <QDialog>

namespace Ui {
class QWoDbBackupDialog;
}

class QWoDbBackupDialog : public QDialog
{
Q_OBJECT

public:
explicit QWoDbBackupDialog(QWidget *parent = nullptr);
~QWoDbBackupDialog();

private slots:
void onBackupButtonClicked();
void onAssistButtonClicked(int idx);
private:
Ui::QWoDbBackupDialog *ui;
};

#endif // QWODBBACKUPDIALOG_H
Loading

0 comments on commit 4c34b87

Please sign in to comment.