From a8574e9d75f65f0ee36739efa42b4890a9adde30 Mon Sep 17 00:00:00 2001 From: Nathan Whitehorn Date: Sat, 30 Oct 2004 01:39:17 +0000 Subject: [PATCH] Fixed a crashing bug that would occur when you switched between preferences tabs while adding a Match Header filter. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9656 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../mail_daemon/inbound_filters/match_header/ConfigView.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/add-ons/mail_daemon/inbound_filters/match_header/ConfigView.cpp b/src/add-ons/mail_daemon/inbound_filters/match_header/ConfigView.cpp index ba8d2e100c..7613df054b 100644 --- a/src/add-ons/mail_daemon/inbound_filters/match_header/ConfigView.cpp +++ b/src/add-ons/mail_daemon/inbound_filters/match_header/ConfigView.cpp @@ -42,7 +42,7 @@ class RuleFilterConfig : public BView { #include -RuleFilterConfig::RuleFilterConfig(BMessage *settings) : BView(BRect(0,0,260,85),"rulefilter_config", B_FOLLOW_LEFT | B_FOLLOW_TOP, 0) { +RuleFilterConfig::RuleFilterConfig(BMessage *settings) : BView(BRect(0,0,260,85),"rulefilter_config", B_FOLLOW_LEFT | B_FOLLOW_TOP, 0), menu(NULL) { SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); attr = new BTextControl(BRect(5,5,100,20),"attr",MDR_DIALECT_CHOICE ("If","条件:"),MDR_DIALECT_CHOICE ("header (e.g. Subject)","ヘッダ(例えばSubject)"),NULL); attr->SetDivider(be_plain_font->StringWidth(MDR_DIALECT_CHOICE ("If ","条件: "))+ 4); @@ -86,6 +86,9 @@ RuleFilterConfig::RuleFilterConfig(BMessage *settings) : BView(BRect(0,0,260,85) void RuleFilterConfig::AttachedToWindow() { + if (menu != NULL) + return; // We switched back from another tab + menu = new BPopUpMenu(MDR_DIALECT_CHOICE ("","<動作を選択>")); menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Move To","移動する"), new BMessage(kMsgActionMoveTo))); menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Set Flags To","フラグを指定する"), new BMessage(kMsgActionSetTo)));