Skip to content

Commit

Permalink
add button to fill in TRIfA community public group ID
Browse files Browse the repository at this point in the history
  • Loading branch information
zoff99 committed Sep 23, 2023
1 parent e5bf84a commit 21653d4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/widget/form/addfriendform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,15 @@ AddFriendForm::AddFriendForm(ToxId ownId_, Settings& settings_, Style& style_,
layout.addWidget(&toxIdLabel);
layout.addWidget(&toxId);
layout.addWidget(&ngcIdLabel);
layout.addWidget(&fillTrifaCommunityGroupButton);
layout.addWidget(&ngcId);
layout.addWidget(&messageLabel);
layout.addWidget(&message);
layout.addWidget(&sendButton);
tabWidget->addTab(main, QString());

sendButton.setEnabled(true);
fillTrifaCommunityGroupButton.setEnabled(true);

importContacts = new QWidget(tabWidget);
importContacts->setLayout(&importContactsLayout);
Expand Down Expand Up @@ -125,6 +127,7 @@ AddFriendForm::AddFriendForm(ToxId ownId_, Settings& settings_, Style& style_,
connect(&ngcId, &QLineEdit::textChanged, this, &AddFriendForm::onNgcIdChanged);
connect(tabWidget, &QTabWidget::currentChanged, this, &AddFriendForm::onCurrentChanged);
connect(&sendButton, &QPushButton::clicked, this, &AddFriendForm::onSendTriggered);
connect(&fillTrifaCommunityGroupButton, &QPushButton::clicked, this, &AddFriendForm::onfillTrifaCommTriggered);
connect(&importSendButton, &QPushButton::clicked, this, &AddFriendForm::onImportSendClicked);
connect(&importFileButton, &QPushButton::clicked, this, &AddFriendForm::onImportOpenClicked);
connect(&core, &Core::usernameSet, this, &AddFriendForm::onUsernameSet);
Expand Down Expand Up @@ -257,6 +260,15 @@ void AddFriendForm::addNgcPublicGroup(const QString& idText)
emit NgcRequested(idText, "__");
}

void AddFriendForm::onfillTrifaCommTriggered()
{
qDebug() << QString("AddFriendForm::onfillTrifaCommTriggered()");
toxId.clear();
ngcId.clear();
message.clear();
ngcId.setText("154b3973bd0e66304fd6179a8a54759073649e09e6e368f0334fc6ed666ab762");
}

void AddFriendForm::onSendTriggered()
{
qDebug() << QString("AddFriendForm::onSendTriggered()");
Expand Down Expand Up @@ -441,6 +453,8 @@ void AddFriendForm::retranslateUi()
message.setPlaceholderText(tr("%1 here! Tox me maybe?").arg(lastUsername));
importMessage.setPlaceholderText(message.placeholderText());

fillTrifaCommunityGroupButton.setText("add Info Group");

importFileLabel.setText(
contactsToImport.isEmpty()
? tr("Import a list of contacts, one Tox ID per line")
Expand Down
2 changes: 2 additions & 0 deletions src/widget/form/addfriendform.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class AddFriendForm : public QObject
public slots:
void onUsernameSet(const QString& userName);
void onSendTriggered();
void onfillTrifaCommTriggered();
void showFocusAgain();

private slots:
Expand Down Expand Up @@ -103,6 +104,7 @@ private slots:
QLabel importMessageLabel;

QPushButton sendButton;
QPushButton fillTrifaCommunityGroupButton;
QPushButton importFileButton;
QPushButton importSendButton;
QLineEdit toxId;
Expand Down

0 comments on commit 21653d4

Please sign in to comment.