bump product version to 6.3.0.0.beta1
[LibreOffice.git] / uui / source / authfallbackdlg.cxx
blobc147a7f1b9a74ab49fd3cb72b76a3cd77ca8b8f0
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include "authfallbackdlg.hxx"
12 #include <iostream>
14 AuthFallbackDlg::AuthFallbackDlg(weld::Window* pParent, const OUString& instructions,
15 const OUString& url)
16 : GenericDialogController(pParent, "uui/ui/authfallback.ui", "AuthFallbackDlg")
17 , m_bGoogleMode( false )
18 , m_xTVInstructions(m_xBuilder->weld_label("instructions"))
19 , m_xEDUrl(m_xBuilder->weld_entry("url"))
20 , m_xEDCode(m_xBuilder->weld_entry("code"))
21 , m_xEDGoogleCode(m_xBuilder->weld_entry("google_code"))
22 , m_xBTOk(m_xBuilder->weld_button("ok"))
23 , m_xBTCancel(m_xBuilder->weld_button("cancel"))
24 , m_xGoogleBox(m_xBuilder->weld_widget("GDrive"))
25 , m_xOneDriveBox(m_xBuilder->weld_widget("OneDrive"))
27 m_xBTOk->connect_clicked( LINK( this, AuthFallbackDlg, OKHdl) );
28 m_xBTCancel->connect_clicked( LINK( this, AuthFallbackDlg, CancelHdl) );
29 m_xBTOk->set_sensitive(true);
31 m_xTVInstructions->set_label(instructions);
32 if( url.isEmpty() )
34 // Google 2FA
35 m_bGoogleMode = true;
36 m_xGoogleBox->show();
37 m_xOneDriveBox->hide();
38 m_xEDUrl->hide();
40 else
42 // OneDrive
43 m_bGoogleMode = false;
44 m_xGoogleBox->hide();
45 m_xOneDriveBox->show();
46 m_xEDUrl->set_text( url );
50 AuthFallbackDlg::~AuthFallbackDlg()
54 OUString AuthFallbackDlg::GetCode() const
56 if( m_bGoogleMode )
57 return m_xEDGoogleCode->get_text();
58 else
59 return m_xEDCode->get_text();
62 IMPL_LINK_NOARG(AuthFallbackDlg, OKHdl, weld::Button&, void)
64 m_xDialog->response(RET_OK);
67 IMPL_LINK_NOARG(AuthFallbackDlg, CancelHdl, weld::Button&, void)
69 m_xDialog->response(RET_CANCEL);