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"
12 AuthFallbackDlg::AuthFallbackDlg(weld::Window
* pParent
, const OUString
& instructions
,
14 : GenericDialogController(pParent
, "uui/ui/authfallback.ui", "AuthFallbackDlg")
15 , m_bGoogleMode(false)
16 , m_xTVInstructions(m_xBuilder
->weld_label("instructions"))
17 , m_xEDUrl(m_xBuilder
->weld_entry("url"))
18 , m_xEDCode(m_xBuilder
->weld_entry("code"))
19 , m_xEDGoogleCode(m_xBuilder
->weld_entry("google_code"))
20 , m_xBTOk(m_xBuilder
->weld_button("ok"))
21 , m_xBTCancel(m_xBuilder
->weld_button("cancel"))
22 , m_xGoogleBox(m_xBuilder
->weld_widget("GDrive"))
23 , m_xOneDriveBox(m_xBuilder
->weld_widget("OneDrive"))
25 m_xBTOk
->connect_clicked(LINK(this, AuthFallbackDlg
, OKHdl
));
26 m_xBTCancel
->connect_clicked(LINK(this, AuthFallbackDlg
, CancelHdl
));
27 m_xBTOk
->set_sensitive(true);
29 m_xTVInstructions
->set_label(instructions
);
35 m_xOneDriveBox
->hide();
41 m_bGoogleMode
= false;
43 m_xOneDriveBox
->show();
44 m_xEDUrl
->set_text(url
);
48 AuthFallbackDlg::~AuthFallbackDlg() {}
50 OUString
AuthFallbackDlg::GetCode() const
53 return m_xEDGoogleCode
->get_text();
55 return m_xEDCode
->get_text();
58 IMPL_LINK_NOARG(AuthFallbackDlg
, OKHdl
, weld::Button
&, void) { m_xDialog
->response(RET_OK
); }
60 IMPL_LINK_NOARG(AuthFallbackDlg
, CancelHdl
, weld::Button
&, void)
62 m_xDialog
->response(RET_CANCEL
);