From f228711a16cbfeff4ff99f5d4ec87ba861f487f4 Mon Sep 17 00:00:00 2001 From: "wingo.he" Date: Mon, 23 Oct 2023 23:43:08 +0800 Subject: [PATCH] =?UTF-8?q?v9.29.2=20[SFTP]=E7=BC=96=E8=BE=91=E6=96=87?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=BC=B9=E6=B3=A1=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E5=B9=B6=E5=90=8C=E6=AD=A5=E5=92=8C=E5=BC=B9=E6=A1=86?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E5=B9=B6=E7=A1=AE=E8=AE=A4=E6=89=8D=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E4=B8=A4=E7=A7=8D=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=82=20[SSH]=E4=BF=AE=E5=A4=8D=E9=BB=98=E8=AE=A4=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD~/.ssh/config=20=E5=92=8C=20/etc/ssh/ssh=5Fconfig?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E9=85=8D=E7=BD=AE=EF=BC=8C=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E5=BC=82=E5=B8=B8=E7=BC=BA=E9=99=B7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [SFTP] Edit the file, add bubble prompt and synchronize, and optimize the two functions of pop-up prompt and confirm before synchronizing. [SSH] Fix default loading~/. ssh/config and/etc/ssh/ssh_ Configuration of the config system resulted in abnormal connection defects. --- private/languages/woterm_zh.ts | 305 +++++++++++++++++-------------- woterm/CMakeLists.txt | 5 + woterm/qkxbubblesyncwidget.cpp | 128 +++++++++++++ woterm/qkxbubblesyncwidget.h | 56 ++++++ woterm/qkxbubblesyncwidget.ui | 93 ++++++++++ woterm/qkxplaintextedit.cpp | 68 +++++++ woterm/qkxplaintextedit.h | 37 ++++ woterm/qwosessionftpproperty.cpp | 18 ++ woterm/qwosessionftpproperty.ui | 18 +- woterm/qwosftpwidget.cpp | 56 +++++- woterm/qwosftpwidget.h | 4 + woterm/resource/images/close.png | Bin 0 -> 4076 bytes woterm/version.h | 2 +- woterm/woterm.qrc | 1 + 14 files changed, 645 insertions(+), 146 deletions(-) create mode 100644 woterm/qkxbubblesyncwidget.cpp create mode 100644 woterm/qkxbubblesyncwidget.h create mode 100644 woterm/qkxbubblesyncwidget.ui create mode 100644 woterm/qkxplaintextedit.cpp create mode 100644 woterm/qkxplaintextedit.h create mode 100644 woterm/resource/images/close.png diff --git a/private/languages/woterm_zh.ts b/private/languages/woterm_zh.ts index c41d250..9bc6be7 100644 --- a/private/languages/woterm_zh.ts +++ b/private/languages/woterm_zh.ts @@ -1091,6 +1091,19 @@ 校验失败 + + QKxBubbleSyncWidget + + + Form + 表单 + + + + title + 标题 + + QKxCombineKeyActionDialog @@ -7580,53 +7593,63 @@ Please input password to activate it. 自动添加默认编辑器。 - + + Pop up the dialog box to confirm whether to synchronize the modified file. + 弹出对话框,确认是否同步修改后的文件。 + + + + Bubble prompt on the bottom right screen and synchronize the modified files. + 在右下角屏幕上弹出气泡提示并同步修改后的文件。 + + + Attempt to load the specified application based on the priority from small to large. 根据优先级从小到大,尝试加载指定的应用程序。 - + Add 增加 - + Modify 修改 - + Remove 移除 - + Use it 使用它 - + Close 关闭 - + File association 文件关联 - - + + Application error 应用程序错误 - + Select an item to apply 选择一项去应用 - + It is not a valid executable program 不是有效的可执行程序 @@ -9767,18 +9790,18 @@ Please input password to activate it. 刷新文件夹 - - + + The directory is out of sync with the terminal. 文件夹不与终端同步 - + Reject request 拒绝请求 - + Please wait until the current task is completed. 请等待当前任务完成。 @@ -9791,61 +9814,72 @@ Please input password to activate it. 请先在工具选项对话框中配置文本编辑工具。 - - + + File error 文件错误 - - + + The temp file has been lost. 临时文件已经丢失。 - - - - + + + + Open file 打开文件 - - - + + + Failed to open: 打开失败: - + + Ready to submit file: %1 + 准备同步文件:%1 + + + + + File synchronization + 文件同步 + + + Modify information 修改信息 - + The content has been modified. Do you need to submit it to the server? 内容已被修改。您需要将其提交到服务器吗? - - + + the follow files has exist or version restrictions: 以下文件已经存在或版本限制: - + Upload task 上传任务 - + Do you want to upload this related file? 是否继续上传相关文件? - - + + Select all 选择所有 @@ -9854,16 +9888,16 @@ Please input password to activate it. 返回 - - - - + + + + Refresh 刷新 - - + + Home Directory 返回主文件夹 @@ -9872,15 +9906,15 @@ Please input password to activate it. 创建文件夹 - - - + + + Upload 上传 - - + + Deselect all 取消所选 @@ -9889,14 +9923,14 @@ Please input password to activate it. 删除选中项 - + Modify the permission 修改文件权限 - - - + + + Rename 重命名 @@ -9905,13 +9939,13 @@ Please input password to activate it. 编辑文件 - + Move to other directory 移动至其它文件夹 - - + + Home directory 主文件夹 @@ -9920,171 +9954,176 @@ Please input password to activate it. 创建文件夹 - + &Edit file content 编辑文件内容(&E) - - + + &Open file 打开文件(&O) - + Try enter 尝试进入 - + Failure 失败 - + Failed to rename file for no permission to make path. 无法重命名文件,因为没有创建路径的权限。 - + directory name 文件夹名 - + Please input a directory name 请输入一个文件夹名称 - + information 信息 - + the new directory name should be empty! 新文件夹名不能为空! - - + + Remove file 删除文件 - - + + After deleting the file, it will not be recoverable. Please confirm whether to continue deleting the file. 删除文件后,该文件将无法恢复。请确认是否继续删除该文件。 - + Failed to open file: 无法打开文件: - + Input error 输入错误 - + The directory entered does not exist. 所输入的文件夹不存在。 - - + + File name 文件名称 - + Permission information 权限信息 - + Have other files also been modified with the same access permissions? 是否也使用相同的访问权限修改了其他文件? - + Move file 移动文件 - + Input a existing directory to save the selected file. 输入现有目录以保存所选文件。 - + Directory is not supported to edit. 文件夹不支持编辑。 - - + + The file size exceeding 5M bytes is not supported. 不支持超过5M字节的文件。 - + The target file exceeds 500K bytes. Do you want to continue editing? 目标文件超过500K字节。是否要继续编辑? - + Directory is not supported to view. 不支持查看目录。 - + The target file exceeds 500K bytes. Do you want to continue view? 目标文件超过500K字节。是否继续查看? - - + + SFTP SFTP - - + + No items are currently selected. 当前没有选中项 - + Keep the directory synchronized with the terminal. 保持文件夹与终端同步 - - The modified file[%1] has been successfully submitted. - 已成功提交修改后的文件[%1]。 + + Successfully submitted the modified file: %1 + 已成功提交修改后的文件:%1 + + + + Failed to submit the modified file: %1 + 无法提交修改后的文件:%1 - + The remote path[%1] does not exist or does not have permission to access it? 远程路径[%1]不存在或没有访问权限? - + Chmod - - - + - - - + + + + + File information 文件信息 @@ -10097,8 +10136,8 @@ Please input password to activate it. 删除文件夹 - - + + Enter 进入 @@ -10107,29 +10146,29 @@ Please input password to activate it. 删除文件 - - + + Download 下载 - + Try Enter 尝度进入 - + New Session Multiplex 新建连接复用 - + Close 关闭 - - + + Error 错误 @@ -10138,89 +10177,89 @@ Please input password to activate it. 保存文件 - - + + FileExist 文件存在 - - + + has the same name in the target path. override it? 已经存在同名文件,是否覆盖? - - + + Upload information 上传信息 - - + + the follow files has exist: 以下文件已经存在: - - - - + + + + &Back 返回(&B) - - + + &Create Directory 创建文件夹(&C) - - + + &Create File 创建文件(&C) - - + + &Delete selections 删除选中项(&D) - - + + &Create directory 创建文件夹(&C) - + Save directory 保存文件夹 - + Parameter error 参数错误 - + Please select directory to save it. 请选择文件夹去保存 - - + + Download information 下载信息 - + Select files 选择文件 - + Select File 选择文件 diff --git a/woterm/CMakeLists.txt b/woterm/CMakeLists.txt index a2e9d7f..fa2b5cb 100644 --- a/woterm/CMakeLists.txt +++ b/woterm/CMakeLists.txt @@ -47,6 +47,8 @@ set(SOURCE_FILES qkxtouchpoint.cpp qkxloadingbarwidget.cpp qkxpositionitem.cpp + qkxbubblesyncwidget.cpp + qkxplaintextedit.cpp #window object main.cpp qwotheme.cpp @@ -230,6 +232,8 @@ set(HEADER_FILES qkxmessagebox.h qkxloadingbarwidget.h qkxpositionitem.h + qkxbubblesyncwidget.h + qkxplaintextedit.h # window object qwotheme.h qwoapplication.h @@ -400,6 +404,7 @@ set(OTHER_FILES woterm.qrc qwoplaybookmanagedialog.ui qwoplaybookconfiguredialog.ui + qkxbubblesyncwidget.ui # window object qwoplaybookwidget.ui qkxfilterlistview.ui diff --git a/woterm/qkxbubblesyncwidget.cpp b/woterm/qkxbubblesyncwidget.cpp new file mode 100644 index 0000000..01ae4a2 --- /dev/null +++ b/woterm/qkxbubblesyncwidget.cpp @@ -0,0 +1,128 @@ +/******************************************************************************************* +* +* 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 "qkxbubblesyncwidget.h" +#include "ui_qkxbubblesyncwidget.h" + +#include +#include +#include +#include +#include +#include + +QKxBubbleSyncWidget::QKxBubbleSyncWidget(QWidget *parent) : + QWidget(parent, Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowStaysOnTopHint | Qt::Tool), + ui(new Ui::QKxBubbleSyncWidget) +{ + ui->setupUi(this); + + setAttribute(Qt::WA_DeleteOnClose); + QObject::connect(ui->btnClose, SIGNAL(clicked()), this, SLOT(close())); + + ui->content->setReadOnly(true); + + QString style = "QToolButton{border:0;border-radius:3px;}\r\n"; + style += "QToolButton:hover{background-color:rgba(255,255,255,128)}\r\n"; + style += "QToolButton:pressed{background-color:rgba(200,200,200,128)}"; + ui->btnClose->setStyleSheet(style); + + setFixedSize(240, 180); + resetLayout(); +} + +QKxBubbleSyncWidget::~QKxBubbleSyncWidget() +{ + delete ui; +} + +void QKxBubbleSyncWidget::setMessage(const QString& title, const QString &msg, int timeout) +{ + Task t; + t.content = msg; + t.title = title; + t.timeout = timeout; + m_tasks.append(t); + if(m_tasks.length() > 1) { + return; + } + if(m_timer == nullptr) { + m_timer = new QTimer(this); + QObject::connect(m_timer, SIGNAL(timeout()), this, SLOT(onTimeout())); + } + m_timer->start(timeout); + ui->title->setText(title); + ui->content->setPlainText(msg); + resetLayout(); +} + +void QKxBubbleSyncWidget::onResetLayout() +{ + QSize sz = size(); + QScreen *screen = QGuiApplication::primaryScreen(); + QRect rt = screen->geometry(); + rt.setLeft(rt.right() - sz.width()); + rt.setTop(rt.bottom() - sz.height()); + setGeometry(rt); + show(); +} + +void QKxBubbleSyncWidget::onTimeout() +{ + if(m_tasks.isEmpty()) { + if(isCursorHover()) { + return; + } + deleteLater(); + return; + } + m_tasks.takeFirst(); + if(m_tasks.isEmpty()) { + if(isCursorHover()) { + return; + } + deleteLater(); + return; + } + Task t = m_tasks.first(); + ui->title->setText(t.title); + ui->content->setPlainText(t.content); + m_timer->start(t.timeout); +} + +void QKxBubbleSyncWidget::mouseMoveEvent(QMouseEvent *event) +{ + if (event->buttons() & Qt::LeftButton) { + move(event->globalPos() - m_dragPosition); + event->accept(); + } +} + +void QKxBubbleSyncWidget::mousePressEvent(QMouseEvent *event) +{ + if (event->button() == Qt::LeftButton) { + m_dragPosition = event->globalPos() - frameGeometry().topLeft(); + event->accept(); + } +} + +bool QKxBubbleSyncWidget::isCursorHover() +{ + QPoint pt = QCursor::pos(); + QRect rt = geometry(); + //qDebug() << pt << rt << rt.contains(pt); + return rt.contains(pt); +} + +void QKxBubbleSyncWidget::resetLayout() +{ + QMetaObject::invokeMethod(this, "onResetLayout", Qt::QueuedConnection); +} diff --git a/woterm/qkxbubblesyncwidget.h b/woterm/qkxbubblesyncwidget.h new file mode 100644 index 0000000..f1316da --- /dev/null +++ b/woterm/qkxbubblesyncwidget.h @@ -0,0 +1,56 @@ +/******************************************************************************************* +* +* 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 QKXBUBBLESYNCWIDGET_H +#define QKXBUBBLESYNCWIDGET_H + +#include +#include +#include + +namespace Ui { +class QKxBubbleSyncWidget; +} + +class QTimer; + +class QKxBubbleSyncWidget : public QWidget +{ + Q_OBJECT + +public: + explicit QKxBubbleSyncWidget(QWidget *parent = nullptr); + ~QKxBubbleSyncWidget(); + + void setMessage(const QString& title, const QString& msg, int timeout = 1000); + Q_INVOKABLE void resetLayout(); +private slots: + void onResetLayout(); + void onTimeout(); +private: + virtual void mouseMoveEvent(QMouseEvent *event); + virtual void mousePressEvent(QMouseEvent *event); +private: + bool isCursorHover(); +private: + Ui::QKxBubbleSyncWidget *ui; + QPointer m_timer; + QPoint m_dragPosition; + + struct Task{ + QString title; + QString content; + int timeout; + }; + QList m_tasks; +}; + +#endif // QKXBUBBLESYNCWIDGET_H diff --git a/woterm/qkxbubblesyncwidget.ui b/woterm/qkxbubblesyncwidget.ui new file mode 100644 index 0000000..4e4fa76 --- /dev/null +++ b/woterm/qkxbubblesyncwidget.ui @@ -0,0 +1,93 @@ + + + QKxBubbleSyncWidget + + + + 0 + 0 + 400 + 137 + + + + Form + + + + 3 + + + 3 + + + 3 + + + 3 + + + + + + + title + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + :/woterm/resource/images/close.png:/woterm/resource/images/close.png + + + + + + + + + 3 + + + 3 + + + 3 + + + 3 + + + + + true + + + + + + + + + + + + diff --git a/woterm/qkxplaintextedit.cpp b/woterm/qkxplaintextedit.cpp new file mode 100644 index 0000000..ac0d126 --- /dev/null +++ b/woterm/qkxplaintextedit.cpp @@ -0,0 +1,68 @@ +/******************************************************************************************* +* +* 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 "qkxplaintextedit.h" + +#include +#include + +QKxPlainTextEdit::QKxPlainTextEdit(QWidget *parent) + : QPlainTextEdit(parent) +{ + setMouseTracking(true); + setAttribute(Qt::WA_Hover,true); +} + +QKxPlainTextEdit::~QKxPlainTextEdit() +{ + +} + +void QKxPlainTextEdit::mousePressEvent(QMouseEvent *e) +{ + m_clickedAnchor = (e->button() & Qt::LeftButton) ? anchorAt(e->pos()) : QString(); + QPlainTextEdit::mousePressEvent(e); +} + +void QKxPlainTextEdit::mouseMoveEvent(QMouseEvent *e) +{ + QString link = anchorAt(e->pos()); + if(link.isEmpty()) { + unsetCursor(); + }else{ + setCursor(Qt::ArrowCursor); + } + QPlainTextEdit::mouseMoveEvent(e); +} + +void QKxPlainTextEdit::mouseReleaseEvent(QMouseEvent *e) +{ + if (e->button() & Qt::LeftButton && !m_clickedAnchor.isEmpty() && anchorAt(e->pos()) == m_clickedAnchor) { + emit linkActivated(m_clickedAnchor); + } + + QPlainTextEdit::mouseReleaseEvent(e); +} + +bool QKxPlainTextEdit::event(QEvent *e) +{ + if(QEvent::HoverMove == e->type()){ + QHoverEvent *hoverEvent = static_cast(e); + QString link = anchorAt(hoverEvent->pos()); + if(link.isEmpty()) { + unsetCursor(); + }else{ + setCursor(Qt::ArrowCursor); + } + qDebug() << hoverEvent->pos() << "anchor: " << link; + } + return QWidget::event(e); +} diff --git a/woterm/qkxplaintextedit.h b/woterm/qkxplaintextedit.h new file mode 100644 index 0000000..a556827 --- /dev/null +++ b/woterm/qkxplaintextedit.h @@ -0,0 +1,37 @@ +/******************************************************************************************* +* +* 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 QKXPLAINTEXTEDIT_H +#define QKXPLAINTEXTEDIT_H + +#include + +class QMouseEvent; + +class QKxPlainTextEdit : public QPlainTextEdit +{ + Q_OBJECT +public: + explicit QKxPlainTextEdit(QWidget *parent=nullptr); + virtual ~QKxPlainTextEdit(); + +signals: + void linkActivated(QString); +protected: + virtual void mousePressEvent(QMouseEvent *e); + virtual void mouseMoveEvent(QMouseEvent *e); + virtual void mouseReleaseEvent(QMouseEvent *e); + virtual bool event(QEvent *e); +private: + QString m_clickedAnchor; +}; + +#endif // QKXPLAINTEXTEDIT_H diff --git a/woterm/qwosessionftpproperty.cpp b/woterm/qwosessionftpproperty.cpp index 03ec927..4f6c14b 100644 --- a/woterm/qwosessionftpproperty.cpp +++ b/woterm/qwosessionftpproperty.cpp @@ -20,6 +20,7 @@ #include #include #include +#include QWoSessionFtpProperty::QWoSessionFtpProperty(bool editAsk, QWidget *parent) : QDialog(parent), @@ -44,6 +45,23 @@ QWoSessionFtpProperty::QWoSessionFtpProperty(bool editAsk, QWidget *parent) : ui->btnModify->setVisible(false); ui->btnRemove->setVisible(false); + { + + bool bubbleSync = QWoSetting::value("sftpFileEdit/bubbleSync", true).toBool(); + ui->radBubbleSync->setChecked(bubbleSync); + ui->radConfirmSync->setChecked(!bubbleSync); + + QButtonGroup *group = new QButtonGroup(this); + group->addButton(ui->radBubbleSync); + group->addButton(ui->radConfirmSync); + QObject::connect(ui->radBubbleSync, &QRadioButton::clicked, this, [=](){ + QWoSetting::setValue("sftpFileEdit/bubbleSync", true); + }); + + QObject::connect(ui->radConfirmSync, &QRadioButton::clicked, this, [=](){ + QWoSetting::setValue("sftpFileEdit/bubbleSync", false); + }); + } QObject::connect(ui->btnUseIt, SIGNAL(clicked()), this, SLOT(onUseItButtonClicked())); diff --git a/woterm/qwosessionftpproperty.ui b/woterm/qwosessionftpproperty.ui index ad0021e..1852c86 100644 --- a/woterm/qwosessionftpproperty.ui +++ b/woterm/qwosessionftpproperty.ui @@ -6,8 +6,8 @@ 0 0 - 550 - 373 + 573 + 380 @@ -37,6 +37,20 @@ + + + + Pop up the dialog box to confirm whether to synchronize the modified file. + + + + + + + Bubble prompt on the bottom right screen and synchronize the modified files. + + + diff --git a/woterm/qwosftpwidget.cpp b/woterm/qwosftpwidget.cpp index 6542fef..355379a 100644 --- a/woterm/qwosftpwidget.cpp +++ b/woterm/qwosftpwidget.cpp @@ -36,6 +36,7 @@ #include "qwosftpeditordialog.h" #include "qwosessionfileassociationmodel.h" #include "qwosessionftpproperty.h" +#include "qkxbubblesyncwidget.h" #include #include @@ -534,14 +535,35 @@ bool QWoSftpWidget::handleEditCommit(const QString &fileSave, const QString &fil if(!force && fi.lastModified() == lastModified) { return false; } - int retval = QKxMessageBox::information(this, tr("Modify information"), tr("The content has been modified. Do you need to submit it to the server?"), QMessageBox::Yes|QMessageBox::No); - if(retval == QMessageBox::Yes && m_sftp) { - QVariantMap user; - user.insert("command", "editFile"); - user.insert("local", fileSave); - user.insert("remote", fileRemote); - m_sftp->upload(fileSave, fileRemote, QWoSshFtp::TP_Override, user); - return true; + bool bubbleSync = QWoSetting::value("sftpFileEdit/bubbleSync", true).toBool(); + if(bubbleSync) { + if(m_sftp) { + QVariantMap user; + user.insert("command", "editFile"); + user.insert("local", fileSave); + user.insert("remote", fileRemote); + user.insert("bubbleSync", true); + m_sftp->upload(fileSave, fileRemote, QWoSshFtp::TP_Override, user); + QString msg = tr("Ready to submit file: %1").arg(fileRemote); + bubbleSyncGet()->setMessage(tr("File synchronization"), msg); + } + }else if(m_pConfirmSync == nullptr){ + QKxMessageBox dlg(QMessageBox::Information, + tr("Modify information"), + tr("The content has been modified. Do you need to submit it to the server?"), + QMessageBox::Yes|QMessageBox::No, + this, + Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint | Qt::WindowStaysOnTopHint); + m_pConfirmSync = &dlg; + if(dlg.exec() == QMessageBox::Yes && m_sftp) { + QVariantMap user; + user.insert("command", "editFile"); + user.insert("local", fileSave); + user.insert("remote", fileRemote); + user.insert("bubbleSync", false); + m_sftp->upload(fileSave, fileRemote, QWoSshFtp::TP_Override, user); + return true; + } } return false; } @@ -724,6 +746,14 @@ QString QWoSftpWidget::sessionHexString() const return m_target.toUtf8().toHex(); } +QKxBubbleSyncWidget *QWoSftpWidget::bubbleSyncGet() +{ + if(m_bubbleSync == nullptr) { + m_bubbleSync = new QKxBubbleSyncWidget(this); + } + return m_bubbleSync; +} + void QWoSftpWidget::onRemoteContextMenuRequested(const QPoint& pos) { QList lsfi = remoteSelections(); @@ -1804,10 +1834,16 @@ void QWoSftpWidget::onCommandFinish(int t, const QVariantMap& userData) } }else if(t == MT_FTP_UPLOAD) { QString command = userData.value("command").toString(); - if(command == "editFile" && reason == "ok") { + if(command == "editFile"){ QString fileSave = userData.value("local").toString(); QString fileRemote = userData.value("remote").toString(); - QKxMessageBox::message(this, tr("File information"), tr("The modified file[%1] has been successfully submitted.").arg(fileRemote)); + QString msg = (reason == "ok") ? tr("Successfully submitted the modified file: %1").arg(fileRemote) : tr("Failed to submit the modified file: %1").arg(fileRemote); + bool bubbleSync = userData.value("bubbleSync", false).toBool(); + if(bubbleSync) { + bubbleSyncGet()->setMessage(tr("File synchronization"), msg); + }else{ + QKxMessageBox::message(this, tr("File information"), msg); + } } }else if(t == MT_FTP_FILE_INFO) { bool customEnter = userData.value("customEnter").toBool(); diff --git a/woterm/qwosftpwidget.h b/woterm/qwosftpwidget.h index e00b1d8..e43c154 100644 --- a/woterm/qwosftpwidget.h +++ b/woterm/qwosftpwidget.h @@ -42,6 +42,7 @@ class QPushButton; class QProcess; class QFileSystemWatcher; class QTimer; +class QKxBubbleSyncWidget; class QWoSftpWidget : public QWidget { @@ -172,6 +173,7 @@ protected slots: void runUploadTask(const QList& lsf); Q_INVOKABLE void runUploadTask(const QStringList& lsfi); QString sessionHexString() const; + QKxBubbleSyncWidget *bubbleSyncGet(); private: friend class QWoSftpWidgetImpl; Ui::QWoSftpWidget *ui; @@ -200,6 +202,8 @@ protected slots: QMap m_filesWatchLastActive; QPointer m_timerFileWatch; + QPointer m_pConfirmSync; + QPointer m_bubbleSync; QString m_target; bool m_savePassword; diff --git a/woterm/resource/images/close.png b/woterm/resource/images/close.png new file mode 100644 index 0000000000000000000000000000000000000000..0e39204869d2220546cc430be9c0e923067488b7 GIT binary patch literal 4076 zcmVvG7017KHfdUl1(8<8D$VXDp`Dou78OvmRYVk21R6y|MGz6KTEVv2MA;s@GYCge z5D}E0@QEr+|-UU_OHv5a@r**s3U0oQ0-G+pP7^x-?g5MztFMF@4dzxjeK=0iDiZ zwO0Ge-x+^m!mYEZ`KC5&{qwH+%ru%b16xyFCznAV25<_1{ijM5fgWS#hnR7rK45IA zmDVW%$S1o#M?|XtEUsm!+TV#WPzG++9V1&$|9!nrKHYUTF?|xiv0ih*z)k{R*_=?W z=y)pkx5@fX3P3*HeLXRs<<)Uj5I}dRcJ8Bo*xFZY6w;Z?z*z0WcrB*#XLRf02disS z<$nvQu8jaK_rdu%6a1iNn=AaaIsL4SoM&MjgU?OlgaiTVi80vziuB3?Egf-wN{$*xm~=qCX>A2Usa`&G+0J`7(n_~>u#=}?qX zAA$6s<7MD4yAS-=QAa*@t+;&Oa~T-Sx_(50!?D0dt*6iH-!uJ~wkB=vN+L}@B1>x|JBYK+4I7%Nd{#jW9 z3aQLp06rLU5EXX>x>vPxCr05rN}t8lx-=uv3-A$9#Gx>szr-=G9swYkc>#pEQ3N7< zGH{P>8z)8OKWx8GwXaJKm6SdP-W0a)Jtt!LiDnt6Q9iwHIkB=avOq>1Gw#+LBa&Gt z%&~9l=xHqtbKgtPQ^IsT(bvB<+c<~{>F)Evd{vZ@jPre$W*aBRBo^Ppcw*7IMWuw& z2jEEGjn`pts8nvHLNap|2Dhu z=C$P}2=U(*np5wN2G!Tknmc+Y@ZmUqZH0X`8xrzBTh|QYuHj=Pg`*#^K5q)5kO?cY6hZ z{*Ip3#Bg~tfO)PuN89LT%{Ih7xmf-BQx`5!cvc?~-Vv+7ssuxz;?4ti93dVFkL?F2 zrZQJBAU1%?@Vim74PW*v`Z3ri+p`A`mBa}j`@D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