MatchHeader: Fixed crash with action, use tooltips.
* When an action was already set, a menu item was being selected before the menu had been created -- must have happened on some refactoring. * Use tooltips rather than fill the header/value text controls with some help texts.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-2012, Haiku, Inc. All rights reserved.
|
* Copyright 2004-2016, Haiku, Inc. All rights reserved.
|
||||||
* Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
|
* Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
|
||||||
*
|
*
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
@@ -70,13 +70,14 @@ RuleFilterConfig::RuleFilterConfig(const BMailAddOnSettings& addOnSettings)
|
|||||||
MatchHeaderSettings settings(addOnSettings);
|
MatchHeaderSettings settings(addOnSettings);
|
||||||
fAction = settings.Action();
|
fAction = settings.Action();
|
||||||
|
|
||||||
fAttributeControl = new BTextControl("attr", B_TRANSLATE("If"),
|
fAttributeControl = new BTextControl("attr", B_TRANSLATE("If"), NULL, NULL);
|
||||||
B_TRANSLATE("header (e.g. Subject)"), NULL);
|
fAttributeControl->SetToolTip(
|
||||||
|
B_TRANSLATE("Header field (e.g. Subject, From, ...)"));
|
||||||
fAttributeControl->SetText(settings.Attribute());
|
fAttributeControl->SetText(settings.Attribute());
|
||||||
|
|
||||||
fRegexControl = new BTextControl("regex", B_TRANSLATE("has"),
|
fRegexControl = new BTextControl("regex", B_TRANSLATE("has"), NULL, NULL);
|
||||||
B_TRANSLATE("value (use REGEX: in front of regular expressions like "
|
fRegexControl->SetToolTip(B_TRANSLATE("Wildcard value like \"*spam*\".\n"
|
||||||
"*spam*)"), NULL);
|
"Prefix with \"REGEX:\" in order to use regular expressions."));
|
||||||
fRegexControl->SetText(settings.Expression());
|
fRegexControl->SetText(settings.Expression());
|
||||||
|
|
||||||
fFileControl = new FileControl("arg", NULL,
|
fFileControl = new FileControl("arg", NULL,
|
||||||
@@ -108,14 +109,8 @@ RuleFilterConfig::RuleFilterConfig(const BMailAddOnSettings& addOnSettings)
|
|||||||
item->SetMarked(true);
|
item->SetMarked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
fAccountField = new BMenuField("reply", "Foo", fAccountMenu);
|
fAccountField = new BMenuField("reply", B_TRANSLATE("Account"),
|
||||||
if (fAction >= 0) {
|
fAccountMenu);
|
||||||
BMenuItem* item = fActionMenu->ItemAt(fAction);
|
|
||||||
if (item != NULL) {
|
|
||||||
item->SetMarked(true);
|
|
||||||
MessageReceived(item->Message());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Popuplate action menu
|
// Popuplate action menu
|
||||||
|
|
||||||
@@ -140,6 +135,13 @@ RuleFilterConfig::RuleFilterConfig(const BMailAddOnSettings& addOnSettings)
|
|||||||
|
|
||||||
BMenuField* actionField = new BMenuField("action", B_TRANSLATE("Then"),
|
BMenuField* actionField = new BMenuField("action", B_TRANSLATE("Then"),
|
||||||
fActionMenu);
|
fActionMenu);
|
||||||
|
if (fAction >= 0) {
|
||||||
|
BMenuItem* item = fActionMenu->ItemAt(fAction);
|
||||||
|
if (item != NULL) {
|
||||||
|
item->SetMarked(true);
|
||||||
|
MessageReceived(item->Message());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Build layout
|
// Build layout
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user