include/svtools/authentication.hxx | 55 +++++++++++++++++ svtools/Library_svt.mk | 1 svtools/source/dialogs/authentication.cxx | 59 +++++++++++++++++++ svtools/uiconfig/ui/authentication.ui | 93 ++++++++++++++++++++++++++++++ 4 files changed, 208 insertions(+)
New commits: commit 32392dbfe4193aa532f2c2b95e7dc1facd63dddf Author: Mihai Varga <mihai.m...@gmail.com> Date: Wed Jun 25 12:43:43 2014 +0300 cmis authentication dialog diff --git a/include/svtools/authentication.hxx b/include/svtools/authentication.hxx new file mode 100644 index 0000000..7ad3f44 --- /dev/null +++ b/include/svtools/authentication.hxx @@ -0,0 +1,55 @@ +/* -*- 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_AUTHENTICATIONDIALOG_HXX +#define INCLUDED_SVTOOLS_AUTHENTICATIONDIALOG_HXX + +#include <svtools/ServerDetailsControls.hxx> + +#include <vcl/button.hxx> +#include <vcl/dialog.hxx> +#include <vcl/edit.hxx> +#include <vcl/fixed.hxx> +#include <vcl/vclmedit.hxx> + +#include <svtools/inettbc.hxx> +#include <svtools/place.hxx> + +#include <boost/shared_ptr.hpp> +#include <vector> + +class SVT_DLLPUBLIC AuthenticationDialog : public ModalDialog +{ +private : + + VclMultiLineEdit* m_pTVInstructions; + Edit* m_pEDUrl; + Edit* m_pEDCode; + OKButton* m_pBTOk; + CancelButton* m_pBTCancel; + +public : + + AuthenticationDialog( Window* pParent); + AuthenticationDialog(Window* pParent, const OUString& instructions, + const OUString& url ); + virtual ~AuthenticationDialog(); + + // Returns a place instance with given information + boost::shared_ptr<Place> GetPlace(); + + OUString GetCode() { return m_pEDCode->GetText(); } + +private: + + DECL_LINK ( OKHdl, Button * ); +}; + +#endif // INCLUDED_SVTOOLS_AUTHENTICATIONDIALOG_HXXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk index 192f14a..9acee92 100644 --- a/svtools/Library_svt.mk +++ b/svtools/Library_svt.mk @@ -132,6 +132,7 @@ $(eval $(call gb_Library_add_exception_objects,svt,\ svtools/source/control/vclxaccessibleheaderbar \ svtools/source/control/vclxaccessibleheaderbaritem \ svtools/source/dialogs/addresstemplate \ + svtools/source/dialogs/authentication \ svtools/source/dialogs/colrdlg \ svtools/source/dialogs/insdlg \ svtools/source/dialogs/mcvmath \ diff --git a/svtools/source/dialogs/authentication.cxx b/svtools/source/dialogs/authentication.cxx new file mode 100644 index 0000000..5d2f698 --- /dev/null +++ b/svtools/source/dialogs/authentication.cxx @@ -0,0 +1,59 @@ +/* -*- 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 <svtools/authentication.hxx> + +#include <officecfg/Office/Common.hxx> +#include <svtools/svtresid.hxx> +#include <vcl/msgbox.hxx> + +using namespace boost; + +AuthenticationDialog::AuthenticationDialog( Window* pParent ) : + ModalDialog( pParent, "AuthenticationDialog", "svt/ui/authentication.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, AuthenticationDialog, OKHdl) ); + m_pBTOk->Enable( false ); +} + +AuthenticationDialog::AuthenticationDialog( Window* pParent, + const OUString& instructions, + const OUString& url ) : + ModalDialog( pParent, "AuthenticationDialog", "svt/ui/authentication.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, AuthenticationDialog, OKHdl) ); + m_pBTOk->Enable( false ); + + m_pTVInstructions->SetText( instructions ); + m_pEDUrl->SetText( url ); +} + +AuthenticationDialog::~AuthenticationDialog() +{ +} + +IMPL_LINK ( AuthenticationDialog, OKHdl, Button *, EMPTYARG ) +{ + EndDialog( RET_OK ); + return 1; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/uiconfig/ui/authentication.ui b/svtools/uiconfig/ui/authentication.ui new file mode 100644 index 0000000..86a0a81 --- /dev/null +++ b/svtools/uiconfig/ui/authentication.ui @@ -0,0 +1,93 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="AuthenticationDialog"> + <property name="can_focus">False</property> + <property name="title" translatable="yes">OneDrive authentication code</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> + </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>
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits