Replaces libinterface's ToolButton, a custom button that can display
a pop-up menu on click (along with a custom image). It didn't scale well
with different themes and font-sizes compared to BButtons― which
ToolButton is supposed to look like to begin with.
A BButton-derived class is used instead, so these buttons look more
in-place among other buttons.
CreateAccountMenu() is used to populate a BMenu with items corresponding
to the map of accounts provided to it― but when an account is disabled
or enabled, it can't update automatically.
A dedicated class, fAccountsMenu, now replaces it― it'll automatically
repopulate the list whenever the active accounts update.
Since libpurple doesn't mark individual account settings as "required"
or not (Pidgin will accept account settings even with all-blank answers,
unlike Cardie), every setting was marked as required by Cardie, just to
err on the side of caution.
But that's not necessary now, and was bad to begin with (especially for
Jabber, etc, with superfluous options)― in the case of libpurple, we can
follow Pidgin's example. Cardie will accept account settings with
mostly-blank options, but the add-on will send an error (and disable the
account) when it doesn't work.
Currently, add-ons are disconnected when ChatProtocol::Shutdown() is
called, which the add-on can do by itself― but there is no standard way
for add-ons to notify the app about their Shutdown. Because of this,
they tend to not call Shutdown()― instead (as in the case of the Jabber
add-on), they display a BAlert (IM_ERROR) notifying the user of the
connection error, but the account is considered active by Cardie (and
its threads are still existant, including its ProtocolLooper).
Zombies are bad, so this is redesigned somewhat with this commit:
Protocols should no longer call ChatProtocol::Shutdown() themselves,
they must send an IM_MESSAGE of IM_PROTOCOL_DISABLE to the app.
This will delete its ProtocolLooper, which in turn will send a
notification to the user and delete the ChatProtocol, and so
calling ChatProtocol::Shutdown().
In the included protocols, an IM_ERROR is sent right before
IM_PROTOCOL_DISABLE is sent if due to a connection error. This is not
required, but it is courteous to inform your user about the "why." :)
Like the notification sent when accounts are ready (IM_PROTOCOL_READY),
one's been added for when accounds have disconnected/are disabled:
IM_PROTOCOL_DISABLED.
Also, error BAlerts (created with IM_ERROR messages) are now more
detailed, showing the associated accounts' name in the header.
Connection errors are now sent to Cardie through an IM_ERROR message
(which appear in a BAlert), and an IM_PROTOCOL_DISABLED IM_MESSAGE is
sent to Cardie when the account is disabled/connection fails.
When a new message is posted (or the user is messaged), the room's item
in the roomlist is now highlighted, like Vision.
Chat also auto-scrolls when new messages are posted.
If the user's in a one-on-one chat, notify on every message― otherwise,
only notify when the user's name/ID is mentioned by another user.
Notifications should be managed by roomflags, but that's for another
time.
Base-level replacement of the Vision-derived text RunView― a couple
important features supported by the replacee haven't been implemented yet,
including:
* Right-click menu
* URL-highlighting/selection
* Emote support
The StatusView (below the roomlist) now shows a default icon if no
accounts have associated avatars, and will use an account's cached avatar
if available.
The BTextBox used for sending messages has been moved from the main
window to individual ConversationViews, allowing seperate histories,
texts, etc., to exist in different conversations.
EditingFilter (a filter that hooked into MainWindow) was previously used
to field special key combos with this textbox, including "ENTER" for
sending, but this has been replaced with a new textview subclass
(SendTextView).
Pidgin's icon has been borrowed as the add-on's icon― and protocol icons
are taken from `$DATA_DIR/pixmaps/Pidgin/protocol/`, just as
Pidgin/libpurple installs them.
Any third-party plugins will also install their icons there, even
if just locally.
I've updated the libpurple package to include these icons, hopefully
that'll get merged.