summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay Deep <akshaydeepiitr@gmail.com>2016-05-23 19:01:02 +0530
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-05-25 09:30:46 +0000
commit75cec5cd54a731039b63d564be378a1202fb9e8b (patch)
treea358853a7239684a8f08cbb03b293651219a5c55
parent72a1fbe16b147911ff90fb5145ea3e2d783193f8 (diff)
Template Manager: ListView in Save As and Category Selector Dialog
Change-Id: Ie3e12e345096c570be11280833889321d0cf7aa5 Reviewed-on: https://gerrit.libreoffice.org/25370 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
-rw-r--r--sfx2/source/doc/saveastemplatedlg.cxx1
-rw-r--r--sfx2/source/doc/templatedlg.cxx3
-rw-r--r--sfx2/uiconfig/ui/saveastemplatedlg.ui112
-rw-r--r--sfx2/uiconfig/ui/templatecategorydlg.ui112
4 files changed, 160 insertions, 68 deletions
diff --git a/sfx2/source/doc/saveastemplatedlg.cxx b/sfx2/source/doc/saveastemplatedlg.cxx
index d219a7f51d29..1d46197db866 100644
--- a/sfx2/source/doc/saveastemplatedlg.cxx
+++ b/sfx2/source/doc/saveastemplatedlg.cxx
@@ -122,7 +122,6 @@ void SfxSaveAsTemplateDialog::initialize()
void SfxSaveAsTemplateDialog::SetCategoryLBEntries(std::vector<OUString> aFolderNames)
{
- mpLBCategory->InsertEntry(OUString("None"), 0);
if (!aFolderNames.empty())
{
for (size_t i = 0, n = aFolderNames.size(); i < n; ++i)
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index fe9c922fcbcc..ee43d48c77b2 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -1601,10 +1601,12 @@ IMPL_LINK_NOARG_TYPED(SfxTemplateCategoryDialog, SelectCategoryHdl, ListBox&, vo
{
msSelectedCategory = OUString();
mpOKButton->Disable();
+ mpNewCategoryEdit->Enable();
}
else
{
msSelectedCategory = mpLBCategory->GetSelectEntry();
+ mpNewCategoryEdit->Disable();
mpOKButton->Enable();
}
@@ -1613,7 +1615,6 @@ IMPL_LINK_NOARG_TYPED(SfxTemplateCategoryDialog, SelectCategoryHdl, ListBox&, vo
void SfxTemplateCategoryDialog::SetCategoryLBEntries(std::vector<OUString> aFolderNames)
{
- mpLBCategory->InsertEntry(OUString("None"), 0);
if (!aFolderNames.empty())
{
for (size_t i = 0, n = aFolderNames.size(); i < n; ++i)
diff --git a/sfx2/uiconfig/ui/saveastemplatedlg.ui b/sfx2/uiconfig/ui/saveastemplatedlg.ui
index 49e68329408e..da673a318b71 100644
--- a/sfx2/uiconfig/ui/saveastemplatedlg.ui
+++ b/sfx2/uiconfig/ui/saveastemplatedlg.ui
@@ -3,6 +3,17 @@
<interface>
<requires lib="gtk+" version="3.6"/>
<requires lib="LibreOffice" version="1.0"/>
+ <object class="GtkListStore" id="categorylist">
+ <columns>
+ <!-- column-name gchararray1 -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">None</col>
+ </row>
+ </data>
+ </object>
<object class="GtkDialog" id="SaveAsTemplateDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
@@ -79,14 +90,39 @@
<property name="row_spacing">12</property>
<property name="column_spacing">12</property>
<child>
- <object class="GtkLabel" id="create_label">
+ <object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Enter Template Name</property>
- <attributes>
- <attribute name="weight" value="normal"/>
- </attributes>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="create_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Enter Template Name</property>
+ <attributes>
+ <attribute name="weight" value="normal"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="name_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="width_request">300</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="left_attach">0</property>
@@ -94,41 +130,51 @@
</packing>
</child>
<child>
- <object class="GtkEntry" id="name_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="select_label">
+ <object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Select Template Category</property>
- <attributes>
- <attribute name="weight" value="normal"/>
- </attributes>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="select_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Select Template Category</property>
+ <attributes>
+ <attribute name="weight" value="normal"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkTreeView" id="categorylb:border">
+ <property name="height_request">150</property>
+ <property name="width_request">300</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">2</property>
+ <property name="model">categorylist</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="treeview-selection1"/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
- <child>
- <object class="GtkComboBox" id="categorylb">
- <property name="width_request">250</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
</object>
<packing>
<property name="expand">False</property>
diff --git a/sfx2/uiconfig/ui/templatecategorydlg.ui b/sfx2/uiconfig/ui/templatecategorydlg.ui
index 57eae1f43e25..d0f95f445964 100644
--- a/sfx2/uiconfig/ui/templatecategorydlg.ui
+++ b/sfx2/uiconfig/ui/templatecategorydlg.ui
@@ -3,6 +3,17 @@
<interface>
<requires lib="gtk+" version="3.6"/>
<requires lib="LibreOffice" version="1.0"/>
+ <object class="GtkListStore" id="categorylist">
+ <columns>
+ <!-- column-name gchararray1 -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">None</col>
+ </row>
+ </data>
+ </object>
<object class="GtkDialog" id="TemplatesCategoryDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
@@ -79,14 +90,45 @@
<property name="row_spacing">12</property>
<property name="column_spacing">12</property>
<child>
- <object class="GtkLabel" id="select_label">
+ <object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Select from Existing Category</property>
- <attributes>
- <attribute name="weight" value="normal"/>
- </attributes>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="select_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Select from Existing Category</property>
+ <attributes>
+ <attribute name="weight" value="normal"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkTreeView" id="categorylb:border">
+ <property name="height_request">150</property>
+ <property name="width_request">300</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">2</property>
+ <property name="model">categorylist</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="treeview-selection1"/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="left_attach">0</property>
@@ -94,41 +136,45 @@
</packing>
</child>
<child>
- <object class="GtkComboBox" id="categorylb">
- <property name="width_request">250</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="create_label">
+ <object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">or Create a New Category</property>
- <attributes>
- <attribute name="weight" value="normal"/>
- </attributes>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="create_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">or Create a New Category</property>
+ <attributes>
+ <attribute name="weight" value="normal"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="category_entry">
+ <property name="visible">True</property>
+ <property name="width_request">300</property>
+ <property name="can_focus">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
- <child>
- <object class="GtkEntry" id="category_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
</object>
<packing>
<property name="expand">False</property>