diff --git a/src/AutoTextControl.cpp b/src/AutoTextControl.cpp index c98da4c..d03d4c4 100644 --- a/src/AutoTextControl.cpp +++ b/src/AutoTextControl.cpp @@ -199,3 +199,9 @@ AutoTextControlFilter::SetMessenger(BMessenger* msgr) delete fMessenger; fMessenger = msgr; } + +BMessenger* +AutoTextControlFilter::GetMessenger() +{ + return fMessenger; +} \ No newline at end of file diff --git a/src/AutoTextControl.h b/src/AutoTextControl.h index 4991d3a..f573a24 100644 --- a/src/AutoTextControl.h +++ b/src/AutoTextControl.h @@ -74,6 +74,7 @@ class AutoTextControlFilter : public BMessageFilter { void SendMessage(BMessage* msg); void SetMessenger(BMessenger* msgr); + BMessenger* GetMessenger(); private: AutoTextControl* fBox; diff --git a/src/CategoryBox.cpp b/src/CategoryBox.cpp index cc82e07..bbbbdf1 100644 --- a/src/CategoryBox.cpp +++ b/src/CategoryBox.cpp @@ -140,7 +140,8 @@ CategoryBox::SetTypeFromCategory(BString category) } bool success = true; - if (!categoryExists) + if (!categoryExists + && category.ICompare(B_TRANSLATE_CONTEXT("Split transaction", "CommonTerms")) != 0) bool success = AddNewCategory(category); return success; diff --git a/src/CategoryButton.cpp b/src/CategoryButton.cpp index 8b0eee4..63dd662 100644 --- a/src/CategoryButton.cpp +++ b/src/CategoryButton.cpp @@ -1,6 +1,7 @@ #include "CategoryButton.h" #include "Database.h" #include "MainWindow.h" +#include "SplitView.h" #include #include @@ -58,8 +59,13 @@ CategoryButton::MessageReceived(BMessage* msg) BString category; msg->FindString("category", &category); fCategoryBox->SetText(category); - fCategoryBox->Validate(); + bool success = fCategoryBox->Validate(); + if (success) { + BMessenger* msgr(fCategoryBox->GetFilter()->GetMessenger()); + BMessage notice(M_SPLIT_CATEGORY_CHANGED); + msgr->SendMessage(¬ice); + } break; } default: