Merge pull request #2907 from dbear496/a-few-fixes

a few small fixes
This commit is contained in:
csoler 2025-01-06 20:32:20 +01:00 committed by GitHub
commit b2d05d7d8e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 92 additions and 93 deletions

View file

@ -1783,7 +1783,6 @@ void IdDialog::loadIdentity(RsGxsIdGroup data)
if (isOwnId) if (isOwnId)
{ {
mStateHelper->setWidgetEnabled(ui->ownOpinion_CB, false);
mStateHelper->setWidgetEnabled(ui->autoBanIdentities_CB, false); mStateHelper->setWidgetEnabled(ui->autoBanIdentities_CB, false);
// ui->editIdentity->setEnabled(true); // ui->editIdentity->setEnabled(true);
// ui->removeIdentity->setEnabled(true); // ui->removeIdentity->setEnabled(true);
@ -1793,8 +1792,6 @@ void IdDialog::loadIdentity(RsGxsIdGroup data)
} }
else else
{ {
// No Reputation yet!
mStateHelper->setWidgetEnabled(ui->ownOpinion_CB, true);
mStateHelper->setWidgetEnabled(ui->autoBanIdentities_CB, true); mStateHelper->setWidgetEnabled(ui->autoBanIdentities_CB, true);
// ui->editIdentity->setEnabled(false); // ui->editIdentity->setEnabled(false);
// ui->removeIdentity->setEnabled(false); // ui->removeIdentity->setEnabled(false);
@ -2266,12 +2263,14 @@ void IdDialog::IdListCustomPopupMenu( QPoint )
if(n_is_a_contact == 0) if(n_is_a_contact == 0)
contextMenu->addAction(QIcon(), tr("Add to Contacts"), this, SLOT(addtoContacts())); contextMenu->addAction(QIcon(), tr("Add to Contacts"), this, SLOT(addtoContacts()));
if (n_selected_items==1)
contextMenu->addAction(QIcon(""),tr("Copy identity to clipboard"),this,SLOT(copyRetroshareLink())) ;
if(n_is_not_a_contact == 0) if(n_is_not_a_contact == 0)
contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/icons/cancel.svg"), tr("Remove from Contacts"), this, SLOT(removefromContacts())); contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/icons/cancel.svg"), tr("Remove from Contacts"), this, SLOT(removefromContacts()));
}
if (n_selected_items==1)
contextMenu->addAction(QIcon(""),tr("Copy identity to clipboard"),this,SLOT(copyRetroshareLink())) ;
contextMenu->addSeparator(); contextMenu->addSeparator();
if(n_positive_reputations == 0) // only unban when all items are banned if(n_positive_reputations == 0) // only unban when all items are banned
@ -2282,13 +2281,11 @@ void IdDialog::IdListCustomPopupMenu( QPoint )
if(n_negative_reputations == 0) if(n_negative_reputations == 0)
contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/icons/png/thumbs-down.png"), tr("Set negative opinion"), this, SLOT(negativePerson())); contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/icons/png/thumbs-down.png"), tr("Set negative opinion"), this, SLOT(negativePerson()));
}
if(one_item_owned_by_you && n_selected_items==1) if(one_item_owned_by_you && n_selected_items==1)
{ {
contextMenu->addSeparator(); contextMenu->addSeparator();
contextMenu->addAction(QIcon(""),tr("Copy identity to clipboard"),this,SLOT(copyRetroshareLink())) ;
contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_EDIT),tr("Edit identity"),this,SLOT(editIdentity())) ; contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_EDIT),tr("Edit identity"),this,SLOT(editIdentity())) ;
contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/icons/cancel.svg"),tr("Delete identity"),this,SLOT(removeIdentity())) ; contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/icons/cancel.svg"),tr("Delete identity"),this,SLOT(removeIdentity())) ;
} }
@ -2602,4 +2599,3 @@ void IdDialog::restoreExpandedCircleItems(const std::vector<bool>& expanded_root
restoreTopLevel(mExternalOtherCircleItem,1); restoreTopLevel(mExternalOtherCircleItem,1);
restoreTopLevel(mMyCircleItem,2); restoreTopLevel(mMyCircleItem,2);
} }

