Kaydet (Commit) 1ef15689 authored tarafından Mihai Varga's avatar Mihai Varga Kaydeden (comit) Miklos Vajna

Authentication fallback dialog for the OneDrive connection

It asks the user to access an URL in his browser and provide a code
from the URL he has been redirected to
üst fc1bfd9e
......@@ -38,6 +38,7 @@ $(eval $(call gb_Library_use_libraries,uui,\
$(eval $(call gb_Library_add_exception_objects,uui,\
uui/source/alreadyopen \
uui/source/authfallbackdlg \
uui/source/filechanged \
uui/source/fltdlg \
uui/source/iahndl \
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "authfallbackdlg.hxx"
#include <vcl/msgbox.hxx>
#include <iostream>
using namespace boost;
AuthFallbackDlg::AuthFallbackDlg( Window* pParent ) :
ModalDialog( pParent, "AuthFallbackDlg", "uui/ui/authfallback.ui" )
{
get( m_pTVInstructions, "instructions" );
get( m_pEDUrl, "url" );
get( m_pEDCode, "code" );
get( m_pBTOk, "ok" );
get( m_pBTCancel, "cancel" );
m_pBTOk->SetClickHdl( LINK( this, AuthFallbackDlg, OKHdl) );
m_pBTOk->Enable( false );
}
AuthFallbackDlg::AuthFallbackDlg( Window* pParent,
const OUString& instructions,
const OUString& url ) :
ModalDialog( pParent, "AuthFallbackDlg", "uui/ui/authfallback.ui" )
{
get( m_pTVInstructions, "instructions" );
get( m_pEDUrl, "url" );
get( m_pEDCode, "code" );
get( m_pBTOk, "ok" );
get( m_pBTCancel, "cancel" );
m_pBTOk->SetClickHdl( LINK( this, AuthFallbackDlg, OKHdl) );
m_pBTCancel->SetClickHdl( LINK( this, AuthFallbackDlg, CancelHdl) );
m_pBTOk->Enable( true );
m_pTVInstructions->SetText( instructions );
m_pEDUrl->SetText( url );
}
AuthFallbackDlg::~AuthFallbackDlg( )
{
}
IMPL_LINK ( AuthFallbackDlg, OKHdl, Button *, EMPTYARG )
{
EndDialog( RET_OK );
return 1;
}
IMPL_LINK ( AuthFallbackDlg, CancelHdl, Button *, EMPTYARG )
{
EndDialog( RET_CANCEL );
return 0;
}
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_SVTOOLS_AUTHFALLBACKDLG_HXX
#define INCLUDED_SVTOOLS_AUTHFALLBACKDLG_HXX
#include <vcl/button.hxx>
#include <vcl/dialog.hxx>
#include <vcl/edit.hxx>
#include <vcl/vclmedit.hxx>
class AuthFallbackDlg : public ModalDialog
{
private :
VclMultiLineEdit* m_pTVInstructions;
Edit* m_pEDUrl;
Edit* m_pEDCode;
PushButton* m_pBTOk;
PushButton* m_pBTCancel;
public :
AuthFallbackDlg( Window* pParent);
AuthFallbackDlg(Window* pParent, const OUString& instructions,
const OUString& url );
virtual ~AuthFallbackDlg();
OUString GetCode() { return m_pEDCode->GetText(); }
private:
DECL_LINK ( OKHdl, Button * );
DECL_LINK ( CancelHdl, Button * );
};
#endif // INCLUDED_SVTOOLS_AUTHFALLBACKDLG_HXX
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkDialog" id="AuthFallbackDlg">
<property name="can_focus">False</property>
<property name="title" translatable="yes">OneDrive authentication code</property>
<property name="default_width">400</property>
<property name="default_height">270</property>
<child>
<object class="GtkBox" id="box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</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="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">False</property>
<property name="invisible_char"></property>
<property name="editable">False</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">False</property>
<property name="invisible_char"></property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButtonBox" id="buttonbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">46</property>
<property name="layout_style">start</property>
<child>
<object class="GtkButton" id="ok">
<property name="label" translatable="yes">Ok</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="cancel">
<property name="label" translatable="yes">Cancel</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="receives_default">True</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">True</property>
<property name="fill">True</property>
<property name="padding">6</property>
<property name="position">3</property>
</packing>
</child>
</object>
</child>
</object>
</interface>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment