Commit bf1afce5 authored by Daniel Teske's avatar Daniel Teske
Browse files

Andoid Manifest Editor: Adjust look to be more in line with a editor



Use the same styling as e.g. the submit editor.

Change-Id: Idb396b6971f75d9f4a876edf992c917ee81820df
Reviewed-by: default avatarEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
parent 79764560
......@@ -42,6 +42,7 @@
#include <QFileInfo>
#include <QDomDocument>
#include <QDir>
#include <QGroupBox>
#include <QHBoxLayout>
#include <QLabel>
#include <QFormLayout>
......@@ -50,6 +51,7 @@
#include <QDebug>
#include <QToolButton>
#include <utils/fileutils.h>
#include <utils/stylehelper.h>
#include <QListView>
#include <QPushButton>
#include <QFileDialog>
......@@ -105,19 +107,19 @@ TextEditor::BaseTextEditor *AndroidManifestEditorWidget::createEditor()
void AndroidManifestEditorWidget::initializePage()
{
ProjectExplorer::PanelsWidget *generalPanel = new ProjectExplorer::PanelsWidget(this);
generalPanel->widget()->setMinimumWidth(0);
generalPanel->widget()->setMaximumWidth(900);
QWidget *mainWidget = new QWidget(this);
mainWidget->setAutoFillBackground(true);
// Package
ProjectExplorer::PropertiesPanel *manifestPanel = new ProjectExplorer::PropertiesPanel;
manifestPanel->setDisplayName(tr("Package"));
{
QWidget *mainWidget = new QWidget();
QVBoxLayout *topLayout = new QVBoxLayout(mainWidget);
QGroupBox *packageGroupBox = new QGroupBox(mainWidget);
topLayout->addWidget(packageGroupBox);
QFormLayout *formLayout = new QFormLayout(mainWidget);
packageGroupBox->setTitle(tr("Package"));
{
QFormLayout *formLayout = new QFormLayout();
m_packageNameLineEdit = new QLineEdit(mainWidget);
m_packageNameLineEdit = new QLineEdit(packageGroupBox);
formLayout->addRow(tr("Package name:"), m_packageNameLineEdit);
m_packageNameWarning = new QLabel;
......@@ -137,15 +139,15 @@ void AndroidManifestEditorWidget::initializePage()
formLayout->addRow(QString(), warningRow);
m_versionCode = new QSpinBox(mainWidget);
m_versionCode = new QSpinBox(packageGroupBox);
m_versionCode->setMaximum(99);
m_versionCode->setValue(1);
formLayout->addRow(tr("Version code:"), m_versionCode);
m_versionNameLinedit = new QLineEdit(mainWidget);
m_versionNameLinedit = new QLineEdit(packageGroupBox);
formLayout->addRow(tr("Version name:"), m_versionNameLinedit);
manifestPanel->setWidget(mainWidget);
packageGroupBox->setLayout(formLayout);
connect(m_packageNameLineEdit, SIGNAL(textEdited(QString)),
this, SLOT(setPackageName()));
......@@ -155,44 +157,44 @@ void AndroidManifestEditorWidget::initializePage()
this, SLOT(setDirty()));
}
generalPanel->addPropertiesPanel(manifestPanel);
// Application
ProjectExplorer::PropertiesPanel *applicationPanel = new ProjectExplorer::PropertiesPanel;
applicationPanel->setDisplayName(tr("Application"));
QGroupBox *applicationGroupBox = new QGroupBox(mainWidget);
topLayout->addWidget(applicationGroupBox);
applicationGroupBox->setTitle(tr("Application"));
{
QWidget *mainWidget = new QWidget();
QFormLayout *formLayout = new QFormLayout(mainWidget);
QFormLayout *formLayout = new QFormLayout();
m_appNameLineEdit = new QLineEdit(mainWidget);
m_appNameLineEdit = new QLineEdit(applicationGroupBox);
formLayout->addRow(tr("Application name:"), m_appNameLineEdit);
m_targetLineEdit = new QLineEdit(mainWidget);
m_targetLineEdit = new QLineEdit(applicationGroupBox);
formLayout->addRow(tr("Run:"), m_targetLineEdit);
QHBoxLayout *iconLayout = new QHBoxLayout();
m_lIconButton = new QToolButton(mainWidget);
m_lIconButton = new QToolButton(applicationGroupBox);
m_lIconButton->setMinimumSize(QSize(48, 48));
m_lIconButton->setMaximumSize(QSize(48, 48));
iconLayout->addWidget(m_lIconButton);
iconLayout->addItem(new QSpacerItem(28, 20, QSizePolicy::Expanding, QSizePolicy::Minimum));
m_mIconButton = new QToolButton(mainWidget);
m_mIconButton = new QToolButton(applicationGroupBox);
m_mIconButton->setMinimumSize(QSize(48, 48));
m_mIconButton->setMaximumSize(QSize(48, 48));
iconLayout->addWidget(m_mIconButton);
iconLayout->addItem(new QSpacerItem(28, 20, QSizePolicy::Expanding, QSizePolicy::Minimum));
m_hIconButton = new QToolButton(mainWidget);
m_hIconButton = new QToolButton(applicationGroupBox);
m_hIconButton->setMinimumSize(QSize(48, 48));
m_hIconButton->setMaximumSize(QSize(48, 48));
iconLayout->addWidget(m_hIconButton);
formLayout->addRow(tr("Application icon:"), iconLayout);
applicationPanel->setWidget(mainWidget);
applicationGroupBox->setLayout(formLayout);
connect(m_appNameLineEdit, SIGNAL(textEdited(QString)),
this, SLOT(setAppName()));
......@@ -203,28 +205,28 @@ void AndroidManifestEditorWidget::initializePage()
connect(m_mIconButton, SIGNAL(clicked()), SLOT(setMDPIIcon()));
connect(m_hIconButton, SIGNAL(clicked()), SLOT(setHDPIIcon()));
}
generalPanel->addPropertiesPanel(applicationPanel);
// Permissions
ProjectExplorer::PropertiesPanel *permissionsPanel = new ProjectExplorer::PropertiesPanel;
permissionsPanel->setDisplayName(tr("Permissions"));
QGroupBox *permissionsGroupBox = new QGroupBox(mainWidget);
topLayout->addWidget(permissionsGroupBox);
permissionsGroupBox->setTitle(tr("Permissions"));
{
QWidget *mainWidget = new QWidget();
QGridLayout *layout = new QGridLayout(mainWidget);
QGridLayout *layout = new QGridLayout(permissionsGroupBox);
m_permissionsModel = new PermissionsModel(this);
m_permissionsListView = new QListView(mainWidget);
m_permissionsListView = new QListView(permissionsGroupBox);
m_permissionsListView->setModel(m_permissionsModel);
m_permissionsListView->setMinimumSize(QSize(0, 200));
layout->addWidget(m_permissionsListView, 0, 0, 3, 1);
m_removePermissionButton = new QPushButton(mainWidget);
m_removePermissionButton = new QPushButton(permissionsGroupBox);
m_removePermissionButton->setText(tr("Remove"));
layout->addWidget(m_removePermissionButton, 0, 1);
m_permissionsComboBox = new QComboBox(mainWidget);
m_permissionsComboBox = new QComboBox(permissionsGroupBox);
m_permissionsComboBox->insertItems(0, QStringList()
<< QLatin1String("android.permission.ACCESS_CHECKIN_PROPERTIES")
<< QLatin1String("android.permission.ACCESS_COARSE_LOCATION")
......@@ -348,11 +350,11 @@ void AndroidManifestEditorWidget::initializePage()
m_permissionsComboBox->setEditable(true);
layout->addWidget(m_permissionsComboBox, 4, 0);
m_addPermissionButton = new QPushButton(mainWidget);
m_addPermissionButton = new QPushButton(permissionsGroupBox);
m_addPermissionButton->setText(tr("Add"));
layout->addWidget(m_addPermissionButton, 4, 1);
permissionsPanel->setWidget(mainWidget);
permissionsGroupBox->setLayout(layout);
connect(m_addPermissionButton, SIGNAL(clicked()),
this, SLOT(addPermission()));
......@@ -361,9 +363,10 @@ void AndroidManifestEditorWidget::initializePage()
connect(m_permissionsComboBox, SIGNAL(currentTextChanged(QString)),
this, SLOT(updateAddRemovePermissionButtons()));
}
generalPanel->addPropertiesPanel(permissionsPanel);
m_overlayWidget = generalPanel;
topLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Fixed, QSizePolicy::MinimumExpanding));
m_overlayWidget = mainWidget;
}
void AndroidManifestEditorWidget::resizeEvent(QResizeEvent *event)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment