Skip to content

Commit 7a94d47

Browse files
committed
feat: Add password save option for Quick Connect, close #746
fix: Resolve bugs in Quick Connect This commit addresses issue #746 by adding an option to save passwords in the "Quick Connect" feature. Additionally, it includes fixes for various bugs found in the Quick Connect.
1 parent 63b109f commit 7a94d47

25 files changed

+262
-96
lines changed

Ui/Controls/PasswordInput.xaml.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,29 @@ private void ToggleButton_Checked(object sender, RoutedEventArgs e)
8181
});
8282
});
8383
}
84-
private void SetSelection(PasswordBox passwordBox, int start, int length)
84+
private void SetSelection(PasswordBox passwordBox, int start, int length = 0)
8585
{
86+
if (start < 0) start = 0;
87+
if (length < 0) length = 0;
8688
passwordBox.GetType().GetMethod("Select", BindingFlags.Instance | BindingFlags.NonPublic)?.Invoke(passwordBox, new object[] { start, length });
8789
}
8890
private void ToggleButton_Unchecked(object sender, RoutedEventArgs e)
8991
{
9092
CipherTextBox.Focus();
91-
SetSelection(CipherTextBox, CipherTextBox.Password.Length, 0);
93+
SetSelection(CipherTextBox, CipherTextBox.Password.Length);
9294
PlainTextBox.Visibility = Visibility.Hidden;
9395
}
96+
97+
98+
99+
100+
public int CaretIndex
101+
{
102+
set
103+
{
104+
PlainTextBox.CaretIndex = value;
105+
SetSelection(CipherTextBox, value);
106+
}
107+
}
94108
}
95109
}

Ui/Resources/Languages/cs-cz.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,4 +314,5 @@
314314
<s:String x:Key="Copy the port along with the address when copying">Při kopírování zkopírujte port spolu s adresou</s:String>
315315
<s:String x:Key="Place the close button on the left side to prevent accidental touches">Umístěte zavírací tlačítko na levou stranu, abyste zabránili náhodným dotykům</s:String>
316316
<s:String x:Key="Ask for password when open connect">Při otevření připojení požádat o heslo</s:String>
317+
<s:String x:Key="Remember the information above">Pamatujte na výše uvedené informace</s:String>
317318
</ResourceDictionary>

Ui/Resources/Languages/de-de.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,4 +314,5 @@
314314
<s:String x:Key="Copy the port along with the address when copying">Beim Kopieren Adresse mit Port verwenden</s:String>
315315
<s:String x:Key="Place the close button on the left side to prevent accidental touches">Platzieren Sie die Schließtaste auf der linken Seite, um versehentliche Berührungen zu verhindern</s:String>
316316
<s:String x:Key="Ask for password when open connect">Beim Öffnen der Verbindung nach dem Passwort fragen</s:String>
317+
<s:String x:Key="Remember the information above">Denken Sie an die obigen Informationen</s:String>
317318
</ResourceDictionary>

Ui/Resources/Languages/en-us.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,4 +314,5 @@
314314
<s:String x:Key="Copy the port along with the address when copying">Copy the port along with the address when copying</s:String>
315315
<s:String x:Key="Place the close button on the left side to prevent accidental touches">Place the close button on the left side to prevent accidental touches</s:String>
316316
<s:String x:Key="Ask for password when open connect">Ask for password when open connect</s:String>
317+
<s:String x:Key="Remember the information above">Remember the information above</s:String>
317318
</ResourceDictionary>

Ui/Resources/Languages/fr-fr.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,4 +314,5 @@
314314
<s:String x:Key="Copy the port along with the address when copying">Copiez le port avec l'adresse lors de la copie</s:String>
315315
<s:String x:Key="Place the close button on the left side to prevent accidental touches">Placez le bouton de fermeture sur le côté gauche pour éviter les contacts accidentels</s:String>
316316
<s:String x:Key="Ask for password when open connect">Demander un mot de passe lors de l'ouverture de la connexion</s:String>
317+
<s:String x:Key="Remember the information above">N'oubliez pas les informations ci-dessus</s:String>
317318
</ResourceDictionary>

Ui/Resources/Languages/gl-es.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,4 +314,5 @@
314314
<s:String x:Key="Copy the port along with the address when copying">Copia o porto xunto co enderezo ao copiar</s:String>
315315
<s:String x:Key="Place the close button on the left side to prevent accidental touches">Coloque o botón de peche no lado esquerdo para evitar toques accidentais</s:String>
316316
<s:String x:Key="Ask for password when open connect">Solicitar o contrasinal ao abrir a conexión</s:String>
317+
<s:String x:Key="Remember the information above">Lembra a información anterior</s:String>
317318
</ResourceDictionary>

Ui/Resources/Languages/glossary.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,3 +348,4 @@ Automatically focus on the content when selecting a tab;Automatically focus on t
348348
Copy the port along with the address when copying;Copy the port along with the address when copying;复制地址时同时复制端口;;Beim Kopieren Adresse mit Port verwenden;;;;;;;Копировать порт вместе с адресом при копировании
349349
Place the close button on the left side to prevent accidental touches;Place the close button on the left side to prevent accidental touches;将关闭按钮放在左侧以防止误触;;;;;;;;;
350350
Ask for password when open connect;Ask for password when open connect;打开连接时输入密码;;;;;;;;;
351+
Remember the information above;Remember the information above;记住上述信息;;;;;;;;;

