
#include "dcquickconnect.h"

DCQuickConnect::DCQuickConnect(QWidget *parent) : QDialog(parent) {
    setupUi(this);

    comboBox_HUBNAME->addItems(DCConfig::Instance()->GetQuickConnectHistory());

    disconnect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(slotAccept()));

    comboBox_HUBNAME->setFocus();
}

DCQuickConnect::~DCQuickConnect() {

}

void DCQuickConnect::slotAccept() {
    QString hub = comboBox_HUBNAME->currentText();

    if (hub != "") {
        DCConnectionManager::Instance()->Connect(CString(), hub.toAscii().constData());
        DCConfig::Instance()->AppendQuickConnectHistory(hub);
    }

    accept();
}

