commit 2bb076d6c933b7e47dbf05ec08604bba6206ee56 Author: zunmx Date: Tue Jul 9 18:42:53 2024 +0800 first commit diff --git a/.ipynb_checkpoints/README-checkpoint.md b/.ipynb_checkpoints/README-checkpoint.md new file mode 100644 index 0000000..6194b97 --- /dev/null +++ b/.ipynb_checkpoints/README-checkpoint.md @@ -0,0 +1,2 @@ +xfreerdp 简易的GUI程序,用于支持可视化界面,并且支持QT的系统,减少了对于处理器平台的限制。但是xfreerdp需要你自己来安装。 + diff --git a/README.md b/README.md new file mode 100644 index 0000000..6194b97 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +xfreerdp 简易的GUI程序,用于支持可视化界面,并且支持QT的系统,减少了对于处理器平台的限制。但是xfreerdp需要你自己来安装。 + diff --git a/freerdp.pro b/freerdp.pro new file mode 100644 index 0000000..d01e364 --- /dev/null +++ b/freerdp.pro @@ -0,0 +1,24 @@ +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +CONFIG += c++11 + +# You can make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +SOURCES += \ + main.cpp \ + mainwindow.cpp + +HEADERS += \ + mainwindow.h + +FORMS += \ + mainwindow.ui + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target diff --git a/freerdp.pro.user b/freerdp.pro.user new file mode 100644 index 0000000..4af9bc8 --- /dev/null +++ b/freerdp.pro.user @@ -0,0 +1,297 @@ + + + + + + EnvironmentId + {a9336516-2e62-440b-bc00-e15a17d537d0} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + false + true + false + 0 + true + true + 0 + 8 + true + false + 1 + true + true + true + *.md, *.MD, Makefile + false + true + + + + ProjectExplorer.Project.PluginSettings + + + true + false + true + true + true + true + + + 0 + true + + false + {a2e2ad64-a021-41be-b554-015c3fdd78b7} + + true + true + Builtin.DefaultTidyAndClazy + 4 + + + + true + + + + + ProjectExplorer.Project.Target.0 + + Desktop + arm-linux-android-elf-64bit + arm-linux-android-elf-64bit + {4a3fa978-cf5e-496d-a788-70538f0039d0} + 0 + 0 + 0 + + 0 + /data/data/com.termux/files/home/tmp/build-freerdp-arm_linux_android_elf_64bit-Debug + /data/data/com.termux/files/home/tmp/build-freerdp-arm_linux_android_elf_64bit-Debug + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + /data/data/com.termux/files/home/tmp/build-freerdp-arm_linux_android_elf_64bit-Release + /data/data/com.termux/files/home/tmp/build-freerdp-arm_linux_android_elf_64bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + + + 0 + /data/data/com.termux/files/home/tmp/build-freerdp-arm_linux_android_elf_64bit-Profile + /data/data/com.termux/files/home/tmp/build-freerdp-arm_linux_android_elf_64bit-Profile + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + + 25 + + 1 + true + false + true + + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + + 2 + + Qt4ProjectManager.Qt4RunConfiguration:/data/data/com.termux/files/home/tmp/freerdp/freerdp.pro + /data/data/com.termux/files/home/tmp/freerdp/freerdp.pro + false + true + true + false + true + /data/data/com.termux/files/home/tmp/build-freerdp-arm_linux_android_elf_64bit-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..fd3e533 --- /dev/null +++ b/main.cpp @@ -0,0 +1,11 @@ +#include "mainwindow.h" + +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + MainWindow w; + w.show(); + return a.exec(); +} diff --git a/mainwindow.cpp b/mainwindow.cpp new file mode 100644 index 0000000..23c25c5 --- /dev/null +++ b/mainwindow.cpp @@ -0,0 +1,104 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" +#include +#include +#include +#include +#include + +void MainWindow::GetDefault(){ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect geometry = screen->geometry(); + int screenWidth = geometry.width(); + int screenHeight = geometry.height(); + QString current= QString("%1x%2").arg(screenWidth).arg(screenHeight); + int idx = ui->resolution_comboBox->findText(current); + if(idx >= 0){ + ui->resolution_comboBox->setCurrentIndex(idx); + }else{ + ui->resolution_comboBox->insertItem(0,current); + ui->resolution_comboBox->setCurrentIndex(0); + } + QProcess process; + process.start("xfreerdp --help"); + process.waitForFinished(); + QByteArray output = process.readAllStandardOutput(); + if (process.exitCode() != 0) { + ui->textBrowser->setText("You need to install xfreerdp!"); + QMessageBox::warning(this,"NOT FOUND XFREERDP", "You need to install xfreerdp!",QMessageBox::Yes); + exit(0); + }else{ + ui->textBrowser->setText(QString::fromLocal8Bit(output).trimmed()); + } +} +MainWindow::MainWindow(QWidget *parent) + : QMainWindow(parent) + , ui(new Ui::MainWindow) +{ + ui->setupUi(this); + ui->port_text->setValidator(new QRegExpValidator(QRegExp("[0-9]{5}"))); + GetDefault(); +} + +MainWindow::~MainWindow() +{ + delete ui; +} + + +void MainWindow::on_cancel_button_clicked() +{ + exit(0); +} + + +void MainWindow::on_connect_button_clicked() +{ + QString host = ui->host_text->text(); + QString port = ui->port_text->text(); + QString domain = ui->domain_text->text(); + QString username = ui->username_text->text(); + QString password = ui->password_text->text(); + QString resolution = ui->resolution_comboBox->currentText(); + QString bpp = ui->bpp_comboBox->currentText(); + QString network= ui->network_comboBox->currentText(); + QString audio_mode= ui->audio_comboBox->currentText(); + bool full_screen = ui->full_screen_box->isChecked(); + bool dynamic_resolution = ui->dynamic_resolution_box->isChecked(); + bool compression = ui->compression_box->isChecked(); + bool glyph_cache = ui->glyph_cache_box->isChecked(); + bool bitmap_cache = ui->bitmap_cache_box->isChecked(); + bool async_input = ui->async_input_box->isChecked(); + bool async_update = ui->async_update_box->isChecked(); + QString shared_directory_name_text = ui->shared_directory_name_text->text(); + QString share_directory_text = ui->share_directory_text->text(); + QString other_options_text = ui->other_options_text->toPlainText(); + + QString exec_command = ""; + exec_command += QString("/v:'%1':%2").arg(host).arg(port); + exec_command += domain!="" ? QString(" /d:'%1'").arg(domain) :"" ; + exec_command += QString(" /u:'%1'").arg(username); + exec_command += QString(" /p:'%1'").arg(password); + exec_command += QString(" /size:%1").arg(resolution); + exec_command += QString(" /bpp:%1").arg(bpp); + exec_command += QString(" /network:%1").arg(network); + exec_command += QString(" /audio-mode:%1").arg(audio_mode); + exec_command += full_screen ? " /f" : ""; + exec_command += dynamic_resolution ? " /dynamic-resolution" : ""; + exec_command += compression ? " /compression" : ""; + exec_command += glyph_cache ? " +glyph-cache" : ""; + exec_command += bitmap_cache ? " /bitmap-cache" : ""; + exec_command += async_input ? " /async-input" : ""; + exec_command += async_update ? " /async-update" : ""; + exec_command += (!shared_directory_name_text.isEmpty() && !share_directory_text.isEmpty()) ? QString(" /drive:%1,%2").arg(shared_directory_name_text).arg(share_directory_text) : ""; + exec_command += QString(" %1").arg(other_options_text); + + + QString command = QString("xfreerdp %1").arg(exec_command); + qDebug()< + +QT_BEGIN_NAMESPACE +namespace Ui { class MainWindow; } +QT_END_NAMESPACE + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + MainWindow(QWidget *parent = nullptr); + ~MainWindow(); + void GetDefault(); + +private slots: + void on_cancel_button_clicked(); + + void on_connect_button_clicked(); + +private: + Ui::MainWindow *ui; +}; +#endif // MAINWINDOW_H diff --git a/mainwindow.ui b/mainwindow.ui new file mode 100644 index 0000000..258cfd8 --- /dev/null +++ b/mainwindow.ui @@ -0,0 +1,499 @@ + + + MainWindow + + + + 0 + 0 + 421 + 341 + + + + + + + + 0 + + + + Normal Options + + + + + + true + + + + + 0 + 0 + 365 + 262 + + + + + + + + + + 800x600 + + + + + 1024x760 + + + + + 1280x600 + + + + + 1360x768 + + + + + 1440x900 + + + + + 1600x900 + + + + + 1920x1080 + + + + + 1920x1200 + + + + + + + + + auto + + + + + modem + + + + + broadband-low + + + + + broadband + + + + + broadband-high + + + + + wan + + + + + lan + + + + + + + + Resolution + + + + + + + Audio Mode + + + + + + + + off + + + + + local + + + + + remote + + + + + + + + Color Depth(bpp) + + + + + + + Host + + + + + + + Network + + + + + + + Password + + + + + + + + + + + + + + 60 + 16777215 + + + + 3389 + + + + + + + UserName + + + + + + + : + + + + + + + + + + + 8 + + + + + 16 + + + + + 24 + + + + + 32 + + + + + + + + Domain + + + + + + + + + + + + + + + + + Advanced Options + + + + + + true + + + + + 0 + -116 + 365 + 365 + + + + + + + + + Dynamic Resolution + + + + + + + Compression + + + + + + + Glyph Cache + + + + + + + Bitmap Cache + + + + + + + Async Input + + + + + + + Async Update + + + + + + + Enable + + + true + + + + + + + Enable + + + true + + + + + + + Enable + + + true + + + + + + + Enable + + + true + + + + + + + Enable + + + true + + + + + + + Enable + + + true + + + + + + + Share Direcory + + + + + + + + + + Shared Directory Name + + + + + + + Shared + + + + + + + Full Screen + + + + + + + Enable + + + + + + + Other Options + + + + + + + + 0 + 80 + + + + + + + + + + + + + + + Help + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Cancel + + + + + + + Connect + + + + + + + + + + +