summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-07-25 17:21:54 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-07-27 12:50:34 +0200
commita341f12325813dafa9be80a70fc90144a144a742 (patch)
tree87a82efb9e45266725d0e54ada13b32c2d5cb3b6
parenta905fed5ba72bc22098910d960e7a502365df9ef (diff)
weld RemoteDialog
Change-Id: I4d3b9f7629137bc9b94f5c0426ae6fc956a97511 Reviewed-on: https://gerrit.libreoffice.org/76336 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--extras/source/glade/libreoffice-catalog.xml.in4
-rw-r--r--sd/UIConfig_simpress.mk1
-rw-r--r--sd/inc/sdabstdlg.hxx2
-rw-r--r--sd/inc/strings.hrc2
-rw-r--r--sd/qa/unit/dialogs-test.cxx3
-rw-r--r--sd/source/filter/html/pubdlg.cxx6
-rw-r--r--sd/source/ui/dlg/RemoteDialog.cxx54
-rw-r--r--sd/source/ui/dlg/RemoteDialog.hxx18
-rw-r--r--sd/source/ui/dlg/RemoteDialogClientBox.cxx622
-rw-r--r--sd/source/ui/dlg/RemoteDialogClientBox.hxx89
-rw-r--r--sd/source/ui/dlg/sddlgfact.cxx4
-rw-r--r--sd/source/ui/dlg/sddlgfact.hxx2
-rw-r--r--sd/source/ui/inc/pubdlg.hxx6
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSlotManager.cxx7
-rw-r--r--sd/source/ui/view/drviews2.cxx2
-rw-r--r--sd/source/ui/view/outlnvs2.cxx2
-rw-r--r--sd/uiconfig/simpress/ui/clientboxfragment.ui79
-rw-r--r--sd/uiconfig/simpress/ui/remotedialog.ui61
18 files changed, 243 insertions, 721 deletions
diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in
index 3cf70cfc456f..dff39e5a6c9d 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -292,10 +292,6 @@
generic-name="Writer Navigator ToolBox" parent="GtkToolbar"
icon-name="widget-gtk-toolbar"/>
- <glade-widget-class title="ClientBox" name="sduilo-ClientBox"
- generic-name="ClientBox" parent="GtkDrawingArea"
- icon-name="widget-gtk-drawingarea"/>
-
<glade-widget-class title="IndexFieldsControl" name="dbulo-DbaIndexFieldsControl"
generic-name="IndexFieldsControl" parent="GtkTreeView"
icon-name="widget-gtk-treeview"/>
diff --git a/sd/UIConfig_simpress.mk b/sd/UIConfig_simpress.mk
index 5f85b4c8a7bc..b5e62f9b67d8 100644
--- a/sd/UIConfig_simpress.mk
+++ b/sd/UIConfig_simpress.mk
@@ -105,6 +105,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/simpress,\
$(eval $(call gb_UIConfig_add_uifiles,modules/simpress,\
sd/uiconfig/simpress/ui/annotationmenu \
sd/uiconfig/simpress/ui/annotationtagmenu \
+ sd/uiconfig/simpress/ui/clientboxfragment \
sd/uiconfig/simpress/ui/currentmastermenu \
sd/uiconfig/simpress/ui/customanimationspanel \
sd/uiconfig/simpress/ui/customanimationproperties \
diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx
index eef454057185..ce5ed49ee656 100644
--- a/sd/inc/sdabstdlg.hxx
+++ b/sd/inc/sdabstdlg.hxx
@@ -186,7 +186,7 @@ public:
virtual VclPtr<SfxAbstractTabDialog> CreateSdParagraphTabDlg(weld::Window* pWindow, const SfxItemSet* pAttr) = 0;
virtual VclPtr<AbstractSdStartPresDlg> CreateSdStartPresentationDlg(weld::Window* pWindow, const SfxItemSet& rInAttrs,
const std::vector<OUString> &rPageNames, SdCustomShowList* pCSList ) = 0;
- virtual VclPtr<VclAbstractDialog> CreateRemoteDialog( vcl::Window* pWindow ) = 0;
+ virtual VclPtr<VclAbstractDialog> CreateRemoteDialog(weld::Window* pWindow) = 0;
virtual VclPtr<SfxAbstractTabDialog> CreateSdPresLayoutTemplateDlg(SfxObjectShell* pDocSh, weld::Window* pParent, bool bBackgroundDlg, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool) = 0;
virtual VclPtr<AbstractSdPresLayoutDlg> CreateSdPresLayoutDlg(weld::Window* pParent, ::sd::DrawDocShell* pDocShell, const SfxItemSet& rInAttrs) = 0;
virtual VclPtr<SfxAbstractTabDialog> CreateSdTabTemplateDlg(weld::Window* pParent, const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView) = 0;
diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc
index 6aa554df0c9f..17e0912d4cec 100644
--- a/sd/inc/strings.hrc
+++ b/sd/inc/strings.hrc
@@ -356,8 +356,6 @@
#define STR_POOLSHEET_TOTAL NC_("STR_POOLSHEET_TOTAL", "Total line" )
#define STR_POOLSHEET_FIRST_COLUMN NC_("STR_POOLSHEET_FIRST_COLUMN", "First column" )
#define STR_POOLSHEET_LAST_COLUMN NC_("STR_POOLSHEET_LAST_COLUMN", "Last column" )
-#define STR_ENTER_PIN NC_("STR_ENTER_PIN", "Enter PIN:")
-#define STR_DEAUTHORISE_CLIENT NC_("STR_DEAUTHORISE_CLIENT", "Remove client authorisation")
#define STR_SHRINK_FONT_SIZE NC_("STR_SHRINK_FONT_SIZE", "Shrink font size")
#define STR_GROW_FONT_SIZE NC_("STR_GROW_FONT_SIZE", "Grow font size")
diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx
index 529fc6f87ffd..21cf07a005cb 100644
--- a/sd/qa/unit/dialogs-test.cxx
+++ b/sd/qa/unit/dialogs-test.cxx
@@ -460,9 +460,10 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID)
}
case 14:
{
+ auto const parent = Application::GetDefDialogParent();
// CreateRemoteDialog(vcl::Window* pWindow) override; // ad for RemoteDialog
pRetval = getSdAbstractDialogFactory()->CreateRemoteDialog(
- Application::GetDefDialogParent());
+ parent == nullptr ? nullptr : parent->GetFrameWeld());
break;
}
case 15:
diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx
index 2bc81ad5db86..fe4dee296273 100644
--- a/sd/source/filter/html/pubdlg.cxx
+++ b/sd/source/filter/html/pubdlg.cxx
@@ -20,11 +20,9 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <comphelper/sequence.hxx>
#include <unotools/ucbstreamhelper.hxx>
-#include <vcl/lstbox.hxx>
#include <vcl/FilterConfigItem.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/vclmedit.hxx>
+#include <vcl/image.hxx>
+#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
#include <svtools/valueset.hxx>
#include <svtools/colrdlg.hxx>
diff --git a/sd/source/ui/dlg/RemoteDialog.cxx b/sd/source/ui/dlg/RemoteDialog.cxx
index 2298d4a243fd..56f5754a5900 100644
--- a/sd/source/ui/dlg/RemoteDialog.cxx
+++ b/sd/source/ui/dlg/RemoteDialog.cxx
@@ -13,61 +13,39 @@
using namespace ::sd;
using namespace ::std;
-RemoteDialog::RemoteDialog( vcl::Window *pWindow )
- : ModalDialog(pWindow, "RemoteDialog",
- "modules/simpress/ui/remotedialog.ui")
+RemoteDialog::RemoteDialog(weld::Window *pWindow)
+ : GenericDialogController(pWindow, "modules/simpress/ui/remotedialog.ui", "RemoteDialog")
+ , m_xButtonConnect(m_xBuilder->weld_button("ok"))
+ , m_xClientBox(new sd::ClientBox(m_xBuilder->weld_scrolled_window("scroll"),
+ m_xBuilder->weld_container("tree")))
{
- get(m_pButtonConnect, "connect");
- get(m_pButtonClose, "close");
- get(m_pClientBox, "tree");
-
- m_pButtonConnect->SetClickHdl( LINK( this, RemoteDialog, HandleConnectButton ) );
- SetCloseHdl( LINK( this, RemoteDialog, CloseHdl ) );
- m_pButtonClose->SetClickHdl( LINK( this, RemoteDialog, CloseClickHdl ) );
+ m_xButtonConnect->connect_clicked(LINK(this, RemoteDialog, HandleConnectButton));
}
RemoteDialog::~RemoteDialog()
{
- disposeOnce();
-}
-
-void RemoteDialog::dispose()
-{
- m_pButtonConnect.clear();
- m_pButtonClose.clear();
- m_pClientBox.clear();
- ModalDialog::dispose();
}
-IMPL_LINK_NOARG(RemoteDialog, HandleConnectButton, Button*, void)
+IMPL_LINK_NOARG(RemoteDialog, HandleConnectButton, weld::Button&, void)
{
-// setBusy( true );
- // Fixme: Try and connect
+ weld::WaitObject(m_xDialog.get());
#if defined(ENABLE_SDREMOTE) && defined(ENABLE_SDREMOTE_BLUETOOTH)
- long aSelected = m_pClientBox->GetActiveEntryIndex();
- if ( aSelected < 0 )
+ auto xEntry = m_xClientBox->GetActiveEntry();
+ if (!xEntry)
return;
- TClientBoxEntry aEntry = m_pClientBox->GetEntryData(aSelected);
- OUString aPin ( m_pClientBox->getPin() );
- if ( RemoteServer::connectClient( aEntry->m_pClientInfo, aPin ) )
- {
- CloseHdl( *this );
- }
-#else
- (void) this;
+ OUString aPin = xEntry->m_xPinBox->get_text();
+ if (RemoteServer::connectClient(xEntry->m_xClientInfo, aPin))
+ m_xDialog->response(RET_OK);
#endif
}
-IMPL_LINK_NOARG( RemoteDialog, CloseClickHdl, Button*, void )
-{
- CloseHdl(*this);
-}
-IMPL_LINK_NOARG( RemoteDialog, CloseHdl, SystemWindow&, void )
+short RemoteDialog::run()
{
+ short nRet = weld::GenericDialogController::run();
#ifdef ENABLE_SDREMOTE
RemoteServer::restoreDiscoverable();
#endif
- Close();
+ return nRet;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/dlg/RemoteDialog.hxx b/sd/source/ui/dlg/RemoteDialog.hxx
index 7dfbc8a11f3c..ea0c492f6440 100644
--- a/sd/source/ui/dlg/RemoteDialog.hxx
+++ b/sd/source/ui/dlg/RemoteDialog.hxx
@@ -9,28 +9,24 @@
#ifndef INCLUDED_SD_SOURCE_UI_DLG_REMOTEDIALOG_HXX
#define INCLUDED_SD_SOURCE_UI_DLG_REMOTEDIALOG_HXX
-#include <vcl/button.hxx>
-#include <vcl/dialog.hxx>
+#include <vcl/weld.hxx>
#include "RemoteDialogClientBox.hxx"
namespace sd
{
-class RemoteDialog : public ModalDialog
+class RemoteDialog : public weld::GenericDialogController
{
private:
- VclPtr<PushButton> m_pButtonConnect;
- VclPtr<CloseButton> m_pButtonClose;
- VclPtr<ClientBox> m_pClientBox;
+ std::unique_ptr<weld::Button> m_xButtonConnect;
+ std::unique_ptr<ClientBox> m_xClientBox;
- DECL_LINK( HandleConnectButton, Button*, void );
- DECL_LINK( CloseHdl, SystemWindow&, void );
- DECL_LINK( CloseClickHdl, Button*, void );
+ DECL_LINK(HandleConnectButton, weld::Button&, void);
public:
- explicit RemoteDialog( vcl::Window* pWindow );
+ explicit RemoteDialog(weld::Window* pWindow);
+ virtual short run() override;
virtual ~RemoteDialog() override;
- virtual void dispose() override;
};
}
diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
index ad1355644a23..30dab80f999a 100644
--- a/sd/source/ui/dlg/RemoteDialogClientBox.cxx
+++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
@@ -25,7 +25,7 @@
#include <RemoteServer.hxx>
#include <vcl/settings.hxx>
-#include <vcl/builderfactory.hxx>
+#include <vcl/svapp.hxx>
#include <vcl/commandevent.hxx>
#include <vcl/event.hxx>
@@ -40,586 +40,76 @@ namespace sd {
// struct ClientBoxEntry
-ClientBoxEntry::ClientBoxEntry(const std::shared_ptr<ClientInfo>& pClientInfo)
- : m_bActive(false)
- , m_pClientInfo(pClientInfo)
+ClientBoxEntry::ClientBoxEntry(ClientBox* pClientBox,
+ const std::shared_ptr<ClientInfo>& pClientInfo)
+ : m_xBuilder(Application::CreateBuilder(pClientBox->GetContainer(), "modules/simpress/ui/clientboxfragment.ui"))
+ , m_xContainer(m_xBuilder->weld_container("ClientboxFragment"))
+ , m_xDeviceName(m_xBuilder->weld_label("name"))
+ , m_xPinLabel(m_xBuilder->weld_label("pinlabel"))
+ , m_xPinBox(m_xBuilder->weld_entry("pin"))
+ , m_xDeauthoriseButton(m_xBuilder->weld_button("button"))
+ , m_xClientInfo(pClientInfo)
+ , m_pClientBox(pClientBox)
{
+ m_xDeviceName->set_label(m_xClientInfo->mName);
+ m_xDeauthoriseButton->connect_clicked(LINK(this, ClientBoxEntry, DeauthoriseHdl));
+ m_xDeauthoriseButton->set_visible(m_xClientInfo->mbIsAlreadyAuthorised);
+ m_xPinBox->set_visible(!m_xClientInfo->mbIsAlreadyAuthorised);
+ m_xPinLabel->set_visible(!m_xClientInfo->mbIsAlreadyAuthorised);
+
+ m_xDeauthoriseButton->connect_focus_in(LINK(this, ClientBoxEntry, FocusHdl));
+ m_xPinBox->connect_focus_in(LINK(this, ClientBoxEntry, FocusHdl));
}
ClientBoxEntry::~ClientBoxEntry()
-{}
+{
+ m_pClientBox->GetContainer()->move(m_xContainer.get(), nullptr);
+}
// ClientBox
-
-ClientBox::ClientBox( vcl::Window* pParent, WinBits nStyle ) :
- Control( pParent, nStyle ),
- m_bHasScrollBar( false ),
- m_bHasActive( false ),
- m_bNeedsRecalc( true ),
- m_bAdjustActive( false ),
- m_nActive( 0 ),
- m_nTopIndex( 0 ),
- m_nActiveHeight( 0 ),
- m_aPinBox( VclPtr<NumericBox>::Create( this, 0 ) ),
- m_aDeauthoriseButton( VclPtr<PushButton>::Create( this ) ),
- m_aScrollBar( VclPtr<ScrollBar>::Create( this, WB_VERT ) )
+ClientBox::ClientBox(std::unique_ptr<weld::ScrolledWindow> xScroll,
+ std::unique_ptr<weld::Container> xContents)
+ : m_xScroll(std::move(xScroll))
+ , m_xContents(std::move(xContents))
+ , m_pActive(nullptr)
{
- m_aScrollBar->SetScrollHdl( LINK( this, ClientBox, ScrollHdl ) );
- m_aScrollBar->EnableDrag();
-
- m_aPinBox->SetUseThousandSep(false);
- m_aDeauthoriseButton->SetText( SdResId(STR_DEAUTHORISE_CLIENT) );
- m_aDeauthoriseButton->SetClickHdl( LINK( this, ClientBox, DeauthoriseHdl ) );
-
- SetPosPixel( Point( RSC_SP_DLG_INNERBORDER_LEFT, RSC_SP_DLG_INNERBORDER_TOP ) );
- long nIconHeight = 2*TOP_OFFSET + SMALL_ICON_SIZE;
- long nTitleHeight = 2*TOP_OFFSET + GetTextHeight();
- if ( nIconHeight < nTitleHeight )
- m_nStdHeight = nTitleHeight;
- else
- m_nStdHeight = nIconHeight;
- m_nStdHeight += GetTextHeight() + TOP_OFFSET;
+ Size aSize(m_xScroll->get_approximate_digit_width() * 40,
+ m_xScroll->get_text_height() * 16);
+ m_xScroll->set_size_request(aSize.Width(), aSize.Height());
- m_nActiveHeight = m_nStdHeight;
-
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- if( IsControlBackground() )
- SetBackground( GetControlBackground() );
- else
- SetBackground( rStyleSettings.GetFieldColor() );
+ m_xContents->set_stack_background();
populateEntries();
-
- Show();
-}
-
-VCL_BUILDER_FACTORY_CONSTRUCTOR(ClientBox, WB_TABSTOP)
-
-Size ClientBox::GetOptimalSize() const
-{
- return LogicToPixel(Size(200, 140), MapMode(MapUnit::MapAppFont));
}
ClientBox::~ClientBox()
{
- disposeOnce();
-}
-
-void ClientBox::dispose()
-{
- m_vEntries.clear();
-
- m_aPinBox.disposeAndClear();
- m_aDeauthoriseButton.disposeAndClear();
- m_aScrollBar.disposeAndClear();
- Control::dispose();
-}
-
-// Title + description
-void ClientBox::CalcActiveHeight()
-{
- const ::osl::MutexGuard aGuard( m_entriesMutex );
-
- // get title height
- long aTextHeight;
- long nIconHeight = 2*TOP_OFFSET + SMALL_ICON_SIZE;
- long nTitleHeight = 2*TOP_OFFSET + GetTextHeight();
- if ( nIconHeight < nTitleHeight )
- aTextHeight = nTitleHeight;
- else
- aTextHeight = nIconHeight;
-
- // Text entry height
- Size aSize = GetOutputSizePixel();
- if ( m_bHasScrollBar )
- aSize.AdjustWidth( -(m_aScrollBar->GetSizePixel().Width()) );
-
- aSize.AdjustWidth( -ICON_OFFSET );
-
- aSize = LogicToPixel( Size( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ),
- MapMode( MapUnit::MapAppFont ) );
- aTextHeight += aSize.Height();
-
- if ( aTextHeight < m_nStdHeight )
- aTextHeight = m_nStdHeight;
-
- m_nActiveHeight = aTextHeight + 2;
-}
-
-::tools::Rectangle ClientBox::GetEntryRect( const long nPos ) const
-{
- const ::osl::MutexGuard aGuard( m_entriesMutex );
-
- Size aSize( GetOutputSizePixel() );
-
- if ( m_bHasScrollBar )
- aSize.AdjustWidth( -(m_aScrollBar->GetSizePixel().Width()) );
-
- if ( m_vEntries[ nPos ]->m_bActive )
- aSize.setHeight( m_nActiveHeight );
- else
- aSize.setHeight( m_nStdHeight );
-
- Point aPos( 0, -m_nTopIndex + nPos * m_nStdHeight );
- if ( m_bHasActive && ( nPos < m_nActive ) )
- aPos.AdjustY(m_nActiveHeight - m_nStdHeight );
-
- return ::tools::Rectangle( aPos, aSize );
-}
-
-long ClientBox::GetActiveEntryIndex()
-{
- if ( m_bHasActive )
- return m_nActive;
- else
- return -1;
-}
-
-//This function may be called with nPos < 0
-void ClientBox::selectEntry( const long nPos )
-{
- //ToDo we should not use the guard at such a big scope here.
- //Currently it is used to guard m_vEntries and m_nActive. m_nActive will be
- //modified in this function.
- //It would be probably best to always use a copy of m_vEntries
- //and some other state variables from ClientBox for
- //the whole painting operation. See issue i86993
- osl::MutexGuard guard(m_entriesMutex);
-
- if ( m_bHasActive )
- {
- if ( nPos == m_nActive )
- return;
-
- m_bHasActive = false;
- m_vEntries[ m_nActive ]->m_bActive = false;
- }
-
- if ( ( nPos >= 0 ) && ( nPos < static_cast<long>(m_vEntries.size()) ) )
- {
- m_bHasActive = true;
- m_nActive = nPos;
- m_vEntries[ nPos ]->m_bActive = true;
-
- if ( IsReallyVisible() )
- {
- m_bAdjustActive = true;
- }
- }
-
- // We empty the pin box now too, just in case the user previously
- // entered a pin, but then changed their selected device.
- m_aPinBox->SetText( "" );
- if ( m_bHasActive )
- {
- bool bAlreadyAuthorised =
- m_vEntries[ m_nActive ]->m_pClientInfo->mbIsAlreadyAuthorised;
-
- if ( bAlreadyAuthorised )
- {
- m_aDeauthoriseButton->GetFocus();
- }
- else
- {
- m_aPinBox->GetFocus();
- }
- }
-
- if ( IsReallyVisible() )
- {
- m_bNeedsRecalc = true;
- Invalidate();
- }
}
-void ClientBox::DrawRow(vcl::RenderContext& rRenderContext, const ::tools::Rectangle& rRect, const TClientBoxEntry& rEntry)
+ClientBoxEntry* ClientBox::GetActiveEntry()
{
- const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
-
- if (rEntry->m_bActive)
- SetTextColor(rStyleSettings.GetHighlightTextColor());
- else
- SetTextColor(rStyleSettings.GetFieldTextColor());
-
- if (rEntry->m_bActive)
- {
- rRenderContext.SetLineColor();
- rRenderContext.SetFillColor(rStyleSettings.GetHighlightColor());
- rRenderContext.DrawRect(rRect);
- }
- else
- {
- if(IsControlBackground())
- SetBackground(GetControlBackground());
- else
- SetBackground(rStyleSettings.GetFieldColor());
-
- rRenderContext.SetTextFillColor();
- rRenderContext.Erase(rRect);
- }
-
- // FIXME: draw bluetooth or wifi icon
- Point aPos(rRect.TopLeft());
-
- // Setup fonts
- vcl::Font aStdFont(rRenderContext.GetFont());
- vcl::Font aBoldFont(aStdFont);
- aBoldFont.SetWeight(WEIGHT_BOLD);
- rRenderContext.SetFont(aBoldFont);
- long aTextHeight = rRenderContext.GetTextHeight();
-
- // Get max title width
- long nMaxTitleWidth = rRect.GetWidth() - ICON_OFFSET;
- nMaxTitleWidth -= ( 2 * SMALL_ICON_SIZE ) + ( 4 * SPACE_BETWEEN );
-
- long aTitleWidth = rRenderContext.GetTextWidth(rEntry->m_pClientInfo->mName) + (aTextHeight / 3);
-
- aPos = rRect.TopLeft() + Point(ICON_OFFSET, TOP_OFFSET);
-
- if (aTitleWidth > nMaxTitleWidth)
- {
- aTitleWidth = nMaxTitleWidth - (aTextHeight / 3);
- OUString aShortTitle = rRenderContext.GetEllipsisString(rEntry->m_pClientInfo->mName, aTitleWidth );
- rRenderContext.DrawText(aPos, aShortTitle);
- }
- else
- rRenderContext.DrawText(aPos, rEntry->m_pClientInfo->mName);
-
- SetFont(aStdFont);
-
- aPos.AdjustY(aTextHeight );
- if (rEntry->m_bActive)
- {
- OUString sPinText(SdResId(STR_ENTER_PIN));
- DrawText(m_sPinTextRect, sPinText);
- }
-
- rRenderContext.SetLineColor(COL_LIGHTGRAY);
- rRenderContext.DrawLine(rRect.BottomLeft(), rRect.BottomRight());
+ return m_pActive;
}
-void ClientBox::RecalcAll()
-{
- if ( m_bHasActive )
- CalcActiveHeight();
-
- SetupScrollBar();
-
- Size aPBSize = LogicToPixel(
- Size( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ),
- MapMode( MapUnit::MapAppFont ) );
- m_aPinBox->SetSizePixel( aPBSize );
- m_aDeauthoriseButton->SetSizePixel( m_aDeauthoriseButton->GetOptimalSize() );
-
- if ( !m_bHasActive )
- {
- m_aPinBox->Show( false );
- m_aDeauthoriseButton->Show( false );
- }
- else
- {
- ::tools::Rectangle aEntryRect = GetEntryRect( m_nActive );
-
- Size aPinBoxSize( m_aPinBox->GetSizePixel() );
- Point aPos( aEntryRect.Left(),
- aEntryRect.Bottom() - TOP_OFFSET - aPinBoxSize.Height() );
-
- bool bAlreadyAuthorised = m_vEntries[ m_nActive ]->m_pClientInfo->mbIsAlreadyAuthorised;
-
- if ( !bAlreadyAuthorised )
- {
- m_sPinTextRect = ::tools::Rectangle( aPos.X(), aPos.Y(),
- aEntryRect.Right(),
- aEntryRect.Bottom() - TOP_OFFSET);
-
- OUString sPinText(SdResId(STR_ENTER_PIN));
-
- aPos = Point( aEntryRect.Left() + GetTextWidth( sPinText ),
- aEntryRect.Bottom() - TOP_OFFSET - aPinBoxSize.Height() );
- m_aPinBox->SetPosPixel( aPos );
- // The text would have it's TOP aligned with the top of
- // the pin box -- hence we push it down to align baselines.
- m_sPinTextRect += Point( 0, 4 );
- }
- else
- {
- aPos += Point( 20, 0 );
- m_aDeauthoriseButton->SetPosPixel( aPos );
- }
-
- m_aPinBox->Show( !bAlreadyAuthorised );
- m_aDeauthoriseButton->Show( bAlreadyAuthorised );
-
- if ( m_bAdjustActive )
- {
- m_bAdjustActive = false;
-
- // If the top of the selected entry isn't visible, make it visible
- if ( aEntryRect.Top() < 0 )
- {
- m_nTopIndex += aEntryRect.Top();
- aEntryRect.Move( 0, -aEntryRect.Top() );
- }
-
- // If the bottom of the selected entry isn't visible, make it visible even if now the top
- // isn't visible any longer ( the buttons are more important )
- Size aOutputSize = GetOutputSizePixel();
- if ( aEntryRect.Bottom() > aOutputSize.Height() )
- {
- m_nTopIndex += ( aEntryRect.Bottom() - aOutputSize.Height() );
- aEntryRect.Move( 0, -( aEntryRect.Bottom() - aOutputSize.Height() ) );
- }
-
- // If there is unused space below the last entry but all entries don't fit into the box,
- // move the content down to use the whole space
- const long nTotalHeight = GetTotalHeight();
- if ( m_bHasScrollBar && ( aOutputSize.Height() + m_nTopIndex > nTotalHeight ) )
- {
- long nOffset = m_nTopIndex;
- m_nTopIndex = nTotalHeight - aOutputSize.Height();
- nOffset -= m_nTopIndex;
- aEntryRect.Move( 0, nOffset );
- }
-
- if ( m_bHasScrollBar )
- m_aScrollBar->SetThumbPos( m_nTopIndex );
- }
- }
-
- m_bNeedsRecalc = false;
-}
-
-bool ClientBox::HandleCursorKey( sal_uInt16 nKeyCode )
-{
- if ( m_vEntries.empty() )
- return true;
-
- long nSelect = 0;
-
- if ( m_bHasActive )
- {
- long nPageSize = GetOutputSizePixel().Height() / m_nStdHeight;
- if ( nPageSize < 2 )
- nPageSize = 2;
-
- if ( ( nKeyCode == KEY_DOWN ) || ( nKeyCode == KEY_RIGHT ) )
- nSelect = m_nActive + 1;
- else if ( ( nKeyCode == KEY_UP ) || ( nKeyCode == KEY_LEFT ) )
- nSelect = m_nActive - 1;
- else if ( nKeyCode == KEY_HOME )
- nSelect = 0;
- else if ( nKeyCode == KEY_END )
- nSelect = m_vEntries.size() - 1;
- else if ( nKeyCode == KEY_PAGEUP )
- nSelect = m_nActive - nPageSize + 1;
- else if ( nKeyCode == KEY_PAGEDOWN )
- nSelect = m_nActive + nPageSize - 1;
- }
- else // when there is no selected entry, we will select the first or the last.
- {
- if ( ( nKeyCode == KEY_DOWN ) || ( nKeyCode == KEY_PAGEDOWN ) || ( nKeyCode == KEY_HOME ) )
- nSelect = 0;
- else if ( ( nKeyCode == KEY_UP ) || ( nKeyCode == KEY_PAGEUP ) || ( nKeyCode == KEY_END ) )
- nSelect = m_vEntries.size() - 1;
- }
-
- if ( nSelect < 0 )
- nSelect = 0;
- if ( nSelect >= static_cast<long>(m_vEntries.size()) )
- nSelect = m_vEntries.size() - 1;
-
- selectEntry( nSelect );
-
- return true;
-}
-
-void ClientBox::Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle &/*rPaintRect*/)
-{
- if (m_bNeedsRecalc)
- RecalcAll();
-
- Point aStart(0, -m_nTopIndex);
- Size aSize(GetOutputSizePixel());
-
- if (m_bHasScrollBar)
- aSize.AdjustWidth( -(m_aScrollBar->GetSizePixel().Width()) );
-
- const ::osl::MutexGuard aGuard(m_entriesMutex);
-
- for (auto& vEntry : m_vEntries)
- {
- aSize.setHeight( vEntry->m_bActive ? m_nActiveHeight : m_nStdHeight );
- ::tools::Rectangle aEntryRect(aStart, aSize);
- DrawRow(rRenderContext, aEntryRect, vEntry);
- aStart.AdjustY(aSize.Height() );
- }
-}
-
-long ClientBox::GetTotalHeight() const
-{
- long nHeight = m_vEntries.size() * m_nStdHeight;
-
- if ( m_bHasActive )
- {
- nHeight += m_nActiveHeight - m_nStdHeight;
- }
-
- return nHeight;
-}
-
-void ClientBox::SetupScrollBar()
-{
- const Size aSize = GetOutputSizePixel();
- const long nScrBarSize = GetSettings().GetStyleSettings().GetScrollBarSize();
- const long nTotalHeight = GetTotalHeight();
- const bool bNeedsScrollBar = ( nTotalHeight > aSize.Height() );
-
- if ( bNeedsScrollBar )
- {
- if ( m_nTopIndex + aSize.Height() > nTotalHeight )
- m_nTopIndex = nTotalHeight - aSize.Height();
-
- m_aScrollBar->SetPosSizePixel( Point( aSize.Width() - nScrBarSize, 0 ),
- Size( nScrBarSize, aSize.Height() ) );
- m_aScrollBar->SetRangeMax( nTotalHeight );
- m_aScrollBar->SetVisibleSize( aSize.Height() );
- m_aScrollBar->SetPageSize( ( aSize.Height() * 4 ) / 5 );
- m_aScrollBar->SetLineSize( m_nStdHeight );
- m_aScrollBar->SetThumbPos( m_nTopIndex );
-
- if ( !m_bHasScrollBar )
- m_aScrollBar->Show();
- }
- else if ( m_bHasScrollBar )
- {
- m_aScrollBar->Hide();
- m_nTopIndex = 0;
- }
-
- m_bHasScrollBar = bNeedsScrollBar;
-}
-
-void ClientBox::Resize()
-{
- RecalcAll();
-}
-
-long ClientBox::PointToPos( const Point& rPos )
-{
- long nPos = ( rPos.Y() + m_nTopIndex ) / m_nStdHeight;
-
- if ( m_bHasActive && ( nPos > m_nActive ) )
- {
- if ( rPos.Y() + m_nTopIndex <= m_nActive*m_nStdHeight + m_nActiveHeight )
- nPos = m_nActive;
- else
- nPos = ( rPos.Y() + m_nTopIndex - (m_nActiveHeight - m_nStdHeight) ) / m_nStdHeight;
- }
-
- return nPos;
-}
-
-OUString ClientBox::getPin()
-{
- return OUString::number( m_aPinBox->GetValue() );
-}
-
-void ClientBox::MouseButtonDown( const MouseEvent& rMEvt )
-{
- long nPos = PointToPos( rMEvt.GetPosPixel() );
-
- if ( rMEvt.IsLeft() )
- {
- if ( rMEvt.IsMod1() && m_bHasActive )
- selectEntry( m_vEntries.size() ); // Selecting an not existing entry will deselect the current one
- else
- selectEntry( nPos );
- }
-}
-
-bool ClientBox::EventNotify( NotifyEvent& rNEvt )
+void ClientBox::addEntry( const std::shared_ptr<ClientInfo>& pClientInfo )
{
- bool bHandled = false;
-
- if ( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
- {
- const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
- vcl::KeyCode aKeyCode = pKEvt->GetKeyCode();
- sal_uInt16 nKeyCode = aKeyCode.GetCode();
-
- if ( aKeyCode.GetGroup() == KEYGROUP_CURSOR )
- bHandled = HandleCursorKey( nKeyCode );
- }
-
- if ( rNEvt.GetType() == MouseNotifyEvent::COMMAND )
- {
- if ( m_bHasScrollBar &&
- ( rNEvt.GetCommandEvent()->GetCommand() == CommandEventId::Wheel ) )
- {
- const CommandWheelData* pData = rNEvt.GetCommandEvent()->GetWheelData();
- if ( pData->GetMode() == CommandWheelMode::SCROLL )
- {
- long nThumbPos = m_aScrollBar->GetThumbPos();
- if ( pData->GetDelta() < 0 )
- m_aScrollBar->DoScroll( nThumbPos + m_nStdHeight );
- else
- m_aScrollBar->DoScroll( nThumbPos - m_nStdHeight );
- bHandled = true;
- }
- }
- }
-
- if ( !bHandled )
- return Control::EventNotify(rNEvt);
- else
- return true;
+ TClientBoxEntry xEntry(new ClientBoxEntry(this, pClientInfo));
+ m_vEntries.push_back(xEntry);
}
-void ClientBox::addEntry( const std::shared_ptr<ClientInfo>& pClientInfo )
+void ClientBox::setActive(ClientBoxEntry* pClientEntry)
{
- long nPos = 0;
-
- TClientBoxEntry xEntry( new ClientBoxEntry( pClientInfo ) );
-
- {
- osl::MutexGuard guard(m_entriesMutex);
- if (m_vEntries.empty())
- {
- m_vEntries.push_back(xEntry);
- }
- else
- {
- m_vEntries.insert(m_vEntries.begin() + nPos, xEntry);
- }
-
- //access to m_nActive must be guarded
- if (m_bHasActive && (m_nActive >= nPos))
- m_nActive += 1;
- }
-
- if ( IsReallyVisible() )
- Invalidate();
-
- m_bNeedsRecalc = true;
+ m_pActive = pClientEntry;
}
void ClientBox::clearEntries()
{
- selectEntry( -1 );
- m_bHasActive = false;
-
- const ::osl::MutexGuard aGuard( m_entriesMutex );
-
m_vEntries.clear();
- if ( IsReallyVisible() )
- Invalidate();
- m_bNeedsRecalc = true;
+ m_pActive = nullptr;
}
void ClientBox::populateEntries()
{
- const ::osl::MutexGuard aGuard( m_entriesMutex );
-
clearEntries();
#ifdef ENABLE_SDREMOTE
@@ -633,39 +123,19 @@ void ClientBox::populateEntries()
}
#endif
- if ( IsReallyVisible() )
- Invalidate();
- m_bNeedsRecalc = true;
}
-void ClientBox::DoScroll( long nDelta )
+IMPL_LINK_NOARG(ClientBoxEntry, DeauthoriseHdl, weld::Button&, void)
{
- m_nTopIndex += nDelta;
- Point aNewSBPt( m_aScrollBar->GetPosPixel() );
-
- ::tools::Rectangle aScrRect( Point(), GetOutputSizePixel() );
- aScrRect.AdjustRight( -(m_aScrollBar->GetSizePixel().Width()) );
- Scroll( 0, -nDelta, aScrRect );
-
- m_aScrollBar->SetPosPixel( aNewSBPt );
-}
-
-IMPL_LINK( ClientBox, ScrollHdl, ScrollBar*, pScrBar, void )
-{
- DoScroll( pScrBar->GetDelta() );
+#ifdef ENABLE_SDREMOTE
+ RemoteServer::deauthoriseClient(m_xClientInfo);
+#endif
+ m_pClientBox->populateEntries();
}
-IMPL_LINK_NOARG( ClientBox, DeauthoriseHdl, Button*, void )
+IMPL_LINK_NOARG(ClientBoxEntry, FocusHdl, weld::Widget&, void)
{
- long aSelected = GetActiveEntryIndex();
- if ( aSelected < 0 )
- return;
- TClientBoxEntry aEntry = GetEntryData(aSelected);
-
-#ifdef ENABLE_SDREMOTE
- RemoteServer::deauthoriseClient( aEntry->m_pClientInfo );
-#endif
- populateEntries();
+ m_pClientBox->setActive(this);
}
} //namespace dp_gui
diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.hxx b/sd/source/ui/dlg/RemoteDialogClientBox.hxx
index beab37d8543e..33cda2d6b788 100644
--- a/sd/source/ui/dlg/RemoteDialogClientBox.hxx
+++ b/sd/source/ui/dlg/RemoteDialogClientBox.hxx
@@ -21,9 +21,7 @@
#define INCLUDED_SD_SOURCE_UI_DLG_REMOTEDIALOGCLIENTBOX_HXX
#include <rtl/ustring.hxx>
-#include <vcl/scrbar.hxx>
-#include <vcl/button.hxx>
-#include <vcl/field.hxx>
+#include <vcl/weld.hxx>
#include <memory>
@@ -37,7 +35,7 @@ namespace sd {
#define RIGHT_ICON_OFFSET 5
#define SPACE_BETWEEN 3
-// struct ClientBoxEntry
+class ClientBox;
struct ClientBoxEntry;
struct ClientInfo;
@@ -45,77 +43,42 @@ typedef std::shared_ptr<ClientBoxEntry> TClientBoxEntry;
struct ClientBoxEntry
{
- bool m_bActive :1;
- std::shared_ptr<ClientInfo> m_pClientInfo;
+ std::unique_ptr<weld::Builder> m_xBuilder;
+ std::unique_ptr<weld::Container> m_xContainer;
+ std::unique_ptr<weld::Label> m_xDeviceName;
+ std::unique_ptr<weld::Label> m_xPinLabel;
+ std::unique_ptr<weld::Entry> m_xPinBox;
+ std::unique_ptr<weld::Button> m_xDeauthoriseButton;
- explicit ClientBoxEntry(const std::shared_ptr<ClientInfo>& pClientInfo);
- ~ClientBoxEntry();
+ std::shared_ptr<ClientInfo> m_xClientInfo;
+ ClientBox* m_pClientBox;
-};
+ DECL_LINK(DeauthoriseHdl, weld::Button&, void);
+ DECL_LINK(FocusHdl, weld::Widget&, void);
-// class ExtensionBox_Impl
+ ClientBoxEntry(ClientBox* pClientBox, const std::shared_ptr<ClientInfo>& pClientInfo);
+ ~ClientBoxEntry();
+};
-class ClientBox : public Control
+class ClientBox
{
- bool m_bHasScrollBar : 1;
- bool m_bHasActive : 1;
- bool m_bNeedsRecalc : 1;
- bool m_bAdjustActive : 1;
- //Must be guarded together with m_vEntries to ensure a valid index at all times.
- //Use m_entriesMutex as guard.
- long m_nActive;
- long m_nTopIndex;
- long m_nStdHeight;
- long m_nActiveHeight;
-
- VclPtr<NumericBox> m_aPinBox;
- VclPtr<PushButton> m_aDeauthoriseButton;
- ::tools::Rectangle m_sPinTextRect;
-
- VclPtr<ScrollBar> m_aScrollBar;
-
- //This mutex is used for synchronizing access to m_vEntries.
- //Currently it is used to synchronize adding, removing entries and
- //functions like getItemName, getItemDescription, etc. to prevent
- //that m_vEntries is accessed at an invalid index.
- //ToDo: There are many more places where m_vEntries is read and which may
- //fail. For example the Paint method is probable called from the main thread
- //while new entries are added / removed in a separate thread.
- mutable ::osl::Mutex m_entriesMutex;
+ std::unique_ptr<weld::ScrolledWindow> m_xScroll;
+ std::unique_ptr<weld::Container> m_xContents;
+
std::vector< TClientBoxEntry > m_vEntries;
+ ClientBoxEntry* m_pActive;
- void CalcActiveHeight();
- long GetTotalHeight() const;
- void SetupScrollBar();
- void DrawRow(vcl::RenderContext& rRenderContext, const ::tools::Rectangle& rRect, const TClientBoxEntry& rEntry);
- bool HandleCursorKey( sal_uInt16 nKeyCode );
+public:
+ ClientBox(std::unique_ptr<weld::ScrolledWindow> xScroll, std::unique_ptr<weld::Container> xContents);
+ weld::Container* GetContainer() { return m_xContents.get(); }
+ ~ClientBox();
- DECL_LINK( ScrollHdl, ScrollBar*, void );
- DECL_LINK( DeauthoriseHdl, Button*, void );
+ ClientBoxEntry* GetActiveEntry();
-public:
- ClientBox( vcl::Window* pParent, WinBits nStyle );
- virtual ~ClientBox() override;
- virtual void dispose() override;
-
- void MouseButtonDown( const MouseEvent& rMEvt ) override;
- void Paint( vcl::RenderContext& rRenderContext, const ::tools::Rectangle &rPaintRect ) override;
- void Resize() override;
- Size GetOptimalSize() const override;
- bool EventNotify( NotifyEvent& rNEvt ) override;
-
- TClientBoxEntry const & GetEntryData( long nPos ) { return m_vEntries[ nPos ]; }
- long GetActiveEntryIndex();
- ::tools::Rectangle GetEntryRect( const long nPos ) const;
- long PointToPos( const Point& rPos );
- void DoScroll( long nDelta );
- void RecalcAll();
-
- void selectEntry( const long nPos );
void addEntry(const std::shared_ptr<ClientInfo>& pClientInfo);
+ void setActive(ClientBoxEntry* pClientData);
void clearEntries();
- OUString getPin();
void populateEntries();
};
diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx
index d7b1434048d6..611ddb0307e8 100644
--- a/sd/source/ui/dlg/sddlgfact.cxx
+++ b/sd/source/ui/dlg/sddlgfact.cxx
@@ -472,9 +472,9 @@ VclPtr<AbstractSdStartPresDlg> SdAbstractDialogFactory_Impl::CreateSdStartPresen
return VclPtr<AbstractSdStartPresDlg_Impl>::Create(std::make_unique<SdStartPresentationDlg>(pParent, rInAttrs, rPageNames, pCSList));
}
-VclPtr<VclAbstractDialog> SdAbstractDialogFactory_Impl::CreateRemoteDialog( vcl::Window* pParent )
+VclPtr<VclAbstractDialog> SdAbstractDialogFactory_Impl::CreateRemoteDialog(weld::Window* pParent)
{
- return VclPtr<SdVclAbstractDialog_Impl>::Create( VclPtr<::sd::RemoteDialog>::Create( pParent ) );
+ return VclPtr<SdAbstractGenericDialog_Impl>::Create(std::make_unique<::sd::RemoteDialog>(pParent));
}
VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdPresLayoutTemplateDlg(SfxObjectShell* pDocSh, weld::Window* pParent, bool bBackgroundDlg, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool)
diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx
index d48d155bbcbe..4932d5c8fa28 100644
--- a/sd/source/ui/dlg/sddlgfact.hxx
+++ b/sd/source/ui/dlg/sddlgfact.hxx
@@ -393,7 +393,7 @@ public:
virtual VclPtr<SfxAbstractTabDialog> CreateSdParagraphTabDlg(weld::Window* pParent, const SfxItemSet* pAttr) override;
virtual VclPtr<AbstractSdStartPresDlg> CreateSdStartPresentationDlg(weld::Window* pWindow, const SfxItemSet& rInAttrs,
const std::vector<OUString> &rPageNames, SdCustomShowList* pCSList ) override;
- virtual VclPtr<VclAbstractDialog> CreateRemoteDialog( vcl::Window* pWindow ) override; // add for RemoteDialog
+ virtual VclPtr<VclAbstractDialog> CreateRemoteDialog(weld::Window* pWindow) override; // add for RemoteDialog
virtual VclPtr<SfxAbstractTabDialog> CreateSdPresLayoutTemplateDlg(SfxObjectShell* pDocSh, weld::Window* pParent, bool bBackgroundDlg, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool) override;
virtual VclPtr<AbstractSdPresLayoutDlg> CreateSdPresLayoutDlg(weld::Window* pParent, ::sd::DrawDocShell* pDocShell, const SfxItemSet& rInAttrs) override;
virtual VclPtr<SfxAbstractTabDialog> CreateSdTabTemplateDlg(weld::Window* pParent, const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView ) override;
diff --git a/sd/source/ui/inc/pubdlg.hxx b/sd/source/ui/inc/pubdlg.hxx
index 3f9bead30964..1ea586bae855 100644
--- a/sd/source/ui/inc/pubdlg.hxx
+++ b/sd/source/ui/inc/pubdlg.hxx
@@ -20,11 +20,7 @@
#ifndef INCLUDED_SD_SOURCE_UI_INC_PUBDLG_HXX
#define INCLUDED_SD_SOURCE_UI_INC_PUBDLG_HXX
-#include <vcl/fixed.hxx>
-#include <vcl/button.hxx>
-#include <vcl/field.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <pres.hxx>
#include "assclass.hxx"
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 4c2af27c3a93..160184b2d2a1 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -280,9 +280,10 @@ void SlotManager::FuTemporary (SfxRequest& rRequest)
case SID_REMOTE_DLG:
{
#ifdef ENABLE_SDREMOTE
- SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
- ScopedVclPtr<VclAbstractDialog> pDlg( pFact->CreateRemoteDialog( mrSlideSorter.GetContentWindow() ) );
- pDlg->Execute();
+ SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
+ vcl::Window* pWin = mrSlideSorter.GetContentWindow();
+ ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateRemoteDialog(pWin ? pWin->GetFrameWeld() : nullptr));
+ pDlg->Execute();
#endif
}
break;
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 7076ff93e1fe..63d5c5709d7b 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -3278,7 +3278,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
{
#ifdef ENABLE_SDREMOTE
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
- ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateRemoteDialog(GetActiveWindow()));
+ ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateRemoteDialog(GetFrameWeld()));
pDlg->Execute();
#endif
}
diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx
index 9935e2eecd5d..ce58f2c6696c 100644
--- a/sd/source/ui/view/outlnvs2.cxx
+++ b/sd/source/ui/view/outlnvs2.cxx
@@ -289,7 +289,7 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq)
{
#ifdef ENABLE_SDREMOTE
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
- ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateRemoteDialog(GetActiveWindow()));
+ ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateRemoteDialog(GetFrameWeld()));
pDlg->Execute();
#endif
}
diff --git a/sd/uiconfig/simpress/ui/clientboxfragment.ui b/sd/uiconfig/simpress/ui/clientboxfragment.ui
new file mode 100644
index 000000000000..361caeeb4823
--- /dev/null
+++ b/sd/uiconfig/simpress/ui/clientboxfragment.ui
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
+<interface domain="sd">
+ <requires lib="gtk+" version="3.20"/>
+ <object class="GtkGrid" id="ClientboxFragment">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">6</property>
+ <child>
+ <object class="GtkButton" id="button">
+ <property name="label" translatable="yes" context="clientboxfragment|STR_DEAUTHORISE_CLIENT">Remove client authorisation</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="name">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="pinlabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="clientboxfragment|STR_ENTER_PIN">Enter PIN:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">pin</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="pin">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="halign">start</property>
+ <property name="max_length">4</property>
+ <property name="activates_default">True</property>
+ <property name="width_chars">4</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <object class="GtkSizeGroup" id="sizegroup1">
+ <property name="mode">vertical</property>
+ <widgets>
+ <widget name="button"/>
+ <widget name="name"/>
+ <widget name="pinlabel"/>
+ <widget name="pin"/>
+ </widgets>
+ </object>
+</interface>
diff --git a/sd/uiconfig/simpress/ui/remotedialog.ui b/sd/uiconfig/simpress/ui/remotedialog.ui
index a2cb20bf6556..ee1b8e286069 100644
--- a/sd/uiconfig/simpress/ui/remotedialog.ui
+++ b/sd/uiconfig/simpress/ui/remotedialog.ui
@@ -1,13 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="sd">
<requires lib="gtk+" version="3.18"/>
- <requires lib="LibreOffice" version="1.0"/>
<object class="GtkDialog" id="RemoteDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes" context="remotedialog|RemoteDialog">Impress Remote</property>
+ <property name="modal">True</property>
+ <property name="default_width">0</property>
+ <property name="default_height">0</property>
<property name="type_hint">dialog</property>
+ <child>
+ <placeholder/>
+ </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
@@ -19,7 +24,7 @@
<property name="margin_top">5</property>
<property name="layout_style">end</property>
<child>
- <object class="GtkButton" id="connect">
+ <object class="GtkButton" id="ok">
<property name="label">gtk-connect</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -35,7 +40,7 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="close">
+ <object class="GtkButton" id="cancel">
<property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -75,6 +80,8 @@
<object class="GtkFrame" id="frame1">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
@@ -86,11 +93,49 @@
<property name="left_padding">12</property>
<property name="right_padding">12</property>
<child>
- <object class="sduilo-ClientBox" id="tree:border">
+ <object class="GtkScrolledWindow" id="scroll">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkViewport">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkBox" id="tree">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">3</property>
+ <property name="margin_right">3</property>
+ <property name="margin_top">3</property>
+ <property name="margin_bottom">3</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
</child>
</object>
@@ -115,8 +160,8 @@
</object>
</child>
<action-widgets>
- <action-widget response="101">connect</action-widget>
- <action-widget response="-7">close</action-widget>
+ <action-widget response="-5">ok</action-widget>
+ <action-widget response="-7">cancel</action-widget>
<action-widget response="-11">help</action-widget>
</action-widgets>
</object>