forked from qt-creator/qt-creator
PathChooser: Provide more direct access to button label
Change-Id: I1489f40432acd3b70cedac6aded40738dddca941 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -52,13 +52,6 @@
|
|||||||
This class has some validation logic for embedding into QWizardPage.
|
This class has some validation logic for embedding into QWizardPage.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const char * const Utils::PathChooser::browseButtonLabel =
|
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
QT_TRANSLATE_NOOP("Utils::PathChooser", "Choose...");
|
|
||||||
#else
|
|
||||||
QT_TRANSLATE_NOOP("Utils::PathChooser", "Browse...");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
// ------------------ PathValidatingLineEdit
|
// ------------------ PathValidatingLineEdit
|
||||||
@@ -251,7 +244,7 @@ PathChooser::PathChooser(QWidget *parent) :
|
|||||||
d->m_hLayout->addWidget(d->m_lineEdit);
|
d->m_hLayout->addWidget(d->m_lineEdit);
|
||||||
d->m_hLayout->setSizeConstraint(QLayout::SetMinimumSize);
|
d->m_hLayout->setSizeConstraint(QLayout::SetMinimumSize);
|
||||||
|
|
||||||
addButton(tr(browseButtonLabel), this, SLOT(slotBrowse()));
|
addButton(browseButtonLabel(), this, SLOT(slotBrowse()));
|
||||||
|
|
||||||
setLayout(d->m_hLayout);
|
setLayout(d->m_hLayout);
|
||||||
setFocusProxy(d->m_lineEdit);
|
setFocusProxy(d->m_lineEdit);
|
||||||
@@ -278,6 +271,11 @@ void PathChooser::insertButton(int index, const QString &text, QObject *receiver
|
|||||||
d->m_buttons.insert(index, button);
|
d->m_buttons.insert(index, button);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString Utils::PathChooser::browseButtonLabel()
|
||||||
|
{
|
||||||
|
return HostOsInfo::isMacHost() ? tr("Choose...") : tr("Browse...");
|
||||||
|
}
|
||||||
|
|
||||||
QAbstractButton *PathChooser::buttonAtIndex(int index) const
|
QAbstractButton *PathChooser::buttonAtIndex(int index) const
|
||||||
{
|
{
|
||||||
return d->m_buttons.at(index);
|
return d->m_buttons.at(index);
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ class QTCREATOR_UTILS_EXPORT PathChooser : public QWidget
|
|||||||
Q_PROPERTY(Utils::FileName baseFileName READ baseFileName WRITE setBaseFileName DESIGNABLE false)
|
Q_PROPERTY(Utils::FileName baseFileName READ baseFileName WRITE setBaseFileName DESIGNABLE false)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static const char * const browseButtonLabel;
|
static QString browseButtonLabel();
|
||||||
|
|
||||||
explicit PathChooser(QWidget *parent = 0);
|
explicit PathChooser(QWidget *parent = 0);
|
||||||
virtual ~PathChooser();
|
virtual ~PathChooser();
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ AndroidPackageCreationWidget::AndroidPackageCreationWidget(AndroidPackageCreatio
|
|||||||
m_prebundledLibs = new CheckModel(this);
|
m_prebundledLibs = new CheckModel(this);
|
||||||
|
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
m_ui->KeystoreLocationPushButton->setText(tr(Utils::PathChooser::browseButtonLabel));
|
m_ui->KeystoreLocationPushButton->setText(Utils::PathChooser::browseButtonLabel());
|
||||||
m_ui->signingDebugWarningIcon->hide();
|
m_ui->signingDebugWarningIcon->hide();
|
||||||
m_ui->signingDebugWarningLabel->hide();
|
m_ui->signingDebugWarningLabel->hide();
|
||||||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent)
|
|||||||
{
|
{
|
||||||
QWidget *versionInfoWidget = new QWidget();
|
QWidget *versionInfoWidget = new QWidget();
|
||||||
m_versionUi->setupUi(versionInfoWidget);
|
m_versionUi->setupUi(versionInfoWidget);
|
||||||
m_versionUi->editPathPushButton->setText(QCoreApplication::translate("Utils::PathChooser", PathChooser::browseButtonLabel));
|
m_versionUi->editPathPushButton->setText(PathChooser::browseButtonLabel());
|
||||||
|
|
||||||
QWidget *debuggingHelperDetailsWidget = new QWidget();
|
QWidget *debuggingHelperDetailsWidget = new QWidget();
|
||||||
m_debuggingHelperUi->setupUi(debuggingHelperDetailsWidget);
|
m_debuggingHelperUi->setupUi(debuggingHelperDetailsWidget);
|
||||||
|
|||||||
Reference in New Issue
Block a user