void ToolBarActionProvider::networkCreated(NetworkId id) {
  const Network *net = Client::network(id);
  Action *act = new Action(net->networkName(), this);
  _networkActions[id] = act;
  act->setObjectName(QString("NetworkAction-%1").arg(id.toInt()));
  act->setData(QVariant::fromValue<NetworkId>(id));
  connect(net, SIGNAL(updatedRemotely()), SLOT(networkUpdated()));
  connect(act, SIGNAL(triggered()), SLOT(connectOrDisconnectNet()));
  networkUpdated(net);
}
CoreDccConfig::CoreDccConfig(CoreSession *session)
    : DccConfig(session)
    , _coreSession{session}
{
    // Load config from database if it exists
    auto configMap = Core::getUserSetting(session->user(), settingsKey).toMap();
    if (!configMap.isEmpty())
        update(configMap);
    // Otherwise, we just use the defaults initialized in the base class

    // We store our settings whenever they change
    connect(this, SIGNAL(updatedRemotely()), SLOT(save()));
}
CoreHighlightRuleManager::CoreHighlightRuleManager(CoreSession *parent)
    : HighlightRuleManager(parent)
{
    CoreSession *session = qobject_cast<CoreSession*>(parent);
    if (!session) {
        qWarning() << "CoreHighlightRuleManager: unable to load HighlightRuleList. Parent is not a Coresession!";
        //loadDefaults();
        return;
    }

    initSetHighlightRuleList(Core::getUserSetting(session->user(), "HighlightRuleList").toMap());

    // we store our settings whenever they change
    connect(this, SIGNAL(updatedRemotely()), SLOT(save()));
}
Beispiel #4
0
CoreAliasManager::CoreAliasManager(CoreSession *parent)
    : AliasManager(parent)
{
    CoreSession *session = qobject_cast<CoreSession *>(parent);
    if (!session) {
        qWarning() << "CoreAliasManager: unable to load Aliases. Parent is not a Coresession!";
        loadDefaults();
        return;
    }

    initSetAliases(Core::getUserSetting(session->user(), "Aliases").toMap());
    if (isEmpty())
        loadDefaults();

    // we store our settings whenever they change
    connect(this, SIGNAL(updatedRemotely()), SLOT(save()));
}
ClientIgnoreListManager::ClientIgnoreListManager(QObject *parent)
    : IgnoreListManager(parent)
{
    connect(this, SIGNAL(updatedRemotely()), SIGNAL(ignoreListChanged()));
}