summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-11-30 13:29:23 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-12-02 11:10:31 +0100
commitcd5bef5e19c2812386ab6afee4b3bc43fe5541b9 (patch)
treeacaca75e4a2972beb0fc8c0867f048ccc238ec67
parentRelated: tdf#121810 pass suitable message dialog parent around (diff)
downloadcore-cd5bef5e19c2812386ab6afee4b3bc43fe5541b9.tar.gz
core-cd5bef5e19c2812386ab6afee4b3bc43fe5541b9.zip
weld ScShareDocumentDlg
Change-Id: I790f957c9ebc6d87a94a355c30215245aaabeb30 Reviewed-on: https://gerrit.libreoffice.org/64345 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--cui/source/dialogs/cuigaldlg.cxx2
-rw-r--r--cui/source/dialogs/showcols.cxx2
-rw-r--r--cui/source/tabpages/numpages.cxx4
-rw-r--r--extensions/source/propctrlr/listselectiondlg.cxx2
-rw-r--r--include/vcl/seleng.hxx4
-rw-r--r--include/vcl/vclenum.hxx2
-rw-r--r--include/vcl/weld.hxx2
-rw-r--r--sc/inc/strings.hrc3
-rw-r--r--sc/source/ui/docshell/docsh4.cxx11
-rw-r--r--sc/source/ui/inc/sharedocdlg.hxx22
-rw-r--r--sc/source/ui/miscdlgs/instbdlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/linkarea.cxx2
-rw-r--r--sc/source/ui/miscdlgs/sharedocdlg.cxx115
-rw-r--r--sc/source/ui/miscdlgs/shtabdlg.cxx2
-rw-r--r--sc/uiconfig/scalc/ui/sharedocumentdlg.ui151
-rw-r--r--sd/source/ui/dlg/custsdlg.cxx2
-rw-r--r--sw/source/ui/misc/num.cxx4
-rw-r--r--vcl/source/app/salvtables.cxx4
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx25
19 files changed, 158 insertions, 203 deletions
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index 49ae1aa8657b..42329f0e95b0 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -604,7 +604,7 @@ TPGalleryThemeProperties::TPGalleryThemeProperties(TabPageParent pWindow, const
{
m_xLbxFound->set_size_request(m_xLbxFound->get_approximate_digit_width() * 35,
m_xLbxFound->get_height_rows(15));
- m_xLbxFound->set_selection_mode(true);
+ m_xLbxFound->set_selection_mode(SelectionMode::Multiple);
xDialogListener->SetDialogClosedLink( LINK( this, TPGalleryThemeProperties, DialogClosedHdl ) );
}
diff --git a/cui/source/dialogs/showcols.cxx b/cui/source/dialogs/showcols.cxx
index e1a454038638..d9dca102beb8 100644
--- a/cui/source/dialogs/showcols.cxx
+++ b/cui/source/dialogs/showcols.cxx
@@ -33,7 +33,7 @@ FmShowColsDialog::FmShowColsDialog(weld::Window* pParent)
, m_xOK(m_xBuilder->weld_button("ok"))
{
m_xList->set_size_request(m_xList->get_approximate_digit_width() * 40, m_xList->get_height_rows(8));
- m_xList->set_selection_mode(true);
+ m_xList->set_selection_mode(SelectionMode::Multiple);
m_xOK->connect_clicked(LINK(this, FmShowColsDialog, OnClickedOk));
}
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index df31d118ae28..64b96bbfd562 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -1099,7 +1099,7 @@ SvxNumOptionsTabPage::SvxNumOptionsTabPage(TabPageParent pParent,
m_xFmtLB->connect_changed(LINK(this, SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl));
m_xBitmapMB->connect_selected(LINK(this, SvxNumOptionsTabPage, GraphicHdl_Impl));
m_xBitmapMB->connect_toggled(LINK(this, SvxNumOptionsTabPage, PopupActivateHdl_Impl));
- m_xLevelLB->set_selection_mode(true);
+ m_xLevelLB->set_selection_mode(SelectionMode::Multiple);
m_xLevelLB->connect_changed(LINK(this, SvxNumOptionsTabPage, LevelHdl_Impl));
m_xCharFmtLB->connect_changed(LINK(this, SvxNumOptionsTabPage, CharFmtHdl_Impl));
m_xWidthMF->connect_value_changed(LINK(this, SvxNumOptionsTabPage, SizeHdl_Impl));
@@ -2540,7 +2540,7 @@ SvxNumPositionTabPage::SvxNumPositionTabPage(TabPageParent pParent, const SfxIte
m_xAlignedAtMF->connect_value_changed(LINK(this, SvxNumPositionTabPage, AlignAtHdl_Impl));
m_xIndentAtMF->connect_value_changed(LINK(this, SvxNumPositionTabPage, IndentAtHdl_Impl));
- m_xLevelLB->set_selection_mode(true);
+ m_xLevelLB->set_selection_mode(SelectionMode::Multiple);
m_xLevelLB->connect_changed(LINK(this, SvxNumPositionTabPage, LevelHdl_Impl));
m_xRelativeCB->connect_toggled(LINK(this, SvxNumPositionTabPage, RelativeHdl_Impl));
m_xStandardPB->connect_clicked(LINK(this, SvxNumPositionTabPage, StandardHdl_Impl));
diff --git a/extensions/source/propctrlr/listselectiondlg.cxx b/extensions/source/propctrlr/listselectiondlg.cxx
index 5cbe35c7d3fc..29b3b19e3a58 100644
--- a/extensions/source/propctrlr/listselectiondlg.cxx
+++ b/extensions/source/propctrlr/listselectiondlg.cxx
@@ -72,7 +72,7 @@ namespace pcr
// initialize the multi-selection flag
bool bMultiSelection = false;
OSL_VERIFY( m_xListBox->getPropertyValue( PROPERTY_MULTISELECTION ) >>= bMultiSelection );
- m_xEntries->set_selection_mode(bMultiSelection);
+ m_xEntries->set_selection_mode(bMultiSelection ? SelectionMode::Single : SelectionMode::Multiple);
// fill the list box with all entries
Sequence< OUString > aListEntries;
diff --git a/include/vcl/seleng.hxx b/include/vcl/seleng.hxx
index e3642330276d..a95bbedc15fc 100644
--- a/include/vcl/seleng.hxx
+++ b/include/vcl/seleng.hxx
@@ -23,6 +23,7 @@
#include <vcl/dllapi.h>
#include <vcl/timer.hxx>
#include <vcl/event.hxx>
+#include <vcl/vclenum.hxx>
#include <o3tl/typed_flags_set.hxx>
namespace vcl { class Window; }
@@ -34,9 +35,6 @@ class CommandEvent;
#define SELENG_AUTOREPEAT_INTERVAL_MIN 25
#define SELENG_AUTOREPEAT_INTERVAL_MAX 300
-enum class SelectionMode { NONE, Single, Range, Multiple };
-
-
class VCL_DLLPUBLIC FunctionSet
{
public:
diff --git a/include/vcl/vclenum.hxx b/include/vcl/vclenum.hxx
index 4ada41058a22..a55c5b0ceb35 100644
--- a/include/vcl/vclenum.hxx
+++ b/include/vcl/vclenum.hxx
@@ -23,6 +23,8 @@
#include <sal/types.h>
#include <tools/fontenum.hxx>
+enum class SelectionMode { NONE, Single, Range, Multiple };
+
enum class TimeFieldFormat : sal_Int32 { F_NONE, F_SEC, F_SEC_CS };
enum class MenuItemType { DONTKNOW, STRING, IMAGE, STRINGIMAGE, SEPARATOR };
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 946966ca3214..e14c1b34ad45 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -528,7 +528,7 @@ public:
virtual void set_column_fixed_widths(const std::vector<int>& rWidths) = 0;
virtual OUString get_column_title(int nColumn) const = 0;
- virtual void set_selection_mode(bool bMultiple) = 0;
+ virtual void set_selection_mode(SelectionMode eMode) = 0;
virtual int count_selected_rows() const = 0;
};
diff --git a/sc/inc/strings.hrc b/sc/inc/strings.hrc
index 7158305fe49f..682d02376a67 100644
--- a/sc/inc/strings.hrc
+++ b/sc/inc/strings.hrc
@@ -359,6 +359,9 @@
#define STR_ANCHOR_TO_CELL_RESIZE NC_("STR_ANCHOR_TO_CELL_RESIZE", "To cell (resize with cell)")
#define STR_ANCHOR_TO_PAGE NC_("STR_ANCHOR_TO_PAGE", "To page")
+#define STR_NO_USER_DATA_AVAILABLE NC_("sharedocumentdlg|nouserdata", "No user data available.")
+#define STR_EXCLUSIVE_ACCESS NC_("sharedocumentdlg|exclusive", "(exclusive access)")
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index b24470891f00..ad89b34082a6 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -970,10 +970,11 @@ void ScDocShell::Execute( SfxRequest& rReq )
break;
}
- ScopedVclPtrInstance< ScShareDocumentDlg > aDlg( GetActiveDialogParent(), pViewData );
- if ( aDlg->Execute() == RET_OK )
+ vcl::Window* pWin = GetActiveDialogParent();
+ ScShareDocumentDlg aDlg(pWin ? pWin->GetFrameWeld() : nullptr, pViewData);
+ if (aDlg.run() == RET_OK)
{
- bool bSetShared = aDlg->IsShareDocumentChecked();
+ bool bSetShared = aDlg.IsShareDocumentChecked();
if ( bSetShared != IsDocShared() )
{
if ( bSetShared )
@@ -981,7 +982,6 @@ void ScDocShell::Execute( SfxRequest& rReq )
bool bContinue = true;
if ( HasName() )
{
- vcl::Window* pWin = GetActiveDialogParent();
std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
VclMessageType::Question, VclButtonsType::YesNo,
ScResId(STR_REIMPORT_AFTER_LOAD)));
@@ -1073,7 +1073,6 @@ void ScDocShell::Execute( SfxRequest& rReq )
OUString aMessage( ScResId( STR_FILE_LOCKED_TRY_LATER ) );
aMessage = aMessage.replaceFirst( "%1", aUserName );
- vcl::Window* pWin = GetActiveDialogParent();
std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
VclMessageType::Warning, VclButtonsType::Ok,
aMessage));
@@ -1081,7 +1080,6 @@ void ScDocShell::Execute( SfxRequest& rReq )
}
else
{
- vcl::Window* pWin = GetActiveDialogParent();
std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
VclMessageType::Warning, VclButtonsType::YesNo,
ScResId(STR_DOC_DISABLESHARED)));
@@ -1119,7 +1117,6 @@ void ScDocShell::Execute( SfxRequest& rReq )
else
{
xCloseable->close( true );
- vcl::Window* pWin = GetActiveDialogParent();
std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
VclMessageType::Warning, VclButtonsType::Ok,
ScResId(STR_DOC_NOLONGERSHARED)));
diff --git a/sc/source/ui/inc/sharedocdlg.hxx b/sc/source/ui/inc/sharedocdlg.hxx
index 7a6d7a2c5451..ae1d28c9aafc 100644
--- a/sc/source/ui/inc/sharedocdlg.hxx
+++ b/sc/source/ui/inc/sharedocdlg.hxx
@@ -20,9 +20,7 @@
#ifndef INCLUDED_SC_SOURCE_UI_INC_SHAREDOCDLG_HXX
#define INCLUDED_SC_SOURCE_UI_INC_SHAREDOCDLG_HXX
-#include <vcl/button.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/fixed.hxx>
+#include <vcl/weld.hxx>
#include <scdllapi.h>
class ScViewData;
@@ -31,25 +29,25 @@ class SvSimpleTable;
// class ScShareDocumentDlg
-class ScShareDocumentDlg : public ModalDialog
+class ScShareDocumentDlg : public weld::GenericDialogController
{
private:
- VclPtr<CheckBox> m_pCbShare;
- VclPtr<FixedText> m_pFtWarning;
- VclPtr<SvSimpleTable> m_pLbUsers;
-
OUString m_aStrNoUserData;
OUString m_aStrUnknownUser;
OUString m_aStrExclusiveAccess;
ScDocShell* mpDocShell;
- DECL_LINK( ToggleHandle, CheckBox&, void );
+ std::unique_ptr<weld::CheckButton> m_xCbShare;
+ std::unique_ptr<weld::Label> m_xFtWarning;
+ std::unique_ptr<weld::TreeView> m_xLbUsers;
+
+ DECL_LINK(ToggleHandle, weld::ToggleButton&, void);
+ DECL_LINK(SizeAllocated, const Size&, void);
public:
- SC_DLLPUBLIC ScShareDocumentDlg( vcl::Window* pParent, ScViewData* pViewData );
- virtual ~ScShareDocumentDlg() override;
- virtual void dispose() override;
+ SC_DLLPUBLIC ScShareDocumentDlg(weld::Window* pParent, ScViewData* pViewData);
+ virtual ~ScShareDocumentDlg() override;
bool IsShareDocumentChecked() const;
void UpdateView();
diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx
index 854f5f41b171..64142daf5355 100644
--- a/sc/source/ui/miscdlgs/instbdlg.cxx
+++ b/sc/source/ui/miscdlgs/instbdlg.cxx
@@ -70,7 +70,7 @@ ScInsertTableDlg::~ScInsertTableDlg()
void ScInsertTableDlg::Init_Impl( bool bFromFile )
{
- m_xLbTables->set_selection_mode(true);
+ m_xLbTables->set_selection_mode(SelectionMode::Multiple);
m_xBtnBrowse->connect_clicked( LINK( this, ScInsertTableDlg, BrowseHdl_Impl ) );
m_xBtnNew->connect_clicked( LINK( this, ScInsertTableDlg, ChoiceHdl_Impl ) );
m_xBtnFromFile->connect_clicked( LINK( this, ScInsertTableDlg, ChoiceHdl_Impl ) );
diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx
index e5d0fdcdf5d5..c941ef38699a 100644
--- a/sc/source/ui/miscdlgs/linkarea.cxx
+++ b/sc/source/ui/miscdlgs/linkarea.cxx
@@ -47,7 +47,7 @@ ScLinkedAreaDlg::ScLinkedAreaDlg(weld::Window* pParent)
, m_xFtSeconds(m_xBuilder->weld_label("secondsft"))
, m_xBtnOk(m_xBuilder->weld_button("ok"))
{
- m_xLbRanges->set_selection_mode(true);
+ m_xLbRanges->set_selection_mode(SelectionMode::Multiple);
m_xCbUrl->connect_entry_activate(LINK(this, ScLinkedAreaDlg, FileHdl));
m_xBtnBrowse->connect_clicked(LINK( this, ScLinkedAreaDlg, BrowseHdl));
diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx b/sc/source/ui/miscdlgs/sharedocdlg.cxx
index 6fa9f75ba56c..c6b22b2f757d 100644
--- a/sc/source/ui/miscdlgs/sharedocdlg.cxx
+++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx
@@ -28,103 +28,69 @@
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
+#include <scresid.hxx>
#include <sharedocdlg.hxx>
+#include <strings.hrc>
#include <viewdata.hxx>
using namespace ::com::sun::star;
-class ScShareTable : public SvSimpleTable
+IMPL_LINK(ScShareDocumentDlg, SizeAllocated, const Size&, rSize, void)
{
-private:
- OUString m_sWidestAccessString;
-public:
- explicit ScShareTable(SvSimpleTableContainer& rParent)
- : SvSimpleTable(rParent)
- {
- m_sWidestAccessString = getWidestTime(*ScGlobal::pLocaleData);
- }
- virtual void Resize() override
- {
- SvSimpleTable::Resize();
- if (isInitialLayout(this))
- setColWidths();
- }
- void setColWidths()
- {
- HeaderBar &rBar = GetTheHeaderBar();
- if (rBar.GetItemCount() < 2)
- return;
-
- long nAccessedWidth = 12 +
- std::max(rBar.GetTextWidth(rBar.GetItemText(2)),
- GetTextWidth(m_sWidestAccessString));
- long nWebSiteWidth = std::max(
- 12 + rBar.GetTextWidth(rBar.GetItemText(1)),
- GetSizePixel().Width() - nAccessedWidth);
- long aStaticTabs[]= { 0, nWebSiteWidth };
- SvSimpleTable::SetTabs(SAL_N_ELEMENTS(aStaticTabs), aStaticTabs, MapUnit::MapPixel);
- }
-};
+ OUString sWidestAccessString = getWidestTime(*ScGlobal::pLocaleData);
+ std::vector<int> aWidths;
+ const int nAccessWidth = m_xLbUsers->get_pixel_size(sWidestAccessString).Width() * 2;
+ aWidths.push_back(rSize.Width() - nAccessWidth);
+ m_xLbUsers->set_column_fixed_widths(aWidths);
+}
// class ScShareDocumentDlg
-ScShareDocumentDlg::ScShareDocumentDlg( vcl::Window* pParent, ScViewData* pViewData )
- : ModalDialog(pParent, "ShareDocumentDialog", "modules/scalc/ui/sharedocumentdlg.ui")
+ScShareDocumentDlg::ScShareDocumentDlg(weld::Window* pParent, ScViewData* pViewData)
+ : GenericDialogController(pParent, "modules/scalc/ui/sharedocumentdlg.ui",
+ "ShareDocumentDialog")
+ , m_aStrNoUserData(ScResId(STR_NO_USER_DATA_AVAILABLE))
+ , m_aStrUnknownUser(ScResId(STR_UNKNOWN_USER_CONFLICT))
+ , m_aStrExclusiveAccess(ScResId(STR_EXCLUSIVE_ACCESS))
, mpDocShell(nullptr)
+ , m_xCbShare(m_xBuilder->weld_check_button("share"))
+ , m_xFtWarning(m_xBuilder->weld_label("warning"))
+ , m_xLbUsers(m_xBuilder->weld_tree_view("users"))
{
+
OSL_ENSURE( pViewData, "ScShareDocumentDlg CTOR: mpViewData is null!" );
mpDocShell = ( pViewData ? pViewData->GetDocShell() : nullptr );
OSL_ENSURE( mpDocShell, "ScShareDocumentDlg CTOR: mpDocShell is null!" );
- get(m_pCbShare, "share");
- get(m_pFtWarning, "warning");
-
- SvSimpleTableContainer *pCtrl = get<SvSimpleTableContainer>("users");
- pCtrl->set_height_request(pCtrl->GetTextHeight()*9);
- m_pLbUsers = VclPtr<ScShareTable>::Create(*pCtrl);
+ std::vector<int> aWidths;
+ aWidths.push_back(m_xLbUsers->get_approximate_digit_width() * 25);
+ m_xLbUsers->set_column_fixed_widths(aWidths);
- m_aStrNoUserData = get<FixedText>("nouserdata")->GetText();
- m_aStrUnknownUser = get<FixedText>("unknownuser")->GetText();
- m_aStrExclusiveAccess = get<FixedText>("exclusive")->GetText();
+ m_xLbUsers->set_size_request(-1, m_xLbUsers->get_height_rows(9));
+ m_xLbUsers->connect_size_allocate(LINK(this, ScShareDocumentDlg, SizeAllocated));
bool bIsDocShared = mpDocShell && mpDocShell->IsDocShared();
- m_pCbShare->Check( bIsDocShared );
- m_pCbShare->SetToggleHdl( LINK( this, ScShareDocumentDlg, ToggleHandle ) );
- m_pFtWarning->Enable( bIsDocShared );
-
- long const nTabs[] = { 0, 0 };
- m_pLbUsers->SetTabs( SAL_N_ELEMENTS(nTabs), nTabs );
+ m_xCbShare->set_active(bIsDocShared);
+ m_xCbShare->connect_toggled( LINK( this, ScShareDocumentDlg, ToggleHandle ) );
+ m_xFtWarning->set_sensitive(bIsDocShared);
- OUString aHeader(get<FixedText>("name")->GetText());
- aHeader += "\t";
- aHeader += get<FixedText>("accessed")->GetText();
- m_pLbUsers->InsertHeaderEntry( aHeader, HEADERBAR_APPEND, HeaderBarItemBits::LEFT | HeaderBarItemBits::LEFTIMAGE );
- m_pLbUsers->SetSelectionMode( SelectionMode::NONE );
+ m_xLbUsers->set_selection_mode(SelectionMode::NONE);
UpdateView();
}
ScShareDocumentDlg::~ScShareDocumentDlg()
{
- disposeOnce();
-}
-
-void ScShareDocumentDlg::dispose()
-{
- m_pLbUsers.disposeAndClear();
- m_pCbShare.clear();
- m_pFtWarning.clear();
- ModalDialog::dispose();
}
-IMPL_LINK_NOARG(ScShareDocumentDlg, ToggleHandle, CheckBox&, void)
+IMPL_LINK_NOARG(ScShareDocumentDlg, ToggleHandle, weld::ToggleButton&, void)
{
- m_pFtWarning->Enable( m_pCbShare->IsChecked() );
+ m_xFtWarning->set_sensitive(m_xCbShare->get_active());
}
bool ScShareDocumentDlg::IsShareDocumentChecked() const
{
- return m_pCbShare->IsChecked();
+ return m_xCbShare->get_active();
}
void ScShareDocumentDlg::UpdateView()
@@ -180,24 +146,23 @@ void ScShareDocumentDlg::UpdateView()
tools::Time aTime( nHours, nMinutes );
DateTime aDateTime( aDate, aTime );
- OUString aString( aUser );
- aString += "\t";
- aString += formatTime(aDateTime, *ScGlobal::pLocaleData);
+ OUString aString = formatTime(aDateTime, *ScGlobal::pLocaleData);
- m_pLbUsers->InsertEntry( aString );
+ m_xLbUsers->append_text(aUser);
+ m_xLbUsers->set_text(m_xLbUsers->n_children() - 1, aString, 1);
}
}
}
else
{
- m_pLbUsers->InsertEntry( m_aStrNoUserData );
+ m_xLbUsers->append_text(m_aStrNoUserData);
}
}
catch ( uno::Exception& )
{
OSL_FAIL( "ScShareDocumentDlg::UpdateView(): caught exception" );
- m_pLbUsers->Clear();
- m_pLbUsers->InsertEntry( m_aStrNoUserData );
+ m_xLbUsers->clear();
+ m_xLbUsers->append_text(m_aStrNoUserData);
}
}
else
@@ -225,7 +190,6 @@ void ScShareDocumentDlg::UpdateView()
}
aUser += " ";
aUser += m_aStrExclusiveAccess;
- OUString aString = aUser + "\t";
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(mpDocShell->GetModel(), uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentProperties> xDocProps = xDPS->getDocumentProperties();
@@ -233,11 +197,12 @@ void ScShareDocumentDlg::UpdateView()
util::DateTime uDT(xDocProps->getModificationDate());
DateTime aDateTime(uDT);
- aString += formatTime(aDateTime, *ScGlobal::pLocaleData);
+ OUString aString = formatTime(aDateTime, *ScGlobal::pLocaleData);
aString += " ";
aString += ScGlobal::pLocaleData->getTime( aDateTime, false );
- m_pLbUsers->InsertEntry( aString );
+ m_xLbUsers->append_text(aUser);
+ m_xLbUsers->set_text(m_xLbUsers->n_children() - 1, aString, 1);
}
}
diff --git a/sc/source/ui/miscdlgs/shtabdlg.cxx b/sc/source/ui/miscdlgs/shtabdlg.cxx
index b3d65e596ea7..ee21149bd988 100644
--- a/sc/source/ui/miscdlgs/shtabdlg.cxx
+++ b/sc/source/ui/miscdlgs/shtabdlg.cxx
@@ -26,7 +26,7 @@ ScShowTabDlg::ScShowTabDlg(weld::Window* pParent)
, m_xFrame(m_xBuilder->weld_frame("frame"))
, m_xLb(m_xBuilder->weld_tree_view("treeview"))
{
- m_xLb->set_selection_mode(true);
+ m_xLb->set_selection_mode(SelectionMode::Multiple);
m_xLb->set_size_request(-1, m_xLb->get_height_rows(10));
m_xLb->connect_row_activated(LINK(this, ScShowTabDlg, DblClkHdl));
}
diff --git a/sc/uiconfig/scalc/ui/sharedocumentdlg.ui b/sc/uiconfig/scalc/ui/sharedocumentdlg.ui
index 02e9a7842afe..697229222c29 100644
--- a/sc/uiconfig/scalc/ui/sharedocumentdlg.ui
+++ b/sc/uiconfig/scalc/ui/sharedocumentdlg.ui
@@ -1,13 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="sc">
<requires lib="gtk+" version="3.18"/>
+ <object class="GtkTreeStore" id="liststore1">
+ <columns>
+ <!-- column-name text -->
+ <column type="gchararray"/>
+ <!-- column-name text2 -->
+ <column type="gchararray"/>
+ <!-- column-name id -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
<object class="GtkDialog" id="ShareDocumentDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes" context="sharedocumentdlg|ShareDocumentDialog">Share Document</property>
<property name="resizable">False</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>
@@ -110,12 +126,13 @@
<object class="GtkLabel" id="warning">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
<property name="xpad">12</property>
<property name="label" translatable="yes" context="sharedocumentdlg|warning">Note: Changes to formatting attributes like fonts, colors, and number formats will not be saved and some functionalities like editing charts and drawing objects are not available in shared mode. Turn off shared mode to get exclusive access needed for those changes and functionalities.</property>
<property name="wrap">True</property>
+ <property name="width_chars">72</property>
<property name="max_width_chars">72</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
</object>
</child>
</object>
@@ -157,105 +174,59 @@
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <object class="GtkBox" id="box2">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
- <property name="hexpand">True</property>
- <property name="homogeneous">True</property>
- <child>
- <object class="GtkLabel" id="name">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="sharedocumentdlg|name">Name</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="accessed">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="sharedocumentdlg|accessed">Accessed</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">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="svtlo-SvSimpleTableContainer" id="users">
+ <object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <child internal-child="selection">
- <object class="GtkTreeSelection" id="Simple Table Container-selection"/>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="box5">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
- <property name="hexpand">True</property>
- <property name="homogeneous">True</property>
- <child>
- <object class="GtkLabel" id="nouserdata">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="sharedocumentdlg|nouserdata">No user data available.</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
+ <property name="shadow_type">in</property>
<child>
- <object class="GtkLabel" id="unknownuser">
+ <object class="GtkTreeView" id="users">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="sharedocumentdlg|unknownuser">Unknown User</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="model">liststore1</property>
+ <property name="headers_visible">True</property>
+ <property name="search_column">0</property>
+ <property name="show_expanders">False</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="Macro Library List-selection1"/>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn1">
+ <property name="resizable">True</property>
+ <property name="spacing">6</property>
+ <property name="title" translatable="yes" context="sharedocumentdlg|name">Name</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderer1"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn2">
+ <property name="resizable">True</property>
+ <property name="spacing">6</property>
+ <property name="title" translatable="yes" context="sharedocumentdlg|accessed">Accessed</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderer2"/>
+ <attributes>
+ <attribute name="text">1</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="exclusive">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="sharedocumentdlg|exclusive">(exclusive access)</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">2</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx
index be696d9ea04e..0df36988aa9a 100644
--- a/sd/source/ui/dlg/custsdlg.cxx
+++ b/sd/source/ui/dlg/custsdlg.cxx
@@ -281,7 +281,7 @@ SdDefineCustomShowDlg::SdDefineCustomShowDlg(weld::Window* pWindow, SdDrawDocume
m_xBtnOK->connect_clicked( LINK( this, SdDefineCustomShowDlg, OKHdl ) );
- m_xLbPages->set_selection_mode(true);
+ m_xLbPages->set_selection_mode(SelectionMode::Multiple);
// shape 'em a bit
m_xLbPages->set_size_request(m_xLbPages->get_approximate_digit_width() * 24, m_xLbPages->get_height_rows(10));
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index 1ba855ed1239..eb4c03c4d523 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -90,7 +90,7 @@ SwNumPositionTabPage::SwNumPositionTabPage(TabPageParent pParent, const SfxItemS
{
SetExchangeSupport();
- m_xLevelLB->set_selection_mode(true);
+ m_xLevelLB->set_selection_mode(SelectionMode::Multiple);
m_xRelativeCB->set_active(true);
m_xAlignLB->connect_changed(LINK(this, SwNumPositionTabPage, EditModifyHdl));
@@ -410,7 +410,7 @@ void SwNumPositionTabPage::Reset( const SfxItemSet* rSet )
if (pOutlineDlg)
{
pSaveNum = pOutlineDlg->GetNumRule();
- m_xLevelLB->set_selection_mode(false);
+ m_xLevelLB->set_selection_mode(SelectionMode::Single);
}
else if(SfxItemState::SET == rSet->GetItemState(FN_PARAM_ACT_NUMBER, false, &pItem))
pSaveNum = const_cast<SwUINumRuleItem*>(static_cast<const SwUINumRuleItem*>(pItem))->GetNumRule();
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index e61980febe35..b6c6d68d920a 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -2267,9 +2267,9 @@ public:
m_xTreeView->SetCollapsedEntryBmp(rVclIter.iter, aImage);
}
- virtual void set_selection_mode(bool bMultiple) override
+ virtual void set_selection_mode(SelectionMode eMode) override
{
- m_xTreeView->SetSelectionMode(bMultiple ? SelectionMode::Multiple : SelectionMode::Single);
+ m_xTreeView->SetSelectionMode(eMode);
}
virtual int count_selected_rows() const override
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index a37d199e1511..265cc49fd982 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -2925,6 +2925,27 @@ static GtkButtonsType VclToGtk(VclButtonsType eType)
return eRet;
}
+static GtkSelectionMode VclToGtk(SelectionMode eType)
+{
+ GtkSelectionMode eRet(GTK_SELECTION_NONE);
+ switch (eType)
+ {
+ case SelectionMode::NONE:
+ eRet = GTK_SELECTION_NONE;
+ break;
+ case SelectionMode::Single:
+ eRet = GTK_SELECTION_SINGLE;
+ break;
+ case SelectionMode::Range:
+ eRet = GTK_SELECTION_BROWSE;
+ break;
+ case SelectionMode::Multiple:
+ eRet = GTK_SELECTION_MULTIPLE;
+ break;
+ }
+ return eRet;
+}
+
class GtkInstanceScrolledWindow : public GtkInstanceContainer, public virtual weld::ScrolledWindow
{
private:
@@ -5065,10 +5086,10 @@ public:
gtk_widget_hide(m_pWidget);
}
- virtual void set_selection_mode(bool bMultiple) override
+ virtual void set_selection_mode(SelectionMode eMode) override
{
disable_notify_events();
- gtk_tree_selection_set_mode(gtk_tree_view_get_selection(m_pTreeView), bMultiple ? GTK_SELECTION_MULTIPLE : GTK_SELECTION_SINGLE);
+ gtk_tree_selection_set_mode(gtk_tree_view_get_selection(m_pTreeView), VclToGtk(eMode));
enable_notify_events();
}