Kaydet (Commit) 3c40bd24 authored tarafından Olivier Hallot's avatar Olivier Hallot Kaydeden (comit) Tor Lillqvist

Enhance OpenCL options UI dialog

1) HIG-ification of blacklist and whitelist, using frames
2) handle Use OpenCL checkbox to enable/disable OpenCL blacklist and whitelist changes

Change-Id: Iae132d09d2dd0436fa1aa2a64e902ee5aed7cf47
Reviewed-on: https://gerrit.libreoffice.org/13602Reviewed-by: 's avatarTor Lillqvist <tml@collabora.com>
Tested-by: 's avatarTor Lillqvist <tml@collabora.com>
üst ed60d4b3
...@@ -42,14 +42,18 @@ SvxOpenCLTabPage::SvxOpenCLTabPage(vcl::Window* pParent, const SfxItemSet& rSet) ...@@ -42,14 +42,18 @@ SvxOpenCLTabPage::SvxOpenCLTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
{ {
get(mpUseOpenCL, "useopencl"); get(mpUseOpenCL, "useopencl");
get(mpBlackList, "blacklist"); get(mpBlackList, "blacklist");
get(mpBlackListFrame,"blacklistframe");
get(mpBlackListEdit, "bledit"); get(mpBlackListEdit, "bledit");
get(mpBlackListAdd, "bladd"); get(mpBlackListAdd, "bladd");
get(mpBlackListDelete, "bldelete"); get(mpBlackListDelete, "bldelete");
get(mpWhiteList, "whitelist"); get(mpWhiteList, "whitelist");
get(mpWhiteListFrame,"whitelistframe");
get(mpWhiteListEdit, "wledit"); get(mpWhiteListEdit, "wledit");
get(mpWhiteListAdd, "wladd"); get(mpWhiteListAdd, "wladd");
get(mpWhiteListDelete, "wldelete"); get(mpWhiteListDelete, "wldelete");
mpUseOpenCL->SetClickHdl(LINK(this, SvxOpenCLTabPage, EnableOpenCLHdl));
mpBlackListEdit->SetClickHdl(LINK(this, SvxOpenCLTabPage, BlackListEditHdl)); mpBlackListEdit->SetClickHdl(LINK(this, SvxOpenCLTabPage, BlackListEditHdl));
mpBlackListAdd->SetClickHdl(LINK(this, SvxOpenCLTabPage, BlackListAddHdl)); mpBlackListAdd->SetClickHdl(LINK(this, SvxOpenCLTabPage, BlackListAddHdl));
mpBlackListDelete->SetClickHdl(LINK(this, SvxOpenCLTabPage, BlackListDeleteHdl)); mpBlackListDelete->SetClickHdl(LINK(this, SvxOpenCLTabPage, BlackListDeleteHdl));
...@@ -60,6 +64,7 @@ SvxOpenCLTabPage::SvxOpenCLTabPage(vcl::Window* pParent, const SfxItemSet& rSet) ...@@ -60,6 +64,7 @@ SvxOpenCLTabPage::SvxOpenCLTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
mpBlackList->set_height_request(4 * mpBlackList->GetTextHeight()); mpBlackList->set_height_request(4 * mpBlackList->GetTextHeight());
mpWhiteList->set_height_request(4 * mpWhiteList->GetTextHeight()); mpWhiteList->set_height_request(4 * mpWhiteList->GetTextHeight());
} }
SvxOpenCLTabPage::~SvxOpenCLTabPage() SvxOpenCLTabPage::~SvxOpenCLTabPage()
...@@ -273,6 +278,10 @@ long SvxOpenCLTabPage::DeleteHdl(ListBox* pListBox, OpenCLConfig::ImplMatcherSet ...@@ -273,6 +278,10 @@ long SvxOpenCLTabPage::DeleteHdl(ListBox* pListBox, OpenCLConfig::ImplMatcherSet
return 0; return 0;
} }
void SvxOpenCLTabPage::EnableOpenCLHdl(VclFrame* pFrame, bool aEnable)
{
pFrame->Enable(aEnable);
}
IMPL_LINK_NOARG(SvxOpenCLTabPage, BlackListEditHdl) IMPL_LINK_NOARG(SvxOpenCLTabPage, BlackListEditHdl)
{ {
...@@ -304,4 +313,13 @@ IMPL_LINK_NOARG(SvxOpenCLTabPage, WhiteListDeleteHdl) ...@@ -304,4 +313,13 @@ IMPL_LINK_NOARG(SvxOpenCLTabPage, WhiteListDeleteHdl)
return DeleteHdl(mpWhiteList, maConfig.maWhiteList); return DeleteHdl(mpWhiteList, maConfig.maWhiteList);
} }
IMPL_LINK_NOARG(SvxOpenCLTabPage, EnableOpenCLHdl)
{
EnableOpenCLHdl(mpBlackListFrame, mpUseOpenCL->IsChecked());
EnableOpenCLHdl(mpWhiteListFrame, mpUseOpenCL->IsChecked());
return 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -33,11 +33,13 @@ private: ...@@ -33,11 +33,13 @@ private:
CheckBox* mpUseOpenCL; CheckBox* mpUseOpenCL;
VclFrame* mpBlackListFrame;
ListBox* mpBlackList; ListBox* mpBlackList;
PushButton* mpBlackListEdit; PushButton* mpBlackListEdit;
PushButton* mpBlackListAdd; PushButton* mpBlackListAdd;
PushButton* mpBlackListDelete; PushButton* mpBlackListDelete;
VclFrame* mpWhiteListFrame;
ListBox* mpWhiteList; ListBox* mpWhiteList;
PushButton* mpWhiteListEdit; PushButton* mpWhiteListEdit;
PushButton* mpWhiteListAdd; PushButton* mpWhiteListAdd;
...@@ -51,9 +53,12 @@ private: ...@@ -51,9 +53,12 @@ private:
DECL_LINK(WhiteListAddHdl, void*); DECL_LINK(WhiteListAddHdl, void*);
DECL_LINK(WhiteListDeleteHdl, void*); DECL_LINK(WhiteListDeleteHdl, void*);
DECL_LINK(EnableOpenCLHdl, void*);
long EditHdl(ListBox* pListBox, OpenCLConfig::ImplMatcherSet& rSet, const OString& rTag); long EditHdl(ListBox* pListBox, OpenCLConfig::ImplMatcherSet& rSet, const OString& rTag);
long AddHdl(ListBox* pListBox, OpenCLConfig::ImplMatcherSet& rSet, const OString& rTag); long AddHdl(ListBox* pListBox, OpenCLConfig::ImplMatcherSet& rSet, const OString& rTag);
long DeleteHdl(ListBox* pListBox, OpenCLConfig::ImplMatcherSet& rSet); long DeleteHdl(ListBox* pListBox, OpenCLConfig::ImplMatcherSet& rSet);
void EnableOpenCLHdl(VclFrame* pFrame, bool aEnable);
public: public:
SvxOpenCLTabPage( vcl::Window* pParent, const SfxItemSet& rSet ); SvxOpenCLTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
......
...@@ -41,20 +41,17 @@ ...@@ -41,20 +41,17 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="label2"> <object class="GtkFrame" id="blacklistframe">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">0</property> <property name="label_xalign">0</property>
<property name="label" translatable="yes">OpenCL blacklist:</property> <property name="shadow_type">none</property>
<property name="use_underline">True</property> <child>
<property name="mnemonic_widget">blacklist</property> <object class="GtkAlignment" id="alignment2">
</object> <property name="visible">True</property>
<packing> <property name="can_focus">False</property>
<property name="expand">False</property> <property name="top_padding">6</property>
<property name="fill">True</property> <property name="left_padding">12</property>
<property name="position">1</property>
</packing>
</child>
<child> <child>
<object class="GtkGrid" id="grid1"> <object class="GtkGrid" id="grid1">
<property name="visible">True</property> <property name="visible">True</property>
...@@ -188,6 +185,21 @@ ...@@ -188,6 +185,21 @@
<property name="top_attach">1</property> <property name="top_attach">1</property>
</packing> </packing>
</child> </child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
...@@ -197,9 +209,12 @@ ...@@ -197,9 +209,12 @@
<child> <child>
<object class="GtkTreeView" id="blacklist"> <object class="GtkTreeView" id="blacklist">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</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>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection"/>
</child>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
...@@ -213,27 +228,38 @@ ...@@ -213,27 +228,38 @@
</packing> </packing>
</child> </child>
</object> </object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child> </child>
<child> </object>
<object class="GtkLabel" id="label3"> </child>
<child type="label">
<object class="GtkLabel" id="label4">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">0</property> <property name="label" translatable="yes">OpenCL blacklist</property>
<property name="label" translatable="yes">OpenCL whitelist:</property> <attributes>
<property name="use_underline">True</property> <attribute name="weight" value="bold"/>
<property name="mnemonic_widget">blacklist</property> </attributes>
</object>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">3</property> <property name="position">5</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkFrame" id="whitelistframe">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child> <child>
<object class="GtkGrid" id="grid4"> <object class="GtkGrid" id="grid4">
<property name="visible">True</property> <property name="visible">True</property>
...@@ -305,15 +331,21 @@ ...@@ -305,15 +331,21 @@
<child> <child>
<object class="GtkTreeView" id="whitelist"> <object class="GtkTreeView" id="whitelist">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</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>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1"/>
</child>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">1</property> <property name="top_attach">1</property>
</packing> </packing>
</child> </child>
<child>
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
...@@ -321,10 +353,24 @@ ...@@ -321,10 +353,24 @@
</packing> </packing>
</child> </child>
</object> </object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">OpenCL whitelist</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
</object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">4</property> <property name="position">6</property>
</packing> </packing>
</child> </child>
</object> </object>
...@@ -342,8 +388,5 @@ ...@@ -342,8 +388,5 @@
</object> </object>
</child> </child>
</object> </object>
<object class="GtkSizeGroup" id="sizegroup1"> <object class="GtkSizeGroup" id="sizegroup1"/>
<widgets>
</widgets>
</object>
</interface> </interface>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment