Kaydet (Commit) 87cf343f authored tarafından Szymon Kłos's avatar Szymon Kłos

added 'Remember password' checkbox

Change-Id: I4231acd92d263ca772a1aa7b3e178c5681ee86e0
üst a38e2ff7
......@@ -34,6 +34,7 @@ private:
std::shared_ptr< DetailsContainer > m_xCurrentDetails;
VclPtr<Edit> m_pEDUsername;
VclPtr<CheckBox> m_pCBPassword;
VclPtr<Edit> m_pEDPassword;
VclPtr<FixedText> m_pFTPasswordLabel;
VclPtr<OKButton> m_pBTOk;
......@@ -72,7 +73,7 @@ public :
OUString GetPassword() { return m_pEDPassword->GetText(); };
OUString GetUser() { return m_pEDUsername->GetText(); };
void ShowPasswordControl( bool bShow = true ) { m_pEDPassword->Show( bShow ); m_pFTPasswordLabel->Show( bShow ); }
void ShowPasswordControl( bool bShow = true );
private:
......@@ -85,6 +86,7 @@ private:
DECL_LINK ( SelectTypeHdl, void * );
DECL_LINK ( EditLabelHdl, void * );
DECL_LINK ( EditUsernameHdl, void * );
DECL_LINK ( ToggledPassHdl, CheckBox * pCheckBox );
};
......
......@@ -31,11 +31,14 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent)
get( m_pBTCancel, "cancel" );
get( m_pBTDelete, "delete" );
get( m_pBTRepoRefresh, "repositoriesRefresh" );
get( m_pCBPassword, "rememberPassword" );
get( m_pEDPassword, "password" );
get( m_pFTPasswordLabel, "passwordLabel" );
m_pEDPassword->Hide();
m_pFTPasswordLabel->Hide();
m_pCBPassword->Hide();
m_pCBPassword->SetToggleHdl( LINK( this, PlaceEditDialog, ToggledPassHdl ) );
m_pBTOk->SetClickHdl( LINK( this, PlaceEditDialog, OKHdl) );
m_pBTOk->Enable( false );
......@@ -64,11 +67,14 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent, const std::shared_ptr<Pla
get( m_pBTCancel, "cancel" );
get( m_pBTDelete, "delete" );
get( m_pTypeGrid, "TypeGrid" );
get( m_pCBPassword, "rememberPassword" );
get( m_pEDPassword, "password" );
get( m_pFTPasswordLabel, "passwordLabel" );
m_pEDPassword->Hide();
m_pFTPasswordLabel->Hide();
m_pCBPassword->Hide();
m_pCBPassword->SetToggleHdl( LINK( this, PlaceEditDialog, ToggledPassHdl ) );
m_pBTOk->SetClickHdl( LINK( this, PlaceEditDialog, OKHdl) );
m_pBTDelete->SetClickHdl ( LINK( this, PlaceEditDialog, DelHdl) );
......@@ -141,6 +147,28 @@ std::shared_ptr<Place> PlaceEditDialog::GetPlace()
return std::make_shared<Place>(m_pEDServerName->GetText(), GetServerUrl(), true);
}
void PlaceEditDialog::ShowPasswordControl( bool bShow )
{
m_pCBPassword->Show( bShow );
m_pEDPassword->Show( bShow );
m_pFTPasswordLabel->Show( bShow );
ToggledPassHdl( m_pCBPassword );
}
IMPL_LINK( PlaceEditDialog, ToggledPassHdl, CheckBox*, pCheckBox )
{
bool bChecked = pCheckBox->IsChecked();
m_pEDPassword->Enable( bChecked );
m_pFTPasswordLabel->Enable( bChecked );
if ( !bChecked )
m_pEDPassword->SetText( "" );
return 0;
}
void PlaceEditDialog::InitDetails( )
{
// Create CMIS controls for each server type
......@@ -326,6 +354,7 @@ IMPL_LINK_NOARG( PlaceEditDialog, SelectTypeHdl )
m_nCurrentType = nPos;
m_xCurrentDetails->show();
ToggledPassHdl( m_pCBPassword );
SetSizePixel(GetOptimalSize());
......
......@@ -192,7 +192,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">7</property>
<property name="top_attach">8</property>
</packing>
</child>
<child>
......@@ -204,7 +204,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">7</property>
<property name="top_attach">8</property>
</packing>
</child>
<child>
......@@ -298,7 +298,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
<property name="top_attach">7</property>
</packing>
</child>
<child>
......@@ -310,7 +310,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">6</property>
<property name="top_attach">7</property>
</packing>
</child>
<child>
......@@ -411,12 +411,12 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Password*:</property>
<property name="label" translatable="yes">Password:</property>
<property name="mnemonic_widget">password</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
......@@ -426,6 +426,20 @@
<property name="visibility">False</property>
<property name="invisible_char"></property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="rememberPassword">
<property name="label" translatable="yes">Remember password</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">5</property>
......@@ -434,6 +448,9 @@
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment