void AccountsPreferencesPane::onAddServiceButtonClicked() { // FIXME we should here provide a nice dialog for choosing an appropriate service // However, for now, create only that which is allowed QVariantMap defaults(Utopia::defaults()); if (defaults.contains("service_uri")) { QString serviceUri = defaults["service_uri"].toString(); Service * newService = new Service; newService->setUrl(serviceUri); QVariantMap methods(newService->supportedAuthenticationMethods()); if (methods.size() > 0) { if (methods.size() == 1 || true) { newService->setAuthenticationMethod((--methods.end()).key()); bool anon = newService->resourceCapabilities(Service::AuthenticationResource).contains("anonymous"); if (anon) { newService->setAnonymous(true); } serviceManager->addService(newService); serviceManager->start(newService); } else { // FIXME should make list } } else { delete newService; } } else { NewAccountDialog dialog; dialog.exec(); } }
void AccountWidget::newAccount() { NewAccountDialog *dialog = new NewAccountDialog( this) ; dialog->exec(); int res = dialog->result(); delete dialog; if( res == QDialog::Accepted ) reload(); }
void ClientWidget::newClientAccount() { int row = clientTable->currentRow(); if( row < 0 ) return; quint32 id = clientTable->getCurrentId(); if( id < 0 ) return; NewAccountDialog *dialog = new NewAccountDialog( this, id, 1 ); dialog->setOwnerName( clientTable->text( row, 1) ); dialog->exec(); int res = dialog->result(); delete dialog; if( res == QDialog::Accepted ) accountRequest(row); }