⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmseditaccount.cpp

📁 Qtopia下的邮件处理程序
💻 CPP
字号:
/******************************************************************************** Copyright (C) 2000-2006 TROLLTECH ASA. All rights reserved.**** This file is part of the Phone Edition of the Qtopia Toolkit.**** Licensees holding a valid license agreement from Trolltech or any of its** authorized distributors may use this file in accordance with** the License Agreement provided with the Licensed Software.**** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for**   information about Trolltech's Commercial License Agreements.**** Contact info@trolltech.com if any conditions of this licensing are** not clear to you.********** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.******************************************************************************/#include "mmseditaccount.h"#include "account.h"#include <qtopia/qtopiaapplication.h>#include <QLineEdit>#include <QCheckBox>#include <QComboBox>#include <QDir>MmsEditAccount::MmsEditAccount(QWidget *parent)    : QDialog(parent){    setupUi(this);    connect(networkBtn, SIGNAL(clicked()), this, SLOT(configureNetworks()));    QCopObject* netChannel = new QCopObject("QPE/NetworkState", this);    QCopObject::connect(netChannel, MESSAGE(wapChanged()),            this, SLOT(updateNetwork()));}void MmsEditAccount::populateNetwork(){    // Find available configs.    QString path = Qtopia::applicationFileName("Network", "wap");    QDir configDir(path);    configDir.mkdir(path);    QStringList files = configDir.entryList( QStringList("*.conf") );    QStringList configList;    foreach( QString item, files ) {        configList.append( configDir.filePath( item ) );    }    // Get default    QSettings cfg("Trolltech", "Network");    cfg.beginGroup("WAP");    QString defaultWap = cfg.value("DefaultAccount").toString();    cfg.endGroup();    int defaultConfig = -1;    // Add to combo    networkCombo->clear();    foreach( QString config, configList ) {        QSettings cfg( config, QSettings::IniFormat );        QString name = cfg.value("Info/Name").toString();        networkCombo->addItem(QIcon(":icon/netsetup/wap"), name, config);        if ( config == defaultWap ) {            defaultConfig = networkCombo->count()-1;        }        if ( config == account->networkConfig() ) {            networkCombo->setCurrentIndex(networkCombo->count()-1);        }    }    if (networkCombo->currentIndex() == -1 && defaultConfig >= 0)        networkCombo->setCurrentIndex(defaultConfig);    if (!networkCombo->count()) {        networkCombo->addItem(tr("<None configured>", "No network profiles have been configured"));        networkCombo->setCurrentIndex(0);    }}void MmsEditAccount::setAccount(MailAccount *in){    account = in;    populateNetwork();    autoRetrieve->setChecked(account->autoDownload());}void MmsEditAccount::accept(){    int currItem = networkCombo->currentIndex();    if (currItem >= 0 && networkCombo->itemData(currItem).isValid()) {        account->setNetworkConfig(networkCombo->itemData(currItem).toString());        account->setAutoDownload(autoRetrieve->isChecked());    }    QDialog::accept();}void MmsEditAccount::configureNetworks(){    QCopObjectService serv("NetworkSetup");    serv.send(MESSAGE(configureWap()));}void MmsEditAccount::updateNetwork(){    populateNetwork();}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -