Qt: Make the capture filter read-only only in main welcome.

As noted in gb7897dd, CaptureFilterCombo needs to be read-only until the
app is initialized. Move the code to do so to MainWelcome, otherwise the
capture filter entry in CaptureInterfacesDialog starts out read-only and
stays that way. Disable / enable the entire CaptureFilterCombo instead
of setting its lineEdit read-only status, which provides a stronger
visual indicator.

Change-Id: Ic7bf5b5631b861ecf4dc8cca67beb5bf4ed27510
Reviewed-on: https://code.wireshark.org/review/15859
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Gerald Combs 2016-06-12 15:10:02 -07:00 committed by Anders Broman
parent 6ff19fff9d
commit 8b6ea372c1
2 changed files with 6 additions and 3 deletions

View File

@ -87,7 +87,7 @@ CaptureFilterCombo::CaptureFilterCombo(QWidget *parent, bool plain) :
connect(wsApp, SIGNAL(appInitialized()), this, SLOT(rebuildFilterList()));
connect(wsApp, SIGNAL(preferencesChanged()), this, SLOT(rebuildFilterList()));
lineEdit()->setReadOnly(true);
rebuildFilterList();
clearEditText();
}
@ -118,7 +118,6 @@ void CaptureFilterCombo::rebuildFilterList()
insertItem(0, (const gchar *) li->data);
}
lineEdit()->blockSignals(false);
lineEdit()->setReadOnly(false);
}
/*

View File

@ -65,9 +65,11 @@ MainWelcome::MainWelcome(QWidget *parent) :
{
welcome_ui_->setupUi(this);
recent_files_ = welcome_ui_->recentList;
welcome_ui_->interfaceTree->resetColumnCount();
recent_files_ = welcome_ui_->recentList;
welcome_ui_->captureFilterComboBox->setEnabled(false);
setStyleSheet(QString(
"MainWelcome {"
@ -248,6 +250,8 @@ void MainWelcome::appInitialized()
// Trigger interfacesUpdated.
welcome_ui_->interfaceTree->selectedInterfaceChanged();
welcome_ui_->captureFilterComboBox->setEnabled(true);
delete splash_overlay_;
splash_overlay_ = NULL;
}