Commit f9a20c14 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Remove uncompiled plasmoid and qml files

They have not been used for almost over a decade, time to let them go
parent cdd9e960
Pipeline #148521 passed with stage
in 1 minute and 47 seconds
......@@ -134,9 +134,7 @@ endif (HAVE_OPENBABEL AND AvogadroLibs_FOUND AND EIGEN3_FOUND)
add_subdirectory(doc)
add_subdirectory(src)
add_subdirectory(data)
# add_subdirectory(plasmoid)
add_subdirectory(libscience)
# add_subdirectory(qml)
ki18n_install(po)
if (KF5DocTools_FOUND)
......
add_subdirectory(applet)
add_subdirectory(engine)
MESSAGE(STATUS "Kalzium Plasma widget 'bodr' disabled, needs porting")
#add_subdirectory(bodr)
add_subdirectory(didyouknow)
add_subdirectory(nuclearPlasmoid)
add_subdirectory(concentrationPlasmoid)
add_subdirectory(gasPlasmoid)
add_subdirectory(psePlasmoid)
include_directories(
${CMAKE_SOURCE_DIR}/libkdeedu/libscience/
)
set(kalzium_plasma_SRCS
kalzium_plasma.cpp
)
kde4_add_ui_files(kalzium_plasma_SRCS config.ui)
kde4_add_plugin(plasma_applet_kalzium ${kalzium_plasma_SRCS})
target_link_libraries(plasma_applet_kalzium
${KDE4_PLASMA_LIBS} ${KDE4_KIO_LIBS}
science
)
install(
TARGETS plasma_applet_kalzium
DESTINATION ${KDE_INSTALL_PLUGINDIR}
)
install(
FILES plasma_kalzium.desktop
DESTINATION ${KDE_INSTALL_KSERVICES5DIR}
)
install(
FILES testtube.svg
DESTINATION ${KDE_INSTALL_DATADIR}/desktoptheme/default/widgets/
)
#! /usr/bin/env bash
$EXTRACTRC *.ui >> rc.cpp
$XGETTEXT *.cpp -o $podir/plasma_applet_kalzium.pot
<ui version="4.0" >
<class>config</class>
<widget class="QWidget" name="config" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>448</width>
<height>221</height>
</rect>
</property>
<layout class="QVBoxLayout" >
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<string>Theme:</string>
</property>
</widget>
</item>
<item>
<widget class="KComboBox" name="comboBox" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text" >
<string>testtube.svg</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QPushButton" name="fontSelectButton" >
<property name="text" >
<string>Select Font...</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>440</width>
<height>91</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KComboBox</class>
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
/*
SPDX-FileCopyrightText: 2008 Carsten Niehaus <cniehaus@kde.org>
SPDX-FileCopyrightText: 2008 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "kalzium_plasma.h"
#include <KConfigGroup>
#include <KFontDialog>
#include <QColor>
#include <QDebug>
#include <QDialog>
#include <QDialogButtonBox>
#include <QLineEdit>
#include <QPainter>
#include <QPen>
#include <QPushButton>
#include <QVBoxLayout>
KalziumPlasma::KalziumPlasma(QObject *parent, const QVariantList &args)
: Plasma::Applet(parent, args),
m_dialog(0),
m_font(QFont())
{
m_theme.setImagePath("widgets/testtube"),
m_engine = dataEngine("kalzium");
m_dialog = 0;
m_label1 = 0;
m_lineedit = new Plasma::LineEdit(this);
m_lineedit->setDefaultText(i18n("Enter the atomic number."));
connect(m_lineedit, SIGNAL(editingFinished()),
this, SLOT(textChanged()));
setHasConfigurationInterface(true);
setAcceptDrops(false);
setAcceptsHoverEvents(true);
// setDrawStandardBackground(false);
resize(385,177);
}
void KalziumPlasma::init()
{
qDebug() << "initializing Kalzium";
configChanged();
m_currentSource = "BlueObelisk:RandomElement";
// connect to random source and update ever 5 seconds
m_engine->connectSource(m_currentSource, this, 5000);
m_theme.setContainsMultipleImages(false);
m_label1 = new QGraphicsTextItem(this);
m_label1->setPos(m_theme.elementRect("name").topLeft());
m_label1->setFont(m_font);
m_label1->setDefaultTextColor(Qt::white);
}
void KalziumPlasma::configChanged()
{
KConfigGroup cg = config();
m_font = cg.readEntry("font",QFont());
}
void KalziumPlasma::constraintsUpdated(Plasma::Constraints constraints)
{
// setDrawStandardBackground(false);
prepareGeometryChange();
if (constraints & Plasma::SizeConstraint) {
//m_theme.resize(contentSize().toSize());
m_theme.resize(size());
}
m_label1->setPos(m_theme.elementRect("canvas").topLeft());
}
KalziumPlasma::~KalziumPlasma()
{
delete m_dialog;
}
void KalziumPlasma::dataUpdated(const QString& source, const Plasma::DataEngine::Data &data)
{
qDebug() << "dataUpdated" << source;
if (source != m_currentSource) {
return;
}
QString bp = data["bp"].toString();
QString mp = data["mp"].toString();
QString mass = data["mass"].toString();
QString symbol = data["symbol"].toString();
QString name = data["name"].toString();
QString text;
text = QString(i18n("\nName: %1", name));
text.append(QString(i18n("\nSymbol: %1", symbol)));
text.append(QString(i18n("\nBoiling point: %1", bp)));
text.append(QString(i18n("\nMelting point: %1", mp)));
text.append(QString(i18n("\nMass: %1", mass)));
if (m_label1) {
// m_label1->setAlignment(Qt::AlignLeft);
m_label1->setPlainText(text);
}
}
void KalziumPlasma::paintInterface(QPainter *p,
const QStyleOptionGraphicsItem *option,
const QRect &contentsRect)
{
Q_UNUSED(option);
p->setRenderHint(QPainter::SmoothPixmapTransform);
p->setRenderHint(QPainter::Antialiasing);
// Now we draw the applet, starting with our svg
//m_theme.resize((int)contentsRect.width(), (int)contentsRect.height());
m_theme.resize(size());
//m_theme.paint(p, (int)contentsRect.left(), (int)contentsRect.top());
m_theme.paint(p, 0, 0);
m_lineedit->setPos(0, 150);
}
void KalziumPlasma::showConfigurationInterface()
{
if (m_dialog == 0) {
m_dialog = new QDialog;
m_dialog->setWindowIcon(QIcon::fromTheme("kalzium"));
m_dialog->setWindowTitle(i18nc("@title:window", "KalziumPlasma Configuration"));
ui.setupUi(m_dialog->mainWidget());
m_dialog->mainWidget()->layout()->setContentsMargins(0, 0, 0, 0);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Apply);
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout;
m_dialog->setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
m_dialog->connect(buttonBox, &QDialogButtonBox::accepted, this, &KalziumPlasma::accept);
m_dialog->connect(buttonBox, &QDialogButtonBox::rejected, this, &KalziumPlasma::reject);
mainLayout->addWidget(buttonBox);
connect(okButton, &QPushButton::clicked,
this, &KalziumPlasma::configAccepted);
connect(buttonBox, &QDialogButtonBox::Apply::clicked,
this, &KalziumPlasma::configAccepted);
connect(ui.fontSelectButton, SIGNAL(clicked()),
this, SLOT(showFontSelectDlg()));
}
m_dialog->show();
}
void KalziumPlasma::showFontSelectDlg()
{
KFontDialog::getFont(m_font);
}
void KalziumPlasma::configAccepted()
{
prepareGeometryChange();
KConfigGroup cg = config();
cg.writeEntry("font", m_font);
m_label1->setFont(m_font);
emit configNeedsSaving();
}
void KalziumPlasma::textChanged()
{
m_engine->disconnectSource(m_currentSource, this);
QString currentText = m_lineedit->toPlainText();
if (!currentText.isEmpty()) {
// simply assume the user entered the atomic number of the element
m_currentSource = QString("BlueObelisk:Element:") + currentText;
} else {
m_currentSource = QString("BlueObelisk:RandomElement");
}
m_engine->connectSource(m_currentSource, this, 5000);
}
#include "kalzium_plasma.moc"
/*
SPDX-FileCopyrightText: 2008 Carsten Niehaus <cniehaus@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef KALZIUM_PLASMA_H
#define KALZIUM_PLASMA_H
#include <Plasma/Applet>
#include <Plasma/Svg>
#include <plasma/widgets/lineedit.h>
#include <plasma/widgets/label.h>
#include <QGraphicsTextItem>
#include "ui_config.h"
class QDialog;
class QFont;
class KalziumPlasma : public Plasma::Applet
{
Q_OBJECT
public:
KalziumPlasma(QObject *parent, const QVariantList &args);
~KalziumPlasma();
void init();
void paintInterface(QPainter *painter,
const QStyleOptionGraphicsItem *option,
const QRect& contentsRect);
void constraintsUpdated(Plasma::Constraints constraints);
public slots:
void showConfigurationInterface();
void configAccepted();
void showFontSelectDlg();
void dataUpdated(const QString &name, const Plasma::DataEngine::Data &data);
void textChanged();
void configChanged();
private:
Plasma::Svg m_theme;
QGraphicsTextItem *m_label1;
Plasma::LineEdit *m_lineedit;
Plasma::DataEngine* m_engine;
QString m_currentSource;
Ui::config ui;
QDialog *m_dialog;
QFont m_font;
};
K_EXPORT_PLASMA_APPLET(data_kalzium, KalziumPlasma)
#endif // KALZIUM_PLASMA_H
[Desktop Entry]
Name=Chemical Data
Name[bg]=Химични данни
Name[bs]=Hemijski podaci
Name[ca]=Dades químiques
Name[ca@valencia]=Dades químiques
Name[cs]=Chemická data
Name[da]=Kemisk data
Name[de]=Chemische Daten
Name[el]=Χημικά δεδομένα
Name[en_GB]=Chemical Data
Name[eo]=Ĥemikaj datumoj
Name[es]=Datos químicos
Name[et]=Keemiaandmed
Name[eu]=Datu kimikoak
Name[fi]=Kemialliset tiedot
Name[fr]=Données de chimie
Name[ga]=Sonraí Ceimiceacha
Name[gl]=Datos químicos
Name[gu]=રસાયણ માહિતી
Name[he]=מידע כימי
Name[hne]=केमिकल डाटा
Name[hu]=Kémiai adatok
Name[is]=Efnafræðilegar upplýsingar
Name[it]=Dati chimici
Name[ja]=化学データ
Name[kk]=Химиялық деректер
Name[km]=ទិន្នន័យ​គីមី
Name[ko]=화학 데이터
Name[lt]=Cheminiai duomenys
Name[lv]=Ķīmiskie dati
Name[mr]=रासायनिक डेटा
Name[nb]=Kjemiske data
Name[nds]=Cheemsch Daten
Name[nl]=Chemische gegevens
Name[nn]=Kjemiske data
Name[pa]=ਰਸਾਇਣਿਕ ਡਾਟਾ
Name[pl]=Dane chemiczne
Name[pt]=Dados Químicos
Name[pt_BR]=Dados químicos
Name[ru]=Химические данные
Name[sk]=Chemické údaje
Name[sl]=Kemijski podatki
Name[sv]=Kemisk information
Name[te]=రసాయన దత్తాంశం
Name[tr]=Kimyasal Veriler
Name[ug]=خىمىيىلىك سانلىق-مەلۇمات
Name[uk]=Хімічні дані
Name[x-test]=xxChemical Dataxx
Name[zh_CN]=化学数据
Name[zh_TW]=化學資料
Icon=kalzium
Type=Service
ServiceTypes=Plasma/Applet
Comment=Chemical Data Applet
Comment[bs]=Aplet za hemijske podatke
Comment[ca]=Miniaplicació de dades químiques
Comment[ca@valencia]=Miniaplicació de dades químiques
Comment[cs]=Applet pracující s chemickými daty
Comment[da]=Applet til kemisk data
Comment[de]=Chemische Daten-Miniprogramm
Comment[el]=Μικροεφαρμογή χημικών δεδομένων
Comment[en_GB]=Chemical Data Applet
Comment[eo]=Ĥemia Datum-Apleto
Comment[es]=Miniaplicación de datos químicos
Comment[et]=Keemiaandmete aplett
Comment[eu]=Datu kimikoen miniaplikazioa
Comment[fi]=Kemialliset tiedot
Comment[fr]=Composant graphique pour données de chimie
Comment[ga]=Feidhmchláirín Sonraí Ceimiceacha
Comment[gl]=Miniaplicativo de datos químicos
Comment[gu]=રસાયણ માહિતી એપ્લેટ
Comment[he]=יישומון מידע כימי
Comment[hne]=केमिकल डाटा ऐप्लेट
Comment[hu]=Kémiai kisalkalmazás
Comment[is]=Smáforrit fyrir efnafræðilegar upplýsingar
Comment[it]=Applet di dati chimici
Comment[ja]=化学データアプレット
Comment[kk]=Химиялық деректер апплеті
Comment[km]=អាប់ភ្លេត​ទិន្នន័យ​គីមី
Comment[ko]=화학 데이터 애플릿
Comment[lt]=Cheminių duomenų programėlė
Comment[lv]=Ķīmisko datu sīkrīks
Comment[mr]=रासायनिक डेटा एप्लेट
Comment[nb]=Miniprogram med kjemiske data
Comment[nds]=Lüttprogramm för cheemsch Daten
Comment[nl]=Chemische gegevensapplet
Comment[nn]=Miniprogram med kjemiske data
Comment[pa]=ਰਸਾਇਣਿਕ ਡਾਟਾ ਐਪਲਿਟ
Comment[pl]=Aplet o chemii
Comment[pt]='Applet' de Dados Químicos
Comment[pt_BR]=Miniaplicativo de dados químicos
Comment[ru]=Виджет химических данных
Comment[sk]=Applet chemických dát
Comment[sl]=Aplet za kemijske podatke
Comment[sv]=Miniprogram med kemisk information
Comment[te]=రసాయనద త్తాంశ యాప్ లెట్
Comment[tr]=Kimyasal Veri Programcığı
Comment[ug]=خىمىيىلىك سانلىق-مەلۇمات قوللانچىقى
Comment[uk]=Аплет хімічних даних
Comment[x-test]=xxChemical Data Appletxx
Comment[zh_CN]=化学数据小程序
Comment[zh_TW]=化學資料小程式
X-KDE-ServiceTypes=Plasma/Applet
X-KDE-Library=plasma_applet_kalzium
X-KDE-PluginInfo-Author=Carsten Niehaus
X-KDE-PluginInfo-Email=cniehaus@kde.org
X-KDE-PluginInfo-Name=plasma_applet_data_kalzium
X-KDE-PluginInfo-Version=0.1
X-KDE-PluginInfo-Website=https://edu.kde.org/kalzium/
X-KDE-PluginInfo-Category=Education
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true
This diff is collapsed.
project(concentrationCalculator)
set(concentrationCalculator_SRCS concentrationCalculator.cpp)
ki18n_wrap_ui(concentrationCalculator_SRCS concentrationCalculatorConfig.ui)
add_library(concentrationCalculator ${concentrationCalculator_SRCS})
target_link_libraries(concentrationCalculator
KF5::Plasma KF5::WidgetsAddons
KF5::UnitConversion
)
install(TARGETS concentrationCalculator DESTINATION ${KDE_INSTALL_PLUGINDIR})
install(FILES concentrationCalculator.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
#! /usr/bin/env bash
$EXTRACTRC *.ui >> rc.cpp
$XGETTEXT *.cpp -o $podir/plasma_applet_concentrationCalculator.pot
[Desktop Entry]
Name=Kalzium concentration Calculator
Name[bs]=Kalzium Kalkulator koncentracija
Name[ca]=Calculadora de concentracions del Kalzium
Name[ca@valencia]=Calculadora de concentracions del Kalzium
Name[cs]=Kalkulačka koncentrace programu Kalzium
Name[da]=Kalzium-regnemaskine til koncentrationer
Name[de]=Kalzium Konzentrations-Rechner
Name[el]=Μικροϋπολογιστής συγκέντρωσης για το Kalzium
Name[en_GB]=Kalzium concentration Calculator
Name[eo]=Entena kalkulilo de Kalzium
Name[es]=Calculadora de concentraciones de Kalzium
Name[et]=Kalziumi kontsentratsioonikalkulaator
Name[eu]=Kalzium kontzentrazioen kalkulagailua
Name[fi]=Kalziumin konsentraatiolaskin
Name[fr]=Calculateur de concentration de Kalzium
Name[ga]=Áireamhán tiúchana Kalzium
Name[gl]=Calculador de concentracións de Kalzium
Name[hu]=Kalzium koncentrációszámoló
Name[it]=Calcolatore di concentrazione di Kalzium
Name[ja]=Kalzium 濃度計算機
Name[kk]=Концентрациялық калькулятор
Name[km]=ម៉ាស៊ីន​គណ​នា​កំហាប់​ Kalzium
Name[ko]=Kalzium 농도 계산기
Name[lv]=Kalzium koncentrācijas kalkulators
Name[mr]=केल्झियम काँसन्ट्रेशन गणकयंत्र
Name[nb]=Kalzium konsentrasjonsberegner
Name[nds]=Kalzium-Konzentrerenreekner
Name[nl]=Kalzium concentratierekenmachine
Name[nn]=Kalzium konsentrasjonskalkulator
Name[pa]=ਕੈਲਜ਼ੀਅਮ ਸੰਘਣਾਪਨ ਕੈਲਕੂਲੇਟਰ
Name[pl]=Kalkulator stężenia Kalzium
Name[pt]=Calculadora de concentrações do Kalzium
Name[pt_BR]=Calculadora de Concentrações do Kalzium
Name[ru]=Калькулятор концентраций
Name[sk]=Kalkulačka koncentrácie Kalzium
Name[sl]=Izračun koncentracij za Kalzium
Name[sv]=Kalzium koncentrationsberäkning
Name[te]=క్యల్జ్యిం కేంద్రీకరించే గనన యంత్రము
Name[tr]=Kalzium Konsantrasyon Hesaplayıcı
Name[ug]=Kalzium قويۇقلۇق ھېسابلىغۇچ
Name[uk]=Калькулятор концентрації Kalzium
Name[x-test]=xxKalzium concentration Calculatorxx
Name[zh_CN]=Kalzium 浓度计算器
Name[zh_TW]=Kalzium 濃度計算器
Comment=Kalzium concentration Calculator
Comment[bs]=Kalzium kalkulator koncentracija
Comment[ca]=Calculadora de concentracions del Kalzium
Comment[ca@valencia]=Calculadora de concentracions del Kalzium
Comment[cs]=Kalkulačka koncentrace programu Kalzium
Comment[da]=Kalzium-regnemaskine til koncentrationer
Comment[de]=Kalzium Konzentrations-Rechner
Comment[el]=Μικροϋπολογιστής συγκέντρωσης για το Kalzium
Comment[en_GB]=Kalzium concentration Calculator
Comment[eo]=Entena kalkulilo de Kalzium
Comment[es]=Calculadora de concentraciones de Kalzium
Comment[et]=Kalziumi kontsentratsioonikalkulaator
Comment[eu]=Kalzium kontzentrazioen kalkulagailua
Comment[fi]=Kalziumin konsentraatiolaskin
Comment[fr]=Calculateur de concentration de Kalzium
Comment[ga]=Áireamhán tiúchana Kalzium
Comment[gl]=Calculador de concentracións de Kalzium
Comment[hu]=Kalzium koncentrációszámoló
Comment[it]=Calcolatore di concentrazione di Kalzium
Comment[ja]=Kalzium 濃度計算機
Comment[kk]=Kalzium концентрациялық калькуляторы
Comment[km]=ម៉ាស៊ីន​គណនា​កំហាប់​​ Kalzium
Comment[ko]=Kalzium 농도 계산기
Comment[lv]=Kalzium koncentrācijas kalkulators
Comment[mr]=केल्झियम काँसन्ट्रेशन गणकयंत्र
Comment[nb]=Kalzium konsentrasjonsberegner
Comment[nds]=Kalzium-Konzentrerenreekner
Comment[nl]=Kalzium concentratierekenmachine
Comment[nn]=Kalzium konsentrasjonskalkulator
Comment[pa]=ਕੈਲਜ਼ੀਅਮ ਸੰਘਣਾਪਨ ਕੈਲਕੂਲੇਟਰ
Comment[pl]=Kalkulator stężenia Kalzium
Comment[pt]=Calculadora de concentrações do Kalzium
Comment[pt_BR]=Calculadora de Concentrações do Kalzium
Comment[ru]=Калькулятор концентраций Kalzium
Comment[sk]=Kalkulačka koncentrácie Kalzium
Comment[sl]=Izračun koncentracij za Kalzium
Comment[sv]=Kalzium koncentrationsberäkning
Comment[te]=క్యల్జ్యిం కేంద్రీకరించే గనన యంత్రము
Comment[tr]=Kalzium Konsantrasyon Hesaplayıcı
Comment[ug]=Kalzium قويۇقلۇق ھېسابلىغۇچ
Comment[uk]=Калькулятор концентрації Kalzium
Comment[x-test]=xxKalzium concentration Calculatorxx
Comment[zh_CN]=Kalzium 浓度计算器
Comment[zh_TW]=Kalzium 濃度計算器
Type=Service
ServiceTypes=Plasma/Applet