void GxsGroupDialog::init() { // connect up the buttons. connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(submitGroup())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(cancelDialog())); connect(ui.pubKeyShare_cb, SIGNAL(clicked()), this, SLOT(setShareList())); connect(ui.groupLogo, SIGNAL(clicked() ), this , SLOT(addGroupLogo())); connect(ui.addLogoButton, SIGNAL(clicked() ), this , SLOT(addGroupLogo())); ui.typePublic->setChecked(true); ui.distributionValueLabel->setText(tr("Public")); updateCircleOptions(); connect(ui.typePublic, SIGNAL(clicked()), this , SLOT(updateCircleOptions())); connect(ui.typeGroup, SIGNAL(clicked()), this , SLOT(updateCircleOptions())); connect(ui.typeLocal, SIGNAL(clicked()), this , SLOT(updateCircleOptions())); if (!ui.pubKeyShare_cb->isChecked()) { ui.contactsdockWidget->hide(); this->resize(this->size().width() - ui.contactsdockWidget->size().width(), this->size().height()); } /* initialize key share list */ ui.keyShareList->setHeaderText(tr("Contacts:")); ui.keyShareList->setModus(FriendSelectionWidget::MODUS_CHECK); ui.keyShareList->start(); /* Setup Reasonable Defaults */ ui.idChooser->loadIds(0,RsGxsId()); ui.circleComboBox->loadCircles(GXS_CIRCLE_CHOOSER_EXTERNAL, RsGxsCircleId()); ui.localComboBox->loadCircles(GXS_CIRCLE_CHOOSER_PERSONAL, RsGxsCircleId()); ui.groupDesc->setPlaceholderText(tr("Set a descriptive description here")); ui.personal_ifnopub->hide() ; ui.personal_required->hide() ; ui.personal_required->setChecked(true) ; // this is always true initMode(); }
CreateLobbyDialog::CreateLobbyDialog(const std::list<std::string>& peer_list,QWidget *parent, Qt::WFlags flags, std::string grpId, int grpType) : QDialog(parent, flags), mGrpId(grpId), mGrpType(grpType) { ui = new Ui::CreateLobbyDialog() ; ui->setupUi(this); std::string default_nick ; rsMsgs->getDefaultNickNameForChatLobby(default_nick) ; ui->lobbyName_LE->setPlaceholderText(tr("Put a sensible lobby name here")) ; ui->nickName_LE->setPlaceholderText(tr("Your nickname for this lobby (Change default name in options->chat)")) ; ui->nickName_LE->setText(QString::fromStdString(default_nick)) ; connect( ui->shareButton, SIGNAL( clicked ( bool ) ), this, SLOT( createLobby( ) ) ); connect( ui->cancelButton, SIGNAL( clicked ( bool ) ), this, SLOT( cancel( ) ) ); connect( ui->lobbyName_LE, SIGNAL( textChanged ( QString ) ), this, SLOT( checkTextFields( ) ) ); connect( ui->nickName_LE, SIGNAL( textChanged ( QString ) ), this, SLOT( checkTextFields( ) ) ); connect(ui->keyShareList, SIGNAL(itemChanged( QTreeWidgetItem *, int ) ), this, SLOT(togglePersonItem( QTreeWidgetItem *, int ) )); setShareList(peer_list); checkTextFields() ; }