commit
adcc74ac8e
5 changed files with 21 additions and 6 deletions
|
@ -257,7 +257,6 @@ namespace libssh {
|
||||||
int bytesWritten = sftp_write(file, buffer, bufferSize);
|
int bytesWritten = sftp_write(file, buffer, bufferSize);
|
||||||
|
|
||||||
std::string chunk(buffer, bufferSize);
|
std::string chunk(buffer, bufferSize);
|
||||||
qDebug() << "sftp write: " << QString(chunk.c_str());
|
|
||||||
|
|
||||||
if (bytesWritten != bufferSize) {
|
if (bytesWritten != bufferSize) {
|
||||||
fin.close();
|
fin.close();
|
||||||
|
@ -272,7 +271,6 @@ namespace libssh {
|
||||||
fin.read(buffer, lastChunkSize);
|
fin.read(buffer, lastChunkSize);
|
||||||
|
|
||||||
std::string chunk(buffer, lastChunkSize);
|
std::string chunk(buffer, lastChunkSize);
|
||||||
qDebug() << "sftp write: " << QString(chunk.c_str());
|
|
||||||
|
|
||||||
int bytesWritten = sftp_write(file, buffer, lastChunkSize);
|
int bytesWritten = sftp_write(file, buffer, lastChunkSize);
|
||||||
|
|
||||||
|
|
|
@ -100,6 +100,11 @@ void ServerSettingsLogic::onLineEditDescriptionEditingFinished()
|
||||||
uiLogic()->onUpdateAllPages();
|
uiLogic()->onUpdateAllPages();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ServerSettingsLogic::isCurrentServerHasCredentials()
|
||||||
|
{
|
||||||
|
return m_settings->haveAuthData(uiLogic()->m_selectedServerIndex);
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(Q_OS_ANDROID)
|
#if defined(Q_OS_ANDROID)
|
||||||
/* Auth result handler for Android */
|
/* Auth result handler for Android */
|
||||||
void authResultReceiver::handleActivityResult(int receiverRequestCode, int resultCode, const QJniObject &data)
|
void authResultReceiver::handleActivityResult(int receiverRequestCode, int resultCode, const QJniObject &data)
|
||||||
|
|
|
@ -31,6 +31,8 @@ public:
|
||||||
Q_INVOKABLE void onPushButtonClearClientCacheClicked();
|
Q_INVOKABLE void onPushButtonClearClientCacheClicked();
|
||||||
Q_INVOKABLE void onLineEditDescriptionEditingFinished();
|
Q_INVOKABLE void onLineEditDescriptionEditingFinished();
|
||||||
|
|
||||||
|
Q_INVOKABLE bool isCurrentServerHasCredentials();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ServerSettingsLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
explicit ServerSettingsLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||||
~ServerSettingsLogic() = default;
|
~ServerSettingsLogic() = default;
|
||||||
|
|
|
@ -13,12 +13,18 @@ Popup {
|
||||||
|
|
||||||
anchors.centerIn: Overlay.overlay
|
anchors.centerIn: Overlay.overlay
|
||||||
modal: true
|
modal: true
|
||||||
closePolicy: Popup.NoAutoClose
|
closePolicy: Popup.CloseOnEscape
|
||||||
|
|
||||||
width: parent.width - 20
|
width: parent.width - 20
|
||||||
|
focus: true
|
||||||
|
|
||||||
|
onAboutToHide: {
|
||||||
|
parent.forceActiveFocus(true)
|
||||||
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
@ -28,9 +34,9 @@ Popup {
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
Layout.fillWidth: true
|
||||||
BlueButtonType {
|
BlueButtonType {
|
||||||
id: yesButton
|
id: yesButton
|
||||||
Layout.preferredWidth: parent.width / 2
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: yesText
|
text: yesText
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
@ -43,7 +49,6 @@ Popup {
|
||||||
}
|
}
|
||||||
BlueButtonType {
|
BlueButtonType {
|
||||||
id: noButton
|
id: noButton
|
||||||
Layout.preferredWidth: parent.width / 2
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: noText
|
text: noText
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|
|
@ -110,13 +110,18 @@ PageBase {
|
||||||
Layout.topMargin: 10
|
Layout.topMargin: 10
|
||||||
text: qsTr("Forget this server")
|
text: qsTr("Forget this server")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
if (ServerSettingsLogic.isCurrentServerHasCredentials()) {
|
||||||
|
popupForgetServer.questionText = "Attention! This action will not remove any data from the server, it will just remove server from the list. Continue?"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
popupForgetServer.questionText = "Remove server from the list?"
|
||||||
|
}
|
||||||
popupForgetServer.open()
|
popupForgetServer.open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PopupWithQuestion {
|
PopupWithQuestion {
|
||||||
id: popupForgetServer
|
id: popupForgetServer
|
||||||
questionText: "Attention! This action will not remove the container on the server, it will only remove the container information from the application. Continue?"
|
|
||||||
yesFunc: function() {
|
yesFunc: function() {
|
||||||
ServerSettingsLogic.onPushButtonForgetServer()
|
ServerSettingsLogic.onPushButtonForgetServer()
|
||||||
close()
|
close()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue