aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2016-05-11 17:55:46 -0700
committerGerald Combs <gerald@wireshark.org>2016-05-17 23:52:38 +0000
commit3f48ef41c35fe567d93029b79edb8664abadc3ee (patch)
treeef2e3eacda9690332295bb3c9cd4e059710b7f47 /ui
parentc564715db1c54375f877d208efc11e7a9480e26b (diff)
Qt: Add accessible names to main welcome widgets.
Make sure all of the widgets in the main welcome tab loop have their AccessibleName properties set. Set AccessibleTextRole for each of the items in the recent file list and in the interface list. Ping-Bug: 9284 Change-Id: I247ce7ed68eda82a27a34d98a4bab1bcbed760b5 Reviewed-on: https://code.wireshark.org/review/15405 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/interface_tree.cpp5
-rw-r--r--ui/qt/main_welcome.cpp1
-rw-r--r--ui/qt/main_welcome.ui12
3 files changed, 17 insertions, 1 deletions
diff --git a/ui/qt/interface_tree.cpp b/ui/qt/interface_tree.cpp
index 5095a984f0..142089a003 100644
--- a/ui/qt/interface_tree.cpp
+++ b/ui/qt/interface_tree.cpp
@@ -205,10 +205,13 @@ void InterfaceTree::display()
}
InterfaceTreeWidgetItem *ti = new InterfaceTreeWidgetItem();
- ti->setText(IFTREE_COL_NAME, QString().fromUtf8(device.display_name));
+ QString if_name = device.display_name;
+ ti->setText(IFTREE_COL_NAME, if_name);
+ ti->setData(IFTREE_COL_NAME, Qt::AccessibleTextRole, if_name);
ti->setData(IFTREE_COL_NAME, Qt::UserRole, QString(device.name));
ti->setData(IFTREE_COL_STATS, Qt::UserRole, qVariantFromValue(&ti->points));
+
#ifdef HAVE_EXTCAP
if (device.if_info.type == IF_EXTCAP) {
if (extcap_has_configuration((const char *)(device.name), FALSE)) {
diff --git a/ui/qt/main_welcome.cpp b/ui/qt/main_welcome.cpp
index 8d93fd6b3a..c3adfa7f93 100644
--- a/ui/qt/main_welcome.cpp
+++ b/ui/qt/main_welcome.cpp
@@ -375,6 +375,7 @@ void MainWelcome::updateRecentFiles() {
rfFont.setItalic(!ri->accessible);
rfItem = recent_files_->item(rfRow);
rfItem->setText(itemLabel);
+ rfItem->setData(Qt::AccessibleTextRole, itemLabel);
rfItem->setData(Qt::UserRole, ri->filename);
rfItem->setFlags(ri->accessible ? Qt::ItemIsSelectable | Qt::ItemIsEnabled : Qt::NoItemFlags);
rfItem->setFont(rfFont);
diff --git a/ui/qt/main_welcome.ui b/ui/qt/main_welcome.ui
index a5ccd1f8e6..14ddee5b9c 100644
--- a/ui/qt/main_welcome.ui
+++ b/ui/qt/main_welcome.ui
@@ -126,6 +126,12 @@
<verstretch>2</verstretch>
</sizepolicy>
</property>
+ <property name="accessibleName">
+ <string>Recent capture files</string>
+ </property>
+ <property name="accessibleDescription">
+ <string>Capture files that have been opened previously</string>
+ </property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
@@ -187,6 +193,12 @@
<verstretch>1</verstretch>
</sizepolicy>
</property>
+ <property name="accessibleName">
+ <string>Interface list</string>
+ </property>
+ <property name="accessibleDescription">
+ <string>List of available capture interfaces</string>
+ </property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>