Commit 9cbee153 authored by hjk's avatar hjk

PathChooser: Provide more direct access to button label

Change-Id: I1489f40432acd3b70cedac6aded40738dddca941
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent 960725da
......@@ -52,13 +52,6 @@
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 {
// ------------------ PathValidatingLineEdit
......@@ -251,7 +244,7 @@ PathChooser::PathChooser(QWidget *parent) :
d->m_hLayout->addWidget(d->m_lineEdit);
d->m_hLayout->setSizeConstraint(QLayout::SetMinimumSize);
addButton(tr(browseButtonLabel), this, SLOT(slotBrowse()));
addButton(browseButtonLabel(), this, SLOT(slotBrowse()));
setLayout(d->m_hLayout);
setFocusProxy(d->m_lineEdit);
......@@ -278,6 +271,11 @@ void PathChooser::insertButton(int index, const QString &text, QObject *receiver
d->m_buttons.insert(index, button);
}
QString Utils::PathChooser::browseButtonLabel()
{
return HostOsInfo::isMacHost() ? tr("Choose...") : tr("Browse...");
}
QAbstractButton *PathChooser::buttonAtIndex(int index) const
{
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)
public:
static const char * const browseButtonLabel;
static QString browseButtonLabel();
explicit PathChooser(QWidget *parent = 0);
virtual ~PathChooser();
......
......@@ -148,7 +148,7 @@ AndroidPackageCreationWidget::AndroidPackageCreationWidget(AndroidPackageCreatio
m_prebundledLibs = new CheckModel(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->signingDebugWarningLabel->hide();
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
......
......@@ -114,7 +114,7 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent)
{
QWidget *versionInfoWidget = new QWidget();
m_versionUi->setupUi(versionInfoWidget);
m_versionUi->editPathPushButton->setText(QCoreApplication::translate("Utils::PathChooser", PathChooser::browseButtonLabel));
m_versionUi->editPathPushButton->setText(PathChooser::browseButtonLabel());
QWidget *debuggingHelperDetailsWidget = new QWidget();
m_debuggingHelperUi->setupUi(debuggingHelperDetailsWidget);
......
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