weld SvxMultiPathDialog
Change-Id: I9a509654d72bbe5b346002a3b23793bf69330720 Reviewed-on: https://gerrit.libreoffice.org/67297 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
@@ -41,33 +41,54 @@ using namespace ::com::sun::star::lang;
|
|||||||
using namespace ::com::sun::star::ui::dialogs;
|
using namespace ::com::sun::star::ui::dialogs;
|
||||||
using namespace ::com::sun::star::uno;
|
using namespace ::com::sun::star::uno;
|
||||||
|
|
||||||
IMPL_LINK_NOARG(SvxMultiPathDialog, SelectHdl_Impl, SvTreeListBox*, void)
|
IMPL_LINK_NOARG(SvxMultiPathDialog, SelectHdl_Impl, weld::TreeView&, void)
|
||||||
{
|
{
|
||||||
sal_uLong nCount = m_pRadioLB->GetEntryCount();
|
auto nCount = m_xRadioLB->n_children();
|
||||||
bool bIsSelected = m_pRadioLB->FirstSelected() != nullptr;
|
bool bIsSelected = m_xRadioLB->get_selected_index() != -1;
|
||||||
bool bEnable = nCount > 1;
|
bool bEnable = nCount > 1;
|
||||||
m_pDelBtn->Enable(bEnable && bIsSelected);
|
m_xDelBtn->set_sensitive(bEnable && bIsSelected);
|
||||||
}
|
}
|
||||||
|
|
||||||
IMPL_LINK_NOARG(SvxPathSelectDialog, SelectHdl_Impl, weld::TreeView&, void)
|
IMPL_LINK_NOARG(SvxPathSelectDialog, SelectHdl_Impl, weld::TreeView&, void)
|
||||||
{
|
{
|
||||||
sal_uLong nCount = m_xPathLB->n_children();
|
auto nCount = m_xPathLB->n_children();
|
||||||
bool bIsSelected = m_xPathLB->get_selected_index() != -1;
|
bool bIsSelected = m_xPathLB->get_selected_index() != -1;
|
||||||
bool bEnable = nCount > 1;
|
bool bEnable = nCount > 1;
|
||||||
m_xDelBtn->set_sensitive(bEnable && bIsSelected);
|
m_xDelBtn->set_sensitive(bEnable && bIsSelected);
|
||||||
}
|
}
|
||||||
|
|
||||||
IMPL_LINK( SvxMultiPathDialog, CheckHdl_Impl, SvTreeListBox*, pBox, void )
|
void SvxMultiPathDialog::HandleEntryChecked(int nRow)
|
||||||
{
|
{
|
||||||
SvTreeListEntry* pEntry =
|
m_xRadioLB->select(nRow);
|
||||||
pBox
|
bool bChecked = m_xRadioLB->get_toggle(nRow, 0);
|
||||||
? pBox->GetEntry( static_cast<svx::SvxRadioButtonListBox*>(pBox)->GetCurMousePoint() )
|
if (bChecked)
|
||||||
: m_pRadioLB->FirstSelected();
|
{
|
||||||
if ( pEntry )
|
// we have radio button behavior -> so uncheck the other entries
|
||||||
m_pRadioLB->HandleEntryChecked( pEntry );
|
int nCount = m_xRadioLB->n_children();
|
||||||
|
for (int i = 0; i < nCount; ++i)
|
||||||
|
{
|
||||||
|
if (i != nRow)
|
||||||
|
m_xRadioLB->set_toggle(i, false, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IMPL_LINK_NOARG(SvxMultiPathDialog, AddHdl_Impl, Button*, void)
|
IMPL_LINK(SvxMultiPathDialog, CheckHdl_Impl, const row_col&, rRowCol, void)
|
||||||
|
{
|
||||||
|
HandleEntryChecked(rRowCol.first);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SvxMultiPathDialog::AppendEntry(const OUString& rText, const OUString& rId)
|
||||||
|
{
|
||||||
|
m_xRadioLB->insert(nullptr, -1, nullptr, nullptr, nullptr,
|
||||||
|
nullptr, nullptr, false);
|
||||||
|
const int nRow = m_xRadioLB->n_children() - 1;
|
||||||
|
m_xRadioLB->set_toggle(nRow, false, 0);
|
||||||
|
m_xRadioLB->set_text(nRow, rText, 1);
|
||||||
|
m_xRadioLB->set_id(nRow, rId);
|
||||||
|
}
|
||||||
|
|
||||||
|
IMPL_LINK_NOARG(SvxMultiPathDialog, AddHdl_Impl, weld::Button&, void)
|
||||||
{
|
{
|
||||||
Reference < XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
|
Reference < XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
|
||||||
Reference < XFolderPicker2 > xFolderPicker = FolderPicker::create(xContext);
|
Reference < XFolderPicker2 > xFolderPicker = FolderPicker::create(xContext);
|
||||||
@@ -80,25 +101,20 @@ IMPL_LINK_NOARG(SvxMultiPathDialog, AddHdl_Impl, Button*, void)
|
|||||||
OUString sInsPath;
|
OUString sInsPath;
|
||||||
osl::FileBase::getSystemPathFromFileURL(aURL, sInsPath);
|
osl::FileBase::getSystemPathFromFileURL(aURL, sInsPath);
|
||||||
|
|
||||||
sal_uLong nPos = m_pRadioLB->GetEntryPos( sInsPath, 1 );
|
if (m_xRadioLB->find_text(sInsPath) != -1)
|
||||||
if ( 0xffffffff == nPos ) //See svtools/source/contnr/svtabbx.cxx SvTabListBox::GetEntryPos
|
|
||||||
{
|
|
||||||
OUString sNewEntry( '\t' );
|
|
||||||
sNewEntry += sInsPath;
|
|
||||||
SvTreeListEntry* pEntry = m_pRadioLB->InsertEntry( sNewEntry );
|
|
||||||
OUString* pData = new OUString( aURL );
|
|
||||||
pEntry->SetUserData( pData );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
OUString sMsg( CuiResId( RID_MULTIPATH_DBL_ERR ) );
|
OUString sMsg( CuiResId( RID_MULTIPATH_DBL_ERR ) );
|
||||||
sMsg = sMsg.replaceFirst( "%1", sInsPath );
|
sMsg = sMsg.replaceFirst( "%1", sInsPath );
|
||||||
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
|
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(m_xDialog.get(),
|
||||||
VclMessageType::Info, VclButtonsType::Ok, sMsg));
|
VclMessageType::Info, VclButtonsType::Ok, sMsg));
|
||||||
xInfoBox->run();
|
xInfoBox->run();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AppendEntry(sInsPath, aURL);
|
||||||
|
}
|
||||||
|
|
||||||
SelectHdl_Impl( nullptr );
|
SelectHdl_Impl(*m_xRadioLB);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,30 +148,27 @@ IMPL_LINK_NOARG(SvxPathSelectDialog, AddHdl_Impl, weld::Button&, void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IMPL_LINK_NOARG(SvxMultiPathDialog, DelHdl_Impl, Button*, void)
|
IMPL_LINK_NOARG(SvxMultiPathDialog, DelHdl_Impl, weld::Button&, void)
|
||||||
{
|
{
|
||||||
SvTreeListEntry* pEntry = m_pRadioLB->FirstSelected();
|
int nPos = m_xRadioLB->get_selected_index();
|
||||||
delete static_cast<OUString*>(pEntry->GetUserData());
|
bool bChecked = m_xRadioLB->get_toggle(nPos, 0);
|
||||||
bool bChecked = m_pRadioLB->GetCheckButtonState( pEntry ) == SvButtonState::Checked;
|
m_xRadioLB->remove(nPos);
|
||||||
sal_uLong nPos = m_pRadioLB->GetEntryPos( pEntry );
|
int nCnt = m_xRadioLB->n_children();
|
||||||
m_pRadioLB->RemoveEntry( pEntry );
|
if (nCnt)
|
||||||
sal_uLong nCnt = m_pRadioLB->GetEntryCount();
|
|
||||||
if ( nCnt )
|
|
||||||
{
|
{
|
||||||
nCnt--;
|
--nCnt;
|
||||||
|
|
||||||
if ( nPos > nCnt )
|
if ( nPos > nCnt )
|
||||||
nPos = nCnt;
|
nPos = nCnt;
|
||||||
pEntry = m_pRadioLB->GetEntry( nPos );
|
if (bChecked)
|
||||||
if ( bChecked )
|
|
||||||
{
|
{
|
||||||
m_pRadioLB->SetCheckButtonState( pEntry, SvButtonState::Checked );
|
m_xRadioLB->set_toggle(nPos, true, 0);
|
||||||
m_pRadioLB->HandleEntryChecked( pEntry );
|
HandleEntryChecked(nPos);
|
||||||
}
|
}
|
||||||
else
|
m_xRadioLB->select(nPos);
|
||||||
m_pRadioLB->Select( pEntry );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SelectHdl_Impl( nullptr );
|
SelectHdl_Impl(*m_xRadioLB);
|
||||||
}
|
}
|
||||||
|
|
||||||
IMPL_LINK_NOARG(SvxPathSelectDialog, DelHdl_Impl, weld::Button&, void)
|
IMPL_LINK_NOARG(SvxPathSelectDialog, DelHdl_Impl, weld::Button&, void)
|
||||||
@@ -176,33 +189,28 @@ IMPL_LINK_NOARG(SvxPathSelectDialog, DelHdl_Impl, weld::Button&, void)
|
|||||||
SelectHdl_Impl(*m_xPathLB);
|
SelectHdl_Impl(*m_xPathLB);
|
||||||
}
|
}
|
||||||
|
|
||||||
SvxMultiPathDialog::SvxMultiPathDialog(vcl::Window* pParent)
|
SvxMultiPathDialog::SvxMultiPathDialog(weld::Window* pParent)
|
||||||
: ModalDialog(pParent, "MultiPathDialog", "cui/ui/multipathdialog.ui")
|
: GenericDialogController(pParent, "cui/ui/multipathdialog.ui", "MultiPathDialog")
|
||||||
|
, m_xRadioLB(m_xBuilder->weld_tree_view("paths"))
|
||||||
|
, m_xAddBtn(m_xBuilder->weld_button("add"))
|
||||||
|
, m_xDelBtn(m_xBuilder->weld_button("delete"))
|
||||||
{
|
{
|
||||||
get(m_pAddBtn, "add");
|
m_xRadioLB->set_size_request(m_xRadioLB->get_approximate_digit_width() * 60,
|
||||||
get(m_pDelBtn, "delete");
|
m_xRadioLB->get_text_height() * 10);
|
||||||
|
|
||||||
SvSimpleTableContainer* pRadioLBContainer = get<SvSimpleTableContainer>("paths");
|
std::vector<int> aWidths;
|
||||||
Size aSize(LogicToPixel(Size(195, 77), MapMode(MapUnit::MapAppFont)));
|
aWidths.push_back(m_xRadioLB->get_approximate_digit_width() * 3 + 6);
|
||||||
pRadioLBContainer->set_width_request(aSize.Width());
|
m_xRadioLB->set_column_fixed_widths(aWidths);
|
||||||
pRadioLBContainer->set_height_request(aSize.Height());
|
|
||||||
m_pRadioLB = VclPtr<svx::SvxRadioButtonListBox>::Create(*pRadioLBContainer, 0);
|
|
||||||
|
|
||||||
static long aStaticTabs[]= { 0, 12 };
|
std::vector<int> aRadioColumns;
|
||||||
m_pRadioLB->SvSimpleTable::SetTabs( SAL_N_ELEMENTS(aStaticTabs), aStaticTabs );
|
aRadioColumns.push_back(0);
|
||||||
OUString sHeader(get<FixedText>("pathlist")->GetText());
|
m_xRadioLB->set_toggle_columns_as_radio(aRadioColumns);
|
||||||
m_pRadioLB->SetQuickHelpText( sHeader );
|
m_xRadioLB->connect_toggled(LINK(this, SvxMultiPathDialog, CheckHdl_Impl));
|
||||||
sHeader = "\t" + sHeader;
|
m_xRadioLB->connect_changed(LINK(this, SvxMultiPathDialog, SelectHdl_Impl));
|
||||||
m_pRadioLB->InsertHeaderEntry( sHeader, HEADERBAR_APPEND, HeaderBarItemBits::LEFT );
|
m_xAddBtn->connect_clicked(LINK(this, SvxMultiPathDialog, AddHdl_Impl));
|
||||||
|
m_xDelBtn->connect_clicked(LINK(this, SvxMultiPathDialog, DelHdl_Impl));
|
||||||
|
|
||||||
m_pRadioLB->SetSelectHdl( LINK( this, SvxMultiPathDialog, SelectHdl_Impl ) );
|
SelectHdl_Impl(*m_xRadioLB);
|
||||||
m_pRadioLB->SetCheckButtonHdl( LINK( this, SvxMultiPathDialog, CheckHdl_Impl ) );
|
|
||||||
m_pAddBtn->SetClickHdl( LINK( this, SvxMultiPathDialog, AddHdl_Impl ) );
|
|
||||||
m_pDelBtn->SetClickHdl( LINK( this, SvxMultiPathDialog, DelHdl_Impl ) );
|
|
||||||
|
|
||||||
SelectHdl_Impl( nullptr );
|
|
||||||
|
|
||||||
m_pRadioLB->ShowTable();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SvxPathSelectDialog::SvxPathSelectDialog(weld::Window* pParent)
|
SvxPathSelectDialog::SvxPathSelectDialog(weld::Window* pParent)
|
||||||
@@ -223,25 +231,6 @@ SvxPathSelectDialog::SvxPathSelectDialog(weld::Window* pParent)
|
|||||||
|
|
||||||
SvxMultiPathDialog::~SvxMultiPathDialog()
|
SvxMultiPathDialog::~SvxMultiPathDialog()
|
||||||
{
|
{
|
||||||
disposeOnce();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SvxMultiPathDialog::dispose()
|
|
||||||
{
|
|
||||||
if (m_pRadioLB)
|
|
||||||
{
|
|
||||||
sal_uInt16 nPos = static_cast<sal_uInt16>(m_pRadioLB->GetEntryCount());
|
|
||||||
while ( nPos-- )
|
|
||||||
{
|
|
||||||
SvTreeListEntry* pEntry = m_pRadioLB->GetEntry( nPos );
|
|
||||||
delete static_cast<OUString*>(pEntry->GetUserData());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_pRadioLB.disposeAndClear();
|
|
||||||
m_pAddBtn.clear();
|
|
||||||
m_pDelBtn.clear();
|
|
||||||
ModalDialog::dispose();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OUString SvxMultiPathDialog::GetPath() const
|
OUString SvxMultiPathDialog::GetPath() const
|
||||||
@@ -250,19 +239,18 @@ OUString SvxMultiPathDialog::GetPath() const
|
|||||||
sal_Unicode cDelim = SVT_SEARCHPATH_DELIMITER;
|
sal_Unicode cDelim = SVT_SEARCHPATH_DELIMITER;
|
||||||
|
|
||||||
OUString sWritable;
|
OUString sWritable;
|
||||||
for ( sal_uLong i = 0; i < m_pRadioLB->GetEntryCount(); ++i )
|
for (int i = 0, nCount = m_xRadioLB->n_children(); i < nCount; ++i)
|
||||||
{
|
{
|
||||||
SvTreeListEntry* pEntry = m_pRadioLB->GetEntry(i);
|
if (m_xRadioLB->get_toggle(i, 0))
|
||||||
if ( m_pRadioLB->GetCheckButtonState( pEntry ) == SvButtonState::Checked )
|
sWritable = m_xRadioLB->get_id(i);
|
||||||
sWritable = *static_cast<OUString*>(pEntry->GetUserData());
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( !sNewPath.isEmpty() )
|
if (!sNewPath.isEmpty())
|
||||||
sNewPath.append(cDelim);
|
sNewPath.append(cDelim);
|
||||||
sNewPath.append( *static_cast<OUString*>(pEntry->GetUserData()) );
|
sNewPath.append(m_xRadioLB->get_id(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( !sNewPath.isEmpty() )
|
if (!sNewPath.isEmpty())
|
||||||
sNewPath.append(cDelim);
|
sNewPath.append(cDelim);
|
||||||
sNewPath.append(sWritable);
|
sNewPath.append(sWritable);
|
||||||
|
|
||||||
@@ -288,7 +276,7 @@ void SvxMultiPathDialog::SetPath( const OUString& rPath )
|
|||||||
if ( !rPath.isEmpty() )
|
if ( !rPath.isEmpty() )
|
||||||
{
|
{
|
||||||
const sal_Unicode cDelim = SVT_SEARCHPATH_DELIMITER;
|
const sal_Unicode cDelim = SVT_SEARCHPATH_DELIMITER;
|
||||||
sal_uLong nCount = 0;
|
int nCount = 0;
|
||||||
sal_Int32 nIndex = 0;
|
sal_Int32 nIndex = 0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@@ -297,23 +285,20 @@ void SvxMultiPathDialog::SetPath( const OUString& rPath )
|
|||||||
bool bIsSystemPath =
|
bool bIsSystemPath =
|
||||||
osl::FileBase::getSystemPathFromFileURL(sPath, sSystemPath) == osl::FileBase::E_None;
|
osl::FileBase::getSystemPathFromFileURL(sPath, sSystemPath) == osl::FileBase::E_None;
|
||||||
|
|
||||||
const OUString sEntry( "\t" + (bIsSystemPath ? sSystemPath : sPath));
|
const OUString sEntry((bIsSystemPath ? sSystemPath : sPath));
|
||||||
SvTreeListEntry* pEntry = m_pRadioLB->InsertEntry( sEntry );
|
AppendEntry(sEntry, sPath);
|
||||||
OUString* pURL = new OUString( sPath );
|
|
||||||
pEntry->SetUserData( pURL );
|
|
||||||
++nCount;
|
++nCount;
|
||||||
}
|
}
|
||||||
while (nIndex >= 0);
|
while (nIndex >= 0);
|
||||||
|
|
||||||
SvTreeListEntry* pEntry = m_pRadioLB->GetEntry( nCount - 1 );
|
if (nCount)
|
||||||
if ( pEntry )
|
|
||||||
{
|
{
|
||||||
m_pRadioLB->SetCheckButtonState( pEntry, SvButtonState::Checked );
|
m_xRadioLB->set_toggle(nCount - 1, true, 0);
|
||||||
m_pRadioLB->HandleEntryChecked( pEntry );
|
HandleEntryChecked(nCount - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SelectHdl_Impl( nullptr );
|
SelectHdl_Impl(*m_xRadioLB);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SvxPathSelectDialog::SetPath(const OUString& rPath)
|
void SvxPathSelectDialog::SetPath(const OUString& rPath)
|
||||||
|
@@ -206,7 +206,10 @@ short AbstractSvxObjectTitleDescDialog_Impl::Execute()
|
|||||||
return m_xDlg->run();
|
return m_xDlg->run();
|
||||||
}
|
}
|
||||||
|
|
||||||
IMPL_ABSTDLG_BASE(AbstractSvxMultiPathDialog_Impl);
|
short AbstractSvxMultiPathDialog_Impl::Execute()
|
||||||
|
{
|
||||||
|
return m_xDlg->run();
|
||||||
|
}
|
||||||
|
|
||||||
short AbstractSvxPathSelectDialog_Impl::Execute()
|
short AbstractSvxPathSelectDialog_Impl::Execute()
|
||||||
{
|
{
|
||||||
@@ -751,17 +754,17 @@ void AbstractSvxObjectTitleDescDialog_Impl::GetDescription(OUString& rDescriptio
|
|||||||
|
|
||||||
OUString AbstractSvxMultiPathDialog_Impl::GetPath() const
|
OUString AbstractSvxMultiPathDialog_Impl::GetPath() const
|
||||||
{
|
{
|
||||||
return pDlg->GetPath();
|
return m_xDlg->GetPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractSvxMultiPathDialog_Impl::SetPath( const OUString& rPath )
|
void AbstractSvxMultiPathDialog_Impl::SetPath( const OUString& rPath )
|
||||||
{
|
{
|
||||||
pDlg->SetPath( rPath );
|
m_xDlg->SetPath( rPath );
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractSvxMultiPathDialog_Impl::SetTitle( const OUString& rNewTitle )
|
void AbstractSvxMultiPathDialog_Impl::SetTitle( const OUString& rNewTitle )
|
||||||
{
|
{
|
||||||
pDlg->SetText( rNewTitle );
|
m_xDlg->SetTitle(rNewTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
OUString AbstractSvxPathSelectDialog_Impl::GetPath() const
|
OUString AbstractSvxPathSelectDialog_Impl::GetPath() const
|
||||||
@@ -1230,10 +1233,9 @@ VclPtr<AbstractSvxObjectTitleDescDialog> AbstractDialogFactory_Impl::CreateSvxOb
|
|||||||
return VclPtr<AbstractSvxObjectTitleDescDialog_Impl>::Create(std::make_unique<SvxObjectTitleDescDialog>(pParent, rTitle, rDescription));
|
return VclPtr<AbstractSvxObjectTitleDescDialog_Impl>::Create(std::make_unique<SvxObjectTitleDescDialog>(pParent, rTitle, rDescription));
|
||||||
}
|
}
|
||||||
|
|
||||||
VclPtr<AbstractSvxMultiPathDialog> AbstractDialogFactory_Impl::CreateSvxMultiPathDialog(vcl::Window* pParent)
|
VclPtr<AbstractSvxMultiPathDialog> AbstractDialogFactory_Impl::CreateSvxMultiPathDialog(weld::Window* pParent)
|
||||||
{
|
{
|
||||||
VclPtrInstance<SvxMultiPathDialog> pDlg(pParent);
|
return VclPtr<AbstractSvxMultiPathDialog_Impl>::Create(std::make_unique<SvxMultiPathDialog>(pParent));
|
||||||
return VclPtr<AbstractSvxMultiPathDialog_Impl>::Create( pDlg );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VclPtr<AbstractSvxMultiPathDialog> AbstractDialogFactory_Impl::CreateSvxPathSelectDialog(weld::Window* pParent)
|
VclPtr<AbstractSvxMultiPathDialog> AbstractDialogFactory_Impl::CreateSvxPathSelectDialog(weld::Window* pParent)
|
||||||
|
@@ -463,10 +463,16 @@ public:
|
|||||||
virtual void GetDescription(OUString& rName) override;
|
virtual void GetDescription(OUString& rName) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SvxMultiPathDialog;
|
|
||||||
class AbstractSvxMultiPathDialog_Impl : public AbstractSvxMultiPathDialog
|
class AbstractSvxMultiPathDialog_Impl : public AbstractSvxMultiPathDialog
|
||||||
{
|
{
|
||||||
DECL_ABSTDLG_BASE(AbstractSvxMultiPathDialog_Impl,SvxMultiPathDialog)
|
protected:
|
||||||
|
std::unique_ptr<SvxMultiPathDialog> m_xDlg;
|
||||||
|
public:
|
||||||
|
explicit AbstractSvxMultiPathDialog_Impl(std::unique_ptr<SvxMultiPathDialog> p)
|
||||||
|
: m_xDlg(std::move(p))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
virtual short Execute() override;
|
||||||
virtual OUString GetPath() const override;
|
virtual OUString GetPath() const override;
|
||||||
virtual void SetPath( const OUString& rPath ) override;
|
virtual void SetPath( const OUString& rPath ) override;
|
||||||
virtual void SetTitle( const OUString& rNewTitle ) override;
|
virtual void SetTitle( const OUString& rNewTitle ) override;
|
||||||
@@ -774,7 +780,7 @@ public:
|
|||||||
virtual VclPtr<AbstractSvxObjectNameDialog> CreateSvxObjectNameDialog(weld::Window* pParent, const OUString& rName) override;
|
virtual VclPtr<AbstractSvxObjectNameDialog> CreateSvxObjectNameDialog(weld::Window* pParent, const OUString& rName) override;
|
||||||
virtual VclPtr<AbstractSvxObjectTitleDescDialog> CreateSvxObjectTitleDescDialog(weld::Window* pParent, const OUString& rTitle, const OUString& rDescription) override;
|
virtual VclPtr<AbstractSvxObjectTitleDescDialog> CreateSvxObjectTitleDescDialog(weld::Window* pParent, const OUString& rTitle, const OUString& rDescription) override;
|
||||||
|
|
||||||
virtual VclPtr<AbstractSvxMultiPathDialog> CreateSvxMultiPathDialog(vcl::Window* pParent) override;
|
virtual VclPtr<AbstractSvxMultiPathDialog> CreateSvxMultiPathDialog(weld::Window* pParent) override;
|
||||||
virtual VclPtr<AbstractSvxMultiPathDialog> CreateSvxPathSelectDialog(weld::Window* pParent) override;
|
virtual VclPtr<AbstractSvxMultiPathDialog> CreateSvxPathSelectDialog(weld::Window* pParent) override;
|
||||||
virtual VclPtr<AbstractSvxHpLinkDlg> CreateSvxHpLinkDlg(vcl::Window* pParent, SfxBindings* pBindings) override;
|
virtual VclPtr<AbstractSvxHpLinkDlg> CreateSvxHpLinkDlg(vcl::Window* pParent, SfxBindings* pBindings) override;
|
||||||
virtual VclPtr<AbstractFmSearchDialog> CreateFmSearchDialog(vcl::Window* pParent,
|
virtual VclPtr<AbstractFmSearchDialog> CreateFmSearchDialog(vcl::Window* pParent,
|
||||||
|
@@ -19,10 +19,7 @@
|
|||||||
#ifndef INCLUDED_CUI_SOURCE_INC_MULTIPAT_HXX
|
#ifndef INCLUDED_CUI_SOURCE_INC_MULTIPAT_HXX
|
||||||
#define INCLUDED_CUI_SOURCE_INC_MULTIPAT_HXX
|
#define INCLUDED_CUI_SOURCE_INC_MULTIPAT_HXX
|
||||||
|
|
||||||
#include <vcl/dialog.hxx>
|
#include <vcl/weld.hxx>
|
||||||
#include <vcl/button.hxx>
|
|
||||||
#include <vcl/fixed.hxx>
|
|
||||||
|
|
||||||
#include "radiobtnbox.hxx"
|
#include "radiobtnbox.hxx"
|
||||||
|
|
||||||
// define ----------------------------------------------------------------
|
// define ----------------------------------------------------------------
|
||||||
@@ -35,25 +32,29 @@
|
|||||||
#define CLASSPATH_DELIMITER ';'
|
#define CLASSPATH_DELIMITER ';'
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class SvxMultiPathDialog : public ModalDialog
|
class SvxMultiPathDialog : public weld::GenericDialogController
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
VclPtr<svx::SvxRadioButtonListBox> m_pRadioLB;
|
std::unique_ptr<weld::TreeView> m_xRadioLB;
|
||||||
VclPtr<PushButton> m_pAddBtn;
|
std::unique_ptr<weld::Button> m_xAddBtn;
|
||||||
VclPtr<PushButton> m_pDelBtn;
|
std::unique_ptr<weld::Button> m_xDelBtn;
|
||||||
|
|
||||||
DECL_LINK(AddHdl_Impl, Button*, void);
|
void AppendEntry(const OUString& rText, const OUString& rId);
|
||||||
DECL_LINK(DelHdl_Impl, Button*, void);
|
void HandleEntryChecked(int nRow);
|
||||||
DECL_LINK(SelectHdl_Impl, SvTreeListBox*, void);
|
|
||||||
DECL_LINK(CheckHdl_Impl, SvTreeListBox*, void);
|
DECL_LINK(AddHdl_Impl, weld::Button&, void);
|
||||||
|
DECL_LINK(DelHdl_Impl, weld::Button&, void);
|
||||||
|
DECL_LINK(SelectHdl_Impl, weld::TreeView&, void);
|
||||||
|
typedef std::pair<int, int> row_col;
|
||||||
|
DECL_LINK(CheckHdl_Impl, const row_col&, void);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SvxMultiPathDialog(vcl::Window* pParent);
|
SvxMultiPathDialog(weld::Window* pParent);
|
||||||
virtual ~SvxMultiPathDialog() override;
|
virtual ~SvxMultiPathDialog() override;
|
||||||
virtual void dispose() override;
|
|
||||||
|
|
||||||
OUString GetPath() const;
|
OUString GetPath() const;
|
||||||
void SetPath( const OUString& rPath );
|
void SetPath(const OUString& rPath);
|
||||||
|
void SetTitle(const OUString& rTitle) { m_xDialog->set_title(rTitle); }
|
||||||
};
|
};
|
||||||
|
|
||||||
class SvxPathSelectDialog : public weld::GenericDialogController
|
class SvxPathSelectDialog : public weld::GenericDialogController
|
||||||
|
@@ -558,7 +558,7 @@ IMPL_LINK_NOARG(SvxPathTabPage, PathHdl_Impl, Button*, void)
|
|||||||
{
|
{
|
||||||
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
|
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
|
||||||
ScopedVclPtr<AbstractSvxMultiPathDialog> pMultiDlg(
|
ScopedVclPtr<AbstractSvxMultiPathDialog> pMultiDlg(
|
||||||
pFact->CreateSvxMultiPathDialog( this ));
|
pFact->CreateSvxMultiPathDialog(GetDialogFrameWeld()));
|
||||||
|
|
||||||
OUString sPath( sUser );
|
OUString sPath( sUser );
|
||||||
if ( !sPath.isEmpty() )
|
if ( !sPath.isEmpty() )
|
||||||
|
@@ -1,14 +1,28 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- Generated with glade 3.18.3 -->
|
<!-- Generated with glade 3.22.1 -->
|
||||||
<interface domain="cui">
|
<interface domain="cui">
|
||||||
<requires lib="gtk+" version="3.18"/>
|
<requires lib="gtk+" version="3.18"/>
|
||||||
<requires lib="LibreOffice" version="1.0"/>
|
<object class="GtkTreeStore" id="liststore1">
|
||||||
|
<columns>
|
||||||
|
<!-- column-name check1 -->
|
||||||
|
<column type="gboolean"/>
|
||||||
|
<!-- column-name text -->
|
||||||
|
<column type="gchararray"/>
|
||||||
|
<!-- column-name id -->
|
||||||
|
<column type="gchararray"/>
|
||||||
|
<!-- column-name checkvis1 -->
|
||||||
|
<column type="gboolean"/>
|
||||||
|
</columns>
|
||||||
|
</object>
|
||||||
<object class="GtkDialog" id="MultiPathDialog">
|
<object class="GtkDialog" id="MultiPathDialog">
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="border_width">6</property>
|
<property name="border_width">6</property>
|
||||||
<property name="title" translatable="yes" context="multipathdialog|MultiPathDialog">Select Paths</property>
|
<property name="title" translatable="yes" context="multipathdialog|MultiPathDialog">Select Paths</property>
|
||||||
<property name="resizable">False</property>
|
<property name="resizable">False</property>
|
||||||
<property name="type_hint">normal</property>
|
<property name="type_hint">normal</property>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
<child internal-child="vbox">
|
<child internal-child="vbox">
|
||||||
<object class="GtkBox" id="dialog-vbox1">
|
<object class="GtkBox" id="dialog-vbox1">
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
@@ -140,29 +154,59 @@
|
|||||||
<object class="GtkGrid" id="grid2">
|
<object class="GtkGrid" id="grid2">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
|
<property name="hexpand">True</property>
|
||||||
|
<property name="vexpand">True</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="svtlo-SvSimpleTableContainer" id="paths">
|
<object class="GtkScrolledWindow">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="hexpand">True</property>
|
<property name="hexpand">True</property>
|
||||||
<property name="vexpand">True</property>
|
<property name="vexpand">True</property>
|
||||||
<property name="search_column">0</property>
|
<property name="shadow_type">in</property>
|
||||||
<child internal-child="selection">
|
<child>
|
||||||
<object class="GtkTreeSelection" id="Simple Table Container-selection"/>
|
<object class="GtkTreeView" id="paths">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">True</property>
|
||||||
|
<property name="vexpand">True</property>
|
||||||
|
<property name="model">liststore1</property>
|
||||||
|
<property name="search_column">0</property>
|
||||||
|
<property name="show_expanders">False</property>
|
||||||
|
<child internal-child="selection">
|
||||||
|
<object class="GtkTreeSelection" id="Macro Library List-selection2"/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkTreeViewColumn" id="treeviewcolumn4">
|
||||||
|
<property name="resizable">True</property>
|
||||||
|
<property name="spacing">6</property>
|
||||||
|
<property name="alignment">0.5</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkCellRendererToggle" id="cellrenderer5">
|
||||||
|
<property name="radio">True</property>
|
||||||
|
</object>
|
||||||
|
<attributes>
|
||||||
|
<attribute name="visible">3</attribute>
|
||||||
|
<attribute name="active">0</attribute>
|
||||||
|
</attributes>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkTreeViewColumn" id="treeviewcolumn5">
|
||||||
|
<property name="resizable">True</property>
|
||||||
|
<property name="spacing">6</property>
|
||||||
|
<property name="title" translatable="yes" context="multipathdialog|pathlist">Path list</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkCellRendererText" id="cellrenderer4"/>
|
||||||
|
<attributes>
|
||||||
|
<attribute name="text">1</attribute>
|
||||||
|
</attributes>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="pathlist">
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="no_show_all">True</property>
|
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="label" translatable="yes" context="multipathdialog|pathlist">Path list:</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
<property name="top_attach">0</property>
|
<property name="top_attach">0</property>
|
||||||
|
@@ -392,7 +392,7 @@ public:
|
|||||||
virtual VclPtr<AbstractSvxObjectNameDialog> CreateSvxObjectNameDialog(weld::Window* pParent, const OUString& rName) = 0;
|
virtual VclPtr<AbstractSvxObjectNameDialog> CreateSvxObjectNameDialog(weld::Window* pParent, const OUString& rName) = 0;
|
||||||
virtual VclPtr<AbstractSvxObjectTitleDescDialog> CreateSvxObjectTitleDescDialog(weld::Window* pParent, const OUString& rTitle, const OUString& rDescription) = 0;
|
virtual VclPtr<AbstractSvxObjectTitleDescDialog> CreateSvxObjectTitleDescDialog(weld::Window* pParent, const OUString& rTitle, const OUString& rDescription) = 0;
|
||||||
|
|
||||||
virtual VclPtr<AbstractSvxMultiPathDialog> CreateSvxMultiPathDialog(vcl::Window* pParent) = 0 ;
|
virtual VclPtr<AbstractSvxMultiPathDialog> CreateSvxMultiPathDialog(weld::Window* pParent) = 0 ;
|
||||||
virtual VclPtr<AbstractSvxMultiPathDialog> CreateSvxPathSelectDialog(weld::Window* pParent) = 0 ;
|
virtual VclPtr<AbstractSvxMultiPathDialog> CreateSvxPathSelectDialog(weld::Window* pParent) = 0 ;
|
||||||
virtual VclPtr<AbstractSvxHpLinkDlg> CreateSvxHpLinkDlg(vcl::Window* pParent, SfxBindings* pBindings)=0;
|
virtual VclPtr<AbstractSvxHpLinkDlg> CreateSvxHpLinkDlg(vcl::Window* pParent, SfxBindings* pBindings)=0;
|
||||||
virtual VclPtr<AbstractFmSearchDialog> CreateFmSearchDialog(vcl::Window* pParent,
|
virtual VclPtr<AbstractFmSearchDialog> CreateFmSearchDialog(vcl::Window* pParent,
|
||||||
|
@@ -5261,7 +5261,7 @@ public:
|
|||||||
|
|
||||||
virtual int find_text(const OUString& rText) const override
|
virtual int find_text(const OUString& rText) const override
|
||||||
{
|
{
|
||||||
Search aSearch(rText, 0);
|
Search aSearch(rText, m_nTextCol);
|
||||||
gtk_tree_model_foreach(GTK_TREE_MODEL(m_pTreeStore), foreach_find, &aSearch);
|
gtk_tree_model_foreach(GTK_TREE_MODEL(m_pTreeStore), foreach_find, &aSearch);
|
||||||
return aSearch.index;
|
return aSearch.index;
|
||||||
}
|
}
|
||||||
@@ -7185,7 +7185,8 @@ public:
|
|||||||
|
|
||||||
virtual int find_id(const OUString& rId) const override
|
virtual int find_id(const OUString& rId) const override
|
||||||
{
|
{
|
||||||
return find(rId, 1);
|
gint id_column = gtk_combo_box_get_id_column(m_pComboBox);
|
||||||
|
return find(rId, id_column);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void clear() override
|
virtual void clear() override
|
||||||
|
Reference in New Issue
Block a user