From 1a716800e37ae482901e9cce36c40005742dd78e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Sun, 28 Feb 2016 19:23:20 +0100 Subject: Qt: Add dialog geometry restore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add GeometryStateDialog class to handle load and save dialog geometry. The QDialog class name will be used as window name. For shared classes the UAT name or the statistics title or abbr will be used. Change-Id: I5a019598307fb3861518f41e733de834788184d8 Reviewed-on: https://code.wireshark.org/review/14139 Reviewed-by: Stig Bjørlykke --- ui/qt/supported_protocols_dialog.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'ui/qt/supported_protocols_dialog.cpp') diff --git a/ui/qt/supported_protocols_dialog.cpp b/ui/qt/supported_protocols_dialog.cpp index 08ff8b116e..1bd1dc8d60 100644 --- a/ui/qt/supported_protocols_dialog.cpp +++ b/ui/qt/supported_protocols_dialog.cpp @@ -47,16 +47,14 @@ enum { name_col_, filter_col_, type_col_, descr_col_ }; SupportedProtocolsDialog::SupportedProtocolsDialog(QWidget *parent) : - QDialog(parent), + GeometryStateDialog(parent), ui(new Ui::SupportedProtocolsDialog), field_count_(0) { ui->setupUi(this); + if (parent) loadGeometry(parent->width() * 3 / 4, parent->height()); setWindowTitle(wsApp->windowTitleString(tr("Supported Protocols"))); - // XXX Use recent settings instead - if (parent) resize(parent->width() * 3 / 4, parent->height()); - // Some of our names are unreasonably long. int one_em = fontMetrics().height(); ui->protoTreeWidget->setColumnWidth(name_col_, one_em * 15); -- cgit v1.2.1