View file

@ -1920,7 +1920,9 @@ static void processList(const QStringList &list, const QString &textSingular, co
void RSLinkClipboard::copyLinks(const QList<RetroShareLink>& links) void RSLinkClipboard::copyLinks(const QList<RetroShareLink>& links)
{ {
QString res ; QString res ;
for (int i = 0; i < links.size(); ++i) if(links.size() == 1)
res += links[0].toString();
else for(int i = 0; i < links.size(); ++i)
res += links[i].toString() + "\n" ; res += links[i].toString() + "\n" ;
QApplication::clipboard()->setText(res) ; QApplication::clipboard()->setText(res) ;
@ -2036,4 +2038,3 @@ void RSLinkClipboard::parseText(QString text, QList<RetroShareLink> &links,Retro
pos += rx.matchedLength(); pos += rx.matchedLength();
} }
} }

View file

@ -235,7 +235,8 @@ void JsonApiPage::addTokenClicked()
void JsonApiPage::removeTokenClicked() void JsonApiPage::removeTokenClicked()
{ {
QString token(ui.tokenLineEdit->text()); QString token(ui.tokenLineEdit->text());
rsJsonApi->revokeAuthToken(token.toStdString()); std::string tokenStr = token.toStdString();
rsJsonApi->revokeAuthToken(tokenStr.substr(0, tokenStr.find_first_of(":")));
QStringList newTk; QStringList newTk;
@ -251,4 +252,3 @@ void JsonApiPage::tokenClicked(const QModelIndex& index)
{ {
ui.tokenLineEdit->setText(ui.tokensListView->model()->data(index).toString()); ui.tokenLineEdit->setText(ui.tokensListView->model()->data(index).toString());
} }

View file

@ -228,6 +228,7 @@ ServerPage::ServerPage(QWidget * parent, Qt::WindowFlags flags)
connect(ui.hiddenpage_proxyPort_tor, SIGNAL(editingFinished()),this,SLOT(saveAddresses())); connect(ui.hiddenpage_proxyPort_tor, SIGNAL(editingFinished()),this,SLOT(saveAddresses()));
connect(ui.hiddenpage_proxyAddress_i2p, SIGNAL(editingFinished()),this,SLOT(saveAddresses())); connect(ui.hiddenpage_proxyAddress_i2p, SIGNAL(editingFinished()),this,SLOT(saveAddresses()));
connect(ui.hiddenpage_proxyPort_i2p, SIGNAL(editingFinished()),this,SLOT(saveAddresses())); connect(ui.hiddenpage_proxyPort_i2p, SIGNAL(editingFinished()),this,SLOT(saveAddresses()));
connect(ui.hiddenpage_localPort, SIGNAL(editingFinished()),this,SLOT(saveAddresses()));
connect(ui.totalDownloadRate,SIGNAL(valueChanged(int)),this,SLOT(saveRates())); connect(ui.totalDownloadRate,SIGNAL(valueChanged(int)),this,SLOT(saveRates()));
connect(ui.totalUploadRate, SIGNAL(valueChanged(int)),this,SLOT(saveRates())); connect(ui.totalUploadRate, SIGNAL(valueChanged(int)),this,SLOT(saveRates()));
@ -1732,7 +1733,8 @@ void ServerPage::saveSam()
new_proxyport = ui.hiddenpage_proxyPort_i2p -> value(); new_proxyport = ui.hiddenpage_proxyPort_i2p -> value();
// SAMv3 has no proxy port, everything goes through the SAM port. // SAMv3 has no proxy port, everything goes through the SAM port.
if ((new_proxyaddr != orig_proxyaddr) /* || (new_proxyport != orig_proxyport) */) { // Still need to check the proxyport for manual i2p
if ((new_proxyaddr != orig_proxyaddr) || (new_proxyport != orig_proxyport)) {
rsPeers->setProxyServer(RS_HIDDEN_TYPE_I2P, new_proxyaddr, new_proxyport); rsPeers->setProxyServer(RS_HIDDEN_TYPE_I2P, new_proxyaddr, new_proxyport);
} }
} }