diff --git a/application/CayaConstants.h b/application/CayaConstants.h index 83d389c..adb8f50 100644 --- a/application/CayaConstants.h +++ b/application/CayaConstants.h @@ -31,9 +31,10 @@ enum CayaStatus { CAYA_ONLINE = 1, CAYA_AWAY = 2, CAYA_DO_NOT_DISTURB = 3, - CAYA_OFFLINE = 4, - CAYA_EXTENDED_AWAY = 5, - CAYA_STATUSES = 6 + CAYA_CUSTOM_STATUS = 4, + CAYA_INVISIBLE = 5, + CAYA_OFFLINE = 6, + CAYA_STATUSES = 7 }; #endif // _CAYA_CONSTANTS_H diff --git a/application/CayaUtils.cpp b/application/CayaUtils.cpp index a8a8350..2dd01b2 100644 --- a/application/CayaUtils.cpp +++ b/application/CayaUtils.cpp @@ -24,14 +24,16 @@ CayaStatusToString(CayaStatus status) switch (status) { case CAYA_ONLINE: return "Available"; - case CAYA_OFFLINE: - return "Offline"; case CAYA_AWAY: return "Away"; - case CAYA_EXTENDED_AWAY: - return "Custom Status"; case CAYA_DO_NOT_DISTURB: return "Busy"; + case CAYA_CUSTOM_STATUS: + return "Custom Status"; + case CAYA_INVISIBLE: + return "Invisible"; + case CAYA_OFFLINE: + return "Offline"; default: return NULL; } diff --git a/application/ChatWindow.cpp b/application/ChatWindow.cpp index cfc0bf7..86e4cd5 100644 --- a/application/ChatWindow.cpp +++ b/application/ChatWindow.cpp @@ -242,13 +242,18 @@ ChatWindow::AppendStatus(CayaStatus status) case CAYA_ONLINE: message << " is available"; break; - case CAYA_EXTENDED_AWAY: case CAYA_AWAY: message << " is away"; break; case CAYA_DO_NOT_DISTURB: message << " is busy, please do not disturb!"; break; + case CAYA_CUSTOM_STATUS: + message << " has set a custom status."; + break; + case CAYA_INVISIBLE: + message << " is invisible."; + break; case CAYA_OFFLINE: message << " is offline"; break; diff --git a/application/TheApp.cpp b/application/TheApp.cpp index 70976ac..5824703 100644 --- a/application/TheApp.cpp +++ b/application/TheApp.cpp @@ -109,7 +109,7 @@ TheApp::AboutRequested() AboutWindow* about = new AboutWindow("Caya", holders, authors, extraInfo.String()); about->Show(); - //delete about; + delete about; } @@ -123,7 +123,6 @@ TheApp::GetMainWindow() const void TheApp::MessageReceived(BMessage* message) { - //message->PrintToStream(); switch (message->what) { case CAYA_REPLICANT_STATUS_SET: case CAYA_REPLICANT_SHOW_WINDOW: diff --git a/application/views/ContactInfoWindow.cpp b/application/views/ContactInfoWindow.cpp index c9404ea..8c2a8be 100644 --- a/application/views/ContactInfoWindow.cpp +++ b/application/views/ContactInfoWindow.cpp @@ -24,6 +24,7 @@ #include "ContactLinker.h" #include "CayaConstants.h" #include "CayaRenderView.h" +#include "CayaUtils.h" #include "NotifyMessage.h" #include "ContactInfoWindow.h" @@ -45,24 +46,7 @@ ContactInfoWindow::ContactInfoWindow(ContactLinker* linker) fPersonalMessage->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); BString status(fContactLinker->GetName()); - - switch (fContactLinker->GetNotifyStatus()) { - case CAYA_ONLINE: - status << " is available"; - break; - case CAYA_EXTENDED_AWAY: - case CAYA_AWAY: - status << " is away"; - break; - case CAYA_DO_NOT_DISTURB: - status << " is busy, please do not disturb!"; - break; - case CAYA_OFFLINE: - status << " is offline"; - break; - default: - break; - } + status << CayaStatusToString(fContactLinker->GetNotifyStatus()); status << "\n\n ID : "; status << fContactLinker->GetId(); diff --git a/application/views/ReplicantMenuItem.cpp b/application/views/ReplicantMenuItem.cpp index 8ab8024..2652e54 100644 --- a/application/views/ReplicantMenuItem.cpp +++ b/application/views/ReplicantMenuItem.cpp @@ -67,15 +67,16 @@ ReplicantMenuItem::SetIcon() case CAYA_ONLINE: num = kOnlineReplicant; break; - case CAYA_EXTENDED_AWAY: - num = kCayaIconReplicant; - break; case CAYA_AWAY: num = kAwayReplicant; break; case CAYA_DO_NOT_DISTURB: num = kBusyReplicant; break; + case CAYA_CUSTOM_STATUS: + num = kCayaIconReplicant; + break; + case CAYA_INVISIBLE: case CAYA_OFFLINE: num = kOfflineReplicant; break; diff --git a/application/views/ReplicantStatusView.cpp b/application/views/ReplicantStatusView.cpp index 808ce27..712e8a9 100644 --- a/application/views/ReplicantStatusView.cpp +++ b/application/views/ReplicantStatusView.cpp @@ -153,12 +153,13 @@ ReplicantStatusView::SetStatus(CayaStatus status) case CAYA_AWAY: fIcon = fAwayIcon; break; - case CAYA_EXTENDED_AWAY: - fIcon = fCayaIcon; - break; case CAYA_DO_NOT_DISTURB: fIcon = fBusyIcon; break; + case CAYA_CUSTOM_STATUS: + fIcon = fCayaIcon; + break; + case CAYA_INVISIBLE: case CAYA_OFFLINE: fIcon = fOfflineIcon; break; diff --git a/application/views/RosterItem.cpp b/application/views/RosterItem.cpp index 3e8aa87..aa78a88 100644 --- a/application/views/RosterItem.cpp +++ b/application/views/RosterItem.cpp @@ -112,64 +112,29 @@ void RosterItem::DrawItem(BView* owner, BRect frame, bool complete) owner->FillRect(frame); } - /*BResources* res = CayaResources(); - if (res) { - int32 num = 0; - - switch (fStatus) { - case CAYA_ONLINE: - num = kOnlineReplicant; - break; - case CAYA_EXTENDED_AWAY: - num = kCayaIconReplicant; - break; - case CAYA_AWAY: - num = kAwayReplicant; - break; - case CAYA_DO_NOT_DISTURB: - num = kBusyReplicant; - break; - case CAYA_OFFLINE: - num = kOfflineReplicant; - break; - default: + // Draw contact status + switch (fStatus) { + case CAYA_ONLINE: + owner->SetHighColor(CAYA_GREEN_COLOR); break; + case CAYA_CUSTOM_STATUS: + case CAYA_AWAY: + owner->SetHighColor(CAYA_ORANGE_COLOR); + break; + case CAYA_DO_NOT_DISTURB: + owner->SetHighColor(CAYA_RED_COLOR); + break; + case CAYA_INVISIBLE: + case CAYA_OFFLINE: + break; + default: + break; } - BBitmap* bitmap = IconFromResources(res, num, B_MINI_ICON); - BRect bitmapRect(frame.left + 40, frame.top + fBaselineOffset - 10, - frame.left + 55, frame.top + 18); - - owner->SetDrawingMode(B_OP_ALPHA); - owner->SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY); - owner->DrawBitmap(bitmap, bitmap->Bounds(), - bitmapRect, B_FILTER_BITMAP_BILINEAR); - - delete res; - } else {*/ - // Draw contact status - switch (fStatus) { - case CAYA_ONLINE: - owner->SetHighColor(CAYA_GREEN_COLOR); - break; - case CAYA_EXTENDED_AWAY: - case CAYA_AWAY: - owner->SetHighColor(CAYA_ORANGE_COLOR); - break; - case CAYA_DO_NOT_DISTURB: - owner->SetHighColor(CAYA_RED_COLOR); - break; - case CAYA_OFFLINE: - break; - default: - break; - } - - owner->FillRect(BRect(frame.left, - frame.top, - frame.left + 5, frame.top + h - 1 - )); - //} + owner->FillRect(BRect(frame.left, + frame.top, + frame.left + 5, frame.top + h - 1 + )); // Draw avatar icon if (fBitmap != NULL) { diff --git a/application/views/StatusMenuItem.cpp b/application/views/StatusMenuItem.cpp index 669509e..5dc1dd5 100644 --- a/application/views/StatusMenuItem.cpp +++ b/application/views/StatusMenuItem.cpp @@ -64,15 +64,16 @@ StatusMenuItem::SetIcon() case CAYA_ONLINE: num = kOnlineReplicant; break; - case CAYA_EXTENDED_AWAY: - num = kCayaIconReplicant; - break; case CAYA_AWAY: num = kAwayReplicant; break; case CAYA_DO_NOT_DISTURB: num = kBusyReplicant; break; + case CAYA_CUSTOM_STATUS: + num = kCayaIconReplicant; + break; + case CAYA_INVISIBLE: case CAYA_OFFLINE: num = kOfflineReplicant; break;