summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorRachit Gupta <rachitgupta1792@gmail.com>2014-07-01 15:30:44 +0530
committerJan Holesovsky <kendy@collabora.com>2014-08-14 19:43:30 +0200
commit5bed7be540e55149667fb5f4af826acdc1127efc (patch)
tree72aff8e92c339639a787ef3b07427531f38b85f3 /cui
parent7b57ab7a98912a86d6131a79c81a1a1d857ed1c1 (diff)
Moved the personas installed through extensions handling to 'own'.
Change-Id: I12baaf22bfad73e228d3ed55dcf365f8eba9cf0a
Diffstat (limited to 'cui')
-rw-r--r--cui/source/options/personalization.cxx20
-rw-r--r--cui/source/options/personalization.hxx4
-rw-r--r--cui/uiconfig/ui/personalization_tab.ui137
3 files changed, 97 insertions, 64 deletions
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index 6074eafa3655..f49ea12627c0 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -245,15 +245,16 @@ SvxPersonalizationTabPage::SvxPersonalizationTabPage( Window *pParent, const Sfx
m_vDefaultPersonaImages[2]->SetClickHdl( LINK( this, SvxPersonalizationTabPage, DefaultPersona ) );
get( m_vExtensionPersonas[0], "extension1" );
- m_vExtensionPersonas[0]->SetClickHdl( LINK( this, SvxPersonalizationTabPage, DefaultPersona ) );
+ m_vExtensionPersonas[0]->SetClickHdl( LINK( this, SvxPersonalizationTabPage, InstalledPersona ) );
get( m_vExtensionPersonas[1], "extension2" );
- m_vExtensionPersonas[1]->SetClickHdl( LINK( this, SvxPersonalizationTabPage, DefaultPersona ) );
+ m_vExtensionPersonas[1]->SetClickHdl( LINK( this, SvxPersonalizationTabPage, InstalledPersona ) );
get( m_vExtensionPersonas[2], "extension3" );
- m_vExtensionPersonas[2]->SetClickHdl( LINK( this, SvxPersonalizationTabPage, DefaultPersona ) );
+ m_vExtensionPersonas[2]->SetClickHdl( LINK( this, SvxPersonalizationTabPage, InstalledPersona ) );
LoadDefaultImages();
+ LoadExtensionImages();
}
SvxPersonalizationTabPage::~SvxPersonalizationTabPage()
@@ -360,13 +361,18 @@ void SvxPersonalizationTabPage::LoadDefaultImages()
m_vDefaultPersonaImages[nIndex]->Show();
m_vDefaultPersonaImages[nIndex++]->SetModeImage( Image( aBmp ) );
}
+}
+void SvxPersonalizationTabPage::LoadExtensionImages()
+{
// See if any extensions are used to install personas. If yes, load them.
+ GraphicFilter aFilter;
+ Graphic aGraphic;
+ sal_Int32 nIndex = 0;
css::uno::Sequence<OUString> installedPersonas( officecfg::Office::Common::Misc::PersonasList::get()->getElementNames() );
sal_Int32 nLength = installedPersonas.getLength();
sal_Int32 nCount = 0;
- nIndex = 0;
if( nLength == 0 )
return;
@@ -442,6 +448,12 @@ IMPL_LINK( SvxPersonalizationTabPage, DefaultPersona, PushButton*, pButton )
m_aPersonaSettings = m_vDefaultPersonaSettings[nIndex];
}
+ return 0;
+}
+
+IMPL_LINK( SvxPersonalizationTabPage, InstalledPersona, PushButton*, pButton )
+{
+ m_pOwnPersona->Check();
for( sal_Int32 nIndex = 0; nIndex < 3; nIndex++ )
{
if( pButton == m_vExtensionPersonas[nIndex] )
diff --git a/cui/source/options/personalization.hxx b/cui/source/options/personalization.hxx
index 98bff5d244b3..0d0cb3f16979 100644
--- a/cui/source/options/personalization.hxx
+++ b/cui/source/options/personalization.hxx
@@ -52,6 +52,7 @@ public:
void SetPersonaSettings( const OUString );
void LoadDefaultImages();
+ void LoadExtensionImages();
private:
/// Handle the Persona selection
@@ -62,6 +63,9 @@ private:
/// Handle the default Persona selection
DECL_LINK( DefaultPersona, PushButton* );
+
+ /// Handle the Personas installed through extensions selection
+ DECL_LINK( InstalledPersona, PushButton* );
};
/** Dialog that will allow the user to choose a Persona to use.
diff --git a/cui/uiconfig/ui/personalization_tab.ui b/cui/uiconfig/ui/personalization_tab.ui
index e2f4332724cd..2b53e029bc29 100644
--- a/cui/uiconfig/ui/personalization_tab.ui
+++ b/cui/uiconfig/ui/personalization_tab.ui
@@ -58,11 +58,9 @@
</packing>
</child>
<child>
- <object class="GtkGrid" id="grid1">
+ <object class="GtkBox" id="box1">
<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="default1">
<property name="can_focus">True</property>
@@ -71,10 +69,9 @@
<property name="vexpand">True</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -85,10 +82,9 @@
<property name="vexpand">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
@@ -99,55 +95,9 @@
<property name="vexpand">True</property>
</object>
<packing>
- <property name="left_attach">2</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="extension1">
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="extension2">
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="extension3">
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
@@ -199,6 +149,73 @@
<property name="position">3</property>
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Or, select from the personas installed via extensions</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkButton" id="extension1">
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="extension2">
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="extension3">
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
</object>
</child>
</object>