tdf#130857 widgettestdialog: Use GtkComboBoxText

Replace GtkComboBox "combo_box_enable" that has
preexisting entries defined in a GtkListStore
with a GtkComboBoxText with corresponding
items predefined directly without
using a separate list store.

That better aligns this with what is done elsewhere
and what e.g.

    commit e0218ed419
    Date:   Thu Sep 26 11:58:15 2019 +0100

        weld ORelationDialog and DlgQryJoin

and other commits also switched to elsewhere.

It also makes the entries show up when using the
qt6 VCL plugin with native widgets enabled
(SAL_VCL_QT_USE_WELDED_WIDGETS=1) where support
for the previous way of defining entries isn't
implemented (and it doesn't seem worthwile to
implement such support).

To trigger the dialog:

* in "Tools" -> "Customize", set a keyboard shortcut for
  function/UNO command ".uno:WidgetTestDialog"
* close the dialog and activat the shortcut

The `git grep '<row>'` output shows that by now,
only 3 more .ui files use the way of defining
`<row>` in models:

    $ git grep '<row>' | grep \\.ui | uniq
    dbaccess/uiconfig/ui/relationdialog.ui:      <row>
    sw/uiconfig/swriter/ui/insertcaption.ui:      <row>
    vcl/qa/cppunit/builder/demo.ui:      <row>

Change-Id: Idce2668b6d1e55ae7dda634ba18e41a07f4735b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201940
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
This commit is contained in:
Michael Weghorn
2026-03-18 17:41:54 +01:00
parent 29ae27c5df
commit 3906bb7bed
+9 -36
View File
@@ -2,31 +2,6 @@
<!-- Generated with glade 3.40.0 -->
<interface domain="cui">
<requires lib="gtk+" version="3.24"/>
<object class="GtkListStore" id="liststore1">
<columns>
<!-- column-name text -->
<column type="gchararray"/>
<!-- column-name id -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="no">Test 1</col>
</row>
<row>
<col id="0" translatable="no">Test 2</col>
</row>
<row>
<col id="0" translatable="no">Test 3</col>
</row>
<row>
<col id="0" translatable="no">Test 4</col>
</row>
<row>
<col id="0" translatable="no">Test 5</col>
</row>
</data>
</object>
<object class="GtkTreeStore" id="liststore2">
<columns>
<!-- column-name expander -->
@@ -317,20 +292,18 @@
</packing>
</child>
<child>
<object class="GtkComboBox" id="combo_box_enable">
<object class="GtkComboBoxText" id="combo_box_enable">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="model">liststore1</property>
<property name="active">2</property>
<property name="has-entry">True</property>
<property name="entry-text-column">0</property>
<property name="id-column">1</property>
<child internal-child="entry">
<object class="GtkEntry">
<property name="can-focus">False</property>
<property name="text" translatable="no">Test 3</property>
<property name="truncate-multiline">True</property>
</object>
</child>
<items>
<item id="0" translatable="no">Test 1</item>
<item id="0" translatable="no">Test 2</item>
<item id="0" translatable="no">Test 3</item>
<item id="0" translatable="no">Test 4</item>
<item id="0" translatable="no">Test 5</item>
</items>
</object>
<packing>
<property name="left-attach">1</property>