Fix some style violations.
This commit is contained in:
parent
c67f1936c0
commit
4412809657
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
|
|
||||||
AboutWindow::AboutWindow(const char* appName, const char** holders,
|
AboutWindow::AboutWindow(const char* appName, const char** holders,
|
||||||
const char** authors, const char* extraInfo)
|
const char** authors, const char* extraInfo)
|
||||||
{
|
{
|
||||||
fAppName = new BString(appName);
|
fAppName = new BString(appName);
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
class AboutWindow {
|
class AboutWindow {
|
||||||
public:
|
public:
|
||||||
AboutWindow(const char* appName, const char** holders,
|
AboutWindow(const char* appName, const char** holders,
|
||||||
const char** authors, const char* extraInfo = NULL);
|
const char** authors, const char* extraInfo = NULL);
|
||||||
virtual ~AboutWindow();
|
virtual ~AboutWindow();
|
||||||
|
|
||||||
void Show();
|
void Show();
|
||||||
|
|
|
@ -17,8 +17,9 @@
|
||||||
|
|
||||||
|
|
||||||
Account::Account(bigtime_t instanceId, CayaProtocol* cayap,
|
Account::Account(bigtime_t instanceId, CayaProtocol* cayap,
|
||||||
const char* name, BHandler* target)
|
const char* name, BHandler* target)
|
||||||
: fIdentifier(instanceId),
|
:
|
||||||
|
fIdentifier(instanceId),
|
||||||
fName(name),
|
fName(name),
|
||||||
fProtocol(cayap),
|
fProtocol(cayap),
|
||||||
fMessenger(target),
|
fMessenger(target),
|
||||||
|
@ -59,9 +60,9 @@ Account::Name() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
Account::SendMessage(BMessage* message)
|
Account::SendMessage(BMessage* message)
|
||||||
{
|
{
|
||||||
message->AddInt64("instance", fIdentifier);
|
message->AddInt64("instance", fIdentifier);
|
||||||
return fMessenger.SendMessage(message);
|
return fMessenger.SendMessage(message);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,8 @@ static AccountManager* fInstance = NULL;
|
||||||
|
|
||||||
|
|
||||||
AccountManager::AccountManager()
|
AccountManager::AccountManager()
|
||||||
: fStatus(CAYA_OFFLINE)
|
:
|
||||||
|
fStatus(CAYA_OFFLINE)
|
||||||
{
|
{
|
||||||
TheApp* theApp = reinterpret_cast<TheApp*>(be_app);
|
TheApp* theApp = reinterpret_cast<TheApp*>(be_app);
|
||||||
RegisterObserver(theApp->GetMainWindow());
|
RegisterObserver(theApp->GetMainWindow());
|
||||||
|
|
|
@ -16,7 +16,8 @@
|
||||||
|
|
||||||
|
|
||||||
CayaProtocolAddOn::CayaProtocolAddOn(image_id image, const char* path)
|
CayaProtocolAddOn::CayaProtocolAddOn(image_id image, const char* path)
|
||||||
: fImage(image),
|
:
|
||||||
|
fImage(image),
|
||||||
fPath(path),
|
fPath(path),
|
||||||
fIcon(NULL)
|
fIcon(NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,7 +33,8 @@
|
||||||
|
|
||||||
|
|
||||||
ChatWindow::ChatWindow(ContactLinker* cl)
|
ChatWindow::ChatWindow(ContactLinker* cl)
|
||||||
: BWindow(BRect(200, 200, 500, 500),
|
:
|
||||||
|
BWindow(BRect(200, 200, 500, 500),
|
||||||
cl->GetName().String(), B_DOCUMENT_WINDOW, 0),
|
cl->GetName().String(), B_DOCUMENT_WINDOW, 0),
|
||||||
fContactLinker(cl)
|
fContactLinker(cl)
|
||||||
{
|
{
|
||||||
|
@ -77,7 +78,7 @@ ChatWindow::QuitRequested()
|
||||||
void
|
void
|
||||||
ChatWindow::MessageReceived(BMessage* message)
|
ChatWindow::MessageReceived(BMessage* message)
|
||||||
{
|
{
|
||||||
switch(message->what) {
|
switch (message->what) {
|
||||||
case CAYA_CHAT:
|
case CAYA_CHAT:
|
||||||
{
|
{
|
||||||
BString message = fSendView->Text();
|
BString message = fSendView->Text();
|
||||||
|
@ -122,10 +123,10 @@ ChatWindow::ImMessage(BMessage* msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ChatWindow::ObserveString(int32 what, BString str)
|
ChatWindow::ObserveString(int32 what, BString str)
|
||||||
{
|
{
|
||||||
switch(what) {
|
switch (what) {
|
||||||
case STR_CONTACT_NAME:
|
case STR_CONTACT_NAME:
|
||||||
if (Lock()){
|
if (Lock()){
|
||||||
SetTitle(str);
|
SetTitle(str);
|
||||||
|
@ -139,7 +140,7 @@ ChatWindow::ObserveString(int32 what, BString str)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ChatWindow::ObservePointer(int32 what, void* ptr)
|
ChatWindow::ObservePointer(int32 what, void* ptr)
|
||||||
{
|
{
|
||||||
switch (what) {
|
switch (what) {
|
||||||
|
@ -149,7 +150,7 @@ ChatWindow::ObservePointer(int32 what, void* ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ChatWindow::ObserveInteger(int32 what, int32 val)
|
ChatWindow::ObserveInteger(int32 what, int32 val)
|
||||||
{
|
{
|
||||||
switch (what) {
|
switch (what) {
|
||||||
|
@ -168,25 +169,25 @@ ChatWindow::AppendStatus(CayaStatus status)
|
||||||
{
|
{
|
||||||
BString message(fContactLinker->GetName());
|
BString message(fContactLinker->GetName());
|
||||||
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case CAYA_ONLINE:
|
case CAYA_ONLINE:
|
||||||
message << " is available";
|
message << " is available";
|
||||||
break;
|
break;
|
||||||
case CAYA_EXTENDED_AWAY:
|
case CAYA_EXTENDED_AWAY:
|
||||||
case CAYA_AWAY:
|
case CAYA_AWAY:
|
||||||
message << " is away";
|
message << " is away";
|
||||||
break;
|
break;
|
||||||
case CAYA_DO_NOT_DISTURB:
|
case CAYA_DO_NOT_DISTURB:
|
||||||
message << " is busy, please do not disturb!";
|
message << " is busy, please do not disturb!";
|
||||||
break;
|
break;
|
||||||
case CAYA_OFFLINE:
|
case CAYA_OFFLINE:
|
||||||
message << " is offline";
|
message << " is offline";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
fReceiveView->Append(message.String(), COL_TEXT, COL_TEXT, R_TEXT);
|
fReceiveView->Append(message.String(), COL_TEXT, COL_TEXT, R_TEXT);
|
||||||
fReceiveView->Append("\n", COL_TEXT, COL_TEXT, R_TEXT);
|
fReceiveView->Append("\n", COL_TEXT, COL_TEXT, R_TEXT);
|
||||||
fReceiveView->ScrollToSelection();
|
fReceiveView->ScrollToSelection();
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,8 @@
|
||||||
#include "CayaPreferences.h"
|
#include "CayaPreferences.h"
|
||||||
|
|
||||||
ContactLinker::ContactLinker(BString id, BMessenger msgn)
|
ContactLinker::ContactLinker(BString id, BMessenger msgn)
|
||||||
: fChatWindow(NULL),
|
:
|
||||||
|
fChatWindow(NULL),
|
||||||
fID(id),
|
fID(id),
|
||||||
fName(id),
|
fName(id),
|
||||||
fMessenger(msgn),
|
fMessenger(msgn),
|
||||||
|
|
|
@ -15,7 +15,8 @@
|
||||||
|
|
||||||
|
|
||||||
EditingFilter::EditingFilter(BTextView* view)
|
EditingFilter::EditingFilter(BTextView* view)
|
||||||
: BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE, B_KEY_DOWN, NULL),
|
:
|
||||||
|
BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE, B_KEY_DOWN, NULL),
|
||||||
_view(view)
|
_view(view)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,8 +23,8 @@ ImageCache::ImageCache()
|
||||||
|
|
||||||
ImageCache::~ImageCache()
|
ImageCache::~ImageCache()
|
||||||
{
|
{
|
||||||
while(m_bitmaps.CountItems()) {
|
while (m_bitmaps.CountItems()) {
|
||||||
BBitmap* bit=m_bitmaps.ValueFor(0);
|
BBitmap* bit = m_bitmaps.ValueFor(0);
|
||||||
delete bit;
|
delete bit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include "TheApp.h"
|
#include "TheApp.h"
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char* argv[])
|
main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,14 +44,15 @@
|
||||||
#include "Server.h"
|
#include "Server.h"
|
||||||
#include "StatusView.h"
|
#include "StatusView.h"
|
||||||
|
|
||||||
const uint32 kLogin = 'LOGI';
|
const uint32 kLogin = 'LOGI';
|
||||||
const uint32 kSearchContact = 'SRCH';
|
const uint32 kSearchContact = 'SRCH';
|
||||||
|
|
||||||
const uint32 kPreferences = 'WPRF';
|
const uint32 kPreferences = 'WPRF';
|
||||||
|
|
||||||
|
|
||||||
MainWindow::MainWindow()
|
MainWindow::MainWindow()
|
||||||
: BWindow(BRect(0, 0, 300, 400), "Caya", B_DOCUMENT_WINDOW, 0)
|
:
|
||||||
|
BWindow(BRect(0, 0, 300, 400), "Caya", B_DOCUMENT_WINDOW, 0)
|
||||||
{
|
{
|
||||||
fStatusView = new StatusView("statusView");
|
fStatusView = new StatusView("statusView");
|
||||||
|
|
||||||
|
@ -184,7 +185,7 @@ MainWindow::MessageReceived(BMessage* message)
|
||||||
void
|
void
|
||||||
MainWindow::ImError(BMessage* msg)
|
MainWindow::ImError(BMessage* msg)
|
||||||
{
|
{
|
||||||
//FIXME: better error handling..
|
// FIXME: better error handling..
|
||||||
BAlert* alert = new BAlert("Error", msg->FindString("error"), "Ouch!");
|
BAlert* alert = new BAlert("Error", msg->FindString("error"), "Ouch!");
|
||||||
alert->Go();
|
alert->Go();
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ Notifier::UnregisterObserver(Observer* obs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Notifier::NotifyString(int32 what, BString str)
|
Notifier::NotifyString(int32 what, BString str)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < fObserverList.CountItems(); i++)
|
for (int i = 0; i < fObserverList.CountItems(); i++)
|
||||||
|
@ -34,14 +34,15 @@ Notifier::NotifyString(int32 what, BString str)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Notifier::NotifyInteger(int32 what, int32 value)
|
Notifier::NotifyInteger(int32 what, int32 value)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < fObserverList.CountItems(); i++)
|
for (int i = 0; i < fObserverList.CountItems(); i++)
|
||||||
fObserverList.ItemAt(i)->ObserveInteger(what, value);
|
fObserverList.ItemAt(i)->ObserveInteger(what, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
|
void
|
||||||
Notifier::NotifyPointer(int32 what, void* ptr)
|
Notifier::NotifyPointer(int32 what, void* ptr)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < fObserverList.CountItems(); i++)
|
for (int i = 0; i < fObserverList.CountItems(); i++)
|
||||||
|
|
|
@ -15,7 +15,8 @@
|
||||||
|
|
||||||
|
|
||||||
ProtocolLooper::ProtocolLooper(CayaProtocol* protocol)
|
ProtocolLooper::ProtocolLooper(CayaProtocol* protocol)
|
||||||
: BLooper(),
|
:
|
||||||
|
BLooper(),
|
||||||
fProtocol(protocol)
|
fProtocol(protocol)
|
||||||
{
|
{
|
||||||
Account* account = reinterpret_cast<Account*>(
|
Account* account = reinterpret_cast<Account*>(
|
||||||
|
|
|
@ -43,7 +43,8 @@ const float kDividerWidth = 1.0f;
|
||||||
|
|
||||||
|
|
||||||
ProtocolSettings::ProtocolSettings(CayaProtocolAddOn* addOn)
|
ProtocolSettings::ProtocolSettings(CayaProtocolAddOn* addOn)
|
||||||
: fAddOn(addOn),
|
:
|
||||||
|
fAddOn(addOn),
|
||||||
fTemplate(new BMessage())
|
fTemplate(new BMessage())
|
||||||
{
|
{
|
||||||
_Init();
|
_Init();
|
||||||
|
@ -149,9 +150,10 @@ ProtocolSettings::Load(const char* account, BView* parent)
|
||||||
freeText = false;
|
freeText = false;
|
||||||
|
|
||||||
menu = new BPopUpMenu(name);
|
menu = new BPopUpMenu(name);
|
||||||
for (int j = 0; curr.FindString("valid_value", j); j++) {
|
for (int j = 0; curr.FindString("valid_value", j); j++) {
|
||||||
BMenuItem* item
|
BMenuItem* item
|
||||||
= new BMenuItem(curr.FindString("valid_value", j), NULL);
|
= new BMenuItem(curr.FindString("valid_value", j),
|
||||||
|
NULL);
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,11 +248,14 @@ ProtocolSettings::Load(const char* account, BView* parent)
|
||||||
control = new BTextControl(name, _T(desc), value, NULL);
|
control = new BTextControl(name, _T(desc), value, NULL);
|
||||||
if (secret) {
|
if (secret) {
|
||||||
dynamic_cast<BTextControl*>(control)->TextView()->HideTyping(true);
|
dynamic_cast<BTextControl*>(control)->TextView()->HideTyping(true);
|
||||||
dynamic_cast<BTextControl*>(control)->SetText(_T(value));
|
dynamic_cast<BTextControl*>(control)->SetText(
|
||||||
|
_T(value));
|
||||||
}
|
}
|
||||||
dynamic_cast<BTextControl*>(control)->SetDivider(kDividerWidth);
|
dynamic_cast<BTextControl*>(control)->SetDivider(
|
||||||
|
kDividerWidth);
|
||||||
} else {
|
} else {
|
||||||
BStringView* label = new BStringView("NA", _T(desc), B_WILL_DRAW);
|
BStringView* label = new BStringView("NA", _T(desc),
|
||||||
|
B_WILL_DRAW);
|
||||||
layout.Add(label);
|
layout.Add(label);
|
||||||
|
|
||||||
NotifyingTextView* textView
|
NotifyingTextView* textView
|
||||||
|
|
|
@ -28,12 +28,13 @@
|
||||||
|
|
||||||
|
|
||||||
Server::Server()
|
Server::Server()
|
||||||
: BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE)
|
:
|
||||||
|
BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Server::Quit()
|
Server::Quit()
|
||||||
{
|
{
|
||||||
ContactLinker* linker = NULL;
|
ContactLinker* linker = NULL;
|
||||||
|
@ -74,15 +75,6 @@ Server::LoginAll()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
void
|
|
||||||
Server::UpdateSettings(BMessage settings)
|
|
||||||
{
|
|
||||||
fProtocol->Protocol()->UpdateSettings(settings);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Server::SendProtocolMessage(BMessage* msg)
|
Server::SendProtocolMessage(BMessage* msg)
|
||||||
{
|
{
|
||||||
|
@ -123,7 +115,7 @@ Server::Filter(BMessage* message, BHandler **target)
|
||||||
{
|
{
|
||||||
filter_result result = B_DISPATCH_MESSAGE;
|
filter_result result = B_DISPATCH_MESSAGE;
|
||||||
|
|
||||||
switch(message->what) {
|
switch (message->what) {
|
||||||
case IM_MESSAGE_RECEIVED:
|
case IM_MESSAGE_RECEIVED:
|
||||||
{
|
{
|
||||||
BString id = message->FindString("id");
|
BString id = message->FindString("id");
|
||||||
|
@ -249,8 +241,9 @@ Server::ImMessage(BMessage* msg)
|
||||||
entry_ref ref;
|
entry_ref ref;
|
||||||
if (linker) {
|
if (linker) {
|
||||||
if (msg->FindRef("ref", &ref) == B_OK) {
|
if (msg->FindRef("ref", &ref) == B_OK) {
|
||||||
//BPath fullPath(&ref);
|
// BPath fullPath(&ref);
|
||||||
//BBitmap *bitmap = ImageCache::GetImage(BString(fullPath.Path()), BString(fullPath.Path()));
|
// BBitmap* bitmap = ImageCache::GetImage(
|
||||||
|
// BString(fullPath.Path()), BString(fullPath.Path()));
|
||||||
BBitmap *bitmap = BTranslationUtils::GetBitmap(&ref);
|
BBitmap *bitmap = BTranslationUtils::GetBitmap(&ref);
|
||||||
linker->SetNotifyAvatarBitmap(bitmap);
|
linker->SetNotifyAvatarBitmap(bitmap);
|
||||||
} else
|
} else
|
||||||
|
|
|
@ -27,7 +27,8 @@
|
||||||
|
|
||||||
|
|
||||||
TheApp::TheApp()
|
TheApp::TheApp()
|
||||||
: BApplication(CAYA_SIGNATURE),
|
:
|
||||||
|
BApplication(CAYA_SIGNATURE),
|
||||||
fMainWin(NULL)
|
fMainWin(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
WindowsManager* WindowsManager::fInstance = NULL;
|
WindowsManager* WindowsManager::fInstance = NULL;
|
||||||
|
|
||||||
|
|
||||||
WindowsManager::WindowsManager()
|
WindowsManager::WindowsManager()
|
||||||
{
|
{
|
||||||
fCurrentPoint.Set(40.0f, 40.0f);
|
fCurrentPoint.Set(40.0f, 40.0f);
|
||||||
|
|
Ŝarĝante…
Reference in New Issue