mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 16:05:21 +01:00
WIP: Tabbed options interface
This commit is contained in:
parent
4c71a2294e
commit
6eb358ed75
3 changed files with 343 additions and 313 deletions
|
@ -790,10 +790,22 @@ QByteArray ImageWriter::getUsbSourceOSlist()
|
|||
#endif
|
||||
}
|
||||
|
||||
QString ImageWriter::_pubKeyFileName()
|
||||
{
|
||||
return QDir::homePath()+"/.ssh/id_rsa.pub";
|
||||
}
|
||||
|
||||
QString ImageWriter::_privKeyFileName()
|
||||
{
|
||||
QString fn = _pubKeyFileName();
|
||||
fn.chop(4);
|
||||
return fn;
|
||||
}
|
||||
|
||||
QString ImageWriter::getDefaultPubKey()
|
||||
{
|
||||
QByteArray pubkey;
|
||||
QFile pubfile(QDir::homePath()+"/.ssh/id_rsa.pub");
|
||||
QFile pubfile(_pubKeyFileName());
|
||||
|
||||
if (pubfile.exists() && pubfile.open(QFile::ReadOnly))
|
||||
{
|
||||
|
@ -804,6 +816,26 @@ QString ImageWriter::getDefaultPubKey()
|
|||
return pubkey;
|
||||
}
|
||||
|
||||
bool ImageWriter::hasPubKey()
|
||||
{
|
||||
return QFile::exists(_pubKeyFileName());
|
||||
}
|
||||
|
||||
bool ImageWriter::hasSshKeyGen()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void ImageWriter::generatePubKey()
|
||||
{
|
||||
if (!hasPubKey() && !QFile::exists(_privKeyFileName()))
|
||||
{
|
||||
QStringList args;
|
||||
args << "-t" << "rsa" << "-f" << _privKeyFileName() << "-N" << "";
|
||||
QProcess::execute("ssh-keygen", args);
|
||||
}
|
||||
}
|
||||
|
||||
QString ImageWriter::getTimezone()
|
||||
{
|
||||
return QTimeZone::systemTimeZoneId();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue