Subversion Repositories public

Compare Revisions

Ignore whitespace Rev 66 → Rev 67

/tilgungsplan/trunk/src/zinssatzaenderung.ui
176,34 → 176,6
<string>Definiert, dass die angegebene Rate ab dem Datum fix verwendet werden soll.</string>
</property>
</widget>
<widget class="KDoubleNumInput">
<property name="name">
<cstring>kDoubleNumInput_Zinssatz</cstring>
</property>
<property name="geometry">
<rect>
<x>100</x>
<y>50</y>
<width>120</width>
<height>25</height>
</rect>
</property>
<property name="maxValue">
<number>100</number>
</property>
<property name="suffix">
<string></string>
</property>
<property name="precision">
<number>3</number>
</property>
<property name="toolTip" stdset="0">
<string>Neuer Zinssatz der ab dem angegebenen Datum gilt</string>
</property>
<property name="whatsThis" stdset="0">
<string>Eingabefeld für einen Zinnsatz im Bereich 0 bis 100%</string>
</property>
</widget>
<widget class="KDateWidget">
<property name="name">
<cstring>kDateWidget_Datum</cstring>
249,6 → 221,34
<bool>true</bool>
</property>
</widget>
<widget class="KDoubleNumInput">
<property name="name">
<cstring>kDoubleNumInput_Zinssatz</cstring>
</property>
<property name="geometry">
<rect>
<x>100</x>
<y>50</y>
<width>120</width>
<height>25</height>
</rect>
</property>
<property name="maxValue">
<number>100</number>
</property>
<property name="suffix">
<string></string>
</property>
<property name="precision">
<number>3</number>
</property>
<property name="toolTip" stdset="0">
<string>Neuer Zinssatz der ab dem angegebenen Datum gilt</string>
</property>
<property name="whatsThis" stdset="0">
<string>Eingabefeld für einen Zinnsatz im Bereich 0 bis 100%</string>
</property>
</widget>
</widget>
<widget class="KPushButton">
<property name="name">
300,34 → 300,6
<string>Der Button schliesst die Dialogbox und verwirft alle durchgeführten Änderungen.</string>
</property>
</widget>
<widget class="KPushButton">
<property name="name">
<cstring>kPushButton_Save</cstring>
</property>
<property name="geometry">
<rect>
<x>50</x>
<y>360</y>
<width>130</width>
<height>30</height>
</rect>
</property>
<property name="text">
<string>Speichern</string>
</property>
<property name="accel">
<string>Alt+S</string>
</property>
<property name="default">
<bool>true</bool>
</property>
<property name="toolTip" stdset="0">
<string>Speichert den Inhalt der Tabelle</string>
</property>
<property name="whatsThis" stdset="0">
<string>Der Button speichert den Inhalt der Tabelle und schliesst die Dialogbox</string>
</property>
</widget>
<widget class="KListView">
<column>
<property name="text">
418,6 → 390,34
</widget>
<widget class="KPushButton">
<property name="name">
<cstring>kPushButton_Save</cstring>
</property>
<property name="geometry">
<rect>
<x>50</x>
<y>360</y>
<width>130</width>
<height>30</height>
</rect>
</property>
<property name="text">
<string>Speichern</string>
</property>
<property name="accel">
<string>Alt+S</string>
</property>
<property name="default">
<bool>true</bool>
</property>
<property name="toolTip" stdset="0">
<string>Speichert den Inhalt der Tabelle</string>
</property>
<property name="whatsThis" stdset="0">
<string>Der Button speichert den Inhalt der Tabelle und schliesst die Dialogbox</string>
</property>
</widget>
<widget class="KPushButton">
<property name="name">
<cstring>kPushButton_Insert</cstring>
</property>
<property name="geometry">
536,13 → 536,13
<includehints>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>
<includehint>kdatewidget.h</includehint>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>
<includehint>kdatewidget.h</includehint>
<includehint>kpushbutton.h</includehint>
<includehint>kpushbutton.h</includehint>
<includehint>kpushbutton.h</includehint>
<includehint>klistview.h</includehint>
<includehint>kpushbutton.h</includehint>
<includehint>kpushbutton.h</includehint>
</includehints>
</UI>
/tilgungsplan/trunk/src/ratenplan.ui
11,7 → 11,7
<x>0</x>
<y>0</y>
<width>844</width>
<height>500</height>
<height>520</height>
</rect>
</property>
<property name="caption">
26,6 → 26,44
<property name="modal">
<bool>true</bool>
</property>
<widget class="KPushButton">
<property name="name">
<cstring>kPushButton_Clipboard</cstring>
</property>
<property name="geometry">
<rect>
<x>440</x>
<y>460</y>
<width>240</width>
<height>30</height>
</rect>
</property>
<property name="text">
<string>Plan in Zwischenablage einfügen</string>
</property>
<property name="toggleButton">
<bool>false</bool>
</property>
</widget>
<widget class="KPushButton">
<property name="name">
<cstring>kPushButton_Save</cstring>
</property>
<property name="geometry">
<rect>
<x>700</x>
<y>460</y>
<width>80</width>
<height>30</height>
</rect>
</property>
<property name="text">
<string>Speichern</string>
</property>
<property name="toggleButton">
<bool>false</bool>
</property>
</widget>
<widget class="KListView">
<column>
<property name="text">
132,45 → 170,99
<property name="allColumnsShowFocus">
<bool>true</bool>
</property>
<property name="showSortIndicator">
<bool>true</bool>
</property>
<property name="showToolTips">
<bool>false</bool>
</property>
<property name="dragEnabled">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton">
<widget class="KPushButton">
<property name="name">
<cstring>pushButton_Cancel</cstring>
<cstring>kPushButton_Cancel</cstring>
</property>
<property name="geometry">
<rect>
<x>400</x>
<x>70</x>
<y>460</y>
<width>86</width>
<height>34</height>
<width>90</width>
<height>30</height>
</rect>
</property>
<property name="text">
<string>Schliessen</string>
</property>
<property name="toggleButton">
<bool>false</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>textLabel_Status</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>500</y>
<width>840</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string></string>
</property>
</widget>
</widget>
<connections>
<connection>
<sender>pushButton_Cancel</sender>
<signal>toggled(bool)</signal>
<sender>kListView_Plan</sender>
<signal>clicked(QListViewItem*)</signal>
<receiver>Ratenplan</receiver>
<slot>lbSelSlot(QListViewItem*)</slot>
</connection>
<connection>
<sender>kPushButton_Clipboard</sender>
<signal>clicked()</signal>
<receiver>Ratenplan</receiver>
<slot>pbClipboardSlot()</slot>
</connection>
<connection>
<sender>kPushButton_Save</sender>
<signal>clicked()</signal>
<receiver>Ratenplan</receiver>
<slot>pbSaveSlot()</slot>
</connection>
<connection>
<sender>kPushButton_Cancel</sender>
<signal>clicked()</signal>
<receiver>Ratenplan</receiver>
<slot>pbCancelSlot()</slot>
</connection>
</connections>
<tabstops>
<tabstop>kListView_Plan</tabstop>
<tabstop>pushButton_Cancel</tabstop>
<tabstop>kPushButton_Cancel</tabstop>
<tabstop>kPushButton_Clipboard</tabstop>
<tabstop>kPushButton_Save</tabstop>
</tabstops>
<slots>
<slot>lbSelSlot(QListViewItem *item)</slot>
<slot>pbCancelSlot()</slot>
<slot>pbClipboardSlot()</slot>
<slot>pbSaveSlot()</slot>
</slots>
<pixmapinproject/>
<layoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>kpushbutton.h</includehint>
<includehint>kpushbutton.h</includehint>
<includehint>klistview.h</includehint>
<includehint>kpushbutton.h</includehint>
</includehints>
</UI>
/tilgungsplan/trunk/src/ratenplanwidget.cpp
22,6 → 22,9
#include <klocale.h>
#include <qdir.h>
#include <qfile.h>
#include <qclipboard.h>
#include <qapplication.h>
#include <qlabel.h>
 
