Source Code (Use browser search to find items of interest.)

Class Index

empath'EmpathAccountsSettingsDialog (./kdepim/empath/ui/settings/EmpathAccountsSettingsDialog.h:48)

class EmpathAccountsSettingsDialog : public KDialog
{
    Q_OBJECT

    public:
        
        EmpathAccountsSettingsDialog(QWidget * = 0);
        ~EmpathAccountsSettingsDialog();

        void loadData();

    protected slots:

        void s_newPOP();
        void s_newIMAP();
        void s_edit();
        void s_remove();
        
        void s_OK();
        void s_cancel();
        void s_help();
        void s_apply();
        
        void s_updateMailboxList();
        void s_currentChanged(QListViewItem *);

    private:
  
        QListView * lv_accts_;

        bool applied_;

        QPushButton * pb_remove_;
};


empath'EmpathAccountsSettingsDialog::EmpathAccountsSettingsDialog() (./kdepim/empath/ui/settings/EmpathAccountsSettingsDialog.cpp:49)

EmpathAccountsSettingsDialog::EmpathAccountsSettingsDialog(QWidget * parent)
    :   KDialog(parent, "AccountsSettings", true)
{
    setCaption(i18n("Accounts Settings"));

    // Mailbox list
    lv_accts_ = new QListView(this, "lv_accts");

    QWhatsThis::add(lv_accts_, i18n(
            "This is a list of all the accounts (mailboxes)\n"
            "that Empath knows about."));

    lv_accts_->addColumn(i18n("Account Name"));
    lv_accts_->addColumn(i18n("Type"));
    lv_accts_->setAllColumnsShowFocus(true);
    lv_accts_->setFrameStyle(QFrame::Box | QFrame::Sunken);

    // List editing buttons
    KButtonBox * ctrlButtons = new KButtonBox(this, KButtonBox::VERTICAL);
 
    QPushButton * pb_newPOP     = ctrlButtons->addButton(i18n("New &POP3"));
    QPushButton * pb_newIMAP    = ctrlButtons->addButton(i18n("New &IMAP4"));
    QPushButton * pb_edit       = ctrlButtons->addButton(i18n("&Edit"));
    pb_remove_    = ctrlButtons->addButton(i18n("&Remove"));
    
    ctrlButtons->layout();

    // Help, Ok, Cancel buttons
    KButtonBox * buttonBox_ = new KButtonBox(this);
    
    QPushButton * pb_help_  = buttonBox_->addButton(i18n("&Help"));    
   
    buttonBox_->addStretch();
    
    QPushButton * pb_OK_    = buttonBox_->addButton(i18n("&OK"));
    QPushButton * pb_cancel_= buttonBox_->addButton(i18n("&Cancel"));
    
    pb_OK_->setDefault(true);
    
    buttonBox_->layout();

    // Layout
    QVBoxLayout * layout = new QVBoxLayout(this, spacingHint());
    QHBoxLayout * topLayout = new QHBoxLayout(layout);
    
    topLayout->addWidget(lv_accts_);
    topLayout->addWidget(ctrlButtons);
    
    layout->addStretch(10);

    layout->addWidget(new EmpathSeparatorWidget(this));

    layout->addWidget(buttonBox_);

    // Connections
    QObject::connect(pb_newPOP,     SIGNAL(clicked()),    SLOT(s_newPOP()));
    QObject::connect(pb_newIMAP,    SIGNAL(clicked()),    SLOT(s_newIMAP()));
    QObject::connect(pb_edit,       SIGNAL(clicked()),    SLOT(s_edit()));
    QObject::connect(pb_remove_,    SIGNAL(clicked()),    SLOT(s_remove())); 

    QObject::connect(pb_OK_,        SIGNAL(clicked()),    SLOT(s_OK()));
    QObject::connect(pb_cancel_,    SIGNAL(clicked()),    SLOT(s_cancel()));
    QObject::connect(pb_help_,      SIGNAL(clicked()),    SLOT(s_help()));

    QObject::connect(
        empath, SIGNAL(updateFolderLists()), SLOT(s_updateMailboxList()));
    
    QObject::connect(
        lv_accts_, SIGNAL(currentChanged(QListViewItem *)),
        this, SLOT(s_currentChanged(QListViewItem *)));

    QWhatsThis::add(pb_newPOP, i18n(
            "A POP3 mailbox is accessed over a network.\n"
            "You can access one on your own machine if\n"
            "you have a POP3 server program. POP3 mailboxes\n"
            "are read-only. That is, you can only <b>get</b>\n"
            "messages from them, you can't put mail back into\n"
            "them.\n\n"
            "POP3 is the most common mailbox format used by\n"
            "ISPs (Internet Service Providers). It provides\n"
            "a simple mechanism for retrieving messages.\n\n"
            "Note that as 'mbox' format mailboxes are not\n"
            "supported, using a local POP3 server is the only\n"
            "way to retrieve mail from these boxes.\n"));

    QWhatsThis::add(pb_newIMAP, i18n(
            "An IMAP4 mailbox is accessed over a network.\n"
            "You can access one on your own machine if you\n"
            "have an IMAP4 server program."));
}