Ui/Resources/Languages/glossary_translated_by_google.csv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,4 +355,5 @@ Use vertical lines to separate descriptions;Use vertical lines to separate descr
355355
Automatically focus on the content when selecting a tab;Automatically focus on the content when selecting a tab;选择 tab 后自动聚焦内容;Při výběru karty se automaticky zaměří na obsah;Automatisch Focus auf den Inhalten setzten, wenn ein Tab ausgwählt wird;Se concentrer automatiquement sur le contenu lors de la sélection d'un onglet;Concentre-se automaticamente no conteúdo ao selecionar uma guia;タブを選択すると自動的にコンテンツにフォーカスします;選擇選項卡時自動對焦內容;Concéntrase automaticamente no contido ao seleccionar unha pestana;Automatycznie skupiaj uwagę na treści podczas wybierania karty;Автоматически фокусироваться на содержимом при выборе вкладки
356356
Copy the port along with the address when copying;Copy the port along with the address when copying;复制地址时同时复制端口;Při kopírování zkopírujte port spolu s adresou;Beim Kopieren Adresse mit Port verwenden;Copiez le port avec l'adresse lors de la copie;Copie a porta junto com o endereço ao copiar;コピーするときはアドレスと一緒にポートもコピーします;複製的時候把連接埠和位址一起複製;Copia o porto xunto co enderezo ao copiar;Podczas kopiowania skopiuj port wraz z adresem;Копировать порт вместе с адресом при копировании
357357
Place the close button on the left side to prevent accidental touches;Place the close button on the left side to prevent accidental touches;将关闭按钮放在左侧以防止误触;Umístěte zavírací tlačítko na levou stranu, abyste zabránili náhodným dotykům;Platzieren Sie die Schließtaste auf der linken Seite, um versehentliche Berührungen zu verhindern;Placez le bouton de fermeture sur le côté gauche pour éviter les contacts accidentels;Coloque o botão fechar no lado esquerdo para evitar toques acidentais;誤操作を防ぐために閉じるボタンを左側に配置;將關閉按鈕置於左側,防止誤觸;Coloque o botón de peche no lado esquerdo para evitar toques accidentais;Umieść przycisk zamykania po lewej stronie, aby zapobiec przypadkowym dotknięciom;Разместите кнопку закрытия слева, чтобы предотвратить случайные нажатия.
358-
Ask for password when open connect;Ask for password when open connect;打开连接时再输入密码;Při otevření připojení požádat o heslo;Beim Öffnen der Verbindung nach dem Passwort fragen;Demander un mot de passe lors de l'ouverture de la connexion;Pedir senha quando abrir conectar;接続を開くときにパスワードを要求する;開啟連線時詢問密碼;Solicitar o contrasinal ao abrir a conexión;Zapytaj o hasło przy otwieraniu połączenia;Запросить пароль при открытии подключения
358+
Ask for password when open connect;Ask for password when open connect;打开连接时输入密码;Při otevření připojení požádat o heslo;Beim Öffnen der Verbindung nach dem Passwort fragen;Demander un mot de passe lors de l'ouverture de la connexion;Pedir senha quando abrir conectar;接続を開くときにパスワードを要求する;開啟連線時詢問密碼;Solicitar o contrasinal ao abrir a conexión;Zapytaj o hasło przy otwieraniu połączenia;Запросить пароль при открытии подключения
359+
Remember the information above;Remember the information above;记住上述信息;Pamatujte na výše uvedené informace;Denken Sie an die obigen Informationen;N'oubliez pas les informations ci-dessus;Lembre-se das informações acima;上記の情報を覚えておいてください;記住上面的訊息;Lembra a información anterior;Zapamiętaj powyższe informacje;Помните информацию выше

Ui/Resources/Languages/ja-jp.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,4 +314,5 @@
314314
<s:String x:Key="Copy the port along with the address when copying">コピーするときはアドレスと一緒にポートもコピーします</s:String>
315315
<s:String x:Key="Place the close button on the left side to prevent accidental touches">誤操作を防ぐために閉じるボタンを左側に配置</s:String>
316316
<s:String x:Key="Ask for password when open connect">接続を開くときにパスワードを要求する</s:String>
317+
<s:String x:Key="Remember the information above">上記の情報を覚えておいてください</s:String>
317318
</ResourceDictionary>

Ui/Resources/Languages/pl-pl.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,4 +314,5 @@
314314
<s:String x:Key="Copy the port along with the address when copying">Podczas kopiowania skopiuj port wraz z adresem</s:String>
315315
<s:String x:Key="Place the close button on the left side to prevent accidental touches">Umieść przycisk zamykania po lewej stronie, aby zapobiec przypadkowym dotknięciom</s:String>
316316
<s:String x:Key="Ask for password when open connect">Zapytaj o hasło przy otwieraniu połączenia</s:String>
317+
<s:String x:Key="Remember the information above">Zapamiętaj powyższe informacje</s:String>
317318
</ResourceDictionary>

0 commit comments

Comments
 (0)