tizenmanifesteditorwidget.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. /****************************************************************************
  2. **
  3. ** Copyright (C) 2013 Jarek Pelczar <jpelczar@gmail.com>
  4. ** Copyright (C) 2014 Tomasz Olszak <olszak.tomasz@gmail.com>
  5. **
  6. ** This file is part of Qt Creator.
  7. **
  8. ** Commercial License Usage
  9. ** Licensees holding valid commercial Qt licenses may use this file in
  10. ** accordance with the commercial license agreement provided with the
  11. ** Software or, alternatively, in accordance with the terms contained in
  12. ** a written agreement between you and Digia. For licensing terms and
  13. ** conditions see http://qt.digia.com/licensing. For further information
  14. ** use the contact form at http://qt.digia.com/contact-us.
  15. **
  16. ** GNU Lesser General Public License Usage
  17. ** Alternatively, this file may be used under the terms of the GNU Lesser
  18. ** General Public License version 2.1 as published by the Free Software
  19. ** Foundation and appearing in the file LICENSE.LGPL included in the
  20. ** packaging of this file. Please review the following information to
  21. ** ensure the GNU Lesser General Public License version 2.1 requirements
  22. ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
  23. **
  24. ** In addition, as a special exception, Digia gives you certain additional
  25. ** rights. These rights are described in the Digia Qt LGPL Exception
  26. ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
  27. **
  28. ****************************************************************************/
  29. #include "tizendebug.h"
  30. #include "tizenmanifesteditorwidget.h"
  31. #include "tizenmanifestdocument.h"
  32. #include "tizenmanifesteditor.h"
  33. #include "tizenconstants.h"
  34. #include <coreplugin/icore.h>
  35. #include <coreplugin/infobar.h>
  36. #include <texteditor/texteditorsettings.h>
  37. #include "botan/botan.h"
  38. #include <QResizeEvent>
  39. #include <QTimer>
  40. #include <QDomDocument>
  41. #include <QVBoxLayout>
  42. #include <QDebug>
  43. using namespace TextEditor;
  44. namespace Tizen {
  45. namespace Internal {
  46. static const char TIZEN_MANIFEST_EDITOR_GENERAL_PANE_CONTEXT_ID[] = "Tizen.Manifest.Editor.General.Pane.Context";
  47. static const char TIZEN_MANIFEST_EDITOR_INFO_BAR_ID[] = "Tizen.Manifest.Editor.Info.Bar.Id";
  48. TizenManifestEditorWidget::TizenManifestEditorWidget() :
  49. QWidget(),
  50. m_dirty(false),
  51. m_stayClean(false)
  52. {
  53. m_textEditorWidget = new TizenManifestTextEditorWidget(this);
  54. TextEditor::TextEditorSettings::initializeEditor(m_textEditorWidget);
  55. initializePage();
  56. m_parseTimer = new QTimer(this);
  57. m_parseTimer->setSingleShot(true);
  58. m_parseTimer->setInterval(800);
  59. m_editor = new TizenManifestEditor(this);
  60. connect(m_parseTimer, SIGNAL(timeout()), SLOT(delayedParseCheck()));
  61. connect(m_textEditorWidget->document(), SIGNAL(contentsChanged()),
  62. this, SLOT(startParseCheck()));
  63. }
  64. bool TizenManifestEditorWidget::isModified() const
  65. {
  66. return m_dirty;
  67. }
  68. bool TizenManifestEditorWidget::open(QString *errorString, const QString &fileName, const QString &realFileName)
  69. {
  70. if(!m_textEditorWidget->open(errorString, fileName, realFileName))
  71. return false;
  72. int errorLine, errorColumn;
  73. QString error;
  74. QDomDocument doc;
  75. if(doc.setContent(m_textEditorWidget->toPlainText(), &error, &errorLine, &errorColumn)) {
  76. if(checkDocument(doc, &error, &errorLine, &errorColumn)) {
  77. if(activePage() != Source)
  78. syncToWidgets(doc);
  79. return true;
  80. }
  81. }
  82. updateInfoBar(error, errorLine, errorColumn);
  83. setActivePage(Source);
  84. return true;
  85. }
  86. void TizenManifestEditorWidget::preSave()
  87. {
  88. if(activePage() != Source)
  89. syncToEditor();
  90. updateInfoBar();
  91. }
  92. TizenManifestEditorWidget::EditorPage TizenManifestEditorWidget::activePage() const
  93. {
  94. return TizenManifestEditorWidget::EditorPage(m_stackedWidget->currentIndex());
  95. }
  96. bool TizenManifestEditorWidget::setActivePage(EditorPage page)
  97. {
  98. EditorPage prevPage = activePage();
  99. if(prevPage == page)
  100. return true;
  101. if(page == Source) {
  102. syncToEditor();
  103. setFocus();
  104. } else {
  105. if(!syncToWidgets())
  106. return false;
  107. }
  108. m_stackedWidget->setCurrentIndex(page);
  109. return true;
  110. }
  111. Core::IEditor *TizenManifestEditorWidget::editor() const
  112. {
  113. return m_editor;
  114. }
  115. TextEditor::PlainTextEditorWidget *TizenManifestEditorWidget::textEditorWidget() const
  116. {
  117. return m_textEditorWidget;
  118. }
  119. void TizenManifestEditorWidget::initializePage()
  120. {
  121. QHBoxLayout *layout = new QHBoxLayout(this);
  122. layout->setMargin(0);
  123. m_stackedWidget = new QStackedWidget(this); // simplfy make TizenManifestEditorWidget a stacked widget
  124. layout->addWidget(m_stackedWidget);
  125. Core::IContext * myContext = new Core::IContext(m_stackedWidget);
  126. myContext->setWidget(m_stackedWidget);
  127. myContext->setContext(Core::Context(TIZEN_MANIFEST_EDITOR_GENERAL_PANE_CONTEXT_ID));
  128. Core::ICore::addContextObject(myContext);
  129. QWidget *mainWidget = new QWidget;
  130. m_form.setupUi(mainWidget);
  131. connect(m_form.addFeatureButton, SIGNAL(clicked()), SLOT(addFeatureClicked()));
  132. connect(m_form.removeFeatureButton, SIGNAL(clicked()), SLOT(removeFeatureClicked()));
  133. connect(m_form.featuresList, SIGNAL(itemSelectionChanged()), SLOT(updateFeaturesButton()));
  134. connect(m_form.featureValueComboBox, SIGNAL(currentIndexChanged(int)), SLOT(featureValueIndexChanged(int)));
  135. connect(m_form.generateAppIdButton, SIGNAL(clicked()), SLOT(generateAppId()));
  136. connect(m_form.authorLineEdit, SIGNAL(textChanged(QString)), SLOT(authorChanged(QString)));
  137. connect(m_form.urlLineEdit, SIGNAL(textChanged(QString)), SLOT(urlChanged(QString)));
  138. connect(m_form.applicationNameEditor,SIGNAL(textChanged(QString)),SLOT(setDirty()));
  139. connect(m_form.appIdEditor,SIGNAL(textChanged(QString)),SLOT(setDirty()));
  140. connect(m_form.versionEditor,SIGNAL(textChanged(QString)),SLOT(setDirty()));
  141. connect(m_form.checkBoxShowMainMenuIcon,SIGNAL(toggled(bool)),SLOT(setDirty()));
  142. connect(m_form.checkBoxShowHideFromHistoryList,SIGNAL(toggled(bool)),SLOT(setDirty()));
  143. updateFeaturesButton();
  144. m_stackedWidget->insertWidget(General, mainWidget);
  145. m_stackedWidget->insertWidget(Source, m_textEditorWidget);
  146. }
  147. void TizenManifestEditorWidget::delayedParseCheck()
  148. {
  149. m_parseTimer->start();
  150. }
  151. void TizenManifestEditorWidget::startParseCheck()
  152. {
  153. updateInfoBar();
  154. }
  155. void TizenManifestEditorWidget::updateInfoBar()
  156. {
  157. if(activePage() != Source) {
  158. m_parseTimer->stop();
  159. return;
  160. }
  161. QDomDocument doc;
  162. int errorLine, errorColumn;
  163. QString error;
  164. if(doc.setContent(m_textEditorWidget->toPlainText(), &error, &errorLine, &errorColumn)) {
  165. if(checkDocument(doc, &error, &errorLine, &errorColumn)) {
  166. hideInfoBar();
  167. return;
  168. }
  169. }
  170. updateInfoBar(error, errorLine, errorColumn);
  171. }
  172. void TizenManifestEditorWidget::setDirty(bool dirty)
  173. {
  174. if(m_stayClean || dirty == m_dirty)
  175. return;
  176. m_dirty = dirty;
  177. emit guiChanged();
  178. }
  179. bool TizenManifestEditorWidget::checkDocument(QDomDocument doc, QString * errorMessage, int * errorLine, int * errorColumn)
  180. {
  181. QDomElement manifest = doc.documentElement();
  182. if(manifest.tagName() != QLatin1String("Manifest")) {
  183. *errorMessage = tr("Tizen Manifest file must begin with \"Manifest\" element");
  184. *errorLine = manifest.lineNumber();
  185. *errorColumn = manifest.columnNumber();
  186. return false;
  187. }
  188. return true;
  189. }
  190. void TizenManifestEditorWidget::updateInfoBar(QString errorMessage, int errorLine, int errorColumn)
  191. {
  192. Core::InfoBar *bar = m_textEditorWidget->baseTextDocument()->infoBar();
  193. QString text;
  194. if(errorLine < 0)
  195. text = tr("Could not parse file: '%1'").arg(errorMessage);
  196. else
  197. text = tr("%2: Could not parse file: '%1'").arg(errorMessage).arg(errorLine);
  198. Core::InfoBarEntry infoBarEntry(TIZEN_MANIFEST_EDITOR_INFO_BAR_ID, text);
  199. bar->removeInfo(TIZEN_MANIFEST_EDITOR_INFO_BAR_ID);
  200. bar->addInfo(infoBarEntry);
  201. m_errorLine = errorLine;
  202. m_errorColumn = errorColumn;
  203. m_parseTimer->stop();
  204. }
  205. void TizenManifestEditorWidget::hideInfoBar()
  206. {
  207. Core::InfoBar * bar = m_textEditorWidget->baseTextDocument()->infoBar();
  208. bar->removeInfo(TIZEN_MANIFEST_EDITOR_INFO_BAR_ID);
  209. m_parseTimer->stop();
  210. }
  211. bool TizenManifestEditorWidget::syncToWidgets()
  212. {
  213. QDomDocument doc;
  214. QString errorMessage;
  215. int errorLine, errorColumn;
  216. if(doc.setContent(m_textEditorWidget->toPlainText(), &errorMessage, &errorLine, &errorColumn)) {
  217. if(checkDocument(doc, &errorMessage, &errorLine, &errorColumn)) {
  218. hideInfoBar();
  219. syncToWidgets(doc);
  220. return true;
  221. }
  222. }
  223. updateInfoBar(errorMessage, errorLine, errorColumn);
  224. return false;
  225. }
  226. void TizenManifestEditorWidget::syncToWidgets(QDomDocument doc)
  227. {
  228. m_stayClean = true;
  229. QDomElement manifest = doc.documentElement();
  230. QDomElement appId = manifest.firstChildElement(QLatin1String("Id"));
  231. m_form.appIdEditor->setText(appId.text());
  232. QDomElement version = manifest.firstChildElement(QLatin1String("Version"));
  233. m_form.versionEditor->setText(version.text());
  234. QDomElement requirements = manifest.firstChildElement(QLatin1String("Requirements"));
  235. const QString kFeature(QLatin1String("Feature"));
  236. const QString kName(QLatin1String("Name"));
  237. QDomElement author = manifest.firstChildElement(QLatin1String("Author"));
  238. m_form.authorLineEdit->setText(author.text());
  239. QDomElement url = manifest.firstChildElement(QLatin1String("Url"));
  240. m_form.urlLineEdit->setText(url.text());
  241. QDomElement type = manifest.firstChildElement(QLatin1String("Type"));
  242. m_form.appTypeCombo->setCurrentIndex(m_form.appTypeCombo->findText(type.text()));
  243. QDomElement apps = manifest.firstChildElement(QLatin1String("Apps"));
  244. QDomElement uiApp = apps.firstChildElement(QLatin1String("UiApp"));
  245. m_form.applicationNameEditor->setText(uiApp.attribute(QLatin1String("Name")));
  246. m_form.checkBoxShowMainMenuIcon->setChecked(uiApp.attribute(QLatin1String("MenuIconVisible")).toLower() == QLatin1String("true"));
  247. m_form.checkBoxShowHideFromHistoryList->setChecked(uiApp.attribute(QLatin1String("LaunchingHistoryVisible")).toLower() == QLatin1String("true"));
  248. QDomElement displayNames = uiApp.firstChildElement(QLatin1String("DisplayNames"));
  249. m_form.displayNameTable->clearContents();
  250. QDomNodeList displayNamesNodeList = displayNames.elementsByTagName(QLatin1String("DisplayName"));
  251. m_form.displayNameTable->setRowCount(displayNamesNodeList.size());
  252. QDomElement displayName;
  253. for(int i = 0; i < displayNamesNodeList.size(); i++) {
  254. displayName = displayNamesNodeList.at(i).toElement();
  255. m_form.displayNameTable->setItem(i,0,new QTableWidgetItem(displayName.text()));
  256. m_form.displayNameTable->setItem(i,1,new QTableWidgetItem(displayName.attribute(QLatin1String("Locale"))));
  257. }
  258. m_form.featuresList->clear();
  259. m_featureValues.clear();
  260. QStringList features;
  261. for(QDomElement child = requirements.firstChildElement(kFeature) ; !child.isNull() ; child = child.nextSiblingElement(kFeature)) {
  262. QString name = child.attribute(kName);
  263. QString value = child.text().trimmed();
  264. m_form.featuresList->addItem(name);
  265. m_featureValues[name] = value;
  266. }
  267. m_form.featuresList->addItems(features);
  268. updateFeaturesButton();
  269. m_stayClean = false;
  270. m_dirty = false;
  271. }
  272. void TizenManifestEditorWidget::updateValue(QDomElement parent, const QString& element, const QString& value)
  273. {
  274. QDomDocument doc = parent.ownerDocument();
  275. QDomElement prevChild = parent.firstChildElement(element);
  276. QDomElement newChild;
  277. if(!value.isEmpty()) {
  278. newChild = doc.createElement(element);
  279. newChild.appendChild(doc.createTextNode(value));
  280. }
  281. if(prevChild.isNull()) {
  282. if(!value.isEmpty())
  283. parent.appendChild(newChild);
  284. } else {
  285. if(value.isEmpty())
  286. parent.removeChild(prevChild);
  287. else
  288. parent.replaceChild(newChild, prevChild);
  289. }
  290. }
  291. void TizenManifestEditorWidget::syncToEditor()
  292. {
  293. QDomDocument doc;
  294. if(!doc.setContent(m_textEditorWidget->toPlainText())) {
  295. updateInfoBar();
  296. return;
  297. }
  298. QDomElement manifest = doc.documentElement();
  299. QDomElement appId = manifest.firstChildElement(QLatin1String("Id"));
  300. QDomElement newAppId = doc.createElement(QLatin1String("Id"));
  301. newAppId.appendChild(doc.createTextNode(m_form.appIdEditor->text()));
  302. manifest.replaceChild(newAppId, appId);
  303. QDomElement version = manifest.firstChildElement(QLatin1String("Version"));
  304. QDomElement newVersion = doc.createElement(QLatin1String("Version"));
  305. newVersion.appendChild(doc.createTextNode(m_form.versionEditor->text())) ;
  306. manifest.replaceChild(newVersion, version);
  307. QDomElement apps = manifest.firstChildElement(QLatin1String("Apps"));
  308. QDomElement uiApp = apps.firstChildElement(QLatin1String("UiApp"));
  309. uiApp.setAttribute(QLatin1String("Name"),m_form.applicationNameEditor->text());
  310. QString menuIconVisibleValue = QLatin1String(m_form.checkBoxShowMainMenuIcon->isChecked() ? "True" : "False");
  311. QString launchHistoryVisible = QLatin1String(m_form.checkBoxShowHideFromHistoryList->isChecked() ? "True" : "False");
  312. uiApp.setAttribute(QLatin1String("MenuIconVisible"),menuIconVisibleValue);
  313. uiApp.setAttribute(QLatin1String("LaunchingHistoryVisible"),launchHistoryVisible);
  314. const QString kRequirements(QLatin1String("Requirements"));
  315. QDomElement features = doc.createElement(kRequirements);
  316. const QString kFeature(QLatin1String("Feature"));
  317. const QString kName(QLatin1String("Name"));
  318. updateValue(manifest, QLatin1String("Author"), m_form.authorLineEdit->text().trimmed());
  319. updateValue(manifest, QLatin1String("Url"), m_form.urlLineEdit->text().trimmed());
  320. for(int i = 0 ; i < m_form.featuresList->count() ; ++i) {
  321. QDomElement feature = doc.createElement(kFeature);
  322. feature.setAttribute(kName, m_form.featuresList->item(i)->text());
  323. feature.appendChild(doc.createTextNode(m_featureValues[m_form.featuresList->item(i)->text()]));
  324. features.appendChild(feature);
  325. }
  326. manifest.replaceChild(features, manifest.firstChildElement(kRequirements));
  327. QString newText = doc.toString(4);
  328. if(newText == m_textEditorWidget->toPlainText())
  329. return;
  330. m_textEditorWidget->setPlainText(newText);
  331. m_textEditorWidget->document()->setModified(true);
  332. m_dirty = false;
  333. }
  334. void TizenManifestEditorWidget::addFeatureClicked()
  335. {
  336. }
  337. void TizenManifestEditorWidget::removeFeatureClicked()
  338. {
  339. QModelIndex featureIndex = m_form.featuresList->currentIndex();
  340. if(featureIndex.isValid()) {
  341. QAbstractItemModel * model = m_form.featuresList->model();
  342. model->removeRow(featureIndex.row());
  343. setDirty();
  344. }
  345. }
  346. void TizenManifestEditorWidget::updateFeaturesButton()
  347. {
  348. m_form.removeFeatureButton->setDisabled(m_form.featuresList->currentItem() == NULL);
  349. if(m_featureValues.isEmpty() && m_form.featurePropertiesGroup->isVisible()) {
  350. m_form.featurePropertiesGroup->hide();
  351. } else if(m_form.featuresList->currentItem() == NULL && m_form.featurePropertiesGroup->isVisible()) {
  352. m_form.featurePropertiesGroup->hide();
  353. } else if(m_form.featuresList->currentItem()) {
  354. QListWidgetItem * item = m_form.featuresList->currentItem();
  355. QString key = item->text();
  356. QString value = m_featureValues.value(key);
  357. QHash<QString, QList<TizenFeatureValue> > features = this->features();
  358. QList<TizenFeatureValue> values = features.value(key);
  359. m_form.featureDescriptionLabel->setText(QString());
  360. QStringList comboValues;
  361. comboValues.reserve(values.size());
  362. int currentIndex = -1;
  363. int index = 0;
  364. foreach(const TizenFeatureValue& v, values) {
  365. comboValues.append(v.value);
  366. if(v.value == value) {
  367. currentIndex = index;
  368. m_form.featureDescriptionLabel->setText(v.description);
  369. } else {
  370. ++index;
  371. }
  372. }
  373. m_form.featureValueComboBox->clear();
  374. m_form.featureValueComboBox->addItems(comboValues);
  375. if(currentIndex != -1) {
  376. m_form.featureValueComboBox->setDisabled(comboValues.count() < 2);
  377. m_form.featureValueComboBox->setCurrentIndex(currentIndex);
  378. } else
  379. m_form.featureValueComboBox->setDisabled(true);
  380. if(!m_form.featurePropertiesGroup->isVisible())
  381. m_form.featurePropertiesGroup->show();
  382. }
  383. }
  384. void TizenManifestEditorWidget::featureValueIndexChanged(int index)
  385. {
  386. if(index < 0)
  387. return;
  388. if(QListWidgetItem * item = m_form.featuresList->currentItem()) {
  389. QString key = item->text();
  390. if(key != m_featureValues[key]) {
  391. m_featureValues[key] = m_form.featureValueComboBox->currentText();
  392. setDirty(true);
  393. }
  394. }
  395. }
  396. QHash<QString, QList<TizenManifestEditorWidget::TizenFeatureValue> > TizenManifestEditorWidget::features()
  397. {
  398. if(!m_features.isEmpty())
  399. return m_features;
  400. QDomDocument doc;
  401. QFile srcFile(QLatin1String(":/tizen/resource/features.xml"));
  402. if(srcFile.open(QFile::ReadOnly)) {
  403. QString errorText;
  404. int errorLine, errorColumn;
  405. if(doc.setContent(&srcFile, &errorText, &errorLine, &errorColumn)) {
  406. const QString kFeature(QLatin1String("Feature"));
  407. const QString kName(QLatin1String("Name"));
  408. const QString kOption(QLatin1String("Option"));
  409. const QString kValue(QLatin1String("Value"));
  410. const QString kDescription(QLatin1String("Description"));
  411. const QString kDefault(QLatin1String("Default"));
  412. QDomElement root = doc.documentElement();
  413. for(QDomElement feature = root.firstChildElement(kFeature) ; !feature.isNull() ; feature = feature.nextSiblingElement(kFeature)) {
  414. QString name = feature.attribute(kName);
  415. QList<TizenFeatureValue> options;
  416. for(QDomElement option = feature.firstChildElement(kOption) ; !option.isNull() ; option = option.nextSiblingElement(kOption)) {
  417. bool isDefault = option.attribute(kDefault) == QLatin1String("true");
  418. options.append(TizenFeatureValue(option.attribute(kValue), option.attribute(kDescription), isDefault));
  419. }
  420. m_features[name] = options;
  421. }
  422. } else {
  423. #ifdef QT_DEBUG
  424. qWarning() << "Can't parse XML with error" << errorText << "@" << errorLine << ":" << errorColumn;
  425. #endif
  426. }
  427. } else {
  428. #ifdef QT_DEBUG
  429. qWarning() << "Can't open features XML:" << srcFile.errorString();
  430. #endif
  431. }
  432. return m_features;
  433. }
  434. void TizenManifestEditorWidget::generateAppId()
  435. {
  436. static const char APP_ID_CHARS[] = "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  437. Botan::AutoSeeded_RNG rng;
  438. rng.reseed();
  439. Botan::byte bytes[10];
  440. rng.randomize(bytes, sizeof(bytes));
  441. QString appId;
  442. appId.reserve(sizeof(bytes));
  443. for(int i = 0 ; i < (int)sizeof(bytes) ; ++i) {
  444. appId.append(QLatin1Char(APP_ID_CHARS[bytes[i] % (sizeof(APP_ID_CHARS) - 1)]));
  445. }
  446. m_form.appIdEditor->setText(appId);
  447. setDirty();
  448. }
  449. void TizenManifestEditorWidget::authorChanged(QString author)
  450. {
  451. Q_UNUSED(author)
  452. setDirty();
  453. }
  454. void TizenManifestEditorWidget::urlChanged(QString url)
  455. {
  456. Q_UNUSED(url)
  457. setDirty();
  458. }
  459. TizenManifestTextEditorWidget::TizenManifestTextEditorWidget(TizenManifestEditorWidget *parent)
  460. : TextEditor::PlainTextEditorWidget(new TizenManifestDocument(parent), parent),
  461. m_parent(parent)
  462. {
  463. baseTextDocument()->setMimeType(QLatin1String(Constants::TIZEN_MANIFEST_MIME_TYPE));
  464. }
  465. } // namespace Internal
  466. } // namespace Tizen