VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2018-04-29 15:33:33 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2018-04-29 15:52:43 (GMT)
commite39f5fa5d6b1b09df16271cabb1dda5d42c0b980 (patch)
treecb3aff4a8c04c6b39c014a37e0683fd5b7817d94 /src/Main/Forms
parent7a842266b3f2e69d1706aec3039b661e3a5b25dd (diff)
downloadVeraCrypt-e39f5fa5d6b1b09df16271cabb1dda5d42c0b980.zip
VeraCrypt-e39f5fa5d6b1b09df16271cabb1dda5d42c0b980.tar.gz
MacOSX: support pasting values to password fields using keyboard (CMD+V and CMD+A now working properly). This make using password managers with VeraCrypt easier.
Diffstat (limited to 'src/Main/Forms')
-rw-r--r--src/Main/Forms/ChangePasswordDialog.cpp15
-rw-r--r--src/Main/Forms/ChangePasswordDialog.h4
-rw-r--r--src/Main/Forms/MountOptionsDialog.cpp16
-rw-r--r--src/Main/Forms/MountOptionsDialog.h4
-rw-r--r--src/Main/Forms/VolumeCreationWizard.cpp15
-rw-r--r--src/Main/Forms/VolumeCreationWizard.h4
6 files changed, 58 insertions, 0 deletions
diff --git a/src/Main/Forms/ChangePasswordDialog.cpp b/src/Main/Forms/ChangePasswordDialog.cpp
index 2f8e1e4..819d9bf 100644
--- a/src/Main/Forms/ChangePasswordDialog.cpp
+++ b/src/Main/Forms/ChangePasswordDialog.cpp
@@ -18,6 +18,17 @@
namespace VeraCrypt
{
+#ifdef TC_MACOSX
+
+ bool ChangePasswordDialog::ProcessEvent(wxEvent& event)
+ {
+ if(GraphicUserInterface::HandlePasswordEntryCustomEvent (event))
+ return true;
+ else
+ return ChangePasswordDialogBase::ProcessEvent(event);
+ }
+#endif
+
ChangePasswordDialog::ChangePasswordDialog (wxWindow* parent, shared_ptr <VolumePath> volumePath, Mode::Enum mode, shared_ptr <VolumePassword> password, shared_ptr <KeyfileList> keyfiles, shared_ptr <VolumePassword> newPassword, shared_ptr <KeyfileList> newKeyfiles)
: ChangePasswordDialogBase (parent), DialogMode (mode), Path (volumePath)
{
@@ -57,6 +68,10 @@ namespace VeraCrypt
default:
throw ParameterIncorrect (SRC_POS);
}
+
+#ifdef TC_MACOSX
+ GraphicUserInterface::InstallPasswordEntryCustomKeyboardShortcuts (this);
+#endif
CurrentPasswordPanel = new VolumePasswordPanel (this, NULL, password, false, keyfiles, false, true, true, false, true, true);
CurrentPasswordPanel->UpdateEvent.Connect (EventConnector <ChangePasswordDialog> (this, &ChangePasswordDialog::OnPasswordPanelUpdate));
diff --git a/src/Main/Forms/ChangePasswordDialog.h b/src/Main/Forms/ChangePasswordDialog.h
index 242bd96..66fbfec 100644
--- a/src/Main/Forms/ChangePasswordDialog.h
+++ b/src/Main/Forms/ChangePasswordDialog.h
@@ -35,6 +35,10 @@ namespace VeraCrypt
ChangePasswordDialog (wxWindow* parent, shared_ptr <VolumePath> volumePath, Mode::Enum mode = Mode::ChangePasswordAndKeyfiles, shared_ptr <VolumePassword> password = shared_ptr <VolumePassword> (), shared_ptr <KeyfileList> keyfiles = shared_ptr <KeyfileList> (), shared_ptr <VolumePassword> newPassword = shared_ptr <VolumePassword> (), shared_ptr <KeyfileList> newKeyfiles = shared_ptr <KeyfileList> ());
virtual ~ChangePasswordDialog ();
+
+#ifdef TC_MACOSX
+ virtual bool ProcessEvent(wxEvent& event);
+#endif
protected:
void OnOKButtonClick (wxCommandEvent& event);
diff --git a/src/Main/Forms/MountOptionsDialog.cpp b/src/Main/Forms/MountOptionsDialog.cpp
index 9a9f269..c33cf9f 100644
--- a/src/Main/Forms/MountOptionsDialog.cpp
+++ b/src/Main/Forms/MountOptionsDialog.cpp
@@ -17,6 +17,17 @@
namespace VeraCrypt
{
+#ifdef TC_MACOSX
+
+ bool MountOptionsDialog::ProcessEvent(wxEvent& event)
+ {
+ if(GraphicUserInterface::HandlePasswordEntryCustomEvent (event))
+ return true;
+ else
+ return MountOptionsDialogBase::ProcessEvent(event);
+ }
+#endif
+
MountOptionsDialog::MountOptionsDialog (wxWindow *parent, MountOptions &options, const wxString &title, bool disableMountOptions)
: MountOptionsDialogBase (parent, wxID_ANY, wxString()
#ifdef __WXGTK__ // GTK apparently needs wxRESIZE_BORDER to support dynamic resizing
@@ -33,6 +44,11 @@ namespace VeraCrypt
if (disableMountOptions)
OptionsButton->Show (false);
+
+
+#ifdef TC_MACOSX
+ GraphicUserInterface::InstallPasswordEntryCustomKeyboardShortcuts (this);
+#endif
PasswordPanel = new VolumePasswordPanel (this, &options, options.Password, disableMountOptions, options.Keyfiles, !disableMountOptions, true, true, false, true, true);
PasswordPanel->SetCacheCheckBoxValidator (wxGenericValidator (&Options.CachePassword));
diff --git a/src/Main/Forms/MountOptionsDialog.h b/src/Main/Forms/MountOptionsDialog.h
index 4a2b38b..6366ce8 100644
--- a/src/Main/Forms/MountOptionsDialog.h
+++ b/src/Main/Forms/MountOptionsDialog.h
@@ -24,6 +24,10 @@ namespace VeraCrypt
public:
MountOptionsDialog (wxWindow* parent, MountOptions &options, const wxString &title = wxEmptyString, bool disableMountOptions = false);
void OnShow ();
+
+#ifdef TC_MACOSX
+ virtual bool ProcessEvent(wxEvent& event);
+#endif
protected:
void OnInitDialog (wxInitDialogEvent& event);
diff --git a/src/Main/Forms/VolumeCreationWizard.cpp b/src/Main/Forms/VolumeCreationWizard.cpp
index 15c92c3..b28b1c3 100644
--- a/src/Main/Forms/VolumeCreationWizard.cpp
+++ b/src/Main/Forms/VolumeCreationWizard.cpp
@@ -36,6 +36,17 @@
namespace VeraCrypt
{
+#ifdef TC_MACOSX
+
+ bool VolumeCreationWizard::ProcessEvent(wxEvent& event)
+ {
+ if(GraphicUserInterface::HandlePasswordEntryCustomEvent (event))
+ return true;
+ else
+ return WizardFrame::ProcessEvent(event);
+ }
+#endif
+
VolumeCreationWizard::VolumeCreationWizard (wxWindow* parent)
: WizardFrame (parent),
CrossPlatformSupport (true),
@@ -55,6 +66,10 @@ namespace VeraCrypt
SetTitle (LangString["INTRO_TITLE"]);
SetImage (Resources::GetVolumeCreationWizardBitmap (Gui->GetCharHeight (this) * 21));
SetMaxStaticTextWidth (55);
+
+#ifdef TC_MACOSX
+ GraphicUserInterface::InstallPasswordEntryCustomKeyboardShortcuts (this);
+#endif
SetStep (Step::VolumeHostType);
diff --git a/src/Main/Forms/VolumeCreationWizard.h b/src/Main/Forms/VolumeCreationWizard.h
index 85203b9..c408742 100644
--- a/src/Main/Forms/VolumeCreationWizard.h
+++ b/src/Main/Forms/VolumeCreationWizard.h
@@ -24,6 +24,10 @@ namespace VeraCrypt
VolumeCreationWizard (wxWindow* parent);
~VolumeCreationWizard ();
+#ifdef TC_MACOSX
+ virtual bool ProcessEvent(wxEvent& event);
+#endif
+
protected:
struct Step
{