|
@@ -3,7 +3,6 @@
|
3
|
3
|
#include <QDebug>
|
4
|
4
|
#include "maindialog.h"
|
5
|
5
|
#include "ui_maindialog.h"
|
6
|
|
-#include "rdpoptions.h"
|
7
|
6
|
#include "rdesktoplauncher.h"
|
8
|
7
|
|
9
|
8
|
MainDialog::MainDialog(QWidget *parent) :
|
|
@@ -22,24 +21,17 @@ MainDialog::~MainDialog()
|
22
|
21
|
delete ui;
|
23
|
22
|
}
|
24
|
23
|
|
25
|
|
-void MainDialog::on_btnConnect_clicked()
|
|
24
|
+RdpOptions MainDialog::getRdpOptions() const
|
26
|
25
|
{
|
27
|
26
|
RdpOptions opt;
|
28
|
|
- opt.setBitmapCache(ui->checkCacheBitmap->isChecked());
|
29
|
|
- opt.setExperience((RdpOptions::Experience)ui->comboExperience->currentIndex());
|
30
|
|
- opt.setFullescreen(ui->slidResolution->value() == m_resolutions.size());
|
31
|
27
|
opt.setHost(ui->lineComputer->currentText());
|
32
|
|
- int meta = ui->comboMetaKeys->currentIndex();
|
33
|
|
- opt.setMetaKeys(meta == 0 || (opt.fullescreen() && meta == 2));
|
34
|
|
- opt.setPassword(ui->linePassword->text());
|
35
|
|
- opt.setResolution(m_resolutions.at(m_resolutions.size() - 1));
|
36
|
28
|
opt.setUsername(ui->lineUsername->text());
|
37
|
|
- opt.setUseShell(ui->checkShell->isChecked());
|
38
|
|
- if (opt.useShell())
|
39
|
|
- {
|
40
|
|
- opt.setShell(ui->lineShellPath->text());
|
41
|
|
- opt.setShellWorkingDir(ui->lineShellWorkingDir->text());
|
42
|
|
- }
|
|
29
|
+ opt.setPassword(ui->linePassword->text());
|
|
30
|
+ opt.setFullescreen(ui->slidResolution->value() == m_resolutions.size());
|
|
31
|
+ if (!opt.fullescreen())
|
|
32
|
+ opt.setResolution(m_resolutions.at(m_resolutions.size() - 1));
|
|
33
|
+ opt.setUseAllMonitors(ui->checkAllDisplays->isChecked());
|
|
34
|
+
|
43
|
35
|
int colors = ui->comboColors->currentIndex();
|
44
|
36
|
RdpOptions::Colors c;
|
45
|
37
|
if (colors == 0)
|
|
@@ -51,6 +43,63 @@ void MainDialog::on_btnConnect_clicked()
|
51
|
43
|
else if (colors == 3)
|
52
|
44
|
c = RdpOptions::HighestQuality;
|
53
|
45
|
opt.setColors(c);
|
|
46
|
+
|
|
47
|
+ opt.setFullscreenBar(ui->checkFullscreenBar->isChecked());
|
|
48
|
+ int meta = ui->comboMetaKeys->currentIndex();
|
|
49
|
+ opt.setMetaKeys(meta == 0 || (opt.fullescreen() && meta == 2));
|
|
50
|
+ opt.setUseShell(ui->checkShell->isChecked());
|
|
51
|
+ if (opt.useShell())
|
|
52
|
+ {
|
|
53
|
+ opt.setShell(ui->lineShellPath->text());
|
|
54
|
+ opt.setShellWorkingDir(ui->lineShellWorkingDir->text());
|
|
55
|
+ }
|
|
56
|
+ opt.setExperience((RdpOptions::Experience)ui->comboExperience->currentIndex());
|
|
57
|
+ opt.setBitmapCache(ui->checkCacheBitmap->isChecked());
|
|
58
|
+ opt.setAutoReconnect(ui->checkAutoReconnect->isChecked());
|
|
59
|
+ return opt;
|
|
60
|
+}
|
|
61
|
+
|
|
62
|
+void MainDialog::setRdpOptions(const RdpOptions &opt)
|
|
63
|
+{
|
|
64
|
+ ui->lineComputer->lineEdit()->setText(opt.host());
|
|
65
|
+ ui->lineUsername->setText(opt.username());
|
|
66
|
+ ui->linePassword->setText(opt.password());
|
|
67
|
+ if (opt.fullescreen())
|
|
68
|
+ {
|
|
69
|
+ ui->slidResolution->setValue(ui->slidResolution->maximum());
|
|
70
|
+ }
|
|
71
|
+ else
|
|
72
|
+ {
|
|
73
|
+
|
|
74
|
+ }
|
|
75
|
+ ui->checkAllDisplays->setChecked(opt.useAllMonitors());
|
|
76
|
+
|
|
77
|
+ int index = 0;
|
|
78
|
+ RdpOptions::Colors c = opt.colors();
|
|
79
|
+ if (c == RdpOptions::HighColor_15)
|
|
80
|
+ index = 0;
|
|
81
|
+ else if (c == RdpOptions::HighColor_16)
|
|
82
|
+ index = 1;
|
|
83
|
+ else if (c == RdpOptions::TrueColor)
|
|
84
|
+ index = 2;
|
|
85
|
+ else if (c == RdpOptions::HighestQuality)
|
|
86
|
+ index = 3;
|
|
87
|
+ ui->comboColors->setCurrentIndex(index);
|
|
88
|
+
|
|
89
|
+ ui->checkFullscreenBar->setChecked(opt.fullscreenBar());
|
|
90
|
+ ui->comboMetaKeys->setCurrentIndex(opt.metaKeys() ? 2 : 1);
|
|
91
|
+ ui->checkShell->setChecked(opt.useShell());
|
|
92
|
+ ui->lineShellPath->setText(opt.shell());
|
|
93
|
+ ui->lineShellWorkingDir->setText(opt.shellWorkingDir());
|
|
94
|
+ ui->comboExperience->setCurrentIndex((int)opt.experience());
|
|
95
|
+ ui->checkCacheBitmap->setChecked(opt.bitmapCache());
|
|
96
|
+ ui->checkAutoReconnect->setChecked(opt.autoReconnect());
|
|
97
|
+}
|
|
98
|
+
|
|
99
|
+void MainDialog::on_btnConnect_clicked()
|
|
100
|
+{
|
|
101
|
+ RdpOptions opt = getRdpOptions();
|
|
102
|
+
|
54
|
103
|
RDesktopLauncher launcher;
|
55
|
104
|
launcher.start(opt);
|
56
|
105
|
}
|
|
@@ -80,3 +129,18 @@ void MainDialog::on_slidResolution_valueChanged(int value)
|
80
|
129
|
ui->lblResolution->setText(tr("Plein écran"));
|
81
|
130
|
}
|
82
|
131
|
}
|
|
132
|
+
|
|
133
|
+void MainDialog::on_btnSaveSession_clicked()
|
|
134
|
+{
|
|
135
|
+
|
|
136
|
+}
|
|
137
|
+
|
|
138
|
+void MainDialog::on_btnSaveAsSession_clicked()
|
|
139
|
+{
|
|
140
|
+
|
|
141
|
+}
|
|
142
|
+
|
|
143
|
+void MainDialog::on_btnOpenSession_clicked()
|
|
144
|
+{
|
|
145
|
+
|
|
146
|
+}
|