예제 #1
0
// Handles an incoming resource message for this media processing object.
// Returns TRUE if the message was handled, otherwise FALSE.
UtlBoolean MpResource::handleMessage(MpResourceMsg& rMsg)
{
   UtlBoolean msgHandled = FALSE;

   // Do stuff for resource messages.
   msgHandled = TRUE; // assume we'll handle the msg
   switch (rMsg.getMsg())
   {
   case MpResourceMsg::MPRM_RESOURCE_DISABLE:   // disable this resource
      msgHandled = handleDisable();
      break;
   case MpResourceMsg::MPRM_RESOURCE_ENABLE:    // enable this resource
      msgHandled = handleEnable();
      break;
   case MpResourceMsg::MPRM_DISABLE_ALL_NOTIFICATIONS:
      // Disable all notifications sent out from this resource.
      setNotificationsEnabled(FALSE);
      break;
   case MpResourceMsg::MPRM_ENABLE_ALL_NOTIFICATIONS:
      // Enable all notifications sent out from this resource.
      setNotificationsEnabled(TRUE);
      break;
   default:
      msgHandled = FALSE; // we didn't handle the msg after all
      break;
   }

   return msgHandled;
}
 ServerGroupSettings& Konversation::ServerGroupSettings::operator=(const ServerGroupSettings& settings)
 {
     setName(settings.name());
     setServerList(settings.serverList());
     setIdentityId(settings.identityId());
     setChannelList(settings.channelList());
     setConnectCommands(settings.connectCommands());
     setAutoConnectEnabled(settings.autoConnectEnabled());
     setNotificationsEnabled(settings.enableNotifications());
     setExpanded(settings.expanded());
     m_id = settings.id();
     m_sortIndex = settings.sortIndex();
     return *this;
 }
 ChannelSettings::ChannelSettings(const QString& name, const QString& password, bool enableNotifications)
 {
     setName(name);
     setPassword(password);
     setNotificationsEnabled(enableNotifications);
 }
 ChannelSettings::ChannelSettings(const QString& name)
 {
     setName(name);
     setNotificationsEnabled(true);
 }
 ChannelSettings::ChannelSettings(const ChannelSettings& settings)
 {
     setName(settings.name());
     setPassword(settings.password());
     setNotificationsEnabled(settings.enableNotifications());
 }
 ChannelSettings::ChannelSettings()
 {
     setNotificationsEnabled(true);
 }