Disable unusable settings, Notfications tab
This commit is contained in:
parent
6e89dbdab1
commit
901f7a8e05
|
@ -51,9 +51,9 @@ SRCS = \
|
||||||
application/preferences/AccountDialog.cpp \
|
application/preferences/AccountDialog.cpp \
|
||||||
application/preferences/AccountListItem.cpp \
|
application/preferences/AccountListItem.cpp \
|
||||||
application/preferences/AppPreferences.cpp \
|
application/preferences/AppPreferences.cpp \
|
||||||
application/preferences/PreferencesChatWindow.cpp \
|
|
||||||
application/preferences/PreferencesBehavior.cpp \
|
application/preferences/PreferencesBehavior.cpp \
|
||||||
application/preferences/PreferencesReplicant.cpp \
|
application/preferences/PreferencesChatWindow.cpp \
|
||||||
|
application/preferences/PreferencesNotifications.cpp \
|
||||||
application/views/AccountsMenu.cpp \
|
application/views/AccountsMenu.cpp \
|
||||||
application/views/AccountMenuItem.cpp \
|
application/views/AccountMenuItem.cpp \
|
||||||
application/views/RenderView.cpp \
|
application/views/RenderView.cpp \
|
||||||
|
|
|
@ -35,11 +35,12 @@ AppPreferences::Load()
|
||||||
|
|
||||||
MoveToCurrentWorkspace = settings.GetBool("MoveToCurrentWorkpace", false);
|
MoveToCurrentWorkspace = settings.GetBool("MoveToCurrentWorkpace", false);
|
||||||
RaiseOnMessageReceived = settings.GetBool("RaiseOnMessageReceived", false);
|
RaiseOnMessageReceived = settings.GetBool("RaiseOnMessageReceived", false);
|
||||||
RaiseUserIsTyping = settings.GetBool("RaiseUserIsTyping", false);
|
|
||||||
MarkUnreadWindow = settings.GetBool("MarkUnreadWindow", true);
|
MarkUnreadWindow = settings.GetBool("MarkUnreadWindow", true);
|
||||||
NotifyProtocolStatus = settings.GetBool("NotifyProtocolStatus", true);
|
NotifyProtocolStatus = settings.GetBool("NotifyProtocolStatus", true);
|
||||||
NotifyNewMessage = settings.GetBool("NotifyNewMessage", true);
|
NotifyNewMessage = settings.GetBool("NotifyNewMessage", true);
|
||||||
NotifyContactStatus = settings.GetBool("NotifyContactStatus", false);
|
NotifyContactStatus = settings.GetBool("NotifyContactStatus", false);
|
||||||
|
SoundOnMessageReceived = settings.GetBool("SoundOnMessageReceived", false);
|
||||||
|
SoundOnMention = settings.GetBool("SoundOnMention", true);
|
||||||
HideDeskbar = settings.GetBool("HideDeskbar", false);
|
HideDeskbar = settings.GetBool("HideDeskbar", false);
|
||||||
DisableReplicant = settings.GetBool("DisableReplicant", true);
|
DisableReplicant = settings.GetBool("DisableReplicant", true);
|
||||||
DisableQuitConfirm = settings.GetBool("DisableQuitConfirm", false);
|
DisableQuitConfirm = settings.GetBool("DisableQuitConfirm", false);
|
||||||
|
@ -67,11 +68,12 @@ AppPreferences::Save()
|
||||||
BMessage settings;
|
BMessage settings;
|
||||||
settings.AddBool("MoveToCurrentWorkpace", MoveToCurrentWorkspace);
|
settings.AddBool("MoveToCurrentWorkpace", MoveToCurrentWorkspace);
|
||||||
settings.AddBool("RaiseOnMessageReceived", RaiseOnMessageReceived);
|
settings.AddBool("RaiseOnMessageReceived", RaiseOnMessageReceived);
|
||||||
settings.AddBool("RaiseUserIsTyping", RaiseUserIsTyping);
|
|
||||||
settings.AddBool("MarkUnreadWindow", MarkUnreadWindow);
|
settings.AddBool("MarkUnreadWindow", MarkUnreadWindow);
|
||||||
settings.AddBool("NotifyProtocolStatus", NotifyProtocolStatus);
|
settings.AddBool("NotifyProtocolStatus", NotifyProtocolStatus);
|
||||||
settings.AddBool("NotifyNewMessage", NotifyNewMessage);
|
settings.AddBool("NotifyNewMessage", NotifyNewMessage);
|
||||||
settings.AddBool("NotifyContactStatus", NotifyContactStatus);
|
settings.AddBool("NotifyContactStatus", NotifyContactStatus);
|
||||||
|
settings.AddBool("SoundOnMessageReceived", SoundOnMessageReceived);
|
||||||
|
settings.AddBool("SoundOnMention", SoundOnMention);
|
||||||
settings.AddBool("HideDeskbar", HideDeskbar);
|
settings.AddBool("HideDeskbar", HideDeskbar);
|
||||||
settings.AddBool("DisableReplicant", DisableReplicant);
|
settings.AddBool("DisableReplicant", DisableReplicant);
|
||||||
settings.AddBool("DisableQuitConfirm", DisableQuitConfirm);
|
settings.AddBool("DisableQuitConfirm", DisableQuitConfirm);
|
||||||
|
|
|
@ -20,11 +20,13 @@ public:
|
||||||
|
|
||||||
bool MoveToCurrentWorkspace;
|
bool MoveToCurrentWorkspace;
|
||||||
bool RaiseOnMessageReceived;
|
bool RaiseOnMessageReceived;
|
||||||
bool RaiseUserIsTyping;
|
|
||||||
bool MarkUnreadWindow;
|
bool MarkUnreadWindow;
|
||||||
|
|
||||||
bool NotifyProtocolStatus;
|
bool NotifyProtocolStatus;
|
||||||
bool NotifyContactStatus;
|
bool NotifyContactStatus;
|
||||||
bool NotifyNewMessage;
|
bool NotifyNewMessage;
|
||||||
|
bool SoundOnMessageReceived;
|
||||||
|
bool SoundOnMention;
|
||||||
|
|
||||||
bool HideDeskbar;
|
bool HideDeskbar;
|
||||||
bool DisableReplicant;
|
bool DisableReplicant;
|
||||||
|
|
|
@ -23,9 +23,6 @@
|
||||||
const uint32 kToCurrentWorkspace = 'CBcw';
|
const uint32 kToCurrentWorkspace = 'CBcw';
|
||||||
const uint32 kRaiseOnMessageReceived = 'FCmr';
|
const uint32 kRaiseOnMessageReceived = 'FCmr';
|
||||||
const uint32 kRaiseUserIsTyping = 'FCit';
|
const uint32 kRaiseUserIsTyping = 'FCit';
|
||||||
const uint32 kNotifyProtocolsLogin = 'NTpl';
|
|
||||||
const uint32 kNotifyContactStatus = 'NTcl';
|
|
||||||
const uint32 kNotifyNewMessage = 'NTms';
|
|
||||||
const uint32 kMarkUnreadWindow = 'MKuw';
|
const uint32 kMarkUnreadWindow = 'MKuw';
|
||||||
const uint32 kHideOffline = 'HiOf';
|
const uint32 kHideOffline = 'HiOf';
|
||||||
const uint32 kDisablePrompt = 'DiPr';
|
const uint32 kDisablePrompt = 'DiPr';
|
||||||
|
@ -40,47 +37,22 @@ PreferencesBehavior::PreferencesBehavior()
|
||||||
fHideOffline = new BCheckBox("HideOfflineContacts",
|
fHideOffline = new BCheckBox("HideOfflineContacts",
|
||||||
B_TRANSLATE("Hide offline contacts"),
|
B_TRANSLATE("Hide offline contacts"),
|
||||||
new BMessage(kHideOffline));
|
new BMessage(kHideOffline));
|
||||||
|
fHideOffline->SetEnabled(false); //not implemented as yet
|
||||||
|
|
||||||
fToCurrentWorkspace = new BCheckBox("ToCurrentWorkspace",
|
fToCurrentWorkspace = new BCheckBox("ToCurrentWorkspace",
|
||||||
B_TRANSLATE("Move window to current workspace"),
|
B_TRANSLATE("Move window to current workspace"),
|
||||||
new BMessage(kToCurrentWorkspace));
|
new BMessage(kToCurrentWorkspace));
|
||||||
|
fToCurrentWorkspace->SetEnabled(false); // not this either
|
||||||
|
|
||||||
fRaiseOnMessageReceived = new BCheckBox("FocusOnMessageReceived",
|
fRaiseOnMessageReceived = new BCheckBox("FocusOnMessageReceived",
|
||||||
B_TRANSLATE("Auto-raise when a message is received"),
|
B_TRANSLATE("Auto-raise when a message is received"),
|
||||||
new BMessage(kRaiseOnMessageReceived));
|
new BMessage(kRaiseOnMessageReceived));
|
||||||
|
fRaiseOnMessageReceived->SetEnabled(false); // nor this
|
||||||
fRaiseUserIsTyping = new BCheckBox("FocusUserIsTyping",
|
|
||||||
B_TRANSLATE("Auto-raise when user is typing"),
|
|
||||||
new BMessage(kRaiseUserIsTyping));
|
|
||||||
|
|
||||||
fPlaySoundOnMessageReceived = new BCheckBox("PlaySoundOnMessageReceived",
|
|
||||||
B_TRANSLATE("Play sound event"), NULL);
|
|
||||||
fPlaySoundOnMessageReceived->SetEnabled(false); // not implemented
|
|
||||||
|
|
||||||
fMarkUnreadWindow = new BCheckBox("MarkUnreadWindow",
|
fMarkUnreadWindow = new BCheckBox("MarkUnreadWindow",
|
||||||
B_TRANSLATE("Mark unread window chat"),
|
B_TRANSLATE("Mark unread window chat"),
|
||||||
new BMessage(kMarkUnreadWindow));
|
new BMessage(kMarkUnreadWindow));
|
||||||
/*fMarkUnreadWindow->SetEnabled(false); implementing it right now*/
|
fMarkUnreadWindow->SetEnabled(false); // of unimplemented settings!
|
||||||
|
|
||||||
fMarkUnreadReplicant = new BCheckBox("MarkUnreadReplicant",
|
|
||||||
B_TRANSLATE("Mark unread the Deskbar Replicant"), NULL);
|
|
||||||
fMarkUnreadReplicant->SetEnabled(false);
|
|
||||||
// not implemented
|
|
||||||
|
|
||||||
BBox* notificationBox = new BBox("notificationBox");
|
|
||||||
notificationBox->SetLabel(B_TRANSLATE("Deskbar notifications"));
|
|
||||||
|
|
||||||
fNotifyProtocols = new BCheckBox("EnableProtocolNotify",
|
|
||||||
B_TRANSLATE("Enable protocol status notifications"),
|
|
||||||
new BMessage(kNotifyProtocolsLogin));
|
|
||||||
|
|
||||||
fNotifyContactStatus = new BCheckBox("EnableContactNotify",
|
|
||||||
B_TRANSLATE("Enable contact status notifications"),
|
|
||||||
new BMessage(kNotifyContactStatus));
|
|
||||||
|
|
||||||
fNotifyNewMessage = new BCheckBox("EnableMessageNotify",
|
|
||||||
B_TRANSLATE("Enable message notifications"),
|
|
||||||
new BMessage(kNotifyNewMessage));
|
|
||||||
|
|
||||||
BBox* generalBox = new BBox("general");
|
BBox* generalBox = new BBox("general");
|
||||||
generalBox->SetLabel(B_TRANSLATE("General"));
|
generalBox->SetLabel(B_TRANSLATE("General"));
|
||||||
|
@ -101,24 +73,13 @@ PreferencesBehavior::PreferencesBehavior()
|
||||||
.Add(fHideOffline)
|
.Add(fHideOffline)
|
||||||
.Add(fToCurrentWorkspace)
|
.Add(fToCurrentWorkspace)
|
||||||
.Add(fRaiseOnMessageReceived)
|
.Add(fRaiseOnMessageReceived)
|
||||||
.Add(fRaiseUserIsTyping)
|
|
||||||
.Add(fMarkUnreadWindow)
|
.Add(fMarkUnreadWindow)
|
||||||
.Add(fMarkUnreadReplicant)
|
|
||||||
.Add(fPlaySoundOnMessageReceived)
|
|
||||||
.End();
|
|
||||||
|
|
||||||
BLayoutBuilder::Group<>(notificationBox, B_VERTICAL)
|
|
||||||
.SetInsets(spacing, spacing * 2, spacing, spacing)
|
|
||||||
.Add(fNotifyProtocols)
|
|
||||||
.Add(fNotifyContactStatus)
|
|
||||||
.Add(fNotifyNewMessage)
|
|
||||||
.End();
|
.End();
|
||||||
|
|
||||||
BLayoutBuilder::Group<>(this, B_VERTICAL)
|
BLayoutBuilder::Group<>(this, B_VERTICAL)
|
||||||
.SetInsets(B_USE_DEFAULT_SPACING)
|
.SetInsets(B_USE_DEFAULT_SPACING)
|
||||||
.Add(generalBox)
|
.Add(generalBox)
|
||||||
.Add(incomingBox)
|
.Add(incomingBox)
|
||||||
.Add(notificationBox)
|
|
||||||
.AddGlue()
|
.AddGlue()
|
||||||
.End();
|
.End();
|
||||||
}
|
}
|
||||||
|
@ -129,29 +90,17 @@ PreferencesBehavior::AttachedToWindow()
|
||||||
{
|
{
|
||||||
fHideOffline->SetTarget(this);
|
fHideOffline->SetTarget(this);
|
||||||
fToCurrentWorkspace->SetTarget(this);
|
fToCurrentWorkspace->SetTarget(this);
|
||||||
fRaiseUserIsTyping->SetTarget(this);
|
|
||||||
fRaiseOnMessageReceived->SetTarget(this);
|
fRaiseOnMessageReceived->SetTarget(this);
|
||||||
fNotifyProtocols->SetTarget(this);
|
|
||||||
fNotifyContactStatus->SetTarget(this);
|
|
||||||
fNotifyNewMessage->SetTarget(this);
|
|
||||||
fDisableQuitConfirm->SetTarget(this);
|
fDisableQuitConfirm->SetTarget(this);
|
||||||
|
|
||||||
fHideOffline->SetValue(
|
fHideOffline->SetValue(
|
||||||
AppPreferences::Get()->HideOffline);
|
AppPreferences::Get()->HideOffline);
|
||||||
fToCurrentWorkspace->SetValue(
|
fToCurrentWorkspace->SetValue(
|
||||||
AppPreferences::Get()->MoveToCurrentWorkspace);
|
AppPreferences::Get()->MoveToCurrentWorkspace);
|
||||||
fRaiseUserIsTyping->SetValue(
|
|
||||||
AppPreferences::Get()->RaiseUserIsTyping);
|
|
||||||
fRaiseOnMessageReceived->SetValue(
|
fRaiseOnMessageReceived->SetValue(
|
||||||
AppPreferences::Get()->RaiseOnMessageReceived);
|
AppPreferences::Get()->RaiseOnMessageReceived);
|
||||||
fMarkUnreadWindow->SetValue(
|
fMarkUnreadWindow->SetValue(
|
||||||
AppPreferences::Get()->MarkUnreadWindow);
|
AppPreferences::Get()->MarkUnreadWindow);
|
||||||
fNotifyProtocols->SetValue(
|
|
||||||
AppPreferences::Get()->NotifyProtocolStatus);
|
|
||||||
fNotifyContactStatus->SetValue(
|
|
||||||
AppPreferences::Get()->NotifyContactStatus);
|
|
||||||
fNotifyNewMessage->SetValue(
|
|
||||||
AppPreferences::Get()->NotifyNewMessage);
|
|
||||||
fDisableQuitConfirm->SetValue(
|
fDisableQuitConfirm->SetValue(
|
||||||
AppPreferences::Get()->DisableQuitConfirm);
|
AppPreferences::Get()->DisableQuitConfirm);
|
||||||
}
|
}
|
||||||
|
@ -173,22 +122,6 @@ PreferencesBehavior::MessageReceived(BMessage* message)
|
||||||
AppPreferences::Get()->RaiseOnMessageReceived
|
AppPreferences::Get()->RaiseOnMessageReceived
|
||||||
= fRaiseOnMessageReceived->Value();
|
= fRaiseOnMessageReceived->Value();
|
||||||
break;
|
break;
|
||||||
case kRaiseUserIsTyping:
|
|
||||||
AppPreferences::Get()->RaiseUserIsTyping
|
|
||||||
= fRaiseUserIsTyping->Value();
|
|
||||||
break;
|
|
||||||
case kNotifyProtocolsLogin:
|
|
||||||
AppPreferences::Get()->NotifyProtocolStatus
|
|
||||||
= fNotifyProtocols->Value();
|
|
||||||
break;
|
|
||||||
case kNotifyContactStatus:
|
|
||||||
AppPreferences::Get()->NotifyContactStatus
|
|
||||||
= fNotifyContactStatus->Value();
|
|
||||||
break;
|
|
||||||
case kNotifyNewMessage:
|
|
||||||
AppPreferences::Get()->NotifyNewMessage
|
|
||||||
= fNotifyNewMessage->Value();
|
|
||||||
break;
|
|
||||||
case kMarkUnreadWindow:
|
case kMarkUnreadWindow:
|
||||||
AppPreferences::Get()->MarkUnreadWindow
|
AppPreferences::Get()->MarkUnreadWindow
|
||||||
= fMarkUnreadWindow->Value();
|
= fMarkUnreadWindow->Value();
|
||||||
|
|
|
@ -22,16 +22,9 @@ private:
|
||||||
BCheckBox* fHideOffline;
|
BCheckBox* fHideOffline;
|
||||||
BCheckBox* fToCurrentWorkspace;
|
BCheckBox* fToCurrentWorkspace;
|
||||||
BCheckBox* fRaiseOnMessageReceived;
|
BCheckBox* fRaiseOnMessageReceived;
|
||||||
BCheckBox* fRaiseUserIsTyping;
|
|
||||||
BCheckBox* fPlaySoundOnMessageReceived;
|
|
||||||
BCheckBox* fMarkUnreadWindow;
|
BCheckBox* fMarkUnreadWindow;
|
||||||
BCheckBox* fMarkUnreadReplicant;
|
|
||||||
|
|
||||||
BCheckBox* fDisableQuitConfirm;
|
BCheckBox* fDisableQuitConfirm;
|
||||||
|
|
||||||
BCheckBox* fNotifyProtocols;
|
|
||||||
BCheckBox* fNotifyContactStatus;
|
|
||||||
BCheckBox* fNotifyNewMessage;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _PREFERENCES_BEHAVIOR_H
|
#endif // _PREFERENCES_BEHAVIOR_H
|
||||||
|
|
|
@ -31,7 +31,7 @@ PreferencesChatWindow::PreferencesChatWindow()
|
||||||
|
|
||||||
fIgnoreEmoticons = new BCheckBox("IgnoreEmoticons",
|
fIgnoreEmoticons = new BCheckBox("IgnoreEmoticons",
|
||||||
B_TRANSLATE("Ignore emoticons"), new BMessage(kIgnoreEmoticons));
|
B_TRANSLATE("Ignore emoticons"), new BMessage(kIgnoreEmoticons));
|
||||||
fIgnoreEmoticons->SetEnabled(true);
|
fIgnoreEmoticons->SetEnabled(false); // No emoticon support currently
|
||||||
|
|
||||||
const float spacing = be_control_look->DefaultItemSpacing();
|
const float spacing = be_control_look->DefaultItemSpacing();
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,134 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2010, Oliver Ruiz Dorantes. All rights reserved.
|
||||||
|
* Copyright 2012, Dario Casalinuovo. All rights reserved.
|
||||||
|
* Copyright 2021, Jaidyn Levesque. All rights reserved.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "PreferencesNotifications.h"
|
||||||
|
|
||||||
|
#include <Box.h>
|
||||||
|
#include <Catalog.h>
|
||||||
|
#include <CheckBox.h>
|
||||||
|
#include <ControlLook.h>
|
||||||
|
#include <LayoutBuilder.h>
|
||||||
|
|
||||||
|
#include "AppPreferences.h"
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATION_CONTEXT
|
||||||
|
#define B_TRANSLATION_CONTEXT "PreferencesNotifications"
|
||||||
|
|
||||||
|
|
||||||
|
const uint32 kNotifyProtocolsLogin = 'NTpl';
|
||||||
|
const uint32 kNotifyContactStatus = 'NTcl';
|
||||||
|
const uint32 kNotifyNewMessage = 'NTms';
|
||||||
|
const uint32 kSoundOnMessageReceived = 'Fmsn';
|
||||||
|
const uint32 kSoundOnMention = 'FMsn';
|
||||||
|
|
||||||
|
|
||||||
|
PreferencesNotifications::PreferencesNotifications()
|
||||||
|
: BView(B_TRANSLATE("Notifications"), B_WILL_DRAW)
|
||||||
|
{
|
||||||
|
BBox* notificationBox = new BBox("notificationBox");
|
||||||
|
notificationBox->SetLabel(B_TRANSLATE("Notifications"));
|
||||||
|
|
||||||
|
fNotifyProtocols = new BCheckBox("EnableProtocolNotify",
|
||||||
|
B_TRANSLATE("Enable protocol status notifications"),
|
||||||
|
new BMessage(kNotifyProtocolsLogin));
|
||||||
|
|
||||||
|
fNotifyContactStatus = new BCheckBox("EnableContactNotify",
|
||||||
|
B_TRANSLATE("Enable contact status notifications"),
|
||||||
|
new BMessage(kNotifyContactStatus));
|
||||||
|
fNotifyContactStatus->SetEnabled(false); // not even this! dear god…
|
||||||
|
|
||||||
|
fNotifyNewMessage = new BCheckBox("EnableMessageNotify",
|
||||||
|
B_TRANSLATE("Enable message notifications"),
|
||||||
|
new BMessage(kNotifyNewMessage));
|
||||||
|
|
||||||
|
BBox* soundsBox = new BBox("soundsBox");
|
||||||
|
soundsBox->SetLabel(B_TRANSLATE("Sounds"));
|
||||||
|
|
||||||
|
fSoundOnMessageReceived = new BCheckBox("SoundOnMessageReceived",
|
||||||
|
B_TRANSLATE("Sound on message received"), NULL);
|
||||||
|
fSoundOnMessageReceived->SetEnabled(false); // wow that's a lot
|
||||||
|
|
||||||
|
fSoundOnMention = new BCheckBox("SoundOnMention",
|
||||||
|
B_TRANSLATE("Sound when mentioned"), NULL);
|
||||||
|
fSoundOnMention->SetEnabled(false); // wow that's a lot
|
||||||
|
|
||||||
|
const float spacing = be_control_look->DefaultItemSpacing();
|
||||||
|
|
||||||
|
|
||||||
|
BLayoutBuilder::Group<>(notificationBox, B_VERTICAL)
|
||||||
|
.SetInsets(spacing, spacing * 2, spacing, spacing)
|
||||||
|
.Add(fNotifyProtocols)
|
||||||
|
.Add(fNotifyContactStatus)
|
||||||
|
.Add(fNotifyNewMessage)
|
||||||
|
.End();
|
||||||
|
|
||||||
|
BLayoutBuilder::Group<>(soundsBox, B_VERTICAL)
|
||||||
|
.SetInsets(spacing, spacing * 2, spacing, spacing)
|
||||||
|
.Add(fSoundOnMessageReceived)
|
||||||
|
.Add(fSoundOnMention)
|
||||||
|
.End();
|
||||||
|
|
||||||
|
BLayoutBuilder::Group<>(this, B_VERTICAL)
|
||||||
|
.SetInsets(B_USE_DEFAULT_SPACING)
|
||||||
|
.Add(notificationBox)
|
||||||
|
.Add(soundsBox)
|
||||||
|
.AddGlue()
|
||||||
|
.End();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
PreferencesNotifications::AttachedToWindow()
|
||||||
|
{
|
||||||
|
fNotifyProtocols->SetTarget(this);
|
||||||
|
fNotifyContactStatus->SetTarget(this);
|
||||||
|
fNotifyNewMessage->SetTarget(this);
|
||||||
|
fSoundOnMessageReceived->SetTarget(this);
|
||||||
|
fSoundOnMention->SetTarget(this);
|
||||||
|
|
||||||
|
fNotifyProtocols->SetValue(
|
||||||
|
AppPreferences::Get()->NotifyProtocolStatus);
|
||||||
|
fNotifyContactStatus->SetValue(
|
||||||
|
AppPreferences::Get()->NotifyContactStatus);
|
||||||
|
fNotifyNewMessage->SetValue(
|
||||||
|
AppPreferences::Get()->NotifyNewMessage);
|
||||||
|
fSoundOnMessageReceived->SetValue(
|
||||||
|
AppPreferences::Get()->SoundOnMessageReceived);
|
||||||
|
fSoundOnMention->SetValue(
|
||||||
|
AppPreferences::Get()->SoundOnMention);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
PreferencesNotifications::MessageReceived(BMessage* message)
|
||||||
|
{
|
||||||
|
switch (message->what) {
|
||||||
|
case kNotifyProtocolsLogin:
|
||||||
|
AppPreferences::Get()->NotifyProtocolStatus
|
||||||
|
= fNotifyProtocols->Value();
|
||||||
|
break;
|
||||||
|
case kNotifyContactStatus:
|
||||||
|
AppPreferences::Get()->NotifyContactStatus
|
||||||
|
= fNotifyContactStatus->Value();
|
||||||
|
break;
|
||||||
|
case kNotifyNewMessage:
|
||||||
|
AppPreferences::Get()->NotifyNewMessage
|
||||||
|
= fNotifyNewMessage->Value();
|
||||||
|
break;
|
||||||
|
case kSoundOnMessageReceived:
|
||||||
|
AppPreferences::Get()->SoundOnMessageReceived
|
||||||
|
= fSoundOnMessageReceived->Value();
|
||||||
|
break;
|
||||||
|
case kSoundOnMention:
|
||||||
|
AppPreferences::Get()->SoundOnMention
|
||||||
|
= fSoundOnMention->Value();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
BView::MessageReceived(message);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2010, Oliver Ruiz Dorantes. All rights reserved.
|
||||||
|
* Copyright 2012, Dario Casalinuovo. All rights reserved.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
#ifndef _PREFERENCES_NOTIFICATIONS_H
|
||||||
|
#define _PREFERENCES_NOTIFICATIONS_H
|
||||||
|
|
||||||
|
#include <View.h>
|
||||||
|
|
||||||
|
class BCheckBox;
|
||||||
|
|
||||||
|
class PreferencesNotifications : public BView {
|
||||||
|
public:
|
||||||
|
PreferencesNotifications();
|
||||||
|
|
||||||
|
virtual void AttachedToWindow();
|
||||||
|
virtual void MessageReceived(BMessage* msg);
|
||||||
|
|
||||||
|
private:
|
||||||
|
BCheckBox* fNotifyProtocols;
|
||||||
|
BCheckBox* fNotifyContactStatus;
|
||||||
|
BCheckBox* fNotifyNewMessage;
|
||||||
|
BCheckBox* fSoundOnMessageReceived;
|
||||||
|
BCheckBox* fSoundOnMention;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _PREFERENCES_BEHAVIOR_H
|
|
@ -35,6 +35,7 @@ PreferencesReplicant::PreferencesReplicant()
|
||||||
fDisableReplicant = new BCheckBox("DisableReplicant",
|
fDisableReplicant = new BCheckBox("DisableReplicant",
|
||||||
B_TRANSLATE("Disable deskbar replicant"),
|
B_TRANSLATE("Disable deskbar replicant"),
|
||||||
new BMessage(kDisableReplicant));
|
new BMessage(kDisableReplicant));
|
||||||
|
fDisableReplicant->SetEnabled(false); // Replicant is broken currently
|
||||||
|
|
||||||
if (!AppPreferences::Get()->HideDeskbar)
|
if (!AppPreferences::Get()->HideDeskbar)
|
||||||
Looper()->PostMessage(new BMessage(kDisableReplicant));
|
Looper()->PostMessage(new BMessage(kDisableReplicant));
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
#include "PreferencesBehavior.h"
|
#include "PreferencesBehavior.h"
|
||||||
#include "PreferencesChatWindow.h"
|
#include "PreferencesChatWindow.h"
|
||||||
#include "PreferencesReplicant.h"
|
#include "PreferencesNotifications.h"
|
||||||
|
|
||||||
|
|
||||||
#undef B_TRANSLATION_CONTEXT
|
#undef B_TRANSLATION_CONTEXT
|
||||||
|
@ -34,7 +34,7 @@ PreferencesWindow::PreferencesWindow()
|
||||||
BTabView* tabView = new BTabView("tabView", B_WIDTH_AS_USUAL);
|
BTabView* tabView = new BTabView("tabView", B_WIDTH_AS_USUAL);
|
||||||
tabView->AddTab(new PreferencesBehavior());
|
tabView->AddTab(new PreferencesBehavior());
|
||||||
tabView->AddTab(new PreferencesChatWindow());
|
tabView->AddTab(new PreferencesChatWindow());
|
||||||
tabView->AddTab(new PreferencesReplicant());
|
tabView->AddTab(new PreferencesNotifications());
|
||||||
|
|
||||||
// Tab resizing here is a bit wonky. We want each tab to be visible,
|
// Tab resizing here is a bit wonky. We want each tab to be visible,
|
||||||
// but we don't want the tab-view to be too wide…
|
// but we don't want the tab-view to be too wide…
|
||||||
|
|
Ŝarĝante…
Reference in New Issue