Merge branch 'rustdesk:master' into master

This commit is contained in:
Ivan Beà 2022-11-16 13:36:30 +01:00 committed by GitHub
commit 6a7ad36fed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 226 additions and 136 deletions

View File

@ -202,6 +202,28 @@ class RemoteCountState {
static RxInt find() => Get.find<RxInt>(tag: tag()); static RxInt find() => Get.find<RxInt>(tag: tag());
} }
class PeerBoolOption {
static String tag(String id, String opt) => 'peer_{$opt}_$id';
static void init(String id, String opt, bool Function() init_getter) {
final key = tag(id, opt);
if (!Get.isRegistered(tag: key)) {
final RxBool value = RxBool(init_getter());
Get.put(value, tag: key);
}
}
static void delete(String id, String opt) {
final key = tag(id, opt);
if (Get.isRegistered(tag: key)) {
Get.delete(tag: key);
}
}
static RxBool find(String id, String opt) =>
Get.find<RxBool>(tag: tag(id, opt));
}
class PeerStringOption { class PeerStringOption {
static String tag(String id, String opt) => 'peer_{$opt}_$id'; static String tag(String id, String opt) => 'peer_{$opt}_$id';

View File

@ -51,6 +51,7 @@ class _RemotePageState extends State<RemotePage>
String keyboardMode = "legacy"; String keyboardMode = "legacy";
final _cursorOverImage = false.obs; final _cursorOverImage = false.obs;
late RxBool _showRemoteCursor; late RxBool _showRemoteCursor;
late RxBool _zoomCursor;
late RxBool _remoteCursorMoved; late RxBool _remoteCursorMoved;
late RxBool _keyboardEnabled; late RxBool _keyboardEnabled;
@ -68,6 +69,10 @@ class _RemotePageState extends State<RemotePage>
KeyboardEnabledState.init(id); KeyboardEnabledState.init(id);
ShowRemoteCursorState.init(id); ShowRemoteCursorState.init(id);
RemoteCursorMovedState.init(id); RemoteCursorMovedState.init(id);
final optZoomCursor = 'zoom-cursor';
PeerBoolOption.init(id, optZoomCursor,
() => bind.sessionGetToggleOptionSync(id: id, arg: optZoomCursor));
_zoomCursor = PeerBoolOption.find(id, optZoomCursor);
_showRemoteCursor = ShowRemoteCursorState.find(id); _showRemoteCursor = ShowRemoteCursorState.find(id);
_keyboardEnabled = KeyboardEnabledState.find(id); _keyboardEnabled = KeyboardEnabledState.find(id);
_remoteCursorMoved = RemoteCursorMovedState.find(id); _remoteCursorMoved = RemoteCursorMovedState.find(id);
@ -216,6 +221,7 @@ class _RemotePageState extends State<RemotePage>
}); });
return ImagePaint( return ImagePaint(
id: widget.id, id: widget.id,
zoomCursor: _zoomCursor,
cursorOverImage: _cursorOverImage, cursorOverImage: _cursorOverImage,
keyboardEnabled: _keyboardEnabled, keyboardEnabled: _keyboardEnabled,
remoteCursorMoved: _remoteCursorMoved, remoteCursorMoved: _remoteCursorMoved,
@ -233,6 +239,7 @@ class _RemotePageState extends State<RemotePage>
visible: _showRemoteCursor.isTrue && _remoteCursorMoved.isTrue, visible: _showRemoteCursor.isTrue && _remoteCursorMoved.isTrue,
child: CursorPaint( child: CursorPaint(
id: widget.id, id: widget.id,
zoomCursor: _zoomCursor,
)))); ))));
paints.add(QualityMonitor(_ffi.qualityMonitorModel)); paints.add(QualityMonitor(_ffi.qualityMonitorModel));
paints.add(RemoteMenubar( paints.add(RemoteMenubar(
@ -253,6 +260,7 @@ class _RemotePageState extends State<RemotePage>
class ImagePaint extends StatefulWidget { class ImagePaint extends StatefulWidget {
final String id; final String id;
final Rx<bool> zoomCursor;
final Rx<bool> cursorOverImage; final Rx<bool> cursorOverImage;
final Rx<bool> keyboardEnabled; final Rx<bool> keyboardEnabled;
final Rx<bool> remoteCursorMoved; final Rx<bool> remoteCursorMoved;
@ -261,6 +269,7 @@ class ImagePaint extends StatefulWidget {
ImagePaint( ImagePaint(
{Key? key, {Key? key,
required this.id, required this.id,
required this.zoomCursor,
required this.cursorOverImage, required this.cursorOverImage,
required this.keyboardEnabled, required this.keyboardEnabled,
required this.remoteCursorMoved, required this.remoteCursorMoved,
@ -277,6 +286,7 @@ class _ImagePaintState extends State<ImagePaint> {
final ScrollController _vertical = ScrollController(); final ScrollController _vertical = ScrollController();
String get id => widget.id; String get id => widget.id;
Rx<bool> get zoomCursor => widget.zoomCursor;
Rx<bool> get cursorOverImage => widget.cursorOverImage; Rx<bool> get cursorOverImage => widget.cursorOverImage;
Rx<bool> get keyboardEnabled => widget.keyboardEnabled; Rx<bool> get keyboardEnabled => widget.keyboardEnabled;
Rx<bool> get remoteCursorMoved => widget.remoteCursorMoved; Rx<bool> get remoteCursorMoved => widget.remoteCursorMoved;
@ -357,7 +367,7 @@ class _ImagePaintState extends State<ImagePaint> {
if (cache == null) { if (cache == null) {
return MouseCursor.defer; return MouseCursor.defer;
} else { } else {
final key = cache.updateGetKey(scale); final key = cache.updateGetKey(scale, zoomCursor.value);
cursor.addKey(key); cursor.addKey(key);
return FlutterCustomMemoryImageCursor( return FlutterCustomMemoryImageCursor(
pixbuf: cache.data, pixbuf: cache.data,
@ -500,8 +510,13 @@ class _ImagePaintState extends State<ImagePaint> {
class CursorPaint extends StatelessWidget { class CursorPaint extends StatelessWidget {
final String id; final String id;
final RxBool zoomCursor;
const CursorPaint({Key? key, required this.id}) : super(key: key); const CursorPaint({
Key? key,
required this.id,
required this.zoomCursor,
}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -516,13 +531,21 @@ class CursorPaint extends StatelessWidget {
hoty = m.defaultImage!.height / 2; hoty = m.defaultImage!.height / 2;
} }
} }
return CustomPaint( return zoomCursor.isTrue
painter: ImagePainter( ? CustomPaint(
image: m.image ?? m.defaultImage, painter: ImagePainter(
x: m.x - hotx + c.x / c.scale, image: m.image ?? m.defaultImage,
y: m.y - hoty + c.y / c.scale, x: m.x - hotx + c.x / c.scale,
scale: c.scale), y: m.y - hoty + c.y / c.scale,
); scale: c.scale),
)
: CustomPaint(
painter: ImagePainter(
image: m.image ?? m.defaultImage,
x: (m.x - hotx) * c.scale + c.x,
y: (m.y - hoty) * c.scale + c.y,
scale: 1.0),
);
} }
} }

View File

@ -47,7 +47,8 @@ class MenubarState {
} }
_initSet(bool s, bool p) { _initSet(bool s, bool p) {
show = RxBool(s); // Show remubar when connection is established.
show = RxBool(true);
_pin = RxBool(p); _pin = RxBool(p);
} }
@ -1109,6 +1110,25 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
); );
}()); }());
/// Show remote cursor
displayMenu.add(() {
final opt = 'zoom-cursor';
final state = PeerBoolOption.find(widget.id, opt);
return MenuEntrySwitch2<String>(
switchType: SwitchType.scheckbox,
text: translate('Zoom cursor'),
getter: () {
return state;
},
setter: (bool v) async {
state.value = v;
await bind.sessionToggleOption(id: widget.id, value: opt);
},
padding: padding,
dismissOnClicked: true,
);
}());
/// Show quality monitor /// Show quality monitor
displayMenu.add(MenuEntrySwitch<String>( displayMenu.add(MenuEntrySwitch<String>(
switchType: SwitchType.scheckbox, switchType: SwitchType.scheckbox,

View File

@ -696,6 +696,8 @@ class CursorData {
final img2.Image? image; final img2.Image? image;
double scale; double scale;
Uint8List? data; Uint8List? data;
final double hotxOrigin;
final double hotyOrigin;
double hotx; double hotx;
double hoty; double hoty;
final int width; final int width;
@ -707,45 +709,53 @@ class CursorData {
required this.image, required this.image,
required this.scale, required this.scale,
required this.data, required this.data,
required this.hotx, required this.hotxOrigin,
required this.hoty, required this.hotyOrigin,
required this.width, required this.width,
required this.height, required this.height,
}); }) : hotx = hotxOrigin * scale,
hoty = hotxOrigin * scale;
int _doubleToInt(double v) => (v * 10e6).round().toInt(); int _doubleToInt(double v) => (v * 10e6).round().toInt();
double _checkUpdateScale(double scale) { double _checkUpdateScale(double scale, bool shouldScale) {
// Update data if scale changed. double oldScale = this.scale;
if (Platform.isWindows) { if (!shouldScale) {
final tgtWidth = (width * scale).toInt(); scale = 1.0;
final tgtHeight = (width * scale).toInt(); } else {
if (tgtWidth < kMinCursorSize || tgtHeight < kMinCursorSize) { // Update data if scale changed.
double sw = kMinCursorSize.toDouble() / width; if (Platform.isWindows) {
double sh = kMinCursorSize.toDouble() / height; final tgtWidth = (width * scale).toInt();
scale = sw < sh ? sh : sw; final tgtHeight = (width * scale).toInt();
if (tgtWidth < kMinCursorSize || tgtHeight < kMinCursorSize) {
double sw = kMinCursorSize.toDouble() / width;
double sh = kMinCursorSize.toDouble() / height;
scale = sw < sh ? sh : sw;
}
} }
if (_doubleToInt(this.scale) != _doubleToInt(scale)) { }
if (Platform.isWindows) {
if (_doubleToInt(oldScale) != _doubleToInt(scale)) {
data = img2 data = img2
.copyResize( .copyResize(
image!, image!,
width: (width * scale).toInt(), width: (width * scale).toInt(),
height: (height * scale).toInt(), height: (height * scale).toInt(),
interpolation: img2.Interpolation.average,
) )
.getBytes(format: img2.Format.bgra); .getBytes(format: img2.Format.bgra);
} }
} }
this.scale = scale; this.scale = scale;
if (hotx > 0 && hoty > 0) { hotx = hotxOrigin * scale;
// default cursor data hoty = hotyOrigin * scale;
hotx = (width * scale) / 2;
hoty = (height * scale) / 2;
}
return scale; return scale;
} }
String updateGetKey(double scale) { String updateGetKey(double scale, bool shouldScale) {
scale = _checkUpdateScale(scale); scale = _checkUpdateScale(scale, shouldScale);
return '${peerId}_${id}_${_doubleToInt(width * scale)}_${_doubleToInt(height * scale)}'; return '${peerId}_${id}_${_doubleToInt(width * scale)}_${_doubleToInt(height * scale)}';
} }
} }
@ -811,8 +821,6 @@ class CursorModel with ChangeNotifier {
if (_defaultCache == null) { if (_defaultCache == null) {
Uint8List data; Uint8List data;
double scale = 1.0; double scale = 1.0;
double hotx = (defaultCursorImage!.width * scale) / 2;
double hoty = (defaultCursorImage!.height * scale) / 2;
if (Platform.isWindows) { if (Platform.isWindows) {
data = defaultCursorImage!.getBytes(format: img2.Format.bgra); data = defaultCursorImage!.getBytes(format: img2.Format.bgra);
} else { } else {
@ -825,8 +833,8 @@ class CursorModel with ChangeNotifier {
image: defaultCursorImage?.clone(), image: defaultCursorImage?.clone(),
scale: scale, scale: scale,
data: data, data: data,
hotx: hotx, hotxOrigin: defaultCursorImage!.width / 2,
hoty: hoty, hotyOrigin: defaultCursorImage!.height / 2,
width: defaultCursorImage!.width, width: defaultCursorImage!.width,
height: defaultCursorImage!.height, height: defaultCursorImage!.height,
); );
@ -996,10 +1004,8 @@ class CursorModel with ChangeNotifier {
image: Platform.isWindows ? img2.Image.fromBytes(w, h, data) : null, image: Platform.isWindows ? img2.Image.fromBytes(w, h, data) : null,
scale: 1.0, scale: 1.0,
data: data, data: data,
hotx: 0, hotxOrigin: _hotx,
hoty: 0, hotyOrigin: _hoty,
// hotx: _hotx,
// hoty: _hoty,
width: w, width: w,
height: h, height: h,
); );

View File

@ -380,7 +380,7 @@ impl TransferJob {
} }
} }
pub async fn write(&mut self, block: FileTransferBlock, raw: Option<&[u8]>) -> ResultType<()> { pub async fn write(&mut self, block: FileTransferBlock) -> ResultType<()> {
if block.id != self.id { if block.id != self.id {
bail!("Wrong id"); bail!("Wrong id");
} }
@ -402,20 +402,15 @@ impl TransferJob {
let path = format!("{}.download", get_string(&path)); let path = format!("{}.download", get_string(&path));
self.file = Some(File::create(&path).await?); self.file = Some(File::create(&path).await?);
} }
let data = if let Some(data) = raw {
data
} else {
&block.data
};
if block.compressed { if block.compressed {
let tmp = decompress(data); let tmp = decompress(&block.data);
self.file.as_mut().unwrap().write_all(&tmp).await?; self.file.as_mut().unwrap().write_all(&tmp).await?;
self.finished_size += tmp.len() as u64; self.finished_size += tmp.len() as u64;
} else { } else {
self.file.as_mut().unwrap().write_all(data).await?; self.file.as_mut().unwrap().write_all(&block.data).await?;
self.finished_size += data.len() as u64; self.finished_size += block.data.len() as u64;
} }
self.transferred += data.len() as u64; self.transferred += block.data.len() as u64;
Ok(()) Ok(())
} }

View File

@ -915,13 +915,8 @@ impl<T: InvokeUiSession> Remote<T> {
} }
} }
Some(file_response::Union::Block(block)) => { Some(file_response::Union::Block(block)) => {
log::info!(
"file response block, file id:{}, file num: {}",
block.id,
block.file_num
);
if let Some(job) = fs::get_job(block.id, &mut self.write_jobs) { if let Some(job) = fs::get_job(block.id, &mut self.write_jobs) {
if let Err(_err) = job.write(block, None).await { if let Err(_err) = job.write(block).await {
// to-do: add "skip" for writing job // to-do: add "skip" for writing job
} }
self.update_jobs_status(); self.update_jobs_status();

View File

@ -389,5 +389,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("or", ""), ("or", ""),
("Continue with", "使用"), ("Continue with", "使用"),
("Elevate", "提权"), ("Elevate", "提权"),
("Zoom cursor", "缩放鼠标"),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -389,5 +389,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("or", ""), ("or", ""),
("Continue with", ""), ("Continue with", ""),
("Elevate", ""), ("Elevate", ""),
("Zoom cursor", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -389,5 +389,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("or", ""), ("or", ""),
("Continue with", ""), ("Continue with", ""),
("Elevate", ""), ("Elevate", ""),
("Zoom cursor", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -389,5 +389,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("or", ""), ("or", ""),
("Continue with", ""), ("Continue with", ""),
("Elevate", ""), ("Elevate", ""),
("Zoom cursor", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -389,5 +389,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("or", ""), ("or", ""),
("Continue with", ""), ("Continue with", ""),
("Elevate", ""), ("Elevate", ""),
("Zoom cursor", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -389,5 +389,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("or", "o"), ("or", "o"),
("Continue with", "Continuar con"), ("Continue with", "Continuar con"),
("Elevate", ""), ("Elevate", ""),
("Zoom cursor", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -388,5 +388,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("This PC", "This PC"), ("This PC", "This PC"),
("or", "یا"), ("or", "یا"),
("Continue with", "ادامه با"), ("Continue with", "ادامه با"),
("Zoom cursor", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -389,5 +389,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("or", "ou"), ("or", "ou"),
("Continue with", "Continuer avec"), ("Continue with", "Continuer avec"),
("Elevate", ""), ("Elevate", ""),
("Zoom cursor", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -389,5 +389,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("or", "vagy"), ("or", "vagy"),
("Continue with", "Folytatás a következővel"), ("Continue with", "Folytatás a következővel"),
("Elevate", ""), ("Elevate", ""),
("Zoom cursor", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -389,5 +389,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("or", ""), ("or", ""),
("Continue with", ""), ("Continue with", ""),
("Elevate", ""), ("Elevate", ""),
("Zoom cursor", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -389,5 +389,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("or", ""), ("or", ""),
("Continue with", ""), ("Continue with", ""),
("Elevate", ""), ("Elevate", ""),
("Zoom cursor", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -389,5 +389,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("or", ""), ("or", ""),
("Continue with", ""), ("Continue with", ""),
("Elevate", ""), ("Elevate", ""),
("Zoom cursor", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -389,5 +389,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("or", ""), ("or", ""),
("Continue with", ""), ("Continue with", ""),
("Elevate", ""), ("Elevate", ""),
("Zoom cursor", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -389,5 +389,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("or", ""), ("or", ""),
("Continue with", ""), ("Continue with", ""),
("Elevate", ""), ("Elevate", ""),
("Zoom cursor", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -389,5 +389,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("or", "albo"), ("or", "albo"),
("Continue with", "Kontynuuj z"), ("Continue with", "Kontynuuj z"),
("Elevate", ""), ("Elevate", ""),
("Zoom cursor", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -389,5 +389,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("or", ""), ("or", ""),
("Continue with", ""), ("Continue with", ""),
("Elevate", ""), ("Elevate", ""),
("Zoom cursor", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -389,5 +389,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("or", "ou"), ("or", "ou"),
("Continue with", "Continuar com"), ("Continue with", "Continuar com"),
("Elevate", ""), ("Elevate", ""),
("Zoom cursor", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -389,5 +389,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("or", "или"), ("or", "или"),
("Continue with", "Продолжить с"), ("Continue with", "Продолжить с"),
("Elevate", ""), ("Elevate", ""),
("Zoom cursor", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -389,5 +389,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("or", ""), ("or", ""),
("Continue with", ""), ("Continue with", ""),
("Elevate", ""), ("Elevate", ""),
("Zoom cursor", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -389,5 +389,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("or", ""), ("or", ""),
("Continue with", ""), ("Continue with", ""),
("Elevate", ""), ("Elevate", ""),
("Zoom cursor", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -41,9 +41,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("About", "Hakkında"), ("About", "Hakkında"),
("Mute", "Sustur"), ("Mute", "Sustur"),
("Audio Input", "Ses Girişi"), ("Audio Input", "Ses Girişi"),
("Enhancements", ""), ("Enhancements", "Geliştirmeler"),
("Hardware Codec", ""), ("Hardware Codec", "Donanımsal Codec"),
("Adaptive Bitrate", ""), ("Adaptive Bitrate", "Uyarlanabilir Bit Hızı"),
("ID Server", "ID Sunucu"), ("ID Server", "ID Sunucu"),
("Relay Server", "Relay Sunucu"), ("Relay Server", "Relay Sunucu"),
("API Server", "API Sunucu"), ("API Server", "API Sunucu"),
@ -89,8 +89,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Delete", "Sil"), ("Delete", "Sil"),
("Properties", "Özellikler"), ("Properties", "Özellikler"),
("Multi Select", "Çoklu Seçim"), ("Multi Select", "Çoklu Seçim"),
("Select All", ""), ("Select All", "Tümünü Seç"),
("Unselect All", ""), ("Unselect All", "Tüm Seçimi Kaldır"),
("Empty Directory", "Boş Klasör"), ("Empty Directory", "Boş Klasör"),
("Not an empty directory", "Klasör boş değil"), ("Not an empty directory", "Klasör boş değil"),
("Are you sure you want to delete this file?", "Bu dosyayı silmek istediğinize emin misiniz?"), ("Are you sure you want to delete this file?", "Bu dosyayı silmek istediğinize emin misiniz?"),
@ -116,9 +116,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Good image quality", "İyi görüntü kalitesi"), ("Good image quality", "İyi görüntü kalitesi"),
("Balanced", "Dengelenmiş"), ("Balanced", "Dengelenmiş"),
("Optimize reaction time", "Tepki süresini optimize et"), ("Optimize reaction time", "Tepki süresini optimize et"),
("Custom", ""), ("Custom", "Özel"),
("Show remote cursor", "Uzaktaki fare imlecini göster"), ("Show remote cursor", "Uzaktaki fare imlecini göster"),
("Show quality monitor", ""), ("Show quality monitor", "Kalite monitörünü göster"),
("Disable clipboard", "Hafızadaki kopyalanmışları engelle"), ("Disable clipboard", "Hafızadaki kopyalanmışları engelle"),
("Lock after session end", "Bağlantıdan sonra kilitle"), ("Lock after session end", "Bağlantıdan sonra kilitle"),
("Insert", "Ekle"), ("Insert", "Ekle"),
@ -161,8 +161,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Action", "Eylem"), ("Action", "Eylem"),
("Add", "Ekle"), ("Add", "Ekle"),
("Local Port", "Yerel Port"), ("Local Port", "Yerel Port"),
("Local Address", ""), ("Local Address", "Yerel Adres"),
("Change Local Port", ""), ("Change Local Port", "Yerel Port'u Değiştir"),
("setup_server_tip", "Daha hızlı bağlantı için kendi sunucunuzu kurun"), ("setup_server_tip", "Daha hızlı bağlantı için kendi sunucunuzu kurun"),
("Too short, at least 6 characters.", "Çok kısa en az 6 karakter gerekli."), ("Too short, at least 6 characters.", "Çok kısa en az 6 karakter gerekli."),
("The confirmation is not identical.", "Doğrulama yapılamadı."), ("The confirmation is not identical.", "Doğrulama yapılamadı."),
@ -197,7 +197,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Reboot required", "Yeniden başlatma gerekli"), ("Reboot required", "Yeniden başlatma gerekli"),
("Unsupported display server ", "Desteklenmeyen görüntü sunucusu"), ("Unsupported display server ", "Desteklenmeyen görüntü sunucusu"),
("x11 expected", "x11 bekleniyor"), ("x11 expected", "x11 bekleniyor"),
("Port", ""), ("Port", "Port"),
("Settings", "Ayarlar"), ("Settings", "Ayarlar"),
("Username", "Kullanıcı Adı"), ("Username", "Kullanıcı Adı"),
("Invalid port", "Geçersiz port"), ("Invalid port", "Geçersiz port"),
@ -278,7 +278,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("android_stop_service_tip", "Hizmetin kapatılması, kurulan tüm bağlantıları otomatik olarak kapatacaktır."), ("android_stop_service_tip", "Hizmetin kapatılması, kurulan tüm bağlantıları otomatik olarak kapatacaktır."),
("android_version_audio_tip", "Mevcut Android sürümü ses yakalamayı desteklemiyor, lütfen Android 10 veya sonraki bir sürüme yükseltin."), ("android_version_audio_tip", "Mevcut Android sürümü ses yakalamayı desteklemiyor, lütfen Android 10 veya sonraki bir sürüme yükseltin."),
("android_start_service_tip", "Ekran paylaşım hizmetini başlatmak için [Hizmeti Başlat] veya AÇ [Ekran Yakalama] iznine dokunun."), ("android_start_service_tip", "Ekran paylaşım hizmetini başlatmak için [Hizmeti Başlat] veya AÇ [Ekran Yakalama] iznine dokunun."),
("Account", ""), ("Account", "Hesap"),
("Overwrite", "üzerine yaz"), ("Overwrite", "üzerine yaz"),
("This file exists, skip or overwrite this file?", "Bu dosya var, bu dosya atlansın veya üzerine yazılsın mı?"), ("This file exists, skip or overwrite this file?", "Bu dosya var, bu dosya atlansın veya üzerine yazılsın mı?"),
("Quit", "Çıkış"), ("Quit", "Çıkış"),
@ -300,21 +300,21 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Ignore Battery Optimizations", ""), ("Ignore Battery Optimizations", ""),
("android_open_battery_optimizations_tip", ""), ("android_open_battery_optimizations_tip", ""),
("Connection not allowed", "bağlantıya izin verilmedi"), ("Connection not allowed", "bağlantıya izin verilmedi"),
("Legacy mode", ""), ("Legacy mode", "Eski mod"),
("Map mode", ""), ("Map mode", "Haritalama modu"),
("Translate mode", ""), ("Translate mode", "Çeviri modu"),
("Use temporary password", "Geçici şifre kullan"), ("Use temporary password", "Geçici şifre kullan"),
("Use permanent password", "Kalıcı şifre kullan"), ("Use permanent password", "Kalıcı şifre kullan"),
("Use both passwords", "İki şifreyide kullan"), ("Use both passwords", "İki şifreyide kullan"),
("Set permanent password", "Kalıcı şifre oluştur"), ("Set permanent password", "Kalıcı şifre oluştur"),
("Set temporary password length", ""), ("Set temporary password length", "Geçici şifre oluştur"),
("Enable Remote Restart", "Uzaktan yeniden başlatmayı aktif et"), ("Enable Remote Restart", "Uzaktan yeniden başlatmayı aktif et"),
("Allow remote restart", "Uzaktan yeniden başlatmaya izin ver"), ("Allow remote restart", "Uzaktan yeniden başlatmaya izin ver"),
("Restart Remote Device", "Uzaktaki cihazı yeniden başlat"), ("Restart Remote Device", "Uzaktaki cihazı yeniden başlat"),
("Are you sure you want to restart", "Yeniden başlatmak istediğinize emin misin?"), ("Are you sure you want to restart", "Yeniden başlatmak istediğinize emin misin?"),
("Restarting Remote Device", "Uzaktan yeniden başlatılıyor"), ("Restarting Remote Device", "Uzaktan yeniden başlatılıyor"),
("remote_restarting_tip", ""), ("remote_restarting_tip", "remote_restarting_tip"),
("Copied", ""), ("Copied", "Kopyalandı"),
("Exit Fullscreen", "Tam ekrandan çık"), ("Exit Fullscreen", "Tam ekrandan çık"),
("Fullscreen", "Tam ekran"), ("Fullscreen", "Tam ekran"),
("Mobile Actions", "Mobil İşlemler"), ("Mobile Actions", "Mobil İşlemler"),
@ -332,62 +332,63 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Insecure Connection", "Güvenli Bağlantı"), ("Insecure Connection", "Güvenli Bağlantı"),
("Scale original", "Orijinali ölçeklendir"), ("Scale original", "Orijinali ölçeklendir"),
("Scale adaptive", "Ölçek uyarlanabilir"), ("Scale adaptive", "Ölçek uyarlanabilir"),
("General", ""), ("General", "Genel"),
("Security", ""), ("Security", "Güvenlik"),
("Account", ""), ("Account", "Hesap"),
("Theme", ""), ("Theme", "Tema"),
("Dark Theme", ""), ("Dark Theme", "Koyu Tema"),
("Dark", ""), ("Dark", "Koyu"),
("Light", ""), ("Light", "ık"),
("Follow System", ""), ("Follow System", "Sisteme Uy"),
("Enable hardware codec", ""), ("Enable hardware codec", "Donanımsal codec aktif et"),
("Unlock Security Settings", ""), ("Unlock Security Settings", "Güvenlik Ayarlarını"),
("Enable Audio", ""), ("Enable Audio", "Sesi Aktif Et"),
("Temporary Password Length", ""), ("Temporary Password Length", "Geçici Şifre Uzunluğu"),
("Unlock Network Settings", ""), ("Unlock Network Settings", "Ağ Ayarlarını"),
("Server", ""), ("Server", "Sunucu"),
("Direct IP Access", ""), ("Direct IP Access", "Direk IP Erişimi"),
("Proxy", ""), ("Proxy", "Vekil"),
("Port", ""), ("Port", "Port"),
("Apply", ""), ("Apply", "Uygula"),
("Disconnect all devices?", ""), ("Disconnect all devices?", "Tüm cihazların bağlantısını kes?"),
("Clear", ""), ("Clear", "Temizle"),
("Audio Input Device", ""), ("Audio Input Device", "Ses Giriş Aygıtı"),
("Deny remote access", ""), ("Deny remote access", "Uzak erişime izin verme"),
("Use IP Whitelisting", ""), ("Use IP Whitelisting", "IP Beyaz Listeyi Kullan"),
("Network", ""), ("Network", ""),
("Enable RDP", ""), ("Enable RDP", "RDP Aktif Et"),
("Pin menubar", "Menü çubuğunu sabitle"), ("Pin menubar", "Menü çubuğunu sabitle"),
("Unpin menubar", "Menü çubuğunun sabitlemesini kaldır"), ("Unpin menubar", "Menü çubuğunun sabitlemesini kaldır"),
("Recording", ""), ("Recording", "Kayıt Ediliyor"),
("Directory", ""), ("Directory", "Klasör"),
("Automatically record incoming sessions", ""), ("Automatically record incoming sessions", "Gelen oturumları otomatik olarak kayıt et"),
("Change", ""), ("Change", "Değiştir"),
("Start session recording", ""), ("Start session recording", "Oturum kaydını başlat"),
("Stop session recording", ""), ("Stop session recording", "Oturum kaydını sonlandır"),
("Enable Recording Session", ""), ("Enable Recording Session", "Kayıt Oturumunu Aktif Et"),
("Allow recording session", ""), ("Allow recording session", "Oturum kaydına izin ver"),
("Enable LAN Discovery", ""), ("Enable LAN Discovery", "Yerel Ağ Keşfine İzin Ver"),
("Deny LAN Discovery", ""), ("Deny LAN Discovery", "Yerl Ağ Keşfine İzin Verme"),
("Write a message", ""), ("Write a message", "Bir mesaj yazın"),
("Prompt", ""), ("Prompt", ""),
("Please wait for confirmation of UAC...", ""), ("Please wait for confirmation of UAC...", "UAC onayı için lütfen bekleyiniz..."),
("elevated_foreground_window_tip", ""), ("elevated_foreground_window_tip", "elevated_foreground_window_tip"),
("Disconnected", ""), ("Disconnected", "Bağlantı Kesildi"),
("Other", ""), ("Other", "Diğer"),
("Confirm before closing multiple tabs", ""), ("Confirm before closing multiple tabs", "Çoklu sekmeleri kapatmadan önce onayla"),
("Keyboard Settings", ""), ("Keyboard Settings", "Klavye Ayarları"),
("Custom", ""), ("Custom", "Özel"),
("Full Access", ""), ("Full Access", "Tam Erişim"),
("Screen Share", ""), ("Screen Share", "Ekran Paylaşımı"),
("Wayland requires Ubuntu 21.04 or higher version.", "Wayland, Ubuntu 21.04 veya daha yüksek bir sürüm gerektirir."), ("Wayland requires Ubuntu 21.04 or higher version.", "Wayland, Ubuntu 21.04 veya daha yüksek bir sürüm gerektirir."),
("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", "Wayland, linux dağıtımının daha yüksek bir sürümünü gerektirir. Lütfen X11 masaüstünü deneyin veya işletim sisteminizi değiştirin."), ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", "Wayland, linux dağıtımının daha yüksek bir sürümünü gerektirir. Lütfen X11 masaüstünü deneyin veya işletim sisteminizi değiştirin."),
("JumpLink", "View"), ("JumpLink", "View"),
("Please Select the screen to be shared(Operate on the peer side).", "Lütfen paylaşılacak ekranı seçiniz (Ekran tarafında çalıştırın)."), ("Please Select the screen to be shared(Operate on the peer side).", "Lütfen paylaşılacak ekranı seçiniz (Ekran tarafında çalıştırın)."),
("Show RustDesk", ""), ("Show RustDesk", "RustDesk'i Göster"),
("This PC", ""), ("This PC", "Bu PC"),
("or", ""), ("or", "veya"),
("Continue with", ""), ("Continue with", "bununla devam et"),
("Elevate", ""), ("Elevate", "Yükseltme"),
("Zoom cursor", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -389,5 +389,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("or", ""), ("or", ""),
("Continue with", ""), ("Continue with", ""),
("Elevate", "提權"), ("Elevate", "提權"),
("Zoom cursor", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -389,5 +389,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("or", ""), ("or", ""),
("Continue with", ""), ("Continue with", ""),
("Elevate", ""), ("Elevate", ""),
("Zoom cursor", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -389,5 +389,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("or", ""), ("or", ""),
("Continue with", ""), ("Continue with", ""),
("Elevate", ""), ("Elevate", ""),
("Zoom cursor", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -1629,7 +1629,8 @@ async fn start_ipc(
file_num, file_num,
data, data,
compressed}) = data { compressed}) = data {
stream.send(&Data::FS(ipc::FS::WriteBlock{id, file_num, data, compressed})).await?; stream.send(&Data::FS(ipc::FS::WriteBlock{id, file_num, data: Bytes::new(), compressed})).await?;
stream.send_raw(data).await?;
} else { } else {
stream.send(&data).await?; stream.send(&data).await?;
} }

View File

@ -1,3 +1,5 @@
#[cfg(any(target_os = "android", target_os = "ios", feature = "flutter"))]
use std::iter::FromIterator;
#[cfg(windows)] #[cfg(windows)]
use std::sync::Arc; use std::sync::Arc;
use std::{ use std::{
@ -8,8 +10,6 @@ use std::{
RwLock, RwLock,
}, },
}; };
#[cfg(any(target_os = "android", target_os = "ios", feature = "flutter"))]
use std::iter::FromIterator;
#[cfg(windows)] #[cfg(windows)]
use clipboard::{cliprdr::CliprdrClientContext, empty_clipboard, set_conn_enabled, ContextSend}; use clipboard::{cliprdr::CliprdrClientContext, empty_clipboard, set_conn_enabled, ContextSend};
@ -343,8 +343,15 @@ impl<T: InvokeUiCM> IpcTaskRunner<T> {
Data::ChatMessage { text } => { Data::ChatMessage { text } => {
self.cm.new_message(self.conn_id, text); self.cm.new_message(self.conn_id, text);
} }
Data::FS(fs) => { Data::FS(mut fs) => {
handle_fs(fs, &mut write_jobs, &self.tx).await; if let ipc::FS::WriteBlock { id, file_num, data: _, compressed } = fs {
if let Ok(bytes) = self.stream.next_raw().await {
fs = ipc::FS::WriteBlock{id, file_num, data:bytes.into(), compressed};
handle_fs(fs, &mut write_jobs, &self.tx).await;
}
} else {
handle_fs(fs, &mut write_jobs, &self.tx).await;
}
} }
#[cfg(windows)] #[cfg(windows)]
Data::ClipbaordFile(_clip) => { Data::ClipbaordFile(_clip) => {
@ -597,16 +604,13 @@ async fn handle_fs(fs: ipc::FS, write_jobs: &mut Vec<fs::TransferJob>, tx: &Unbo
} => { } => {
if let Some(job) = fs::get_job(id, write_jobs) { if let Some(job) = fs::get_job(id, write_jobs) {
if let Err(err) = job if let Err(err) = job
.write( .write(FileTransferBlock {
FileTransferBlock { id,
id, file_num,
file_num, data,
data, compressed,
compressed, ..Default::default()
..Default::default() })
},
None,
)
.await .await
{ {
send_raw(fs::new_error(id, err, file_num), &tx); send_raw(fs::new_error(id, err, file_num), &tx);