Add workspace-switching and window-raising options

This commit is contained in:
Jaidyn Ann 2021-08-19 02:00:11 -05:00
parent 38e9fca3be
commit da8b0236c5
4 changed files with 15 additions and 20 deletions

View File

@ -145,6 +145,18 @@ Conversation::ImMessage(BMessage* msg)
}
}
// Misc. features Caya contributors planned on adding
BWindow* mainWin = ((TheApp*)be_app)->GetMainWindow();
if (win == NULL && AppPreferences::Get()->MarkUnreadWindow == true)
mainWin->SetTitle(BString(mainWin->Title()).Prepend("[!]"));
if (win == NULL && AppPreferences::Get()->MoveToCurrentWorkspace)
mainWin->SetWorkspaces(B_CURRENT_WORKSPACE);
if (win == NULL && AppPreferences::Get()->RaiseOnMessageReceived)
mainWin->Activate(true);
// If unattached, highlight the ConversationItem
if (win == NULL && mentioned == true)
NotifyInteger(INT_NEW_MENTION, fNotifyMentionCount);

View File

@ -35,11 +35,11 @@ AppPreferences::Load()
MoveToCurrentWorkspace = settings.GetBool("MoveToCurrentWorkpace", false);
RaiseOnMessageReceived = settings.GetBool("RaiseOnMessageReceived", false);
MarkUnreadWindow = settings.GetBool("MarkUnreadWindow", true);
MarkUnreadWindow = settings.GetBool("MarkUnreadWindow", false);
NotifyProtocolStatus = settings.GetBool("NotifyProtocolStatus", true);
NotifyNewMessage = settings.GetBool("NotifyNewMessage", true);
NotifyContactStatus = settings.GetBool("NotifyContactStatus", false);
SoundOnMessageReceived = settings.GetBool("SoundOnMessageReceived", false);
SoundOnMessageReceived = settings.GetBool("SoundOnMessageReceived", true);
SoundOnMention = settings.GetBool("SoundOnMention", true);
HideDeskbar = settings.GetBool("HideDeskbar", false);
DisableReplicant = settings.GetBool("DisableReplicant", true);

View File

@ -24,7 +24,6 @@ const uint32 kToCurrentWorkspace = 'CBcw';
const uint32 kRaiseOnMessageReceived = 'FCmr';
const uint32 kRaiseUserIsTyping = 'FCit';
const uint32 kMarkUnreadWindow = 'MKuw';
const uint32 kHideOffline = 'HiOf';
const uint32 kDisablePrompt = 'DiPr';
@ -34,25 +33,17 @@ PreferencesBehavior::PreferencesBehavior()
BBox* incomingBox = new BBox("incoming");
incomingBox->SetLabel(B_TRANSLATE("On incoming" B_UTF8_ELLIPSIS));
fHideOffline = new BCheckBox("HideOfflineContacts",
B_TRANSLATE("Hide offline contacts"),
new BMessage(kHideOffline));
fHideOffline->SetEnabled(false); //not implemented as yet
fToCurrentWorkspace = new BCheckBox("ToCurrentWorkspace",
B_TRANSLATE("Move window to current workspace"),
new BMessage(kToCurrentWorkspace));
fToCurrentWorkspace->SetEnabled(false); // not this either
fRaiseOnMessageReceived = new BCheckBox("FocusOnMessageReceived",
B_TRANSLATE("Auto-raise when a message is received"),
new BMessage(kRaiseOnMessageReceived));
fRaiseOnMessageReceived->SetEnabled(false); // nor this
fMarkUnreadWindow = new BCheckBox("MarkUnreadWindow",
B_TRANSLATE("Mark unread window chat"),
new BMessage(kMarkUnreadWindow));
fMarkUnreadWindow->SetEnabled(false); // of unimplemented settings!
BBox* generalBox = new BBox("general");
generalBox->SetLabel(B_TRANSLATE("General"));
@ -70,7 +61,6 @@ PreferencesBehavior::PreferencesBehavior()
BLayoutBuilder::Group<>(incomingBox, B_VERTICAL)
.SetInsets(spacing, spacing * 2, spacing, spacing)
.Add(fHideOffline)
.Add(fToCurrentWorkspace)
.Add(fRaiseOnMessageReceived)
.Add(fMarkUnreadWindow)
@ -88,13 +78,11 @@ PreferencesBehavior::PreferencesBehavior()
void
PreferencesBehavior::AttachedToWindow()
{
fHideOffline->SetTarget(this);
fToCurrentWorkspace->SetTarget(this);
fRaiseOnMessageReceived->SetTarget(this);
fMarkUnreadWindow->SetTarget(this);
fDisableQuitConfirm->SetTarget(this);
fHideOffline->SetValue(
AppPreferences::Get()->HideOffline);
fToCurrentWorkspace->SetValue(
AppPreferences::Get()->MoveToCurrentWorkspace);
fRaiseOnMessageReceived->SetValue(
@ -110,10 +98,6 @@ void
PreferencesBehavior::MessageReceived(BMessage* message)
{
switch (message->what) {
case kHideOffline:
AppPreferences::Get()->HideOffline
= fHideOffline->Value();
break;
case kToCurrentWorkspace:
AppPreferences::Get()->MoveToCurrentWorkspace
= fToCurrentWorkspace->Value();

View File

@ -19,7 +19,6 @@ public:
private:
BCheckBox* fHideOffline;
BCheckBox* fToCurrentWorkspace;
BCheckBox* fRaiseOnMessageReceived;
BCheckBox* fMarkUnreadWindow;