bool ChannelSettings::operator== (const ChannelSettings& channel) const
 {
     if (m_name.toLower() == channel.name().toLower())
         return true;
     else
         return false;
 }
 void ServerGroupSettings::addChannel(const ChannelSettings& channel, const ChannelSettings& before)
 {
     if (before.name().isEmpty())
         m_channelList.append(channel);
     else
         m_channelList.insert(m_channelList.indexOf(before), channel);
 }
Ejemplo n.º 3
0
    void ServerGroupDialog::addChannel()
    {
        QPointer<ChannelDialog> dlg = new ChannelDialog(i18n("Add Channel"), this);

        if(dlg->exec() == KDialog::Accepted)
        {
            ChannelSettings channel = dlg->channelSettings();
            m_mainWidget->m_channelLBox->addItem(channel.name());
            m_mainWidget->m_channelLBox->setCurrentItem(m_mainWidget->m_channelLBox->item(m_mainWidget->m_channelLBox->count() - 1));
            m_channelList.append(channel);
        }
        delete dlg;
    }
Ejemplo n.º 4
0
    void ServerGroupDialog::moveChannelDown()
    {
        int current = m_mainWidget->m_channelLBox->currentRow();

        if(current < (m_channelList.count() - 1))
        {
            ChannelSettings channel = m_channelList[current];
            delete m_mainWidget->m_channelLBox->takeItem(current);
            m_mainWidget->m_channelLBox->insertItem(current + 1, channel.name());
            m_mainWidget->m_channelLBox->setCurrentRow(current + 1);
            m_channelList.move(current, current + 1);
        }

        updateChannelArrows();
    }
    void ServerGroupSettings::appendChannelHistory(const ChannelSettings& channel)
    {
        ChannelList::iterator endIt = m_channelHistory.end();

        for(ChannelList::iterator it = m_channelHistory.begin(); it != endIt; ++it)
        {
            if(channel.name() == (*it).name())
            {
                (*it).setPassword(channel.password());
                (*it).setNotificationsEnabled(channel.enableNotifications());
                return;
            }
        }

        m_channelHistory.append(channel);
    }
Ejemplo n.º 6
0
    void ServerGroupDialog::editChannel()
    {
        int current = m_mainWidget->m_channelLBox->currentRow();

        if(current < m_channelList.count())
        {
            QPointer<ChannelDialog> dlg = new ChannelDialog(i18n("Edit Channel"), this);
            dlg->setChannelSettings(m_channelList[current]);

            if(dlg->exec() == KDialog::Accepted)
            {
                ChannelSettings channel = dlg->channelSettings();
                m_mainWidget->m_channelLBox->item(current)->setText(channel.name());
                m_channelList[current] = channel;
            }
            delete dlg;
        }
    }
 ChannelSettings::ChannelSettings(const ChannelSettings& settings)
 {
     setName(settings.name());
     setPassword(settings.password());
     setNotificationsEnabled(settings.enableNotifications());
 }
Ejemplo n.º 8
0
 void ChannelDialog::setChannelSettings(const ChannelSettings& channel)
 {
     m_channelEdit->setText(channel.name());
     m_passwordEdit->setText(channel.password());
 }