forked from qt-creator/qt-creator
Android: Turn SDK manager from QTabWidget into QGroupBox
Since the AVD manager moved into the "Devices" option page, the SDK manager tab was left alone in the QTabWidget. One single tab looks strange and uses more space than needed. This change turns the SDK manager area into a QGroupBox, which is consistent with the rest of the Android Options page. This patch also adjusts the margins and spacings of the SDK manager widget to fit to the rest of the options page. Change-Id: Id1ed38862e8f9e984f53cdfb59492e30902162a7 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
@@ -48,10 +48,7 @@
|
|||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing">
|
<item row="1" column="0" colspan="2">
|
||||||
<number>4</number>
|
|
||||||
</property>
|
|
||||||
<item row="2" column="0" colspan="4">
|
|
||||||
<widget class="QTreeView" name="packagesView">
|
<widget class="QTreeView" name="packagesView">
|
||||||
<property name="indentation">
|
<property name="indentation">
|
||||||
<number>20</number>
|
<number>20</number>
|
||||||
@@ -61,7 +58,7 @@
|
|||||||
</attribute>
|
</attribute>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="4">
|
<item row="1" column="2">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="updateInstalledButton">
|
<widget class="QPushButton" name="updateInstalledButton">
|
||||||
@@ -195,10 +192,10 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="0" column="0">
|
||||||
<widget class="Utils::FancyLineEdit" name="searchField"/>
|
<widget class="Utils::FancyLineEdit" name="searchField"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="2">
|
<item row="0" column="1">
|
||||||
<widget class="QCheckBox" name="expandCheck">
|
<widget class="QCheckBox" name="expandCheck">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Expand All</string>
|
<string>Expand All</string>
|
||||||
@@ -209,6 +206,18 @@
|
|||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="outputStack">
|
<widget class="QWidget" name="outputStack">
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<item row="3" column="2">
|
<item row="3" column="2">
|
||||||
<widget class="QPushButton" name="cancelButton">
|
<widget class="QPushButton" name="cancelButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@@ -291,16 +291,14 @@ AndroidSettingsWidget::AndroidSettingsWidget()
|
|||||||
{
|
{
|
||||||
m_ui.setupUi(this);
|
m_ui.setupUi(this);
|
||||||
m_sdkManagerWidget = new AndroidSdkManagerWidget(m_androidConfig, &m_sdkManager,
|
m_sdkManagerWidget = new AndroidSdkManagerWidget(m_androidConfig, &m_sdkManager,
|
||||||
m_ui.sdkManagerTab);
|
m_ui.sdkManagerGroupBox);
|
||||||
auto sdkMangerLayout = new QVBoxLayout(m_ui.sdkManagerTab);
|
auto sdkMangerLayout = new QVBoxLayout(m_ui.sdkManagerGroupBox);
|
||||||
sdkMangerLayout->setContentsMargins(0, 0, 0, 0);
|
|
||||||
sdkMangerLayout->addWidget(m_sdkManagerWidget);
|
sdkMangerLayout->addWidget(m_sdkManagerWidget);
|
||||||
connect(m_sdkManagerWidget, &AndroidSdkManagerWidget::updatingSdk, [this] {
|
connect(m_sdkManagerWidget, &AndroidSdkManagerWidget::updatingSdk, [this] {
|
||||||
// Disable the top level UI to keep the user from unintentionally interrupting operations
|
// Disable the top level UI to keep the user from unintentionally interrupting operations
|
||||||
m_ui.androidSettingsGroupBox->setEnabled(false);
|
m_ui.androidSettingsGroupBox->setEnabled(false);
|
||||||
m_ui.androidOpenSSLSettingsGroupBox->setEnabled(false);
|
m_ui.androidOpenSSLSettingsGroupBox->setEnabled(false);
|
||||||
m_ui.CreateKitCheckBox->setEnabled(false);
|
m_ui.CreateKitCheckBox->setEnabled(false);
|
||||||
m_ui.managerTabWidget->tabBar()->setEnabled(false);
|
|
||||||
m_androidSummary->setState(DetailsWidget::Collapsed);
|
m_androidSummary->setState(DetailsWidget::Collapsed);
|
||||||
m_androidProgress->hide();
|
m_androidProgress->hide();
|
||||||
});
|
});
|
||||||
@@ -308,13 +306,12 @@ AndroidSettingsWidget::AndroidSettingsWidget()
|
|||||||
m_ui.androidSettingsGroupBox->setEnabled(true);
|
m_ui.androidSettingsGroupBox->setEnabled(true);
|
||||||
m_ui.androidOpenSSLSettingsGroupBox->setEnabled(true);
|
m_ui.androidOpenSSLSettingsGroupBox->setEnabled(true);
|
||||||
m_ui.CreateKitCheckBox->setEnabled(true);
|
m_ui.CreateKitCheckBox->setEnabled(true);
|
||||||
m_ui.managerTabWidget->tabBar()->setEnabled(true);
|
|
||||||
});
|
});
|
||||||
connect(m_sdkManagerWidget, &AndroidSdkManagerWidget::licenseWorkflowStarted, [this] {
|
connect(m_sdkManagerWidget, &AndroidSdkManagerWidget::licenseWorkflowStarted, [this] {
|
||||||
QObject *parentWidget = parent();
|
QObject *parentWidget = parent();
|
||||||
while (parentWidget) {
|
while (parentWidget) {
|
||||||
if (auto scrollArea = qobject_cast<QScrollArea *>(parentWidget)) {
|
if (auto scrollArea = qobject_cast<QScrollArea *>(parentWidget)) {
|
||||||
scrollArea->ensureWidgetVisible(m_ui.managerTabWidget);
|
scrollArea->ensureWidgetVisible(m_ui.sdkManagerGroupBox);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
parentWidget = parentWidget->parent();
|
parentWidget = parentWidget->parent();
|
||||||
@@ -530,7 +527,6 @@ void AndroidSettingsWidget::validateSdk()
|
|||||||
auto userInput = QMessageBox::information(this, tr("Missing Android SDK Packages"),
|
auto userInput = QMessageBox::information(this, tr("Missing Android SDK Packages"),
|
||||||
message, QMessageBox::Yes | QMessageBox::No);
|
message, QMessageBox::Yes | QMessageBox::No);
|
||||||
if (userInput == QMessageBox::Yes) {
|
if (userInput == QMessageBox::Yes) {
|
||||||
m_ui.managerTabWidget->setCurrentWidget(m_ui.sdkManagerTab);
|
|
||||||
m_sdkManagerWidget->installEssentials();
|
m_sdkManagerWidget->installEssentials();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -651,7 +647,7 @@ void AndroidSettingsWidget::updateUI()
|
|||||||
const bool androidSetupOk = m_androidSummary->allRowsOk();
|
const bool androidSetupOk = m_androidSummary->allRowsOk();
|
||||||
const bool openSslOk = m_openSslSummary->allRowsOk();
|
const bool openSslOk = m_openSslSummary->allRowsOk();
|
||||||
|
|
||||||
m_ui.sdkManagerTab->setEnabled(sdkToolsOk);
|
m_ui.sdkManagerGroupBox->setEnabled(sdkToolsOk);
|
||||||
|
|
||||||
const QListWidgetItem *currentItem = m_ui.ndkListWidget->currentItem();
|
const QListWidgetItem *currentItem = m_ui.ndkListWidget->currentItem();
|
||||||
const FilePath currentNdk = FilePath::fromString(currentItem ? currentItem->text() : "");
|
const FilePath currentNdk = FilePath::fromString(currentItem ? currentItem->text() : "");
|
||||||
|
@@ -175,6 +175,16 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="7" column="0" colspan="7">
|
||||||
|
<widget class="QCheckBox" name="CreateKitCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Automatically create kits for Android tool chains</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -224,31 +234,10 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="CreateKitCheckBox">
|
<widget class="QGroupBox" name="sdkManagerGroupBox">
|
||||||
<property name="sizePolicy">
|
<property name="title">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
<string>SDK Manager</string>
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
|
||||||
<string>Automatically create kits for Android tool chains</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QTabWidget" name="managerTabWidget">
|
|
||||||
<property name="currentIndex">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="sdkManagerTab">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>SDK Manager</string>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
Reference in New Issue
Block a user