aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/extcap_argument_file.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ui/qt/extcap_argument_file.cpp')
-rw-r--r--ui/qt/extcap_argument_file.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/ui/qt/extcap_argument_file.cpp b/ui/qt/extcap_argument_file.cpp
index f0115ceda4..b93e889ef6 100644
--- a/ui/qt/extcap_argument_file.cpp
+++ b/ui/qt/extcap_argument_file.cpp
@@ -35,8 +35,10 @@
#include <QFileInfo>
#include <QVariant>
-#include <extcap_parser.h>
+#include <epan/prefs.h>
+#include <color_utils.h>
+#include <extcap_parser.h>
ExtcapArgumentFileSelection::ExtcapArgumentFileSelection (extcap_arg * argument) :
ExtcapArgument(argument), textBox(0)
@@ -118,9 +120,16 @@ void ExtcapArgumentFileSelection::openFileDialog()
bool ExtcapArgumentFileSelection::isValid()
{
- if ( textBox->text().length() > 0 )
- return true;
- return false;
+ bool valid = false;
+
+ if ( textBox->text().length() > 0 || ! isRequired() )
+ valid = true;
+
+ QString lblInvalidColor = ColorUtils::fromColorT(prefs.gui_text_invalid).name();
+ QString txtStyle("QLineEdit { background-color: %1; } ");
+ textBox->setStyleSheet( txtStyle.arg(valid ? QString("") : lblInvalidColor) );
+
+ return valid;
}
/*