if(Global::runMode == Global::Monolithic) {
connect(ui.internalCore, SIGNAL(toggled(bool)), ui.hostEdit, SLOT(setDisabled(bool)));
connect(ui.internalCore, SIGNAL(toggled(bool)), ui.port, SLOT(setDisabled(bool)));
ui.internalCore->setChecked(true);
} else {
if(Global::runMode == Global::Monolithic) {
connect(ui.internalCore, SIGNAL(toggled(bool)), ui.hostEdit, SLOT(setDisabled(bool)));
connect(ui.internalCore, SIGNAL(toggled(bool)), ui.port, SLOT(setDisabled(bool)));
ui.internalCore->setChecked(true);
} else {
connect(ui.newAccount, SIGNAL(clicked()), this, SLOT(createAccount()));
connect(ui.delAccount, SIGNAL(clicked()), this, SLOT(removeAccount()));
connect(ui.buttonBox1, SIGNAL(accepted()), this, SLOT(doConnect()));
connect(ui.hostEdit, SIGNAL(textChanged(const QString &)), this, SLOT(checkInputValid()));
connect(ui.userEdit, SIGNAL(textChanged(const QString &)), this, SLOT(checkInputValid()));
connect(ui.internalCore, SIGNAL(toggled(bool)), this, SLOT(checkInputValid()));
connect(ui.newAccount, SIGNAL(clicked()), this, SLOT(createAccount()));
connect(ui.delAccount, SIGNAL(clicked()), this, SLOT(removeAccount()));
connect(ui.buttonBox1, SIGNAL(accepted()), this, SLOT(doConnect()));
connect(ui.hostEdit, SIGNAL(textChanged(const QString &)), this, SLOT(checkInputValid()));
connect(ui.userEdit, SIGNAL(textChanged(const QString &)), this, SLOT(checkInputValid()));
connect(ui.internalCore, SIGNAL(toggled(bool)), this, SLOT(checkInputValid()));
+ connect(ui.internalCore, SIGNAL(toggled(bool)), ui.hostEdit, SLOT(setDisabled(bool)));
+ connect(ui.internalCore, SIGNAL(toggled(bool)), ui.port, SLOT(setDisabled(bool)));
connect(ui.accountList, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(accountChanged(const QString &)));
connect(ui.autoConnect, SIGNAL(clicked(bool)), this, SLOT(autoConnectToggled(bool)));
connect(ui.accountList, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(accountChanged(const QString &)));
connect(ui.autoConnect, SIGNAL(clicked(bool)), this, SLOT(autoConnectToggled(bool)));
curacc = s.lastAccount();
if(!ui.accountList->count()) {
//if(doAutoConnect) reject();
curacc = s.lastAccount();
if(!ui.accountList->count()) {
//if(doAutoConnect) reject();
setAccountEditEnabled(false);
QString newacc = QInputDialog::getText(this, tr("Create Account"), tr(
"In order to connect to a Quassel Core, you need to create an account.<br>"
setAccountEditEnabled(false);
QString newacc = QInputDialog::getText(this, tr("Create Account"), tr(
"In order to connect to a Quassel Core, you need to create an account.<br>"
// FIXME We create a default account here that just connects to the internal core
curacc = "Default";
ui.accountList->addItem("Default");
// FIXME We create a default account here that just connects to the internal core
curacc = "Default";
ui.accountList->addItem("Default");
ui.accountList->setCurrentIndex(0);
ui.autoConnect->setChecked(true);
autoConnectToggled(true);
ui.accountList->setCurrentIndex(0);
ui.autoConnect->setChecked(true);
autoConnectToggled(true);
ui.delAccount->setEnabled(en);
ui.internalCore->setEnabled(en);
ui.rememberPasswd->setEnabled(en);
ui.delAccount->setEnabled(en);
ui.internalCore->setEnabled(en);
ui.rememberPasswd->setEnabled(en);
ui.buttonBox1->button(QDialogButtonBox::Ok)->setEnabled(en && checkInputValid());
}
void CoreConnectDlg::accountChanged(const QString &text) {
AccountSettings s;
if(!curacc.isEmpty()) {
ui.buttonBox1->button(QDialogButtonBox::Ok)->setEnabled(en && checkInputValid());
}
void CoreConnectDlg::accountChanged(const QString &text) {
AccountSettings s;
if(!curacc.isEmpty()) {
oldAcc["User"] = ui.userEdit->text();
oldAcc["Host"] = ui.hostEdit->text();
oldAcc["Port"] = ui.port->value();
oldAcc["User"] = ui.userEdit->text();
oldAcc["Host"] = ui.hostEdit->text();
oldAcc["Port"] = ui.port->value();
ui.userEdit->setText(newAcc["User"].toString());
ui.hostEdit->setText(newAcc["Host"].toString());
ui.port->setValue(newAcc["Port"].toInt());
ui.userEdit->setText(newAcc["User"].toString());
ui.hostEdit->setText(newAcc["Host"].toString());
ui.port->setValue(newAcc["Port"].toInt());
QMessageBox::warning(this, tr("Account name already exists!"), tr("An account named '%1' already exists, and account names must be unique!").arg(accname));
return;
}
QMessageBox::warning(this, tr("Account name already exists!"), tr("An account named '%1' already exists, and account names must be unique!").arg(accname));
return;
}
ui.accountList->addItem(accname);
ui.accountList->setCurrentIndex(ui.accountList->findText(accname));
setAccountEditEnabled(true);
ui.accountList->addItem(accname);
ui.accountList->setCurrentIndex(ui.accountList->findText(accname));
setAccountEditEnabled(true);
+ // FIXME
+ coreConnectionError(tr("Can't connect to internal core at the moment [serious breakage due to switch to dynamic signals]. Please check back later."));
+ return;
+ if(Global::runMode != Global::Monolithic) {
+ coreConnectionError(tr("Can't connect to internal core, since we are running as a standalone GUI!"));
+ return;
+ }
ui.connectionGroupBox->setTitle(tr("Connecting to internal core"));
ui.connectionProgress->hide();
} else {
ui.connectionGroupBox->setTitle(tr("Connecting to %1").arg(ui.hostEdit->text()));
conninfo["Host"] = ui.hostEdit->text();
ui.connectionGroupBox->setTitle(tr("Connecting to internal core"));
ui.connectionProgress->hide();
} else {
ui.connectionGroupBox->setTitle(tr("Connecting to %1").arg(ui.hostEdit->text()));
conninfo["Host"] = ui.hostEdit->text();
connect(ClientProxy::instance(), SIGNAL(recvPartialItem(quint32, quint32)), this, SLOT(updateProgressBar(quint32, quint32)));
connect(ClientProxy::instance(), SIGNAL(csCoreState(QVariant)), this, SLOT(recvCoreState(QVariant)));
ui.progressBar->show();
connect(ClientProxy::instance(), SIGNAL(recvPartialItem(quint32, quint32)), this, SLOT(updateProgressBar(quint32, quint32)));
connect(ClientProxy::instance(), SIGNAL(csCoreState(QVariant)), this, SLOT(recvCoreState(QVariant)));
ui.progressBar->show();
initmsg["GUIProtocol"] = GUI_PROTOCOL;
// FIXME guiProxy->send(GS_CLIENT_INIT, QVariant(initmsg)); */
ui.connectionStatus->setText(tr("Connected to core."));
initmsg["GUIProtocol"] = GUI_PROTOCOL;
// FIXME guiProxy->send(GS_CLIENT_INIT, QVariant(initmsg)); */
ui.connectionStatus->setText(tr("Connected to core."));
ui.stackedWidget->setCurrentIndex(0);
show(); // just in case we started hidden
QMessageBox::warning(this, tr("Connection Error"), tr("<b>Could not connect to Quassel Core!</b><br>\n") + err, QMessageBox::Retry);
ui.stackedWidget->setCurrentIndex(0);
show(); // just in case we started hidden
QMessageBox::warning(this, tr("Connection Error"), tr("<b>Could not connect to Quassel Core!</b><br>\n") + err, QMessageBox::Retry);
- disconnect(ClientProxy::instance(), 0, this, 0);
+ //disconnect(ClientProxy::instance(), 0, this, 0); FIXME?