summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnu Mittal <anu22mittal@gmail.com>2015-02-27 15:52:40 (GMT)
committerAnu Mittal <anu22mittal@gmail.com>2015-02-27 15:52:40 (GMT)
commit97d4d053ce254b3e57ad10b484d178d3a6aad4e4 (patch)
treecfce4d176fc4826f1f6661e9c956c643680fa2a7
parentb01feabb497a05e1b2703b4a0d674e6aab7987c5 (diff)
src kalzium.cpp and main.cpp ported
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/kalzium.cpp21
-rw-r--r--src/main.cpp8
3 files changed, 17 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8c2aed5..daeda20 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,7 +6,7 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${OPENBABEL2_INCL
find_package(OpenBabel2 REQUIRED)
find_package(Qt5 REQUIRED COMPONENTS Widgets Script OpenGL)
find_package(Qt5Svg REQUIRED)
-find_package(KF5 REQUIRED COMPONENTS CoreAddons Solid Config Archive I18n Parts UnitConversion WidgetsAddons NewStuff KDELibs4Support)
+find_package(KF5 REQUIRED COMPONENTS CoreAddons Solid Config Archive KHtml I18n Parts UnitConversion WidgetsAddons NewStuff KDELibs4Support)
find_package(KF5DocTools REQUIRED)
find_package(KF5Plotting REQUIRED)
find_package(Qt5Widgets REQUIRED)
diff --git a/src/kalzium.cpp b/src/kalzium.cpp
index f52cf5b..f51c36b 100644
--- a/src/kalzium.cpp
+++ b/src/kalzium.cpp
@@ -51,7 +51,7 @@
#include <QToolBox>
#include <QKeyEvent>
#include <QRegExp>
-#include <QStatusBar>
+#include <KStatusBar>
#include <kmessagebox.h>
#include <kconfigdialog.h>
@@ -556,20 +556,23 @@ void Kalzium::slotShowExportDialog()
void Kalzium::setupStatusBar()
{
- statusBar()->insertWiget("", 0, 0);
- statusBar()->setItemAlignment(0, Qt::AlignRight);
-
- statusBar()->insertItem("", IDS_ELEMENTINFO, 1);
- statusBar()->setItemAlignment(IDS_ELEMENTINFO, Qt::AlignRight);
- statusBar()->show();
+ KStatusBar *statusBar = new KStatusBar(this);
+ setStatusBar(statusBar);
+
+ statusBar->insertItem("", 0, 0);
+ statusBar->setItemAlignment(0, Qt::AlignRight);
+ statusBar->insertItem("", IDS_ELEMENTINFO, 1);
+ statusBar->setItemAlignment(IDS_ELEMENTINFO, Qt::AlignRight);
+ statusBar->show();
}
void Kalzium::elementHover(int num)
{
// extractIconicInformationAboutElement(num);
-
Element *e = KalziumDataObject::instance()->element(num);
- statusBar()->changeItem(i18nc("For example: \"Carbon (6), Mass: 12.0107 u\"", "%1 (%2), Mass: %3 u",
+ KStatusBar *statusBar = new KStatusBar(this);
+ setStatusBar(statusBar);
+ statusBar->changeItem(i18nc("For example: \"Carbon (6), Mass: 12.0107 u\"", "%1 (%2), Mass: %3 u",
e->dataAsString(ChemicalDataObject::name),
e->dataAsString(ChemicalDataObject::atomicNumber),
e->dataAsString(ChemicalDataObject::mass)), IDS_ELEMENTINFO);
diff --git a/src/main.cpp b/src/main.cpp
index c3b910b..4ecc6f1 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -22,6 +22,7 @@
#include <klocale.h>
#include <kapplication.h>
+
#include "kalzium.h"
#include <config-kalzium.h>
@@ -44,7 +45,7 @@ int main(int argc, char **argv)
caml_startup(argv);
#endif
- KAboutData about("kalzium", 0, ki18n("Kalzium"), version, ki18n(description),
+ /* KAboutData about("kalzium", 0, ki18n("Kalzium"), version, ki18n(description),
KAboutData::License_GPL, ki18n("(C) 2002-2014 Carsten Niehaus"), KLocalizedString(), "http://edu.kde.org/kalzium");
about.addAuthor(ki18n("Carsten Niehaus"), KLocalizedString(), "cniehaus@kde.org");
about.addCredit(ki18n("Pino Toscano"), ki18n("Large code contributions; resident guru helping the other developers"));
@@ -72,11 +73,10 @@ int main(int argc, char **argv)
about.addCredit(ki18n("Tiago Porangaba"),ki18n("New interface design and usability improvements"));
about.addCredit(ki18n("Etienne Rebetez"),ki18n("Adding new sizable Periodic System"));
- KCmdLineArgs::init(argc, argv, &about);
-
+ KCmdLineArgs::init(argc, argv, &about);*/
KCmdLineOptions options;
#if defined(HAVE_OPENBABEL2) && defined(HAVE_EIGEN) && defined(HAVE_AVOGADRO)
- options.add("molecule <file>", ki18n("Open the given molecule file"));
+ options.add("molecule <file>", ki18n("Open the given molecule file"));
#endif
KCmdLineArgs::addCmdLineOptions(options);
KApplication app;