2010-05-07 04:47:10 -05:00
|
|
|
/*
|
|
|
|
* Copyright 2009-2010, Pier Luigi Fiorini. All rights reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Pier Luigi Fiorini, pierluigi.fiorini@gmail.com
|
|
|
|
*/
|
|
|
|
|
Explicitly tie Conversations, Contacts, and Users to their ProtocolLoopers
Previously, all Conversations/Contacts/Users were stored in the Server,
each in their respective KeyMaps, identified solely by their
identifiers. This leads to the glaring problem of overlap― if the user
has multiple accounts, some users/rooms might be used or present in multiple
accounts at the same time.
Now, each accounts' Contacts, Conversations, and Users are stored in
its ProtocolLooper, making this overlap impossible. An oversight of only
allowing one user identifier to be stored (fMySelf) in Server was also fixed
this way.
This is the bulk of the work required for multi-account support― now,
the user can join the same XMPP room on two seperate accounts, and it
works perfectly.
2021-06-10 15:16:43 -05:00
|
|
|
#include "PreferencesWindow.h"
|
|
|
|
|
2010-05-07 04:47:10 -05:00
|
|
|
#include <Button.h>
|
|
|
|
#include <ControlLook.h>
|
2010-10-24 01:27:09 -05:00
|
|
|
#include <LayoutBuilder.h>
|
2010-05-07 04:47:10 -05:00
|
|
|
#include <TabView.h>
|
|
|
|
|
|
|
|
#include "PreferencesAccounts.h"
|
2010-05-19 13:05:30 -05:00
|
|
|
#include "PreferencesBehavior.h"
|
2012-03-01 20:23:21 -06:00
|
|
|
#include "PreferencesChatWindow.h"
|
2012-03-08 16:55:13 -06:00
|
|
|
#include "PreferencesReplicant.h"
|
2010-05-07 04:47:10 -05:00
|
|
|
|
Explicitly tie Conversations, Contacts, and Users to their ProtocolLoopers
Previously, all Conversations/Contacts/Users were stored in the Server,
each in their respective KeyMaps, identified solely by their
identifiers. This leads to the glaring problem of overlap― if the user
has multiple accounts, some users/rooms might be used or present in multiple
accounts at the same time.
Now, each accounts' Contacts, Conversations, and Users are stored in
its ProtocolLooper, making this overlap impossible. An oversight of only
allowing one user identifier to be stored (fMySelf) in Server was also fixed
this way.
This is the bulk of the work required for multi-account support― now,
the user can join the same XMPP room on two seperate accounts, and it
works perfectly.
2021-06-10 15:16:43 -05:00
|
|
|
|
2010-05-09 01:27:48 -05:00
|
|
|
const uint32 kApply = 'SAVE';
|
2010-05-07 04:47:10 -05:00
|
|
|
|
|
|
|
|
Explicitly tie Conversations, Contacts, and Users to their ProtocolLoopers
Previously, all Conversations/Contacts/Users were stored in the Server,
each in their respective KeyMaps, identified solely by their
identifiers. This leads to the glaring problem of overlap― if the user
has multiple accounts, some users/rooms might be used or present in multiple
accounts at the same time.
Now, each accounts' Contacts, Conversations, and Users are stored in
its ProtocolLooper, making this overlap impossible. An oversight of only
allowing one user identifier to be stored (fMySelf) in Server was also fixed
this way.
This is the bulk of the work required for multi-account support― now,
the user can join the same XMPP room on two seperate accounts, and it
works perfectly.
2021-06-10 15:16:43 -05:00
|
|
|
PreferencesWindow::PreferencesWindow()
|
2015-10-01 23:17:54 -05:00
|
|
|
: BWindow(BRect(0, 0, 500, 615), "Preferences", B_TITLED_WINDOW,
|
2010-05-07 04:47:10 -05:00
|
|
|
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_CLOSE_ON_ESCAPE)
|
|
|
|
{
|
|
|
|
BTabView* tabView = new BTabView("tabView", B_WIDTH_AS_USUAL);
|
|
|
|
tabView->AddTab(new PreferencesAccounts());
|
2010-05-19 13:05:30 -05:00
|
|
|
tabView->AddTab(new PreferencesBehavior());
|
2012-03-01 20:23:21 -06:00
|
|
|
tabView->AddTab(new PreferencesChatWindow());
|
2012-03-08 16:55:13 -06:00
|
|
|
tabView->AddTab(new PreferencesReplicant());
|
2010-05-07 04:47:10 -05:00
|
|
|
|
2010-05-09 01:27:48 -05:00
|
|
|
BButton* ok = new BButton("OK", new BMessage(kApply));
|
2010-05-07 04:47:10 -05:00
|
|
|
|
2010-10-24 01:27:09 -05:00
|
|
|
BLayoutBuilder::Group<>(this, B_VERTICAL)
|
2010-05-07 04:47:10 -05:00
|
|
|
.Add(tabView)
|
|
|
|
.AddGroup(B_HORIZONTAL)
|
|
|
|
.AddGlue()
|
|
|
|
.Add(ok)
|
2021-05-30 22:04:45 -05:00
|
|
|
.End();
|
2010-05-07 04:47:10 -05:00
|
|
|
|
|
|
|
CenterOnScreen();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
Explicitly tie Conversations, Contacts, and Users to their ProtocolLoopers
Previously, all Conversations/Contacts/Users were stored in the Server,
each in their respective KeyMaps, identified solely by their
identifiers. This leads to the glaring problem of overlap― if the user
has multiple accounts, some users/rooms might be used or present in multiple
accounts at the same time.
Now, each accounts' Contacts, Conversations, and Users are stored in
its ProtocolLooper, making this overlap impossible. An oversight of only
allowing one user identifier to be stored (fMySelf) in Server was also fixed
this way.
This is the bulk of the work required for multi-account support― now,
the user can join the same XMPP room on two seperate accounts, and it
works perfectly.
2021-06-10 15:16:43 -05:00
|
|
|
PreferencesWindow::MessageReceived(BMessage* msg)
|
2010-05-07 04:47:10 -05:00
|
|
|
{
|
|
|
|
switch (msg->what) {
|
2010-05-09 01:27:48 -05:00
|
|
|
case kApply:
|
2010-05-07 04:47:10 -05:00
|
|
|
Close();
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
BWindow::MessageReceived(msg);
|
|
|
|
}
|
|
|
|
}
|
2021-05-30 22:04:45 -05:00
|
|
|
|
|
|
|
|