~bzoltan/kubuntu-packaging/decouple_cmake_plugin

« back to all changes in this revision

Viewing changes to src/plugins/genericprojectmanager/genericprojectwizard.cpp

  • Committer: Timo Jyrinki
  • Date: 2013-11-15 12:25:23 UTC
  • mfrom: (1.1.28)
  • Revision ID: timo.jyrinki@canonical.com-20131115122523-i2kyamsu4gs2mu1m
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
//////////////////////////////////////////////////////////////////////////////
109
109
 
110
110
GenericProjectWizard::GenericProjectWizard()
111
 
    : Core::BaseFileWizard(parameters())
112
 
{ }
113
 
 
114
 
Core::FeatureSet GenericProjectWizard::requiredFeatures() const
115
 
{
116
 
    return Core::FeatureSet();
117
 
}
118
 
 
119
 
Core::BaseFileWizardParameters GenericProjectWizard::parameters()
120
 
{
121
 
    Core::BaseFileWizardParameters parameters(ProjectWizard);
 
111
{
 
112
    setWizardKind(ProjectWizard);
122
113
    // TODO do something about the ugliness of standard icons in sizes different than 16, 32, 64, 128
123
114
    {
124
115
        QPixmap icon(22, 22);
125
116
        icon.fill(Qt::transparent);
126
117
        QPainter p(&icon);
127
118
        p.drawPixmap(3, 3, 16, 16, qApp->style()->standardIcon(QStyle::SP_DirIcon).pixmap(16));
128
 
        parameters.setIcon(icon);
 
119
        setIcon(icon);
129
120
    }
130
 
    parameters.setDisplayName(tr("Import Existing Project"));
131
 
    parameters.setId(QLatin1String("Z.Makefile"));
132
 
    parameters.setDescription(tr("Imports existing projects that do not use qmake, CMake or Autotools. "
133
 
                                 "This allows you to use Qt Creator as a code editor."));
134
 
    parameters.setCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY));
135
 
    parameters.setDisplayCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY_DISPLAY));
136
 
    parameters.setFlags(Core::IWizard::PlatformIndependent);
137
 
    return parameters;
 
121
    setDisplayName(tr("Import Existing Project"));
 
122
    setId(QLatin1String("Z.Makefile"));
 
123
    setDescription(tr("Imports existing projects that do not use qmake, CMake or Autotools. "
 
124
                      "This allows you to use Qt Creator as a code editor."));
 
125
    setCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY));
 
126
    setDisplayCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY_DISPLAY));
 
127
    setFlags(Core::IWizard::PlatformIndependent);
138
128
}
139
129
 
140
130
QWizard *GenericProjectWizard::createWizardDialog(QWidget *parent,
141
131
                                                  const Core::WizardDialogParameters &wizardDialogParameters) const
142
132
{
143
133
    GenericProjectWizardDialog *wizard = new GenericProjectWizardDialog(parent);
144
 
    setupWizard(wizard);
145
134
 
146
135
    wizard->setPath(wizardDialogParameters.defaultPath());
147
136
 
166
155
    const QString configFileName = QFileInfo(dir, projectName + QLatin1String(".config")).absoluteFilePath();
167
156
    const QStringList paths = wizard->selectedPaths();
168
157
 
169
 
    Core::MimeDatabase *mimeDatabase = Core::ICore::mimeDatabase();
170
 
 
171
 
    Core::MimeType headerTy = mimeDatabase->findByType(QLatin1String("text/x-chdr"));
 
158
    Core::MimeType headerTy = Core::MimeDatabase::findByType(QLatin1String("text/x-chdr"));
172
159
 
173
160
    QStringList nameFilters;
174
161
    foreach (const Core::MimeGlobPattern &gp, headerTy.globPatterns())