Logo Search packages:      
Sourcecode: mailody version File versions  Download package

Mailody::SetupIdentities::SetupIdentities ( QWidget *  parent = 0  ) 

Constructor

Parameters:
parent Parent Widget

Definition at line 77 of file setupidentities.cpp.

References Mailody::Global::cryptoConnectionSupported(), and readSettings().

           : QWidget(parent),
           m_currentIdentity(0)
{
    QVBoxLayout *mainLayout = new QVBoxLayout(parent);
    QGridLayout* mainGrid = new QGridLayout(this,2,2,2,2);

    m_identybox = new NoDragKListBox(this);
    m_identybox->setAcceptDrops(false);
    connect(m_identybox, SIGNAL(selectionChanged(QListBoxItem*)),
            SLOT(slotSelectionChanged(QListBoxItem*)));

    mainGrid->addMultiCellWidget( m_identybox, 0, 0, 0, 1 );

    QPushButton* add = new QPushButton(i18n("+"), this);
    connect(add, SIGNAL(clicked()), SLOT(slotAdd()));
    mainGrid->addWidget( add, 1, 0 );

    QPushButton* del = new QPushButton(i18n("-"), this);
    connect(del, SIGNAL(clicked()), SLOT(slotDel()));
    mainGrid->addWidget( del, 1, 1 );

    m_tabWidget = new KTabWidget(this);

    mainGrid->addMultiCellWidget( m_tabWidget, 0, 1, 2, 2 );
    mainGrid->setRowStretch( 0, 0 );

    // -------------- page 1 ---------------------- //

    QWidget* page1 = new QWidget(this);
    QGridLayout* m1 = new QGridLayout(page1,3,2,7,7);

    QLabel *l0 = new QLabel(i18n("Identity name:") + ' ', page1 );
    l0->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
    m1->addWidget(l0,0,0);
    QWhatsThis::add( l0, i18n("The display name") );
    m_identityName = new KLineEdit(page1);
    connect(m_identityName, SIGNAL(textChanged( const QString & )),
            SLOT( slotIdentityNameEdit( const QString & )));
    m1->addWidget(m_identityName,0,1);
    l0->setBuddy(m_identityName);

    QLabel *l1 = new QLabel(i18n("Full name:") + ' ', page1 );
    l1->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
    m1->addWidget(l1,1,0);
    QWhatsThis::add( l1, i18n("The display name") );
    m_fullName = new KLineEdit(page1);
    m1->addWidget(m_fullName,1,1);
    l1->setBuddy(m_fullName);

    QLabel *l2 = new QLabel(i18n("Email address:") + ' ', page1 );
    l2->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
    m1->addWidget(l2,2,0);
    QWhatsThis::add( l2, i18n("Your Emailadress") );
    m_emailAddress = new KLineEdit(page1);
    m1->addWidget(m_emailAddress,2,1);
    l2->setBuddy(m_emailAddress);

    QLabel *l3 = new QLabel(i18n("SMTP-server:") + ' ', page1 );
    m1->addWidget(l3,3,0);
    l3->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
    QWhatsThis::add( l3, i18n("SSL is safe SMTP over port 465, TLS will "
                              "will operate on 25 and switch to a secure "
                              "connection, directly after connecting, None "
                              "will connect to 25 but will not switch to a "
                              "secure connection. This setting will probably "
                              "be needed for most providers.") );
    m_smtpServer = new KLineEdit(page1);
    m1->addWidget(m_smtpServer,3,1);
    l3->setBuddy(m_smtpServer);

    QLabel *l4 = new QLabel(i18n("Safety:") + ' ', page1);
    m1->addWidget(l4,4,0);
    l4->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
    QWhatsThis::add( l4, i18n("Indicate how safe you want to send") );
    m_safeSMTP = new QButtonGroup(3, Qt::Horizontal, page1);
    m_safeSMTP->setExclusive(true);
    m_safeSMTP->setInsideMargin(3);
    new QRadioButton(i18n("None"), m_safeSMTP);
    QRadioButton* sslRadioS = new QRadioButton(i18n("SSL"), m_safeSMTP);
    QRadioButton* tlsRadioS = new QRadioButton(i18n("TLS"), m_safeSMTP);
    m1->addWidget(m_safeSMTP,4,1);
    l4->setBuddy(m_safeSMTP);

    m_smtpAuthBox = new QVGroupBox(page1);
    m_smtpAuthBox->setTitle(i18n("Use authentication"));
    m_smtpAuthBox->setCheckable( true );

    QHBox *s1 = new QHBox(m_smtpAuthBox);
    QLabel *l5 = new QLabel(i18n("Username:") + ' ', s1 );
    l5->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
    QWhatsThis::add( l5, i18n("The username") );
    m_smtpUserName = new KLineEdit(s1);
    l5->setBuddy(m_smtpUserName);

    QHBox *s2 = new QHBox(m_smtpAuthBox);
    QLabel *l6 = new QLabel(i18n("Password:") + ' ', s2 );
    l6->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
    QWhatsThis::add( l6, i18n("The password") );
    m_smtpPassword = new KPasswordEdit(s2);
    l6->setBuddy(m_smtpPassword);

    m1->addMultiCellWidget(m_smtpAuthBox,5,5,0,1);

    QLabel *htmlp = new QLabel(i18n("Include auto html part:") + ' ', page1 );
    m1->addWidget(htmlp,6,0);
    htmlp->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
    QWhatsThis::add( htmlp, i18n("Mailody is able to convert your plain "
                                "message to a html message and include that "
                                "in the outgoing message, this means the "
                                "receiver will also have clickable links and "
                                "colored quote levels") );
    m_htmlPart = new QButtonGroup(2, Qt::Horizontal, page1);
    m_htmlPart->setExclusive(true);
    m_htmlPart->setInsideMargin(3);
    new QRadioButton(i18n("No"), m_htmlPart);
    new QRadioButton(i18n("Yes"), m_htmlPart);
    m1->addWidget(m_htmlPart,6,1);
    htmlp->setBuddy(m_htmlPart);

    QSpacerItem* spacer1 = new QSpacerItem( 20, 20, QSizePolicy::Minimum,
                                          QSizePolicy::Expanding );
    m1->addItem( spacer1, 7, 1 );

    m_tabWidget->addTab(page1,i18n("General"));

    // ------------------- page 2 -----------------------//
    QWidget* page2 = new QWidget(this);
    QGridLayout* m2 = new QGridLayout(page2,1,1,5,5);

    m_sigBox = new QGroupBox(page2);
    m_sigBox->setCheckable(true);
    m_sigBox->setTitle(i18n("Use Signature"));
    m_sigBox->setColumnLayout(0, Qt::Vertical);
    m_sigBox->setInsideMargin(3);
    m_sigBox->setInsideSpacing(3);
    m_sigBox->setFlat(true);



    QVBoxLayout* f2 = new QVBoxLayout(m_sigBox->layout());
    f2->setAlignment( Qt::AlignTop );
    m_signature = new KTextEdit(m_sigBox);
    QWhatsThis::add( m_signature, i18n("This is the mail signature."));

    m_sigPos = new QButtonGroup(2, Qt::Horizontal, i18n("Position"), m_sigBox);
    m_sigPos->setExclusive(true);
    m_sigPos->setFlat(true);

    new QRadioButton(i18n("Bottom"), m_sigPos);
    new QRadioButton(i18n("Top"), m_sigPos);
    QWhatsThis::add( m_sigPos, i18n("Select the placement of the signature in "
                                    "the composer. Top means above the text "
                                    "in the message you reply to or forward. "
                                    "Bottom means below the text in the "
                                    "message you reply to or forward."));

    m_tabWidget->addTab(page2,i18n("Signature"));
    m2->addWidget(m_sigBox, 0, 0);
    f2->addWidget(m_signature);
    f2->addWidget(m_sigPos);

    //---------------------------------------------------//


    mainLayout->addWidget(this);

    m_wallet = Wallet::openWallet(Wallet::NetworkWallet(), this->winId());
    if (!m_wallet)
    {
        m_smtpPassword->setEnabled(false);
    }
    else if (m_wallet && m_wallet->isOpen())
    {
        if (!m_wallet->hasFolder("mailody"))
            m_wallet->createFolder( "mailody" );

        m_wallet->setFolder( "mailody" );
    }

    //------------------------------------------------/

    readSettings();

    if(!Global::cryptoConnectionSupported())
    {
        tlsRadioS->setEnabled(false);
        sslRadioS->setEnabled(false);
        m_safeSMTP->setButton(0);
    }

    m_tabWidget->setEnabled(false);
}


Generated by  Doxygen 1.6.0   Back to index