Enable S3 file browser when access key info is set.

This commit is contained in:
Jean-Philip Desjardins 2019-05-13 12:49:37 -04:00
parent d84f86a338
commit b6eca426d9
3 changed files with 10 additions and 0 deletions

View File

@ -30,6 +30,13 @@ S3FileBrowser::~S3FileBrowser()
delete ui;
}
bool S3FileBrowser::IsAvailable()
{
auto accessKeyId = CS3ObjectStream::CConfig::GetInstance().GetAccessKeyId();
auto accessKeySecret = CS3ObjectStream::CConfig::GetInstance().GetSecretAccessKey();
return !accessKeyId.empty() && !accessKeySecret.empty();
}
boost::filesystem::path S3FileBrowser::GetSelectedPath() const
{
return m_selectedPath;

View File

@ -20,6 +20,8 @@ public:
explicit S3FileBrowser(QWidget* parent = 0);
~S3FileBrowser();
static bool IsAvailable();
boost::filesystem::path GetSelectedPath() const;
private slots:

View File

@ -88,6 +88,7 @@ MainWindow::MainWindow(QWidget* parent)
CreateStatusBar();
UpdateUI();
ui->actionBoot_DiscImage_S3->setVisible(S3FileBrowser::IsAvailable());
InitVirtualMachine();