summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/checkbook/qcheckbook.h37
-rw-r--r--noncore/apps/checkbook/qcheckentrybase.ui610
-rw-r--r--noncore/apps/checkbook/qcheckgraph.cpp258
-rw-r--r--noncore/apps/checkbook/qcheckgraph.h25
-rw-r--r--noncore/apps/checkbook/qcheckgraphbase.ui62
-rw-r--r--noncore/apps/checkbook/qcheckmainmenu.cpp74
-rw-r--r--noncore/apps/checkbook/qcheckmainmenu.h27
-rw-r--r--noncore/apps/checkbook/qcheckmmbase.ui80
-rw-r--r--noncore/apps/checkbook/qcheckname.cpp36
-rw-r--r--noncore/apps/checkbook/qcheckname.h15
-rw-r--r--noncore/apps/checkbook/qcheckview.cpp458
-rw-r--r--noncore/apps/checkbook/qcheckviewbase.ui122
-rw-r--r--noncore/apps/checkbook/qrestrictedcombo.cpp78
-rw-r--r--noncore/apps/checkbook/qrestrictedcombo.h96
-rw-r--r--noncore/apps/checkbook/qrestrictedline.cpp78
-rw-r--r--noncore/apps/checkbook/qrestrictedline.h96
16 files changed, 0 insertions, 2152 deletions
diff --git a/noncore/apps/checkbook/qcheckbook.h b/noncore/apps/checkbook/qcheckbook.h
deleted file mode 100644
index 52c0d40..0000000
--- a/noncore/apps/checkbook/qcheckbook.h
+++ b/dev/null
@@ -1,37 +0,0 @@
-#include "qcheckview.h"
-#include "qcheckgraph.h"
-#include "qcheckmainmenu.h"
-
-#include <qpe/resource.h>
-#include <qmainwindow.h>
-#include <qtoolbar.h>
-#include <qstring.h>
-#include "config.h"
-#include <qpopupmenu.h>
-
-class QCheckBook : public QMainWindow
-{
- Q_OBJECT
- public:
- QCheckBook();
- private slots:
- void newCheck(const QString &filename);
- void newGraph();
- void close();
- void initMainMenus();
- private:
- QCheckView *m_view;
- QCheckGraph *m_view2;
- QCheckMainMenu *m_view3;
- QToolBar *bar;
- QMenuBar *mbar;
- int filemenuid;
- QString m_filename;
- QToolButton *nb1;
- QToolButton *nb2;
- QToolButton *nb3;
- QToolButton *nb4;
- bool initCheck;
- bool initMM;
- QPopupMenu *popup;
-};
diff --git a/noncore/apps/checkbook/qcheckentrybase.ui b/noncore/apps/checkbook/qcheckentrybase.ui
deleted file mode 100644
index efc35ff..0000000
--- a/noncore/apps/checkbook/qcheckentrybase.ui
+++ b/dev/null
@@ -1,610 +0,0 @@
-<!DOCTYPE UI><UI>
-<class>QCheckEntryBase</class>
-<widget>
- <class>QDialog</class>
- <property stdset="1">
- <name>name</name>
- <cstring>QCheckEntryBase</cstring>
- </property>
- <property stdset="1">
- <name>geometry</name>
- <rect>
- <x>0</x>
- <y>0</y>
- <width>224</width>
- <height>291</height>
- </rect>
- </property>
- <property stdset="1">
- <name>caption</name>
- <string>Account Transaction</string>
- </property>
- <property>
- <name>layoutMargin</name>
- </property>
- <property>
- <name>layoutSpacing</name>
- </property>
- <grid>
- <property stdset="1">
- <name>margin</name>
- <number>5</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>2</number>
- </property>
- <spacer row="7" column="8" rowspan="1" colspan="4" >
- <property>
- <name>name</name>
- <cstring>Spacer3</cstring>
- </property>
- <property stdset="1">
- <name>orientation</name>
- <enum>Horizontal</enum>
- </property>
- <property stdset="1">
- <name>sizeType</name>
- <enum>Expanding</enum>
- </property>
- <property>
- <name>sizeHint</name>
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- <spacer row="3" column="1" rowspan="1" colspan="4" >
- <property>
- <name>name</name>
- <cstring>Spacer5</cstring>
- </property>
- <property stdset="1">
- <name>orientation</name>
- <enum>Horizontal</enum>
- </property>
- <property stdset="1">
- <name>sizeType</name>
- <enum>Expanding</enum>
- </property>
- <property>
- <name>sizeHint</name>
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- <widget row="5" column="5" >
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>TextLabel6</cstring>
- </property>
- <property stdset="1">
- <name>font</name>
- <font>
- <family>adobe-helvetica</family>
- <bold>1</bold>
- </font>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>$</string>
- </property>
- </widget>
- <spacer row="4" column="6" >
- <property>
- <name>name</name>
- <cstring>Spacer8</cstring>
- </property>
- <property stdset="1">
- <name>orientation</name>
- <enum>Horizontal</enum>
- </property>
- <property stdset="1">
- <name>sizeType</name>
- <enum>Expanding</enum>
- </property>
- <property>
- <name>sizeHint</name>
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- <widget row="2" column="0" rowspan="1" colspan="3" >
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>TextLabel2</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Category:</string>
- </property>
- </widget>
- <spacer row="5" column="2" rowspan="1" colspan="3" >
- <property>
- <name>name</name>
- <cstring>Spacer7</cstring>
- </property>
- <property stdset="1">
- <name>orientation</name>
- <enum>Horizontal</enum>
- </property>
- <property stdset="1">
- <name>sizeType</name>
- <enum>Expanding</enum>
- </property>
- <property>
- <name>sizeHint</name>
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- <spacer row="5" column="11" >
- <property>
- <name>name</name>
- <cstring>Spacer4</cstring>
- </property>
- <property stdset="1">
- <name>orientation</name>
- <enum>Horizontal</enum>
- </property>
- <property stdset="1">
- <name>sizeType</name>
- <enum>Expanding</enum>
- </property>
- <property>
- <name>sizeHint</name>
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- <spacer row="2" column="3" rowspan="1" colspan="2" >
- <property>
- <name>name</name>
- <cstring>Spacer6</cstring>
- </property>
- <property stdset="1">
- <name>orientation</name>
- <enum>Horizontal</enum>
- </property>
- <property stdset="1">
- <name>sizeType</name>
- <enum>Expanding</enum>
- </property>
- <property>
- <name>sizeHint</name>
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- <widget row="5" column="6" rowspan="1" colspan="5" >
- <class>QRestrictedLine</class>
- <property stdset="1">
- <name>name</name>
- <cstring>transAmount</cstring>
- </property>
- </widget>
- <widget row="1" column="0" rowspan="1" colspan="5" >
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>TextLabel1</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Description:</string>
- </property>
- </widget>
- <widget row="3" column="0" >
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>TextLabel3</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Type:</string>
- </property>
- </widget>
- <widget row="5" column="0" rowspan="1" colspan="2" >
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>TextLabel5</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Amount:</string>
- </property>
- </widget>
- <widget row="2" column="5" rowspan="1" colspan="7" >
- <class>QComboBox</class>
- <item>
- <property>
- <name>text</name>
- <string>Automobile</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>Bills</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>CDs</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>Clothing</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>Computer</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>DVDs</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>Eletronics</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>Entertainment</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>Food</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>Gasoline</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>Misc</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>Movies</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>Rent</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>Travel</string>
- </property>
- </item>
- <property stdset="1">
- <name>name</name>
- <cstring>cmbCategory</cstring>
- </property>
- <property stdset="1">
- <name>editable</name>
- <bool>true</bool>
- </property>
- <property stdset="1">
- <name>currentItem</name>
- <number>0</number>
- </property>
- <property stdset="1">
- <name>autoCompletion</name>
- <bool>true</bool>
- </property>
- <property stdset="1">
- <name>duplicatesEnabled</name>
- <bool>false</bool>
- </property>
- </widget>
- <widget row="4" column="0" rowspan="1" colspan="6" >
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>TextLabel4</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Check Number:</string>
- </property>
- </widget>
- <widget row="6" column="4" >
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>TextLabel6_2</cstring>
- </property>
- <property stdset="1">
- <name>font</name>
- <font>
- <family>adobe-helvetica</family>
- <bold>1</bold>
- </font>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>$</string>
- </property>
- </widget>
- <widget row="6" column="5" rowspan="1" colspan="4" >
- <class>QRestrictedLine</class>
- <property stdset="1">
- <name>name</name>
- <cstring>transFee</cstring>
- </property>
- </widget>
- <widget row="6" column="0" rowspan="1" colspan="4" >
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>TextLabel7</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Extra Fee:</string>
- </property>
- </widget>
- <widget row="7" column="0" rowspan="1" colspan="8" >
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>TextLabel8</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Additional Notes:</string>
- </property>
- </widget>
- <widget row="1" column="5" rowspan="1" colspan="7" >
- <class>QComboBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>descriptionCombo</cstring>
- </property>
- <property stdset="1">
- <name>editable</name>
- <bool>true</bool>
- </property>
- <property stdset="1">
- <name>maxCount</name>
- <number>10</number>
- </property>
- <property stdset="1">
- <name>insertionPolicy</name>
- <enum>BeforeCurrent</enum>
- </property>
- <property stdset="1">
- <name>autoCompletion</name>
- <bool>true</bool>
- </property>
- <property stdset="1">
- <name>duplicatesEnabled</name>
- <bool>false</bool>
- </property>
- </widget>
- <widget row="6" column="9" >
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>TextLabel9</cstring>
- </property>
- <property stdset="1">
- <name>minimumSize</name>
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- <property stdset="1">
- <name>maximumSize</name>
- <size>
- <width>32767</width>
- <height>32767</height>
- </size>
- </property>
- <property stdset="1">
- <name>caption</name>
- <string></string>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Date:</string>
- </property>
- </widget>
- <widget row="6" column="10" rowspan="1" colspan="2" >
- <class>QRestrictedLine</class>
- <property stdset="1">
- <name>name</name>
- <cstring>dateEdit</cstring>
- </property>
- </widget>
- <widget row="4" column="7" rowspan="1" colspan="5" >
- <class>QRestrictedLine</class>
- <property stdset="1">
- <name>name</name>
- <cstring>checkNumber</cstring>
- </property>
- </widget>
- <widget row="3" column="5" rowspan="1" colspan="7" >
- <class>QComboBox</class>
- <item>
- <property>
- <name>text</name>
- <string>Debit Charge</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>Written Check</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>Transfer</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>Credit Card</string>
- </property>
- </item>
- <property stdset="1">
- <name>name</name>
- <cstring>transType</cstring>
- </property>
- </widget>
- <widget row="8" column="0" rowspan="1" colspan="12" >
- <class>QMultiLineEdit</class>
- <property stdset="1">
- <name>name</name>
- <cstring>additionalNotes</cstring>
- </property>
- </widget>
- <widget row="0" column="0" rowspan="1" colspan="12" >
- <class>QButtonGroup</class>
- <property stdset="1">
- <name>name</name>
- <cstring>ButtonGroup3</cstring>
- </property>
- <property stdset="1">
- <name>sizePolicy</name>
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>7</vsizetype>
- </sizepolicy>
- </property>
- <property stdset="1">
- <name>title</name>
- <string></string>
- </property>
- <property>
- <name>layoutMargin</name>
- </property>
- <property>
- <name>layoutSpacing</name>
- </property>
- <grid>
- <property stdset="1">
- <name>margin</name>
- <number>4</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>0</number>
- </property>
- <widget row="0" column="1" >
- <class>QRadioButton</class>
- <property stdset="1">
- <name>name</name>
- <cstring>deposit</cstring>
- </property>
- <property stdset="1">
- <name>sizePolicy</name>
- <sizepolicy>
- <hsizetype>1</hsizetype>
- <vsizetype>1</vsizetype>
- </sizepolicy>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Deposit</string>
- </property>
- </widget>
- <widget row="0" column="0" >
- <class>QRadioButton</class>
- <property stdset="1">
- <name>name</name>
- <cstring>payment</cstring>
- </property>
- <property stdset="1">
- <name>sizePolicy</name>
- <sizepolicy>
- <hsizetype>1</hsizetype>
- <vsizetype>1</vsizetype>
- </sizepolicy>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Payment</string>
- </property>
- <property stdset="1">
- <name>checked</name>
- <bool>true</bool>
- </property>
- </widget>
- </grid>
- </widget>
- </grid>
-</widget>
-<customwidgets>
- <customwidget>
- <class>QRestrictedLine</class>
- <header location="local">qrestrictedline.h</header>
- <sizehint>
- <width>-1</width>
- <height>-1</height>
- </sizehint>
- <container>0</container>
- <sizepolicy>
- <hordata>5</hordata>
- <verdata>5</verdata>
- </sizepolicy>
- <pixmap>image0</pixmap>
- </customwidget>
-</customwidgets>
-<images>
- <image>
- <name>image0</name>
- <data format="XPM.GZ" length="649">789c6dd23b0ec2300c00d03da7b0e22d42e9476c88232031222186c80c3074813220c4dd214dddd84dac0e759fe2386e1a07a7e3015c639e6318ef04740b0f70d7d730bccf97fdc7d8be87f8406737c62210606869dbb531f531a57f4a299d03a7e06c11cca1055508412c2889acc2ef425423b34840a645f28244936860d2c265d7923bae8b2f05cb35a91739002d2b5727d535cbe954a43ad1e22f700755caf7407cf4799fe286c47dbe3bf303014167a2</data>
- </image>
-</images>
-<tabstops>
- <tabstop>payment</tabstop>
- <tabstop>descriptionCombo</tabstop>
- <tabstop>cmbCategory</tabstop>
- <tabstop>transType</tabstop>
- <tabstop>additionalNotes</tabstop>
-</tabstops>
-</UI>
diff --git a/noncore/apps/checkbook/qcheckgraph.cpp b/noncore/apps/checkbook/qcheckgraph.cpp
deleted file mode 100644
index 5b21ad8..0000000
--- a/noncore/apps/checkbook/qcheckgraph.cpp
+++ b/dev/null
@@ -1,258 +0,0 @@
-#include "qcheckgraph.h"
-
-#include <qpainter.h>
-#include <qmessagebox.h>
-#include <qfontmetrics.h>
-#include <qdir.h>
-#include <qfile.h>
-#include <qstringlist.h>
-#include <qdatetime.h>
-#include <qmenubar.h>
-#include <qpopupmenu.h>
-
-QCheckGraph::QCheckGraph(const QString filename)
- : QCheckGraphBase()
-{
- QMenuBar *bar = new QMenuBar(this);
- bar->setMargin(0);
- QPopupMenu *popup = new QPopupMenu;
- popup->insertItem("&Save Graph...", this, SLOT(saveGraphAsPicture()));
- bar->insertItem("&File", popup);
-
- pixmapready = false;
- config = new Config(filename, Config::File);
- QString forresult = "";
- QString forresult2 = "";
- int i = 1;
- for (; forresult != "Not Found"; i++)
- {
- config->setGroup(QString::number(i));
- forresult = config->readEntry("Description", QString("Not Found"));
- forresult2 = config->readEntry("Category", QString("Not Found"));
- if (forresult != "Not Found")
- {
- if (list.contains(forresult2) == 0)
- {
- config->setGroup("Totals");
- QString larger = config->readEntry("Spent", QString("no"));
- QString smaller = config->readEntry(forresult2, QString("no"));
- if (larger != "no" && smaller != "no")
- {
- list << forresult2;
- QString percentage = calculator(smaller, larger, true);
-
- // Here we calculate how many pixels tall it will be by multiplying it by 200.
- QString pixels = calculator(percentage, QString("200"), false);
-
- // This is done because it really doesn't need to have a decimal... just an int, and
- // QString rounds doubles up to the nearest whole number in order to convert
- // to an int (which is correct).
- pixels = pixels.remove(pixels.find('.'), pixels.length());
-
- if (pixels.toInt() <= 5)
- {
- pixels = "6";
- }
-
- list2 << pixels;
- }
- }
- } else {
- continue;
- }
- // We want to break this loop on the 7th (remember, starts at 0->6 == 7) item.
- if (list.count() == 6)
- {
- break;
- }
- }
- for (QStringList::Iterator it = list.begin(); it != list.end(); it++)
- {
- if ((*it).length() > 11)
- {
- (*it).truncate(8);
- (*it).append("...");
- }
- }
- graphPixmap();
-}
-
-void QCheckGraph::graphPixmap()
-{
- pixmapready = false;
- graph = QPixmap(240,250);
- QPainter p;
- p.begin(&graph);
- p.fillRect(0, 0, 240, 300, QColor(255,255,255));
- // Draw the graph lines
-
- // Y
- p.drawLine( 40, 50, 40, 252 );
-
- // X
- p.drawLine( 40, 252, 203, 252 );
-
- // Y stepup lines
- p.drawLine( 40, 50, 37, 50);
- p.drawLine( 40, 70, 37, 70);
- p.drawLine( 40, 90, 37, 90);
- p.drawLine( 40, 110, 37, 110);
- p.drawLine( 40, 130, 37, 130);
- p.drawLine( 40, 150, 37, 150);
- p.drawLine( 40, 170, 37, 170);
- p.drawLine( 40, 190, 37, 190);
- p.drawLine( 40, 210, 37, 210);
- p.drawLine( 40, 230, 37, 230);
- p.drawLine( 40, 245, 37, 245);
-
-
- // Y stepup values
- p.drawText((35 - p.fontMetrics().width("100")), (50 + (p.fontMetrics().height() / 2)), "100");
- p.drawText((35 - p.fontMetrics().width("90")), (70 + (p.fontMetrics().height() / 2)), "90");
- p.drawText((35 - p.fontMetrics().width("80")), (90 + (p.fontMetrics().height() / 2)), "80");
- p.drawText((35 - p.fontMetrics().width("70")), (110 + (p.fontMetrics().height() / 2)), "70");
- p.drawText((35 - p.fontMetrics().width("60")), (130 + (p.fontMetrics().height() / 2)), "60");
- p.drawText((35 - p.fontMetrics().width("50")), (150 + (p.fontMetrics().height() / 2)), "50");
- p.drawText((35 - p.fontMetrics().width("40")), (170 + (p.fontMetrics().height() / 2)), "40");
- p.drawText((35 - p.fontMetrics().width("30")), (190 + (p.fontMetrics().height() / 2)), "30");
- p.drawText((35 - p.fontMetrics().width("20")), (210 + (p.fontMetrics().height() / 2)), "20");
- p.drawText((35 - p.fontMetrics().width("10")), (230 + (p.fontMetrics().height() / 2)), "10");
- p.drawText((35 - p.fontMetrics().width("<10")), (245 + (p.fontMetrics().height() / 2)), "<10");
-
- // Draw the axis[sic?] labels
- QString ylabel = "Percentage";
- int pixel = 100;
- for (unsigned int i = 0; i != ylabel.length(); i++)
- {
- p.setBrush(QColor(0,0,0));
- p.drawText(5,pixel, QString(ylabel[i]));
- pixel = pixel + p.fontMetrics().height();
- }
- p.drawText(95, 265, "Category");
-
- int i = 0;
- // Hack: Using if()'s... switch was acting all wierd :{
- QStringList::Iterator it2 = list2.begin();
- for (QStringList::Iterator it = list.begin(); it != list.end(); it++)
- {
- qWarning(QString::number(i));
- if (i ==0)
- {
- // For the color code:
- p.setBrush(QColor(255,0,0));
- p.drawRect(8,12, 8, 8);
-
- // Now the text:
- p.setBrush(QColor(0,0,0));
- p.drawText(18,20, (*it));
-
- // Last, but not least, we have the actual bar graph height.
- p.setBrush(QColor(255,0,0));
- p.drawRect(47, ((202 - (*it2).toInt()) + 50), 15, (*it2).toInt());
- }
- if (i ==1)
- {
- p.setBrush(QColor(255,255,0));
- p.drawRect(78,12, 8, 8);
-
- p.setBrush(QColor(0,0,0));
- p.drawText(88,20, (*it));
-
- p.setBrush(QColor(255,255,0));
- p.drawRect(70, ((202 - (*it2).toInt()) + 50), 15, (*it2).toInt());
- }
- if (i==2)
- {
- p.setBrush(QColor(0,255,0));
- p.drawRect(153,12, 8, 8);
- p.setBrush(QColor(0,0,0));
- p.drawText(163,20, (*it));
-
- p.setBrush(QColor(0,255,0));
- p.drawRect(98, ((202 - (*it2).toInt()) + 50), 15, (*it2).toInt());
- }
- if (i==3)
- {
- p.setBrush(QColor(89,12,54));
- p.drawRect(8,27, 8, 8);
- p.setBrush(QColor(0,0,0));
- p.drawText(18,35, (*it));
-
- p.setBrush(QColor(89,12,54));
- p.drawRect(126, ((202 - (*it2).toInt()) + 50), 15, (*it2).toInt());
- }
- if (i==4)
- {
- p.setBrush(QColor(0,0,255));
- p.drawRect(78,27, 8, 8);
- p.setBrush(QColor(0,0,0));
- p.drawText(88,35, (*it));
- p.setBrush(QColor(0,0,255));
- p.drawRect(154, ((202 - (*it2).toInt()) + 50), 15, (*it2).toInt());
- }
- if (i==5)
- {
- p.setBrush(QColor(100,40,0));
- p.drawRect(153,27, 8, 8);
- p.setBrush(QColor(0,0,0));
- p.drawText(163,35, (*it));
- p.setBrush(QColor(100,40,0));
- p.drawRect(182, ((202 - (*it2).toInt()) + 50), 15, (*it2).toInt());
- }
- i++;
- it2++;
- }
-
- p.end();
- pixmapready = true;
- graphWidget->setBackgroundPixmap(graph);
-}
-
-QString QCheckGraph::calculator(QString largervalue, QString smallervalue, bool divide)
-{
-// largervalue = largervalue.remove(largervalue.find(".", 0, false), 1);
-// smallervalue = smallervalue.remove(smallervalue.find(".", 0, false), 1);
-
- double largercents = largervalue.toDouble();
- double smallercents = smallervalue.toDouble();
-
- double finalammount = 0;
-
- if (divide == true)
- {
- finalammount = (largercents / smallercents);
- } else {
- finalammount = (largercents * smallercents);
- }
-
- qWarning(QString::number(finalammount));
-
- return QString::number(finalammount);
-}
-
-/*void QCheckGraph::paintEvent(QPaintEvent *e)
-{
- if (pixmapready == true)
- {
- bitBlt((QPaintDevice *)(graphWidget), 0, 0, graph, 0,0);
- QWidget::paintEvent(e);
- }
-}
-*/
-void QCheckGraph::saveGraphAsPicture()
-{
- QString homedir = QDir::homeDirPath();
- QDate current = QDate::currentDate();
- QString datestring = QString::number(current.month());
- datestring.append(QString::number(current.day()));
- datestring.append(QString::number(current.year()));
- QString filename = homedir;
- filename.append("/Documents/graph");
- filename.append(datestring);
- filename.append(".png");
- graph.save(filename, "PNG", 85);
- QString graphmessage = "<qt>The graph was saved as graph";
- graphmessage.append(datestring);
- graphmessage.append(".png. You may access it by returning to your home screen and clicking on the \"Documents\" tab in the upper right hand screen</qt>");
- QMessageBox::information(0, "File Saved", graphmessage);
-}
diff --git a/noncore/apps/checkbook/qcheckgraph.h b/noncore/apps/checkbook/qcheckgraph.h
deleted file mode 100644
index 1cafef8..0000000
--- a/noncore/apps/checkbook/qcheckgraph.h
+++ b/dev/null
@@ -1,25 +0,0 @@
-#include <qstring.h>
-#include <qmainwindow.h>
-#include <qwidget.h>
-#include <qstringlist.h>
-#include <qpixmap.h>
-#include "config.h"
-
-#include "qcheckgraphbase.h"
-
-class QCheckGraph : public QCheckGraphBase
-{
- Q_OBJECT
- public:
- QCheckGraph(const QString);
- private:
- QStringList list;
- QStringList list2;
- QString calculator(QString larger, QString smaller, bool divide);
- QPixmap graph;
- void graphPixmap();
- bool pixmapready;
- Config *config;
- private slots:
- void saveGraphAsPicture();
-};
diff --git a/noncore/apps/checkbook/qcheckgraphbase.ui b/noncore/apps/checkbook/qcheckgraphbase.ui
deleted file mode 100644
index 2763839..0000000
--- a/noncore/apps/checkbook/qcheckgraphbase.ui
+++ b/dev/null
@@ -1,62 +0,0 @@
-<!DOCTYPE UI><UI>
-<class>QCheckGraphBase</class>
-<widget>
- <class>QDialog</class>
- <property stdset="1">
- <name>name</name>
- <cstring>QCheckGraphBase</cstring>
- </property>
- <property stdset="1">
- <name>geometry</name>
- <rect>
- <x>0</x>
- <y>0</y>
- <width>236</width>
- <height>285</height>
- </rect>
- </property>
- <property stdset="1">
- <name>caption</name>
- <string>Account Graph</string>
- </property>
- <grid>
- <property stdset="1">
- <name>margin</name>
- <number>0</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>0</number>
- </property>
- <widget row="0" column="0" >
- <class>QWidget</class>
- <property stdset="1">
- <name>name</name>
- <cstring>graphWidget</cstring>
- </property>
- </widget>
- </grid>
-</widget>
-<customwidgets>
- <customwidget>
- <class>QWidget</class>
- <header location="global">qwidget.h</header>
- <sizehint>
- <width>-1</width>
- <height>-1</height>
- </sizehint>
- <container>0</container>
- <sizepolicy>
- <hordata>5</hordata>
- <verdata>5</verdata>
- </sizepolicy>
- <pixmap>image0</pixmap>
- </customwidget>
-</customwidgets>
-<images>
- <image>
- <name>image0</name>
- <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1ddec44f503c0ae2a154410f53d0ed20e2bf6bdb656dd6861dd23d9a66591b0587fd1654235ebded6f0edcd53e419d87ae7b1f4f9b8f906d0bfe012317426a70b07bdc2f3ec77f8ed6b89559061a0343d06a124cc105596482585094bc0ae599b04646c9018926491b2205e140c485cace25755c175d0a967b622ff900b8cc9c7d29af594ea722d589167f813aa852ba07d94b9dce296e883fe7bb163f23896753</data>
- </image>
-</images>
-</UI>
diff --git a/noncore/apps/checkbook/qcheckmainmenu.cpp b/noncore/apps/checkbook/qcheckmainmenu.cpp
deleted file mode 100644
index 2382513..0000000
--- a/noncore/apps/checkbook/qcheckmainmenu.cpp
+++ b/dev/null
@@ -1,74 +0,0 @@
-#include "qcheckmainmenu.h"
-#include "qcheckname.h"
-
-QCheckMainMenu::QCheckMainMenu(QWidget *parent)
- : QCheckMMBase(parent)
-{
- init();
-}
-
-void QCheckMainMenu::init()
-{
- lstCheckBooks->clear();
- QString checkdirname = QDir::homeDirPath();
- checkdirname.append("/.checkbooks");
- QDir checkdir(checkdirname);
- if (checkdir.exists() == true)
- {
- QStringList checkbooks = checkdir.entryList("*.qcb", QDir::Files|QDir::Readable|QDir::Writable, QDir::Time);
- for (QStringList::Iterator it = checkbooks.begin(); it != checkbooks.end(); it++)
- {
- (*it) = (*it).remove((*it).find('.'), (*it).length());
- }
- lstCheckBooks->insertStringList(checkbooks);
- }
- lstCheckBooks->clearSelection();
- connect(lstCheckBooks, SIGNAL(clicked(QListBoxItem *)), this, SLOT(slotSelected(QListBoxItem *)));
- lstCheckBooks->clearSelection();
-}
-
-void QCheckMainMenu::slotSelected(QListBoxItem *item)
-{
- if (item != 0)
- {
- QString text = item->text();
- if (text.isEmpty() == false)
- {
- text.append(".qcb");
- QString checkdirname = QDir::homeDirPath();
- checkdirname.append("/.checkbooks/");
- text.prepend(checkdirname);
- emit itemSelected(text);
- }
- }
-}
-
-void QCheckMainMenu::newClicked()
-{
- QString checkname = QCheckName::getName();
- if (checkname.isEmpty() == false)
- {
- QString checkdirname = QDir::homeDirPath();
- checkdirname.append("/.checkbooks");
- QDir checkdir(checkdirname);
- if (checkdir.exists() == false)
- {
- checkdir.mkdir(checkdirname);
- }
- checkdirname.append("/");
- checkdirname.append(checkname);
- checkdirname.append(".qcb");
- QFile file(checkdirname);
- if (file.exists() == false)
- {
- file.open(IO_WriteOnly);
- QTextStream os(&file);
- os << "";
- file.close();
- }
- QFileInfo fi(file);
- QString noextension = fi.fileName();
- noextension = noextension.remove(noextension.find('.'), noextension.length());
- lstCheckBooks->insertItem(noextension);
- }
-}
diff --git a/noncore/apps/checkbook/qcheckmainmenu.h b/noncore/apps/checkbook/qcheckmainmenu.h
deleted file mode 100644
index 456d3df..0000000
--- a/noncore/apps/checkbook/qcheckmainmenu.h
+++ b/dev/null
@@ -1,27 +0,0 @@
-#include <qwidget.h>
-#include <qtoolbutton.h>
-#include <qpopupmenu.h>
-#include <qfile.h>
-#include <qdir.h>
-#include <qtextstream.h>
-#include <qstring.h>
-#include <qlistbox.h>
-#include <qmessagebox.h>
-
-#include "qcheckmmbase.h"
-
-class QCheckMainMenu : public QCheckMMBase
-{
- Q_OBJECT
- public:
- QCheckMainMenu(QWidget *);
- signals:
- void itemSelected(const QString &);
- private:
- void init();
- private slots:
- void slotSelected(QListBoxItem *);
- public slots:
- void newClicked();
-};
-
diff --git a/noncore/apps/checkbook/qcheckmmbase.ui b/noncore/apps/checkbook/qcheckmmbase.ui
deleted file mode 100644
index efde990..0000000
--- a/noncore/apps/checkbook/qcheckmmbase.ui
+++ b/dev/null
@@ -1,80 +0,0 @@
-<!DOCTYPE UI><UI>
-<class>QCheckMMBase</class>
-<widget>
- <class>QWidget</class>
- <property stdset="1">
- <name>name</name>
- <cstring>QCheckMMBase</cstring>
- </property>
- <property stdset="1">
- <name>geometry</name>
- <rect>
- <x>0</x>
- <y>0</y>
- <width>256</width>
- <height>311</height>
- </rect>
- </property>
- <property stdset="1">
- <name>caption</name>
- <string>Main Menu</string>
- </property>
- <grid>
- <property stdset="1">
- <name>margin</name>
- <number>7</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>3</number>
- </property>
- <widget row="0" column="0" >
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>TextLabel2</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Select from the check books below or click the "New" icon in the toolbar.</string>
- </property>
- <property stdset="1">
- <name>alignment</name>
- <set>WordBreak|AlignVCenter|AlignLeft</set>
- </property>
- <property>
- <name>wordwrap</name>
- </property>
- </widget>
- <widget row="1" column="0" >
- <class>QListBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>lstCheckBooks</cstring>
- </property>
- </widget>
- </grid>
-</widget>
-<customwidgets>
- <customwidget>
- <class>QWidget</class>
- <header location="global">qwidget.h</header>
- <sizehint>
- <width>-1</width>
- <height>-1</height>
- </sizehint>
- <container>0</container>
- <sizepolicy>
- <hordata>5</hordata>
- <verdata>5</verdata>
- </sizepolicy>
- <pixmap>image0</pixmap>
- </customwidget>
-</customwidgets>
-<images>
- <image>
- <name>image0</name>
- <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1ddec44f503c0ae2a154410f53d0ed20e2bf6bdb656dd6861dd23d9a66591b0587fd1654235ebded6f0edcd53e419d87ae7b1f4f9b8f906d0bfe012317426a70b07bdc2f3ec77f8ed6b89559061a0343d06a124cc105596482585094bc0ae599b04646c9018926491b2205e140c485cace25755c175d0a967b622ff900b8cc9c7d29af594ea722d589167f813aa852ba07d94b9dce296e883fe7bb163f23896753</data>
- </image>
-</images>
-</UI>
diff --git a/noncore/apps/checkbook/qcheckname.cpp b/noncore/apps/checkbook/qcheckname.cpp
deleted file mode 100644
index 0e4d71c..0000000
--- a/noncore/apps/checkbook/qcheckname.cpp
+++ b/dev/null
@@ -1,36 +0,0 @@
-#include "qcheckname.h"
-#include <qmessagebox.h>
-#include <qdialog.h>
-#include <qpushbutton.h>
-#include <qlineedit.h>
-#include "qrestrictedline.h"
-
-QCheckName::QCheckName()
- : QCheckNameBase()
-{
- connect(cmdDone, SIGNAL(clicked()), this, SLOT(clicked()));
-}
-
-QString QCheckName::getName()
-{
- QCheckName qcn;
- qcn.setWFlags(Qt::WType_Modal);
- qcn.leText->setValidChars("abcdefghijklmnopqrstuvwxyz0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ");
- if (qcn.exec() == QDialog::Accepted)
- {
- return qcn.leText->text();
- } else {
- return QString("");
- }
-}
-
-void QCheckName::clicked()
-{
- if (leText->text().isEmpty() == false)
- {
- hide();
- accept();
- } else {
- QMessageBox::critical(this, "Missing Information", "<qt>Please enter the name of your Check Book and try again.</qt>");
- }
-}
diff --git a/noncore/apps/checkbook/qcheckname.h b/noncore/apps/checkbook/qcheckname.h
deleted file mode 100644
index c47c4f9..0000000
--- a/noncore/apps/checkbook/qcheckname.h
+++ b/dev/null
@@ -1,15 +0,0 @@
-#include "qchecknamebase.h"
-#include <qstring.h>
-#include <qwidget.h>
-
-class QCheckName : public QCheckNameBase
-{
- Q_OBJECT
- public:
- QCheckName();
- static QString getName();
- private:
- QWidget *m_parent;
- private slots:
- void clicked();
-};
diff --git a/noncore/apps/checkbook/qcheckview.cpp b/noncore/apps/checkbook/qcheckview.cpp
deleted file mode 100644
index ddc3fa9..0000000
--- a/noncore/apps/checkbook/qcheckview.cpp
+++ b/dev/null
@@ -1,458 +0,0 @@
-#include "qcheckview.h"
-
-#include <qpe/resource.h>
-#include <qregexp.h>
-#include <qlineedit.h>
-#include <qradiobutton.h>
-#include <qcombobox.h>
-#include <qapplication.h>
-#include <qpushbutton.h>
-#include <qdir.h>
-#include <qlabel.h>
-#include <qdatetime.h>
-#include <qmessagebox.h>
-#include <qcheckbox.h>
-#include <qfile.h>
-#include <qtextstream.h>
-#include <qbuttongroup.h>
-#include <qradiobutton.h>
-#include <qheader.h>
-
-QCheckView::QCheckView(QWidget *parent, QString filename)
- : QCheckViewBase(parent)
-{
- tblTransactions->setHScrollBarMode( QTable::AlwaysOff );
- tblTransactions->setNumRows( 0 );
- tblTransactions->setNumCols( 4 );
- tblTransactions->setShowGrid( FALSE );
- tblTransactions->horizontalHeader()->setLabel(0, "Num", 29);
- tblTransactions->horizontalHeader()->setLabel(1, "Description", 81);
- tblTransactions->horizontalHeader()->setLabel(2, "Date", 57);
- tblTransactions->horizontalHeader()->setLabel(3, "Amount", 59);
- tblTransactions->verticalHeader()->hide();
- tblTransactions->setLeftMargin( 0 );
- tblTransactions->setSelectionMode(QTable::NoSelection);
-
- m_filename = filename;
- load(filename);
-}
-
-void QCheckView::deleteClicked(int row, int col)
-{
- QStringList existing;
- QString rowText = tblTransactions->text(row, 0);
- config->setGroup(rowText);
- QString originalamount = config->readEntry("Amount", "0.00");
-
- config->setGroup("Data");
- int lastCheck = config->readNumEntry("LastCheck", 0);
-
- qWarning(rowText);
- config->setGroup(rowText);
- QString payment = config->readEntry("Payment", "true");
- if ( payment == QString("true") && rowText.toInt() <= lastCheck)
- {
- for(int i = row; i != (lastCheck); i++)
- {
- config->setGroup(tblTransactions->text(i, 0));
- QString ibalance = config->readEntry("Balance", "0.00");
- // this adds the old amount on to the transaction and then takes the new amount away
- QString newbalance = calculator(ibalance, originalamount, false);
- config->writeEntry("Balance", newbalance);
-
- if (i == (lastCheck - 1))
- {
- config->setGroup("Totals");
- config->writeEntry("Balance", newbalance);
- break;
- }
- }
- QString category = config->readEntry("Category", "Error");
- if (category != QString("Error"))
- {
- config->setGroup("Totals");
- config->writeEntry("Spent", calculator(config->readEntry("Spent", QString("0")), originalamount, true));
- QString categorytotal = config->readEntry(category, QString("0"));
- categorytotal = calculator(categorytotal, originalamount, true);
- config->writeEntry(category, categorytotal);
- }
- }
- if ( payment == QString("false") && rowText.toInt() <= lastCheck)
- {
- for(int i = row; i != (lastCheck); i++)
- {
- config->setGroup(tblTransactions->text(i, 0));
- QString ibalance = config->readEntry("Balance", "0.00");
- // this subtracts the old amount on to the transaction and then adds the new amount on
- QString newbalance = calculator(ibalance, originalamount, true);
- config->writeEntry("Balance", newbalance);
-
- if (i == lastCheck - 1)
- {
- config->setGroup("Totals");
- config->writeEntry("Balance", newbalance);
- break;
- }
- }
- config->setGroup("Totals");
- config->writeEntry("Deposited", calculator(config->readEntry("Deposited", QString("0")), originalamount, true));
- }
- for (int i = rowText.toInt(); i != lastCheck; i++)
- {
- qWarning(QString::number(i +1));
- config->setGroup(QString::number(i +1));
- QString origamount = config->readEntry("Amount", "0");
- qWarning(origamount);
- QString origbalance = config->readEntry("Balance", "0");
- QString origchecknumber = config->readEntry("CheckNumber", "0");
- QString origcomments = config->readEntry("Comments", "");
- QString origdate = config->readEntry("Date", "01/01/2000");
- QString origdescription = config->readEntry("Description", "No Description");
- QString origpayment = config->readEntry("Payment", "true");
- QString origtransactionfee = config->readEntry("TransactionFee", "0");
- QString origtype = config->readEntry("Type", "0");
-
- if (config->hasKey("Category"))
- {
- QString origcategory = config->readEntry("Category", "No Category");
- config->removeGroup();
- config->setGroup(QString::number(i));
- config->clearGroup();
- config->writeEntry("Category", origcategory);
- } else {
- config->removeGroup();
- config->setGroup(QString::number(i));
- config->clearGroup();
- }
- config->writeEntry("Amount", origamount);
- config->writeEntry("Balance", origbalance);
- config->writeEntry("CheckNumber", origchecknumber);
- config->writeEntry("Comments", origcomments);
- config->writeEntry("Date", origdate);
- config->writeEntry("Description", origdescription);
- config->writeEntry("Payment", origpayment);
- config->writeEntry("TransactionFee", origtransactionfee);
- config->writeEntry("Type", origtype);
- }
- tblTransactions->clearCell(row, col);
- labelBalance->setText(QString("$" + config->readEntry("Balance", QString("0.00"))));
- config->setGroup("Data");
- config->writeEntry("LastCheck", QString::number(QString(config->readEntry("LastCheck", 0)).toInt() -1));
- config->write();
- delete qcd;
- emit reload(m_filename);
-
-}
-
-void QCheckView::load(const QString filename)
-{
- config = new Config(filename, Config::File);
-
- connect(tblTransactions, SIGNAL(clicked(int, int, int, const QPoint &)), this, SLOT(tableClicked(int, int, int, const QPoint &)));
-
- config->setGroup("Totals");
- labelBalance->setText(QString("$" + config->readEntry("Balance", QString("0.00"))));
-
- config->setGroup("Data");
- int lastCheck = config->readNumEntry("LastCheck", 1);
- for (int i = 1; i != (lastCheck + 1); i++)
- {
- config->setGroup(QString::number(i));
- QString item = config->readEntry("Description", QString("Not Found"));
- if (item != "Not Found")
- {
- QTableItem *qti = new QTableItem(tblTransactions, QTableItem::Never, QString::number(i));
- QTableItem *qti1 = new QTableItem(tblTransactions, QTableItem::Never, config->readEntry("Description", QString("None")));
- QTableItem *qti2 = new QTableItem(tblTransactions, QTableItem::Never, config->readEntry("Date", QString("None")));
- QTableItem *qti3 = new QTableItem(tblTransactions, QTableItem::Never, QString("$" + config->readEntry("Amount", QString("0.00"))));
- int row = tblTransactions->numRows();
- tblTransactions->setNumRows(row + 1);
- tblTransactions->setItem(row,0, qti);
- tblTransactions->setItem(row,1, qti1);
- tblTransactions->setItem(row,2, qti2);
- tblTransactions->setItem(row,3, qti3);
- tblTransactions->updateCell(row, 0);
- tblTransactions->updateCell(row, 1);
- tblTransactions->updateCell(row, 2);
- tblTransactions->updateCell(row, 3);
- }
- }
-}
-
-void QCheckView::editClicked(int row, int col)
-{
- delete qcd;
- QStringList existing;
- QString rowText = tblTransactions->text(row, 0);
- config->setGroup("Data");
- QString recent = config->readEntry("Recent", "");
-
- config->setGroup(rowText);
- //We need the original amount to add or subtract to check's blanaces written after this edited check
- QString originalamount = config->readEntry("Amount", "0.00");
- QString originalcategory = config->readEntry("Category", "None");
-
- existing << config->readEntry("Payment", "true") << config->readEntry("Description", "No Description Found") << config->readEntry("Category", "Misc.") << config->readEntry("Type", "0") << config->readEntry("CheckNumber", "0") << originalamount << config->readEntry("TransactionFee", "") << config->readEntry("Date", "01/01/2001") << config->readEntry("Comments", "") << recent;
- QStringList result = QCheckEntry::popupEntry(existing);
- if (result.isEmpty() == false)
- {
- config->setGroup("Data");
- int lastCheck = config->readNumEntry("LastCheck", 0);
- config->writeEntry("Recent", result[9]);
-
- config->setGroup(rowText);
-
- tblTransactions->setText(row, 1, result[1]);
- tblTransactions->updateCell(row, 1);
-
- tblTransactions->setText(row, 2, result[7]);
- tblTransactions->updateCell(row, 2);
-
- tblTransactions->setText(row, 3, QString("$" + result[5]));
- tblTransactions->updateCell(row, 3);
-
- // This is how the list looks:
- // 0: true or false, true == payment, false == deposit
- // 1: description of the transaction
- // 2: category name
- // 3: transaction type (stores the integer value of the index of the combobox)
- // 4: check number of the transaction (if any)
- // 5: transaction amount
- // 6: transaction fee (e.g. service charge, or ATM charge).
- // 7: date of the transaction
- // 8: additional comments
- config->writeEntry("Payment", result[0]);
- config->writeEntry("Description", result[1]);
- if (result[0] == QString("true"))
- {
- config->writeEntry("Category", result[2]);
- }
- config->writeEntry("Type", result[3]);
- config->writeEntry("CheckNumber", result[4]);
- config->writeEntry("Amount", result[5]);
- config->writeEntry("TransactionFee", result[6]);
- config->writeEntry("Date", result[7]);
- config->writeEntry("Comments", result[8]);
- if (result[0] == QString("true"))
- {
- if (rowText.toInt() <= lastCheck)
- {
- for(int i = (rowText.toInt() - 1); i != (lastCheck); i++)
- {
- config->setGroup(tblTransactions->text(i, 0));
- QString ibalance = config->readEntry("Balance", "0.00");
-
- // this adds the old amount on to the transaction and then takes the new amount away
- QString newbalance = calculator(calculator(ibalance, originalamount, false), result[5], true);
- config->writeEntry("Balance", newbalance);
- if (i == (lastCheck - 1))
- {
- config->setGroup("Totals");
- config->writeEntry("Balance", newbalance);
- break;
- }
- }
- }
- config->setGroup("Totals");
- config->writeEntry("Spent", calculator(config->readEntry("Spent", QString("0")), originalamount, true));
- config->writeEntry("Spent", calculator(config->readEntry("Spent", QString("0")), result[5], false));
-
- if (result[2] == originalcategory)
- {
- QString categorytotal = config->readEntry(result[2], QString("0"));
- categorytotal = calculator(categorytotal, originalamount, true);
- categorytotal = calculator(categorytotal, result[5], false);
- config->writeEntry(result[2], categorytotal);
- } else {
- QString origtotal = config->readEntry(originalcategory, QString("0"));
- QString origfinal = calculator(origtotal, result[5], true);
- if (origfinal == "0" || origfinal == "0.00")
- {
- config->removeEntry(originalcategory);
- } else {
- config->writeEntry(originalcategory, origfinal);
- }
- QString categorytotal = config->readEntry(result[2], QString("0"));
- categorytotal = calculator(categorytotal, originalamount, false);
- config->writeEntry(result[2],categorytotal);
- }
- }
- if (result[0] == QString("false"))
- {
- if (rowText.toInt() <= lastCheck)
- {
- for(int i = (rowText.toInt() - 1 ); i != (lastCheck); i++)
- {
- config->setGroup(tblTransactions->text(i, 0));
- QString ibalance = config->readEntry("Balance", "0.00");
-
- // this subtracts the old amount on to the transaction and then adds the new amount on
- QString newbalance = calculator(calculator(ibalance, originalamount, true), result[5], false);
- config->writeEntry("Balance", newbalance);
- if (i == lastCheck - 1)
- {
- config->setGroup("Totals");
- config->writeEntry("Balance", newbalance);
- break;
- }
- }
- }
- config->setGroup("Totals");
- config->writeEntry("Deposited", calculator(config->readEntry("Deposited", QString("0")), originalamount, true));
- config->writeEntry("Deposited", calculator(config->readEntry("Deposited", QString("0")), result[5], false));
- }
- labelBalance->setText(QString("$" + config->readEntry("Balance", QString("0.00"))));
- config->write();
- }
-}
-void QCheckView::tableClicked(int row, int col, int mouseButton, const QPoint &mousePos)
-{
- if (tblTransactions->text(row, col).isEmpty() == false)
- {
- QStringList existing;
- config->setGroup(tblTransactions->text(row, 0));
- existing << config->readEntry("Payment", "true") << config->readEntry("Description", "No Description Found") << config->readEntry("Category", "Misc.") << config->readEntry("Type", "0") << config->readEntry("CheckNumber", "0") << config->readEntry("Amount", "0.00") << config->readEntry("TransactionFee", "0.00") << config->readEntry("Date", "01/01/2001") << config->readEntry("Comments", "") << config->readEntry("Balance", "0.00");
- qcd = new QCheckDetails(row, col, existing);
- qcd->showMaximized();
- connect(qcd, SIGNAL(editClicked(int, int)), this, SLOT(editClicked(int, int)));
- connect(qcd, SIGNAL(deleteClicked(int, int)), this, SLOT(deleteClicked(int, int)));
- }
-}
-
-void QCheckView::newClicked()
-{
- config->setGroup("Data");
- QString recent = config->readEntry("Recent", "");
- QStringList kindablank;
- kindablank << recent;
- QStringList result = QCheckEntry::popupEntry(kindablank);
- if (result.count() > 1)
- {
- QTableItem *qti = new QTableItem(tblTransactions, QTableItem::Never, result[1]);
- int row = tblTransactions->numRows();
- tblTransactions->setNumRows(row + 1);
- tblTransactions->setItem(row,1, qti);
- tblTransactions->updateCell(row, 1);
- config->setGroup("Data");
- config->writeEntry("Recent", result[9]);
- int lastCheck = config->readNumEntry("LastCheck", 0);
- if (lastCheck == 0)
- {
- config->writeEntry("LastCheck", 1);
- } else {
- config->writeEntry("LastCheck", (lastCheck + 1));
- }
- QString number = QString::number(lastCheck + 1);
- config->setGroup(number);
-
- QTableItem *qti1 = new QTableItem(tblTransactions, QTableItem::Never, number);
- tblTransactions->setItem(row, 0, qti1);
- tblTransactions->updateCell(row, 0);
-
- QTableItem *qti2 = new QTableItem(tblTransactions, QTableItem::Never, result[7]);
- tblTransactions->setItem(row, 2, qti2);
- tblTransactions->updateCell(row, 2);
-
- QTableItem *qti3 = new QTableItem(tblTransactions, QTableItem::Never, QString("$" + result[5]));
- tblTransactions->setItem(row, 3, qti3);
- tblTransactions->updateCell(row, 3);
-
- // This is how the list looks:
- // 0: true or false, true == payment, false == deposit
- // 1: description of the transaction
- // 2: category name
- // 3: transaction type (stores the integer value of the index of the combobox)
- // 4: check number of the transaction (if any)
- // 5: transaction amount
- // 6: transaction fee (e.g. service charge, or ATM charge).
- // 7: date of the transaction
- config->writeEntry("Payment", result[0]);
- config->writeEntry("Description", result[1]);
- if (result[0] == QString("true"))
- {
- config->writeEntry("Category", result[2]);
- }
- config->writeEntry("Type", result[3]);
- config->writeEntry("CheckNumber", result[4]);
- config->writeEntry("Amount", result[5]);
- config->writeEntry("TransactionFee", result[6]);
- config->writeEntry("Date", result[7]);
- config->writeEntry("Comments", result[8]);
- config->setGroup("Totals");
- if (result[0] == QString("true"))
- {
- QString totalspent = config->readEntry("Spent", QString("0"));
- totalspent = calculator(totalspent, result[5], false);
- config->writeEntry("Spent", totalspent);
- QString balance = config->readEntry("Balance", QString("0"));
- balance = calculator(balance, result[5], true);
-
- // Make sure to add the fee on, if any
- balance = calculator(balance, result[6], true);
-
- config->writeEntry("Balance", balance);
-
- config->setGroup(number);
- config->writeEntry("Balance", balance);
-
- config->setGroup("Totals");
- QString categorytotal = config->readEntry(result[2], QString("0"));
- categorytotal = calculator(categorytotal, result[5], false);
- config->writeEntry(result[2], categorytotal);
- }
- if (result[0] == QString("false"))
- {
- QString totaldeposited = config->readEntry("Deposited", QString("0"));
- totaldeposited = calculator(totaldeposited, result[5], false);
- config->writeEntry("Deposited", totaldeposited);
- QString balance = config->readEntry("Balance", QString("0"));
- balance = calculator(balance, result[5], false);
-
- // Make sure to add the fee on, if any
- balance = calculator(balance, result[6], true);
-
- config->writeEntry("Balance", balance);
-
- config->setGroup(number);
- config->writeEntry("Balance", balance);
- }
- }
- config->setGroup("Totals");
- labelBalance->setText(QString("$" + config->readEntry("Balance", QString("0.00"))));
- config->write();
-}
-
-QString QCheckView::calculator(QString largervalue, QString smallervalue, bool subtract)
-{
- // This class provides a way to eliminate the ARM processor problem of not being able to handle
- // decimals. I just take the two QString'ed numbers and find the decimal point, then I remove the decimal
- // point seperating the number into two. Then I convert it to cents (times it times 100) and add/
- // substract the two together. Put the decimals back in, and return.
-
- largervalue = largervalue.remove(largervalue.find(".", 0, false), 1);
- smallervalue = smallervalue.remove(smallervalue.find(".", 0, false), 1);
-
- int largercents = largervalue.toInt();
- int smallercents = smallervalue.toInt();
-
- int finalammount = 0;
-
- if (subtract == true)
- {
- finalammount = largercents - smallercents;
- } else {
- finalammount = largercents + smallercents;
- }
-
- QString returnvalue = QString::number(finalammount);
- if (returnvalue.length() >= 2)
- {
- returnvalue.insert((returnvalue.length() - 2), ".");
- } else {
- if (returnvalue.length() == 1)
- {
- returnvalue.prepend("0.0");
- }
- }
- return returnvalue;
-}
diff --git a/noncore/apps/checkbook/qcheckviewbase.ui b/noncore/apps/checkbook/qcheckviewbase.ui
deleted file mode 100644
index 00ed7dd..0000000
--- a/noncore/apps/checkbook/qcheckviewbase.ui
+++ b/dev/null
@@ -1,122 +0,0 @@
-<!DOCTYPE UI><UI>
-<class>QCheckViewBase</class>
-<widget>
- <class>QWidget</class>
- <property stdset="1">
- <name>name</name>
- <cstring>QCheckViewBase</cstring>
- </property>
- <property stdset="1">
- <name>geometry</name>
- <rect>
- <x>0</x>
- <y>0</y>
- <width>242</width>
- <height>312</height>
- </rect>
- </property>
- <property stdset="1">
- <name>caption</name>
- <string>Account Transactions</string>
- </property>
- <grid>
- <property stdset="1">
- <name>margin</name>
- <number>5</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>1</number>
- </property>
- <widget row="0" column="1" >
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>labelBalance</cstring>
- </property>
- <property stdset="1">
- <name>frameShape</name>
- <enum>MShape</enum>
- </property>
- <property stdset="1">
- <name>frameShadow</name>
- <enum>MShadow</enum>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>$0.00</string>
- </property>
- <property stdset="1">
- <name>alignment</name>
- <set>AlignCenter</set>
- </property>
- <property>
- <name>hAlign</name>
- </property>
- </widget>
- <widget row="1" column="0" rowspan="1" colspan="2" >
- <class>QTable</class>
- <property stdset="1">
- <name>name</name>
- <cstring>tblTransactions</cstring>
- </property>
- <property stdset="1">
- <name>hScrollBarMode</name>
- <enum>AlwaysOff</enum>
- </property>
- <property stdset="1">
- <name>numRows</name>
- <number>0</number>
- </property>
- <property stdset="1">
- <name>numCols</name>
- <number>4</number>
- </property>
- <property stdset="1">
- <name>showGrid</name>
- <bool>false</bool>
- </property>
- </widget>
- <widget row="0" column="0" >
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>TextLabel3</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Balance:</string>
- </property>
- <property stdset="1">
- <name>alignment</name>
- <set>AlignVCenter|AlignRight</set>
- </property>
- <property>
- <name>hAlign</name>
- </property>
- </widget>
- </grid>
-</widget>
-<customwidgets>
- <customwidget>
- <class>QWidget</class>
- <header location="global">qwidget.h</header>
- <sizehint>
- <width>-1</width>
- <height>-1</height>
- </sizehint>
- <container>0</container>
- <sizepolicy>
- <hordata>5</hordata>
- <verdata>5</verdata>
- </sizepolicy>
- <pixmap>image0</pixmap>
- </customwidget>
-</customwidgets>
-<images>
- <image>
- <name>image0</name>
- <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1ddec44f503c0ae2a154410f53d0ed20e2bf6bdb656dd6861dd23d9a66591b0587fd1654235ebded6f0edcd53e419d87ae7b1f4f9b8f906d0bfe012317426a70b07bdc2f3ec77f8ed6b89559061a0343d06a124cc105596482585094bc0ae599b04646c9018926491b2205e140c485cace25755c175d0a967b622ff900b8cc9c7d29af594ea722d589167f813aa852ba07d94b9dce296e883fe7bb163f23896753</data>
- </image>
-</images>
-</UI>
diff --git a/noncore/apps/checkbook/qrestrictedcombo.cpp b/noncore/apps/checkbook/qrestrictedcombo.cpp
deleted file mode 100644
index e1533f6..0000000
--- a/noncore/apps/checkbook/qrestrictedcombo.cpp
+++ b/dev/null
@@ -1,78 +0,0 @@
-/*
- *
- * $Id$
- *
- * Implementation of QRestrictedCombo
- *
- * Copyright (C) 1997 Michael Wiedmann, <mw@miwie.in-berlin.de>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include <qkeycode.h>
-
-#include "qrestrictedcombo.h"
-
-QRestrictedCombo::QRestrictedCombo( QWidget *parent,
- const char *name,
- const QString& valid )
- : QComboBox( parent, name )
-{
- qsValidChars = valid;
-}
-
-QRestrictedCombo::~QRestrictedCombo()
-{
- ;
-}
-
-
-void QRestrictedCombo::keyPressEvent( QKeyEvent *e )
-{
- // let QLineEdit process "special" keys and return/enter
- // so that we still can use the default key binding
- if (e->key() == Key_Enter || e->key() == Key_Return || e->key() == Key_Delete || e->ascii() < 32)
- {
- QComboBox::keyPressEvent(e);
- return;
- }
-
- // do we have a list of valid chars &&
- // is the pressed key in the list of valid chars?
- if (!qsValidChars.isEmpty() && !qsValidChars.contains(e->ascii()))
- {
- // invalid char, emit signal and return
- emit (invalidChar(e->key()));
- return;
- }
- else
- // valid char: let QLineEdit process this key as usual
- QComboBox::keyPressEvent(e);
-
- return;
-}
-
-
-void QRestrictedCombo::setValidChars( const QString& valid)
-{
- qsValidChars = valid;
-}
-
-QString QRestrictedCombo::validChars() const
-{
- return qsValidChars;
-}
-
diff --git a/noncore/apps/checkbook/qrestrictedcombo.h b/noncore/apps/checkbook/qrestrictedcombo.h
deleted file mode 100644
index 50ea59f..0000000
--- a/noncore/apps/checkbook/qrestrictedcombo.h
+++ b/dev/null
@@ -1,96 +0,0 @@
-/*
- *
- * Definition of QRestrictedCombo
- *
- * Copyright (C) 1997 Michael Wiedmann, <mw@miwie.in-berlin.de>
- *
- * Edited 2001 by Nick Betcher <nbetcher@usinternet.com> to work
- * with Qt-only. Changed class name from LRestrictedLine to
- * QRestrictedCombo in order to accomidate Combo Boxes.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#ifndef QRESTRICTEDCOMBO_H
-#define QRESTRICTEDCOMBO_H
-
-#include <qcombobox.h>
-
-/**
- * The QRestrictedCombo widget is a variant of @ref QComboBox which
- * accepts only a restricted set of characters as input.
- * All other characters will be discarded and the signal @ref #invalidChar()
- * will be emitted for each of them.
- *
- * Valid characters can be passed as a QString to the constructor
- * or set afterwards via @ref #setValidChars().
- * The default key bindings of @ref QComboBox are still in effect.
- *
- * @short A line editor for restricted character sets.
- * @author Michael Wiedmann <mw@miwie.in-berlin.de>
- * @version 0.0.1
- */
-class QRestrictedCombo : public QComboBox
-{
- Q_OBJECT
- Q_PROPERTY( QString validChars READ validChars WRITE setValidChars )
-
-public:
-
- /**
- * Constructor: This contructor takes three - optional - arguments.
- * The first two parameters are simply passed on to @ref QLineEdit.
- * @param parent pointer to the parent widget
- * @param name pointer to the name of this widget
- * @param valid pointer to set of valid characters
- */
- QRestrictedCombo( QWidget *parent=0, const char *name=0,
- const QString& valid = QString::null);
-
- /**
- * Destructs the restricted line editor.
- */
- ~QRestrictedCombo();
-
- /**
- * All characters in the string valid are treated as
- * acceptable characters.
- */
- void setValidChars(const QString& valid);
- /**
- * @return the string of acceptable characters.
- */
- QString validChars() const;
-
-signals:
-
- /**
- * Emitted when an invalid character was typed.
- */
- void invalidChar(int);
-
-protected:
- /**
- * @reimplemented
- */
- void keyPressEvent( QKeyEvent *e );
-
-private:
- /// QString of valid characters for this line
- QString qsValidChars;
-};
-
-#endif // QRESTRICTEDCOMBO_H
diff --git a/noncore/apps/checkbook/qrestrictedline.cpp b/noncore/apps/checkbook/qrestrictedline.cpp
deleted file mode 100644
index 8508c33..0000000
--- a/noncore/apps/checkbook/qrestrictedline.cpp
+++ b/dev/null
@@ -1,78 +0,0 @@
-/*
- *
- * $Id$
- *
- * Implementation of QRestrictedLine
- *
- * Copyright (C) 1997 Michael Wiedmann, <mw@miwie.in-berlin.de>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include <qkeycode.h>
-
-#include "qrestrictedline.h"
-
-QRestrictedLine::QRestrictedLine( QWidget *parent,
- const char *name,
- const QString& valid )
- : QLineEdit( parent, name )
-{
- qsValidChars = valid;
-}
-
-QRestrictedLine::~QRestrictedLine()
-{
- ;
-}
-
-
-void QRestrictedLine::keyPressEvent( QKeyEvent *e )
-{
- // let QLineEdit process "special" keys and return/enter
- // so that we still can use the default key binding
- if (e->key() == Key_Enter || e->key() == Key_Return || e->key() == Key_Delete || e->ascii() < 32)
- {
- QLineEdit::keyPressEvent(e);
- return;
- }
-
- // do we have a list of valid chars &&
- // is the pressed key in the list of valid chars?
- if (!qsValidChars.isEmpty() && !qsValidChars.contains(e->ascii()))
- {
- // invalid char, emit signal and return
- emit (invalidChar(e->key()));
- return;
- }
- else
- // valid char: let QLineEdit process this key as usual
- QLineEdit::keyPressEvent(e);
-
- return;
-}
-
-
-void QRestrictedLine::setValidChars( const QString& valid)
-{
- qsValidChars = valid;
-}
-
-QString QRestrictedLine::validChars() const
-{
- return qsValidChars;
-}
-
diff --git a/noncore/apps/checkbook/qrestrictedline.h b/noncore/apps/checkbook/qrestrictedline.h
deleted file mode 100644
index 7e41cd9..0000000
--- a/noncore/apps/checkbook/qrestrictedline.h
+++ b/dev/null
@@ -1,96 +0,0 @@
-/*
- *
- * Definition of QRestrictedLine
- *
- * Copyright (C) 1997 Michael Wiedmann, <mw@miwie.in-berlin.de>
- *
- * Edited 2001 by Nick Betcher <nbetcher@usinternet.com> to work
- * with Qt-only. Changed class name from QRestrictedLine to
- * QRestrictedLine.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#ifndef QRESTRICTEDLINE_H
-#define QRESTRICTEDLINE_H
-
-#include <qlineedit.h>
-
-/**
- * The QRestrictedLine widget is a variant of @ref QLineEdit which
- * accepts only a restricted set of characters as input.
- * All other characters will be discarded and the signal @ref #invalidChar()
- * will be emitted for each of them.
- *
- * Valid characters can be passed as a QString to the constructor
- * or set afterwards via @ref #setValidChars().
- * The default key bindings of @ref QLineEdit are still in effect.
- *
- * @short A line editor for restricted character sets.
- * @author Michael Wiedmann <mw@miwie.in-berlin.de>
- * @version 0.0.1
- */
-class QRestrictedLine : public QLineEdit
-{
- Q_OBJECT
- Q_PROPERTY( QString validChars READ validChars WRITE setValidChars )
-
-public:
-
- /**
- * Constructor: This contructor takes three - optional - arguments.
- * The first two parameters are simply passed on to @ref QLineEdit.
- * @param parent pointer to the parent widget
- * @param name pointer to the name of this widget
- * @param valid pointer to set of valid characters
- */
- QRestrictedLine( QWidget *parent=0, const char *name=0,
- const QString& valid = QString::null);
-
- /**
- * Destructs the restricted line editor.
- */
- ~QRestrictedLine();
-
- /**
- * All characters in the string valid are treated as
- * acceptable characters.
- */
- void setValidChars(const QString& valid);
- /**
- * @return the string of acceptable characters.
- */
- QString validChars() const;
-
-signals:
-
- /**
- * Emitted when an invalid character was typed.
- */
- void invalidChar(int);
-
-protected:
- /**
- * @reimplemented
- */
- void keyPressEvent( QKeyEvent *e );
-
-private:
- /// QString of valid characters for this line
- QString qsValidChars;
-};
-
-#endif // QRESTRICTEDLINE_H