diff options
Diffstat (limited to 'uui')
-rw-r--r-- | uui/source/authfallbackdlg.cxx | 27 | ||||
-rw-r--r-- | uui/source/authfallbackdlg.hxx | 9 | ||||
-rw-r--r-- | uui/uiconfig/ui/authfallback.ui | 102 |
3 files changed, 108 insertions, 30 deletions
diff --git a/uui/source/authfallbackdlg.cxx b/uui/source/authfallbackdlg.cxx index 89110740993b..dedcdc8a1aee 100644 --- a/uui/source/authfallbackdlg.cxx +++ b/uui/source/authfallbackdlg.cxx @@ -17,29 +17,37 @@ using namespace boost; AuthFallbackDlg::AuthFallbackDlg(Window* pParent, const OUString& instructions, const OUString& url) : ModalDialog(pParent, "AuthFallbackDlg", "uui/ui/authfallback.ui") + , m_bGoogleMode( false ) { get( m_pTVInstructions, "instructions" ); get( m_pEDUrl, "url" ); get( m_pEDCode, "code" ); + get( m_pEDGoogleCode, "google_code" ); get( m_pBTOk, "ok" ); get( m_pBTCancel, "cancel" ); - get( m_pFTGooglePrefixLabel, "google_prefix_label" ); + get( m_pGoogleBox, "GDrive" ); + get( m_pOneDriveBox, "OneDrive" ); m_pBTOk->SetClickHdl( LINK( this, AuthFallbackDlg, OKHdl) ); m_pBTCancel->SetClickHdl( LINK( this, AuthFallbackDlg, CancelHdl) ); m_pBTOk->Enable(); m_pTVInstructions->SetText( instructions ); + m_pTVInstructions->SetPaintTransparent(true); if( url.isEmpty() ) { // Google 2FA - m_pFTGooglePrefixLabel->Show(); + m_bGoogleMode = true; + m_pGoogleBox->Show(); + m_pOneDriveBox->Hide(); m_pEDUrl->Hide(); } else { // OneDrive - m_pFTGooglePrefixLabel->Hide(); + m_bGoogleMode = false; + m_pGoogleBox->Hide(); + m_pOneDriveBox->Show(); m_pEDUrl->SetText( url ); } } @@ -49,14 +57,25 @@ AuthFallbackDlg::~AuthFallbackDlg() disposeOnce(); } +OUString AuthFallbackDlg::GetCode() const +{ + if( m_bGoogleMode ) + return m_pEDGoogleCode->GetText(); + else + return m_pEDCode->GetText(); +} + + void AuthFallbackDlg::dispose() { m_pTVInstructions.clear(); m_pEDUrl.clear(); m_pEDCode.clear(); + m_pEDGoogleCode.clear(); m_pBTOk.clear(); m_pBTCancel.clear(); - m_pFTGooglePrefixLabel.clear(); + m_pGoogleBox.clear(); + m_pOneDriveBox.clear(); ModalDialog::dispose(); } diff --git a/uui/source/authfallbackdlg.hxx b/uui/source/authfallbackdlg.hxx index 9e5eb5265efa..4df88ddc421b 100644 --- a/uui/source/authfallbackdlg.hxx +++ b/uui/source/authfallbackdlg.hxx @@ -15,7 +15,7 @@ #include <vcl/edit.hxx> #include <vcl/vclmedit.hxx> #include <vcl/fixed.hxx> - +#include <vcl/layout.hxx> class AuthFallbackDlg : public ModalDialog { @@ -23,9 +23,12 @@ private: VclPtr<VclMultiLineEdit> m_pTVInstructions; VclPtr<Edit> m_pEDUrl; VclPtr<Edit> m_pEDCode; + VclPtr<Edit> m_pEDGoogleCode; VclPtr<PushButton> m_pBTOk; VclPtr<PushButton> m_pBTCancel; - VclPtr<FixedText> m_pFTGooglePrefixLabel; + VclPtr<VclVBox> m_pGoogleBox; + VclPtr<VclVBox> m_pOneDriveBox; + bool m_bGoogleMode; public: AuthFallbackDlg(Window* pParent, const OUString& instructions, @@ -33,7 +36,7 @@ public: virtual ~AuthFallbackDlg(); virtual void dispose() override; - OUString GetCode() const { return m_pEDCode->GetText(); } + OUString GetCode() const; private: diff --git a/uui/uiconfig/ui/authfallback.ui b/uui/uiconfig/ui/authfallback.ui index d99fa99e25d1..09b0dc863c81 100644 --- a/uui/uiconfig/ui/authfallback.ui +++ b/uui/uiconfig/ui/authfallback.ui @@ -64,13 +64,52 @@ <property name="orientation">vertical</property> <property name="spacing">6</property> <child> - <object class="GtkTextView" id="instructions"> + <object class="GtkBox" id="OneDrive"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="pixels_below_lines">4</property> - <property name="editable">False</property> - <property name="wrap_mode">word</property> - <property name="cursor_visible">False</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkTextView" id="instructions"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="pixels_below_lines">4</property> + <property name="editable">False</property> + <property name="wrap_mode">word</property> + <property name="cursor_visible">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="url"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="invisible_char">●</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="code"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + <property name="width_chars">0</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> </object> <packing> <property name="expand">False</property> @@ -79,26 +118,17 @@ </packing> </child> <child> - <object class="GtkEntry" id="url"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="editable">False</property> - <property name="invisible_char">●</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkBox" id="box1"> + <object class="GtkBox" id="GDrive"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> <child> - <object class="GtkLabel" id="google_prefix_label"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="no">G-</property> + <property name="label" translatable="yes">Enter the 6 digit PIN:</property> + <property name="xalign">0</property> </object> <packing> <property name="expand">False</property> @@ -107,10 +137,36 @@ </packing> </child> <child> - <object class="GtkEntry" id="code"> + <object class="GtkBox" id="box2"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="invisible_char">●</property> + <property name="halign">center</property> + <child> + <object class="GtkLabel" id="google_prefix_label"> + <property name="can_focus">False</property> + <property name="margin_right">3</property> + <property name="label">G-</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="google_code"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="max_length">6</property> + <property name="invisible_char">●</property> + <property name="width_chars">6</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> </object> <packing> <property name="expand">False</property> |