#include <sys/stat.h>
 
75,7 → 78,7
fstat (tmpFile.handle(), &sbuf);
 
if (sbuf.st_size <= sizeof(TPPARS))
if (sbuf.st_size <= (long)sizeof(TPPARS))
{
tmpFile.close ();
KMessageBox::information(this, i18n("Bitte berechnen sie zuerst einen Tilgungsplan!"));
90,7 → 93,7
// Tabelle der Dialogbox.
line = 1;
 
while (read (tmpFile.handle(), &dTable, sizeof(DTABLE)) >= sizeof(DTABLE))
while (read (tmpFile.handle(), &dTable, sizeof(DTABLE)) >= (int)sizeof(DTABLE))
{
zeile.sprintf("%04d", line);
date_int(&day, &mon, &year, dTable.datum);
140,5 → 143,132
done(QDialog::Accepted);
}
 
void ratenplanWidget::lbSelSlot(QListViewItem *item)
{
QString zeile;
QClipboard *cb = QApplication::clipboard();
 
zeile.append(item->text(1).ascii()); // Datum
zeile.append("\t");
zeile.append(item->text(2).ascii()); // Text
zeile.append("\t");
zeile.append(item->text(3).ascii()); // Kapital
zeile.append("\t");
zeile.append(item->text(4).ascii()); // Tilgung
zeile.append("\t");
zeile.append(item->text(5).ascii()); // Rate
zeile.append("\t");
zeile.append(item->text(6).ascii()); // Zinsen
zeile.append("\t");
zeile.append(item->text(7).ascii()); // Restkapital
 
cb->setText(zeile);
textLabel_Status->setText(QString("Zeile %1 des Ratenplans wurde in Zwischenablage kopiert").arg(item->text(0).ascii()));
}
 
void ratenplanWidget::pbClipboardSlot()
{
QString hdir = QDir::homeDirPath ();
QString zeile, str;
QFile tmpFile;
TPPARS TpPars;
DTABLE dTable;
int day, mon, year, line;
char hv0[128];
struct stat sbuf;
QClipboard *cb = QApplication::clipboard();
 
hdir.append("/.date_tbl.dat");
tmpFile.setName(hdir);
 
if (tmpFile.open(IO_ReadOnly) == FALSE)
{
KMessageBox::error(0, QString("Could not open file for reading: %1").arg(tmpFile.errorString()));
return;
}
fstat (tmpFile.handle(), &sbuf);
 
if (sbuf.st_size <= (long)sizeof(TPPARS))
{
tmpFile.close ();
KMessageBox::information(this, i18n("Bitte berechnen sie zuerst einen Tilgungsplan!"));
return;
}
 
// Als erstes befindet sich die Struktur mit den Parametern und
// Summenergebnissen in der Datei.
read(tmpFile.handle(), &TpPars, sizeof(TPPARS));
// Diese schreiben wir als erstes in das Clipboard
zeile = QString("Auszahlungsbetrag:\t%1\n").arg(PointNumber(TpPars.rahmen, 2, &hv0[0]));
date_int(&day, &mon, &year, TpPars.ragab);
str.sprintf("Auszahlung am:\t%02d.%02d.%d\n", day, mon, year);
zeile.append(str);
str.sprintf("Zinssatz Soll:\t%s\n\n", PointNumber(TpPars.zssoll, 3, &hv0[0]));
zeile.append(str);
 
// Nun lesen wir den Ratenplan aus und schreiben das Ergebnis in das
// Clipboard
// Überschrift
zeile.append("Datum\tText\tKapital\tTilgung\tRate\tZinsen\tRestkapital\n");
// Loop
line = 1;
 
while (read (tmpFile.handle(), &dTable, sizeof(DTABLE)) >= (int)sizeof(DTABLE))
{
date_int(&day, &mon, &year, dTable.datum);
 
if (dTable.kz != 'E')
str.sprintf("%02d.%02d.%d\t", day, mon, year);
else
str.sprintf("Raten: %ld\t", dTable.datum);
 
zeile.append(str);
 
switch (dTable.kz)
{
case 'A': zeile.append("Abschluss\t"); break;
case 'R': zeile.append("Rate\t"); break;
case 'Z':
str = QString("Zinssatzänderung auf %1\n").arg(dTable.rate, 0, 'f', 3);
zeile.append(str);
break;
case 'E': zeile.append("Ergebnis\t"); break;
default:
str = QString("??? <%1>\t").arg(dTable.kz);
zeile.append(str);
}
 
if (dTable.kz != 'Z')
{
str = QString("%1\t").arg(PointNumber(dTable.kapital, 2, &hv0[0]));
zeile.append(str);
str = QString("%1\t").arg(PointNumber(dTable.tilg, 2, &hv0[0]));
zeile.append(str);
str = QString("%1\t").arg(PointNumber(dTable.rate, 2, &hv0[0]));
zeile.append(str);
str = QString("%1\t").arg(PointNumber(dTable.zinsen, 2, &hv0[0]));
zeile.append(str);
str = QString("%1\n").arg(PointNumber(dTable.rkapi, 2, &hv0[0]));
zeile.append(str);
}
else
{
str = QString("\t\t\t\t\n");
zeile.append(str);
}
line++;
}
 
tmpFile.close();
cb->setText(zeile);
textLabel_Status->setText(i18n("Ratenplan wurde in Zwischenablage kopiert"));
}
 
void ratenplanWidget::pbSaveSlot()
{
}
 
 
#include "ratenplanwidget.moc"
 
/tilgungsplan/trunk/src/ratenplanwidget.h
34,6 → 34,9
public slots:
/*$PUBLIC_SLOTS$*/
virtual void pbCancelSlot();
virtual void lbSelSlot(QListViewItem *item);
virtual void pbClipboardSlot();
virtual void pbSaveSlot();
 
protected:
/*$PROTECTED_FUNCTIONS$*/