Compare commits

...

5 Commits

Author SHA1 Message Date
Mazay B 1b75b68373 Fix in AndroidController [NO CI] 2023-06-18 17:49:03 +01:00
pokamest a116774104 Bugfix/macos fixes (#247)
* Icon for macos and tiny fixes
* Macos deploy build fix
2023-05-28 16:24:00 +01:00
pokamest adcc74ac8e Merge pull request #245 from amnezia-vpn/fix/ui_fixes
Tiny ui fixes
2023-05-24 08:17:40 -07:00
pokamest 3e0085b4a4 PopupWithQuestion.qml fix 2023-05-24 16:12:07 +01:00
pokamest 17fb2a98d6 Fix question when removing server from list 2023-05-24 12:18:40 +01:00
15 changed files with 68 additions and 50 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.25.0 FATAL_ERROR)
set(PROJECT AmneziaVPN) set(PROJECT AmneziaVPN)
project(${PROJECT} VERSION 3.0.7.2 project(${PROJECT} VERSION 3.0.7.4
DESCRIPTION "AmneziaVPN" DESCRIPTION "AmneziaVPN"
HOMEPAGE_URL "https://amnezia.org/" HOMEPAGE_URL "https://amnezia.org/"
) )
+5 -1
View File
@@ -214,7 +214,11 @@ if(APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15) set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15)
add_compile_definitions(MVPN_MACOS) add_compile_definitions(MVPN_MACOS)
# ICON = $$PWD/images/app.icns
set(ICON_FILE ${CMAKE_CURRENT_SOURCE_DIR}/images/app.icns)
set(MACOSX_BUNDLE_ICON_FILE app.icns)
set_source_files_properties(${ICON_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set(SOURCES ${SOURCES} ${ICON_FILE})
find_library(FW_COCOA Cocoa) find_library(FW_COCOA Cocoa)
find_library(FW_APPLICATIONSERVICES ApplicationServices) find_library(FW_APPLICATIONSERVICES ApplicationServices)
+3 -3
View File
@@ -136,9 +136,9 @@ android {
defaultConfig { defaultConfig {
resConfig "en" resConfig "en"
minSdkVersion = 24 minSdkVersion = 24
targetSdkVersion = 31 targetSdkVersion = 34
versionCode 10 // Change to a higher number versionCode 21 // Change to a higher number
versionName "2.0.10" // Change to a higher number versionName "3.0.7" // Change to a higher number
javaCompileOptions.annotationProcessorOptions.arguments = [ javaCompileOptions.annotationProcessorOptions.arguments = [
"room.schemaLocation": "${qtAndroidDir}/schemas".toString() "room.schemaLocation": "${qtAndroidDir}/schemas".toString()
-2
View File
@@ -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;
+1 -1
View File
@@ -23,7 +23,7 @@ class StartPageLogic : public PageLogicBase
AUTO_PROPERTY(QString, labelWaitInfoText) AUTO_PROPERTY(QString, labelWaitInfoText)
AUTO_PROPERTY(bool, pushButtonBackFromStartVisible) AUTO_PROPERTY(bool, pushButtonBackFromStartVisible)
AUTO_PROPERTY(QString, privateKeyPassphrase); AUTO_PROPERTY(QString, privateKeyPassphrase)
READONLY_PROPERTY(QRegularExpression, ipAddressPortRegex) READONLY_PROPERTY(QRegularExpression, ipAddressPortRegex)
public: public:
+8 -3
View File
@@ -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: {
+6 -1
View File
@@ -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()
+15 -13
View File
@@ -233,9 +233,8 @@ PageBase {
anchors.top: label_server_ip.bottom anchors.top: label_server_ip.bottom
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: StartPageLogic.lineEditIpText text: StartPageLogic.lineEditIpText
onEditingFinished: { onEditingFinished: { StartPageLogic.lineEditIpText = text }
StartPageLogic.lineEditIpText = text onTextEdited: { StartPageLogic.lineEditIpText = text }
}
validator: RegularExpressionValidator { validator: RegularExpressionValidator {
regularExpression: StartPageLogic.ipAddressPortRegex regularExpression: StartPageLogic.ipAddressPortRegex
@@ -253,9 +252,8 @@ PageBase {
anchors.top: label_login.bottom anchors.top: label_login.bottom
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: StartPageLogic.lineEditLoginText text: StartPageLogic.lineEditLoginText
onEditingFinished: { onEditingFinished: { StartPageLogic.lineEditLoginText = text }
StartPageLogic.lineEditLoginText = text onTextEdited: { StartPageLogic.lineEditLoginText = text }
}
} }
LabelType { LabelType {
@@ -268,25 +266,29 @@ PageBase {
id: new_server_password id: new_server_password
anchors.top: label_new_server_password.bottom anchors.top: label_new_server_password.bottom
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
inputMethodHints: Qt.ImhSensitiveData
echoMode: TextInput.Password echoMode: TextInput.Password
text: StartPageLogic.lineEditPasswordText text: StartPageLogic.lineEditPasswordText
onEditingFinished: { onEditingFinished: { StartPageLogic.lineEditPasswordText = text }
StartPageLogic.lineEditPasswordText = text onTextEdited: { StartPageLogic.lineEditPasswordText = text }
} onAccepted: { StartPageLogic.onPushButtonConnect() }
} }
TextFieldType { TextFieldType {
id: new_server_ssh_key id: new_server_ssh_key
anchors.top: label_new_server_password.bottom anchors.top: label_new_server_password.bottom
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
visible: false
height: 71 height: 71
font.pixelSize: 10 font.pixelSize: 10
verticalAlignment: Text.AlignTop verticalAlignment: Text.AlignTop
inputMethodHints: Qt.ImhSensitiveData
text: StartPageLogic.textEditSshKeyText text: StartPageLogic.textEditSshKeyText
onEditingFinished: { onEditingFinished: { StartPageLogic.textEditSshKeyText = text }
StartPageLogic.textEditSshKeyText = text onTextEdited: { StartPageLogic.textEditSshKeyText = text }
} onAccepted: { StartPageLogic.onPushButtonConnect() }
visible: false
} }
LabelType { LabelType {
+1 -1
View File
@@ -354,7 +354,7 @@ Window {
} }
textArea.wrapMode: cbLogWrap.checked ? TextEdit.WordWrap: TextEdit.NoWrap textArea.wrapMode: cbLogWrap.checked ? TextEdit.WordWrap: TextEdit.NoWrap
Keys.onPressed: { Keys.onPressed: function(event) {
UiLogic.keyPressEvent(event.key) UiLogic.keyPressEvent(event.key)
event.accepted = true event.accepted = true
} }
+2 -2
View File
@@ -133,12 +133,12 @@ void UiLogic::initializeUiLogic()
connect(AndroidController::instance(), &AndroidController::initialized, [this](bool status, bool connected, const QDateTime& connectionDate) { connect(AndroidController::instance(), &AndroidController::initialized, [this](bool status, bool connected, const QDateTime& connectionDate) {
if (connected) { if (connected) {
pageLogic<VpnLogic>()->onConnectionStateChanged(VpnProtocol::Connected); pageLogic<VpnLogic>()->onConnectionStateChanged(VpnProtocol::Connected);
m_vpnConnection->restoreConnection(); if (m_vpnConnection) m_vpnConnection->restoreConnection();
} }
}); });
if (!AndroidController::instance()->initialize(pageLogic<StartPageLogic>())) { if (!AndroidController::instance()->initialize(pageLogic<StartPageLogic>())) {
qCritical() << QString("Init failed"); qCritical() << QString("Init failed");
emit VpnProtocol::Error; if (m_vpnConnection) m_vpnConnection->connectionStateChanged(VpnProtocol::Error);
return; return;
} }
#endif #endif
+1 -3
View File
@@ -69,8 +69,6 @@ echo "____________________________________"
# Package # Package
echo "Packaging ..." echo "Packaging ..."
#cd $DEPLOY_DIR
$QT_BIN_DIR/macdeployqt $OUT_APP_DIR/$APP_FILENAME -always-overwrite -qmldir=$PROJECT_DIR $QT_BIN_DIR/macdeployqt $OUT_APP_DIR/$APP_FILENAME -always-overwrite -qmldir=$PROJECT_DIR
cp -av $BUILD_DIR/service/server/$APP_NAME-service $BUNDLE_DIR/Contents/macOS cp -av $BUILD_DIR/service/server/$APP_NAME-service $BUNDLE_DIR/Contents/macOS
cp -Rv $PROJECT_DIR/deploy/data/macos/* $BUNDLE_DIR/Contents/macOS cp -Rv $PROJECT_DIR/deploy/data/macos/* $BUNDLE_DIR/Contents/macOS
@@ -147,7 +145,7 @@ if [ "${MAC_CERT_PW+x}" ]; then
fi fi
echo "Building DMG installer..." echo "Building DMG installer..."
hdiutil create -volname $APP_NAME -srcfolder $BUILD_DIR/installer/$APP_NAME.app -ov -format UDZO $DMG_FILENAME hdiutil create -volname Amnezia -srcfolder $BUILD_DIR/installer/$APP_NAME.app -ov -format UDZO $DMG_FILENAME
if [ "${MAC_CERT_PW+x}" ]; then if [ "${MAC_CERT_PW+x}" ]; then
echo "Signing DMG installer..." echo "Signing DMG installer..."
-4
View File
@@ -7,10 +7,6 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(NOT IOS AND NOT ANDROID) if(NOT IOS AND NOT ANDROID)
#include(common.cmake)
#if (qtservice-uselib)
# add_subdirectory(buildlib)
#endif()
add_subdirectory(server) add_subdirectory(server)
endif() endif()
+8 -5
View File
@@ -94,11 +94,16 @@ include_directories(
add_executable(${PROJECT} ${SOURCES} ${HEADERS}) add_executable(${PROJECT} ${SOURCES} ${HEADERS})
target_link_libraries(${PROJECT} PRIVATE Qt6::Core Qt6::Network Qt6::RemoteObjects Qt6::Core5Compat ${LIBS}) target_link_libraries(${PROJECT} PRIVATE Qt6::Core Qt6::Network Qt6::RemoteObjects Qt6::Core5Compat ${LIBS})
qt_add_repc_sources(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipc_interface.rep) if(APPLE)
if(NOT IOS) set_target_properties(${PROJECT} PROPERTIES
qt_add_repc_sources(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipc_process_interface.rep) INSTALL_RPATH "@executable_path/../Frameworks"
BUILD_WITH_INSTALL_RPATH TRUE
)
endif() endif()
qt_add_repc_sources(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipc_interface.rep)
qt_add_repc_sources(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipc_process_interface.rep)
# deploy artifacts required to run the application to the debug build folder # deploy artifacts required to run the application to the debug build folder
if(WIN32) if(WIN32)
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8") if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
@@ -112,7 +117,6 @@ elseif(APPLE AND NOT IOS)
set(DEPLOY_ARTIFACT_PATH "macos") set(DEPLOY_ARTIFACT_PATH "macos")
endif() endif()
if(NOT IOS AND NOT ANDROID)
add_custom_command( add_custom_command(
TARGET ${PROJECT} POST_BUILD TARGET ${PROJECT} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E $<IF:$<CONFIG:Debug>,copy_directory,true> COMMAND ${CMAKE_COMMAND} -E $<IF:$<CONFIG:Debug>,copy_directory,true>
@@ -120,4 +124,3 @@ if(NOT IOS AND NOT ANDROID)
$<TARGET_FILE_DIR:${PROJECT}> $<TARGET_FILE_DIR:${PROJECT}>
COMMAND_EXPAND_LISTS COMMAND_EXPAND_LISTS
) )
endif()