-rw-r--r-- | noncore/apps/oxygen/datawidgetui.cpp | 27 | ||||
-rw-r--r-- | noncore/apps/oxygen/datawidgetui.h | 2 | ||||
-rw-r--r-- | noncore/apps/oxygen/oxygen.cpp | 9 | ||||
-rw-r--r-- | noncore/apps/oxygen/oxygen.pro | 2 | ||||
-rw-r--r-- | noncore/apps/oxygen/psewidget.cpp | 16 | ||||
-rw-r--r-- | noncore/apps/oxygen/psewidget.h | 29 |
6 files changed, 82 insertions, 3 deletions
diff --git a/noncore/apps/oxygen/datawidgetui.cpp b/noncore/apps/oxygen/datawidgetui.cpp index c8492e5..7256777 100644 --- a/noncore/apps/oxygen/datawidgetui.cpp +++ b/noncore/apps/oxygen/datawidgetui.cpp | |||
@@ -1,85 +1,108 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * This program is free software; you can redistribute it and/or modify * | 3 | * This program is free software; you can redistribute it and/or modify * |
4 | * it under the terms of the GNU General Public License as published by * | 4 | * it under the terms of the GNU General Public License as published by * |
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | * ( at your option ) any later version. * | 6 | * ( at your option ) any later version. * |
7 | * * | 7 | * * |
8 | **************************************************************************/ | 8 | **************************************************************************/ |
9 | #include "oxygen.h" | 9 | #include "oxygen.h" |
10 | 10 | ||
11 | #include <qpe/config.h> | 11 | #include <qpe/config.h> |
12 | #include "datawidgetui.h" | 12 | #include "datawidgetui.h" |
13 | #include <qstring.h> | 13 | #include <qstring.h> |
14 | #include <qcombobox.h> | 14 | #include <qcombobox.h> |
15 | #include <qlayout.h> | 15 | #include <qlayout.h> |
16 | #include <qtable.h> | ||
17 | #include <qhbox.h> | ||
18 | #include <qlabel.h> | ||
16 | 19 | ||
17 | dataWidgetUI::dataWidgetUI() : QDialog() | 20 | dataWidgetUI::dataWidgetUI() : QDialog() |
18 | { | 21 | { |
19 | this->setCaption("Chemical Data"); | 22 | this->setCaption("Chemical Data"); |
20 | 23 | ||
21 | QVBoxLayout *vbox = new QVBoxLayout( this ); | 24 | QVBoxLayout *vbox = new QVBoxLayout( this ); |
22 | 25 | ||
23 | dataCombo = new QComboBox( this ); | 26 | dataCombo = new QComboBox( this ); |
24 | DataTable = new OxydataTable( 7,2, this ); | 27 | DataTable = new OxydataTable( 8,2, this ); |
25 | DataTable->setShowGrid( false ); | 28 | DataTable->setShowGrid( false ); |
29 | DataTable->setHScrollBarMode(QScrollView::AlwaysOff); | ||
30 | |||
31 | QHBox *hbox = new QHBox( this ); | ||
32 | left = new QLabel( hbox ); | ||
33 | middle = new QLabel( hbox ); | ||
34 | right = new QLabel( hbox ); | ||
26 | 35 | ||
27 | vbox->addWidget( dataCombo ); | 36 | vbox->addWidget( dataCombo ); |
37 | vbox->addWidget( hbox ); | ||
28 | vbox->addWidget( DataTable ); | 38 | vbox->addWidget( DataTable ); |
29 | 39 | ||
30 | DataTable->show(); | 40 | DataTable->show(); |
31 | dataCombo->show(); | 41 | dataCombo->show(); |
32 | 42 | ||
33 | connect ( dataCombo, SIGNAL( activated(int) ), this, SLOT( slotShowData(int) ) ); | 43 | connect ( dataCombo, SIGNAL( activated(int) ), this, SLOT( slotShowData(int) ) ); |
34 | Config test( "/home/opie/Settings/oxygendata", Config::File ); | 44 | Config test( "/home/opie/Settings/oxygendata", Config::File ); |
35 | 45 | ||
36 | //read in all names of the 118 elements | 46 | //read in all names of the 118 elements |
37 | for ( int i = 1 ; i < 119 ; i++ ) | 47 | for ( int i = 1 ; i < 119 ; i++ ) |
38 | { | 48 | { |
39 | test.setGroup( QString::number( i ) ); | 49 | test.setGroup( QString::number( i ) ); |
40 | QString foo = test.readEntry( "Name" ); | 50 | QString foo = test.readEntry( "Name" ); |
41 | dataCombo->insertItem( foo ); | 51 | dataCombo->insertItem( foo ); |
42 | } | 52 | } |
43 | 53 | ||
44 | createTableLayout(); | 54 | createTableLayout(); |
45 | slotShowData( 1 ); //this way we do always get data here | 55 | slotShowData( 1 ); //this way we do always get data here |
46 | 56 | ||
47 | } | 57 | } |
48 | 58 | ||
49 | void dataWidgetUI::createTableLayout(){ | 59 | void dataWidgetUI::createTableLayout(){ |
50 | DataTable->horizontalHeader()->hide(); | 60 | DataTable->horizontalHeader()->hide(); |
51 | DataTable->verticalHeader()->hide(); | 61 | DataTable->verticalHeader()->hide(); |
52 | DataTable->setTopMargin( 0 ); | 62 | DataTable->setTopMargin( 0 ); |
53 | DataTable->setLeftMargin( 0 ); | 63 | DataTable->setLeftMargin( 0 ); |
54 | 64 | ||
55 | DataTable->setText( 0,0,"Weight:" ); | 65 | DataTable->setText( 0,0,"Weight:" ); |
56 | DataTable->setText( 1,0,"Block" ); | 66 | DataTable->setText( 1,0,"Block" ); |
57 | DataTable->setText( 2,0,"Group" ); | 67 | DataTable->setText( 2,0,"Group" ); |
58 | DataTable->setText( 3,0,"Electronegativity" ); | 68 | DataTable->setText( 3,0,"Electronegativity" ); |
59 | DataTable->setText( 4,0,"Atomic radius" ); | 69 | DataTable->setText( 4,0,"Atomic radius" ); |
60 | DataTable->setText( 5,0,"Ionizationenergie" ); | 70 | DataTable->setText( 5,0,"Ionizationenergie" ); |
61 | DataTable->setText( 6,0,"Density" ); | 71 | DataTable->setText( 6,0,"Density" ); |
62 | DataTable->setText( 7,0,"Boilingpoint" ); | 72 | DataTable->setText( 7,0, tr( "Boilingpoint" ) ); |
73 | DataTable->setText( 8,0, tr( "Meltingpoint" ) ); | ||
63 | } | 74 | } |
64 | 75 | ||
65 | 76 | ||
66 | void dataWidgetUI::slotShowData(int number){ | 77 | void dataWidgetUI::slotShowData(int number){ |
67 | Config test( "/home/opie/Settings/oxygendata", Config::File ); | 78 | Config test( "/home/opie/Settings/oxygendata", Config::File ); |
68 | test.setGroup( QString::number( number+1 )); | 79 | test.setGroup( QString::number( number+1 )); |
80 | |||
81 | left->setText( test.readEntry( "Symbol" ) ); | ||
82 | middle->setText( test.readEntry( "Name" ) ); | ||
83 | right->setText( QString::number( number+1 ) ); | ||
84 | |||
85 | QFont bf; | ||
86 | bf.setBold( true ); | ||
87 | bf.setPointSize( bf.pointSize()+2 ); | ||
88 | middle->setFont( bf ); | ||
89 | |||
69 | QString weight = test.readEntry( "Weight" ); | 90 | QString weight = test.readEntry( "Weight" ); |
70 | DataTable->setText( 0,1,weight ); | 91 | DataTable->setText( 0,1,weight ); |
71 | QString block = test.readEntry( "Block" ); | 92 | QString block = test.readEntry( "Block" ); |
72 | DataTable->setText( 1,1,block ); | 93 | DataTable->setText( 1,1,block ); |
73 | QString grp = test.readEntry( "Group" ); | 94 | QString grp = test.readEntry( "Group" ); |
74 | DataTable->setText( 2,1,grp ); | 95 | DataTable->setText( 2,1,grp ); |
75 | QString en = test.readEntry( "EN" ); | 96 | QString en = test.readEntry( "EN" ); |
76 | DataTable->setText( 3,1,en ); | 97 | DataTable->setText( 3,1,en ); |
77 | QString ar = test.readEntry( "AR" ); | 98 | QString ar = test.readEntry( "AR" ); |
78 | DataTable->setText( 4,1,ar ) ; | 99 | DataTable->setText( 4,1,ar ) ; |
79 | QString ion = test.readEntry( "IE" ); | 100 | QString ion = test.readEntry( "IE" ); |
80 | DataTable->setText( 5,1,ion ); | 101 | DataTable->setText( 5,1,ion ); |
81 | QString dens = test.readEntry( "Density" ); | 102 | QString dens = test.readEntry( "Density" ); |
82 | DataTable->setText( 6,1,dens ); | 103 | DataTable->setText( 6,1,dens ); |
83 | QString bp = test.readEntry( "BP" ); | 104 | QString bp = test.readEntry( "BP" ); |
84 | DataTable->setText( 7,1,bp ); | 105 | DataTable->setText( 7,1,bp ); |
106 | QString mp = test.readEntry( "MP" ); | ||
107 | DataTable->setText( 7,1,mp ); | ||
85 | } | 108 | } |
diff --git a/noncore/apps/oxygen/datawidgetui.h b/noncore/apps/oxygen/datawidgetui.h index 9427adf..64599a7 100644 --- a/noncore/apps/oxygen/datawidgetui.h +++ b/noncore/apps/oxygen/datawidgetui.h | |||
@@ -1,30 +1,32 @@ | |||
1 | 1 | ||
2 | /*************************************************************************** | 2 | /*************************************************************************** |
3 | * * | 3 | * * |
4 | * This program is free software; you can redistribute it and/or modify * | 4 | * This program is free software; you can redistribute it and/or modify * |
5 | * it under the terms of the GNU General Public License as published by * | 5 | * it under the terms of the GNU General Public License as published by * |
6 | * the Free Software Foundation; either version 2 of the License, or * | 6 | * the Free Software Foundation; either version 2 of the License, or * |
7 | * ( at your option ) any later version. * | 7 | * ( at your option ) any later version. * |
8 | * * | 8 | * * |
9 | **************************************************************************/ | 9 | **************************************************************************/ |
10 | #include "dataTable.h" | 10 | #include "dataTable.h" |
11 | #include <qdialog.h> | 11 | #include <qdialog.h> |
12 | 12 | ||
13 | class QTable; | 13 | class QTable; |
14 | class QComboBox; | 14 | class QComboBox; |
15 | class QLabel; | ||
15 | 16 | ||
16 | class dataWidgetUI : public QDialog | 17 | class dataWidgetUI : public QDialog |
17 | { | 18 | { |
18 | Q_OBJECT | 19 | Q_OBJECT |
19 | 20 | ||
20 | public: | 21 | public: |
21 | dataWidgetUI(); | 22 | dataWidgetUI(); |
22 | 23 | ||
23 | private: | 24 | private: |
24 | void createTableLayout(); | 25 | void createTableLayout(); |
25 | OxydataTable *DataTable; | 26 | OxydataTable *DataTable; |
26 | QComboBox *dataCombo; | 27 | QComboBox *dataCombo; |
28 | QLabel *left, *middle, *right; | ||
27 | 29 | ||
28 | private slots: | 30 | private slots: |
29 | void slotShowData(int); | 31 | void slotShowData(int); |
30 | }; | 32 | }; |
diff --git a/noncore/apps/oxygen/oxygen.cpp b/noncore/apps/oxygen/oxygen.cpp index a9c2276..2574841 100644 --- a/noncore/apps/oxygen/oxygen.cpp +++ b/noncore/apps/oxygen/oxygen.cpp | |||
@@ -1,56 +1,63 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * This program is free software; you can redistribute it and/or modify * | 3 | * This program is free software; you can redistribute it and/or modify * |
4 | * it under the terms of the GNU General Public License as published by * | 4 | * it under the terms of the GNU General Public License as published by * |
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | * ( at your option ) any later version. * | 6 | * ( at your option ) any later version. * |
7 | * * | 7 | * * |
8 | **************************************************************************/ | 8 | **************************************************************************/ |
9 | #include "oxygen.h" | 9 | #include "oxygen.h" |
10 | 10 | ||
11 | #include <qlabel.h> | 11 | #include <qlabel.h> |
12 | #include <qapplication.h> | 12 | #include <qapplication.h> |
13 | #include <qpushbutton.h> | 13 | #include <qpushbutton.h> |
14 | #include <qvbox.h> | 14 | #include <qvbox.h> |
15 | #include "calcdlg.h" | 15 | #include "calcdlg.h" |
16 | #include "calcdlgui.h" | 16 | #include "calcdlgui.h" |
17 | #include "datawidgetui.h" | 17 | #include "datawidgetui.h" |
18 | #include "psewidget.h" | ||
18 | 19 | ||
19 | Oxygen::Oxygen() | 20 | Oxygen::Oxygen() |
20 | : QMainWindow() | 21 | : QMainWindow() |
21 | { | 22 | { |
22 | this->setCaption( "Oxygen" ); | 23 | this->setCaption( "Oxygen" ); |
23 | vbox = new QVBox( this ); | 24 | vbox = new QVBox( this ); |
24 | QPushButton *setButton = new QPushButton( "Settings", vbox ); | 25 | QPushButton *setButton = new QPushButton( "Settings", vbox ); |
25 | connect ( setButton, SIGNAL( clicked() ), this, SLOT( slotSettings() ) ); | 26 | connect ( setButton, SIGNAL( clicked() ), this, SLOT( slotSettings() ) ); |
26 | QPushButton *dataButton = new QPushButton( "Data", vbox ); | 27 | QPushButton *dataButton = new QPushButton( "Data", vbox ); |
27 | connect ( dataButton, SIGNAL( clicked() ), this, SLOT( slotData() ) ); | 28 | connect ( dataButton, SIGNAL( clicked() ), this, SLOT( slotData() ) ); |
28 | QPushButton *calcButton = new QPushButton( "Calculations", vbox ); | 29 | QPushButton *calcButton = new QPushButton( "Calculations", vbox ); |
29 | connect ( calcButton, SIGNAL( clicked() ), this, SLOT( slotCalculations() ) ); | 30 | connect ( calcButton, SIGNAL( clicked() ), this, SLOT( slotCalculations() ) ); |
30 | QPushButton *pseButton = new QPushButton( "PSE", vbox ); | 31 | QPushButton *pseButton = new QPushButton( "PSE", vbox ); |
31 | connect ( pseButton, SIGNAL( clicked() ), this, SLOT( slotPSE() ) ); | 32 | connect ( pseButton, SIGNAL( clicked() ), this, SLOT( slotPSE() ) ); |
32 | 33 | ||
33 | setCentralWidget( vbox ); | 34 | setCentralWidget( vbox ); |
34 | } | 35 | } |
35 | 36 | ||
36 | 37 | ||
37 | void Oxygen::close() | 38 | void Oxygen::close() |
38 | { | 39 | { |
39 | QApplication::exit(); | 40 | QApplication::exit(); |
40 | } | 41 | } |
41 | 42 | ||
42 | //SLOTS | 43 | //SLOTS |
43 | 44 | ||
44 | void Oxygen::slotCalculations(){ | 45 | void Oxygen::slotCalculations(){ |
45 | calcDlgUI *CalcDlgUI = new calcDlgUI(); | 46 | calcDlgUI *CalcDlgUI = new calcDlgUI(); |
46 | CalcDlgUI->show(); | 47 | CalcDlgUI->show(); |
47 | }; | 48 | }; |
48 | 49 | ||
49 | void Oxygen::slotData(){ | 50 | void Oxygen::slotData(){ |
50 | dataWidgetUI *DataWidgetUI = new dataWidgetUI(); | 51 | dataWidgetUI *DataWidgetUI = new dataWidgetUI(); |
52 | DataWidgetUI->showMaximized(); | ||
51 | DataWidgetUI->show(); | 53 | DataWidgetUI->show(); |
52 | }; | 54 | }; |
53 | 55 | ||
54 | void Oxygen::slotSettings(){ }; | 56 | void Oxygen::slotSettings(){ }; |
55 | void Oxygen::slotPSE(){ }; | 57 | |
58 | void Oxygen::slotPSE(){ | ||
59 | PSEWidget *pse = new PSEWidget(); | ||
60 | pse->showMaximized(); | ||
61 | pse->show(); | ||
62 | }; | ||
56 | 63 | ||
diff --git a/noncore/apps/oxygen/oxygen.pro b/noncore/apps/oxygen/oxygen.pro index 1bbeb94..c447330 100644 --- a/noncore/apps/oxygen/oxygen.pro +++ b/noncore/apps/oxygen/oxygen.pro | |||
@@ -1,24 +1,26 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG = qt warn_on release | 2 | CONFIG = qt warn_on release |
3 | HEADERS = oxygen.h \ | 3 | HEADERS = oxygen.h \ |
4 | kmolcalc.h \ | 4 | kmolcalc.h \ |
5 | kmolelements.h \ | 5 | kmolelements.h \ |
6 | calcdlgui.h \ | 6 | calcdlgui.h \ |
7 | dataTable.h \ | 7 | dataTable.h \ |
8 | psewidget.h \ | ||
8 | datawidgetui.h | 9 | datawidgetui.h |
9 | 10 | ||
10 | SOURCES = main.cpp \ | 11 | SOURCES = main.cpp \ |
11 | oxygen.cpp \ | 12 | oxygen.cpp \ |
12 | kmolcalc.cpp \ | 13 | kmolcalc.cpp \ |
13 | calcdlgui.cpp \ | 14 | calcdlgui.cpp \ |
14 | kmolelements.cpp \ | 15 | kmolelements.cpp \ |
15 | dataTable.cpp \ | 16 | dataTable.cpp \ |
17 | psewidget.cpp \ | ||
16 | datawidgetui.cpp | 18 | datawidgetui.cpp |
17 | INCLUDEPATH += $(OPIEDIR)/include | 19 | INCLUDEPATH += $(OPIEDIR)/include |
18 | DEPENDPATH += $(OPIEDIR)/include | 20 | DEPENDPATH += $(OPIEDIR)/include |
19 | LIBS += -lqpe | 21 | LIBS += -lqpe |
20 | INTERFACES= calcdlg.ui | 22 | INTERFACES= calcdlg.ui |
21 | TARGET = oxygen | 23 | TARGET = oxygen |
22 | DESTDIR = $(OPIEDIR)/bin | 24 | DESTDIR = $(OPIEDIR)/bin |
23 | 25 | ||
24 | TRANSLATIONS = ../../../i18n/de/oxygen.ts | 26 | TRANSLATIONS = ../../../i18n/de/oxygen.ts |
diff --git a/noncore/apps/oxygen/psewidget.cpp b/noncore/apps/oxygen/psewidget.cpp new file mode 100644 index 0000000..66450be --- a/dev/null +++ b/noncore/apps/oxygen/psewidget.cpp | |||
@@ -0,0 +1,16 @@ | |||
1 | /*************************************************************************** | ||
2 | * * | ||
3 | * This program is free software; you can redistribute it and/or modify * | ||
4 | * it under the terms of the GNU General Public License as published by * | ||
5 | * the Free Software Foundation; either version 2 of the License, or * | ||
6 | * ( at your option ) any later version. * | ||
7 | * * | ||
8 | **************************************************************************/ | ||
9 | #include "oxygen.h" | ||
10 | |||
11 | #include <qpe/config.h> | ||
12 | #include "psewidget.h" | ||
13 | |||
14 | PSEWidget::PSEWidget() : QWidget() | ||
15 | { | ||
16 | } | ||
diff --git a/noncore/apps/oxygen/psewidget.h b/noncore/apps/oxygen/psewidget.h new file mode 100644 index 0000000..ebdec94 --- a/dev/null +++ b/noncore/apps/oxygen/psewidget.h | |||
@@ -0,0 +1,29 @@ | |||
1 | |||
2 | /*************************************************************************** | ||
3 | * * | ||
4 | * This program is free software; you can redistribute it and/or modify * | ||
5 | * it under the terms of the GNU General Public License as published by * | ||
6 | * the Free Software Foundation; either version 2 of the License, or * | ||
7 | * ( at your option ) any later version. * | ||
8 | * * | ||
9 | **************************************************************************/ | ||
10 | #ifndef _PSEWIDGET_H | ||
11 | #define _PSEWIDGET_H | ||
12 | |||
13 | #include <qwidget.h> | ||
14 | |||
15 | class QTable; | ||
16 | class QComboBox; | ||
17 | class QLabel; | ||
18 | |||
19 | |||
20 | class PSEWidget : public QWidget | ||
21 | { | ||
22 | Q_OBJECT | ||
23 | |||
24 | public: | ||
25 | PSEWidget(); | ||
26 | |||
27 | }; | ||
28 | |||
29 | #endif | ||