Changeset View
Changeset View
Standalone View
Standalone View
src/kalzium.cpp
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Line(s) | |||||
68 | #include <QLocale> | 68 | #include <QLocale> | ||
69 | #include <KPluginLoader> | 69 | #include <KPluginLoader> | ||
70 | #include <QGridLayout> | 70 | #include <QGridLayout> | ||
71 | #include <KLocalizedString> | 71 | #include <KLocalizedString> | ||
72 | #include <QStandardPaths> | 72 | #include <QStandardPaths> | ||
73 | 73 | | |||
74 | #define IDS_ELEMENTINFO 7 | 74 | #define IDS_ELEMENTINFO 7 | ||
75 | 75 | | |||
76 | Kalzium::Kalzium() : KXmlGuiWindow(0) | 76 | Kalzium::Kalzium() : KXmlGuiWindow(nullptr) | ||
77 | { | 77 | { | ||
78 | setObjectName("KalziumMainWindow"); | 78 | setObjectName("KalziumMainWindow"); | ||
79 | 79 | | |||
80 | // Init pointers with null | 80 | // Init pointers with null | ||
81 | m_infoDialog = 0; | 81 | m_infoDialog = nullptr; | ||
82 | m_isotopeDialog = 0; | 82 | m_isotopeDialog = nullptr; | ||
83 | m_elementDataPlotter = 0; | 83 | m_elementDataPlotter = nullptr; | ||
84 | m_tablesDialog = 0; | 84 | m_tablesDialog = nullptr; | ||
85 | m_rsDialog = 0; | 85 | m_rsDialog = nullptr; | ||
86 | m_calculator = 0; | 86 | m_calculator = nullptr; | ||
87 | m_exportDialog = 0; | 87 | m_exportDialog = nullptr; | ||
88 | m_glossarydlg = 0; | 88 | m_glossarydlg = nullptr; | ||
89 | m_elementInfo = 0; | 89 | m_elementInfo = nullptr; | ||
90 | 90 | | |||
91 | // reading the elements from file | 91 | // reading the elements from file | ||
92 | KalziumDataObject::instance(); | 92 | KalziumDataObject::instance(); | ||
93 | 93 | | |||
94 | Search *newsearch = new Search(); | 94 | Search *newsearch = new Search(); | ||
95 | KalziumDataObject::instance()->setSearch(newsearch); | 95 | KalziumDataObject::instance()->setSearch(newsearch); | ||
96 | 96 | | |||
97 | // Main pse-Table Tablewidget | 97 | // Main pse-Table Tablewidget | ||
▲ Show 20 Lines • Show All 278 Lines • ▼ Show 20 Line(s) | |||||
376 | } | 376 | } | ||
377 | 377 | | |||
378 | MoleculeDialog *Kalzium::slotMoleculeviewer() | 378 | MoleculeDialog *Kalzium::slotMoleculeviewer() | ||
379 | { | 379 | { | ||
380 | #if defined(HAVE_OPENBABEL2) && defined(HAVE_EIGEN) && defined(HAVE_AVOGADRO) | 380 | #if defined(HAVE_OPENBABEL2) && defined(HAVE_EIGEN) && defined(HAVE_AVOGADRO) | ||
381 | 381 | | |||
382 | if (!QGLFormat::hasOpenGL()) { | 382 | if (!QGLFormat::hasOpenGL()) { | ||
383 | QMessageBox::critical(Q_NULLPTR, i18n("Kalzium Error"), i18n("This system does not support OpenGL.")); | 383 | QMessageBox::critical(Q_NULLPTR, i18n("Kalzium Error"), i18n("This system does not support OpenGL.")); | ||
384 | return NULL; | 384 | return nullptr; | ||
385 | } | 385 | } | ||
386 | 386 | | |||
387 | MoleculeDialog * d = new MoleculeDialog(this); | 387 | MoleculeDialog * d = new MoleculeDialog(this); | ||
388 | d->show(); | 388 | d->show(); | ||
389 | return d; | 389 | return d; | ||
390 | 390 | | |||
391 | #if 0 | 391 | #if 0 | ||
392 | KPluginLoader loader("libkalziumglpart"); | 392 | KPluginLoader loader("libkalziumglpart"); | ||
393 | KPluginFactory* factory = loader.factory(); | 393 | KPluginFactory* factory = loader.factory(); | ||
394 | 394 | | |||
395 | if (factory) { | 395 | if (factory) { | ||
396 | KParts::ReadOnlyPart *part = 0; | 396 | KParts::ReadOnlyPart *part = 0; | ||
397 | part = static_cast<KParts::ReadOnlyPart*>(factory->create(this, "KalziumGLPart")); | 397 | part = static_cast<KParts::ReadOnlyPart*>(factory->create(this, "KalziumGLPart")); | ||
398 | 398 | | |||
399 | part->widget()->show(); | 399 | part->widget()->show(); | ||
400 | } | 400 | } | ||
401 | #endif | 401 | #endif | ||
402 | #endif | 402 | #endif | ||
403 | return NULL; | 403 | return nullptr; | ||
404 | } | 404 | } | ||
405 | 405 | | |||
406 | void Kalzium::slotTables() | 406 | void Kalzium::slotTables() | ||
407 | { | 407 | { | ||
408 | if (!m_tablesDialog) { | 408 | if (!m_tablesDialog) { | ||
409 | m_tablesDialog = new TablesDialog(this); | 409 | m_tablesDialog = new TablesDialog(this); | ||
410 | } | 410 | } | ||
411 | m_tablesDialog->show(); | 411 | m_tablesDialog->show(); | ||
▲ Show 20 Lines • Show All 243 Lines • Show Last 20 Lines |