diff options
author | Gerald Combs <gerald@wireshark.org> | 2019-06-20 11:25:49 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2019-06-21 23:51:49 +0000 |
commit | 7b557088e9cf2e1d9bb82eb3714851e671414c43 (patch) | |
tree | 8d1ff605e9bfee90614685513aa2f428a2393572 /ui | |
parent | d0b961f9829a3241adac74f37df920ae0dd46096 (diff) |
Qt: Convert the rest of the preference dialog list buttons.
We no longer use the old icon names, so remove their aliases from
stock_icons.qrc.
Ping-Bug: 15511
Change-Id: If3c5e2b95825207a401e12607fcb94cdcc8a51c8
Reviewed-on: https://code.wireshark.org/review/33689
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qt/coloring_rules_dialog.cpp | 5 | ||||
-rw-r--r-- | ui/qt/coloring_rules_dialog.ui | 89 | ||||
-rw-r--r-- | ui/qt/column_preferences_frame.cpp | 3 | ||||
-rw-r--r-- | ui/qt/column_preferences_frame.ui | 25 | ||||
-rw-r--r-- | ui/qt/decode_as_dialog.cpp | 5 | ||||
-rw-r--r-- | ui/qt/decode_as_dialog.ui | 49 | ||||
-rw-r--r-- | ui/qt/filter_dialog.cpp | 4 | ||||
-rw-r--r-- | ui/qt/filter_dialog.ui | 39 | ||||
-rw-r--r-- | ui/qt/io_graph_dialog.cpp | 12 | ||||
-rw-r--r-- | ui/qt/io_graph_dialog.ui | 51 | ||||
-rw-r--r-- | ui/qt/manage_interfaces_dialog.cpp | 5 | ||||
-rw-r--r-- | ui/qt/manage_interfaces_dialog.ui | 35 | ||||
-rw-r--r-- | ui/qt/profile_dialog.cpp | 3 | ||||
-rw-r--r-- | ui/qt/profile_dialog.ui | 27 | ||||
-rw-r--r-- | ui/qt/uat_dialog.cpp | 1 | ||||
-rw-r--r-- | ui/qt/uat_frame.cpp | 7 | ||||
-rw-r--r-- | ui/qt/uat_frame.ui | 296 |
17 files changed, 295 insertions, 361 deletions
diff --git a/ui/qt/coloring_rules_dialog.cpp b/ui/qt/coloring_rules_dialog.cpp index eb260f3ec3..16cb537664 100644 --- a/ui/qt/coloring_rules_dialog.cpp +++ b/ui/qt/coloring_rules_dialog.cpp @@ -59,6 +59,11 @@ ColoringRulesDialog::ColoringRulesDialog(QWidget *parent, QString add_filter) : ui->coloringRulesTreeView->resizeColumnToContents(i); } + ui->newToolButton->setStockIcon("list-add"); + ui->deleteToolButton->setStockIcon("list-remove"); + ui->copyToolButton->setStockIcon("list-copy"); + ui->clearToolButton->setStockIcon("list-clear"); + #ifdef Q_OS_MAC ui->newToolButton->setAttribute(Qt::WA_MacSmallSize, true); ui->deleteToolButton->setAttribute(Qt::WA_MacSmallSize, true); diff --git a/ui/qt/coloring_rules_dialog.ui b/ui/qt/coloring_rules_dialog.ui index 2922793a08..7436f76d97 100644 --- a/ui/qt/coloring_rules_dialog.ui +++ b/ui/qt/coloring_rules_dialog.ui @@ -16,6 +16,12 @@ <layout class="QVBoxLayout" name="verticalLayout"> <item> <widget class="TabnavTreeView" name="coloringRulesTreeView"> + <property name="dragEnabled"> + <bool>true</bool> + </property> + <property name="dragDropMode"> + <enum>QAbstractItemView::InternalMove</enum> + </property> <property name="selectionMode"> <enum>QAbstractItemView::ExtendedSelection</enum> </property> @@ -34,15 +40,9 @@ <property name="expandsOnDoubleClick"> <bool>false</bool> </property> - <property name="dragEnabled"> + <property name="DropIndicatorShown" stdset="0"> <bool>true</bool> </property> - <property name="DropIndicatorShown"> - <bool>true</bool> - </property> - <property name="dragDropMode"> - <enum>QAbstractItemView::InternalMove</enum> - </property> </widget> </item> <item> @@ -58,66 +58,53 @@ <item> <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,0,0,0,0,0,1"> <item> - <widget class="QToolButton" name="newToolButton"> + <widget class="StockIconToolButton" name="newToolButton"> <property name="toolTip"> <string>Add a new coloring rule.</string> </property> <property name="text"> <string/> </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/plus-8.png</normaloff>:/stock/plus-8.png</iconset> - </property> </widget> </item> <item> - <widget class="QToolButton" name="deleteToolButton"> + <widget class="StockIconToolButton" name="deleteToolButton"> + <property name="enabled"> + <bool>false</bool> + </property> <property name="toolTip"> <string>Delete this coloring rule.</string> </property> <property name="text"> <string/> </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/minus-8.png</normaloff>:/stock/minus-8.png</iconset> - </property> - <property name="enabled"> - <bool>false</bool> - </property> </widget> </item> <item> - <widget class="QToolButton" name="copyToolButton"> - <property name="toolTip"> - <string>Duplicate this coloring rule.</string> - </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/copy-8.png</normaloff>:/stock/copy-8.png</iconset> - </property> + <widget class="StockIconToolButton" name="copyToolButton"> <property name="enabled"> <bool>false</bool> </property> + <property name="toolTip"> + <string>Duplicate this coloring rule.</string> + </property> </widget> </item> <item> - <widget class="QToolButton" name="clearToolButton"> - <property name="toolTip"> - <string>Clear all coloring rules.</string> - </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/delete_list.png</normaloff>:/stock/delete_list.png</iconset> - </property> + <widget class="StockIconToolButton" name="clearToolButton"> <property name="enabled"> <bool>false</bool> </property> + <property name="toolTip"> + <string>Clear all coloring rules.</string> + </property> </widget> </item> <item> <widget class="QPushButton" name="fGPushButton"> + <property name="visible"> + <bool>false</bool> + </property> <property name="toolTip"> <string>Set the foreground color for this rule.</string> </property> @@ -133,13 +120,13 @@ <property name="flat"> <bool>true</bool> </property> - <property name="visible"> - <bool>false</bool> - </property> </widget> </item> <item> <widget class="QPushButton" name="bGPushButton"> + <property name="visible"> + <bool>false</bool> + </property> <property name="toolTip"> <string>Set the background color for this rule.</string> </property> @@ -155,13 +142,13 @@ <property name="flat"> <bool>true</bool> </property> - <property name="visible"> - <bool>false</bool> - </property> </widget> </item> <item> <widget class="QPushButton" name="displayFilterPushButton"> + <property name="visible"> + <bool>false</bool> + </property> <property name="toolTip"> <string>Set the display filter using this rule.</string> </property> @@ -171,9 +158,6 @@ <property name="autoDefault"> <bool>false</bool> </property> - <property name="visible"> - <bool>false</bool> - </property> </widget> </item> <item> @@ -224,19 +208,22 @@ </widget> <customwidgets> <customwidget> + <class>ElidedLabel</class> + <extends>QLabel</extends> + <header>widgets/elided_label.h</header> + </customwidget> + <customwidget> <class>TabnavTreeView</class> <extends>QTreeView</extends> <header>widgets/tabnav_tree_view.h</header> </customwidget> <customwidget> - <class>ElidedLabel</class> - <extends>QLabel</extends> - <header>widgets/elided_label.h</header> + <class>StockIconToolButton</class> + <extends>QToolButton</extends> + <header>widgets/stock_icon_tool_button.h</header> </customwidget> </customwidgets> - <resources> - <include location="../../image/stock_icons.qrc"/> - </resources> + <resources/> <connections> <connection> <sender>buttonBox</sender> diff --git a/ui/qt/column_preferences_frame.cpp b/ui/qt/column_preferences_frame.cpp index 4920ef8b81..1818a189a4 100644 --- a/ui/qt/column_preferences_frame.cpp +++ b/ui/qt/column_preferences_frame.cpp @@ -60,6 +60,9 @@ ColumnPreferencesFrame::ColumnPreferencesFrame(QWidget *parent) : ui->columnTreeWidget->setDropIndicatorShown(true); ui->columnTreeWidget->setDragDropMode(QAbstractItemView::InternalMove); + ui->newToolButton->setStockIcon("list-add"); + ui->deleteToolButton->setStockIcon("list-remove"); + for (GList *cur = g_list_first(prefs.col_list); cur != NULL && cur->data != NULL; cur = cur->next) { fmt_data *cfmt = (fmt_data *) cur->data; addColumn(cfmt->visible, cfmt->title, cfmt->fmt, cfmt->custom_fields, cfmt->custom_occurrence); diff --git a/ui/qt/column_preferences_frame.ui b/ui/qt/column_preferences_frame.ui index a34e5dc3d6..9c9620e8b6 100644 --- a/ui/qt/column_preferences_frame.ui +++ b/ui/qt/column_preferences_frame.ui @@ -55,20 +55,10 @@ <item> <layout class="QHBoxLayout" name="horizontalLayout"> <item> - <widget class="QToolButton" name="newToolButton"> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/plus-8.png</normaloff>:/stock/plus-8.png</iconset> - </property> - </widget> + <widget class="StockIconToolButton" name="newToolButton"/> </item> <item> - <widget class="QToolButton" name="deleteToolButton"> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/minus-8.png</normaloff>:/stock/minus-8.png</iconset> - </property> - </widget> + <widget class="StockIconToolButton" name="deleteToolButton"/> </item> <item> <spacer name="horizontalSpacer"> @@ -87,8 +77,13 @@ </item> </layout> </widget> - <resources> - <include location="../../image/stock_icons.qrc"/> - </resources> + <customwidgets> + <customwidget> + <class>StockIconToolButton</class> + <extends>QToolButton</extends> + <header>widgets/stock_icon_tool_button.h</header> + </customwidget> + </customwidgets> + <resources/> <connections/> </ui> diff --git a/ui/qt/decode_as_dialog.cpp b/ui/qt/decode_as_dialog.cpp index d7a6d68c0a..49606cc51f 100644 --- a/ui/qt/decode_as_dialog.cpp +++ b/ui/qt/decode_as_dialog.cpp @@ -49,6 +49,11 @@ DecodeAsDialog::DecodeAsDialog(QWidget *parent, capture_file *cf, bool create_ne ui->decodeAsTreeView->setModel(model_); ui->decodeAsTreeView->setItemDelegate(delegate_); + ui->newToolButton->setStockIcon("list-add"); + ui->deleteToolButton->setStockIcon("list-remove"); + ui->copyToolButton->setStockIcon("list-copy"); + ui->clearToolButton->setStockIcon("list-clear"); + #ifdef Q_OS_MAC ui->newToolButton->setAttribute(Qt::WA_MacSmallSize, true); ui->deleteToolButton->setAttribute(Qt::WA_MacSmallSize, true); diff --git a/ui/qt/decode_as_dialog.ui b/ui/qt/decode_as_dialog.ui index 6db0a61cc4..795a3beb96 100644 --- a/ui/qt/decode_as_dialog.ui +++ b/ui/qt/decode_as_dialog.ui @@ -21,59 +21,43 @@ <item> <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,0,0,1"> <item> - <widget class="QToolButton" name="newToolButton"> + <widget class="StockIconToolButton" name="newToolButton"> <property name="toolTip"> <string>Change the dissection behavior for a protocol.</string> </property> <property name="text"> <string/> </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/plus-8.png</normaloff>:/stock/plus-8.png</iconset> - </property> </widget> </item> <item> - <widget class="QToolButton" name="deleteToolButton"> - <property name="toolTip"> - <string>Remove this dissection behavior.</string> - </property> + <widget class="StockIconToolButton" name="deleteToolButton"> <property name="enabled"> <bool>false</bool> </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/minus-8.png</normaloff>:/stock/minus-8.png</iconset> + <property name="toolTip"> + <string>Remove this dissection behavior.</string> </property> </widget> </item> <item> - <widget class="QToolButton" name="copyToolButton"> + <widget class="StockIconToolButton" name="copyToolButton"> <property name="toolTip"> <string>Copy this dissection behavior.</string> </property> <property name="text"> <string/> </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/copy-8.png</normaloff>:/stock/copy-8.png</iconset> - </property> </widget> </item> <item> - <widget class="QToolButton" name="clearToolButton"> - <property name="toolTip"> - <string>Clear all dissection behaviors.</string> - </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/delete_list.png</normaloff>:/stock/delete_list.png</iconset> - </property> + <widget class="StockIconToolButton" name="clearToolButton"> <property name="enabled"> <bool>false</bool> </property> + <property name="toolTip"> + <string>Clear all dissection behaviors.</string> + </property> </widget> </item> <item> @@ -129,14 +113,17 @@ <header>widgets/elided_label.h</header> </customwidget> <customwidget> - <class>TabnavTreeView</class> - <extends>QTreeView</extends> - <header>widgets/tabnav_tree_view.h</header> + <class>TabnavTreeView</class> + <extends>QTreeView</extends> + <header>widgets/tabnav_tree_view.h</header> + </customwidget> + <customwidget> + <class>StockIconToolButton</class> + <extends>QToolButton</extends> + <header>widgets/stock_icon_tool_button.h</header> </customwidget> </customwidgets> - <resources> - <include location="../../image/stock_icons.qrc"/> - </resources> + <resources/> <connections> <connection> <sender>buttonBox</sender> diff --git a/ui/qt/filter_dialog.cpp b/ui/qt/filter_dialog.cpp index cc9a06f541..8ef43bbb2a 100644 --- a/ui/qt/filter_dialog.cpp +++ b/ui/qt/filter_dialog.cpp @@ -53,6 +53,10 @@ FilterDialog::FilterDialog(QWidget *parent, FilterType filter_type, const QStrin if (parent) loadGeometry(parent->width() * 2 / 3, parent->height() * 2 / 3); setWindowIcon(wsApp->normalIcon()); + ui->newToolButton->setStockIcon("list-add"); + ui->deleteToolButton->setStockIcon("list-remove"); + ui->copyToolButton->setStockIcon("list-copy"); + #ifdef Q_OS_MAC ui->newToolButton->setAttribute(Qt::WA_MacSmallSize, true); ui->deleteToolButton->setAttribute(Qt::WA_MacSmallSize, true); diff --git a/ui/qt/filter_dialog.ui b/ui/qt/filter_dialog.ui index 87d2b7dd95..c01a6eff76 100644 --- a/ui/qt/filter_dialog.ui +++ b/ui/qt/filter_dialog.ui @@ -43,48 +43,36 @@ <item> <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,0,1"> <item> - <widget class="QToolButton" name="newToolButton"> + <widget class="StockIconToolButton" name="newToolButton"> <property name="toolTip"> <string>Create a new filter.</string> </property> <property name="text"> <string/> </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/plus-8.png</normaloff>:/stock/plus-8.png</iconset> - </property> </widget> </item> <item> - <widget class="QToolButton" name="deleteToolButton"> - <property name="toolTip"> - <string>Remove this filter.</string> - </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/minus-8.png</normaloff>:/stock/minus-8.png</iconset> - </property> + <widget class="StockIconToolButton" name="deleteToolButton"> <property name="enabled"> <bool>false</bool> </property> + <property name="toolTip"> + <string>Remove this filter.</string> + </property> </widget> </item> <item> - <widget class="QToolButton" name="copyToolButton"> + <widget class="StockIconToolButton" name="copyToolButton"> + <property name="enabled"> + <bool>false</bool> + </property> <property name="toolTip"> <string>Copy this filter.</string> </property> <property name="text"> <string/> </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/copy-8.png</normaloff>:/stock/copy-8.png</iconset> - </property> - <property name="enabled"> - <bool>false</bool> - </property> </widget> </item> <item> @@ -139,10 +127,13 @@ <extends>QLabel</extends> <header>widgets/elided_label.h</header> </customwidget> + <customwidget> + <class>StockIconToolButton</class> + <extends>QToolButton</extends> + <header>widgets/stock_icon_tool_button.h</header> + </customwidget> </customwidgets> - <resources> - <include location="../../image/stock_icons.qrc"/> - </resources> + <resources/> <connections> <connection> <sender>buttonBox</sender> diff --git a/ui/qt/io_graph_dialog.cpp b/ui/qt/io_graph_dialog.cpp index 3dcf2dc602..15abbc26dd 100644 --- a/ui/qt/io_graph_dialog.cpp +++ b/ui/qt/io_graph_dialog.cpp @@ -308,6 +308,18 @@ IOGraphDialog::IOGraphDialog(QWidget &parent, CaptureFile &cf) : setAttribute(Qt::WA_DeleteOnClose, true); QCustomPlot *iop = ui->ioPlot; + ui->newToolButton->setStockIcon("list-add"); + ui->deleteToolButton->setStockIcon("list-remove"); + ui->copyToolButton->setStockIcon("list-copy"); + ui->clearToolButton->setStockIcon("list-clear"); + +#ifdef Q_OS_MAC + ui->newToolButton->setAttribute(Qt::WA_MacSmallSize, true); + ui->deleteToolButton->setAttribute(Qt::WA_MacSmallSize, true); + ui->copyToolButton->setAttribute(Qt::WA_MacSmallSize, true); + ui->clearToolButton->setAttribute(Qt::WA_MacSmallSize, true); +#endif + QPushButton *save_bt = ui->buttonBox->button(QDialogButtonBox::Save); save_bt->setText(tr("Save As" UTF8_HORIZONTAL_ELLIPSIS)); diff --git a/ui/qt/io_graph_dialog.ui b/ui/qt/io_graph_dialog.ui index 33c8deb022..d6e5752e5a 100644 --- a/ui/qt/io_graph_dialog.ui +++ b/ui/qt/io_graph_dialog.ui @@ -76,56 +76,40 @@ <item> <layout class="QHBoxLayout" name="horizontalLayout"> <item> - <widget class="QToolButton" name="newToolButton"> + <widget class="StockIconToolButton" name="newToolButton"> <property name="toolTip"> <string>Add a new graph.</string> </property> <property name="text"> <string/> </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/plus-8.png</normaloff>:/stock/plus-8.png</iconset> - </property> </widget> </item> <item> - <widget class="QToolButton" name="deleteToolButton"> + <widget class="StockIconToolButton" name="deleteToolButton"> <property name="toolTip"> <string>Remove this graph.</string> </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/minus-8.png</normaloff>:/stock/minus-8.png</iconset> - </property> </widget> </item> <item> - <widget class="QToolButton" name="copyToolButton"> + <widget class="StockIconToolButton" name="copyToolButton"> <property name="toolTip"> <string>Duplicate this graph.</string> </property> <property name="text"> <string/> </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/copy-8.png</normaloff>:/stock/copy-8.png</iconset> - </property> </widget> </item> <item> - <widget class="QToolButton" name="clearToolButton"> - <property name="toolTip"> - <string>Clear all graphs.</string> - </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/delete_list.png</normaloff>:/stock/delete_list.png</iconset> - </property> + <widget class="StockIconToolButton" name="clearToolButton"> <property name="enabled"> <bool>false</bool> </property> + <property name="toolTip"> + <string>Clear all graphs.</string> + </property> </widget> </item> <item> @@ -482,12 +466,6 @@ </widget> <customwidgets> <customwidget> - <class>QCustomPlot</class> - <extends>QWidget</extends> - <header>widgets/qcustomplot.h</header> - <container>1</container> - </customwidget> - <customwidget> <class>ElidedLabel</class> <extends>QLabel</extends> <header>widgets/elided_label.h</header> @@ -497,10 +475,19 @@ <extends>QTreeView</extends> <header>widgets/tabnav_tree_view.h</header> </customwidget> + <customwidget> + <class>StockIconToolButton</class> + <extends>QToolButton</extends> + <header>widgets/stock_icon_tool_button.h</header> + </customwidget> + <customwidget> + <class>QCustomPlot</class> + <extends>QWidget</extends> + <header>widgets/qcustomplot.h</header> + <container>1</container> + </customwidget> </customwidgets> - <resources> - <include location="../../image/stock_icons.qrc"/> - </resources> + <resources/> <connections> <connection> <sender>buttonBox</sender> diff --git a/ui/qt/manage_interfaces_dialog.cpp b/ui/qt/manage_interfaces_dialog.cpp index a193e9397b..162f79c4cd 100644 --- a/ui/qt/manage_interfaces_dialog.cpp +++ b/ui/qt/manage_interfaces_dialog.cpp @@ -130,6 +130,11 @@ ManageInterfacesDialog::ManageInterfacesDialog(QWidget *parent) : loadGeometry(); setAttribute(Qt::WA_DeleteOnClose, true); + ui->addPipe->setStockIcon("list-add"); + ui->delPipe->setStockIcon("list-remove"); + ui->addRemote->setStockIcon("list-add"); + ui->delRemote->setStockIcon("list-remove"); + #ifdef Q_OS_MAC ui->addPipe->setAttribute(Qt::WA_MacSmallSize, true); ui->delPipe->setAttribute(Qt::WA_MacSmallSize, true); diff --git a/ui/qt/manage_interfaces_dialog.ui b/ui/qt/manage_interfaces_dialog.ui index eff0b9475b..fa93023cf0 100644 --- a/ui/qt/manage_interfaces_dialog.ui +++ b/ui/qt/manage_interfaces_dialog.ui @@ -96,31 +96,23 @@ <item> <layout class="QHBoxLayout" name="horizontalLayout_2"> <item> - <widget class="QToolButton" name="addPipe"> + <widget class="StockIconToolButton" name="addPipe"> <property name="toolTip"> <string><html><head/><body><p>Add a new pipe using default settings.</p></body></html></string> </property> <property name="text"> <string/> </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/plus-8.png</normaloff>:/stock/plus-8.png</iconset> - </property> </widget> </item> <item> - <widget class="QToolButton" name="delPipe"> + <widget class="StockIconToolButton" name="delPipe"> <property name="toolTip"> <string><html><head/><body><p>Remove the selected pipe from the list.</p></body></html></string> </property> <property name="text"> <string/> </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/minus-8.png</normaloff>:/stock/minus-8.png</iconset> - </property> </widget> </item> <item> @@ -165,31 +157,23 @@ <item> <layout class="QHBoxLayout" name="horizontalLayout_3"> <item> - <widget class="QToolButton" name="addRemote"> + <widget class="StockIconToolButton" name="addRemote"> <property name="toolTip"> <string><html><head/><body><p>Add a remote host and its interfaces</p></body></html></string> </property> <property name="text"> <string/> </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/plus-8.png</normaloff>:/stock/plus-8.png</iconset> - </property> </widget> </item> <item> - <widget class="QToolButton" name="delRemote"> + <widget class="StockIconToolButton" name="delRemote"> <property name="toolTip"> <string><html><head/><body><p>Remove the selected host from the list.</p></body></html></string> </property> <property name="text"> <string/> </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/minus-8.png</normaloff>:/stock/minus-8.png</iconset> - </property> </widget> </item> <item> @@ -237,9 +221,14 @@ </item> </layout> </widget> - <resources> - <include location="../../image/stock_icons.qrc"/> - </resources> + <customwidgets> + <customwidget> + <class>StockIconToolButton</class> + <extends>QToolButton</extends> + <header>widgets/stock_icon_tool_button.h</header> + </customwidget> + </customwidgets> + <resources/> <connections> <connection> <sender>buttonBox</sender> diff --git a/ui/qt/profile_dialog.cpp b/ui/qt/profile_dialog.cpp index 667577b62f..f140d86791 100644 --- a/ui/qt/profile_dialog.cpp +++ b/ui/qt/profile_dialog.cpp @@ -50,6 +50,9 @@ ProfileDialog::ProfileDialog(QWidget *parent) : // XXX - Use NSImageNameAddTemplate and NSImageNameRemoveTemplate to set stock // icons on macOS. // Are there equivalent stock icons on Windows? + pd_ui_->newToolButton->setStockIcon("list-add"); + pd_ui_->deleteToolButton->setStockIcon("list-remove"); + pd_ui_->copyToolButton->setStockIcon("list-copy"); #ifdef Q_OS_MAC pd_ui_->newToolButton->setAttribute(Qt::WA_MacSmallSize, true); pd_ui_->deleteToolButton->setAttribute(Qt::WA_MacSmallSize, true); diff --git a/ui/qt/profile_dialog.ui b/ui/qt/profile_dialog.ui index b1fd7f8ece..fd2c908eef 100644 --- a/ui/qt/profile_dialog.ui +++ b/ui/qt/profile_dialog.ui @@ -41,42 +41,30 @@ <item> <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,0,1"> <item> - <widget class="QToolButton" name="newToolButton"> + <widget class="StockIconToolButton" name="newToolButton"> <property name="toolTip"> <string>Create a new profile using default settings.</string> </property> <property name="text"> <string/> </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/plus-8.png</normaloff>:/stock/plus-8.png</iconset> - </property> </widget> </item> <item> - <widget class="QToolButton" name="deleteToolButton"> + <widget class="StockIconToolButton" name="deleteToolButton"> <property name="toolTip"> <string>Remove this profile. System provided profiles cannot be removed.</string> </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/minus-8.png</normaloff>:/stock/minus-8.png</iconset> - </property> </widget> </item> <item> - <widget class="QToolButton" name="copyToolButton"> + <widget class="StockIconToolButton" name="copyToolButton"> <property name="toolTip"> <string>Copy this profile.</string> </property> <property name="text"> <string/> </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/copy-8.png</normaloff>:/stock/copy-8.png</iconset> - </property> </widget> </item> <item> @@ -131,10 +119,13 @@ <extends>QLabel</extends> <header>widgets/elided_label.h</header> </customwidget> + <customwidget> + <class>StockIconToolButton</class> + <extends>QToolButton</extends> + <header>widgets/stock_icon_tool_button.h</header> + </customwidget> </customwidgets> - <resources> - <include location="../../image/stock_icons.qrc"/> - </resources> + <resources/> <connections> <connection> <sender>buttonBox</sender> diff --git a/ui/qt/uat_dialog.cpp b/ui/qt/uat_dialog.cpp index dbd2dcacba..63e56e195a 100644 --- a/ui/qt/uat_dialog.cpp +++ b/ui/qt/uat_dialog.cpp @@ -17,7 +17,6 @@ #include <wsutil/report_message.h> #include <ui/qt/widgets/copy_from_profile_menu.h> -#include <ui/qt/widgets/stock_icon_tool_button.h> #include <ui/qt/utils/qt_ui_utils.h> #include <QDesktopServices> diff --git a/ui/qt/uat_frame.cpp b/ui/qt/uat_frame.cpp index bb1dadd458..0a8cb69e2c 100644 --- a/ui/qt/uat_frame.cpp +++ b/ui/qt/uat_frame.cpp @@ -38,6 +38,13 @@ UatFrame::UatFrame(QWidget *parent) : { ui->setupUi(this); + ui->newToolButton->setStockIcon("list-add"); + ui->deleteToolButton->setStockIcon("list-remove"); + ui->copyToolButton->setStockIcon("list-copy"); + ui->moveUpToolButton->setStockIcon("list-move-up"); + ui->moveDownToolButton->setStockIcon("list-move-down"); + ui->clearToolButton->setStockIcon("list-clear"); + #ifdef Q_OS_MAC ui->newToolButton->setAttribute(Qt::WA_MacSmallSize, true); ui->deleteToolButton->setAttribute(Qt::WA_MacSmallSize, true); diff --git a/ui/qt/uat_frame.ui b/ui/qt/uat_frame.ui index ea26552dbc..786aa2c07a 100644 --- a/ui/qt/uat_frame.ui +++ b/ui/qt/uat_frame.ui @@ -17,176 +17,140 @@ <number>0</number> </property> <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="TabnavTreeView" name="uatTreeView"> - <column> - <property name="text"> - <string notr="true">1</string> - </property> - <property name="dragEnabled"> - <bool>false</bool> - </property> - </column> + <item> + <widget class="TabnavTreeView" name="uatTreeView"/> + </item> + <item> + <widget class="QLabel" name="hintLabel"> + <property name="styleSheet"> + <string notr="true">QLabel { color: red; }</string> + </property> + <property name="text"> + <string/> + </property> + <property name="textFormat"> + <enum>Qt::RichText</enum> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,0,0,0,0,1"> + <item> + <widget class="StockIconToolButton" name="newToolButton"> + <property name="toolTip"> + <string>Create a new entry.</string> + </property> + <property name="text"> + <string/> + </property> </widget> - </item> - <item> - <widget class="QLabel" name="hintLabel"> - <property name="styleSheet"> - <string notr="true">QLabel { color: red; }</string> - </property> - <property name="text"> - <string/> - </property> - <property name="textFormat"> - <set>Qt::RichText</set> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> + </item> + <item> + <widget class="StockIconToolButton" name="deleteToolButton"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="toolTip"> + <string>Remove this entry.</string> + </property> </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,0,0,0,0,1"> - <item> - <widget class="QToolButton" name="newToolButton"> - <property name="toolTip"> - <string>Create a new entry.</string> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/plus-8.png</normaloff>:/stock/plus-8.png - </iconset> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="deleteToolButton"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="toolTip"> - <string>Remove this entry.</string> - </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/minus-8.png</normaloff>:/stock/minus-8.png - </iconset> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="copyToolButton"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="toolTip"> - <string>Copy this entry.</string> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/copy-8.png</normaloff>:/stock/copy-8.png - </iconset> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="moveUpToolButton"> - <property name="toolTip"> - <string>Move entry up.</string> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/arrow_up.png</normaloff>:/stock/arrow_up.png - </iconset> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="moveDownToolButton"> - <property name="toolTip"> - <string>Move entry down.</string> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/arrow_down.png</normaloff>:/stock/arrow_down.png - </iconset> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="clearToolButton"> - <property name="toolTip"> - <string>Clear all entries.</string> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="../../image/stock_icons.qrc"> - <normaloff>:/stock/delete_list.png</normaloff>:/stock/delete_list.png - </iconset> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="copyFromProfileButton"> - <property name="toolTip"> - <string>Copy entries from another profile.</string> - </property> - <property name="text"> - <string>Copy from</string> - </property> - </widget> - </item> - <item> - <widget class="ElidedLabel" name="pathLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> - <horstretch>1</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="openExternalLinks"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </item> + </item> + <item> + <widget class="StockIconToolButton" name="copyToolButton"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="toolTip"> + <string>Copy this entry.</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <widget class="StockIconToolButton" name="moveUpToolButton"> + <property name="toolTip"> + <string>Move entry up.</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <widget class="StockIconToolButton" name="moveDownToolButton"> + <property name="toolTip"> + <string>Move entry down.</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <widget class="StockIconToolButton" name="clearToolButton"> + <property name="toolTip"> + <string>Clear all entries.</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="copyFromProfileButton"> + <property name="toolTip"> + <string>Copy entries from another profile.</string> + </property> + <property name="text"> + <string>Copy from</string> + </property> + </widget> + </item> + <item> + <widget class="ElidedLabel" name="pathLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>1</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string/> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </item> </layout> </widget> <customwidgets> - <customwidget> - <class>ElidedLabel</class> - <extends>QLabel</extends> - <header>widgets/elided_label.h</header> - </customwidget> - <customwidget> - <class>TabnavTreeView</class> - <extends>QTreeView</extends> - <header>widgets/tabnav_tree_view.h</header> - </customwidget> - </customwidgets> - <resources> - <include location="../../image/stock_icons.qrc"/> - </resources> + <customwidget> + <class>ElidedLabel</class> + <extends>QLabel</extends> + <header>widgets/elided_label.h</header> + </customwidget> + <customwidget> + <class>TabnavTreeView</class> + <extends>QTreeView</extends> + <header>widgets/tabnav_tree_view.h</header> + </customwidget> + <customwidget> + <class>StockIconToolButton</class> + <extends>QToolButton</extends> + <header>widgets/stock_icon_tool_button.h</header> + </customwidget> + </customwidgets> + <resources/> <connections/> </ui> |