1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
10 #include "authfallbackdlg.hxx"
14 AuthFallbackDlg::AuthFallbackDlg(weld::Window
* pParent
, const OUString
& instructions
,
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
);
37 m_xOneDriveBox
->hide();
43 m_bGoogleMode
= false;
45 m_xOneDriveBox
->show();
46 m_xEDUrl
->set_text( url
);
50 AuthFallbackDlg::~AuthFallbackDlg()
54 OUString
AuthFallbackDlg::GetCode() const
57 return m_xEDGoogleCode
->get_text();
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
);