Permalink
Browse files

RemoteLoginDlg - reformats

  • Loading branch information...
1 parent 082de7b commit bf2383c10b99b2f663c468de12480aece8824945 @adamv adamv committed with adamv Nov 3, 2009
Showing with 16 additions and 20 deletions.
  1. +1 −3 src/EditorFrame.cpp
  2. +11 −12 src/RemoteLoginDlg.cpp
  3. +4 −5 src/RemoteLoginDlg.h
View
@@ -1818,10 +1818,9 @@ wxDateTime EditorFrame::GetRemoteDate(const wxString& url, const RemoteProfile*
return GetRemoteThread().GetModDate(url, *rp);
}
+// Asks our settings to get or create a matching remote profile.
const RemoteProfile* EditorFrame::GetRemoteProfile(const wxString& url, bool withDir) {
wxASSERT(eDocumentPath::IsRemotePath(url));
-
- // Get (or create) matching profile
return m_generalSettings.GetRemoteProfileFromUrl(url, withDir);
}
@@ -1832,7 +1831,6 @@ bool EditorFrame::AskRemoteLogin(const RemoteProfile* rp) {
// this also updates rp with the new login
m_generalSettings.SetRemoteProfileLogin(rp, dlg.GetUsername(), dlg.GetPassword(), dlg.GetSaveProfile());
-
return true;
}
@@ -13,8 +13,9 @@
#include "RemoteLoginDlg.h"
-RemoteLoginDlg::RemoteLoginDlg(wxWindow *parent, const wxString& username, const wxString& site, bool askToSave)
-: wxDialog (parent, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER) {
+RemoteLoginDlg::RemoteLoginDlg(wxWindow *parent, const wxString& username, const wxString& site, bool askToSave):
+ wxDialog (parent, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
+{
SetTitle (_("Login failed"));
wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
@@ -48,21 +49,19 @@ RemoteLoginDlg::RemoteLoginDlg(wxWindow *parent, const wxString& username, const
mainSizer->Add(CreateButtonSizer(wxOK|wxCANCEL), 0, wxEXPAND|wxALL, 5);
}
- if (!askToSave) mainSizer->Hide(m_saveProfile);
- if (!username.empty()) {
+ if (!askToSave)
+ mainSizer->Hide(m_saveProfile);
+
+ if (username.empty()) m_profileUsername->SetFocus();
+ else {
m_profileUsername->SetValue(username);
m_profilePassword->SetFocus();
}
- else m_profileUsername->SetFocus();
SetSizerAndFit(mainSizer);
Centre();
}
-
-
-
-
-
-
-
+wxString RemoteLoginDlg::GetUsername() const { return m_profileUsername->GetValue(); }
+wxString RemoteLoginDlg::GetPassword() const { return m_profilePassword->GetValue(); }
+bool RemoteLoginDlg::GetSaveProfile() const { return m_saveProfile->IsChecked(); }
@@ -16,19 +16,18 @@
#include "wx/wxprec.h"
#ifndef WX_PRECOMP
- #include <wx/wx.h>
+#include <wx/wx.h>
#endif
class RemoteLoginDlg : public wxDialog {
public:
RemoteLoginDlg(wxWindow *parent, const wxString& username, const wxString& site, bool askToSave);
- wxString GetUsername() const {return m_profileUsername->GetValue();};
- wxString GetPassword() const {return m_profilePassword->GetValue();};
- bool GetSaveProfile() const {return m_saveProfile->IsChecked();};
+ virtual wxString GetUsername() const;
+ virtual wxString GetPassword() const;
+ virtual bool GetSaveProfile() const;
private:
- // Ctrls
wxTextCtrl* m_profileUsername;
wxTextCtrl* m_profilePassword;
wxCheckBox* m_saveProfile;

0 comments on commit bf2383c

Please sign in to comment.