Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
2437cf97
Kaydet (Commit)
2437cf97
authored
Ara 03, 2012
tarafından
Jan Holesovsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Personas: Configuration entries for Personas and BacgroundImage.
Change-Id: I47b1a5bacaeb5bd54f11630e5d3f2652be2bdfb4
üst
14005c28
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
148 additions
and
33 deletions
+148
-33
personalization.cxx
cui/source/options/personalization.cxx
+79
-30
personalization.hxx
cui/source/options/personalization.hxx
+7
-3
Common.xcs
officecfg/registry/schema/org/openoffice/Office/Common.xcs
+62
-0
No files found.
cui/source/options/personalization.cxx
Dosyayı görüntüle @
2437cf97
...
@@ -9,6 +9,12 @@
...
@@ -9,6 +9,12 @@
#include "personalization.hxx"
#include "personalization.hxx"
#include <comphelper/processfactory.hxx>
#include <officecfg/Office/Common.hxx>
#include <vcl/msgbox.hxx>
using
namespace
com
::
sun
::
star
;
/** Dialog that will allow the user to choose a Persona to use.
/** Dialog that will allow the user to choose a Persona to use.
So far there is no better possibility than just to paste the URL from
So far there is no better possibility than just to paste the URL from
...
@@ -26,24 +32,21 @@ SelectPersonaDialog::SelectPersonaDialog( Window *pParent )
...
@@ -26,24 +32,21 @@ SelectPersonaDialog::SelectPersonaDialog( Window *pParent )
}
}
SvxPersonalizationTabPage
::
SvxPersonalizationTabPage
(
Window
*
pParent
,
const
SfxItemSet
&
rSet
)
SvxPersonalizationTabPage
::
SvxPersonalizationTabPage
(
Window
*
pParent
,
const
SfxItemSet
&
rSet
)
:
SfxTabPage
(
pParent
,
"PersonalizationTabPage"
,
"cui/ui/personalization_tab.ui"
,
rSet
)
:
SfxTabPage
(
pParent
,
"PersonalizationTabPage"
,
"cui/ui/personalization_tab.ui"
,
rSet
),
m_aBackgroundURL
()
{
{
// background image
get
(
m_pNoBackground
,
"no_background"
);
get
(
m_pNoBackground
,
"no_background"
);
get
(
m_pDefaultBackground
,
"default_background"
);
get
(
m_pDefaultBackground
,
"default_background"
);
get
(
m_pOwnBackground
,
"own_background"
);
get
(
m_pOwnBackground
,
"own_background"
);
m_pNoBackground
->
SetClickHdl
(
LINK
(
this
,
SvxPersonalizationTabPage
,
EnableDisableSelectionButtons
)
);
m_pDefaultBackground
->
SetClickHdl
(
LINK
(
this
,
SvxPersonalizationTabPage
,
EnableDisableSelectionButtons
)
);
m_pOwnBackground
->
SetClickHdl
(
LINK
(
this
,
SvxPersonalizationTabPage
,
EnableDisableSelectionButtons
)
);
get
(
m_pSelectBackground
,
"select_background"
);
get
(
m_pSelectBackground
,
"select_background"
);
m_pSelectBackground
->
SetClickHdl
(
LINK
(
this
,
SvxPersonalizationTabPage
,
SelectBackground
)
);
m_pSelectBackground
->
SetClickHdl
(
LINK
(
this
,
SvxPersonalizationTabPage
,
SelectBackground
)
);
// persona
get
(
m_pNoPersona
,
"no_persona"
);
get
(
m_pNoPersona
,
"no_persona"
);
get
(
m_pDefaultPersona
,
"default_persona"
);
get
(
m_pDefaultPersona
,
"default_persona"
);
get
(
m_pOwnPersona
,
"own_persona"
);
get
(
m_pOwnPersona
,
"own_persona"
);
m_pNoPersona
->
SetClickHdl
(
LINK
(
this
,
SvxPersonalizationTabPage
,
EnableDisableSelectionButtons
)
);
m_pDefaultPersona
->
SetClickHdl
(
LINK
(
this
,
SvxPersonalizationTabPage
,
EnableDisableSelectionButtons
)
);
m_pOwnPersona
->
SetClickHdl
(
LINK
(
this
,
SvxPersonalizationTabPage
,
EnableDisableSelectionButtons
)
);
get
(
m_pSelectPersona
,
"select_persona"
);
get
(
m_pSelectPersona
,
"select_persona"
);
LINK
(
this
,
SvxPersonalizationTabPage
,
SelectPersona
);
LINK
(
this
,
SvxPersonalizationTabPage
,
SelectPersona
);
...
@@ -59,47 +62,93 @@ SfxTabPage* SvxPersonalizationTabPage::Create( Window *pParent, const SfxItemSet
...
@@ -59,47 +62,93 @@ SfxTabPage* SvxPersonalizationTabPage::Create( Window *pParent, const SfxItemSet
return
new
SvxPersonalizationTabPage
(
pParent
,
rSet
);
return
new
SvxPersonalizationTabPage
(
pParent
,
rSet
);
}
}
IMPL_LINK
(
SvxPersonalizationTabPage
,
EnableDisableSelectionButtons
,
RadioButton
*
,
pButton
)
sal_Bool
SvxPersonalizationTabPage
::
FillItemSet
(
SfxItemSet
&
)
{
{
PushButton
*
pPushButton
=
NULL
;
// background image
RadioButton
*
pRadioButton
=
NULL
;
OUString
aBackground
(
"default"
);
if
(
m_pNoBackground
->
IsChecked
()
)
if
(
pButton
==
m_pNoBackground
||
pButton
==
m_pDefaultBackground
||
pButton
==
m_pOwnBackground
)
aBackground
=
"no"
;
else
if
(
m_pOwnBackground
->
IsChecked
()
)
aBackground
=
"own"
;
// persona
OUString
aPersona
(
"default"
);
if
(
m_pNoPersona
->
IsChecked
()
)
aPersona
=
"no"
;
else
if
(
m_pOwnPersona
->
IsChecked
()
)
aPersona
=
"own"
;
bool
bModified
=
false
;
uno
::
Reference
<
uno
::
XComponentContext
>
xContext
=
comphelper
::
getProcessComponentContext
();
if
(
xContext
.
is
()
&&
(
aBackground
!=
officecfg
::
Office
::
Common
::
Misc
::
BackgroundImage
::
get
(
xContext
)
||
m_aBackgroundURL
!=
officecfg
::
Office
::
Common
::
Misc
::
BackgroundImageURL
::
get
(
xContext
)
||
aPersona
!=
officecfg
::
Office
::
Common
::
Misc
::
Persona
::
get
(
xContext
)
)
)
{
{
pPushButton
=
m_pSelectBackground
;
bModified
=
true
;
pRadioButton
=
m_pOwnBackground
;
}
}
else
if
(
pButton
==
m_pNoPersona
||
pButton
==
m_pDefaultPersona
||
pButton
==
m_pOwnPersona
)
// write
boost
::
shared_ptr
<
comphelper
::
ConfigurationChanges
>
batch
(
comphelper
::
ConfigurationChanges
::
create
()
);
officecfg
::
Office
::
Common
::
Misc
::
BackgroundImage
::
set
(
aBackground
,
batch
);
officecfg
::
Office
::
Common
::
Misc
::
BackgroundImageURL
::
set
(
m_aBackgroundURL
,
batch
);
officecfg
::
Office
::
Common
::
Misc
::
Persona
::
set
(
aPersona
,
batch
);
batch
->
commit
();
return
bModified
;
}
void
SvxPersonalizationTabPage
::
Reset
(
const
SfxItemSet
&
)
{
uno
::
Reference
<
uno
::
XComponentContext
>
xContext
=
comphelper
::
getProcessComponentContext
();
// background image
OUString
aBackground
(
"default"
);
if
(
xContext
.
is
()
)
{
{
pPushButton
=
m_pSelectPersona
;
aBackground
=
officecfg
::
Office
::
Common
::
Misc
::
BackgroundImage
::
get
(
xContext
)
;
pRadioButton
=
m_pOwnPersona
;
m_aBackgroundURL
=
officecfg
::
Office
::
Common
::
Misc
::
BackgroundImageURL
::
get
(
xContext
)
;
}
}
if
(
aBackground
==
"no"
)
m_pNoBackground
->
Check
();
else
if
(
aBackground
==
"own"
)
m_pOwnBackground
->
Check
();
else
else
return
0
;
m_pDefaultBackground
->
Check
()
;
if
(
pRadioButton
->
IsChecked
()
&&
!
pPushButton
->
IsEnabled
()
)
// persona
{
OUString
aPersona
(
"default"
);
pPushButton
->
Enable
();
if
(
xContext
.
is
()
)
pPushButton
->
Invalidate
();
aPersona
=
officecfg
::
Office
::
Common
::
Misc
::
Persona
::
get
(
xContext
);
}
else
if
(
!
pRadioButton
->
IsChecked
()
&&
pPushButton
->
IsEnabled
()
)
{
pPushButton
->
Disable
();
pPushButton
->
Invalidate
();
}
return
0
;
if
(
aPersona
==
"no"
)
m_pNoPersona
->
Check
();
else
if
(
aPersona
==
"own"
)
m_pOwnPersona
->
Check
();
else
m_pDefaultPersona
->
Check
();
}
}
IMPL_LINK
(
SvxPersonalizationTabPage
,
SelectBackground
,
PushButton
*
,
/*pButton*/
)
IMPL_LINK
(
SvxPersonalizationTabPage
,
SelectBackground
,
PushButton
*
,
/*pButton*/
)
{
{
// TODO m_pOwnBackground->Check(); if something selected
// TODO parse the results
return
0
;
return
0
;
}
}
IMPL_LINK
(
SvxPersonalizationTabPage
,
SelectPersona
,
PushButton
*
,
/*pButton*/
)
IMPL_LINK
(
SvxPersonalizationTabPage
,
SelectPersona
,
PushButton
*
,
/*pButton*/
)
{
{
SelectPersonaDialog
aDialog
(
NULL
);
SelectPersonaDialog
aDialog
(
NULL
);
/* TODO handle the ret val sal_Int16 nReturn =*/
aDialog
.
Execute
();
if
(
aDialog
.
Execute
()
==
RET_OK
)
{
m_pOwnPersona
->
Check
();
// TODO parse the results
}
return
0
;
return
0
;
}
}
...
...
cui/source/options/personalization.hxx
Dosyayı görüntüle @
2437cf97
...
@@ -23,6 +23,7 @@ private:
...
@@ -23,6 +23,7 @@ private:
RadioButton
*
m_pDefaultBackground
;
///< Use the built-in bitmap for Writer background
RadioButton
*
m_pDefaultBackground
;
///< Use the built-in bitmap for Writer background
RadioButton
*
m_pOwnBackground
;
///< Use the user-defined bitmap
RadioButton
*
m_pOwnBackground
;
///< Use the user-defined bitmap
PushButton
*
m_pSelectBackground
;
///< Let the user select in the 'own' case
PushButton
*
m_pSelectBackground
;
///< Let the user select in the 'own' case
OUString
m_aBackgroundURL
;
///< URL of the the background image in the 'own' case
RadioButton
*
m_pNoPersona
;
///< Just the default look, without any bitmap
RadioButton
*
m_pNoPersona
;
///< Just the default look, without any bitmap
RadioButton
*
m_pDefaultPersona
;
///< Use the built-in bitmap
RadioButton
*
m_pDefaultPersona
;
///< Use the built-in bitmap
...
@@ -35,10 +36,13 @@ public:
...
@@ -35,10 +36,13 @@ public:
static
SfxTabPage
*
Create
(
Window
*
pParent
,
const
SfxItemSet
&
rSet
);
static
SfxTabPage
*
Create
(
Window
*
pParent
,
const
SfxItemSet
&
rSet
);
private
:
/// Apply the settings ([OK] button).
/// Maintain sane behavior of the m_pSelect(Background|Persona) buttons
virtual
sal_Bool
FillItemSet
(
SfxItemSet
&
rSet
);
DECL_LINK
(
EnableDisableSelectionButtons
,
RadioButton
*
);
/// Reset to default settings ([Revert] button).
virtual
void
Reset
(
const
SfxItemSet
&
rSet
);
private
:
/// Handle the bacground selection
/// Handle the bacground selection
DECL_LINK
(
SelectBackground
,
PushButton
*
);
DECL_LINK
(
SelectBackground
,
PushButton
*
);
...
...
officecfg/registry/schema/org/openoffice/Office/Common.xcs
Dosyayı görüntüle @
2437cf97
...
@@ -6685,6 +6685,68 @@
...
@@ -6685,6 +6685,68 @@
</constraints>
</constraints>
<value>
auto
</value>
<value>
auto
</value>
</prop>
</prop>
<prop
oor:name=
"BackgroundImage"
oor:type=
"xs:string"
oor:nillable=
"false"
>
<!-- UIHints: Tools Options General Personalization -->
<info>
<author>
kendy
</author>
<desc>
Specifies whether we should use background image in the
workplace.
</desc>
</info>
<constraints>
<enumeration
oor:value=
"no"
>
<info>
<desc>
No - the user wants only solid bacground.
</desc>
</info>
</enumeration>
<enumeration
oor:value=
"default"
>
<info>
<desc>
Default - the LibreOffice default background image.
</desc>
</info>
</enumeration>
<enumeration
oor:value=
"own"
>
<info>
<desc>
The user installed an own background image, and wants to
use that. It's URL is in BackgroundImageURL.
</desc>
</info>
</enumeration>
</constraints>
<value>
default
</value>
</prop>
<prop
oor:name=
"BackgroundImageURL"
oor:type=
"xs:string"
oor:nillable=
"false"
>
<!-- UIHints: Tools Options General Personalization -->
<info>
<author>
kendy
</author>
<desc>
URL of the image the user wants to use; it is used only when
BackgroundImage is 'own'.
</desc>
</info>
<value></value>
</prop>
<prop
oor:name=
"Persona"
oor:type=
"xs:string"
oor:nillable=
"false"
>
<!-- UIHints: Tools Options General Personalization -->
<info>
<author>
kendy
</author>
<desc>
Specifies whether we should use a Firefox Persona, ie. a
picture under the menu, toolbar, and status bar.
</desc>
</info>
<constraints>
<enumeration
oor:value=
"no"
>
<info>
<desc>
No - the user wants just the themed look, no Persona.
</desc>
</info>
</enumeration>
<enumeration
oor:value=
"default"
>
<info>
<desc>
Default - the LibreOffice default Persona.
</desc>
</info>
</enumeration>
<enumeration
oor:value=
"own"
>
<info>
<desc>
The user installed an own Persona, and wants to use that.
</desc>
</info>
</enumeration>
</constraints>
<value>
default
</value>
</prop>
<prop
oor:name=
"ToolboxStyle"
oor:type=
"xs:short"
oor:nillable=
"false"
>
<prop
oor:name=
"ToolboxStyle"
oor:type=
"xs:short"
oor:nillable=
"false"
>
<!-- UIHints: Tools Options General View -->
<!-- UIHints: Tools Options General View -->
<info>
<info>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment