Share WireGuard page
Share IKEv2 page
This commit is contained in:
parent
c6efc5b212
commit
25428c9165
28 changed files with 907 additions and 238 deletions
|
|
@ -705,5 +705,29 @@ bool UiLogic::saveTextFile(const QString& desc, const QString& ext, const QStrin
|
|||
QSaveFile save(fileName);
|
||||
save.open(QIODevice::WriteOnly);
|
||||
save.write(data.toUtf8());
|
||||
|
||||
QFileInfo fi(fileName);
|
||||
QDesktopServices::openUrl(fi.absoluteDir().absolutePath());
|
||||
|
||||
return save.commit();
|
||||
}
|
||||
|
||||
bool UiLogic::saveBinaryFile(const QString &desc, const QString &ext, const QString &data)
|
||||
{
|
||||
QString fileName = QFileDialog::getSaveFileName(nullptr, desc,
|
||||
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), ext);
|
||||
|
||||
QSaveFile save(fileName);
|
||||
save.open(QIODevice::WriteOnly);
|
||||
save.write(QByteArray::fromBase64(data.toUtf8()));
|
||||
|
||||
QFileInfo fi(fileName);
|
||||
QDesktopServices::openUrl(fi.absoluteDir().absolutePath());
|
||||
|
||||
return save.commit();
|
||||
}
|
||||
|
||||
void UiLogic::copyToClipboard(const QString &text)
|
||||
{
|
||||
qApp->clipboard()->setText(text);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue