~ubuntu-branches/ubuntu/karmic/qtcreator/karmic-security

« back to all changes in this revision

Viewing changes to src/plugins/designer/formeditorplugin.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Andres Rodriguez
  • Date: 2009-07-19 16:23:52 UTC
  • mfrom: (3.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090719162352-oni0h8hrrkdd3sil
Tags: 1.2.1-1ubuntu1
* Merge from debian unstable (LP: #399414), remaining changes:
  - Add qt-creator transitional package.
* debian/control: Conflicts on qt-creator (<< 1.2.1-1ubuntu1).

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
**
5
5
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
6
6
**
7
 
** Contact:  Qt Software Information (qt-info@nokia.com)
 
7
** Contact: Nokia Corporation (qt-info@nokia.com)
8
8
**
9
9
** Commercial Usage
10
10
**
23
23
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24
24
**
25
25
** If you are unsure which license is appropriate for your use, please
26
 
** contact the sales department at qt-sales@nokia.com.
 
26
** contact the sales department at http://www.qtsoftware.com/contact.
27
27
**
28
28
**************************************************************************/
29
29
 
44
44
#include <coreplugin/coreconstants.h>
45
45
#include <coreplugin/uniqueidmanager.h>
46
46
 
 
47
#include <QtCore/QCoreApplication>
47
48
#include <QtCore/QtPlugin>
48
49
#include <QtCore/QDebug>
49
50
#include <QtCore/QProcess>
 
51
#include <QtCore/QLibraryInfo>
 
52
#include <QtCore/QTranslator>
50
53
 
51
54
#ifdef CPP_ENABLED
52
55
#    include <QtGui/QAction>
115
118
        FormEditorW::ensureInitStage(FormEditorW::RegisterPlugins);
116
119
    }
117
120
 
 
121
    QString locale = qApp->property("qtc_locale").toString();
 
122
    if (!locale.isEmpty()) {
 
123
        QTranslator *qtr = new QTranslator(this);
 
124
        const QString &creatorTrPath =
 
125
                Core::ICore::instance()->resourcePath() + QLatin1String("/translations");
 
126
        const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
 
127
        const QString &trFile = QLatin1String("designer_") + locale;
 
128
        if (qtr->load(trFile, qtTrPath) || qtr->load(trFile, creatorTrPath))
 
129
            qApp->installTranslator(qtr);
 
130
    }
 
131
 
118
132
    error->clear();
119
133
    return true;
120
134
}
137
151
    wizardParameters.setTrCategory(tr("Qt"));
138
152
    const QString formFileType = QLatin1String(Constants::FORM_FILE_TYPE);
139
153
    wizardParameters.setName(tr("Qt Designer Form"));
140
 
    wizardParameters.setDescription(tr("This creates a new Qt Designer form file."));
 
154
    wizardParameters.setDescription(tr("Creates a Qt Designer form file (.ui)."));
141
155
    m_formWizard = new FormWizard(wizardParameters, this);
142
156
    addObject(m_formWizard);
143
157
 
144
158
#ifdef CPP_ENABLED
145
159
    wizardParameters.setKind(Core::IWizard::ClassWizard);
146
160
    wizardParameters.setName(tr("Qt Designer Form Class"));
147
 
    wizardParameters.setDescription(tr("This creates a new Qt Designer form class."));
 
161
    wizardParameters.setDescription(tr("Creates a Qt Designer form file (.ui) with a matching class."));
148
162
    m_formClassWizard = new FormClassWizard(wizardParameters, this);
149
163
    addObject(m_formClassWizard);
150
164
#endif