empath'EmpathAccountsSettingsDialog::~EmpathAccountsSettingsDialog() (./kdepim/empath/ui/settings/EmpathAccountsSettingsDialog.cpp:140)

EmpathAccountsSettingsDialog::~EmpathAccountsSettingsDialog()
{
    // Empty.
}

    void

empath'EmpathAccountsSettingsDialog::s_newPOP() (./kdepim/empath/ui/settings/EmpathAccountsSettingsDialog.cpp:146)

EmpathAccountsSettingsDialog::s_newPOP()
{
    empath->mailboxList()->createNew(EmpathMailbox::POP3);
    s_updateMailboxList();
}

    void

empath'EmpathAccountsSettingsDialog::s_newIMAP() (./kdepim/empath/ui/settings/EmpathAccountsSettingsDialog.cpp:153)

EmpathAccountsSettingsDialog::s_newIMAP()
{
    empath->mailboxList()->createNew(EmpathMailbox::IMAP4);
    s_updateMailboxList();
}

    void

empath'EmpathAccountsSettingsDialog::s_edit() (./kdepim/empath/ui/settings/EmpathAccountsSettingsDialog.cpp:160)

EmpathAccountsSettingsDialog::s_edit()
{
    EmpathURL url;

    url.setMailboxName(lv_accts_->currentItem()->text(0));

    if (url.mailboxName() == 0) {
        empathDebug("Nothing selected");
        return;
    }

    empath->s_configureMailbox(url, this);
}

    void

empath'EmpathAccountsSettingsDialog::loadData() (./kdepim/empath/ui/settings/EmpathAccountsSettingsDialog.cpp:175)

EmpathAccountsSettingsDialog::loadData()
{
    s_updateMailboxList();
}

    void

empath'EmpathAccountsSettingsDialog::s_updateMailboxList() (./kdepim/empath/ui/settings/EmpathAccountsSettingsDialog.cpp:181)

EmpathAccountsSettingsDialog::s_updateMailboxList()
{
    lv_accts_->clear();

    EmpathMailboxListIterator it(*(empath->mailboxList()));

    for (; it.current(); ++it)
        if (it.current()->type() != EmpathMailbox::Maildir)
            new EmpathAccountListItem(lv_accts_, it.current());
}



empath'EmpathAccountsSettingsDialog::s_remove() (./kdepim/empath/ui/settings/EmpathAccountsSettingsDialog.cpp:209)

EmpathAccountsSettingsDialog::s_remove()
{
    EmpathURL u;
    u.setMailboxName(lv_accts_->currentItem()->text(0));
    empath->mailboxList()->remove(u);
}

    void

empath'EmpathAccountsSettingsDialog::s_OK() (./kdepim/empath/ui/settings/EmpathAccountsSettingsDialog.cpp:217)

EmpathAccountsSettingsDialog::s_OK()
{
    hide();
    s_apply();
    KGlobal::config()->sync();
    accept();
}

    void

empath'EmpathAccountsSettingsDialog::s_help() (./kdepim/empath/ui/settings/EmpathAccountsSettingsDialog.cpp:226)

EmpathAccountsSettingsDialog::s_help()
{
    //empathInvokeHelp(QString::null, QString::null);
}

    void

empath'EmpathAccountsSettingsDialog::s_apply() (./kdepim/empath/ui/settings/EmpathAccountsSettingsDialog.cpp:232)

EmpathAccountsSettingsDialog::s_apply()
{
    empath->mailboxList()->saveConfig();
    applied_ = true;
}

    void

empath'EmpathAccountsSettingsDialog::s_cancel() (./kdepim/empath/ui/settings/EmpathAccountsSettingsDialog.cpp:239)

EmpathAccountsSettingsDialog::s_cancel()
{
    if (!applied_)
        KGlobal::config()->rollback(true);
    reject();
}


    void

empath'EmpathAccountsSettingsDialog::s_currentChanged() (./kdepim/empath/ui/settings/EmpathAccountsSettingsDialog.cpp:248)

EmpathAccountsSettingsDialog::s_currentChanged(QListViewItem * item)
{
    if (!item == 0)
        return;
    
    if (item->text(1) == "Maildir")
        pb_remove_->setEnabled(false);
    else
        pb_remove_->setEnabled(true);
}

// vim:ts=4:sw=4:tw=78