From 9de9f5362eff3f0fb25672dfc93c5cb87f5201c0 Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Wed, 9 Aug 2017 16:09:32 +0200 Subject: [PATCH] Drop the cutecash experiment and the gtkmm optional bindings These are currently unmaintained, cutecash us based on the obsolete qt4 and gtkmm is only used by cutecash. Whenever someone wishes to revive this experiment it can be recovered from git history and be brought into a separate repository. --- .gitignore | 1 - CMakeLists.txt | 28 +- configure.ac | 25 - po/CMakeLists.txt | 2 +- po/POTFILES.skip | 4 - src/CMakeLists.txt | 6 - src/bin/gnucash-bin.c | 1 - src/gnc/.gitignore | 1 - src/gnc/AccountItemModel.cpp | 248 ------ src/gnc/AccountItemModel.hpp | 122 --- src/gnc/AccountSelectionDelegate.cpp | 122 --- src/gnc/AccountSelectionDelegate.hpp | 55 -- src/gnc/CMakeLists.txt | 133 --- src/gnc/Cmd.cpp | 478 ----------- src/gnc/Cmd.hpp | 162 ---- src/gnc/Doxyfile | 228 ------ src/gnc/QofEventWrapper.cpp | 59 -- src/gnc/QofEventWrapper.hpp | 157 ---- src/gnc/RecentFileMenu.cpp | 155 ---- src/gnc/RecentFileMenu.hpp | 94 --- src/gnc/Session.cpp | 95 --- src/gnc/Session.hpp | 109 --- src/gnc/SplitListModel.cpp | 756 ----------------- src/gnc/SplitListModel.hpp | 110 --- src/gnc/SplitListView.cpp | 119 --- src/gnc/SplitListView.hpp | 62 -- src/gnc/WeakPointer.hpp | 94 --- src/gnc/bla.html | 20 - src/gnc/conv.hpp | 37 - src/gnc/dashboard.cpp | 335 -------- src/gnc/dashboard.hpp | 124 --- src/gnc/dashboard.ui | 329 -------- src/gnc/fallback-icons.qrc | 18 - src/gnc/fpo/FPO.cpp | 46 -- src/gnc/fpo/FPO.hpp | 35 - src/gnc/fpo/ViewletModel.cpp | 236 ------ src/gnc/fpo/ViewletModel.hpp | 55 -- src/gnc/fpo/ViewletView.cpp | 371 --------- src/gnc/fpo/ViewletView.hpp | 102 --- src/gnc/gnucash.qrc | 21 - src/gnc/gtk-icons.qrc | 16 - src/gnc/gtk-icons/gtk-about.png | Bin 1710 -> 0 bytes src/gnc/gtk-icons/gtk-close.png | Bin 1045 -> 0 bytes src/gnc/gtk-icons/gtk-copy.png | Bin 567 -> 0 bytes src/gnc/gtk-icons/gtk-cut.png | Bin 1532 -> 0 bytes src/gnc/gtk-icons/gtk-new.png | Bin 1393 -> 0 bytes src/gnc/gtk-icons/gtk-open.png | Bin 971 -> 0 bytes src/gnc/gtk-icons/gtk-paste.png | Bin 1143 -> 0 bytes src/gnc/gtk-icons/gtk-quit.png | Bin 1207 -> 0 bytes src/gnc/gtk-icons/gtk-redo.png | Bin 1608 -> 0 bytes src/gnc/gtk-icons/gtk-save-as.png | Bin 2024 -> 0 bytes src/gnc/gtk-icons/gtk-save.png | Bin 1944 -> 0 bytes src/gnc/gtk-icons/gtk-undo.png | Bin 1555 -> 0 bytes .../oxygen/48x48/actions/document-new.png | Bin 2461 -> 0 bytes .../oxygen/48x48/actions/document-open.png | Bin 1616 -> 0 bytes .../oxygen/48x48/actions/document-save-as.png | Bin 3792 -> 0 bytes .../oxygen/48x48/actions/document-save.png | Bin 2122 -> 0 bytes .../icons/oxygen/48x48/actions/edit-copy.png | Bin 1380 -> 0 bytes .../icons/oxygen/48x48/actions/edit-cut.png | Bin 1666 -> 0 bytes .../icons/oxygen/48x48/actions/edit-paste.png | Bin 1578 -> 0 bytes .../icons/oxygen/48x48/actions/edit-redo.png | Bin 3383 -> 0 bytes .../icons/oxygen/48x48/actions/edit-undo.png | Bin 3440 -> 0 bytes .../icons/oxygen/48x48/actions/help-about.png | Bin 2742 -> 0 bytes .../icons/oxygen/48x48/actions/list-add.png | Bin 2658 -> 0 bytes .../oxygen/48x48/actions/tab-close-other.png | Bin 2451 -> 0 bytes .../oxygen/48x48/actions/window-close.png | Bin 3751 -> 0 bytes src/gnc/icons/oxygen/index.theme | 35 - src/gnc/main.cpp | 221 ----- src/gnc/mainwindow-file.cpp | 763 ------------------ src/gnc/mainwindow.cpp | 633 --------------- src/gnc/mainwindow.hpp | 151 ---- src/gnc/mainwindow.ui | 430 ---------- src/gnc/metatype.hpp | 12 - src/gnc/qss/default.qss | 48 -- src/gnc/stylesheets.qrc | 5 - src/optional/CMakeLists.txt | 3 +- src/optional/Makefile.am | 5 +- src/optional/gtkmm/CMakeLists.txt | 63 -- src/optional/gtkmm/Makefile.am | 62 -- src/optional/gtkmm/gnc-plugin-gtkmm-ui.xml | 11 - src/optional/gtkmm/gnc-plugin-gtkmm.cpp | 187 ----- src/optional/gtkmm/gnc-plugin-gtkmm.hpp | 90 --- src/optional/gtkmm/gncmm/Account.cpp | 136 ---- src/optional/gtkmm/gncmm/Account.hpp | 194 ----- src/optional/gtkmm/gncmm/Book.cpp | 145 ---- src/optional/gtkmm/gncmm/Book.hpp | 130 --- src/optional/gtkmm/gncmm/Commodity.cpp | 118 --- src/optional/gtkmm/gncmm/Commodity.hpp | 159 ---- src/optional/gtkmm/gncmm/GncInstance.cpp | 142 ---- src/optional/gtkmm/gncmm/GncInstance.hpp | 128 --- src/optional/gtkmm/gncmm/Numeric.cpp | 74 -- src/optional/gtkmm/gncmm/Numeric.hpp | 340 -------- src/optional/gtkmm/gncmm/Split.cpp | 205 ----- src/optional/gtkmm/gncmm/Split.hpp | 322 -------- src/optional/gtkmm/gncmm/Transaction.cpp | 225 ------ src/optional/gtkmm/gncmm/Transaction.hpp | 336 -------- .../gtkmm/gncmm/private/Account_p.hpp | 48 -- src/optional/gtkmm/gncmm/private/Book_p.hpp | 48 -- .../gtkmm/gncmm/private/Commodity_p.hpp | 48 -- .../gtkmm/gncmm/private/GncInstance_p.hpp | 48 -- src/optional/gtkmm/gncmm/private/Split_p.hpp | 48 -- .../gtkmm/gncmm/private/Transaction_p.hpp | 48 -- src/optional/gtkmm/gncmm/wrap_init.cpp | 85 -- src/optional/gtkmm/gncmm/wrap_init.hpp | 32 - src/optional/gtkmm/gncmod-gtkmm.cpp | 102 --- src/optional/gtkmm/test/CMakeLists.txt | 2 - src/optional/gtkmm/test/Makefile.am | 50 -- src/optional/gtkmm/test/test-book.cpp | 176 ---- src/optional/gtkmm/test/test-gtkmm.cpp | 64 -- 109 files changed, 4 insertions(+), 11339 deletions(-) delete mode 100644 src/gnc/.gitignore delete mode 100644 src/gnc/AccountItemModel.cpp delete mode 100644 src/gnc/AccountItemModel.hpp delete mode 100644 src/gnc/AccountSelectionDelegate.cpp delete mode 100644 src/gnc/AccountSelectionDelegate.hpp delete mode 100644 src/gnc/CMakeLists.txt delete mode 100644 src/gnc/Cmd.cpp delete mode 100644 src/gnc/Cmd.hpp delete mode 100644 src/gnc/Doxyfile delete mode 100644 src/gnc/QofEventWrapper.cpp delete mode 100644 src/gnc/QofEventWrapper.hpp delete mode 100644 src/gnc/RecentFileMenu.cpp delete mode 100644 src/gnc/RecentFileMenu.hpp delete mode 100644 src/gnc/Session.cpp delete mode 100644 src/gnc/Session.hpp delete mode 100644 src/gnc/SplitListModel.cpp delete mode 100644 src/gnc/SplitListModel.hpp delete mode 100644 src/gnc/SplitListView.cpp delete mode 100644 src/gnc/SplitListView.hpp delete mode 100644 src/gnc/WeakPointer.hpp delete mode 100644 src/gnc/bla.html delete mode 100644 src/gnc/conv.hpp delete mode 100644 src/gnc/dashboard.cpp delete mode 100644 src/gnc/dashboard.hpp delete mode 100644 src/gnc/dashboard.ui delete mode 100644 src/gnc/fallback-icons.qrc delete mode 100644 src/gnc/fpo/FPO.cpp delete mode 100644 src/gnc/fpo/FPO.hpp delete mode 100644 src/gnc/fpo/ViewletModel.cpp delete mode 100644 src/gnc/fpo/ViewletModel.hpp delete mode 100644 src/gnc/fpo/ViewletView.cpp delete mode 100644 src/gnc/fpo/ViewletView.hpp delete mode 100644 src/gnc/gnucash.qrc delete mode 100644 src/gnc/gtk-icons.qrc delete mode 100644 src/gnc/gtk-icons/gtk-about.png delete mode 100644 src/gnc/gtk-icons/gtk-close.png delete mode 100644 src/gnc/gtk-icons/gtk-copy.png delete mode 100644 src/gnc/gtk-icons/gtk-cut.png delete mode 100644 src/gnc/gtk-icons/gtk-new.png delete mode 100644 src/gnc/gtk-icons/gtk-open.png delete mode 100644 src/gnc/gtk-icons/gtk-paste.png delete mode 100644 src/gnc/gtk-icons/gtk-quit.png delete mode 100644 src/gnc/gtk-icons/gtk-redo.png delete mode 100644 src/gnc/gtk-icons/gtk-save-as.png delete mode 100644 src/gnc/gtk-icons/gtk-save.png delete mode 100644 src/gnc/gtk-icons/gtk-undo.png delete mode 100644 src/gnc/icons/oxygen/48x48/actions/document-new.png delete mode 100644 src/gnc/icons/oxygen/48x48/actions/document-open.png delete mode 100644 src/gnc/icons/oxygen/48x48/actions/document-save-as.png delete mode 100644 src/gnc/icons/oxygen/48x48/actions/document-save.png delete mode 100644 src/gnc/icons/oxygen/48x48/actions/edit-copy.png delete mode 100644 src/gnc/icons/oxygen/48x48/actions/edit-cut.png delete mode 100644 src/gnc/icons/oxygen/48x48/actions/edit-paste.png delete mode 100644 src/gnc/icons/oxygen/48x48/actions/edit-redo.png delete mode 100644 src/gnc/icons/oxygen/48x48/actions/edit-undo.png delete mode 100644 src/gnc/icons/oxygen/48x48/actions/help-about.png delete mode 100644 src/gnc/icons/oxygen/48x48/actions/list-add.png delete mode 100644 src/gnc/icons/oxygen/48x48/actions/tab-close-other.png delete mode 100644 src/gnc/icons/oxygen/48x48/actions/window-close.png delete mode 100644 src/gnc/icons/oxygen/index.theme delete mode 100644 src/gnc/main.cpp delete mode 100644 src/gnc/mainwindow-file.cpp delete mode 100644 src/gnc/mainwindow.cpp delete mode 100644 src/gnc/mainwindow.hpp delete mode 100644 src/gnc/mainwindow.ui delete mode 100644 src/gnc/metatype.hpp delete mode 100644 src/gnc/qss/default.qss delete mode 100644 src/gnc/stylesheets.qrc delete mode 100644 src/optional/gtkmm/CMakeLists.txt delete mode 100644 src/optional/gtkmm/Makefile.am delete mode 100644 src/optional/gtkmm/gnc-plugin-gtkmm-ui.xml delete mode 100644 src/optional/gtkmm/gnc-plugin-gtkmm.cpp delete mode 100644 src/optional/gtkmm/gnc-plugin-gtkmm.hpp delete mode 100644 src/optional/gtkmm/gncmm/Account.cpp delete mode 100644 src/optional/gtkmm/gncmm/Account.hpp delete mode 100644 src/optional/gtkmm/gncmm/Book.cpp delete mode 100644 src/optional/gtkmm/gncmm/Book.hpp delete mode 100644 src/optional/gtkmm/gncmm/Commodity.cpp delete mode 100644 src/optional/gtkmm/gncmm/Commodity.hpp delete mode 100644 src/optional/gtkmm/gncmm/GncInstance.cpp delete mode 100644 src/optional/gtkmm/gncmm/GncInstance.hpp delete mode 100644 src/optional/gtkmm/gncmm/Numeric.cpp delete mode 100644 src/optional/gtkmm/gncmm/Numeric.hpp delete mode 100644 src/optional/gtkmm/gncmm/Split.cpp delete mode 100644 src/optional/gtkmm/gncmm/Split.hpp delete mode 100644 src/optional/gtkmm/gncmm/Transaction.cpp delete mode 100644 src/optional/gtkmm/gncmm/Transaction.hpp delete mode 100644 src/optional/gtkmm/gncmm/private/Account_p.hpp delete mode 100644 src/optional/gtkmm/gncmm/private/Book_p.hpp delete mode 100644 src/optional/gtkmm/gncmm/private/Commodity_p.hpp delete mode 100644 src/optional/gtkmm/gncmm/private/GncInstance_p.hpp delete mode 100644 src/optional/gtkmm/gncmm/private/Split_p.hpp delete mode 100644 src/optional/gtkmm/gncmm/private/Transaction_p.hpp delete mode 100644 src/optional/gtkmm/gncmm/wrap_init.cpp delete mode 100644 src/optional/gtkmm/gncmm/wrap_init.hpp delete mode 100644 src/optional/gtkmm/gncmod-gtkmm.cpp delete mode 100644 src/optional/gtkmm/test/CMakeLists.txt delete mode 100644 src/optional/gtkmm/test/Makefile.am delete mode 100644 src/optional/gtkmm/test/test-book.cpp delete mode 100644 src/optional/gtkmm/test/test-gtkmm.cpp diff --git a/.gitignore b/.gitignore index 3d5e3eabcd..369109333e 100644 --- a/.gitignore +++ b/.gitignore @@ -193,7 +193,6 @@ src/import-export/qif-import/test/test-link src/import-export/test/test-import-parse src/import-export/test/test-link src/engine/test/test-qof -src/optional/gtkmm/test/test-gtkmm src/optional/python-bindings/.py-links src/optional/python-bindings/gnucash/ src/optional/python-bindings/gnucash_core.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 363e452f82..eb9a65d525 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,8 +53,7 @@ INCLUDE (MakeDistFiles) OPTION (WITH_SQL "Build this project with SQL (libdbi) support" ON) OPTION (WITH_AQBANKING "Build this project with aqbanking (online banking) support" ON) -OPTION (WITH_GNUCASH "Build all of GnuCash, not just cutecash" ON) -OPTION (WITH_CUTECASH "Also build cutecash" OFF) +OPTION (WITH_GNUCASH "Build all of GnuCash, not just the library" ON) OPTION (WITH_OFX "compile with ofx support (needs LibOFX)" ON) OPTION (WITH_PYTHON "enable python plugin and bindings" OFF) OPTION (ENABLE_BINRELOC "compile with binary relocation support" ON) @@ -197,9 +196,6 @@ IF (WITH_GNUCASH) ENDIF (WITH_GNUCASH) GNC_PKG_CHECK_MODULES (ZLIB REQUIRED zlib) -IF (WITH_CUTECASH) - GNC_PKG_CHECK_MODULES (GLIBMM REQUIRED glibmm-2.4>=2.24) -ENDIF(WITH_CUTECASH) IF (MSVC) MESSAGE (STATUS "Hint: To create the import libraries for the gnome DLLs (e.g. gconf-2.lib), use the dlltool as follows: pexports bin/libgconf-2-4.dll > lib/libgconf-2.def ; dlltool -d lib/libgconf-2.def -D bin/libgconf-2-4.dll -l lib/gconf-2.lib") @@ -289,12 +285,6 @@ IF (NOT GUILE_EXECUTABLE) MESSAGE (SEND_ERROR "The guile executable was not found, but is required. Please set GUILE_EXECUTABLE.") ENDIF (NOT GUILE_EXECUTABLE) -# Qt -IF (WITH_CUTECASH) - SET (QT_MIN_VERSION "4.5.0") - FIND_PACKAGE (Qt4 REQUIRED) # find and setup Qt4 for this project -ENDIF (WITH_CUTECASH) - # ############################################################ IF (WITH_AQBANKING) GNC_PKG_CHECK_MODULES (GWENHYWFAR REQUIRED gwenhywfar) @@ -731,22 +721,6 @@ ENDIF() # ############################################################ # Package creation rules -IF (WITH_CUTECASH) -SET (CUTECASH_VERSION_MAJOR "0") -SET (CUTECASH_VERSION_MINOR "1") -SET (CUTECASH_VERSION_PATCH "0") -SET (CUTECASH_VERSION_NANO "0") - -SET (CPACK_PACKAGE_NAME "Cutecash") -SET (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Cutecash Free Finance Software") -SET (CPACK_PACKAGE_VERSION_MAJOR ${CUTECASH_VERSION_MAJOR}) -SET (CPACK_PACKAGE_VERSION_MINOR ${CUTECASH_VERSION_MINOR}) -SET (CPACK_PACKAGE_VERSION_PATCH ${CUTECASH_VERSION_PATCH}) -SET (CPACK_PACKAGE_VENDOR "Christian Stimming") -SET (CPACK_SOURCE_IGNORE_FILES "/\\\\.svn/;/\\\\.git/;.*~;build.*;html;Debug;Release") -SET (CPACK_STRIP_FILES "bin/cutecash") -#SET (CPACK_PACKAGE_EXECUTABLES "bin/carclient") -ENDIF (WITH_CUTECASH) IF(UNIX) SET(CPACK_GENERATOR "TGZ") ENDIF(UNIX) diff --git a/configure.ac b/configure.ac index 3478c827a5..2e4354a112 100644 --- a/configure.ac +++ b/configure.ac @@ -153,30 +153,7 @@ AX_BOOST_BASE([1.53.0], [ac_cv_BOOST=yes], [ac_cv_BOOST=no]) if test x$ac_cv_BOOST != xyes; then AC_MSG_ERROR([Boost 1.53.0 or later was not found and is required to build GnuCash]) fi -###-------------------------------------------------------- -### Optionally enable gtkmm plugin (requires c++ compiler) -###-------------------------------------------------------- -enable_GTKMM=false -AC_ARG_ENABLE(gtkmm, - [AS_HELP_STRING([--enable-gtkmm],[enable gtkmm gui])], - [case "${enableval}" in - yes) enable_GTKMM=true ;; - no) enable_GTKMM=false ;; - *) enable_GTKMM=false ;; - esac] - ) - -AS_IF([test x${enable_GTKMM} = "xtrue"], - [ - # We require gtkmm, of course - PKG_CHECK_MODULES(GTKMM, gtkmm-2.4 >= 2.24) - # and also the c++ compiler - AC_PROG_CXXCPP - AC_PROG_CXX - _COMPONENTS="$_COMPONENTS gtkmm" - ]) -AM_CONDITIONAL([WITH_GTKMM], [test x${enable_GTKMM} = "xtrue"]) # This section must come before AC_PROG_LIBTOOL because libtool # must know about the c++ compiler. ###-------------------------------------------------------- @@ -1730,8 +1707,6 @@ AC_CONFIG_FILES( src/import-export/aqb/gschemas/Makefile src/import-export/aqb/test/Makefile src/optional/Makefile - src/optional/gtkmm/Makefile - src/optional/gtkmm/test/Makefile src/optional/python-bindings/Makefile src/optional/python-bindings/tests/Makefile src/pixmaps/Makefile diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index 2ab86f7397..bf8f0ba83b 100644 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -66,7 +66,7 @@ ENDFUNCTION() FUNCTION(MAKE_GNUCASH_POTFILES) - SET(IGNORE_PATTERNS "gw-" "test" "experimental" "python-bindings" "swig-.*\\.c" "^src/gnc/" "^src/optional/gtkmm") + SET(IGNORE_PATTERNS "gw-" "test" "experimental" "python-bindings" "swig-.*\\.c") # Create a list of candidate translation files FILE(GLOB_RECURSE FILES_IN RELATIVE ${CMAKE_SOURCE_DIR} diff --git a/po/POTFILES.skip b/po/POTFILES.skip index 27588cee19..11ae5e5156 100644 --- a/po/POTFILES.skip +++ b/po/POTFILES.skip @@ -5,10 +5,6 @@ src/backend/xml/gncmod-backend-xml.c src/backend/xml/gncmod-backend-xml.cpp src/gnome-utils/gnc-tree-model-selection.c -# These we don't want to translate because they're experimental: -src/gnc/.* -src/optional/gtkmm/.* - # Skip softlinks to scm files. These softlinks are created in builddir # for testing purposes, intltool-extract isn't smart enough to ignore # them when bulddir and srcdir are the same, and both intltool-extract diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0255d9f7e3..9071d81adf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,8 +6,6 @@ SET (GETTEXT_PACKAGE "gnucash") -SET(GNOME 1) - IF (WIN32) IF (MINGW) SET (HAVE_SCANF_LLD 1) @@ -169,10 +167,6 @@ IF (WITH_GNUCASH) ADD_SUBDIRECTORY(report) ENDIF (WITH_GNUCASH) -IF (WITH_CUTECASH) - ADD_SUBDIRECTORY (gnc) -ENDIF (WITH_CUTECASH) - SET(src_EXTRA_DIST base-typemaps.i config.h.cmake.in diff --git a/src/bin/gnucash-bin.c b/src/bin/gnucash-bin.c index fe4ceecea4..2a1187a6bc 100644 --- a/src/bin/gnucash-bin.c +++ b/src/bin/gnucash-bin.c @@ -507,7 +507,6 @@ load_gnucash_modules() { "gnucash/report/stylesheets", 0, FALSE }, { "gnucash/report/locale-specific/us", 0, FALSE }, { "gnucash/report/report-gnome", 0, FALSE }, - { "gnucash/gtkmm", 0, TRUE }, { "gnucash/python", 0, TRUE }, { "gnucash/plugins/bi_import", 0, TRUE}, { "gnucash/plugins/customer_import", 0, TRUE}, diff --git a/src/gnc/.gitignore b/src/gnc/.gitignore deleted file mode 100644 index 1936cc1d44..0000000000 --- a/src/gnc/.gitignore +++ /dev/null @@ -1 +0,0 @@ -html diff --git a/src/gnc/AccountItemModel.cpp b/src/gnc/AccountItemModel.cpp deleted file mode 100644 index 9f811df4b4..0000000000 --- a/src/gnc/AccountItemModel.cpp +++ /dev/null @@ -1,248 +0,0 @@ -/* - * AccountItemModel.hpp - * Copyright (C) 2010 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#include "AccountItemModel.hpp" - -#include "engine/gnc-event.h" // for GNC_EVENT_ITEM_ADDED -#include "gncmm/Numeric.hpp" -#include - -namespace gnc -{ - -AccountTreeModel::AccountTreeModel(Glib::RefPtr rootaccount, QObject *parent) - : QAbstractItemModel(parent) - , m_root(rootaccount) -{ -} - -QModelIndex AccountTreeModel::index(int row, int column, - const QModelIndex &parent) const -{ - //qDebug() << "index(), " << row << column << parent; - if (!hasIndex(row, column, parent)) - return QModelIndex(); - - Glib::RefPtr parentItem; - - if (!parent.isValid()) - parentItem = m_root; - else - parentItem = Glib::wrap(static_cast< ::Account*>(parent.internalPointer())); - - Glib::RefPtr childItem = parentItem->get_nth_child(row); - if (childItem) - { - //qDebug() << "returning" << childItem.getName(); - return createIndex(row, column, childItem->gobj()); - } - else - return QModelIndex(); -} - -QModelIndex AccountTreeModel::parent(const QModelIndex &index) const -{ - //qDebug() << "parent()" << index; - if (!index.isValid()) - return QModelIndex(); - - Glib::RefPtr childItem = Glib::wrap(static_cast< ::Account*>(index.internalPointer())); - Glib::RefPtr parentItem(childItem->get_parent()); - - if (parentItem->gobj() == m_root->gobj()) - return QModelIndex(); - - return createIndex(parentItem->child_index(), 0, parentItem->gobj()); -} - -int AccountTreeModel::rowCount(const QModelIndex& parent) const -{ - //qDebug() << "rowCount()" << parent; - if (parent.column() > 0) - return 0; - // FIXME: Doesn't this just mean the nonzero columns don't have a - // tree? In that case it would be correct. - - Glib::RefPtr parentItem; - if (!parent.isValid()) - parentItem = m_root; - else - parentItem = Glib::wrap(static_cast< ::Account*>(parent.internalPointer())); - - //qDebug() << "Returning " << parentItem.n_children(); - return parentItem->get_num_children(); -} - -int AccountTreeModel::columnCount(const QModelIndex& parent) const -{ - //qDebug() << "columnCount()" << parent; -// if (!parent.isValid()) -// return 0; -// else - return 4; // Fixed number for now -} - -QVariant AccountTreeModel::data(const QModelIndex& index, int role) const -{ - //qDebug() << "data(), " << index; - if (!index.isValid()) - return QVariant(); - - Glib::RefPtr account = Glib::wrap(static_cast< ::Account*>(index.internalPointer())); - if (role == Qt::DisplayRole) - { - switch (index.column()) - { - case 0: - return g2q(account->get_name()); - case 1: - return g2q(account->get_code()); - case 2: - return g2q(account->get_description()); - case 3: - { - Numeric balance = gnc_ui_account_get_balance(account->gobj(), false); - PrintAmountInfo printInfo(account, true); - return g2q(balance.printAmount(printInfo)); - } - default: - return QVariant(); - } - } - else - return QVariant(); -} - -Qt::ItemFlags AccountTreeModel::flags(const QModelIndex &index) const -{ - //qDebug() << "flags()" << index; - if (!index.isValid()) - return 0; - - // Ensure read-only access only - return Qt::ItemIsEnabled | Qt::ItemIsSelectable; -} - -QVariant AccountTreeModel::headerData(int section, Qt::Orientation orientation, int role) const -{ - //qDebug() << "headerData()" << section; - if (role != Qt::DisplayRole) - return QVariant(); - if (orientation == Qt::Horizontal) - { - switch (section) - { - case 0: - return QString("Name"); - case 1: - return QString("Code"); - case 2: - return QString("Description"); - case 3: - return QString("Balance"); - default: - return QVariant(); - } - } - else - return QString("%1").arg(1 + section); -} - -// //////////////////////////////////////////////////////////// - - -AccountListModel::AccountListModel(Glib::RefPtr rootaccount, QObject *parent) - : base_class(rootaccount, parent) - , m_list() - , m_eventWrapperAccount(*this, &AccountListModel::accountEvent) -{ - recreateCache(); -} - -void AccountListModel::recreateCache() -{ - m_list = accountFromGList(m_root->get_descendants()); - reset(); -} - -void AccountListModel::accountEvent( ::Account* acc, QofEventId event_type) -{ - //qDebug() << "AccountListModel::accountEvent, id=" << qofEventToString(event_type); - - switch (event_type) - { - case QOF_EVENT_CREATE: - case QOF_EVENT_DESTROY: - recreateCache(); - break; - default: - break; - } -} - -QModelIndex AccountListModel::index(int row, int column, - const QModelIndex &parent) const -{ - //qDebug() << "index(), " << row << column << parent; - if (!hasIndex(row, column, parent) || row >= m_list.size()) - return QModelIndex(); - - Glib::RefPtr childItem = Glib::wrap(m_list.at(row)); - if (childItem) - { - //qDebug() << "returning" << childItem.getName(); - return createIndex(row, column, childItem->gobj()); - } - else - return QModelIndex(); -} - - -// //////////////////////////////////////////////////////////// - -int AccountListNamesModel::columnCount(const QModelIndex& parent) const -{ - return 1; -} - -QVariant AccountListNamesModel::data(const QModelIndex& index, int role) const -{ - if (!index.isValid()) - return QVariant(); - - Glib::RefPtr account = Glib::wrap(static_cast< ::Account*>(index.internalPointer())); - switch (index.column()) - { - case 0: - switch (role) - { - case Qt::DisplayRole: - return g2q(account->get_full_name()); - default: - return QVariant(); - } - default: - return QVariant(); - } -} - -} // END namespace gnc diff --git a/src/gnc/AccountItemModel.hpp b/src/gnc/AccountItemModel.hpp deleted file mode 100644 index c3b9c0db1b..0000000000 --- a/src/gnc/AccountItemModel.hpp +++ /dev/null @@ -1,122 +0,0 @@ -/* - * AccountItemModel.hpp - * Copyright (C) 2010 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#ifndef GNC_ACCOUNTITEMMODEL_HPP -#define GNC_ACCOUNTITEMMODEL_HPP - -#include "config.h" -#include "gncmm/Account.hpp" -#include "gnc/QofEventWrapper.hpp" -#include "gnc/conv.hpp" -#include "gnc/metatype.hpp" - -#include - -namespace gnc -{ - -/** This is the data model for an account tree. - * - * It was written following the "Simple Tree Model Example" in the qt4 - * documentation. In particular, the trick is that each returned - * QModelIndex of our model implementation which is valid will have a - * ::Account* pointer in its QModelIndex::internalPointer() member, - * which can then be used in the data() method and the other - * methods. This trick works quite nice because our C structures - * ::Account* already have all the methods to iterate the tree back - * and forth, and our C++ wrapper gnc::Account doesn't add any - * functionality except for some nicer method names. - */ -class AccountTreeModel : public QAbstractItemModel -{ - Q_OBJECT -public: - AccountTreeModel(Glib::RefPtr rootaccount, QObject *parent = 0); - - int rowCount(const QModelIndex& parent = QModelIndex()) const; - int columnCount(const QModelIndex& parent = QModelIndex()) const; - QModelIndex parent(const QModelIndex &index) const; - QModelIndex index(int row, int column, - const QModelIndex &parent = QModelIndex()) const; - Qt::ItemFlags flags(const QModelIndex &index) const; - - QVariant data(const QModelIndex& index, int role) const; - QVariant headerData(int section, Qt::Orientation orientation, int role) const; - -protected: - Glib::RefPtr m_root; -}; - -typedef QList< ::Account*> AccountQList; -inline AccountQList accountFromGList(GList *glist) -{ - return from_glist(glist); -} - -/** Specialization of the account tree model for when all accounts - * should be viewed as a flat list instead of a tree. Only the index() - * and parent() functions had to be overridden - quite easy. */ -class AccountListModel : public AccountTreeModel -{ - Q_OBJECT -public: - typedef AccountTreeModel base_class; - AccountListModel(Glib::RefPtr rootaccount, QObject *parent = 0); - - int rowCount(const QModelIndex& parent = QModelIndex()) const { return m_list.size(); } - - QModelIndex index(int row, int column, - const QModelIndex &parent = QModelIndex()) const; - - QModelIndex parent(const QModelIndex &index) const { return QModelIndex(); } - - int indexOf(AccountQList::value_type value) const { return m_list.indexOf(value); } - const AccountQList::value_type at(int i) const { return m_list.at(i); } - -public Q_SLOTS: - void accountEvent( ::Account* v, QofEventId event_type); - -private: - void recreateCache(); - - AccountQList m_list; - QofEventWrapper m_eventWrapperAccount; -}; - -/** Specialization of the account list model that only shows the - * "Account Full Name" in one single column. - */ -class AccountListNamesModel : public AccountListModel -{ - Q_OBJECT -public: - typedef AccountListModel base_class; - AccountListNamesModel(Glib::RefPtr rootaccount, QObject *parent = 0) - : base_class(rootaccount, parent) - {} - int columnCount(const QModelIndex& parent = QModelIndex()) const; - QVariant data(const QModelIndex& index, int role) const; -}; - -} // END namespace gnc - -#endif diff --git a/src/gnc/AccountSelectionDelegate.cpp b/src/gnc/AccountSelectionDelegate.cpp deleted file mode 100644 index 3412ca396d..0000000000 --- a/src/gnc/AccountSelectionDelegate.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* - * AccountSelectionDelegate.cpp - * Copyright (C) 2010 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#include "AccountSelectionDelegate.hpp" - -#include "gnc/AccountItemModel.hpp" -#include "gncmm/Book.hpp" -#include "gncmm/Split.hpp" -#include "gnc/SplitListModel.hpp" - -#include -#include - -namespace gnc -{ - -AccountSelectionDelegate::AccountSelectionDelegate(QObject* parent) - : base_class(parent) -{} - -QString AccountSelectionDelegate::displayText(const QVariant& value, const QLocale& locale) const -{ - if (value.canConvert< ::Account*>()) - { - Glib::RefPtr acc = Glib::wrap(value.value< ::Account*>()); - if (acc) - return g2q(acc->get_full_name()); - else - return QString(); - } - else - { - return base_class::displayText(value, locale); - } -} - -QWidget *AccountSelectionDelegate::createEditor(QWidget *parent, - const QStyleOptionViewItem &option, - const QModelIndex &index) const -{ - QComboBox* comboBox = new QComboBox(parent); - - Q_ASSERT(index.isValid()); - const SplitListModel* smodel = dynamic_cast(index.model()); - if (smodel) - { - Glib::RefPtr modelAccount = smodel->getAccount(); - Q_ASSERT(modelAccount); - Glib::RefPtr book = modelAccount->get_book(); - Q_ASSERT(book); - Glib::RefPtr rootaccount = book->get_root_account(); - Q_ASSERT(rootaccount); - AccountListModel* model = new AccountListNamesModel(rootaccount, comboBox); - comboBox->setModel(model); - } - - return comboBox; -} - -void AccountSelectionDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const -{ - QComboBox* comboBox = dynamic_cast(editor); - Q_ASSERT(comboBox); - - Q_ASSERT(index.isValid()); - - QVariant value = index.model()->data(index, Qt::EditRole); - if (value.canConvert< ::Account*>()) - { - Glib::RefPtr acc = Glib::wrap(value.value< ::Account*>()); - if (acc) - { - const AccountListModel* amodel = dynamic_cast(comboBox->model()); - Q_ASSERT(amodel); - comboBox->setCurrentIndex(amodel->indexOf(acc->gobj())); - } - } - else - { - qDebug() << "AccountSelectionDelegate::setEditorData: oops, item returns no account in the column"; - } -} - -void AccountSelectionDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, - const QModelIndex &index) const -{ - QComboBox* comboBox = dynamic_cast(editor); - Q_ASSERT(comboBox); - - int currentIndex = comboBox->currentIndex(); - if (currentIndex == -1) - return; - const AccountListModel* amodel = dynamic_cast(comboBox->model()); - Q_ASSERT(amodel); - ::Account* acc(amodel->at(currentIndex)); - if (acc) - { - model->setData(index, QVariant::fromValue(acc), Qt::EditRole); - } -} - - -} // END namespace gnc diff --git a/src/gnc/AccountSelectionDelegate.hpp b/src/gnc/AccountSelectionDelegate.hpp deleted file mode 100644 index 05ae44ed3d..0000000000 --- a/src/gnc/AccountSelectionDelegate.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * AccountSelectionDelegate.hpp - * Copyright (C) 2010 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#ifndef GNC_ACCOUNTSELECTIONDELEGATE_HPP -#define GNC_ACCOUNTSELECTIONDELEGATE_HPP - -#include "config.h" -#include "gncmm/Account.hpp" - -#include -#include - -namespace gnc -{ - -class AccountSelectionDelegate : public QStyledItemDelegate -{ - Q_OBJECT -public: - typedef QStyledItemDelegate base_class; - - AccountSelectionDelegate(QObject* parent = 0); - - virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, - const QModelIndex &index) const; - virtual QString displayText(const QVariant& value, const QLocale& locale) const; - virtual void setEditorData(QWidget *editor, const QModelIndex &index) const; - virtual void setModelData(QWidget *editor, QAbstractItemModel *model, - const QModelIndex &index) const; - -}; - - -} // END namespace gnc - -#endif diff --git a/src/gnc/CMakeLists.txt b/src/gnc/CMakeLists.txt deleted file mode 100644 index 6ba10f5b07..0000000000 --- a/src/gnc/CMakeLists.txt +++ /dev/null @@ -1,133 +0,0 @@ -# CMakeLists.txt for src/gnc - - -# A test executable -LINK_DIRECTORIES (${GLIB2_LIBRARY_DIRS} - ${GMODULE_LIBRARY_DIRS} - ${GOBJECT_LIBRARY_DIRS} - ${GTHREAD_LIBRARY_DIRS} - ${GCONF2_LIBRARY_DIRS} - ${GLIBMM_LIBRARY_DIRS} -# ${GWENHYWFAR_LIBRARY_DIRS} -# ${AQBANKING_LIBRARY_DIRS} -) - -SET (gnc_SOURCES - AccountItemModel.cpp - AccountSelectionDelegate.cpp - Cmd.cpp - QofEventWrapper.cpp - RecentFileMenu.cpp - Session.cpp - SplitListModel.cpp - SplitListView.cpp - main.cpp - mainwindow.cpp - mainwindow-file.cpp - dashboard.cpp - fpo/FPO.cpp - fpo/ViewletModel.cpp - fpo/ViewletView.cpp -) - -SET (gnc_QOBJECT_HEADERS - AccountItemModel.hpp - AccountSelectionDelegate.hpp - RecentFileMenu.hpp - SplitListModel.hpp - SplitListView.hpp - mainwindow.hpp - dashboard.hpp - fpo/FPO.hpp - fpo/ViewletModel.hpp - fpo/ViewletView.hpp -) -SET (gnc_HEADERS ${gnc_QOBJECT_HEADERS} - conv.hpp - metatype.hpp - Cmd.hpp - QofEventWrapper.hpp - Session.hpp - WeakPointer.hpp -) - -SET (gnc_FORMS - mainwindow.ui - dashboard.ui -) - -SET (gnc_RESOURCES - gnucash.qrc - gtk-icons.qrc - fallback-icons.qrc - stylesheets.qrc -) - -IF (WITH_SQL) - ADD_DEFINITIONS (-DWITH_SQL) -ENDIF (WITH_SQL) - -# Generation of resource files -QT4_ADD_RESOURCES (gnc_RESOURCE ${gnc_RESOURCES}) - -# Generation of the foo_MOC_SRCS = moc_Class1.cxx moc_Class2.cxx -QT4_WRAP_CPP (gnc_MOC_SOURCES ${gnc_QOBJECT_HEADERS}) - -# Generation of the ui source files -QT4_WRAP_UI (gnc_FORMS_HEADERS ${gnc_FORMS}) - -INCLUDE_DIRECTORIES (${GLIB2_INCLUDE_DIRS}) -INCLUDE_DIRECTORIES (${GLIBMM_INCLUDE_DIRS}) -INCLUDE_DIRECTORIES (${GUILE_INCLUDE_DIRS}) -INCLUDE_DIRECTORIES (${LIBINTL_INCLUDE_PATH}) -INCLUDE_DIRECTORIES (${REGEX_INCLUDE_PATH}) -INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR}/src ) # for config.h -INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR}/src ) # for gnc-ui.h -INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR}/src/gnc-module) # for gnc-glib-utils.h -INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR}/src/core-utils) # for gnc-glib-utils.h -INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR}/src/engine) # for gnc-glib-utils.h -INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR}/src/optional/gtkmm) -INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR}/src/backend/xml) -INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR}/src/engine) # for swig-runtime.h -INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) # for ui_mainwindow.h - -INCLUDE_DIRECTORIES (${QT_INCLUDES}) -ADD_DEFINITIONS(-DQT_NO_KEYWORDS) - -ADD_EXECUTABLE (cutecash - ${gnc_FORMS_HEADERS} - ${gnc_HEADERS} - ${gnc_MOC_SOURCES} - ${gnc_RESOURCE} - ${gnc_SOURCES} -) - -TARGET_LINK_LIBRARIES (cutecash gncmod-backend-xml-utils gnc-backend-xml-utils) -TARGET_LINK_LIBRARIES (cutecash gncmod-generic-import) -TARGET_LINK_LIBRARIES (cutecash gncmod-app-utils) -IF (WITH_SQL) - TARGET_LINK_LIBRARIES (cutecash gncmod-backend-dbi gnc-backend-sql) - TARGET_LINK_LIBRARIES (cutecash ${LIBDBI_LIBRARY}) -ENDIF (WITH_SQL) -IF (WITH_AQBANKING) - TARGET_LINK_LIBRARIES (cutecash gncmod-aqbanking) -# TARGET_LINK_LIBRARIES (cutecash ${AQBANKING_LIBRARIES} ${GWENHYWFAR_LIBRARIES}) -ENDIF (WITH_AQBANKING) -TARGET_LINK_LIBRARIES (cutecash libgncmod-gtkmm) -TARGET_LINK_LIBRARIES (cutecash gncmod-engine gnc-module gnc-core-utils) - -TARGET_LINK_LIBRARIES (cutecash ${GUILE_LIBRARY} ${GUILE_LIBRARIES}) -TARGET_LINK_LIBRARIES (cutecash ${GLIBMM_LIBRARIES}) -TARGET_LINK_LIBRARIES (cutecash ${GCONF2_LIBRARIES}) -TARGET_LINK_LIBRARIES (cutecash ${GTHREAD_LIBRARIES} ${GOBJECT_LIBRARIES} ${GMODULE_LIBRARIES} ${GLIB2_LIBRARIES}) -TARGET_LINK_LIBRARIES (cutecash ${LIBXML2_LIBRARIES}) -TARGET_LINK_LIBRARIES (cutecash ${ZLIB_LIBRARIES}) -IF (WIN32) - TARGET_LINK_LIBRARIES (cutecash ${LIBINTL_LIBRARY} ${REGEX_LIBRARY}) -ENDIF (WIN32) - -TARGET_LINK_LIBRARIES (cutecash ${Boost_LIBRARIES}) -TARGET_LINK_LIBRARIES (cutecash ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY}) -TARGET_LINK_LIBRARIES (cutecash pthread) - -INSTALL (TARGETS cutecash RUNTIME DESTINATION bin) diff --git a/src/gnc/Cmd.cpp b/src/gnc/Cmd.cpp deleted file mode 100644 index c231df1b73..0000000000 --- a/src/gnc/Cmd.cpp +++ /dev/null @@ -1,478 +0,0 @@ -/* - * Cmd.hpp - * Copyright (C) 2010 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#include "Cmd.hpp" -#include "gncmm/Split.hpp" -#include "gncmm/Account.hpp" -#include "gncmm/Transaction.hpp" -#include "gnc/conv.hpp" -#include - -namespace gnc -{ - -// Explicit instantiations to check for compiler errors -template class Cmd; - -namespace cmd -{ - -// //////////////////////////////////////////////////////////// - -QUndoCommand* setSplitMemo(Glib::RefPtr t, const QString& newValue) -{ - return new Cmd(QObject::tr("Edit Split Memo"), - t, &Split::set_memo, - t->get_memo(), q2g(newValue)); -} - -QUndoCommand* setSplitAction(Glib::RefPtr t, const QString& newValue) -{ - return new Cmd(QObject::tr("Edit Split Action"), - t, &Split::set_action, - t->get_action(), q2g(newValue)); -} - -QUndoCommand* setSplitReconcile(Glib::RefPtr t, char newValue) -{ - if (newValue == t->get_reconcile()) - return NULL; - // Special third argument: The setter function takes a value - // directly, instead of a const-reference, so the template type - // must be given explicitly. - return new Cmd(QObject::tr("Edit Split Reconcile"), - t, &Split::set_reconcile, - t->get_reconcile(), newValue); -} - -QUndoCommand* setSplitAccount(Glib::RefPtr t, Glib::RefPtr newValue) -{ - // Temporary function pointer "tmp" to resolve the ambiguous - // overload "setAccount()". - void (Split::*tmp)(Glib::RefPtr) = &Split::set_account; - return new Cmd, void (Split::*)(Glib::RefPtr)>(QObject::tr("Edit Split Account"), - t, tmp, - t->get_account(), newValue); -} - -QUndoCommand* setSplitAmount(Glib::RefPtr t, const Numeric& newValue) -{ - return new Cmd(QObject::tr("Edit Split Amount"), - t, &Split::set_amount, - t->get_amount(), newValue); -} - -QUndoCommand* setSplitValue(Glib::RefPtr t, const Numeric& newValue) -{ - return new Cmd(QObject::tr("Edit Split Value"), - t, &Split::set_value, - t->get_value(), newValue); -} - -// //////////////////////////////////////////////////////////// - -class SplitValueAndAmountCmd : public QUndoCommand -{ -public: - typedef QUndoCommand base_class; - typedef Split target_type; - typedef Numeric value_type; - - /** Constructor without a getter-function but instead the previous - * value given directly. - */ - SplitValueAndAmountCmd(const QString& text, - Glib::RefPtr targetPtr, - const value_type& previousValue, - const value_type& newValue, - QUndoCommand *parent = 0) - : base_class(text, parent) - , m_target(targetPtr) - , m_previousValue(previousValue) - , m_newValue(newValue) - { - Q_ASSERT(m_target); - } - - virtual void redo() - { - set(m_newValue); - } - virtual void undo() - { - set(m_previousValue); - } -private: - void set(const value_type& value) - { - Glib::RefPtr trans = m_target->get_parent(); - if (!trans || trans->get_num_splits() != 2) - return; - Glib::RefPtr other = m_target->get_other_split(); - Q_ASSERT(other); - Glib::RefPtr originCommodity = m_target->get_account()->get_commodity(); - Glib::RefPtr transCommodity = trans->get_currency(); - Glib::RefPtr otherCommodity = other->get_account()->get_commodity(); - if (originCommodity != transCommodity - || transCommodity != otherCommodity) - return; - - trans->begin_edit(); - m_target->set_value(value); - m_target->set_amount(value); - Numeric valueNeg = value.neg(); - other->set_amount(valueNeg); - other->set_value(valueNeg); - trans->commit_edit(); - } - -protected: - Glib::RefPtr m_target; - value_type m_previousValue; - value_type m_newValue; - -}; - -QUndoCommand* setSplitValueAndAmount(Glib::RefPtr t, const Numeric& newValue) -{ - return new SplitValueAndAmountCmd(QObject::tr("Edit Transaction Value"), - t, t->get_value(), newValue); -} - -// //////////////////////////////////////////////////////////// - -QUndoCommand* setTransactionNum(Glib::RefPtr t, const QString& newValue) -{ - if (newValue == g2q(t->get_num())) - return NULL; - return new Cmd(QObject::tr("Edit Transaction Number"), - t, &Transaction::set_num, - t->get_num(), q2g(newValue)); -} - -QUndoCommand* setTransactionDescription(Glib::RefPtr t, const QString& newValue) -{ - if (newValue == g2q(t->get_description())) - return NULL; - return new Cmd(QObject::tr("Edit Transaction Description"), - t, &Transaction::set_description, - t->get_description(), q2g(newValue)); -} - -QUndoCommand* setTransactionNotes(Glib::RefPtr t, const QString& newValue) -{ - return new Cmd(QObject::tr("Edit Transaction Notes"), - t, &Transaction::set_notes, - t->get_notes(), q2g(newValue)); -} - -QUndoCommand* setTransactionDate(Glib::RefPtr t, const QDate& newValue) -{ - if (newValue == g2q(t->get_date_posted())) - return NULL; - return new Cmd(QObject::tr("Edit Transaction Date"), - t, &Transaction::set_date_posted, - t->get_date_posted(), q2g(newValue)); -} - -// //////////////////////////////////////////////////////////// - -class TransactionDestroyCmd : public QUndoCommand -{ -public: - typedef QUndoCommand base_class; - typedef Transaction target_type; - - /** Constructor - */ - TransactionDestroyCmd(const QString& text, - Glib::RefPtr& targetPtr, - QUndoCommand *parent = 0) - : base_class(text, parent) - , m_target(targetPtr) - , m_previousValue(*targetPtr.operator->()) - , m_book(m_target->get_book()) - { - Q_ASSERT(m_target); - } - - virtual void redo() - { - xaccTransDestroy(m_target->gobj()); - m_target.reset(); - } - - virtual void undo() - { - m_target = Glib::wrap(Transaction::new_instance(m_book)); - m_target->begin_edit(); - m_previousValue.copy_to(m_target); - m_target->commit_edit(); - // Could also use m_previousValue.createAsReal() - } - -protected: - Glib::RefPtr m_target; - TmpTransaction m_previousValue; - Glib::RefPtr m_book; -}; - -QUndoCommand* destroyTransaction(Glib::RefPtr t) -{ - return new TransactionDestroyCmd(QObject::tr("Delete Transaction"), - t); -} - -// //////////////////////////////////////////////////////////// - -/** This is another templated implementation of a QUndoCommand - * class, this time with keeping a direct reference to the target object. - * - * This implements the Command pattern: Any instance of this - * class represents the change of one member variable (of type ValueT) - * in an instance of a TargetT object. - * - * As we need to keep a reference to the original object, it is - * relevant who owns the life cycle of that original object. For - * simplicity, we constrain this current implementation only to - * classes which are implementations of a WeakPointer<...> which by - * definition keeps a C pointer to the original object, and we hope - * that one lives longer than we do. - */ -template < class TargetT, class ValueT, typename SetterFunc = void (TargetT::*)(const ValueT&) > -class CmdRef : public QUndoCommand -{ -public: - /// The base class - typedef QUndoCommand base_class; - - /// Type of the target object on which this command is applied - typedef TargetT target_type; - - /// Type of the value that is set by this command - typedef ValueT value_type; - - /// Type of the setter function to set the value in the target object - typedef SetterFunc setter_func; - - /** Constructor with the previous value given directly. - * - * @param text The QUndoCommand's text which will be displayed in the Undo action. - * @param targetRef Reference to the target object on which this command is applied. - * @param setter Pointer to function which sets the value in the target object - * @param previousValue The previous value, in case this command needs to be undone - * @param newValue The new value to be set - * @param parent The parent QUndoCommand instance, or NULL. - */ - CmdRef(const QString& text, - TargetT& targetRef, - setter_func setter, - const value_type& previousValue, - const value_type& newValue, - QUndoCommand *parent = 0) - : base_class(text, parent) - , m_target(targetRef) - , m_setter(setter) - , m_previousValue(previousValue) - , m_newValue(newValue) - { - Q_ASSERT(m_setter); - } - - virtual void redo() - { - set(m_newValue); - } - virtual void undo() - { - set(m_previousValue); - } - -private: - void set(const value_type& value) - { - // Call the pointer-to-member which is stored in m_setter. - (m_target.*m_setter)(value); - } - -protected: - target_type& m_target; - setter_func m_setter; - value_type m_previousValue; - value_type m_newValue; -}; - - -QUndoCommand* setSplitAccount(TmpSplit& t, Glib::RefPtr newValue) -{ - return new CmdRef(QObject::tr("Edit Split Account"), - t, &TmpSplit::set_account, - t.get_account(), newValue->gobj()); -} -QUndoCommand* setSplitReconcile(TmpSplit& t, char newValue) -{ - // Special third argument: The setter function takes a value - // directly, instead of a const-reference, so the template type - // must be given explicitly. - return new CmdRef(QObject::tr("Edit Split Reconcile"), - t, &TmpSplit::set_reconcile, - t.get_reconcile(), newValue); -} -QUndoCommand* setTransactionNum(TmpTransaction& t, const QString& newValue) -{ - return new CmdRef(QObject::tr("Edit Transaction Number"), - t, &TmpTransaction::set_num, - t.get_num(), q2g(newValue)); -} -QUndoCommand* setTransactionDescription(TmpTransaction& t, const QString& newValue) -{ - return new CmdRef(QObject::tr("Edit Transaction Description"), - t, &TmpTransaction::set_description, - t.get_description(), q2g(newValue)); -} -QUndoCommand* setTransactionDate(TmpTransaction& t, const QDate& newValue) -{ - return new CmdRef(QObject::tr("Edit Transaction Date"), - t, &TmpTransaction::set_date_posted, - t.get_date_posted(), q2g(newValue)); -} - -// //////////////////////////////////////////////////////////// - -class TmpSplitValueAndAmountCmd : public QUndoCommand -{ -public: - typedef QUndoCommand base_class; - typedef TmpSplit target_type; - typedef Numeric value_type; - - /** Constructor without a getter-function but instead the previous - * value given directly. - */ - TmpSplitValueAndAmountCmd(const QString& text, - target_type& targetRef, - const value_type& previousValue, - const value_type& newValue, - QUndoCommand *parent = 0) - : base_class(text, parent) - , m_target(targetRef) - , m_previousValue(previousValue) - , m_newValue(newValue) - { - Q_ASSERT(m_target.get_parent()); - Q_ASSERT(m_target.get_other_split()); - Q_ASSERT(m_target.get_account()); - } - - virtual void redo() - { - set(m_newValue); - } - virtual void undo() - { - set(m_previousValue); - } -private: - void set(const value_type& value) - { - Q_ASSERT(m_target.get_parent()); - const TmpTransaction& trans = *m_target.get_parent(); - if (trans.get_num_splits() != 2) - return; - TmpSplit* p_other = m_target.get_other_split(); - Q_ASSERT(p_other); - TmpSplit& other = *p_other; - Glib::RefPtr originCommodity = Glib::wrap(m_target.get_account())->get_commodity(); - Glib::RefPtr transCommodity = trans.get_commodity(); - Q_ASSERT(other.get_account()); - Glib::RefPtr otherCommodity = Glib::wrap(other.get_account())->get_commodity(); - if (originCommodity != transCommodity - || transCommodity != otherCommodity) - return; - - m_target.set_value(value); - m_target.set_amount(value); - Numeric valueNeg = value.neg(); - other.set_amount(valueNeg); - other.set_value(valueNeg); - } - -protected: - target_type& m_target; - value_type m_previousValue; - value_type m_newValue; - -}; - - -QUndoCommand* setSplitValueAndAmount(TmpSplit& t, const Numeric& newValue) -{ - return new TmpSplitValueAndAmountCmd(QObject::tr("Edit Transaction Value"), - t, t.get_value(), newValue); -} - -// //////////////////////////////////////////////////////////// - - - -class TransactionCreateCmd : public QUndoCommand -{ -public: - typedef QUndoCommand base_class; - - /** Constructor - */ - TransactionCreateCmd(const QString& text, - const TmpTransaction& target, - QUndoCommand *parent = 0) - : base_class(text, parent) - , m_template(target) - , m_created(NULL) - {} - - virtual void redo() - { - m_created = m_template.create_as_real(); - } - - virtual void undo() - { - xaccTransDestroy(m_created->gobj()); - m_created.reset(); - } - -protected: - TmpTransaction m_template; - Glib::RefPtr m_created; -}; - -QUndoCommand* commitNewTransaction(const TmpTransaction& t) -{ - return new TransactionCreateCmd(QObject::tr("Create Transaction"), t); -} - - - -} // END namespace cmd - - -} // END namespace gnc diff --git a/src/gnc/Cmd.hpp b/src/gnc/Cmd.hpp deleted file mode 100644 index 3b3e3c7aa3..0000000000 --- a/src/gnc/Cmd.hpp +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Cmd.hpp - * Copyright (C) 2010 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#ifndef GNC_CMD_HPP -#define GNC_CMD_HPP - -#include -#include -#include -#include - -namespace gnc -{ - -class Account; -class Split; -class TmpSplit; -class TmpTransaction; -class Transaction; - -/** This is a templated implementation of a QUndoCommand class. This - * implements the Command pattern: Any instance of this class - * represents the change of one member variable (of type ValueT) in an - * instance of a TargetT object. - * - * The fun part is that we can pass pointers to the getter and setter - * functions into this class' constructor, and the redo()/undo() - * implementations follow naturally. Hence, this class is already - * sufficient for any Command that is executed by a particular Setter - * function. - * - * As we need to keep a reference to the original object, it is - * relevant who owns the life cycle of that original object. For - * simplicity, we constrain this current implementation only to - * classes which are implementations of a WeakPointer<...> which by - * definition keeps a C pointer to the original object, and we hope - * that one lives longer than we do. - */ -template -class Cmd : public QUndoCommand -{ -public: - /// The base class - typedef QUndoCommand base_class; - - /// Type of the target object on which this command is applied - typedef TargetT target_type; - - /// Type of the value that is set by this command - typedef ValueT value_type; - - /// Type of the setter function to set the value in the target object - typedef SetterFunc setter_func; - - /// Type of the getter function to retrieve the current value from the target object - typedef value_type (target_type::*getter_func)() const; - - /** Constructor with the to-be-manipulated object "targetPtr", the setter - * function, the previous value, and the new value. - * - * @param text The QUndoCommand's text which will be displayed in the Undo action. - * @param targetPtr Reference to the target object on which this command is applied. - * @param setter Pointer to function which sets the value in the target object - * @param previousValue The previous value, in case this command needs to be undone - * @param newValue The new value to be set - * @param parent The parent QUndoCommand instance, or NULL. - */ - Cmd(const QString& text, - Glib::RefPtr targetPtr, - setter_func setter, - const value_type& previousValue, - const value_type& newValue, - QUndoCommand *parent = 0) - : base_class(text, parent) - , m_target(targetPtr) - , m_setter(setter) - , m_previousValue(previousValue) - , m_newValue(newValue) - { - Q_ASSERT(m_target); - Q_ASSERT(m_setter); - } - - virtual void redo() - { - set(m_newValue); - } - - virtual void undo() - { - set(m_previousValue); - } - - -private: - void set(const value_type& value) - { - // Uh oh. The calling syntax for pointer-to-member - // variables (here: m_setter) looks rather weird: - (m_target.operator->()->*m_setter)(value); - } - -protected: - Glib::RefPtr m_target; - setter_func m_setter; - value_type m_previousValue; - value_type m_newValue; - -}; - -namespace cmd -{ - -// This is the collection of command objects which are already -// provided for the different data types and their simple -// members. Just create one of those, add it to a QUndoStack, and -// magically the values will change with undo/redo back and -// forth. Spooky, IMHO. -// QUndoCommand* setSplitMemo(Split& split, const QString& newValue); -// QUndoCommand* setSplitAction(Split& t, const QString& newValue); -QUndoCommand* setSplitAccount(Glib::RefPtr t, Glib::RefPtr newValue); -QUndoCommand* setSplitAccount(TmpSplit& t, Glib::RefPtr newValue); -QUndoCommand* setSplitReconcile(Glib::RefPtr t, char newValue); -QUndoCommand* setSplitReconcile(TmpSplit& t, char newValue); -// QUndoCommand* setSplitAmount(Glib::RefPtr t, const Numeric& newValue); -// QUndoCommand* setSplitValue(Glib::RefPtr t, const Numeric& newValue); -QUndoCommand* setTransactionNum(Glib::RefPtr t, const QString& newValue); -QUndoCommand* setTransactionNum(TmpTransaction& t, const QString& newValue); -QUndoCommand* setTransactionDescription(Glib::RefPtr t, const QString& newValue); -QUndoCommand* setTransactionDescription(TmpTransaction& t, const QString& newValue); -// QUndoCommand* setTransactionNotes(Glib::RefPtr t, const QString& newValue); -QUndoCommand* setTransactionDate(Glib::RefPtr t, const QDate& newValue); -QUndoCommand* setTransactionDate(TmpTransaction& t, const QDate& newValue); -QUndoCommand* setSplitValueAndAmount(Glib::RefPtr t, const Numeric& newValue); -QUndoCommand* setSplitValueAndAmount(TmpSplit& t, const Numeric& newValue); -QUndoCommand* destroyTransaction(Glib::RefPtr t); -QUndoCommand* commitNewTransaction(const TmpTransaction& t); - -} // END namespace cmd - -} // END namespace gnc - -#endif diff --git a/src/gnc/Doxyfile b/src/gnc/Doxyfile deleted file mode 100644 index c10806e35f..0000000000 --- a/src/gnc/Doxyfile +++ /dev/null @@ -1,228 +0,0 @@ -# Doxyfile 1.5.5 - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -DOXYFILE_ENCODING = UTF-8 -PROJECT_NAME = Cutecash -PROJECT_NUMBER = 0.1.0 -OUTPUT_DIRECTORY = -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = "The $name class " \ - "The $name widget " \ - "The $name file " \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = NO -QT_AUTOBRIEF = NO -MULTILINE_CPP_IS_BRIEF = NO -INHERIT_DOCS = YES -SEPARATE_MEMBER_PAGES = NO -TAB_SIZE = 4 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = NO -OPTIMIZE_OUTPUT_JAVA = NO -OPTIMIZE_FOR_FORTRAN = NO -OPTIMIZE_OUTPUT_VHDL = NO -BUILTIN_STL_SUPPORT = YES -CPP_CLI_SUPPORT = NO -SIP_SUPPORT = NO -DISTRIBUTE_GROUP_DOC = NO -SUBGROUPING = YES -TYPEDEF_HIDES_STRUCT = NO -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = YES -EXTRACT_PRIVATE = YES -EXTRACT_STATIC = YES -EXTRACT_LOCAL_CLASSES = YES -EXTRACT_LOCAL_METHODS = NO -EXTRACT_ANON_NSPACES = NO -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = NO -CASE_SENSE_NAMES = NO -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = NO -SORT_GROUP_NAMES = NO -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_DIRECTORIES = YES -FILE_VERSION_FILTER = -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = YES -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = NO -WARN_FORMAT = "$file:$line: $text " -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = . \ - ../core-utils \ - ../gnc-module \ - ../engine \ - ../app-utils -INPUT_ENCODING = UTF-8 -FILE_PATTERNS = *.cpp \ - *.hpp \ - *.h -RECURSIVE = NO -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = test-*.c -EXCLUDE_SYMBOLS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = * -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = NO -REFERENCES_RELATION = NO -REFERENCES_LINK_SOURCE = YES -USE_HTAGS = NO -VERBATIM_HEADERS = NO -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = YES -COLS_IN_ALPHA_INDEX = 4 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -GENERATE_DOCSET = NO -DOCSET_FEEDNAME = "Doxygen generated docs" -DOCSET_BUNDLE_ID = org.doxygen.Project -HTML_DYNAMIC_SECTIONS = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = NO -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = YES -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = DOXYGEN_IGNORE -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -MSCGEN_PATH = -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = YES -CLASS_GRAPH = YES -COLLABORATION_GRAPH = NO -GROUP_GRAPHS = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = NO -INCLUDE_GRAPH = NO -INCLUDED_BY_GRAPH = NO -CALL_GRAPH = NO -CALLER_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -DOT_GRAPH_MAX_NODES = 50 -MAX_DOT_GRAPH_DEPTH = 1000 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO diff --git a/src/gnc/QofEventWrapper.cpp b/src/gnc/QofEventWrapper.cpp deleted file mode 100644 index f1455df1b4..0000000000 --- a/src/gnc/QofEventWrapper.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * QofEventWrapper.cpp - * Copyright (C) 2010 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#include "QofEventWrapper.hpp" -#include "engine/gnc-event.h" - -#include "gnc/SplitListModel.hpp" -#include "gncmm/Transaction.hpp" - -namespace gnc -{ - -// Explicit instantiation to check for compiler errors -template class QofEventWrapper; - -#define EVENT_TO_STR(result, input, evtype) \ - if ((input) & (evtype)) result += QString(result.isEmpty() ? "" : ",") + #evtype - -QString qofEventToString(QofEventId event_type) -{ - if (event_type == QOF_EVENT_NONE) - return "NONE"; - QString r; - EVENT_TO_STR(r, event_type, QOF_EVENT_CREATE); - EVENT_TO_STR(r, event_type, QOF_EVENT_MODIFY); - EVENT_TO_STR(r, event_type, QOF_EVENT_DESTROY); - EVENT_TO_STR(r, event_type, QOF_EVENT_ADD); - EVENT_TO_STR(r, event_type, QOF_EVENT_REMOVE); - - EVENT_TO_STR(r, event_type, GNC_EVENT_ITEM_ADDED); - EVENT_TO_STR(r, event_type, GNC_EVENT_ITEM_REMOVED); - EVENT_TO_STR(r, event_type, GNC_EVENT_ITEM_CHANGED); - - if (r.isEmpty()) - r = QString::number(event_type); - return r; -} - - -} // END namespace gnc diff --git a/src/gnc/QofEventWrapper.hpp b/src/gnc/QofEventWrapper.hpp deleted file mode 100644 index f21154dbdc..0000000000 --- a/src/gnc/QofEventWrapper.hpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * QofEventWrapper.hpp - * Copyright (C) 2010 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#ifndef GNC_QOFEVENTWRAPPER_HPP -#define GNC_QOFEVENTWRAPPER_HPP - -// gnucash includes -#include "config.h" // required by qof/qofutil.h -#include "engine/guid.hpp" -extern "C" -{ -#include "qof.h" -#include "engine/gnc-engine.h" -#include "engine/Account.h" -#include "engine/Transaction.h" -#include "engine/gnc-commodity.h" -} - -#include -#include -#include - -namespace gnc -{ - -/** Conversion of the event_type to string (for debugging) */ -QString qofEventToString(QofEventId event_type); - -/** Retrieval of the Qof instance class name (for debugging) */ -inline const char* getQofType( ::QofInstance* obj) -{ - return obj->e_type; -} - -namespace detail -{ - template inline const char* getQofTypeT() - { - Q_ASSERT(false); - // This would need a BOOST_STATIC_ASSERT(sizeof(T)==0) to - // trigger a compile-time warning in case this function is - // erroneously instantiated. - // This template must not be instantiated. Instead, for each - // templated usage there must exist a specialization which - // will return the correct QOF_ID string! - throw std::runtime_error("Should not have been instantiated"); - } - template<> inline const char* getQofTypeT< ::Transaction*>() - { - return GNC_ID_TRANS; - } - template<> inline const char* getQofTypeT< ::Account*>() - { - return GNC_ID_ACCOUNT; - } - template<> inline const char* getQofTypeT< ::QofBook*>() - { - return QOF_ID_BOOK; - } - template<> inline const char* getQofTypeT< ::QofSession*>() - { - return QOF_ID_SESSION; - } - template<> inline const char* getQofTypeT< ::gnc_commodity*>() - { - return GNC_ID_COMMODITY; - } - template<> inline const char* getQofTypeT< ::Split*>() - { - return GNC_ID_SPLIT; - } -} - -/** Template wrapper class for objects which want to receive - * notifications from the qof_event system in any of their member - * functions. - * - * The receiver's class is the first template argument; the argument - * type of the to-be-called member function is the second template - * (usually a pointer type). */ -template -class QofEventWrapper -{ -public: - QofEventWrapper(ReceiverT& receiver, - SlotFunc recvSlot) - : m_receiver(receiver) - , m_receiveFunc(recvSlot) - , m_qof_type(gnc::detail::getQofTypeT()) - { - m_handler_id = qof_event_register_handler(QofEventWrapper::event_handler, this); - } - - ~QofEventWrapper() - { - qof_event_unregister_handler(m_handler_id); - } - - static void event_handler (::QofInstance *entity, QofEventId event_type, - gpointer user_data, gpointer event_data) - { - QofEventWrapper* wrapper = static_cast(user_data); - wrapper->private_event_handler(entity, event_type, event_data); - } - -private: - void private_event_handler (::QofInstance *entity, QofEventId event_type, - gpointer event_data) - { -// qDebug() << "private_event_handler, id=" << qofEventToString(event_type) -// << "entity=" << getQofType(entity); - - // Verify that we have the correct QofInstance type and also - // correct event type - if (!QOF_CHECK_TYPE(entity, m_qof_type)) - return; -// if ((event_type & m_event_type) == 0) -// return; - -// qDebug() << "private_event_handler, id=" << qofEventToString(event_type) -// << "entity=" << getQofType(entity); - - ValuePtrT vptr = reinterpret_cast(entity); - - // Call the pointer-to-member function with that weird C++ - // syntax - (m_receiver.*m_receiveFunc)(vptr, event_type); - } - - ReceiverT& m_receiver; - SlotFunc m_receiveFunc; - const char* m_qof_type; - gint m_handler_id; -}; - -} // END namespace gnc - -#endif diff --git a/src/gnc/RecentFileMenu.cpp b/src/gnc/RecentFileMenu.cpp deleted file mode 100644 index ca8a794ce2..0000000000 --- a/src/gnc/RecentFileMenu.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/* - * RecentFileMenu.hpp - * Copyright (C) 2010 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - - -#include "RecentFileMenu.hpp" - -#include -#include -#include -#include - -namespace gnc -{ - -RecentFileMenu::RecentFileMenu(const QString& title, QWidget *parent) - : QMenu(title, parent) -{ - createActions(); -} - - -RecentFileMenu::~RecentFileMenu() -{ -} - - -void RecentFileMenu::createActions() -{ - for (int i = 0; i < MaxRecentFiles; ++i) - { - QAction *newAct = new QAction(this); - newAct->setVisible(false); - connect(newAct, SIGNAL(triggered()), - this, SLOT(on_actionRecentFile())); - addAction(newAct); - - m_actionRecentFile[i] = newAct; - } -} - - -void RecentFileMenu::usingFile(const QString& filename) -{ - if (filename.isEmpty()) - return; - - m_fileNames.removeAll(filename); - while (m_fileNames.size() > MaxRecentFiles - 1) - // remove last allowed position - m_fileNames.removeAt(MaxRecentFiles - 1); - m_fileNames.insert(0, filename); - updateMenu(); -} - - -void RecentFileMenu::updateMenu() -{ - setEnabled(!m_fileNames.isEmpty()); - for (int i = 0; i < std::min(int(MaxRecentFiles), m_fileNames.size()); ++i) - { - const QString& qs = m_fileNames.at(i); - QAction *act = m_actionRecentFile[i]; - act->setVisible(true); - act->setText(tr("&%1 %2").arg(i + 1).arg(QFileInfo(qs).fileName())); - act->setStatusTip(qs); - act->setData(qs); - } - for (int i = m_fileNames.size(); i < MaxRecentFiles; ++i) - { - QAction *act = m_actionRecentFile[i]; - act->setVisible(false); - } - - update(); -} - - -void RecentFileMenu::readSettings(QSettings *settings, const QString &groupName) -{ - int size = settings->beginReadArray(groupName); - for (int i = 0; i < size; i++) - { - settings->setArrayIndex(i); - QString qs = settings->value("filename").toString(); - if (!qs.isEmpty()) - { - m_fileNames << qs; - } - } - settings->endArray(); - updateMenu(); -} - -QString RecentFileMenu::getRecentFileName(QSettings *settings, - const QString &groupName) -{ - settings->beginReadArray(groupName); - settings->setArrayIndex(0); - QString qs = settings->value("filename").toString(); - settings->endArray(); - return qs; -} - -void RecentFileMenu::writeSettings(QSettings *settings, const QString &groupName) -{ - settings->remove(groupName); - settings->beginWriteArray(groupName); - - int numElements = m_fileNames.size(); - int j = 0; - for (int i = 0; i < numElements; i++) - { - QString qs = m_fileNames.at(i); - if (!qs.isEmpty()) - { - settings->setArrayIndex(j++); - settings->setValue("filename", qs); - } - } - - settings->endArray(); -} - - -void RecentFileMenu::on_actionRecentFile() -{ - QAction *action = qobject_cast(sender()); - if (action) - { - QString str = action->data().toString(); - if (!str.isEmpty()) - Q_EMIT fileSelected(str); - } -} - -} // END namespace gnc diff --git a/src/gnc/RecentFileMenu.hpp b/src/gnc/RecentFileMenu.hpp deleted file mode 100644 index 6debccd886..0000000000 --- a/src/gnc/RecentFileMenu.hpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - * RecentFileMenu.hpp - * Copyright (C) 2010 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#ifndef GNC_RECENTFILEMENU_HPP -#define GNC_RECENTFILEMENU_HPP - -#include -#include - -class QAction; -class QSettings; - -namespace gnc -{ - -/** - * A menu that shows a list of recently opened files. - */ -class RecentFileMenu: public QMenu -{ - Q_OBJECT - -public: - RecentFileMenu(const QString& title, QWidget *parent = 0); - ~RecentFileMenu(); - - /** - * Read the internal list from a QSettings array. - * @param settings QSettings to read from - * @param groupName name of the array for QSettings::beginReadArray(). - */ - void readSettings(QSettings *settings, const QString &groupName); - - QString getRecentFileName(QSettings *settings, const QString &groupName); - - /** - * Write the internal list to a QSettings array. - * @param settings QSettings to write to - * @param groupName name of the array for QSettings::beginWriteArray(). - */ - void writeSettings(QSettings *settings, const QString &groupName); - -public Q_SLOTS: - /** - * Record the given string as a filename that was (or is) - * being used in the application. As a result the given - * filename will always become the new first menu entry. - */ - void usingFile(const QString &fileName); - -Q_SIGNALS: - /** - * This signal is emitted whenever the user selects a file from the internally managed - * menu (i.e. the user wants to open the given file). - */ - void fileSelected(const QString &fileName); - -private Q_SLOTS: - void on_actionRecentFile(); - -private: - void updateMenu(); - void createActions(); - -private: - QStringList m_fileNames; - - enum { MaxRecentFiles = 5 }; - QAction *m_actionRecentFile[MaxRecentFiles]; - -}; - -} // END namespace gnc - -#endif diff --git a/src/gnc/Session.cpp b/src/gnc/Session.cpp deleted file mode 100644 index 78d5734a89..0000000000 --- a/src/gnc/Session.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Session.cpp - * Copyright (C) 2010 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#include "config.h" -#include "gnc/Session.hpp" -#include "gncmm/Book.hpp" - -// Explicit instantiation to check for compiler errors in the template -template class gnc::WeakPointer< QofSession >; - - -namespace gnc -{ - -Glib::RefPtr Session::get_book () const -{ - return Glib::wrap(qof_session_get_book(gobj())); -} - - -#define TYPE_TO_STR(tstr, desc) tstr : return std::make_pair(QString::fromUtf8(#tstr), QString::fromUtf8(desc)) - -std::pair errorToStringPair(QofBackendError err) -{ - switch (err) - { - case TYPE_TO_STR(ERR_BACKEND_NO_ERR, "No Error"); - case TYPE_TO_STR(ERR_BACKEND_NO_HANDLER, "no backend handler found for this access method (ENOSYS)"); - case TYPE_TO_STR(ERR_BACKEND_NO_BACKEND, "Backend * pointer was unexpectedly null"); - case TYPE_TO_STR(ERR_BACKEND_BAD_URL, "Can't parse url"); - case TYPE_TO_STR(ERR_BACKEND_NO_SUCH_DB, "the named database doesn't exist"); - case TYPE_TO_STR(ERR_BACKEND_CANT_CONNECT, "bad dbname/login/passwd or network failure"); - case TYPE_TO_STR(ERR_BACKEND_CONN_LOST, "Lost connection to server"); - case TYPE_TO_STR(ERR_BACKEND_LOCKED, "in use by another user (ETXTBSY)"); - case TYPE_TO_STR(ERR_BACKEND_READONLY, "cannot write to file/directory"); - case TYPE_TO_STR(ERR_BACKEND_TOO_NEW, "file/db version newer than what we can read"); - case TYPE_TO_STR(ERR_BACKEND_DATA_CORRUPT, "data in db is corrupt"); - case TYPE_TO_STR(ERR_BACKEND_SERVER_ERR, "error in response from server"); - case TYPE_TO_STR(ERR_BACKEND_ALLOC, "internal memory allocation failure"); - case TYPE_TO_STR(ERR_BACKEND_PERM, "user login successful, but no permissions to access the desired object"); - case TYPE_TO_STR(ERR_BACKEND_MODIFIED, "commit of object update failed because another user has modified the object"); - case TYPE_TO_STR(ERR_BACKEND_MOD_DESTROY, "commit of object update failed because another user has deleted the object"); - case TYPE_TO_STR(ERR_BACKEND_MISC, "undetermined error"); - case TYPE_TO_STR(ERR_QOF_OVERFLOW, "EOVERFLOW - generated by strtol or strtoll."); - case TYPE_TO_STR(ERR_FILEIO_FILE_BAD_READ, "read failed or file prematurely truncated"); - case TYPE_TO_STR(ERR_FILEIO_FILE_EMPTY, "file exists, is readable, but is empty"); - case TYPE_TO_STR(ERR_FILEIO_FILE_LOCKERR, "mangled locks (unspecified error)"); - case TYPE_TO_STR(ERR_FILEIO_FILE_NOT_FOUND, "not found / no such file"); - case TYPE_TO_STR(ERR_FILEIO_FILE_TOO_OLD, "file version so old we can't read it"); - case TYPE_TO_STR(ERR_FILEIO_UNKNOWN_FILE_TYPE, "didn't recognize the file type"); - case TYPE_TO_STR(ERR_FILEIO_PARSE_ERROR, "couldn't parse the data in the file"); - case TYPE_TO_STR(ERR_FILEIO_BACKUP_ERROR, "couldn't make a backup of the file"); - case TYPE_TO_STR(ERR_FILEIO_WRITE_ERROR, "couldn't write to the file"); - case TYPE_TO_STR(ERR_FILEIO_READ_ERROR, "Could not open the file for reading."); - case TYPE_TO_STR(ERR_FILEIO_NO_ENCODING, "file does not specify encoding"); - case TYPE_TO_STR(ERR_FILEIO_FILE_EACCES, "No read access permission for the given file"); - case TYPE_TO_STR(ERR_NETIO_SHORT_READ, "not enough bytes received"); - case TYPE_TO_STR(ERR_NETIO_WRONG_CONTENT_TYPE, "wrong kind of server, wrong data served"); - case TYPE_TO_STR(ERR_NETIO_NOT_GNCXML, "whatever it is, we can't parse it."); - case TYPE_TO_STR(ERR_SQL_MISSING_DATA, "database doesn't contain expected data"); - case TYPE_TO_STR(ERR_SQL_DB_TOO_OLD, "database is old and needs upgrading"); - case TYPE_TO_STR(ERR_SQL_DB_BUSY, "database is busy, cannot upgrade version"); - case TYPE_TO_STR(ERR_RPC_HOST_UNK, "Host unknown"); - case TYPE_TO_STR(ERR_RPC_CANT_BIND, "can't bind to address"); - case TYPE_TO_STR(ERR_RPC_CANT_ACCEPT, "can't accept connection"); - case TYPE_TO_STR(ERR_RPC_NO_CONNECTION, "no connection to server"); - case TYPE_TO_STR(ERR_RPC_BAD_VERSION, "RPC Version Mismatch"); - case TYPE_TO_STR(ERR_RPC_FAILED, "Operation failed"); - case TYPE_TO_STR(ERR_RPC_NOT_ADDED, "object not added"); - default: - assert(0); // must not be reached - return std::make_pair("Unknown", "Unknown"); - } -} - -} // END namespace gnc diff --git a/src/gnc/Session.hpp b/src/gnc/Session.hpp deleted file mode 100644 index 2d476288ff..0000000000 --- a/src/gnc/Session.hpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Session.hpp - * Copyright (C) 2010 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#ifndef GNC_SESSION_HPP -#define GNC_SESSION_HPP - -// gnucash includes -#include "config.h" // required by qof/qofutil.h -#include -#include "engine/guid.hpp" -extern "C" -{ -#include "qof.h" -#include "engine/gnc-hooks.h" -} - -#include "gnc/WeakPointer.hpp" -#include -#include - -namespace gnc -{ - -class Book; - -/** Wrapper around a gnucash ::QofSession pointer with C++ methods for - * easier setter and getter access. - * - * Unfortunately this object has no information about whether the - * underlying gnucash ::QofSession object is still alive or has been - * deleted. - */ -class Session : public WeakPointer< ::QofSession > -{ -public: - typedef WeakPointer< ::QofSession > base_class; - - Session(element_type *ptr = 0) - : base_class(ptr) - {} - - // Now the actual functions on the object - - void begin(const QString& book_id, bool ignore_lock, bool create_if_nonexistent, bool force) - { - qof_session_begin(gobj(), book_id.toUtf8(), ignore_lock, create_if_nonexistent, force); - } - void load (QofPercentageFunc percentage_func) - { - qof_session_load(gobj(), percentage_func); - } - QofBackendError get_error () - { - return qof_session_get_error(gobj()); - } - QofBackendError pop_error () - { - return qof_session_pop_error(gobj()); - } - QString get_error_message() const - { - return QString::fromUtf8(qof_session_get_error_message(gobj())); - } - Glib::RefPtr get_book () const; - - QString get_file_path () const - { - return QString::fromUtf8(qof_session_get_file_path(gobj())); - } - - QString get_url() const - { - return QString::fromUtf8(qof_session_get_url(gobj())); - } - - bool save_in_progress() const - { - return qof_session_save_in_progress(gobj()); - } - void save (QofPercentageFunc percentage_func) - { - qof_session_save(gobj(), percentage_func); - } -}; - -std::pair errorToStringPair(QofBackendError err); - -} // END namespace gnc - -#endif diff --git a/src/gnc/SplitListModel.cpp b/src/gnc/SplitListModel.cpp deleted file mode 100644 index 528869d8e8..0000000000 --- a/src/gnc/SplitListModel.cpp +++ /dev/null @@ -1,756 +0,0 @@ -/* - * SplitListModel.cpp - * Copyright (C) 2010 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#include "SplitListModel.hpp" -#include "engine/gnc-event.h" // for GNC_EVENT_ITEM_ADDED -#include "gncmm/Transaction.hpp" -#include "gnc/Cmd.hpp" -#include "gnc/Session.hpp" -#include "gnc/metatype.hpp" -#include -#include -#include -#include -#include - -#include "app-utils/gnc-ui-util.h" // for gnc_get_reconcile_str - -namespace gnc -{ - - - -SplitListModel::SplitListModel(const Glib::RefPtr acc, QUndoStack* undoStack, QObject *parent) - : QAbstractItemModel(parent) - , m_account(acc) - , m_list() - , m_undoStack(undoStack) - , m_eventWrapper(*this, &SplitListModel::transactionEvent) - , m_eventWrapperAccount(*this, &SplitListModel::accountEvent) - , m_enableNewTransaction(true) -{ - recreateCache(); - - m_tmpTransaction.push_back(TmpSplit(NULL)); - m_tmpTransaction.push_back(TmpSplit(NULL)); - recreateTmpTrans(); -} - -void SplitListModel::recreateCache() -{ - SplitQList newSplits = Split::from_glist(m_account->get_split_list()); - bool doReset = (newSplits.size() != m_list.size()); - - m_list = newSplits; - - // Cache the mapping of transactions to split in the m_hash - m_hash.clear(); - for (int k = 0; k < m_list.size(); ++k) - { - m_hash.insert(Glib::wrap(m_list[k])->get_parent()->gobj(), k); - } - - if (doReset) - reset(); -} - -void SplitListModel::recreateTmpTrans() -{ - m_tmpTransaction.reset_content(); - while (m_tmpTransaction.get_num_splits() > 2) - m_tmpTransaction.get_splits().pop_back(); - Q_ASSERT(m_tmpTransaction.get_num_splits() == 2); - - m_tmpTransaction.set_commodity(m_account->get_commodity()); - m_tmpTransaction.set_date_posted(q2g(QDate::currentDate())); - TmpSplit& oursplit = m_tmpTransaction.get_splits().front(); - TmpSplit& othersplit = m_tmpTransaction.get_splits().back(); - oursplit.set_account(m_account->gobj()); - - Q_ASSERT(m_tmpTransaction.get_num_splits() == 2); - Q_ASSERT(oursplit.get_account() == m_account->gobj()); - Q_ASSERT(othersplit.get_account() == NULL); -} - -SplitListModel::~SplitListModel() -{ -} - -QModelIndex SplitListModel::index(int row, int column, - const QModelIndex &parent) const -{ - //qDebug() << "index(), " << row << column << parent; - if (!hasIndex(row, column, parent) || row >= rowCount()) - return QModelIndex(); - - if (m_enableNewTransaction && row == m_list.size()) - return createIndex(row, column, (void*)NULL); - - Glib::RefPtr childItem = Glib::wrap(m_list.at(row)); - if (childItem) - { - //qDebug() << "returning" << childItem.getName(); - return createIndex(row, column, childItem->gobj()); - } - else - return QModelIndex(); -} - -bool SplitListModel::removeRows(int position, int rows, const QModelIndex &index) -{ - for (int row = position; row < position + rows; ++row) - { - Glib::RefPtr s = Glib::wrap(m_list.at(row)); - Q_ASSERT(s); - Glib::RefPtr t = s->get_parent(); - Q_ASSERT(t); - QUndoCommand* cmd = cmd::destroyTransaction(t); - m_undoStack->push(cmd); - } - // No beginInsertRows/endInsertRows because reset() is called in - // recreateCache() anyway. - return true; -} - -int SplitListModel::rowCount(const QModelIndex& parent) const -{ - return m_list.size() + (m_enableNewTransaction ? 1 : 0); -} - -int SplitListModel::columnCount(const QModelIndex& parent) const -{ - //qDebug() << "columnCount()" << parent; -// if (!parent.isValid()) -// return 0; -// else - return COLUMN_LAST; // Fixed number for now -} - -Qt::ItemFlags SplitListModel::flags(const QModelIndex &index) const -{ - //qDebug() << "flags()" << index; - if (!index.isValid()) - return 0; - - Qt::ItemFlags result = Qt::ItemIsEnabled | Qt::ItemIsSelectable; - switch (index.column()) - { - case COLUMN_DATE: - case COLUMN_NUM: - case COLUMN_DESC: - case COLUMN_RECONCILE: - case COLUMN_INCREASE: - case COLUMN_DECREASE: - case COLUMN_ACCOUNT: - // Allow write access as well - return result | Qt::ItemIsEditable; - case COLUMN_BALANCE: - default: - // Ensure read-only access only - return result; - } -} - -QVariant SplitListModel::data(const QModelIndex& index, int role) const -{ - //qDebug() << "data(), " << index; - if (!index.isValid()) - return QVariant(); - - if (m_enableNewTransaction && index.row() == m_list.size()) - { - // Special case: We are in the last row which represents the - // newly entered txn. - - const TmpSplit& split(m_tmpTransaction.get_splits().front()); - const TmpTransaction& trans = m_tmpTransaction; - Numeric amount = split.get_value(); - PrintAmountInfo printInfo(m_account, false); - switch (index.column()) - { - case COLUMN_DATE: - switch (role) - { - case Qt::DisplayRole: - case Qt::EditRole: - return g2q(trans.get_date_posted()); - default: - return QVariant(); - } - case COLUMN_NUM: - switch (role) - { - case Qt::DisplayRole: - case Qt::EditRole: - return g2q(trans.get_num()); - default: - return QVariant(); - } - case COLUMN_DESC: - switch (role) - { - case Qt::DisplayRole: - case Qt::EditRole: - return g2q(trans.get_description()); - default: - return QVariant(); - } - case COLUMN_ACCOUNT: - switch (role) - { - case Qt::DisplayRole: - case Qt::EditRole: - if (trans.get_num_splits() == 2) - return QVariant::fromValue(trans.get_splits().back().get_account()); - else - return QVariant(); // FIXME: Multi-split txn here - default: - return QVariant(); - } - case COLUMN_RECONCILE: - switch (role) - { - case Qt::DisplayRole: - case Qt::EditRole: - return QString::fromUtf8(gnc_get_reconcile_str(split.get_reconcile())); - default: - return QVariant(); - } - case COLUMN_INCREASE: - switch (role) - { - case Qt::DisplayRole: - case Qt::EditRole: - if (!amount.zero_p() && amount.positive_p()) - return g2q(amount.printAmount(printInfo)); - else - return QString(); - default: - return QVariant(); - } - case COLUMN_DECREASE: - switch (role) - { - case Qt::DisplayRole: - case Qt::EditRole: - if (amount.zero_p() || amount.positive_p()) - return QString(); - else - return g2q(amount.neg().printAmount(printInfo)); - default: - return QVariant(); - } - case COLUMN_BALANCE: - default: - return QVariant(); - } - - - } - else - { - // Normal case: We are in a row that displays a normal - // transaction and split - - Glib::RefPtr split = Glib::wrap(static_cast< ::Split*>(index.internalPointer())); - Glib::RefPtr trans(split->get_parent()); - Numeric amount = split->get_value(); // Alternatively: xaccSplitConvertAmount(split.gobj(), split.getAccount().gobj()); - PrintAmountInfo printInfo(split, false); - - switch (index.column()) - { - case COLUMN_DATE: - switch (role) - { - case Qt::DisplayRole: - case Qt::EditRole: - return g2q(trans->get_date_posted()); - default: - return QVariant(); - } - case COLUMN_NUM: - switch (role) - { - case Qt::DisplayRole: - case Qt::EditRole: - return g2q(trans->get_num()); - default: - return QVariant(); - } - case COLUMN_DESC: - switch (role) - { - case Qt::DisplayRole: - case Qt::EditRole: - return g2q(trans->get_description()); - default: - return QVariant(); - } - case COLUMN_ACCOUNT: - switch (role) - { - case Qt::DisplayRole: - case Qt::EditRole: - if (trans->get_num_splits() == 2) - return QVariant::fromValue(split->get_other_split()->get_account()->gobj()); - else - return g2q(split->get_corr_account_full_name()); - default: - return QVariant(); - } - case COLUMN_RECONCILE: - switch (role) - { - case Qt::DisplayRole: - case Qt::EditRole: - return QString::fromUtf8(gnc_get_reconcile_str(split->get_reconcile())); - default: - return QVariant(); - } - case COLUMN_INCREASE: - switch (role) - { - case Qt::DisplayRole: - case Qt::EditRole: - if (amount.positive_p()) - return g2q(amount.printAmount(printInfo)); - else - return QString(); - default: - return QVariant(); - } - case COLUMN_DECREASE: - switch (role) - { - case Qt::DisplayRole: - case Qt::EditRole: - if (amount.positive_p()) - return QString(); - else - return g2q(amount.neg().printAmount(printInfo)); - default: - return QVariant(); - } - case COLUMN_BALANCE: - switch (role) - { - case Qt::DisplayRole: - return g2q(split->get_balance().printAmount(printInfo)); - case Qt::ForegroundRole: - return split->get_balance().negative_p() - ? QBrush(Qt::red) - : QBrush(); - default: - return QVariant(); - } - default: - return QVariant(); - } - } -} - -QVariant SplitListModel::headerData(int section, Qt::Orientation orientation, int role) const -{ - //qDebug() << "headerData()" << section; - if (role != Qt::DisplayRole) - return QVariant(); - if (orientation == Qt::Horizontal) - { - switch (section) - { - case COLUMN_DATE: - return tr("Date"); - case COLUMN_NUM: - return tr("Num"); - case COLUMN_DESC: - return tr("Description"); - case COLUMN_ACCOUNT: - return tr("Transfer"); - case COLUMN_RECONCILE: - return tr("R?"); - case COLUMN_INCREASE: - return tr("Increase"); - case COLUMN_DECREASE: - return tr("Decrease"); - case COLUMN_BALANCE: - return tr("Balance"); - default: - return QVariant(); - } - } - else - return QString("%1").arg(1 + section); -} - -bool SplitListModel::setData(const QModelIndex &index, const QVariant &value, int role) -{ - if (!index.isValid() || role != Qt::EditRole) - return false; - - QUndoCommand* cmd = NULL; - if (m_enableNewTransaction && index.row() == m_list.size()) - { - // Special case: We are in the last row which represents the - // newly entered txn. - - TmpTransaction& trans = m_tmpTransaction; - TmpSplit& split = trans.get_splits().front(); - Q_ASSERT(split.get_account() == m_account->gobj()); - Q_ASSERT(trans.get_num_splits() == 2); - TmpSplit& other = trans.get_splits().back(); - - // "Editing" is done by creating a Cmd-object and adding it to - // the undo stack. That's in fact all that was needed to - // create an *undoable* edit of this data cell. Seems almost - // spooky, doesn't it? - switch (index.column()) - { - case COLUMN_DATE: - { - QDate date = value.toDate(); - if (date.isValid()) - { - cmd = cmd::setTransactionDate(trans, date); - } - break; - } - case COLUMN_NUM: - cmd = cmd::setTransactionNum(trans, value.toString()); - break; - case COLUMN_DESC: - cmd = cmd::setTransactionDescription(trans, value.toString()); - break; - case COLUMN_ACCOUNT: - if (value.canConvert< ::Account*>()) - { - if (trans.get_num_splits() == 2) - { - cmd = cmd::setSplitAccount(other, Glib::wrap(value.value< ::Account*>())); - } - else - QMessageBox::warning(NULL, tr("Unimplemented"), - tr("Sorry, but editing a transaction with more than two splits (here: %1) is not yet implemented.").arg(trans.get_num_splits())); - } - break; - case COLUMN_RECONCILE: - { - QString str(value.toString()); - if (str.size() > 0) - { - char recn = str[0].toLatin1(); - switch (recn) - { - case NREC: - case CREC: - case YREC: - case FREC: - case VREC: - cmd = cmd::setSplitReconcile(split, recn); - break; - default: - qDebug() << "Unknown reconcile string:" << str; - } - } - break; - } - case COLUMN_INCREASE: - case COLUMN_DECREASE: - { - QString str(value.toString().simplified()); - if (str.isEmpty()) - break; - Numeric n; - QString errmsg = g2q(n.parse(q2g(str))); - if (errmsg.isEmpty()) - { - qDebug() << "Successfully parsed string to numeric=" << g2q(n.to_string()); - if (index.column() == COLUMN_DECREASE) - n = n.neg(); - // Check whether we have the simple case here - if (trans.get_num_splits() != 2) - { - QMessageBox::warning(NULL, tr("Unimplemented"), - tr("Sorry, but editing a transaction with more than two splits (here: %1) is not yet implemented.").arg(trans.get_num_splits())); - } - else - { - Glib::RefPtr originCommodity = m_account->get_commodity(); - Glib::RefPtr transCommodity = trans.get_commodity(); - bool sameCommodities = (originCommodity == transCommodity); - if (other.get_account()) - { - Glib::RefPtr otherCommodity = Glib::wrap(other.get_account())->get_commodity(); - sameCommodities = sameCommodities && (transCommodity == otherCommodity); - } - if (!sameCommodities) - { - QMessageBox::warning(NULL, tr("Unimplemented"), - tr("Sorry, but editing a transaction with different accounts is not yet implemented.")); - } - else - { - // This is the really simple case which we can - // handle now. - cmd = cmd::setSplitValueAndAmount(split, n); - } - } - } - else - { - qDebug() << "Cannot convert this string to gnc_numeric:" << str; - } - break; - } - default: - break; - } - } - else - { - // Normal case: We are in a row that displays a normal - // transaction and split - - Glib::RefPtr split = Glib::wrap(static_cast< ::Split*>(index.internalPointer())); - Glib::RefPtr trans(split->get_parent()); - QVariant y(trans); - - // "Editing" is done by creating a Cmd-object and adding it to - // the undo stack. That's in fact all that was needed to - // create an *undoable* edit of this data cell. Seems almost - // spooky, doesn't it? - switch (index.column()) - { - case COLUMN_DATE: - { - QDate date = value.toDate(); - if (date.isValid()) - { - cmd = cmd::setTransactionDate(trans, date); - } - break; - } - case COLUMN_NUM: - cmd = cmd::setTransactionNum(trans, value.toString()); - break; - case COLUMN_DESC: - cmd = cmd::setTransactionDescription(trans, value.toString()); - break; - case COLUMN_ACCOUNT: - if (value.canConvert< ::Account*>()) - { - if (trans->get_num_splits() == 2) - { - Glib::RefPtr other = split->get_other_split(); - cmd = cmd::setSplitAccount(other, Glib::wrap(value.value< ::Account*>())); - } - else - QMessageBox::warning(NULL, tr("Unimplemented"), - tr("Sorry, but editing a transaction with more than two splits " - "(here: %1) is not yet implemented.").arg(trans->get_num_splits())); - } - break; - case COLUMN_RECONCILE: - { - QString str(value.toString()); - if (!str.isEmpty()) - { - char recn = str[0].toLatin1(); - switch (recn) - { - case NREC: - case CREC: - case YREC: - case FREC: - case VREC: - cmd = cmd::setSplitReconcile(split, recn); - break; - default: - qDebug() << "Unknown reconcile string:" << str; - } - } - break; - } - case COLUMN_INCREASE: - case COLUMN_DECREASE: - { - QString str(value.toString().simplified()); - if (str.isEmpty()) - break; - Numeric n; - QString errmsg = g2q(n.parse(q2g(str))); - if (errmsg.isEmpty()) - { - qDebug() << "Successfully parsed string to numeric=" << g2q(n.to_string()); - if (index.column() == COLUMN_DECREASE) - n = n.neg(); - // Check whether we have the simple case here - if (split->get_parent()->get_num_splits() != 2) - { - QMessageBox::warning(NULL, tr("Unimplemented"), - tr("Sorry, but editing a transaction with more than two splits " - "(here: %1) is not yet implemented.").arg(split->get_parent()->get_num_splits())); - } - else - { - Glib::RefPtr trans = split->get_parent(); - Glib::RefPtr other = split->get_other_split(); - Q_ASSERT(other); - Glib::RefPtr originCommodity = split->get_account()->get_commodity(); - Glib::RefPtr transCommodity = trans->get_currency(); - Glib::RefPtr otherCommodity = other->get_account()->get_commodity(); - if (originCommodity != transCommodity - || transCommodity != otherCommodity) - { - QMessageBox::warning(NULL, tr("Unimplemented"), - tr("Sorry, but editing a transaction with different accounts is not yet implemented.")); - } - else - { - // This is the really simple case which we can - // handle now. - cmd = cmd::setSplitValueAndAmount(split, n); - } - } - } - else - { - qDebug() << "Cannot convert this string to gnc_numeric:" << str; - } - break; - } - default: - break; - } - } - if (cmd) - { - m_undoStack->push(cmd); - // No dataChanged() signal here because it is emitted from the - // transactionChanged slot. - return true; - } - return false; -} - -void SplitListModel::transactionEvent( ::Transaction* trans, QofEventId event_type) -{ - //qDebug() << "SplitListModel::transactionEvent, id=" << qofEventToString(event_type); - switch (event_type) - { - case QOF_EVENT_MODIFY: - if (m_hash.contains(trans)) - { - int row = m_hash.value(trans); - Q_EMIT dataChanged(index(row, 0), index(row, columnCount() - 1)); - } - break; - case GNC_EVENT_ITEM_REMOVED: - case GNC_EVENT_ITEM_ADDED: - // This event is triggered by a split being added (or removed) - // to a transaction. Ignored because we already reacted upon - // the MODIFY event. - break; - case QOF_EVENT_CREATE: - // This event is triggered by a newly created transaction, but - // we reacted on this in the accountEvent handler already. - break; - default: - qDebug() << "SplitListModel::transactionEvent, ignored event id=" << qofEventToString(event_type); - break; - } - -} - -void SplitListModel::accountEvent( ::Account* acc, QofEventId event_type) -{ - if (acc != m_account->gobj()) - return; - //qDebug() << "SplitListModel::accountEvent, id=" << qofEventToString(event_type); - - switch (event_type) - { - case GNC_EVENT_ITEM_REMOVED: - case GNC_EVENT_ITEM_ADDED: - recreateCache(); - break; - case QOF_EVENT_MODIFY: - case GNC_EVENT_ITEM_CHANGED: - // These events are also triggered e.g. by a newly added - // transaction/split in this account. However, we already - // reacted on this by the above events, so we can ignore them - // here. - break; - default: - qDebug() << "SplitListModel::accountEvent, ignored event id=" << qofEventToString(event_type); - break; - } -} - -void SplitListModel::editorClosed(const QModelIndex& index, - QAbstractItemDelegate::EndEditHint hint) -{ - if (!index.isValid()) - return; - - if (m_enableNewTransaction && index.row() == m_list.size()) - { - // Special case: The line with the new transaction - - switch (hint) - { - case QAbstractItemDelegate::SubmitModelCache: - switch (index.column()) - { - case COLUMN_DATE: - case COLUMN_NUM: - case COLUMN_DESC: - case COLUMN_ACCOUNT: - case COLUMN_RECONCILE: - break; // we want to do nothing - case COLUMN_INCREASE: - case COLUMN_DECREASE: - { - // Commit the new transaction - //qDebug() << "Commit the new transaction as a real one"; - m_tmpTransaction.set_date_entered(QDateTime::currentDateTime().toTime_t()); - QUndoCommand* cmd = cmd::commitNewTransaction(m_tmpTransaction); - recreateTmpTrans(); - m_undoStack->push(cmd); - break; - } - default: - break; // nothing to do - } - case QAbstractItemDelegate::RevertModelCache: - recreateTmpTrans(); - break; - } - } - else - { - // We are in the line of an existing transaction - no function - // implemented yet. - } - -} - -} // END namespace gnc diff --git a/src/gnc/SplitListModel.hpp b/src/gnc/SplitListModel.hpp deleted file mode 100644 index 60a177513f..0000000000 --- a/src/gnc/SplitListModel.hpp +++ /dev/null @@ -1,110 +0,0 @@ -/* - * SplitListModel.hpp - * Copyright (C) 2010 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#ifndef GNC_SPLITLISTMODEL_HPP -#define GNC_SPLITLISTMODEL_HPP - -#include "config.h" -#include "gncmm/Account.hpp" -#include "gncmm/Split.hpp" -#include "gnc/QofEventWrapper.hpp" -#include "gncmm/Transaction.hpp" -#include "gnc/conv.hpp" - -extern "C" -{ -#include "engine/Transaction.h" -} - -#include -#include -#include -class QUndoStack; - -namespace gnc -{ - -/** This is the data model for a list of splits. - */ -class SplitListModel : public QAbstractItemModel -{ - Q_OBJECT -public: - - enum ColumnNumbers - { - COLUMN_DATE = 0 - , COLUMN_NUM - , COLUMN_DESC - , COLUMN_ACCOUNT - , COLUMN_RECONCILE - , COLUMN_INCREASE - , COLUMN_DECREASE - , COLUMN_BALANCE - , COLUMN_LAST - }; - - SplitListModel(const Glib::RefPtr acc, QUndoStack* undoStack, QObject *parent = 0); - ~SplitListModel(); - - Glib::RefPtr getAccount() const { return m_account; } - - QModelIndex parent(const QModelIndex &index) const { return QModelIndex(); } - int rowCount(const QModelIndex& parent = QModelIndex()) const; - int columnCount(const QModelIndex& parent = QModelIndex()) const; - QModelIndex index(int row, int column, - const QModelIndex &parent = QModelIndex()) const; - Qt::ItemFlags flags(const QModelIndex &index) const; - - QVariant data(const QModelIndex& index, int role) const; - QVariant headerData(int section, Qt::Orientation orientation, int role) const; - bool setData(const QModelIndex &index, const QVariant &value, int role); - - bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex()); - -public Q_SLOTS: - void transactionEvent( ::Transaction* trans, QofEventId event_type); - void accountEvent( ::Account* trans, QofEventId event_type); - void editorClosed(const QModelIndex& index, QAbstractItemDelegate::EndEditHint hint); - -private: - void recreateCache(); - void recreateTmpTrans(); - -protected: - Glib::RefPtr m_account; - SplitQList m_list; - QUndoStack* m_undoStack; - typedef QHash< ::Transaction*, int> TransactionRowHash; - TransactionRowHash m_hash; - - /** The wrapper for receiving events from gnc. */ - QofEventWrapper m_eventWrapper; - QofEventWrapper m_eventWrapperAccount; - - bool m_enableNewTransaction; - TmpTransaction m_tmpTransaction; -}; - -} // END namespace gnc - -#endif diff --git a/src/gnc/SplitListView.cpp b/src/gnc/SplitListView.cpp deleted file mode 100644 index d66847d2f9..0000000000 --- a/src/gnc/SplitListView.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/* - * SplitListView.cpp - * Copyright (C) 2010 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#include "SplitListView.hpp" - -#include "engine/gnc-event.h" // for GNC_EVENT_ITEM_ADDED -#include "gncmm/Account.hpp" -#include "gnc/SplitListModel.hpp" -#include "gnc/AccountSelectionDelegate.hpp" - -#include -#include -#include - -namespace gnc -{ - -SplitListView::SplitListView(Glib::RefPtr account, QUndoStack* undoStack, QWidget* parent) - : base_class(parent) - , m_account(account) - , m_eventWrapperAccount(*this, &SplitListView::accountEvent) - , m_eventWrapperBook(*this, &SplitListView::bookEvent) -{ - // Create a model that is used in this view - SplitListModel *smodel = new SplitListModel(account, undoStack, this); - setModel(smodel); - connect(this, SIGNAL(editorClosed(const QModelIndex&,QAbstractItemDelegate::EndEditHint)), - smodel, SLOT(editorClosed(const QModelIndex&,QAbstractItemDelegate::EndEditHint))); - - // Create a separate delegate only for the Account colum - QAbstractItemDelegate *accountDelegate = new AccountSelectionDelegate(this); - setItemDelegateForColumn(SplitListModel::COLUMN_ACCOUNT, accountDelegate); - - // Appearance of this view - setAlternatingRowColors(true); - - // Move the focus to the latest line - scrollToBottom(); - if (model()->rowCount() > 0) - setCurrentIndex(model()->index(model()->rowCount() - 1, 0)); -} - -void SplitListView::closeEditor(QWidget* editor, QAbstractItemDelegate::EndEditHint hint) -{ - base_class::closeEditor(editor, hint); - //qDebug() << "closeEditor, row=" << currentIndex().row() << "hint=" << hint; - QModelIndex index = currentIndex(); - if (hint != QAbstractItemDelegate::NoHint) - Q_EMIT editorClosed(index, hint); - if (index.isValid() - && hint == QAbstractItemDelegate::SubmitModelCache - && index.row() < model()->rowCount() - 1) - { - switch (index.column()) - { - case SplitListModel::COLUMN_INCREASE: - case SplitListModel::COLUMN_DECREASE: - setCurrentIndex(model()->index(index.row() + 1, - SplitListModel::COLUMN_DATE, - index.parent())); - break; - default: - break; - } - } -} - -void SplitListView::accountEvent( ::Account* v, QofEventId event_type) -{ - if (v != m_account->gobj()) - return; - //qDebug() << "SplitListView::accountEvent, id=" << qofEventToString(event_type); - switch (event_type) - { - case QOF_EVENT_DESTROY: - // This account seems to be getting deleted - better close - // this view. - deleteLater(); - break; - default: - break; - } -} - -void SplitListView::bookEvent( ::QofBook* v, QofEventId event_type) -{ - qDebug() << "SplitListView::bookEvent, id=" << qofEventToString(event_type); - - switch (event_type) - { - case QOF_EVENT_DESTROY: - // The book is being deleted - better close this view ASAP! - deleteLater(); - break; - default: - break; - } -} - -} diff --git a/src/gnc/SplitListView.hpp b/src/gnc/SplitListView.hpp deleted file mode 100644 index 5da90b3e7d..0000000000 --- a/src/gnc/SplitListView.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * SplitListView.hpp - * Copyright (C) 2010 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#ifndef GNC_SPLITLISTVIEW_HPP -#define GNC_SPLITLISTVIEW_HPP - -#include "config.h" -#include "gncmm/Account.hpp" -#include "gnc/SplitListModel.hpp" -#include "gnc/QofEventWrapper.hpp" - -#include -#include -#include -#include - -namespace gnc -{ - -class SplitListView : public QTableView -{ - Q_OBJECT -public: - typedef QTableView base_class; - SplitListView(Glib::RefPtr account, QUndoStack* undoStack, QWidget* parent = 0); - -Q_SIGNALS: - void editorClosed(const QModelIndex& index, QAbstractItemDelegate::EndEditHint hint); - -public Q_SLOTS: - void closeEditor(QWidget* editor, QAbstractItemDelegate::EndEditHint hint); - void accountEvent( ::Account* v, QofEventId event_type); - void bookEvent( ::QofBook* v, QofEventId event_type); - -private: - Glib::RefPtr m_account; - QofEventWrapper m_eventWrapperAccount; - QofEventWrapper m_eventWrapperBook; -}; - -} - -#endif diff --git a/src/gnc/WeakPointer.hpp b/src/gnc/WeakPointer.hpp deleted file mode 100644 index 6d775e29c5..0000000000 --- a/src/gnc/WeakPointer.hpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - * WeakPointer.hpp - * Copyright (C) 2010 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#ifndef GNC_WEAKPOINTER_HPP -#define GNC_WEAKPOINTER_HPP - -#include -#include - -namespace gnc -{ - -/** A thin wrapper for a C object which is owned by someone else. - * - * This copies the interface of the boost::scoped_ptr, but in contrast - * to the boost::scoped_ptr this class does not take on ownership of - * the given pointer. Instead, the pointer is owned by someone else, - * and we hope nobody accesses this object after the pointer's object - * was deleted somewhere else. Unfortunately currently we have no - * information about whether the pointed-to object is still alive or - * already deleted. Sorry for that. - */ -template -class WeakPointer -{ -public: - typedef T element_type; -private: - element_type *m_ptr; - typedef WeakPointer this_type; -public: - - WeakPointer(element_type* ptr = 0) - : m_ptr(ptr) - { } - - void reset(element_type* ptr = 0) - { - m_ptr = ptr; - } - - T & operator*() const // never throws - { - assert(m_ptr != 0); - return *m_ptr; - } - - T * operator->() const // never throws - { - assert(m_ptr != 0); - return m_ptr; - } - - T * gobj() const // never throws - { - return m_ptr; - } - - // implicit conversion to "bool" - typedef T * this_type::*unspecified_bool_type; - operator unspecified_bool_type() const // never throws - { - return m_ptr == 0 ? 0 : &this_type::m_ptr; - } - - bool operator! () const // never throws - { - return m_ptr == 0; - } - -}; - -} // END namespace gnc - -#endif diff --git a/src/gnc/bla.html b/src/gnc/bla.html deleted file mode 100644 index dd2e6e20f1..0000000000 --- a/src/gnc/bla.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - -GnuCash C++ Test - - - -

GnuCash C++ Test

- -

This is a text that demonstrates how we can build a GnuCash variant in C++ and Qt.

- -

Images

-

-

We can also embed images here in this compiled-in HTML page.

- -
-
-Last modified: Mon Mar 1 09:11:12 CET 2010 - diff --git a/src/gnc/conv.hpp b/src/gnc/conv.hpp deleted file mode 100644 index 46216c30a1..0000000000 --- a/src/gnc/conv.hpp +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef CONV_HPP -#define CONV_HPP - -#include -#include -#include -#include - -namespace gnc -{ - -/// Convert the given Glib::Date into a QDate object -inline QDate g2q(const Glib::Date& d) -{ - return QDate(d.get_year(), d.get_month(), d.get_day()); -} - -/// Convert the given QDate into a Glib::Date object -inline Glib::Date q2g(const QDate& d) -{ - return Glib::Date(d.day(), Glib::Date::Month(d.month()), d.year()); -} - -/// Convert the given Glib::ustring into a QString object -inline QString g2q(const Glib::ustring& s) -{ - return QString::fromUtf8(s.c_str()); -} - -/// Convert the given QString into a Glib::ustring object -inline Glib::ustring q2g(const QString& s) -{ - return Glib::ustring(s.toUtf8()); -} -} - -#endif // CONV_HPP diff --git a/src/gnc/dashboard.cpp b/src/gnc/dashboard.cpp deleted file mode 100644 index fc415dcf09..0000000000 --- a/src/gnc/dashboard.cpp +++ /dev/null @@ -1,335 +0,0 @@ -/* - * Copyright (C) 2011 Free Software Foundation, Inc - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Foobar. If not, see . - */ -/** - * @file - * Dashboard for embedding various dock widgets. - * - * Dock Widgets: - * 1) Transfer Funds - * 2) First Person Overview - */ - -#include "dashboard.hpp" -#include "ui_dashboard.h" -#include "engine/gnc-event.h" // for GNC_EVENT_ITEM_ADDED - -#include -#include -#include - -namespace gnc -{ -Dashboard::Dashboard(QWidget *parent) : - QMainWindow(parent), - ui(new Ui::Dashboard), - m_eventWrapper(*this, &Dashboard::transactionEvent), - m_eventWrapperAccount(*this, &Dashboard::accountEvent) -{ - QSettings settings; - restoreGeometry(settings.value("dashboardGeometry").toByteArray()); - - ui->setupUi(this); - - // Generate UI - setUiWidgets(); - setBasicTxnEntryFormLayout(); - setCentralWidget(ui->dockwFPO); - setFPO(); - //this->tabifyDockWidget(ui->dockwBasicTxn, ui->dockwSplitTxn); - //ui->dockwBasicTxn->raise(); - ui->dockwSplitTxn->hide(); - ui->dockwLogViewer->hide(); - - /* Set stylesheet, so that some styling to viewlets can be applied */ - /*QFile styleSheetFile(":/qss-default"); - styleSheetFile.open(QFile::ReadOnly); - QString styleSheetName = QLatin1String(styleSheetFile.readAll()); - this->setStyleSheet(styleSheetName);*/ - - restoreState(settings.value("dashboardState").toByteArray()); - bool isBasicTxnDockVisible = settings.value("basic-txn-dockwidget-visible").toBool(); - ui->dockwBasicTxn->setVisible(isBasicTxnDockVisible); - - /* - // Trying to restore pos and size of dockwidget manually - QSettings settings; - QPoint bTxnWdgPos = settings.value("basic-txn-entry-dockwidget-pos").toPoint(); - ui->dockwBasicTxn->move(bTxnWdgPos); - QSize bTxnWdgSize = settings.value("basic-txn-entry-dockwidget-size").toSize(); - ui->dockwBasicTxn->resize(bTxnWdgSize); - */ - - connect(btnCreateBasicTxn, SIGNAL(clicked()), - this, SLOT(on_btnCreateBasicTxn_clicked())); -} - -Dashboard::~Dashboard() -{ - /* - QSettings settings; - settings.setValue("basic-txn-entry-dockwidget-pos", ui->dockwBasicTxn->pos()); - settings.setValue("basic-txn-entry-dockwidget-size", ui->dockwBasicTxn->size()); - */ - delete ui; -} - -void -Dashboard::mainWindowCloseEvent() -{ - QSettings settings; - settings.setValue("dashboardGeometry", saveGeometry()); - settings.setValue("dashboardState", saveState()); - settings.setValue("basic-txn-dockwidget-visible", ui->dockwBasicTxn->isVisible()); - //qDebug()<<"while writing dockwdg visibility is "<dockwBasicTxn->setVisible(settings.value("basic-txn-dockwidget-visible").toBool()); - ui->dockwFPO->show(); -} - -/** Initialise widgets to startup defaults */ -void -Dashboard::setUiWidgets() -{ - numer = 0.0; - - lblDescription = new QLabel(tr("Description:")); - lblDate = new QLabel(tr("Date:")); - lblTransferFrom = new QLabel(tr("Transfer From:")); - lblTransferTo = new QLabel(tr("TransferTo:")); - lblAmount = new QLabel(tr("Amount:")); - lblMemo = new QLabel(tr("Memo:")); - lblNum = new QLabel(tr("Num:")); - comboTransferFrom = new QComboBox(); - comboTransferFrom->addItem(tr("- NA -")); - comboTransferTo = new QComboBox(); - comboTransferTo->addItem(tr("- NA -")); - lineDescription = new QLineEdit(); - lineAmount = new QLineEdit(); - lineAmount->setText(tr("0.00")); - lineAmount->setValidator(new QDoubleValidator(0.0, 1e100, 2, this)); - lineMemo = new QLineEdit(); - lineNum = new QLineEdit(); - dateTxnDate = new QDateEdit(); - dateVal = QDate::currentDate(); - dateTxnDate->setDate(dateVal); - btnCreateBasicTxn = new QPushButton(tr("Create Transaction")); -} - -/** Layout for data entry. Type: Form Based - * - * Set this as default to make this layout as default - * for all data entry widgets. */ -void -Dashboard::setBasicTxnEntryFormLayout() -{ - gridBasicTxnEntry = new QGridLayout(ui->dockcBasicTxn); - - gridBasicTxnEntry->addWidget(lblDescription, 0, 0); - gridBasicTxnEntry->addWidget(lineDescription, 0, 1); - - gridBasicTxnEntry->addWidget(lblDate, 1, 0); - gridBasicTxnEntry->addWidget(dateTxnDate, 1, 1); - - gridBasicTxnEntry->addWidget(lblTransferFrom, 2, 0); - gridBasicTxnEntry->addWidget(comboTransferFrom, 2, 1); - - gridBasicTxnEntry->addWidget(lblTransferTo, 3, 0); - gridBasicTxnEntry->addWidget(comboTransferTo, 3, 1); - - gridBasicTxnEntry->addWidget(lblAmount, 4, 0); - gridBasicTxnEntry->addWidget(lineAmount, 4, 1); - - gridBasicTxnEntry->addWidget(lblMemo, 5, 0); - gridBasicTxnEntry->addWidget(lineMemo, 5, 1); - - gridBasicTxnEntry->addWidget(lblNum, 6, 0); - gridBasicTxnEntry->addWidget(lineNum, 6, 1); - - gridBasicTxnEntry->addWidget(btnCreateBasicTxn, 7, 1); -} - -void -Dashboard::setFPO() -{ - QHBoxLayout *FPOLayout = new QHBoxLayout; - ui->dockcFPO->setLayout(FPOLayout); - fpoWidget = new FPO(ui->dockcFPO, FPOLayout); -} - -void -Dashboard::clearFields() -{ - lineDescription->clear(); - lineAmount->clear(); - lineMemo->clear(); - lineNum->clear(); -} - -void -Dashboard::transactionEvent( ::Transaction* trans, QofEventId event_type) -{ - //qDebug() << "Dashboard::transactionEvent, id=" << qofEventToString(event_type); - switch (event_type) - { - case QOF_EVENT_MODIFY: - fpoWidget->leftViewlet->leftVUpdate(); - fpoWidget->rightViewlet->rightVUpdate(); - fpoWidget->defaultViewlet->defaultVUpdate(); - break; - case GNC_EVENT_ITEM_REMOVED: - case GNC_EVENT_ITEM_ADDED: - // This event is triggered by a split being added (or removed) - // to a transaction. Ignored because we already reacted upon - // the MODIFY event. - break; - case QOF_EVENT_CREATE: - // This event is triggered by a newly created transaction, but - // we reacted on this in the accountEvent handler already. - break; - default: - qDebug() << "Dashboard::transactionEvent, ignored event id=" << qofEventToString(event_type); - break; - } -} - -void -Dashboard::accountEvent( ::Account* acc, QofEventId event_type) -{ - //qDebug() << "Dashboard::accountEvent, id=" << qofEventToString(event_type); - - switch (event_type) - { - case GNC_EVENT_ITEM_REMOVED: - fpoWidget->leftViewlet->leftVUpdate(); - fpoWidget->rightViewlet->rightVUpdate(); - fpoWidget->defaultViewlet->defaultVUpdate(); - break; - case GNC_EVENT_ITEM_CHANGED: - case GNC_EVENT_ITEM_ADDED: - case QOF_EVENT_MODIFY: - // These events are also triggered e.g. by a newly added - // transaction/split in this account. However, we already - // reacted on this by the above events, so we can ignore them - // here. - break; - default: - qDebug() << "Dashboard::accountEvent, ignored event id=" << qofEventToString(event_type); - break; - } -} - - -void -Dashboard::loadAccountsTreeComboBox(AccountListModel * const m_accountsListModel) -{ - accountsList = m_accountsListModel; - comboTransferFrom->setModel(accountsList); - comboTransferTo->setModel(accountsList); -} - -/***** Slots *****/ - -/** "Create Transaction" button for Basic Transaction Entry dock widget */ -void -Dashboard::on_btnCreateBasicTxn_clicked() -{ - if (lineDescription->text().isEmpty()) - { - QMessageBox::StandardButton warnEmptyDesc; - warnEmptyDesc = QMessageBox::warning(this, tr("Empty Description"), "You have not set a description. Are you sure you want to create a transaction with no description?", QMessageBox::Yes | QMessageBox::No); - if (warnEmptyDesc == QMessageBox::No) - return; - } - - // Allocate memory and start editing a new transaction - int index = comboTransferFrom->currentIndex(); - account = accountsList->at(index); - book = gnc_account_get_book(account); - transaction = ::xaccMallocTransaction(book); - ::xaccTransBeginEdit(transaction); - - // Populate transaction details - dateVal = dateTxnDate->date(); - ::xaccTransSetDate(transaction, dateVal.day(), dateVal.month(), - dateVal.year()); - - ::xaccTransSetNum(transaction, lineNum->text().toUtf8()); - ::xaccTransSetDescription(transaction, lineDescription->text().toUtf8()); - - currency = gnc_account_or_default_currency(account, NULL); - ::xaccTransSetCurrency(transaction, currency); - - denom = ::gnc_commodity_get_fraction(currency); - - // Populate split 1 - // Check whether the account for this split is a placeholder - qDebug() << ::xaccAccountGetPlaceholder(account); - // ^^ does not work as expected, returns false for placeholder accounts too. Why? - - split = xaccMallocSplit(book); - ::xaccTransAppendSplit(transaction, split); - ::xaccAccountInsertSplit(account, split); - - numer = lineAmount->text().toDouble(); - amount = ::double_to_gnc_numeric(numer, denom, - GNC_HOW_DENOM_REDUCE | GNC_HOW_RND_NEVER); - ::xaccSplitSetValue(split, amount); - ::xaccSplitSetAmount(split, amount); - - // Populate split 2 - split2 = ::xaccMallocSplit(book); - ::xaccTransAppendSplit(transaction, split2); - int index2 = comboTransferTo->currentIndex(); - account2 = accountsList->at(index2); - ::xaccAccountInsertSplit(account2, split2); - - amount2 = ::gnc_numeric_neg(amount); - ::xaccSplitSetValue(split2, amount2); - ::xaccSplitSetAmount(split2, amount2); - - // Finally commit the transaction to storage backend. - ::xaccTransCommitEdit(transaction); - - statusBar()->showMessage(tr("Transaction has been created"), 2000); - clearFields(); -} - -void -Dashboard::on_dockwBasicTxn_visibilityChanged(bool visible) -{ - ((MainWindow *)parentWidget()->parentWidget()->parentWidget()->parentWidget())->dockWidgetsVisibilityChanged(0, visible); -} - -void -Dashboard::transferFundsWidgetButtonToggled(bool checked) -{ - if (checked) - { - ui->dockwBasicTxn->show(); - } - else - { - ui->dockwBasicTxn->hide(); - } -} - -} // END namespace gnc diff --git a/src/gnc/dashboard.hpp b/src/gnc/dashboard.hpp deleted file mode 100644 index 233a57169b..0000000000 --- a/src/gnc/dashboard.hpp +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (C) 2011 Free Software Foundation, Inc - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Foobar. If not, see . - */ -/** - * @file - * Dashboard for embedding various dock widgets. - */ - -#ifndef DASHBOARD_HPP -#define DASHBOARD_HPP - -#include "config.h" -#include "engine/guid.hpp" - -extern "C" -{ -#include "qof.h" -#include "engine/Account.h" -#include "engine/Transaction.h" -} - -#include "AccountItemModel.hpp" -#include "fpo/FPO.hpp" -#include "gnc/QofEventWrapper.hpp" - -#include -#include -#include - -namespace Ui { - class Dashboard; -} - -namespace gnc -{ - -class FPO; - -class Dashboard : public QMainWindow -{ - Q_OBJECT - -public: - explicit Dashboard(QWidget *parent = 0); - ~Dashboard(); - - FPO *fpoWidget; - AccountListModel *accountsList; - void loadAccountsTreeComboBox(AccountListModel * const m_accountListModel); - void showDashboardWidgets(); - void mainWindowCloseEvent(); - -public Q_SLOTS: - void transferFundsWidgetButtonToggled(bool checked); - void transactionEvent( ::Transaction* trans, QofEventId event_type); - void accountEvent( ::Account* acc, QofEventId event_type); - -private: - Ui::Dashboard *ui; - - /* UI widgets */ - QGridLayout *gridBasicTxnEntry; - QHBoxLayout *hbox; - QVBoxLayout *vbox; - QLabel *lblDescription; - QLabel *lblDate; - QLabel *lblTransferFrom; - QLabel *lblTransferTo; - QLabel *lblAmount; - QLabel *lblMemo; - QLabel *lblNum; - QComboBox *comboTransferFrom; - QComboBox *comboTransferTo; - QLineEdit *lineDescription; - QLineEdit *lineAmount; - QLineEdit *lineMemo; - QLineEdit *lineNum; - QDateEdit *dateTxnDate; - QDate dateVal; - QPushButton *btnCreateBasicTxn; - - /* Transaction related data types */ - ::QofBook *book; - ::Transaction *transaction; - ::gnc_commodity *currency; - int denom; - - ::Account *account; - ::Split *split; - double numer; - ::gnc_numeric amount; - - ::Account *account2; - ::Split *split2; - ::gnc_numeric amount2; - - void setUiWidgets(); - void setBasicTxnEntryFormLayout(); - void setFPO(); - void clearFields(); - QofEventWrapper m_eventWrapper; - QofEventWrapper m_eventWrapperAccount; - -private Q_SLOTS: - void on_btnCreateBasicTxn_clicked(); - void on_dockwBasicTxn_visibilityChanged(bool visible); -}; - -} // END namespace gnc - -#endif // DASHBOARD_HPP diff --git a/src/gnc/dashboard.ui b/src/gnc/dashboard.ui deleted file mode 100644 index fc18998b36..0000000000 --- a/src/gnc/dashboard.ui +++ /dev/null @@ -1,329 +0,0 @@ - - - Dashboard - - - - 0 - 0 - 1049 - 617 - - - - MainWindow - - - QMainWindow::AllowTabbedDocks|QMainWindow::AnimatedDocks|QMainWindow::ForceTabbedDocks - - - - - - 0 - 0 - 1049 - 21 - - - - - - - - 0 - 0 - - - - - 300 - 265 - - - - - 500 - 275 - - - - - 200 - 275 - - - - false - - - - - - QDockWidget::AllDockWidgetFeatures - - - Qt::AllDockWidgetAreas - - - Basic - - - 4 - - - - - - - 0 - 0 - - - - - 200 - 265 - - - - - 500 - 275 - - - - QDockWidget::AllDockWidgetFeatures - - - Qt::AllDockWidgetAreas - - - Split - - - 4 - - - - - - 10 - 60 - 261 - 161 - - - - Split - - - - - 10 - 30 - 101 - 16 - - - - Transfer From/To - - - - - - 120 - 30 - 111 - 24 - - - - - - - 10 - 60 - 55 - 15 - - - - Amount - - - - - - 10 - 90 - 55 - 15 - - - - Memo - - - - - - 10 - 120 - 55 - 15 - - - - Num - - - - - - 70 - 60 - 181 - 23 - - - - - - - 70 - 90 - 181 - 23 - - - - - - - 70 - 120 - 181 - 23 - - - - - - - - 80 - 0 - 331 - 23 - - - - - - - 10 - 0 - 81 - 16 - - - - Description - - - - - - 10 - 30 - 55 - 15 - - - - Date - - - - - - 80 - 30 - 110 - 23 - - - - - - - 280 - 130 - 121 - 31 - - - - Add Split > - - - - - - 280 - 170 - 121 - 31 - - - - Create Transaction - - - - - - - - 100 - 100 - - - - Event Logger - - - 4 - - - - - - true - - - - 0 - 0 - - - - QDockWidget::NoDockWidgetFeatures - - - Qt::BottomDockWidgetArea|Qt::TopDockWidgetArea - - - - - - 8 - - - - - - - diff --git a/src/gnc/fallback-icons.qrc b/src/gnc/fallback-icons.qrc deleted file mode 100644 index 23c6e46423..0000000000 --- a/src/gnc/fallback-icons.qrc +++ /dev/null @@ -1,18 +0,0 @@ - - - icons/oxygen/index.theme - icons/oxygen/48x48/actions/list-add.png - icons/oxygen/48x48/actions/edit-undo.png - icons/oxygen/48x48/actions/edit-redo.png - icons/oxygen/48x48/actions/edit-copy.png - icons/oxygen/48x48/actions/edit-cut.png - icons/oxygen/48x48/actions/edit-paste.png - icons/oxygen/48x48/actions/window-close.png - icons/oxygen/48x48/actions/tab-close-other.png - icons/oxygen/48x48/actions/document-new.png - icons/oxygen/48x48/actions/document-open.png - icons/oxygen/48x48/actions/document-save.png - icons/oxygen/48x48/actions/document-save-as.png - icons/oxygen/48x48/actions/help-about.png - - diff --git a/src/gnc/fpo/FPO.cpp b/src/gnc/fpo/FPO.cpp deleted file mode 100644 index af09ab3e54..0000000000 --- a/src/gnc/fpo/FPO.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/********************************************************************\ - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License as * - * published by the Free Software Foundation; either version 2 of * - * the License, or (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License* - * along with this program; if not, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * - * Boston, MA 02110-1301, USA gnu@gnu.org * - * * -\********************************************************************/ - -#include "FPO.hpp" -#include "gnc/dashboard.hpp" -#include "gnc/mainwindow.hpp" - -#include - -namespace gnc -{ - -FPO::FPO(QWidget *parent, QHBoxLayout *FPOLayout) : - QWidget(parent) -{ - /* Left viewlet */ - leftViewlet = new ViewletView(parent, FPOLayout); - leftViewlet->leftVSet(parent, FPOLayout); - - /* Right viewlet */ - rightViewlet = new ViewletView(parent, FPOLayout); - rightViewlet->rightVSet(parent, FPOLayout); - - /* Default viewlet */ - defaultViewlet = new ViewletView(parent, FPOLayout); - defaultViewlet->defaultVSet(parent, FPOLayout); -} - -} // END namespace gnc diff --git a/src/gnc/fpo/FPO.hpp b/src/gnc/fpo/FPO.hpp deleted file mode 100644 index f51f5862a2..0000000000 --- a/src/gnc/fpo/FPO.hpp +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef FPO_HPP -#define FPO_HPP - -#include "ViewletView.hpp" -#include "gnc/Session.hpp" - -#include -#include - -namespace gnc -{ - -class ViewletView; - -class FPO : public QWidget -{ - Q_OBJECT -public: - explicit FPO(QWidget *parent = 0, QHBoxLayout *FPOLayout = NULL); - ViewletView *leftViewlet; - ViewletView *rightViewlet; - ViewletView *defaultViewlet; - - Session m_session; - -Q_SIGNALS: - void sessionLoaded(); - -public Q_SLOTS: - -}; - -} // END namespace gnc - -#endif // FPO_HPP diff --git a/src/gnc/fpo/ViewletModel.cpp b/src/gnc/fpo/ViewletModel.cpp deleted file mode 100644 index f504236210..0000000000 --- a/src/gnc/fpo/ViewletModel.cpp +++ /dev/null @@ -1,236 +0,0 @@ -/********************************************************************\ - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License as * - * published by the Free Software Foundation; either version 2 of * - * the License, or (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License* - * along with this program; if not, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * - * Boston, MA 02110-1301, USA gnu@gnu.org * - * * -\********************************************************************/ - -#include "ViewletModel.hpp" -#include "gncmm/Transaction.hpp" -#include "gncmm/Account.hpp" - -#include "gncmm/Numeric.hpp" - -namespace gnc -{ - -ViewletModel::ViewletModel() -{ -} - -void -ViewletModel::defaultVGenerate(::Account *selectedAccount) -{ - SplitQList splitList = buildSplitListDateSort(selectedAccount); - buildMiniJournalStruct(splitList); -} - -void -ViewletModel::leftVGenerate(::Account *selectedAccount) -{ - ::QofBook *book = gnc_account_get_book(selectedAccount); - ::Account *rootAccount = gnc_book_get_root_account(book); - - GList *accountsGList = gnc_account_get_descendants(rootAccount); - AccountQList accountsList = accountFromGList(accountsGList); - - int numOfAccounts = accountsList.count(); - qDebug()<<"Total num of accounts: "< xaccTransGetDate(tx_b); -} - -SplitQList -ViewletModel::buildSplitListDateSort(AccountQList accountsList) -{ - int numOfAccounts = accountsList.count(); - qDebug() <<"Num of accounts of X TYPE: "<(accountsList.at(i)); - - SplitQList tempList = Split::from_glist(::xaccAccountGetSplitList(C_acct)); - - int numOfSplits = tempList.size(); - for(int i=0; i split = Glib::wrap(splitList.at(i)); - Glib::RefPtr txn = split->get_parent(); - - structViewletEntries entry; - - if(i == 0) - { - tempDate = txn->get_date_posted(); - entry.isDateEqual = false; - tempAccount = split->get_corr_account_name(); - entry.isSplitAccountEqual = false; - } - else - { - if(txn->get_date_posted() == tempDate) - { - entry.isDateEqual = true; - } - else - { - entry.isDateEqual = false; - tempDate = txn->get_date_posted(); - } - - if(split->get_corr_account_name() == tempAccount) - { - entry.isSplitAccountEqual = true; - } - else - { - entry.isSplitAccountEqual = false; - tempAccount = split->get_corr_account_name(); - } - } - - entry.txnDate = g2q(txn->get_date_posted()).toString(); - entry.splitAccount = g2q(split->get_corr_account_name()); - entry.txnDescription = g2q(txn->get_description()); - - Numeric splitAmount = split->get_amount(); - PrintAmountInfo printInfo(split, true); - entry.splitAmount = g2q(splitAmount.printAmount(printInfo)); - - //qDebug()< -#include - -#include "config.h" -#include "engine/guid.hpp" - -extern "C" -{ -#include "qof.h" -#include "engine/Account.h" -#include "engine/Transaction.h" -#include "engine/Split.h" -} - -#include "gncmm/Split.hpp" -#include "gnc/SplitListModel.hpp" -#include "gnc/AccountItemModel.hpp" - -namespace gnc -{ - -class ViewletModel -{ -public: - ViewletModel(); - void defaultVGenerate(::Account * selectedAccount); - void leftVGenerate(::Account * selectedAccount); - void rightVGenerate(::Account *selectedAccount); - - struct structViewletEntries - { - QString txnDate; - bool isDateEqual; - QString splitAccount; - bool isSplitAccountEqual; - QString txnDescription; - QString splitAmount; - }; - structViewletEntries tempEntry; - QQueue queueEntries; - -private: - SplitQList buildSplitListDateSort(::Account *selectedAccount); - SplitQList buildSplitListDateSort(AccountQList accountsList); - bool static lessThanByDate(::Split* a, ::Split* b); - void buildMiniJournalStruct(SplitQList splitList); - -}; - -} // END namespace gnc - -#endif // VIEWLETMODEL_HPP diff --git a/src/gnc/fpo/ViewletView.cpp b/src/gnc/fpo/ViewletView.cpp deleted file mode 100644 index 2086767f95..0000000000 --- a/src/gnc/fpo/ViewletView.cpp +++ /dev/null @@ -1,371 +0,0 @@ -/********************************************************************\ - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License as * - * published by the Free Software Foundation; either version 2 of * - * the License, or (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License* - * along with this program; if not, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * - * Boston, MA 02110-1301, USA gnu@gnu.org * - * * -\********************************************************************/ - -#include "ViewletView.hpp" - -namespace gnc -{ - -ViewletView::ViewletView(QWidget * parent, QHBoxLayout * FPOlayout) : - QWidget(parent) -{ - viewletModel = new ViewletModel(); -} - -/***** Public *****/ - -void -ViewletView::defaultVSet(QWidget *parent, QHBoxLayout *FPOLayout) -{ - /* For default viewlet */ - comboAccountsList = new QComboBox(); - comboAccountsList->addItem(tr("-NA-")); - - connect(comboAccountsList, SIGNAL(currentIndexChanged(int)), - this, SLOT(defaultVUpdate())); - - /* Add a new QWidget (acts as a container for this viewlet) to the - layout of QWidget (QDockWidget>QWidget, i.e, dockwFPO>dockcFPO) - in dashboard QMainWindow. - */ - QWidget *viewletContainer = new QWidget; - FPOLayout->addWidget(viewletContainer); - - /* Set a layout for the container QWidget */ - QVBoxLayout *vLay = new QVBoxLayout; - viewletContainer->setLayout(vLay); - - /***** Start of viewlet specific implementations *****/ - /* Specification: - This default viewlet contains two widgets, 1) An account - selection widget, and 2) A scroll area which wraps a QWidget - to show the entries.*/ - /** @bugid_1 1) Account selection feature of the viewlet */ - /* - comboAccountsList = new QComboBox(); - comboAccountsList->addItem(tr("-NA-")); - */ - - vLay->addWidget(comboAccountsList); - - /* 2) The actual viewlet display of account selected in 1) */ - QWidget *defaultViewletWidget = new QWidget(); - defaultVLayout = new QVBoxLayout(); - QScrollArea *viewletScrollArea = new QScrollArea(); - - viewletScrollArea->setWidget(defaultViewletWidget); - viewletScrollArea->setAlignment(Qt::AlignLeft); - viewletScrollArea->setWidgetResizable(true); - defaultViewletWidget->setLayout(defaultVLayout); - vLay->addWidget(viewletScrollArea); - - //create viewlet - if(comboAccountsList->currentIndex()) - { - selectedAccountIndex = comboAccountsList->currentIndex(); - selectedAccount = accountsList->at(selectedAccountIndex); - - viewletModel->defaultVGenerate(selectedAccount); - defaultVDraw(); - } -} - -void -ViewletView::leftVSet(QWidget *parent, QHBoxLayout *FPOLayout) -{ - connect(this, SIGNAL(fileLoaded()), - this, SLOT(leftVLoad())); - - //connect(comboAccountsList, SIGNAL(currentIndexChanged(int)), - // this, SLOT(leftVUpdate())); - - //not required. remove after cleaning loadAccountsTreeComboBox() - comboAccountsList = new QComboBox(); - comboAccountsList->addItem(tr("-NA-")); - - - QWidget *viewletContainer = new QWidget; - FPOLayout->addWidget(viewletContainer); - - QVBoxLayout *vLay = new QVBoxLayout; - viewletContainer->setLayout(vLay); - - QLabel *title = new QLabel(tr("Expense")); - vLay->addWidget(title); - - /* The actual viewlet display of account(s) chosen*/ - QWidget *defaultViewletWidget = new QWidget(); - defaultVLayout = new QVBoxLayout(); - QScrollArea *viewletScrollArea = new QScrollArea(); - - viewletScrollArea->setWidget(defaultViewletWidget); - viewletScrollArea->setAlignment(Qt::AlignLeft); - viewletScrollArea->setWidgetResizable(true); - defaultViewletWidget->setLayout(defaultVLayout); - vLay->addWidget(viewletScrollArea); - - /*//create viewlet - if(comboAccountsList->currentIndex()) - { - selectedAccountIndex = comboAccountsList->currentIndex(); - selectedAccount = accountsList->at(selectedAccountIndex); - - defaultVDraw(); - }*/ - -} - -void -ViewletView::rightVSet(QWidget *parent, QHBoxLayout *FPOLayout) -{ - connect(this, SIGNAL(fileLoaded()), - this, SLOT(rightVLoad())); - - //connect(comboAccountsList, SIGNAL(currentIndexChanged(int)), - // this, SLOT(leftVUpdate())); - - //not required. remove after cleaning loadAccountsTreeComboBox() - comboAccountsList = new QComboBox(); - comboAccountsList->addItem(tr("-NA-")); - - - QWidget *viewletContainer = new QWidget; - FPOLayout->addWidget(viewletContainer); - - QVBoxLayout *vLay = new QVBoxLayout; - viewletContainer->setLayout(vLay); - - QLabel *title = new QLabel(tr("Income")); - vLay->addWidget(title); - - /* The actual viewlet display of account(s) chosen*/ - QWidget *defaultViewletWidget = new QWidget(); - defaultVLayout = new QVBoxLayout(); - QScrollArea *viewletScrollArea = new QScrollArea(); - - viewletScrollArea->setWidget(defaultViewletWidget); - viewletScrollArea->setAlignment(Qt::AlignLeft); - viewletScrollArea->setWidgetResizable(true); - defaultViewletWidget->setLayout(defaultVLayout); - vLay->addWidget(viewletScrollArea); - - /*//create viewlet - if(comboAccountsList->currentIndex()) - { - selectedAccountIndex = comboAccountsList->currentIndex(); - selectedAccount = accountsList->at(selectedAccountIndex); - - defaultVDraw(); - }*/ - -} - -/***** Private *****/ - -/** Create the widgets for the viewlet entries - - Passes the selected account to the model. The updated textual - data in the struct of the model is used in the newly created - widgets. -*/ -void -ViewletView::defaultVDraw() -{ - /* Update the struct in ViewletModel with data from the selected - account - */ - - - int numOfTransactions = viewletModel->queueEntries.count(); - for (int i = 0; i < numOfTransactions; i++) - { - viewletModel->tempEntry = viewletModel->queueEntries.at(i); - - //1 & 2 - if((!viewletModel->tempEntry.isDateEqual && !viewletModel->tempEntry.isSplitAccountEqual) - || (!viewletModel->tempEntry.isDateEqual && viewletModel->tempEntry.isSplitAccountEqual)) - { - dateCheckOutput(); - accountCheckOutput(); - descriptionAmountOutput(); - } - - //3 - if(viewletModel->tempEntry.isDateEqual && !viewletModel->tempEntry.isSplitAccountEqual) - { - accountCheckOutput(); - descriptionAmountOutput(); - } - - //4 - if(viewletModel->tempEntry.isDateEqual && viewletModel->tempEntry.isSplitAccountEqual) - { - descriptionAmountOutput(); - } - } -} - -void -ViewletView::dateCheckOutput() -{ - QWidget *dateLevelContainer = new QWidget(); - QVBoxLayout *dateLayout = new QVBoxLayout; - dateLevelContainer->setLayout(dateLayout); - - /* Append the pointer of this top level widget - of the viewlet for later removal during update */ - viewletWidgetContainersList.append(dateLevelContainer); - - defaultVLayout->addWidget(dateLevelContainer, 10, Qt::AlignTop); - - txnDate = viewletModel->tempEntry.txnDate; - setLabel(txnDate, "dateWidget", dateLayout); - - QWidget *accountLevelContainer = new QWidget(); - accountLayout = new QVBoxLayout; - accountLevelContainer->setLayout(accountLayout); - dateLayout->addWidget(accountLevelContainer); -} - -void -ViewletView::accountCheckOutput() -{ - QWidget *singleAccountLevelContainer = new QWidget(); - QVBoxLayout *singleAccountLayout = new QVBoxLayout(); - singleAccountLevelContainer->setLayout(singleAccountLayout); - - accountLayout->addWidget(singleAccountLevelContainer); - - // 1 - splitAccount = viewletModel->tempEntry.splitAccount; - setLabel(splitAccount, "accountWidget", singleAccountLayout); - - QWidget *descriptionAmountLevelContainer = new QWidget(); - descriptionAmountLayout = new QVBoxLayout(); - descriptionAmountLevelContainer->setLayout(descriptionAmountLayout); - - // 2 - singleAccountLayout->addWidget(descriptionAmountLevelContainer); -} - -void -ViewletView::descriptionAmountOutput() -{ - txnDescription = viewletModel->tempEntry.txnDescription; - setLabel(txnDescription, "descWidget", descriptionAmountLayout); - - splitAmount = viewletModel->tempEntry.splitAmount; - setLabel(splitAmount, "amountWidget", descriptionAmountLayout); -} - -void -ViewletView::defaultVRemoveWidgets() -{ - /* Remove old widgets. */ - int numOfContainers = viewletWidgetContainersList.count(); - for (int i=0; iqueueEntries.clear(); - viewletWidgetContainersList.clear(); -} - -/**********/ - -void -ViewletView::setLabel(QString data, QString objectName, QVBoxLayout *layout) -{ - QLabel *lbl = new QLabel(); - lbl->setText(data); - layout->addWidget(lbl); - /* Used as CSS ID by QStyleSheet */ - lbl->setObjectName(objectName); - viewletWidgetsList.append(lbl); -} - -void -ViewletView::loadAccountsTreeComboBox(AccountListModel * const m_accountsListModel) -{ - accountsList = m_accountsListModel; - comboAccountsList->setModel(accountsList); - Q_EMIT fileLoaded(); -} - -/***** Slots *****/ - -void -ViewletView::defaultVUpdate() -{ - selectedAccountIndex = comboAccountsList->currentIndex(); - selectedAccount = accountsList->at(selectedAccountIndex); - - defaultVRemoveWidgets(); - viewletModel->defaultVGenerate(selectedAccount); - defaultVDraw(); -} - - -void -ViewletView::leftVUpdate() -{ - selectedAccountIndex = comboAccountsList->currentIndex(); - selectedAccount = accountsList->at(selectedAccountIndex); - - //Call this in dboard gnc event switch - defaultVRemoveWidgets(); - viewletModel->leftVGenerate(selectedAccount); - defaultVDraw(); -} - -void -ViewletView::leftVLoad() -{ - selectedAccount = accountsList->at(1); - defaultVRemoveWidgets(); - viewletModel->leftVGenerate(selectedAccount); - defaultVDraw(); -} - -void -ViewletView::rightVUpdate() -{ - selectedAccountIndex = comboAccountsList->currentIndex(); - selectedAccount = accountsList->at(selectedAccountIndex); - - //Call this in dboard gnc event switch - defaultVRemoveWidgets(); - viewletModel->rightVGenerate(selectedAccount); - defaultVDraw(); -} - -void -ViewletView::rightVLoad() -{ - selectedAccount = accountsList->at(1); - defaultVRemoveWidgets(); - viewletModel->rightVGenerate(selectedAccount); - defaultVDraw(); -} - -} // END namespace gnc - diff --git a/src/gnc/fpo/ViewletView.hpp b/src/gnc/fpo/ViewletView.hpp deleted file mode 100644 index 6fd4f913c9..0000000000 --- a/src/gnc/fpo/ViewletView.hpp +++ /dev/null @@ -1,102 +0,0 @@ -#ifndef VIEWLETVIEW_HPP -#define VIEWLETVIEW_HPP - -#include "config.h" -#include "engine/guid.hpp" - -extern "C" -{ -#include "qof.h" -#include "engine/Account.h" -#include "engine/Transaction.h" -#include "engine/Split.h" -} - -#include "gnc/mainwindow.hpp" -#include "gnc/fpo/ViewletModel.hpp" -#include "gnc/AccountItemModel.hpp" -#include "gnc/SplitListModel.hpp" - -#include -#include -#include -#include - -namespace gnc -{ -class ViewletModel; - -class ViewletView : public QWidget -{ - Q_OBJECT -public: - explicit ViewletView(QWidget * parent = 0, QHBoxLayout * FPOLayout = NULL); - void loadAccountsTreeComboBox(AccountListModel * const m_accountsListModel); - - /* Call the appropriate method to set the viewlet of that type */ - void defaultVSet(QWidget * parent, QHBoxLayout * FPOLayout); - void leftVSet(QWidget * parent, QHBoxLayout * FPOLayout); - void rightVSet(QWidget * parent, QHBoxLayout * FPOLayout); - - void leftVUpdate(); - void rightVUpdate(); - -Q_SIGNALS: - void fileLoaded(); - -public Q_SLOTS: - void defaultVUpdate(); - -private: - ViewletModel *viewletModel; - AccountListModel *accountsList; - - QString txnDate; - QString txnDescription; - QString splitAccount; - QString splitAmount; - - QVBoxLayout *defaultVLayout; - QVBoxLayout *leftVLayout; - QVBoxLayout *rightVLayout; - - QVBoxLayout *accountLayout; - QVBoxLayout *descriptionAmountLayout; - - /* A simple list to store widgets generated by any of the three - viewlet types. When the viewlet updates, a new viewlet could - be drawn by first removing the old widgets in this list. */ - QList viewletWidgetsList; - QList viewletWidgetContainersList; - - /** @bugid_1 */ - QComboBox * comboAccountsList; - - /** @todo */ - ::SplitList * pSplitList; - ::Account * selectedAccount; - int selectedAccountIndex; - - /* Widget generator */ - void setLabel(QString data, QString objectName, QVBoxLayout *layout); - - /* Viewlet generator methods */ - void defaultVDraw(); - void defaultVRemoveWidgets(); - //void leftVDraw(); - void leftVRemoveWidgets(); - //void rightVDraw(); - void rightVRemoveWidgets(); - - void dateCheckOutput(); - void accountCheckOutput(); - void descriptionAmountOutput(); - -private Q_SLOTS: - void leftVLoad(); - void rightVLoad(); -}; - -} // END namespace gnc - -#endif // VIEWLETVIEW_HPP diff --git a/src/gnc/gnucash.qrc b/src/gnc/gnucash.qrc deleted file mode 100644 index ac7b9c1504..0000000000 --- a/src/gnc/gnucash.qrc +++ /dev/null @@ -1,21 +0,0 @@ - - - - ../pixmaps/hicolor/24x24/actions/gnc-account-delete.png - ../pixmaps/hicolor/24x24/actions/gnc-account-edit.png - ../pixmaps/hicolor/24x24/actions/gnc-account-new.png - ../pixmaps/hicolor/24x24/actions/gnc-account-open.png - ../pixmaps/hicolor/24x24/actions/gnc-account.png - ../pixmaps/hicolor/24x24/actions/gnc-invoice-edit.png - ../pixmaps/hicolor/24x24/actions/gnc-invoice.png - ../pixmaps/hicolor/24x24/actions/gnc-invoice-post.png - ../pixmaps/hicolor/24x24/actions/gnc-invoice-unpost.png - ../pixmaps/hicolor/24x24/actions/gnc-jumpto.png - ../pixmaps/hicolor/24x24/actions/gnc-split-trans.png - ../pixmaps/hicolor/24x24/actions/gnc-sx-new.png - ../pixmaps/hicolor/24x24/actions/gnc-transfer.png - ../pixmaps/hicolor/24x24/actions/gnucash-icon.png - ../pixmaps/hicolor/24x24/actions/gnucash-icon.png - ../pixmaps/gnucash_splash.png - - diff --git a/src/gnc/gtk-icons.qrc b/src/gnc/gtk-icons.qrc deleted file mode 100644 index eb634cfc58..0000000000 --- a/src/gnc/gtk-icons.qrc +++ /dev/null @@ -1,16 +0,0 @@ - - - gtk-icons/gtk-about.png - gtk-icons/gtk-close.png - gtk-icons/gtk-copy.png - gtk-icons/gtk-cut.png - gtk-icons/gtk-new.png - gtk-icons/gtk-open.png - gtk-icons/gtk-paste.png - gtk-icons/gtk-quit.png - gtk-icons/gtk-redo.png - gtk-icons/gtk-save-as.png - gtk-icons/gtk-save.png - gtk-icons/gtk-undo.png - - diff --git a/src/gnc/gtk-icons/gtk-about.png b/src/gnc/gtk-icons/gtk-about.png deleted file mode 100644 index dd06dd4e263c85ba610133f579625d0fa78350c9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1710 zcmV;f22uHmP)0cVoF4UQj*w#Gz}zn z?2Hr7&2u?3=j^?Bn6Yy_u}R}JJ<`(NI0Fk!tTo1(0diRyk~;eLjd#D;r-F(7xhxI+Ujc~d*}+>Lj;_1maSV^|iV@N7HN|1( zD|X6dDNKUqZvXz_Sgp7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#tC+MP(?d*+jzYKtxd1(@MLHK*X59NPH0O&^#py%zs zETz7?biBgKz{SaU$tdmu=>{UKUM7Eu{I$NM_WrT_CD;%}E&30nHUIzs07*qoM6N<$ Ef{n&5p#T5? diff --git a/src/gnc/gtk-icons/gtk-close.png b/src/gnc/gtk-icons/gtk-close.png deleted file mode 100644 index bf8104f95645b70b65f125daa1001a666edd0cf4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1045 zcmV+w1nT>VP)-~`wtg0-#?q8Elr7DUdyH*9Jf4}CMNCUffb6PDz0%t}oqK-o-mCk7|Kr~druE|9>^(mL_XMCH0Qj|j z-1ugGe!lpo#6#&@!;AapS8fjF^iuJ4@bh`Few%b5PSmC>5O4h z8{trx?7!GUZ?6Zcsv0Y+t0}udC+6nn4&Ms!8sy{Q$iP6Dlyn{4-Q56ya=DD28#l1E zr5Y=1mz!S+ID;@wJo_m6p-&D;T&-3E0PsAIthQ~euCKkICZd;_zi|dF!7>yM#=%g_ zvSC>k0Kl?rn3lyb6b=foR~lUL`X1KFEJdTy{-6{j)oKMi&w~(xTCED7&&Rrm%T*{I zObrd)e6+c_dGgkPGxMRL_hrA|Ps)d7balCr&2Bez{m^>X>t*$_4zI_<5<)tQrQ)TK z3xLVV$!_9u{yz9#L>5KyZ*xu4jKpT5aBy&NaV5P3x7!U>RU2EWt?XaP=bxLVX)z3bu`Dy}_lu;Ym(VBl z5zDkgsnqj_0A>JKmjOCK>1Y0c$W^Nqbae2@WVA+FRddVnKc~{^bR7UHmC9GPO@A^? zQwjw9T(wq(&?j&yHFXC-FMy-wc@5wK&}Nx*V>`P&A&MfaX<9?eXuAu)E#1%O^R=dq zX0zFodcA(1f<9^(Mj#jra=F}&ZJTxyKzp--1^}aV2E=5nWx|nYZfA!t92Az97XSD* zpU>w390RBTr~_b*j*d=CMg3_9-y!er?s|&F!n3uNjqggOQn9Hy1wdODjRVjD;GJ{T znE+0jB{$BswjDql0D@P)vJJp!8Xq_FF5P4X|9s^(0D6s%X=<+0{zu~_qCc?|d{V^k P00000NkvXXu0mjfCFklj diff --git a/src/gnc/gtk-icons/gtk-copy.png b/src/gnc/gtk-icons/gtk-copy.png deleted file mode 100644 index adea8fe4212f67a8ff13db46f3d37c59bd23b454..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 567 zcmV-70?7S|P)}AxfEX!6OxDr}I!Zo}`No?d?gKn+)*J zAEU67Z1!;5M|{_m(p9@bgpfCb8nIOB;MuWFE`QX}b=`D=uIpwlf7Gxo&Q1oDuB)nw zdi~Y5{O0Bs29&P55*VW>3hp0k(jkGJklk~w1%kU_$Dy7G)b4MjLqdUw*8)H|=seW5 z0HEOZuFBnH3=9~Cfj;fe{Fce4P2qu4b>;pAkx+~qa`#X}TuVSzRnb{rT+#9G=uPg(-s4G`sFBa!+Ix80^>)h6r zD{xu4unhE~uG|{NwFGxlu~e9>6V-K^a4;$-peXa6&RZw0s|>7wLWsZB?RM6dmR6(% zM0K4e8lG*|w;O0R8p*=xNtq7lvYddpt}?I!W+rp|1mFq7FQr9h_(yAf0E|pF{W27g ztLqpox+fH1F#&vx1{bTk%D@wlLZ+^9ZU5&4tm-O*%NuZYwqpU?b!F*xJ0Qg0!tg~m z9o>N4y0VZ3^4@ATljFJDOBB`>00qzo@W~9}7t=q#&KFYZ-?QXvQilKl002ovPDHLk FV1jf51+M@A diff --git a/src/gnc/gtk-icons/gtk-cut.png b/src/gnc/gtk-icons/gtk-cut.png deleted file mode 100644 index b672b7360d330036f953992898d7ba366b96b8ca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1532 zcmV0u&+U2g{D1j>ya)JS|AIoHkjyzJ6Y z)_(*b6bezw`9YZqpH3vOqobpAN_qJUilRKTZCj|UXaHAs062~fFy=2BAkSDuI<12Rcv2@PKZ7CYSg#Gf-zFt!h1Xx)UnY51Cv*$?JY<68|XQ$H9(Z0N~ zp(&txRK!LikQD{-L;@Eg;fqGv`gpv2V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$y0Muzr~Uy!FksMT8s}5!=nHI{P)TiZ@%;1+keZe%beR5xpC3hQ4{KY{nfQM=f`KQ znO_wkzVBC$X9LDF@8;J+fWrLmEMC~$-}7GpK?l#uz82{M00000NkvXXu0mjf2oamJ diff --git a/src/gnc/gtk-icons/gtk-open.png b/src/gnc/gtk-icons/gtk-open.png deleted file mode 100644 index 0a7bedd3eefd0c81b5eac44d91e022534703c809..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 971 zcmV;+12p`JP)vR@dOd1jt@KkxJF1)l2vF4p>R;)D0T)Y_aH=){=ijyRJ(_w^?`3NSmDx-vEW z(&Xsq-o8%0FLCMO@*^e9XX$k2?2`aEorc+&kFjz+4=H6&r{O)r7<*=X_}lM({3?}7 z4 z!uia*p#TlX!MbsC1)~SX_&dkn0MyD5ZJ>gxDgH2qq>bz=H@9wbxiz3bfYHS_kVlQXzzZ8;v1(IN5uP z9R!^)f(HP$F8~E8&~3DwJBUVIT)n#3cRqwE8jWIdauSZ?G*{>iU@52pW!h*RM}V;? zlF1`o3vA`Re?RcH2y8)grJywe&2Dg<2!wEu&-b5@-B67POifLJ1;*w-w*^2!4K$sn zr>6%l-uj=d`*3>*0Kr(h*@n%jD5dNo@AMliHW+{iP*QESp*1!D@L{b*{z@JT>3NjP zisuvK zj}6e&;^KAWe!HA?0Dv)kaqL)fJdrrKneR?<#u1P20b|{T^f)ROSL>eVH2?^>proAJ zw>QrFyAf!6hvh)sD&A4VSdIgL(sJS2N}<*`w|D>YJP-A{7v+Zk;Q&DGf%lVO4$25>IcE`0yP;Yy`)tF`9@ tfH44Z3_4k!Ocp>DzR{IP)tbhd+5nteP+4Elc z_@lw|i2}}c$=LYW_01%23IJecW}2Cq>Ckl%Nv3BQz~OyzU#hjWui|+*KCS+7kE0q3fB>=UzMMJIKAn@xv@TAbI?9%?1ID3J9f{DuZvdx0adD1 z%lpR*ti7k3+{O(!juQ${ufpJ`gYfSZFFl;WbqwMzWAKBw^x%MRV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i$EKe$8-(Af6l`EG04$aR&ep zi6FvZsyA<@wYQ(1mtUjkr_**pM+j1Qz_2VEeOeO&y|ff#YMQa>De?{;09}XJ{aUxA z5Xe{zD_s)KY3n+kV35%S-01CN^~c9i9t&bd4BI@_v%mvdnr@h}eS30MO~VLcC^VvP*8|r8iX!3a=Gaeld(ZGPx@x$ z8lbi77VF-rW$o(+0TA&xt5)Su;xA)rdW!nc?_BG=O2@$8+`ijQoG9wT5Uj)lYd$>2 z+E?}?go4lKBPYkpeSny%L|5xxU}stZybH68#EF#CI$4j>E29rSqt=pF1LY=)_C{h8*@ z1`Nw(>2_KvFb2$|0?>dQARk~NJVImFS+3t{CXtAvm4JV_^0Rx!0n1GY5&(zZIDYRo zd-<~VJrh78-Pte$$Yu6refNf3fp83n0Mo!Y5O#Gq1$4jzc)@YDSc+N9zJN9N;6Jl| VYc*wnf-C?4002ovPDHLkV1fXHI)(rM diff --git a/src/gnc/gtk-icons/gtk-redo.png b/src/gnc/gtk-icons/gtk-redo.png deleted file mode 100644 index f0ad66455641289a49d0fe92340f69ea87c911b0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1608 zcmV-O2DkZ%P)X#0P747f5CjQU5l96>fwGB+ z8{?W7ToN^dG5#^e#26EQV8S04{unTf$PY{~5=QYed^rPEp7 zn|JT=M;B+N)0QQ{lYF_eymP+qeD}=U3ueZ(V(nIA!S&=bGX$M((G(7a7`Q-m1z#~k&yk@g?Q(*emhqifNz2O1?pxmg$ORF~dZW%vk!^0nWH{Ean z%#5?yMm)cCqjksR`WGJl$ook!Z0a{m004A5XYhCG0M;#h-Kv}MKu~D(RWNK?SCV_h zN`ql@5`ZU!MstWz!;Gn8eUp`fD*zzjcA=$rAJ)!&(d)M=m+bxh&BHl&YD=1pjo5@lJrLn>e5S6J6O8gU@?K1#0}OaO~_}clY7< z&nd}EA|bo;ss#kYrVtu^;4>3RGWs#8m*A)v0hD}pw)KD{N!SZ`+pZ0dUXONLSP@Egl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m1g~t7u>3a)!l3|Su^4J=YmrK&NJb$xz$zrbWVpu1!M5s+BC|>@< z`|o3~6q6J8M@L7!>*5HMR;OZ(6AVEdP89sg)1P%o486h@NB3rLxxyJl=50FaYXGL(c2;c^PY~5?ll=Lue1Y60BJ&) z5Gv?}z5`tcUr8jAt$;1_Sdnm8nml<*aL=AS30knJGKo=<>5o87ridw$B(8Z&L699q zJB8d5!EwrpNyH3FdXvg+A)D3ocvXCq9FujUBNYdT;gYv$=%GSE-zvF8Yh8~A39|d3 z>|VzRaYDcwD3M4=bLPxRwzjs$s;a7Fsz@psB75-uw*opcB!W!<8D`Rbi_QfA5P4fS zs8O}bQoiJN?%X-DapT5ey0%cc*#w=C@hoJriVL{}0T)V3)LE@fk2>8f(*wfQvcXoE#-n%9+!u$tWR^toqOJZ3700000Yz| diff --git a/src/gnc/icons/oxygen/48x48/actions/document-save.png b/src/gnc/icons/oxygen/48x48/actions/document-save.png deleted file mode 100644 index cc380a03aee7f4add3e6b6b78338ff6e031c9688..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2122 zcmV-Q2(|Z#P)h57?Ly)NPo%(m3 zb3awpWB5B=FDXq^mKKTrE8$i-0>PVayz&0p_iIlKC;bJ+@Z;NvE<*+zwmgw-B#Cju0cQxFE1aKzWuEhtQ@%+=J(A~yB@C*AtQex zRvDIvw3{z&8icqZ@cV8bTKikj?+qZIqQOvq_szFYG8wD9aMX=3*lD*RiiR+ZyRZy5 zjsVkI`2_rA!1}~ghSm{dOBLoQ%uhrpCPWMjc%J|wK(pC|<-^O+?d)>hGLwgE`ugaL zuj`=KwkYM7l^J0z_Ro`d$~q}KnUCMPluy7ij^h}9xx68!JTkX$WWhiKJpSN4P@8Og z*lMX29C&5Sq0PuBiK%Ww0!s*BH37sF4jnw0uS;%yPF#p2t@Zy*l-FlS=|bJQjvbds zW-Q>XZU931BeF#xz?$K>^9-QaqT}62PicLbT8Et3$0w^F;A%XsUtaYK9L(Y_)*>n9qO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;KP(wpT z;M1p*E1jJmzXt&SV9^W&3lLUCA^Iq-KD!MGh(w;j^75~6w(%^SsyGFHzaRguXGBd- zJ^Ay(`HSz;@dA^VM=BS?Ra_< z#_j|@#}lgy;93rIf$aO_I^^>Q2M16QsK_Rd8+I!4*{7d>h~oah?l_URGZU-4m*DI_>LP7gd?p11dlQ-Z24)Ko;aEHdPL~s^swy+& z$HyPQ<;z!KeSQ7Ge=$FG5&@~F581HLOpT^UhefaUGF}Qy1tBh+gc>`fZ zfCC3i;=Ls{hEcg2rP8?iF7RQjzkh!eZr=Qc?@9Lc^`(1zd-G1@e(v~mZf9rbEnG>L z=qB9G4YzX0Effq^!rgl#aP8`K?n>ba<{Xo^D!^DN*D-S#Y9g}&$rkdWUDDc$CAL3 cG!!=0zaYt|Z#+<6GXMYp07*qoM6N<$g0G+4JOBUy diff --git a/src/gnc/icons/oxygen/48x48/actions/edit-redo.png b/src/gnc/icons/oxygen/48x48/actions/edit-redo.png deleted file mode 100644 index 8de333fe8cefce891058e89c3c549173e87e284f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3383 zcmV-74ao9|P)tT&B0ck0c2F#m5QZ|+BrY(4b) z|G5Bx=p+03KPOmxjfh4BfX!{cf^{u7BWWd(kPhNetr!FoTphqu3PCtaehHK1Q+RuE zzY!7;CZ&{@%cz*S7v85#6_~^Rw{%b2yZHe#bxF`ognI64maJ#Bg-xXA#34|FrStpIf*>);`+#YozhSNY@5y+u$fpyC?8LhQdw+$8bYS z_-_@DHk~OQew+x@o8APnY@Dmkpv~?CFXcTjyr*p)Ydm(-%JtTUz73eDp8P=0IGJhE zI2tdHp*`M>5vP~pB93`Ai+OL(fV=ENYk&mkvI5zMn_Dec?(J*oYhF8a6DHkBEH#2G zOjqYH>&^izAW0fb+p>_5F=P{6P&$Ahx^pY zNMB|LRz1+N3l*{JwvFL+7)(MpTrUM=p~vaRPtW}vhYD}tN^wZS4y&|>6QyySDxbj0 zco&9J{m9svh6bP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zT4571=JjXVgPvrw{-23)Ej)@87zDj8TjGiy;uFOwRt&s&`vjw&4bS#81nT99oeK<; zWeOzz)^1LfV>j>GyrgwwZ(Tp3LWC52Q3W&%ak0GJ4@ znZW=*`{D76;BE;e&I|ZvDxBJxTlNl^r2g7ov#GZ~lesaW_7#pPBGM7G5s0QRQ`OgI z7s7h7CZYrcOCoIq2u1{9ILv=;AG<2l@H6d3h6LgGj=8J72QE&zD>(l8)MVbCm+ty> zUj*g}qOcJpc@iQl`4Moq4xvTVpf1GGw8I$_Va-~?Cb1NFlVf+xvLkGKylXA)`j7Rr zYytiP>yUKfxuZubYtiMdO164dBmg7f3#!9|0&@@4o>Drh6~PN5QLjWK5f;nIksW8b zI_qO5pMUSaBTIiH;lxO+xNF-jI4g2`tT4mGqz#yXtX)=S3K3YfdxN9Os2~1g21=al_(~Ee9EmTz`Q^R{XSy98Dq~v#~q77B5U5=TBrua3VLy zI#Bq@);E_4ew}_(-~Ln+94RPZMz*OL`?pUru0xE#FLOlL{};HP`CnwdE+E#4ROJ8w N002ovPDHLkV1fjvU2OmW diff --git a/src/gnc/icons/oxygen/48x48/actions/edit-undo.png b/src/gnc/icons/oxygen/48x48/actions/edit-undo.png deleted file mode 100644 index 5071aa1dd3c41f3c1ba760256d3e60efc1b46acc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3440 zcmV-$4Uh7PP)?y6R8y&VK>o8#FaM{7J z6UvZOtOQ(yN=%BB9hb_9Q#o8Vl!4eJ1y~_C2~LqRF~P>dfj}URgM(rWLLf^ktXpf{ zJA0qAGt?9TVS_quzxdx@Fx|5*;+Lhb*r>sp*_ z=ThP37CTPM66rQAByuF{(g__-_3Ch>mx5EhOWw6}5^s^Ncn0>qdi^SGQL`&-iO z*x>n{>W$8yu$|S{0#!LB!=jMCClIQr{j^8vdG6<1enh>&U(;e!hoKXwY26ww>6-f#~yKLX~J#6U~)Ml`f6gX?D@T(U?APXJ(;NLgZ-SV4sf z#fdy7h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87Kl#Qac=UuBm#Rm_kX8I!^ z$bxUh(NMjf8u}evkGEjqYM^e85)rH-qf_p(G};f`kLdHDubO-0V_5KsFv`kA%3kxd#F_149jYpVXQ$ zcnv0CjRV;vU@8tn*Quj1vWGkVU+w-Qf55(ZNqJ0qi15i9h>Wb&u<&$-m{zIR(#vSv zSOZGubB(lcfrg+DNfIvl;qim8?M`=;{{yyXV&6_*h;5PZPr*Qbd7WKPVI>L7N(!%@ wKtW3iRGJ*|dV#Ja&nuJTHSk#m#b+G<2gFc?M!o!Ay8r+H07*qoM6N<$f?{M8GXMYp diff --git a/src/gnc/icons/oxygen/48x48/actions/list-add.png b/src/gnc/icons/oxygen/48x48/actions/list-add.png deleted file mode 100644 index af5b56e3c4fbd6d91eb3fa6e337ddb89c5843854..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2658 zcmV-o3Z3hJMY0I>9n3i^&>GUy= z&gQ-z2CU*k(ayMdNzH0eh6=lzlNHf zgCR!A7;Ii~J8oLO6_rxu!~K)*-22llJBM)v8eb{pzrOyPhabD;N1JY0b}QDj_oHf- zz*=|+;0)HbUyHu>0epVd{TuG-dEn3w_CD0td;-C3)|C5S7+7*+b$Ie9R=2Ik>dHF6 z5}b94dJpJwdt@C36i)n4=WiJwln(ji^{&x8d8#*=~+}^tbTUOqNn^tZ{9W#hA zheVR%LN@Xw`fy_ABOIF8i^1uA_+WD1rkB3>{(+_ju_UI)5>6B(^#n~P-~>b#UMpsAyE)wlNG`+ynod9!0+GgmQ0793wU@Vm6A(NI zfH+(g7SIkU4~Pg-bs@S$3|RO#oD$HOX}$$uK`yMQWl}duoV|<-*&>MHpxrA?;F*2T zlwLXd${o8#c5R%RpI8eECNQx84Dtvh?GdR%}1K<;E|)vjaQQ%My6%ji z8R%{A#njxSUeJF)Jy*no0CGWn6<`pA1unRda~2?kIg2eIPO>?qQ|_?V-Jv}X%K|tD zFl(TbYk<(f%MsTXFgoChU(T87tc;IyH^xv!H>cGmjmFT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(S%1cnHTakAhFtc<`BxL`^)EXlUYDwG|A zKoum84B{Xr7=?-5Q0fNC$yQ)%5k2te*Wp{^un+L60<5X-xlTanK<7MIB0004m14CM zM-{Ew&_35w6^FWK0zs%|Ao5iXD{34C3WVwiQ0jy6osxTjiXxtd2Rm28wY|`nu6`n5 z3K3f%e>@cC!dW(0nqOikeP+=_b)RUvq(vwjX#oOXWxoiOJWT9`{M%~NvI0feOUD~^hj<^x zJE0)(`qV5qF}NsXwE$rJ8L`d1@FI{`^F#b$?oONfy&8eGe}pT}f~#Y2D}Vq`=RhMi z!O+IFa%#ynwPMpwZkxuEg9(+*7;Hhh>RDa+07iZW-?#^)_zVH1boCE410)x9`2PXB zT47&1%+Es32F%G7{CaS6;oS6mZTcfSQ%#5nAH5N=!tF9E|- zkw3J6#7aS=Zew)y!5j17xFeu7y+UX~lJz(SOT&yLM{4Y#kWC0H^7=U&;vMkh-@z@< zz?RA6Kgw53hK38&0Zk6H-3(t?442fy9KD!O);Z9a{E6uqb5hXaqXF3b1l+$CUIqq% zG40gwaK0l;i?D$l&;T?a3$s?il25_1Mvx!LDB>DZeQT0}tzI)R09#*x#~*@MW!w*p z0tMY-(cynfnS`m~Y9aMNqYF)+gA*3P8MEQkCUtAFNgaVEeUNI6{t@_}9kB5?@VfNZ zZcTbj6E9cS1q}{gz~tFToRHOGYSVUZhPn=DZG%Pwi~xd87wXepR~**;vcgBCZA%ff;6my{&$H4ae|K){|ikF!lF_L RP}2Ya002ovPDHLkV1o2x>zM!m diff --git a/src/gnc/icons/oxygen/index.theme b/src/gnc/icons/oxygen/index.theme deleted file mode 100644 index efb2ee2b90..0000000000 --- a/src/gnc/icons/oxygen/index.theme +++ /dev/null @@ -1,35 +0,0 @@ -[Icon Theme] -Name=Oxygen - -Comment=Oxygen Team - -DisplayDepth=32 - -Inherits=hicolor - -Example=folder - -LinkOverlay=link -LockOverlay=lockoverlay -ShareOverlay=share -ZipOverlay=zip - -DesktopDefault=48 -DesktopSizes=16,22,32,48,64,128,256 -ToolbarDefault=22 -ToolbarSizes=16,22,32,48 -MainToolbarDefault=22 -MainToolbarSizes=16,22,32,48 -SmallDefault=16 -SmallSizes=16,22,32,48 -PanelDefault=32 -PanelSizes=16,22,32,48,64,128,256 -DialogDefault=32 -DialogSizes=16,22,32,48,64,128,256 - -Directories=48x48/actions - -[48x48/actions] -Size=48 -Context=Actions -Type=Threshold \ No newline at end of file diff --git a/src/gnc/main.cpp b/src/gnc/main.cpp deleted file mode 100644 index 7aab5fd3da..0000000000 --- a/src/gnc/main.cpp +++ /dev/null @@ -1,221 +0,0 @@ -/* - * main.cpp -- The program entry point for cutecash - * - * Copyright (C) 2006 Chris Shoemaker - * Copyright (C) 2010 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include "engine/guid.hpp" -extern "C" -{ -#include "gnc-module/gnc-module.h" -#include "core-utils/gnc-path.h" -#include "core-utils/binreloc.h" - /* #include "gnc-version.h" */ -#include "engine/gnc-engine.h" -#include "core-utils/gnc-filepath-utils.h" -#include "engine/gnc-hooks.h" -#include "engine/gnc-commodity.h" -#include "core-utils/gnc-prefs.h" -#include "engine/gnc-session.h" -#include "engine/engine-helpers.h" -#include "engine/gnc-engine.h" -#include "app-utils/gnc-ui-util.h" // for gnc_ui_util_init() -#include "app-utils/gnc-exp-parser.h" // for gnc_exp_parser_init() -#include "swig-runtime.h" - -#include "backend/xml/gnc-backend-xml.h" -#ifdef WITH_SQL -# include "backend/dbi/gnc-backend-dbi.h" -#endif -} // END extern C - -#ifdef HAVE_GETTEXT -# include -# include -#endif - -// Glibmm includes -#include -#include "gncmm/wrap_init.hpp" - -// Qt includes -#include -#include "mainwindow.hpp" - -namespace gnc -{ - -#define APP_GNUCASH "/apps/gnucash" - -/* GNUCASH_SCM is defined whenever we're building from an svn/svk/git/bzr tree */ -#ifdef GNUCASH_SCM -static int is_development_version = TRUE; -#else -static int is_development_version = FALSE; -#endif - -static gchar **log_flags = NULL; -static gchar *log_to_filename = NULL; - -static void -gnc_log_init() -{ - if (log_to_filename != NULL) - { - qof_log_init_filename_special(log_to_filename); - } - else - { - /* initialize logging to our file. */ - gchar *tracefilename; - tracefilename = g_build_filename(g_get_tmp_dir(), "gnucash.trace", - (gchar *)NULL); - qof_log_init_filename(tracefilename); - g_free(tracefilename); - } - - // set a reasonable default. - qof_log_set_default(QOF_LOG_WARNING); - - gnc_log_default(); - - if (gnc_prefs_is_debugging_enabled()) - { - qof_log_set_level("", QOF_LOG_INFO); - qof_log_set_level("qof", QOF_LOG_INFO); - qof_log_set_level("gnc", QOF_LOG_INFO); - } - - { - gchar *log_config_filename; - log_config_filename = gnc_build_dotgnucash_path("log.conf"); - if (g_file_test(log_config_filename, G_FILE_TEST_EXISTS)) - qof_log_parse_log_config(log_config_filename); - g_free(log_config_filename); - } - - if (log_flags != NULL) - { - int i = 0; - for (; log_flags[i] != NULL; i++) - { - QofLogLevel level; - gchar **parts = NULL; - - gchar *log_opt = log_flags[i]; - parts = g_strsplit(log_opt, "=", 2); - if (parts == NULL || parts[0] == NULL || parts[1] == NULL) - { - g_warning("string [%s] not parseable", log_opt); - continue; - } - - level = qof_log_level_from_string(parts[1]); - qof_log_set_level(parts[0], level); - g_strfreev(parts); - } - } -} - -} // END namespace gnc - -int -main(int argc, char ** argv) -{ -#if !defined(G_THREADS_ENABLED) || defined(G_THREADS_IMPL_NONE) -# error "No GLib thread implementation available!" -#endif - g_thread_init(NULL); - - QApplication app(argc, argv); - - // Binreloc is initialized by the Qt exe path lookup. - gnc_gbr_set_exe(QCoreApplication::applicationFilePath().toUtf8()); - -#ifdef HAVE_GETTEXT - { - gchar *localedir = gnc_path_get_localedir(); - /* setlocale(LC_ALL, ""); is already called by gtk_set_locale() - via gtk_init(). */ - bindtextdomain(GETTEXT_PACKAGE, localedir); - textdomain(GETTEXT_PACKAGE); - bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); - g_free(localedir); - } -#endif - - qof_log_init(); - qof_log_set_default(QOF_LOG_INFO); - - gnc::gnc_log_init(); - - qof_init(); - gnc_module_system_init(); - gnc_engine_init_static(argc, argv); - - // Initialize glibmm - Glib::init(); - gnc::wrap_init(); - - // Call the statically-linked versions of the backend init - // functions - gnc_module_init_backend_xml(); -#ifdef WITH_SQL - gnc_module_init_backend_dbi(); -#endif - gnc_ui_util_init(); - gnc_exp_parser_init(); - - int r; - { - // From here on the new C++ code - gnc::MainWindow mainWin; - mainWin.show(); - - /* set stylesheet */ - QFile styleSheetFile(":/qss-default"); - styleSheetFile.open(QFile::ReadOnly); - QString styleSheetName = QLatin1String(styleSheetFile.readAll()); - app.setStyleSheet(styleSheetName); - - // Go into the main qt event loop - r = app.exec(); - - // Destruction of the MainWindow will trigger all the C++ - // destructors - } - - // Shutdown of the C side after all C++ was destructed already. - gnc_exp_parser_shutdown(); -#ifdef WITH_SQL - gnc_module_finalize_backend_dbi(); -#endif - qof_close(); - return r; - -} diff --git a/src/gnc/mainwindow-file.cpp b/src/gnc/mainwindow-file.cpp deleted file mode 100644 index 432f0c6932..0000000000 --- a/src/gnc/mainwindow-file.cpp +++ /dev/null @@ -1,763 +0,0 @@ -/* - * mainwindow-file.cpp - * Copyright (C) 2010 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "config.h" -#include "mainwindow.hpp" -#include "ui_mainwindow.h" - -// gnucash includes -#include -extern "C" -{ -#include "qof.h" -#include "engine/gnc-hooks.h" -#include "core-utils/gnc-uri-utils.h" -#include "engine/Account.h" -#include "engine/TransLog.h" -} - -#include "gncmm/Account.hpp" -#include "gnc/AccountItemModel.hpp" -#include "gncmm/Book.hpp" -#include "gncmm/Numeric.hpp" -#include "gncmm/Split.hpp" -#include "gnc/SplitListModel.hpp" -#include "gnc/RecentFileMenu.hpp" - -/* Temp solution for accounts list */ -#include "gnc/fpo/ViewletView.hpp" - -#include "gnc/Cmd.hpp" - -namespace gnc -{ - -inline QString errorToString(QofBackendError err) -{ - return errorToStringPair(err).first; -} -inline QString errorToDescription(QofBackendError err) -{ - return errorToStringPair(err).second; -} - -/* This static indicates the debugging module that this .o belongs to. */ -static QofLogModule log_module = GNC_MOD_GUI; -static const char* PROPERTY_TAB_PREVIOUSPOS = "tab_previouspos"; -static gint save_in_progress = 0; - -// //////////////////////////////////////////////////////////// - -bool MainWindow::show_session_error (QWidget *parent, - ::QofBackendError io_error, - const QString& filename, - GNCFileDialogType type) -{ - bool should_abort = true; - QString fmt; - - switch (io_error) - { - case ERR_BACKEND_NO_ERR: - should_abort = FALSE; - break; - - case ERR_BACKEND_NO_HANDLER: - QMessageBox::critical(parent, tr("Error"), - tr("No suitable backend was found for %1.").arg(filename)); - break; - - case ERR_BACKEND_NO_BACKEND: - QMessageBox::critical(parent, tr("Error"), - tr("The URL %1 is not supported by this version of GnuCash.").arg(filename)); - break; - - case ERR_BACKEND_BAD_URL: - QMessageBox::critical(parent, tr("Error"), - tr("Can't parse the URL %1.").arg(filename)); - break; - - case ERR_BACKEND_CANT_CONNECT: - QMessageBox::critical(parent, tr("Error"), - tr("Can't connect to %1. " - "The host, username or password were incorrect.").arg(filename)); - break; - - case ERR_BACKEND_CONN_LOST: - QMessageBox::critical(parent, tr("Error"), - tr("Can't connect to %1. " - "Connection was lost, unable to send data.").arg(filename)); - break; - - case ERR_BACKEND_TOO_NEW: - QMessageBox::critical(parent, tr("Error"), - tr("This file/URL appears to be from a newer version " - "of GnuCash. You must upgrade your version of GnuCash " - "to work with this data.")); - break; - - case ERR_BACKEND_NO_SUCH_DB: - if (QMessageBox::question(parent, tr("Create New File?"), - tr("The database %1 doesn't seem to exist. " - "Do you want to create it?").arg(filename), - QMessageBox::Ok | QMessageBox::Cancel) - == QMessageBox::Ok) - { - should_abort = false; - } - break; - - case ERR_BACKEND_LOCKED: - switch (type) - { - case GNC_FILE_DIALOG_OPEN: - default: - fmt = tr("GnuCash could not obtain the lock for %1. " - "That database may be in use by another user, " - "in which case you should not open the database. " - "Do you want to proceed with opening the database?"); - break; - - case GNC_FILE_DIALOG_IMPORT: - fmt = tr("GnuCash could not obtain the lock for %1. " - "That database may be in use by another user, " - "in which case you should not import the database. " - "Do you want to proceed with importing the database?"); - break; - - case GNC_FILE_DIALOG_SAVE: - fmt = tr("GnuCash could not obtain the lock for %1. " - "That database may be in use by another user, " - "in which case you should not save the database. " - "Do you want to proceed with saving the database?"); - break; - - case GNC_FILE_DIALOG_EXPORT: - fmt = tr("GnuCash could not obtain the lock for %1. " - "That database may be in use by another user, " - "in which case you should not export the database. " - "Do you want to proceed with exporting the database?"); - break; - } - - if (QMessageBox::question(parent, tr("Create New File?"), - tr("The database %1 doesn't seem to exist. " - "Do you want to create it?").arg(filename), - QMessageBox::Yes | QMessageBox::No, QMessageBox::No) - == QMessageBox::Yes) - { - should_abort = false; - } - break; - - case ERR_BACKEND_READONLY: - QMessageBox::critical(parent, tr("Error"), - tr("GnuCash could not write to %1. " - "That database may be on a read-only file system, " - "or you may not have write permission for the directory.").arg(filename)); - break; - - case ERR_BACKEND_DATA_CORRUPT: - QMessageBox::critical(parent, tr("Error"), - tr("The file/URL %1 " - "does not contain GnuCash data or the data is corrupt.").arg(filename)); - break; - - case ERR_BACKEND_SERVER_ERR: - QMessageBox::critical(parent, tr("Error"), - tr("The server at URL %1 " - "experienced an error or encountered bad or corrupt data.").arg(filename)); - break; - - case ERR_BACKEND_PERM: - QMessageBox::critical(parent, tr("Error"), - tr("You do not have permission to access %1.").arg(filename)); - break; - - case ERR_BACKEND_MISC: - QMessageBox::critical(parent, tr("Error"), - tr("An error occurred while processing %1.").arg(filename)); - break; - - - case ERR_FILEIO_FILE_BAD_READ: - if (QMessageBox::question(parent, tr("Continue?"), - tr("There was an error reading the file. " - "Do you want to continue?"), - QMessageBox::Ok | QMessageBox::Cancel) - == QMessageBox::Ok) - { - should_abort = false; - } - break; - - case ERR_FILEIO_PARSE_ERROR: - QMessageBox::critical(parent, tr("Error"), - tr("There was an error parsing the file %1.").arg(filename)); - break; - - case ERR_FILEIO_FILE_EMPTY: - QMessageBox::critical(parent, tr("Error"), - tr("The file %1 is empty.").arg(filename)); - break; - - case ERR_FILEIO_FILE_NOT_FOUND: - if (type == GNC_FILE_DIALOG_SAVE) - { - should_abort = false; - } - else - { - QMessageBox::critical(parent, tr("Error"), - tr("The file %1 could not be found.").arg(filename)); - } - break; - - case ERR_FILEIO_FILE_TOO_OLD: - if (QMessageBox::question(parent, tr("Continue?"), - tr("This file is from an older version of GnuCash. " - "Do you want to continue?"), - QMessageBox::Ok | QMessageBox::Cancel) - == QMessageBox::Ok) - { - should_abort = false; - } - break; - - case ERR_FILEIO_UNKNOWN_FILE_TYPE: - QMessageBox::critical(parent, tr("Error"), - tr("The file type of file %1 is unknown.").arg(filename)); - break; - - case ERR_FILEIO_BACKUP_ERROR: - QMessageBox::critical(parent, tr("Error"), - tr("Could not make a backup of the file %1").arg(filename)); - break; - - case ERR_FILEIO_WRITE_ERROR: - QMessageBox::critical(parent, tr("Error"), - tr("Could not write to file %1. Check that you have " - "permission to write to this file and that " - "there is sufficient space to create it.").arg(filename)); - break; - - case ERR_FILEIO_FILE_EACCES: - QMessageBox::critical(parent, tr("Error"), - tr("No read permission to read from file %1.").arg(filename)); - break; - - case ERR_SQL_DB_TOO_OLD: - if (QMessageBox::question(parent, tr("Upgrade Database?"), - tr("This database is from an older version of GnuCash. " - "Do you want to want to upgrade the database " - "to the current version?"), - QMessageBox::Yes | QMessageBox::No, QMessageBox::No) - == QMessageBox::Yes) - { - should_abort = false; - } - break; - - case ERR_SQL_DB_BUSY: - QMessageBox::critical(parent, tr("Error"), - tr("The SQL database is in use by other users, " - "and the upgrade cannot be performed until they logoff. " - "If there are currently no other users, consult the " - "documentation to learn how to clear out dangling login " - "sessions.")); - break; - - default: - PERR("FIXME: Unhandled error %d", io_error); - QMessageBox::critical(parent, tr("Error"), - tr("An unknown I/O error (%1) occurred.").arg(int(io_error))); - break; - } - - return should_abort; -} - -// //////////////////////////////////////////////////////////// - - -static void -gnc_book_opened (Session& sess) -{ - gnc_hook_run(HOOK_BOOK_OPENED, sess.gobj()); -} - - -namespace -{ -/** This is a workaround function object so that we can obtain a - * QofPercentageFunc without extra boost::bind usage; obviously due to - * the static member variable it will not work if multiple instances - * are in use simultaneously */ -class progress_functor -{ -public: - progress_functor(QProgressBar *progressBar) - { - m_progressBar = progressBar; - } - ~progress_functor() - { - m_progressBar = NULL; - } - static void static_func(const char *message, double percent) - { - assert(m_progressBar); - m_progressBar->setValue(int(percent)); - // Give the Qt event loop some time - qApp->processEvents(); - } -private: - static QProgressBar *m_progressBar; -}; -QProgressBar *progress_functor::m_progressBar = NULL; - -} // END namespace anonymous - - -void MainWindow::loadFile(const QString &fileName) -{ - if (fileName.isEmpty()) - return; - - // copied from gnc_post_file_open, gnome-utils/gnc-file.c - - QString newfile_qstring = - g2q(gchar_to_ustring(gnc_uri_normalize_uri(fileName.toUtf8(), TRUE))); - if (newfile_qstring.isEmpty()) - { - show_session_error (this, ERR_FILEIO_FILE_NOT_FOUND, fileName, - GNC_FILE_DIALOG_OPEN); - return; - } - QByteArray newfile = newfile_qstring.toUtf8(); - - /* disable events while moving over to the new set of accounts; - * the mass deletion of accounts and transactions during - * switchover would otherwise cause excessive redraws. */ - qof_event_suspend (); - - // Change the mouse to a busy cusor - QApplication::setOverrideCursor(Qt::WaitCursor); - - /* -------------- BEGIN CORE SESSION CODE ------------- */ - /* -- this code is almost identical in FileOpen and FileSaveAs -- */ - gnc_hook_run(HOOK_BOOK_CLOSED, m_session.gobj()); - qof_session_destroy(m_session.gobj()); - m_session.reset(); - - /* load the accounts from the users datafile */ - /* but first, check to make sure we've got a session going. */ - QofSession *new_session = qof_session_new (); - - bool we_are_in_error = false; - qof_session_begin (new_session, newfile, FALSE, FALSE, FALSE); - QofBackendError io_err = qof_session_get_error (new_session); - /* if file appears to be locked, ask the user ... */ - if (ERR_BACKEND_LOCKED == io_err || ERR_BACKEND_READONLY == io_err) - { - QString fmt1 = tr("GnuCash could not obtain the lock for %1. ").arg(fileName); - QString fmt2 = - ((ERR_BACKEND_LOCKED == io_err) - ? tr("That database may be in use by another user, " - "in which case you should not open the database. " - "What would you like to do?") - : tr("That database may be on a read-only file system, " - "or you may not have write permission for the directory. " - "If you proceed you may not be able to save any changes. " - "What would you like to do?")); - QMessageBox msgBox(this); - msgBox.setWindowTitle(tr("Could not obtain file lock")); - msgBox.setText(fmt1 + fmt2); - QPushButton *openAnyway = msgBox.addButton(tr("&Open Anyway"), QMessageBox::ActionRole); - QPushButton *createNewFile = msgBox.addButton(tr("&Create New File"), QMessageBox::ActionRole); - QPushButton *close = msgBox.addButton(QMessageBox::Close); - msgBox.exec(); - if (msgBox.clickedButton() == openAnyway) - { - /* user told us to ignore locks. So ignore them. */ - qof_session_begin (new_session, newfile, TRUE, FALSE, FALSE); - } - else if (msgBox.clickedButton() == createNewFile) - { - /* Can't use the given file, so just create a new - * database so that the user will gobj a window that - * they can click "Exit" on. - */ - newFile(); - return; - } - else - { - qApp->quit(); - return; - } - } - - /* if the database doesn't exist, ask the user ... */ - else if ((ERR_BACKEND_NO_SUCH_DB == io_err) || - (ERR_SQL_DB_TOO_OLD == io_err)) - { - if (false == show_session_error (this, io_err, newfile, GNC_FILE_DIALOG_OPEN)) - { - /* user told us to create a new database. Do it. */ - qof_session_begin (new_session, newfile, FALSE, TRUE, FALSE); - } - } - - /* Check for errors again, since above may have cleared the lock. - * If its still locked, still, doesn't exist, still too old, then - * don't bother with the message, just die. */ - io_err = qof_session_get_error (new_session); - if ((ERR_BACKEND_LOCKED == io_err) || - (ERR_BACKEND_READONLY == io_err) || - (ERR_BACKEND_NO_SUCH_DB == io_err) || - (ERR_SQL_DB_TOO_OLD == io_err)) - { - we_are_in_error = true; - } - else - { - we_are_in_error = show_session_error (this, io_err, newfile, GNC_FILE_DIALOG_OPEN); - } - - if (!we_are_in_error) - { - xaccLogDisable(); - - { - // Set up a progress bar in the statusBar() - QProgressBar progressBar; - progressBar.setMinimum(0); - progressBar.setMaximum(100); - statusBar()->showMessage(tr("Loading user data...")); - statusBar()->addPermanentWidget(&progressBar); - progressBar.show(); - // This local progress_functor is a workaround on how to - // pass the suitable function pointer to session_load - - // not very nice because of its static member, but it does - // the trick for now. - progress_functor functor(&progressBar); - - // Do the loading. - qof_session_load (new_session, &progress_functor::static_func); - - // Remove the progress bar again from the status bar. - statusBar()->removeWidget(&progressBar); - } - xaccLogEnable(); - - /* check for i/o error, put up appropriate error dialog */ - io_err = qof_session_get_error (new_session); - - we_are_in_error = show_session_error(this, io_err, newfile, GNC_FILE_DIALOG_OPEN); - - ::Account* new_root_account = gnc_book_get_root_account (qof_session_get_book (new_session)); - if (we_are_in_error) new_root_account = NULL; - - /* Umm, came up empty-handed, but no error: - * The backend forgot to set an error. So make one up. */ - if (!we_are_in_error && !new_root_account) - { - we_are_in_error = show_session_error (this, ERR_BACKEND_MISC, newfile, - GNC_FILE_DIALOG_OPEN); - } - } - - QApplication::restoreOverrideCursor(); - - /* going down -- abandon ship */ - if (we_are_in_error) - { - xaccLogDisable(); - qof_session_destroy (new_session); - xaccLogEnable(); - - /* well, no matter what, I think it's a good idea to have a root - * account around. For example, early in the gnucash startup - * sequence, the user opens a file; if this open fails for any - * reason, we don't want to leave them high & dry without a root - * account, because if the user continues, then bad things will - * happen. */ - new_session = qof_session_new (); - m_session.reset(new_session); - - qof_event_resume (); - return; - } - - /* if we got to here, then we've successfully gotten a new session */ - /* close up the old file session (if any) */ - m_session.reset(new_session); - - qof_event_resume (); - - /* Call this after re-enabling events. */ - gnc_book_opened (m_session); - - // //////////////////////////////////////////////////////////// - // Some display about this file - - Glib::RefPtr root (m_session.get_book()->get_root_account()); - if (root) - { - m_accountListModel = new AccountListModel(root, this); - ui->tableView->setModel(m_accountListModel); - - m_accountTreeModel = new AccountTreeModel(root, this); - ui->treeView->setModel(m_accountTreeModel); - /* Load the tree in combo boxes of dashboard */ - m_dboard->loadAccountsTreeComboBox(m_accountListModel); - m_dboard->fpoWidget->defaultViewlet->loadAccountsTreeComboBox(m_accountListModel); - m_dboard->fpoWidget->leftViewlet->loadAccountsTreeComboBox(m_accountListModel); - m_dboard->fpoWidget->rightViewlet->loadAccountsTreeComboBox(m_accountListModel); - - ui->treeViewTab->setProperty(PROPERTY_TAB_PREVIOUSPOS, ui->tabWidget->currentIndex()); - ui->tabWidget->setCurrentWidget(m_dboard); - } - else - { - //ui->labelMain->setText(tr("No root account")); - } - - // //////////////////////////////////////////////////////////// - - setCurrentFile(fileName); - statusBar()->showMessage(tr("File loaded"), 5000); -} - - -// //////////////////////////////////////////////////////////// - -bool MainWindow::saveFileAs(const QString &fileName) -{ - if (gnc_uri_is_file_uri(fileName.toUtf8())) - { - QFile file(g2q(gchar_to_ustring(gnc_uri_get_path(fileName.toUtf8())))); - if (!file.open(QFile::WriteOnly)) - { - QMessageBox::warning(this, tr("Application"), - tr("Cannot write file %1:\n%2.") - .arg(fileName) - .arg(file.errorString())); - return false; - } - file.close(); - } - - /* Check to see if the user specified the same file as the current - * file. If so, then just do a simple save, instead of a full save as */ - /* FIXME Check if it is ok to have a password in the uri here */ - QString newfile_qstring = - g2q(gchar_to_ustring(gnc_uri_normalize_uri ( fileName.toUtf8(), TRUE ))); - if (newfile_qstring.isEmpty()) - { - show_session_error (this, ERR_FILEIO_FILE_NOT_FOUND, fileName, - GNC_FILE_DIALOG_SAVE); - return false; - } - QByteArray newfile = newfile_qstring.toUtf8(); - - QofSession *session = m_session.gobj(); - if (m_session.get_url() == fileName) - { - return saveFile(); - } - - /* Make sure all of the data from the old file is loaded */ - qof_session_ensure_all_data_loaded(session); - - /* -- this session code is NOT identical in FileOpen and FileSaveAs -- */ - - save_in_progress++; - QofSession *new_session = qof_session_new (); - qof_session_begin (new_session, newfile, FALSE, FALSE, FALSE); - - QofBackendError io_err = qof_session_get_error (new_session); - - /* if file appears to be locked, ask the user ... */ - if (ERR_BACKEND_LOCKED == io_err || ERR_BACKEND_READONLY == io_err) - { - if (false == show_session_error (this, io_err, newfile, GNC_FILE_DIALOG_SAVE)) - { - /* user told us to ignore locks. So ignore them. */ - qof_session_begin (new_session, newfile, TRUE, FALSE, FALSE); - } - } - - /* if the database doesn't exist, ask the user ... */ - else if ((ERR_FILEIO_FILE_NOT_FOUND == io_err) || - (ERR_BACKEND_NO_SUCH_DB == io_err) || - (ERR_SQL_DB_TOO_OLD == io_err)) - { - if (false == show_session_error (this, io_err, newfile, GNC_FILE_DIALOG_SAVE)) - { - /* user told us to create a new database. Do it. */ - qof_session_begin (new_session, newfile, FALSE, TRUE, FALSE); - } - } - - /* check again for session errors (since above dialog may have - * cleared a file lock & moved things forward some more) - * This time, errors will be fatal. - */ - io_err = qof_session_get_error (new_session); - if (ERR_BACKEND_NO_ERR != io_err) - { - show_session_error (this, io_err, newfile, GNC_FILE_DIALOG_SAVE); - xaccLogDisable(); - qof_session_destroy (new_session); - xaccLogEnable(); - save_in_progress--; - return false; - } - - /* oops ... file already exists ... ask user what to do... */ - if (false) //qof_session_save_may_clobber_data (new_session)) - // FIXME: Need to copy the other implementation from r19798 in - // gnc-file.c for overwrite-on-existing-file. - { - if (QMessageBox::question(this, tr("File Exists"), - tr("The file %1 already exists. " - "Are you sure you want to overwrite it?").arg(fileName), - QMessageBox::Yes | QMessageBox::No) - != QMessageBox::Yes) - { - /* if user says cancel, we should break out */ - xaccLogDisable(); - qof_session_destroy (new_session); - xaccLogEnable(); - save_in_progress--; - return false; - } - - /* Whoa-ok. Blow away the previous file. */ - } - - - /* Prevent race condition between swapping the contents of the two - * sessions, and actually installing the new session as the current - * one. Any event callbacks that occur in this interval will have - * problems if they check for the current book. */ - qof_event_suspend(); - - /* if we got to here, then we've successfully gotten a new session */ - /* close up the old file session (if any) */ - qof_session_swap_data (session, new_session); - qof_session_destroy(m_session.gobj()); - m_session.reset(); - session = NULL; - - /* XXX At this point, we should really mark the data in the new session - * as being 'dirty', since we haven't saved it at all under the new - * session. But I'm lazy... - */ - m_session.reset(new_session); - - qof_event_resume(); - - /* --------------- END CORE SESSION CODE -------------- */ - - bool r = saveFile(); - - save_in_progress--; - setCurrentFile(fileName); - return r; -} - -static bool been_here_before = false; - -bool MainWindow::saveFile() -{ - /* hack alert -- Somehow make sure all in-progress edits gobj committed! */ - - /* If we don't have a filename/path to save to gobj one. */ - if (m_session.get_url().isEmpty()) - return on_actionSave_as_triggered(); - - /* use the current session to save to file */ - save_in_progress++; - QApplication::setOverrideCursor(Qt::WaitCursor); - - { - // Set up a progress bar in the statusBar() - QProgressBar progressBar; - progressBar.setMinimum(0); - progressBar.setMaximum(100); - statusBar()->showMessage(tr("Saving user data...")); - statusBar()->addPermanentWidget(&progressBar); - progressBar.show(); - // A local progress_functor to pass the suitable function - // pointer to session_load - progress_functor functor(&progressBar); - - // The actual saving - qof_session_save (m_session.gobj(), &progress_functor::static_func); - - // Remove the progress bar again from the status bar. - statusBar()->removeWidget(&progressBar); - } - - // And saving is finished - QApplication::restoreOverrideCursor(); - save_in_progress--; - - - /* Make sure everything's OK - disk could be full, file could have - become read-only etc. */ - QofBackendError io_err = m_session.get_error (); - if (ERR_BACKEND_NO_ERR != io_err) - { - show_session_error (this, io_err, m_session.get_url(), GNC_FILE_DIALOG_SAVE); - - if (been_here_before) - return true; - been_here_before = true; - on_actionSave_as_triggered(); - /* been_here prevents infinite recursion */ - been_here_before = false; - return true; - } - - xaccReopenLog(); - gnc_hook_run(HOOK_BOOK_SAVED, m_session.gobj()); - - documentCleanStateChanged(true); - statusBar()->showMessage(tr("File saved"), 5000); - return true; -} - -} // END namespace gnc diff --git a/src/gnc/mainwindow.cpp b/src/gnc/mainwindow.cpp deleted file mode 100644 index d68749cfff..0000000000 --- a/src/gnc/mainwindow.cpp +++ /dev/null @@ -1,633 +0,0 @@ -/* - * mainwindow.cpp - * Copyright (C) 2010 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "config.h" -#include "mainwindow.hpp" -#include "ui_mainwindow.h" - -// gnucash includes -#include -extern "C" -{ -#include "qof.h" -#include "engine/gnc-hooks.h" -#include "core-utils/gnc-uri-utils.h" -#include "engine/Account.h" -#include "engine/TransLog.h" -} - -#include "gncmm/Account.hpp" -#include "gnc/AccountItemModel.hpp" -#include "gncmm/Book.hpp" -#include "gncmm/Numeric.hpp" -#include "gncmm/Split.hpp" -#include "gnc/SplitListModel.hpp" -#include "gnc/RecentFileMenu.hpp" -#include "gnc/SplitListView.hpp" - -namespace gnc -{ - -inline QString errorToString(QofBackendError err) -{ - return errorToStringPair(err).first; -} -inline QString errorToDescription(QofBackendError err) -{ - return errorToStringPair(err).second; -} - -/* This static indicates the debugging module that this .o belongs to. */ -static QofLogModule log_module = GNC_MOD_GUI; - -static const char* PROPERTY_TAB_LABEL = "tab_label"; -static const char* PROPERTY_TAB_POSITION = "tab_position"; -static const char* PROPERTY_TAB_ISCURRENT = "tab_iscurrent"; -static const char* PROPERTY_TAB_PREVIOUSPOS = "tab_previouspos"; - -// //////////////////////////////////////////////////////////// - -MainWindow::MainWindow() - : ui(new Ui::MainWindow) - , m_menuRecentFiles(new RecentFileMenu(tr("Open &Recent"))) - , m_undoStack(new QUndoStack(this)) -{ - ui->setupUi(this); - - createActions(); - createToolBars(); - createStatusBar(); - setIcons(); - - m_dboard = new Dashboard(this); - m_dboard->setWindowTitle("Dashboard"); - //m_dboard->show(); - ui->tabWidget->addTab(m_dboard, "Dashboard"); - - /* Properties used by QSettings */ - QCoreApplication::setOrganizationName("Gnucash"); - QCoreApplication::setOrganizationDomain("gnucash.org"); - QCoreApplication::setApplicationName("Cutecash"); - - readSettings(); - - connect(m_undoStack, SIGNAL(cleanChanged(bool)), - this, SLOT(documentCleanStateChanged(bool))); - connect(m_btnTransferFundsWidget, SIGNAL(toggled(bool)), - m_dboard, SLOT(transferFundsWidgetButtonToggled(bool))); - connect(this, SIGNAL(dashboardVisible(bool)), - m_dboard, SLOT(transferFundsWidgetButtonToggled(bool))); - - setWindowIcon(QIcon(":/pixmaps/gnucash-icon-64x64.png")); - - /* Check if the system supports freedesktop standards for icons, - * if not, then use the bundled icon set. */ - if (!QIcon::hasThemeIcon("document-open")) - { - QIcon::setThemeName("oxygen"); - } - - newFile(); - setUnifiedTitleAndToolBarOnMac(true); - - autoLoadRecentFile(); -} - -MainWindow::~MainWindow() -{ - if (m_session.gobj()) - { - qof_session_destroy(m_session.gobj()); - m_session.reset(); - } -} - -// Auto-connected to ui->actionOpen's signal triggered() -void MainWindow::on_actionOpen_triggered() -{ - if (maybeSave()) - { - QString fileName = QFileDialog::getOpenFileName(this); - if (!fileName.isEmpty()) - loadFile(fileName); - } -} - -void MainWindow::loadFileMaybe(const QString &fileName) -{ - if (maybeSave()) - { - loadFile(fileName); - } -} - - -// Auto-connected to ui->actionSave's signal triggered() -bool MainWindow::on_actionSave_triggered() -{ - if (m_currentFilename.isEmpty()) - { - return on_actionSave_as_triggered(); - } - else - { - return saveFile(); - } -} - -// Auto-connected to ui->actionSave_as's signal triggered() -bool MainWindow::on_actionSave_as_triggered() -{ - QString fileName = QFileDialog::getSaveFileName(this); - if (fileName.isEmpty()) - return false; - - return saveFileAs(fileName); -} - -// Auto-connected to ui->actionAbout's signal triggered() -void MainWindow::on_actionAbout_triggered() -{ - QMessageBox::about(this, tr("About Application"), - tr("This is a Gnucash C++ gui example, from the Qt4 Application example. It demonstrates how to " - "write modern GUI applications using Qt, with a menu bar, " - "toolbars, and a status bar.")); -} - -void MainWindow::documentWasModified() -{ - documentCleanStateChanged(false); -} - -void MainWindow::documentCleanStateChanged(bool documentIsClean) -{ - bool unchanged = (documentIsClean == isWindowModified()); - - setWindowModified(!documentIsClean); - if (!unchanged) - updateWindowTitle(); -} - -// Auto-connected to ui->textBrowser's signal anchorClicked() -void MainWindow::on_textBrowser_anchorClicked(const QUrl &url) -{ - QMessageBox::information(this, tr("Got you!"), - tr("Obviously you clicked the link with the URL %1.") - .arg(url.toString())); -} - -void MainWindow::createActions() -{ - ui->actionNew->setShortcuts(QKeySequence::New); - ui->actionOpen->setShortcuts(QKeySequence::Open); - ui->actionSave->setShortcuts(QKeySequence::Save); - ui->actionSave_as->setShortcuts(QKeySequence::SaveAs); - - m_actionRedo = m_undoStack->createRedoAction(ui->menuEdit, tr("&Redo")); - m_actionRedo->setShortcuts(QKeySequence::Redo); - m_actionUndo = m_undoStack->createUndoAction(ui->menuEdit, tr("&Undo")); - m_actionUndo->setShortcuts(QKeySequence::Undo); - ui->menuEdit->insertAction(ui->actionCut, m_actionUndo); - ui->menuEdit->insertAction(ui->actionCut, m_actionRedo); - ui->menuEdit->insertSeparator(ui->actionCut); - - ui->actionCut->setShortcuts(QKeySequence::Cut); - ui->actionCopy->setShortcuts(QKeySequence::Copy); - ui->actionPaste->setShortcuts(QKeySequence::Paste); - - ui->actionCloseTab->setShortcuts(QKeySequence::Close); - - connect(ui->actionNew, SIGNAL(triggered()), this, SLOT(newFile())); - connect(ui->actionExit, SIGNAL(triggered()), this, SLOT(close())); - connect(ui->actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt())); - - ui->actionCut->setEnabled(false); - ui->actionCopy->setEnabled(false); - -// connect(ui->textBrowser, SIGNAL(copyAvailable(bool)), -// ui->actionCut, SLOT(setEnabled(bool))); - connect(ui->textBrowser, SIGNAL(copyAvailable(bool)), - ui->actionCopy, SLOT(setEnabled(bool))); - connect(ui->actionCopy, SIGNAL(triggered()), - ui->textBrowser, SLOT(copy())); - - connect(ui->treeView, SIGNAL(activated(const QModelIndex &)), - this, SLOT(accountItemActivated(const QModelIndex&))); - connect(ui->tableView, SIGNAL(activated(const QModelIndex &)), - this, SLOT(accountItemActivated(const QModelIndex&))); -} - -void MainWindow::createToolBars() -{ - ui->menuFile->insertMenu(ui->actionSave, m_menuRecentFiles.data()); - connect(m_menuRecentFiles.data(), SIGNAL(fileSelected(const QString &)), - this, SLOT(loadFileMaybe(const QString&))); - - m_fileToolBar = addToolBar(tr("File")); - m_fileToolBar->addAction(ui->actionNew); - m_fileToolBar->addAction(ui->actionOpen); - m_fileToolBar->addAction(ui->actionSave); - m_fileToolBar->addAction(ui->actionCloseTab); - - m_editToolBar = addToolBar(tr("Edit")); - m_editToolBar->addAction(m_actionUndo); - m_editToolBar->addAction(m_actionRedo); - m_editToolBar->addAction(ui->actionCut); - m_editToolBar->addAction(ui->actionCopy); - m_editToolBar->addAction(ui->actionPaste); - - m_dashboardToolBar = addToolBar(tr("Dashboard")); - m_dashboardToolBar->setObjectName("m_dashboardToolBar"); - m_btnTransferFundsWidget = new QToolButton; - m_btnTransferFundsWidget->setCheckable(true); - QSettings settings; - m_btnTransferFundsWidget->setChecked(settings.value("basic-txn-dockwidget-visible").toBool()); - m_dashboardToolBar->addWidget(m_btnTransferFundsWidget); -} - -void MainWindow::createStatusBar() -{ - statusBar()->showMessage(tr("Ready")); -} - -void MainWindow::setIcons() -{ - m_actionRedo->setIcon(QIcon::fromTheme("edit-redo")); - m_actionUndo->setIcon(QIcon::fromTheme("edit-undo")); - ui->actionCut->setIcon(QIcon::fromTheme("edit-cut")); - ui->actionCopy->setIcon(QIcon::fromTheme("edit-copy")); - ui->actionPaste->setIcon(QIcon::fromTheme("edit-paste")); - ui->actionCloseTab->setIcon(QIcon::fromTheme("tab-close-other")); - ui->actionNew->setIcon(QIcon::fromTheme("document-new")); - ui->actionOpen->setIcon(QIcon::fromTheme("document-open")); - ui->actionSave->setIcon(QIcon::fromTheme("document-save")); - ui->actionCloseTab->setIcon(QIcon::fromTheme("tab-close-other")); - ui->actionSave_as->setIcon(QIcon::fromTheme("document-save-as")); - ui->actionExit->setIcon(QIcon::fromTheme("window-close")); - ui->actionAbout->setIcon(QIcon::fromTheme("help-about")); - m_btnTransferFundsWidget->setIcon(QIcon::fromTheme("help-about")); -} - -void MainWindow::readSettings() -{ - QSettings settings; - QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint(); - QSize size = settings.value("size", QSize(400, 400)).toSize(); - //resize(size); - //move(pos); - restoreState(settings.value("state").toByteArray()); - restoreGeometry(settings.value("geometry").toByteArray()); - m_menuRecentFiles->readSettings(&settings, "RecentFiles"); -} - -void MainWindow::autoLoadRecentFile() -{ - QSettings settings; - QString lastOpenedFile = ""; - lastOpenedFile = m_menuRecentFiles->getRecentFileName(&settings, - "RecentFiles"); - if (maybeSave()) - { - loadFile(lastOpenedFile); - } -} - -void MainWindow::writeSettings() -{ - QSettings settings; - //settings.setValue("pos", pos()); - //settings.setValue("size", size()); - settings.setValue("state", saveState()); - settings.setValue("geometry", saveGeometry()); - m_menuRecentFiles->writeSettings(&settings, "RecentFiles"); -} - -bool MainWindow::maybeSave() -{ - if (isWindowModified()) - { - QMessageBox::StandardButton ret; - ret = QMessageBox::warning(this, tr("Application"), - tr("The document has been modified.\n" - "Do you want to save your changes?"), - QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel); - if (ret == QMessageBox::Save) - return on_actionSave_triggered(); - else if (ret == QMessageBox::Cancel) - return false; - } - return true; -} - -void MainWindow::setCurrentFile(const QString &fileName) -{ - m_menuRecentFiles->usingFile(fileName); - m_currentFilename = fileName; - documentCleanStateChanged(true); - - updateWindowTitle(); -} - -void MainWindow::updateWindowTitle() -{ - QString shownName; - if (m_currentFilename.isEmpty()) - shownName = "untitled.txt"; - else - shownName = strippedName(m_currentFilename); - - setWindowTitle(tr("%1[*]%2 - %3").arg(shownName).arg(isWindowModified() ? "(*)" : "").arg(tr("Application"))); -} - -QString MainWindow::strippedName(const QString &fullFileName) -{ - return QFileInfo(fullFileName).fileName(); -} - - -// //////////////////////////////////////////////////////////// - -// Auto-connected to ui->actionCloseTab's signal triggered -void MainWindow::on_actionCloseTab_triggered() -{ - on_tabWidget_tabCloseRequested(ui->tabWidget->currentIndex()); -} - -// Auto-connected to ui->tabWidget's signal tabCloseRequested(int) -void MainWindow::on_tabWidget_tabCloseRequested(int index) -{ - QWidget *widget = ui->tabWidget->widget(index); - if (widget == ui->textBrowserTab) - { - ui->actionViewWelcomepage->setChecked(false); - reallyRemoveTab(index); - } - else if (widget == ui->treeViewTab) - { - ui->actionViewAccountTree->setChecked(false); - reallyRemoveTab(index); - } - else if (widget == ui->tableViewTab) - { - ui->actionViewAccountList->setChecked(false); - reallyRemoveTab(index); - } - else if (widget == m_dboard) - { - ui->actionViewDashboard->setChecked(false); - m_dashboardToolBar->setEnabled(false); - m_dashboardToolBar->setHidden(true); - reallyRemoveTab(index); - } - else - { - QVariant prevPos = widget->property(PROPERTY_TAB_PREVIOUSPOS); - if (prevPos.isValid()) - ui->tabWidget->setCurrentIndex(prevPos.toInt()); - ui->tabWidget->removeTab(index); - delete widget; - } -} - -// Auto-connected to ui->actionViewAccountTree's signal triggered() -void MainWindow::on_actionViewAccountTree_triggered(bool checked) -{ - viewOrHideTab(checked, ui->treeViewTab); -} - -// Auto-connected to ui->actionViewAccountList's signal triggered() -void MainWindow::on_actionViewAccountList_triggered(bool checked) -{ - viewOrHideTab(checked, ui->tableViewTab); -} - -// Auto-connected to ui->actionViewWelcomepage's signal triggered() -void MainWindow::on_actionViewWelcomepage_triggered(bool checked) -{ - viewOrHideTab(checked, ui->textBrowserTab); -} - -void MainWindow::on_actionViewDashboard_triggered(bool checked) -{ - viewOrHideTab(checked, m_dboard); -} - -void MainWindow::viewOrHideTab(bool checked, QWidget *widget) -{ - if (checked) - { - QVariant tabLabel = widget->property(PROPERTY_TAB_LABEL); - Q_ASSERT(tabLabel.isValid()); - QVariant tabPosition = widget->property(PROPERTY_TAB_POSITION); - Q_ASSERT(tabPosition.isValid()); - QVariant tabIsCurrentV = widget->property(PROPERTY_TAB_ISCURRENT); - Q_ASSERT(tabIsCurrentV.isValid()); - bool tabIsCurrent = tabIsCurrentV.toBool(); - - if (tabIsCurrent) - widget->setProperty(PROPERTY_TAB_PREVIOUSPOS, ui->tabWidget->currentIndex()); - - ui->tabWidget->insertTab(tabPosition.toInt(), widget, tabLabel.toString()); - if (tabIsCurrent) - ui->tabWidget->setCurrentWidget(widget); - - if(widget == m_dboard) - { - m_dashboardToolBar->setEnabled(true); - m_dashboardToolBar->setHidden(false); - Q_EMIT dashboardVisible(true); - } - } - else - { - on_tabWidget_tabCloseRequested(ui->tabWidget->indexOf(widget)); - } -} - -void MainWindow::reallyRemoveTab(int index) -{ - QWidget *widget = ui->tabWidget->widget(index); - widget->setProperty(PROPERTY_TAB_LABEL, ui->tabWidget->tabText(index)); - widget->setProperty(PROPERTY_TAB_POSITION, index); - widget->setProperty(PROPERTY_TAB_ISCURRENT, (index == ui->tabWidget->currentIndex())); - ui->tabWidget->removeTab(index); - QVariant prevPos = widget->property(PROPERTY_TAB_PREVIOUSPOS); - if (prevPos.isValid()) - ui->tabWidget->setCurrentIndex(prevPos.toInt()); -} - -// Auto-connected to ui->tabWidget's signal currentChanged(int) -void MainWindow::on_tabWidget_currentChanged(int index) -{ - QWidget *widget = ui->tabWidget->widget(index); - bool tabWithAccounts = (widget != ui->textBrowserTab); - ui->menuAccount->setEnabled(tabWithAccounts); - - if(ui->tabWidget->currentWidget() == m_dboard) - { - m_dashboardToolBar->setEnabled(true); - m_dashboardToolBar->setHidden(false); - m_dboard->showDashboardWidgets(); - } - else - { - m_dashboardToolBar->setEnabled(false); - m_dashboardToolBar->setHidden(true); - } -} - -void MainWindow::accountItemActivated(const QModelIndex & index) -{ - if (index.model() != m_accountTreeModel - && index.model() != m_accountListModel) - { - qDebug() << "Wrong model; row=" << (index.isValid()? index.row() : -1); - return; - } - Glib::RefPtr account = Glib::wrap(static_cast< ::Account*>(index.internalPointer())); - if (!account) - { - qDebug() << "Account is null; why?"; - return; - } - - // We create a new model for this account which will query it for - // its splits, and also a view widget for this list. - QTableView *tableView = - new SplitListView(account, m_undoStack, ui->tabWidget); - ui->actionCut->setEnabled(tableView->model()->rowCount() > 0); - - // Insert this as a new tab - tableView->setProperty(PROPERTY_TAB_PREVIOUSPOS, ui->tabWidget->currentIndex()); - ui->tabWidget->addTab(tableView, g2q(account->get_name())); - ui->tabWidget->setCurrentWidget(tableView); - - connect(tableView->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), - this, SLOT(selectionChanged(const QItemSelection &, const QItemSelection & ))); -} - -void MainWindow::selectionChanged(const QItemSelection & selected, const QItemSelection & deselected ) -{ - ui->actionCut->setEnabled(!selected.isEmpty()); - //ui->actionCopy->setEnabled(!selected.isEmpty()); -} - -// Auto-connected to actionCut's signal triggered() -void MainWindow::on_actionCut_triggered() -{ - QWidget *widget = ui->tabWidget->currentWidget(); - QTableView *tableView = qobject_cast(widget); - if (tableView) - { -// QModelIndexList selection = tableView->selectionModel()->selectedIndexes(); -// QSet rows; -// Q_FOREACH (QModelIndex index, selection) -// { -// rows.insert(index.row()); -// } -// qDebug() << "Removing number of rows:" << rows.size(); - QModelIndex index = tableView->currentIndex(); - if (!index.isValid()) - return; - QAbstractItemModel *model = tableView->model(); - Q_ASSERT(model); - model->removeRow(index.row()); - } -} - -// //////////////////////////////////////////////////////////// - -void MainWindow::closeEvent(QCloseEvent *event) -{ - if (maybeSave()) - { - m_dboard->mainWindowCloseEvent(); - writeSettings(); - event->accept(); - - /* disable events; otherwise the mass deletion of accounts and - * transactions during shutdown would cause massive redraws */ - qof_event_suspend (); - - gnc_hook_run(HOOK_BOOK_CLOSED, m_session.gobj()); - - qof_session_destroy(m_session.gobj()); - m_session.reset(); - - qof_event_resume (); - } - else - { - event->ignore(); - } -} - -void MainWindow::newFile() -{ - if (maybeSave()) - { - - if (m_session) - { - /* close any ongoing file sessions, and free the accounts. - * disable events so we don't gobj spammed by redraws. */ - qof_event_suspend (); - - gnc_hook_run(HOOK_BOOK_CLOSED, m_session.gobj()); - - qof_session_destroy(m_session.gobj()); - m_session.reset(); - qof_event_resume (); - } - - /* start a new book */ - m_session.reset(qof_session_new()); - - gnc_hook_run(HOOK_NEW_BOOK, NULL); - - /* Call this after re-enabling events. */ - gnc_hook_run(HOOK_BOOK_OPENED, m_session.gobj()); - - setCurrentFile(""); - } -} - -void MainWindow::dockWidgetsVisibilityChanged(int wdg, bool visible) -{ - if (wdg == 0) - { - /** todo: handle tabs */ - m_btnTransferFundsWidget->setChecked(visible); - } -} - - -} // END namespace gnc diff --git a/src/gnc/mainwindow.hpp b/src/gnc/mainwindow.hpp deleted file mode 100644 index 4e77f40366..0000000000 --- a/src/gnc/mainwindow.hpp +++ /dev/null @@ -1,151 +0,0 @@ -/* - * mainwindow.hpp - * Copyright (C) 2010 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include -#include -#include -#include "gnc/Session.hpp" -#include "gnc/AccountItemModel.hpp" -#include "gnc/dashboard.hpp" - -class QAction; -class QMenu; -class QPlainTextEdit; -class QTextEdit; -class QTabWidget; -class QUndoStack; -class QToolButton; - -namespace Ui -{ -class MainWindow; -} - -namespace gnc -{ - -class RecentFileMenu; -class Dashboard; - -/** The main window of Cutecash. - * - * Some of the action parts in here should probably be refactored into - * separate classes/functions. - */ -class MainWindow : public QMainWindow -{ - Q_OBJECT - -public: - MainWindow(); - ~MainWindow(); - - const QString& getCurrentFilename() const { return m_currentFilename; } - bool hasOpenedFile() const { return !m_currentFilename.isEmpty(); } - void dockWidgetsVisibilityChanged(int wdg, bool visible); - -public Q_SLOTS: - void accountItemActivated(const QModelIndex & index); - void loadFileMaybe(const QString &fileName); - void documentCleanStateChanged(bool clean); - -protected: - void closeEvent(QCloseEvent *event); - -Q_SIGNALS: - void dashboardVisible(bool visible); - -private Q_SLOTS: - void newFile(); - void on_actionOpen_triggered(); - bool on_actionSave_triggered(); - void on_actionAbout_triggered(); - bool on_actionSave_as_triggered(); - void on_actionCloseTab_triggered(); - void on_actionCut_triggered(); - void on_tabWidget_tabCloseRequested(int index); - void on_tabWidget_currentChanged(int index); - void on_textBrowser_anchorClicked(const QUrl &); - void on_actionViewAccountTree_triggered(bool checked); - void on_actionViewAccountList_triggered(bool checked); - void on_actionViewWelcomepage_triggered(bool checked); - void on_actionViewDashboard_triggered(bool checked); - void documentWasModified(); - void selectionChanged(const QItemSelection & selected, const QItemSelection & deselected ); - -private: - void createActions(); - void createToolBars(); - void createStatusBar(); - void setIcons(); - void readSettings(); - void autoLoadRecentFile(); - void writeSettings(); - bool maybeSave(); - void setCurrentFile(const QString &fileName); - QString strippedName(const QString &fullFileName); - void viewOrHideTab(bool checkedView, QWidget *widget); - void reallyRemoveTab(int index); - void updateWindowTitle(); - - void loadFile(const QString &fileName); - bool saveFile(); - bool saveFileAs(const QString &fileName); - - typedef enum - { - GNC_FILE_DIALOG_OPEN, - GNC_FILE_DIALOG_IMPORT, - GNC_FILE_DIALOG_SAVE, - GNC_FILE_DIALOG_EXPORT - } GNCFileDialogType; - static bool show_session_error (QWidget *parent, - ::QofBackendError io_error, - const QString& newfile, - GNCFileDialogType type); - - QSharedPointer ui; - - QString m_currentFilename; - - QToolBar *m_fileToolBar; - QToolBar *m_editToolBar; - QToolBar *m_dashboardToolBar; - QAction *m_actionUndo; - QAction *m_actionRedo; - QToolButton *m_btnTransferFundsWidget; - QSharedPointer m_menuRecentFiles; - QUndoStack *m_undoStack; - - Dashboard *m_dboard; - - Session m_session; - AccountListModel *m_accountListModel; - AccountTreeModel *m_accountTreeModel; -}; - -} // END namespace gnc - -#endif diff --git a/src/gnc/mainwindow.ui b/src/gnc/mainwindow.ui deleted file mode 100644 index 00c222c1ab..0000000000 --- a/src/gnc/mainwindow.ui +++ /dev/null @@ -1,430 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 707 - 665 - - - - GnuCash Qt Example - - - - :/pixmaps/gnucash-icon-32x32.png:/pixmaps/gnucash-icon-32x32.png - - - - - 0 - - - 2 - - - 0 - - - 0 - - - - - 0 - - - true - - - true - - - true - - - - - :/gtk-icons/gtk-about.png:/gtk-icons/gtk-about.png - - - Example Welcome Page - - - - 0 - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:18px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:12pt; font-weight:600;">Cutecash</span></p> -<p style=" margin-top:18px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:12pt; font-weight:600;">Free Finance Software. Easy to develop, easy to use.</span></p> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">Currently this is more or less a proof-of-concept for developers:</span></p> -<ol style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" font-family:'Sans'; font-size:10pt;" style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Load an existing gnucash XML file</li> -<li style=" font-family:'Sans'; font-size:10pt;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">It will show the account tree in a tree view and also a list view </li> -<li style=" font-family:'Sans'; font-size:10pt;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Double-click on any account in either view; it will open the list of splits in that account.</li> -<li style=" font-family:'Sans'; font-size:10pt;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Save and Save-As works as normal.</li> -<li style=" font-family:'Sans'; font-size:10pt;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Edit any of the existing transaction/splits: Date, Description, or Amount. Click Undo. Click Redo. Click Undo. Etc. etc.</li> -<li style=" font-family:'Sans'; font-size:10pt;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Delete any of the existings transactions. Or entering a new one. Click Undo. Click Redo. Etc. etc.</li></ol> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;">The list of splits in the account is comparable to gnucash's single line view. Amounts, balance, date, all there.</span></p> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;">The following parts are still missing:</span></p> -<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" font-family:'MS Shell Dlg 2'; font-size:8pt;" style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Currently the accout selection of a transaction cannot be edited. </li> -<li style=" font-family:'MS Shell Dlg 2'; font-size:8pt;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Editing or adding multi-split transactions are not yet supported (it shows only the string &quot;--Split Transaction--&quot;). </li> -<li style=" font-family:'MS Shell Dlg 2'; font-size:8pt;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Editing or adding multi-currency transactions are not yet supported. </li> -<li style=" font-family:'MS Shell Dlg 2'; font-size:8pt;" style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Any of the more specialized account views are not yet implemented.</li></ul> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">The fun part is how easy it was to add this. Let's see how far we will get...</span></p> -<p style=" margin-top:16px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:600;">Images</span></p> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/pixmaps/gnucash_splash.png" /></p> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">We can also embed images here in this compiled-in HTML page, as you can see above. Eventually, this page should explain what this software can do for the new user. Maybe a </span><a href="gnc:test"><span style=" font-family:'Sans'; font-size:10pt; text-decoration: underline; color:#0000ff;">hyperlink </span></a><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">here?</span></p></body></html> - - - false - - - - - - - - - :/pixmaps/gnc-account.png:/pixmaps/gnc-account.png - - - Account List - - - - 0 - - - - - false - - - - - - - - - :/pixmaps/gnc-account.png:/pixmaps/gnc-account.png - - - Account Tree - - - - 0 - - - - - - - - - - - - - - 0 - 0 - 707 - 21 - - - - - &File - - - - - - - - - - - - - &Help - - - - - - - false - - - &Account - - - - - - - - - - &Edit - - - - - - - - &View - - - - - - - - - - - - - - - - &New - - - Create a new file - - - Ctrl+N - - - - - &Open... - - - Open an existing file - - - Ctrl+O - - - - - &About - - - - - &Save - - - Save the document to disk - - - Ctrl+S - - - - - Save &as... - - - Save the document under a new name - - - - - E&xit - - - Exit the application - - - Ctrl+Q - - - - - false - - - - :/pixmaps/gnc-account-new.png:/pixmaps/gnc-account-new.png - - - &New... - - - - - false - - - - :/pixmaps/gnc-account-open.png:/pixmaps/gnc-account-open.png - - - &Open - - - - - false - - - - :/pixmaps/gnc-account-edit.png:/pixmaps/gnc-account-edit.png - - - &Properties... - - - - - false - - - Cu&t - - - - - false - - - &Copy - - - - - false - - - &Paste - - - - - false - - - - :/pixmaps/gnc-account-delete.png:/pixmaps/gnc-account-delete.png - - - &Delete... - - - - - About Qt - - - - - true - - - true - - - &Welcome Page - - - - - true - - - true - - - Account &List - - - - - true - - - true - - - Account &Tree - - - - - &Close Current Tab - - - - - true - - - true - - - &Dashboard - - - - - true - - - true - - - &Transfer Funds - - - - - true - - - true - - - &FPO - - - - - - - - - - textBrowser - copyAvailable(bool) - actionCopy - setEnabled(bool) - - - 352 - 343 - - - -1 - -1 - - - - - diff --git a/src/gnc/metatype.hpp b/src/gnc/metatype.hpp deleted file mode 100644 index c926d94054..0000000000 --- a/src/gnc/metatype.hpp +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef METATYPE_HPP -#define METATYPE_HPP - -#include - -#include "config.h" -#include - -// The macros to declare those types for inclusion in QVariant -Q_DECLARE_METATYPE(::Account*); - -#endif // METATYPE_HPP diff --git a/src/gnc/qss/default.qss b/src/gnc/qss/default.qss deleted file mode 100644 index 2b4ed0dce6..0000000000 --- a/src/gnc/qss/default.qss +++ /dev/null @@ -1,48 +0,0 @@ -#dateWidget { -background-color: #FAA0A0; -color:black; -border-style: outset; -border-width: 1px; -border-radius: 5px; -border-color: beige; - -border-bottom-width: 2px; -border-bottom-color: darkgray; -border-bottom-style: solid; - -min-width: 12em; -padding: 2px; -} - -#accountWidget { -background-color: #A0A1FA; -border-style: outset; -border-width: 1px; -border-radius: 5px; -border-color: beige; -padding: 2px; - -/* Test with colours */ -/* -background-color: qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5, - stop: 0 #FF92BB, stop: 1 white); -*/ -} - -#descWidget { -background-color: #A9FAA0; -border-style: outset; -border-width: 1px; -border-radius: 5px; -border-color: beige; -padding: 2px; -} - -#amountWidget { -background-color: #F0F7F0; -border-style: outset; -border-width: 1px; -border-radius: 5px; -border-color: beige; -padding: 2px; -} diff --git a/src/gnc/stylesheets.qrc b/src/gnc/stylesheets.qrc deleted file mode 100644 index 9d422f7159..0000000000 --- a/src/gnc/stylesheets.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - qss/default.qss - - diff --git a/src/optional/CMakeLists.txt b/src/optional/CMakeLists.txt index 3fe88da942..320b387f7a 100644 --- a/src/optional/CMakeLists.txt +++ b/src/optional/CMakeLists.txt @@ -1,5 +1,4 @@ ADD_SUBDIRECTORY(python-bindings) -ADD_SUBDIRECTORY(gtkmm) SET_LOCAL_DIST(optional_DIST_local CMakeLists.txt Makefile.am) -SET(optional_DIST ${optional_DIST_local} ${gtkmm_DIST} ${python_bindings_DIST} PARENT_SCOPE) \ No newline at end of file +SET(optional_DIST ${optional_DIST_local} ${python_bindings_DIST} PARENT_SCOPE) diff --git a/src/optional/Makefile.am b/src/optional/Makefile.am index 14cda7ab9d..73573b1323 100644 --- a/src/optional/Makefile.am +++ b/src/optional/Makefile.am @@ -1,9 +1,6 @@ if WITH_PYTHON PYTHON_BINDINGS_DIR = python-bindings endif -if WITH_GTKMM - GTKMM_DIR=gtkmm -endif -SUBDIRS = ${PYTHON_BINDINGS_DIR} ${GTKMM_DIR} +SUBDIRS = ${PYTHON_BINDINGS_DIR} EXTRA_DIST = CMakeLists.txt diff --git a/src/optional/gtkmm/CMakeLists.txt b/src/optional/gtkmm/CMakeLists.txt deleted file mode 100644 index ad777a050e..0000000000 --- a/src/optional/gtkmm/CMakeLists.txt +++ /dev/null @@ -1,63 +0,0 @@ -# CMakeLists.txt for src/optional/gtkmm -#ADD_SUBDIRECTORY(gncmm) -ADD_SUBDIRECTORY(test) - - -ADD_DEFINITIONS (-DG_LOG_DOMAIN=\"gnc.gtkmm\") - -INCLUDE_DIRECTORIES (${GLIB2_INCLUDE_DIRS}) -INCLUDE_DIRECTORIES (${GLIBMM_INCLUDE_DIRS}) -INCLUDE_DIRECTORIES (${LIBINTL_INCLUDE_PATH}) -INCLUDE_DIRECTORIES (${REGEX_INCLUDE_PATH}) -INCLUDE_DIRECTORIES (${GUILE_INCLUDE_DIRS}) -INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR}/src ) # for config.h -INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR}/src ) # for gnc-ui.h -INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR}/src/gnc-module) # for gnc-glib-utils.h -INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR}/src/core-utils) # for gnc-glib-utils.h -INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR}/src/engine) # for gnc-glib-utils.h -INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR}/src/backend/xml) -INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR}/src/engine) # for swig-runtime.h - -SET (libgncmod_gtkmm_HEADERS - gncmm/Account.hpp - gncmm/Book.hpp - gncmm/Commodity.hpp - gncmm/GncInstance.hpp - gncmm/Numeric.hpp - gncmm/Split.hpp - gncmm/Transaction.hpp - gncmm/private/Account_p.hpp - gncmm/private/Book_p.hpp - gncmm/private/Commodity_p.hpp - gncmm/private/GncInstance_p.hpp - gncmm/private/Split_p.hpp - gncmm/private/Transaction_p.hpp - gncmm/wrap_init.hpp -) - -SET (libgncmod_gtkmm_SOURCES - gncmm/Account.cpp - gncmm/Book.cpp - gncmm/Commodity.cpp - gncmm/GncInstance.cpp - gncmm/Numeric.cpp - gncmm/Split.cpp - gncmm/Transaction.cpp - gncmm/wrap_init.cpp -) - -SET(gnc_plugin_SOURCES gnc-plugin-gtkmm.cpp gncmod-gtkmm.cpp) -SET(gnc_plugin_noinst_SOURCES gnc-plugin-gtkmm.hpp) -SET(gnc_plugin_UI gnc-plugin-gtkmm-ui.xml) - -IF (WITH_CUTECASH) - ADD_LIBRARY (libgncmod-gtkmm - ${libgncmod_gtkmm_SOURCES} - ${libgncmod_gtkmm_HEADERS} - ) -ENDIF() - -SET_LOCAL_DIST(gtkmm_DIST_local CMakeLists.txt Makefile.am - ${libgncmod_gtkmm_SOURCES} ${libgncmod_gtkmm_HEADERS} - ${gnc_plugin_SOURCES} ${gnc_plugin_noinst_SOURCES} ${gnc_plugin_UI}) -SET(gtkmm_DIST ${gtkmm_DIST_local} ${test_gtkmm_DIST} PARENT_SCOPE) diff --git a/src/optional/gtkmm/Makefile.am b/src/optional/gtkmm/Makefile.am deleted file mode 100644 index 7b4be860e9..0000000000 --- a/src/optional/gtkmm/Makefile.am +++ /dev/null @@ -1,62 +0,0 @@ -SUBDIRS = . test - -pkglib_LTLIBRARIES = libgncmod-gtkmm.la - -libgncmod_gtkmm_la_SOURCES = \ - gncmm/Account.cpp \ - gncmm/Book.cpp \ - gncmm/Commodity.cpp \ - gncmm/GncInstance.cpp \ - gncmm/Numeric.cpp \ - gncmm/Split.cpp \ - gncmm/Transaction.cpp \ - gncmm/wrap_init.cpp \ - gnc-plugin-gtkmm.cpp \ - gncmod-gtkmm.cpp - -noinst_HEADERS = \ - gncmm/Account.hpp \ - gncmm/Book.hpp \ - gncmm/Commodity.hpp \ - gncmm/GncInstance.hpp \ - gncmm/Numeric.hpp \ - gncmm/Split.hpp \ - gncmm/Transaction.hpp \ - gncmm/private/Account_p.hpp \ - gncmm/private/Book_p.hpp \ - gncmm/private/Commodity_p.hpp \ - gncmm/private/GncInstance_p.hpp \ - gncmm/private/Split_p.hpp \ - gncmm/private/Transaction_p.hpp \ - gncmm/wrap_init.hpp \ - gnc-plugin-gtkmm.hpp - -libgncmod_gtkmm_la_LDFLAGS = -avoid-version - -libgncmod_gtkmm_la_LIBADD = \ - ${top_builddir}/src/gnome/libgnc-gnome.la \ - ${top_builddir}/src/gnome-utils/libgncmod-gnome-utils.la \ - ${top_builddir}/src/app-utils/libgncmod-app-utils.la \ - ${top_builddir}/src/engine/libgncmod-engine.la \ - ${top_builddir}/src/core-utils/libgnc-core-utils.la \ - ${top_builddir}/src/gnc-module/libgnc-module.la \ - ${GTKMM_LIBS} \ - ${GLIB_LIBS} - -AM_CPPFLAGS = \ - -I${top_srcdir}/src \ - -I${top_srcdir}/src/gnc-module \ - -I${top_srcdir}/src/core-utils \ - -I${top_srcdir}/src/engine \ - ${GTKMM_CFLAGS} \ - ${GLIB_CFLAGS} - -uidir = $(GNC_UI_DIR) -ui_DATA = gnc-plugin-gtkmm-ui.xml - -gtkbuilderdir = $(GNC_GTKBUILDER_DIR) -gtkbuilder_DATA = - -EXTRA_DIST = ${ui_DATA} ${gtkbuilder_DATA} CMakeLists.txt - -AM_CPPFLAGS += -DG_LOG_DOMAIN=\"gnc.gui.gtkmm\" diff --git a/src/optional/gtkmm/gnc-plugin-gtkmm-ui.xml b/src/optional/gtkmm/gnc-plugin-gtkmm-ui.xml deleted file mode 100644 index a4b3460191..0000000000 --- a/src/optional/gtkmm/gnc-plugin-gtkmm-ui.xml +++ /dev/null @@ -1,11 +0,0 @@ - - -

- - - - - - - - diff --git a/src/optional/gtkmm/gnc-plugin-gtkmm.cpp b/src/optional/gtkmm/gnc-plugin-gtkmm.cpp deleted file mode 100644 index ae94f086e8..0000000000 --- a/src/optional/gtkmm/gnc-plugin-gtkmm.cpp +++ /dev/null @@ -1,187 +0,0 @@ -/* - * gnc-plugin-gtkmm.cpp -- - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -/** - * @internal - * @file - * @brief Plugin registration of the Gtkmm module - * @author Copyright (C) 2011 Christian Stimming - */ - -#include "config.h" - -#include -#include -extern "C" { -#include "gnome-utils/gnc-plugin-manager.h" -#include "gnome-utils/gnc-main-window.h" -#include "engine/Account.h" -} - -#include "gnc-plugin-gtkmm.hpp" -#include - -namespace gncmm -{ - -// This static indicates the debugging module that this .o belongs to. -static QofLogModule log_module = G_LOG_DOMAIN; - -static void gnc_plugin_gtkmm_class_init (GncPluginGtkmmClass *klass); -static void gnc_plugin_gtkmm_init (GncPluginGtkmm *plugin); -static void gnc_plugin_gtkmm_finalize (GObject *object); - -/* Command callbacks */ -static void gnc_plugin_gtkmm_cmd_something (GtkAction *action, GncMainWindowActionData *data); - -#define PLUGIN_ACTIONS_NAME "gnc-plugin-gtkmm-actions" -#define PLUGIN_UI_FILENAME "gnc-plugin-gtkmm-ui.xml" - -static GtkActionEntry gnc_plugin_actions [] = -{ - { - // FIXME: I've intentionally remove the i18n markers so that - // translators don't have to deal with these example strings! - "GtkmmSomethingAction", NULL, "Do _Something in C++/gtkmm...", NULL, - "This demonstrates how to integrate C++/gtkmm in a plugin of gnucash", - G_CALLBACK (gnc_plugin_gtkmm_cmd_something) - }, -}; -static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions); - -struct GncPluginGtkmmPrivate -{ - gpointer dummy; -}; - -#define GNC_PLUGIN_GTKMM_GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_GTKMM, GncPluginGtkmmPrivate)) - -static GObjectClass *parent_class = NULL; - -GType -gnc_plugin_gtkmm_get_type (void) -{ - static GType gnc_plugin_gtkmm_type = 0; - - if (gnc_plugin_gtkmm_type == 0) - { - static const GTypeInfo our_info = - { - sizeof (GncPluginGtkmmClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) gnc_plugin_gtkmm_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (GncPluginGtkmm), - 0, /* n_preallocs */ - (GInstanceInitFunc) gnc_plugin_gtkmm_init, - }; - - gnc_plugin_gtkmm_type = g_type_register_static (GNC_TYPE_PLUGIN, - "GncPluginGtkmm", - &our_info, GTypeFlags(0)); - } - - return gnc_plugin_gtkmm_type; -} - -GncPlugin * -gnc_plugin_gtkmm_new (void) -{ - return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_GTKMM, NULL)); -} - -static void -gnc_plugin_gtkmm_class_init (GncPluginGtkmmClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass); - - parent_class = reinterpret_cast(g_type_class_peek_parent (klass)); - - object_class->finalize = gnc_plugin_gtkmm_finalize; - - // plugin info - plugin_class->plugin_name = GNC_PLUGIN_GTKMM_NAME; - - // widget addition/removal - plugin_class->actions_name = PLUGIN_ACTIONS_NAME; - plugin_class->actions = gnc_plugin_actions; - plugin_class->n_actions = gnc_plugin_n_actions; - plugin_class->ui_filename = PLUGIN_UI_FILENAME; - - g_type_class_add_private(klass, sizeof(GncPluginGtkmmPrivate)); -} - -static void -gnc_plugin_gtkmm_init (GncPluginGtkmm *plugin) -{ -} - -static void -gnc_plugin_gtkmm_finalize (GObject *object) -{ - g_return_if_fail (GNC_IS_PLUGIN_GTKMM (object)); - - GncPluginGtkmm *plugin = GNC_PLUGIN_GTKMM (object); - GncPluginGtkmmPrivate *priv = GNC_PLUGIN_GTKMM_GET_PRIVATE(plugin); - - G_OBJECT_CLASS (parent_class)->finalize (object); -} - -/************************************************************ - * Plugin Function Implementation * - ************************************************************/ - -/************************************************************ - * Command Callbacks * - ************************************************************/ - -static void -gnc_plugin_gtkmm_cmd_something (GtkAction *action, - GncMainWindowActionData *data) -{ - // Now we're gonna do something. - ENTER("action %p, main window data %p", action, data); - g_return_if_fail(data); - -// ::Account *c_account = NULL;//main_window_to_account(data->window); -// Glib::RefPtr account_ptr = Glib::wrap(c_account); - - LEAVE(""); -} - - -/************************************************************ - * Plugin Bootstrapping * - ************************************************************/ - -void -gnc_plugin_gtkmm_create_plugin (void) -{ - GncPlugin *plugin = gnc_plugin_gtkmm_new (); - - gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (), plugin); -} - -} // END namespace gncmm diff --git a/src/optional/gtkmm/gnc-plugin-gtkmm.hpp b/src/optional/gtkmm/gnc-plugin-gtkmm.hpp deleted file mode 100644 index e5a0b3d84c..0000000000 --- a/src/optional/gtkmm/gnc-plugin-gtkmm.hpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * gnc-plugin-gtkmm.h -- - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -/** - * @addtogroup GUI - * @{ - * @addtogroup Gtkmm - * @{ - * @file - * @brief Plugin registration of the Gtkmm module - * @author Copyright (C) 2011 Christian Stimming - */ - -#ifndef GNC_PLUGIN_GTKMM_H -#define GNC_PLUGIN_GTKMM_H - -#include -extern "C" { -#include "gnome-utils/gnc-plugin.h" -} - -namespace gncmm -{ - -G_BEGIN_DECLS - -/* type macros */ -#define GNC_TYPE_PLUGIN_GTKMM (gnc_plugin_gtkmm_get_type()) -#define GNC_PLUGIN_GTKMM(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNC_TYPE_PLUGIN_GTKMM, GncPluginGtkmm)) -#define GNC_PLUGIN_GTKMM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNC_TYPE_PLUGIN_GTKMM, GncPluginGtkmmClass)) -#define GNC_IS_PLUGIN_GTKMM(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNC_TYPE_PLUGIN_GTKMM)) -#define GNC_IS_PLUGIN_GTKMM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNC_TYPE_PLUGIN_GTKMM)) -#define GNC_PLUGIN_GTKMM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNC_TYPE_PLUGIN_GTKMM, GncPluginGtkmmClass)) - -#define GNC_PLUGIN_GTKMM_NAME "gnc-plugin-gtkmm" - -/* typedefs & structures */ -struct GncPluginGtkmm -{ - GncPlugin gnc_plugin; -}; - -struct GncPluginGtkmmClass -{ - GncPluginClass gnc_plugin; -}; - -/* function prototypes */ - -/** - * @return The glib runtime type of an gtkmm plugin page - **/ -GType gnc_plugin_gtkmm_get_type(void); - -/** - * @return A new GncPluginGtkmm object - */ -GncPlugin* gnc_plugin_gtkmm_new(void); - -/** - * Create a new GncPluginGtkmm object and register it. - */ -void gnc_plugin_gtkmm_create_plugin(void); - -G_END_DECLS - -} // END namespace gncmm - -/** @} */ -/** @} */ - -#endif /* GNC_PLUGIN_GTKMM_H */ diff --git a/src/optional/gtkmm/gncmm/Account.cpp b/src/optional/gtkmm/gncmm/Account.cpp deleted file mode 100644 index 6c67822ecc..0000000000 --- a/src/optional/gtkmm/gncmm/Account.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Account.cpp - * Copyright (C) 2011 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#include "config.h" -#include "Account.hpp" -#include "private/Account_p.hpp" -#include "Commodity.hpp" - -namespace Glib -{ - -Glib::RefPtr wrap(::Account* object, bool refuse_ownership) -{ - return Glib::RefPtr( dynamic_cast (Glib::wrap_auto ((GObject*)(object), refuse_ownership)) ); - //We use dynamic_cast<> in case of multiple inheritance. -} - -} /* namespace Glib */ - - -namespace gnc -{ - - -/* The *_Class implementation: */ - -const Glib::Class& Account_Class::init() -{ - if (!gtype_) // create the GType if necessary - { - // Glib::Class has to know the class init function to clone custom types. - class_init_func_ = &Account_Class::class_init_function; - - // This is actually just optimized away, apparently with no harm. - // Make sure that the parent type has been created. - //CppClassParent::CppObjectType::get_type(); - - // Create the wrapper type, with the same class/instance size as the base type. - register_derived_type(gnc_account_get_type()); - - // Add derived versions of interfaces, if the C type implements any interfaces: - - } - - return *this; -} - - -void Account_Class::class_init_function(void* g_class, void* class_data) -{ - BaseClassType *const klass = static_cast(g_class); - CppClassParent::class_init_function(klass, class_data); -} - - -Glib::ObjectBase* Account_Class::wrap_new(GObject* object) -{ - return new Account((::Account*)object); -} - - -/* The implementation: */ - -::Account* Account::gobj_copy() -{ - reference(); - return gobj(); -} - -Account::Account(const Glib::ConstructParams& construct_params) - : GncInstance(construct_params) -{ - -} - -Account::Account(::Account* castitem) - : GncInstance((::QofInstance*)(castitem)) -{} - - -Account::~Account() -{} - - -Account::CppClassType Account::account_class_; // initialize static member - -GType Account::get_type() -{ - return account_class_.init().get_type(); -} - - -GType Account::get_base_type() -{ - return gnc_account_get_type(); -} - - - -Glib::RefPtr Account::get_commodity() const -{ - return Glib::wrap(xaccAccountGetCommodity(gobj())); -} -Glib::RefPtr Account::get_parent() const -{ - return Glib::wrap(gnc_account_get_parent(gobj())); -} -Glib::RefPtr Account::get_root() -{ - return Glib::wrap(gnc_account_get_root(gobj())); -} -Glib::RefPtr Account::get_nth_child (gint num) const -{ - return Glib::wrap(gnc_account_nth_child(gobj(), num)); -} - -} // END namespace gnc diff --git a/src/optional/gtkmm/gncmm/Account.hpp b/src/optional/gtkmm/gncmm/Account.hpp deleted file mode 100644 index 576188291c..0000000000 --- a/src/optional/gtkmm/gncmm/Account.hpp +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Account.hpp - * Copyright (C) 2011 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#ifndef GNC_ACCOUNT_HPP -#define GNC_ACCOUNT_HPP - -// gnucash includes -#include "engine/guid.hpp" -extern "C" -{ -#include "qof.h" -#include "engine/Account.h" -} - -#include -#include - -#include "Numeric.hpp" -#include "GncInstance.hpp" - -namespace gnc -{ -class Account_Class; -} // END namespace gnc - -namespace gnc -{ -class Account; -class Commodity; - -/** Wrapper around a gnucash ::Account pointer with C++ methods for - * easier setter and getter access. - */ -class Account : public GncInstance -{ -#ifndef DOXYGEN_SHOULD_SKIP_THIS - typedef Account CppObjectType; - typedef Account_Class CppClassType; - typedef ::Account BaseObjectType; - typedef ::AccountClass BaseClassType; - -private: - friend class Account_Class; - static CppClassType account_class_; - -private: - // noncopyable - Account(const Account&); - Account& operator=(const Account&); - -protected: - explicit Account(const Glib::ConstructParams& construct_params); - explicit Account(::Account* castitem); - -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ - -public: - virtual ~Account(); -#ifndef DOXYGEN_SHOULD_SKIP_THIS - static GType get_type() G_GNUC_CONST; - static GType get_base_type() G_GNUC_CONST; -#endif - - ///Provides access to the underlying C GObject. - ::Account* gobj() - { - return reinterpret_cast< ::Account*>(gobject_); - } - - ///Provides access to the underlying C GObject. - const ::Account* gobj() const - { - return reinterpret_cast< ::Account*>(gobject_); - } - - ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. - ::Account* gobj_copy(); - -private: -public: - - - // actual implementation follows here - - Glib::ustring get_name() const - { - return (xaccAccountGetName(gobj())); - } - Glib::ustring get_full_name() const - { - return gchar_to_ustring(gnc_account_get_full_name (gobj())); - } - Glib::ustring get_code() const - { - return (xaccAccountGetCode(gobj())); - } - Glib::ustring get_description() const - { - return (xaccAccountGetDescription(gobj())); - } - Glib::RefPtr get_commodity() const; - int get_commodity_scu() const - { - return xaccAccountGetCommoditySCU(gobj()); - } - - ::SplitList* get_split_list() const - { - return xaccAccountGetSplitList(gobj()); - } - - /** @name Account tree traversal */ - //@{ - - Glib::RefPtr get_parent() const; - Glib::RefPtr get_root(); - bool is_root() const - { - return gnc_account_is_root(gobj()); - } - gint get_num_children() const - { - return gnc_account_n_children(gobj()); - } - GList *get_children() const - { - return gnc_account_get_children(gobj()); - } - GList *get_descendants () const - { - return gnc_account_get_descendants (gobj()); - } - Glib::RefPtr get_nth_child (gint num) const; - - - /** Return the index of this account in the children's list of its - * parent account. - */ - gint child_index () const - { - Glib::RefPtr parent(get_parent()); - if (parent && parent->gobj()) - return gnc_account_child_index(parent->gobj(), gobj()); - else - return 0; - } - - gint get_current_depth () const - { - return gnc_account_get_current_depth(gobj()); - } - gint get_tree_depth () const - { - return gnc_account_get_tree_depth(gobj()); - } - //@} - -}; - -} // END namespace gnc - -namespace Glib -{ -/** A Glib::wrap() method for this object. - * - * @param object The C instance. - * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. - * @result A C++ instance that wraps this C instance. - * - * @relates Gio::FileInfo - */ -Glib::RefPtr wrap(::Account* object, bool refuse_ownership = true); -} - -#endif diff --git a/src/optional/gtkmm/gncmm/Book.cpp b/src/optional/gtkmm/gncmm/Book.cpp deleted file mode 100644 index a8fc38a679..0000000000 --- a/src/optional/gtkmm/gncmm/Book.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Book.cpp - * Copyright (C) 2011 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#include "config.h" -#include "Book.hpp" -#include "private/Book_p.hpp" -#include "Account.hpp" - -namespace Glib -{ - -Glib::RefPtr wrap(QofBook* object, bool take_copy) -{ - return Glib::RefPtr( dynamic_cast (Glib::wrap_auto ((GObject*)(object), take_copy)) ); - //We use dynamic_cast<> in case of multiple inheritance. -} - -} /* namespace Glib */ - - -namespace gnc -{ - - -/* The *_Class implementation: */ - -const Glib::Class& Book_Class::init() -{ - if (!gtype_) // create the GType if necessary - { - // Glib::Class has to know the class init function to clone custom types. - class_init_func_ = &Book_Class::class_init_function; - - // This is actually just optimized away, apparently with no harm. - // Make sure that the parent type has been created. - //CppClassParent::CppObjectType::get_type(); - - // Create the wrapper type, with the same class/instance size as the base type. - register_derived_type(qof_book_get_type()); - - // Add derived versions of interfaces, if the C type implements any interfaces: - - } - - return *this; -} - - -void Book_Class::class_init_function(void* g_class, void* class_data) -{ - BaseClassType *const klass = static_cast(g_class); - CppClassParent::class_init_function(klass, class_data); -} - - -Glib::ObjectBase* Book_Class::wrap_new(GObject* object) -{ - return new Book((QofBook*)object); -} - - -/* The implementation: */ - -QofBook* Book::gobj_copy() -{ - reference(); - return gobj(); -} - -Book::Book(const Glib::ConstructParams& construct_params) - : GncInstance(construct_params) -{ - -} - -Book::Book(QofBook* castitem) - : GncInstance((::QofInstance*)(castitem)) -{} - - -Book::~Book() -{} - - -Book::CppClassType Book::book_class_; // initialize static member - -GType Book::get_type() -{ - return book_class_.init().get_type(); -} - - -GType Book::get_base_type() -{ - return qof_book_get_type(); -} - - -void Book::string_option_set (const Glib::ustring& opt_name, const Glib::ustring& opt_val) -{ - qof_book_set_string_option(gobj(), opt_name.c_str(), opt_val.c_str()); -} - -Glib::ustring Book::string_option_get (const Glib::ustring& opt_name) const -{ - const char* r = qof_book_get_string_option(gobj(), opt_name.c_str()); - if (r) - return r; - else - return ""; -} -bool Book::string_option_exists (const Glib::ustring& opt_name) const -{ - const char* r = qof_book_get_string_option(gobj(), opt_name.c_str()); - if (r) - return true; - else - return false; -} - -Glib::RefPtr Book::get_root_account() -{ - return Glib::wrap(gnc_book_get_root_account (gobj())); -} - -} // END namespace gnc diff --git a/src/optional/gtkmm/gncmm/Book.hpp b/src/optional/gtkmm/gncmm/Book.hpp deleted file mode 100644 index 2795166b00..0000000000 --- a/src/optional/gtkmm/gncmm/Book.hpp +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Book.hpp - * Copyright (C) 2011 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#ifndef GNC_BOOK_HPP -#define GNC_BOOK_HPP - -// gnucash includes -#include "engine/guid.hpp" -extern "C" -{ -#include "qof.h" -#include "engine/gnc-hooks.h" -#include "engine/Account.h" -} - -#include -#include "GncInstance.hpp" - -namespace gnc -{ -class Book_Class; -class Book; -class GncInstance; -} // END namespace gnc - -namespace gnc -{ -class Account; - -/** Wrapper around a gnucash ::QofBook pointer with C++ methods for - * easier setter and getter access. - */ -class Book : public GncInstance -{ -#ifndef DOXYGEN_SHOULD_SKIP_THIS - typedef Book CppObjectType; - typedef Book_Class CppClassType; - typedef ::QofBook BaseObjectType; - typedef ::QofBookClass BaseClassType; - -private: - friend class Book_Class; - static CppClassType book_class_; - -private: - // noncopyable - Book(const Book&); - Book& operator=(const Book&); - -protected: - explicit Book(const Glib::ConstructParams& construct_params); - explicit Book(QofBook* castitem); - -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ - -public: - virtual ~Book(); -#ifndef DOXYGEN_SHOULD_SKIP_THIS - static GType get_type() G_GNUC_CONST; - static GType get_base_type() G_GNUC_CONST; -#endif - - ///Provides access to the underlying C GObject. - QofBook* gobj() - { - return reinterpret_cast(gobject_); - } - - ///Provides access to the underlying C GObject. - const QofBook* gobj() const - { - return reinterpret_cast(gobject_); - } - - ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. - QofBook* gobj_copy(); - -private: -public: - - - Glib::RefPtr get_root_account(); - bool is_readonly() const - { - return qof_book_is_readonly(gobj()); - } - void mark_readonly() - { - qof_book_mark_readonly(gobj()); - } - void string_option_set (const Glib::ustring& opt_name, const Glib::ustring& opt_val); - Glib::ustring string_option_get (const Glib::ustring& opt_name) const; - bool string_option_exists (const Glib::ustring& opt_name) const; -}; - -} // END namespace gnc - -namespace Glib -{ -/** A Glib::wrap() method for this object. - * - * @param object The C instance. - * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. - * @result A C++ instance that wraps this C instance. - * - * @relates Gio::FileInfo - */ -Glib::RefPtr wrap(::QofBook* object, bool refuse_ownership = true); -} - -#endif diff --git a/src/optional/gtkmm/gncmm/Commodity.cpp b/src/optional/gtkmm/gncmm/Commodity.cpp deleted file mode 100644 index 6b291a5fa7..0000000000 --- a/src/optional/gtkmm/gncmm/Commodity.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Commodity.cpp - * Copyright (C) 2011 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#include "Commodity.hpp" -#include "private/Commodity_p.hpp" - - -namespace Glib -{ - -Glib::RefPtr wrap(gnc_commodity* object, bool take_copy) -{ - return Glib::RefPtr( dynamic_cast (Glib::wrap_auto ((GObject*)(object), take_copy)) ); - //We use dynamic_cast<> in case of multiple inheritance. -} - -} /* namespace Glib */ - - -namespace gnc -{ - - -/* The *_Class implementation: */ - -const Glib::Class& Commodity_Class::init() -{ - if (!gtype_) // create the GType if necessary - { - // Glib::Class has to know the class init function to clone custom types. - class_init_func_ = &Commodity_Class::class_init_function; - - // This is actually just optimized away, apparently with no harm. - // Make sure that the parent type has been created. - //CppClassParent::CppObjectType::get_type(); - - // Create the wrapper type, with the same class/instance size as the base type. - register_derived_type(gnc_commodity_get_type()); - - // Add derived versions of interfaces, if the C type implements any interfaces: - - } - - return *this; -} - - -void Commodity_Class::class_init_function(void* g_class, void* class_data) -{ - BaseClassType *const klass = static_cast(g_class); - CppClassParent::class_init_function(klass, class_data); -} - - -Glib::ObjectBase* Commodity_Class::wrap_new(GObject* object) -{ - return new Commodity((gnc_commodity*)object); -} - - -/* The implementation: */ - -gnc_commodity* Commodity::gobj_copy() -{ - reference(); - return gobj(); -} - -Commodity::Commodity(const Glib::ConstructParams& construct_params) - : GncInstance(construct_params) -{ - -} - -Commodity::Commodity(gnc_commodity* castitem) - : GncInstance((::QofInstance*)(castitem)) -{} - - -Commodity::~Commodity() -{} - - -Commodity::CppClassType Commodity::commodity_class_; // initialize static member - -GType Commodity::get_type() -{ - return commodity_class_.init().get_type(); -} - - -GType Commodity::get_base_type() -{ - return gnc_commodity_get_type(); -} - - - -} // END namespace gnc diff --git a/src/optional/gtkmm/gncmm/Commodity.hpp b/src/optional/gtkmm/gncmm/Commodity.hpp deleted file mode 100644 index f2e9f9f4e5..0000000000 --- a/src/optional/gtkmm/gncmm/Commodity.hpp +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Commodity.hpp - * Copyright (C) 2011 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#ifndef GNC_COMMODITY_HPP -#define GNC_COMMODITY_HPP - -// gnucash includes -#include "config.h" -#include "engine/guid.hpp" -extern "C" -{ -#include "qof.h" -#include "engine/gnc-commodity.h" -} - -#include -#include -#include "GncInstance.hpp" - -namespace gnc -{ -class Commodity_Class; -} // END namespace gnc - -namespace gnc -{ - -/** Wrapper around a gnucash \ref gnc_commodity object */ -class Commodity : public GncInstance -{ -#ifndef DOXYGEN_SHOULD_SKIP_THIS - typedef Commodity CppObjectType; - typedef Commodity_Class CppClassType; - typedef ::gnc_commodity BaseObjectType; - typedef ::gnc_commodityClass BaseClassType; - -private: - friend class Commodity_Class; - static CppClassType commodity_class_; - -private: - // noncopyable - Commodity(const Commodity&); - Commodity& operator=(const Commodity&); - -protected: - explicit Commodity(const Glib::ConstructParams& construct_params); - explicit Commodity(gnc_commodity* castitem); - -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ - -public: - virtual ~Commodity(); -#ifndef DOXYGEN_SHOULD_SKIP_THIS - static GType get_type() G_GNUC_CONST; - static GType get_base_type() G_GNUC_CONST; -#endif - - ///Provides access to the underlying C GObject. - gnc_commodity* gobj() - { - return reinterpret_cast(gobject_); - } - - ///Provides access to the underlying C GObject. - const gnc_commodity* gobj() const - { - return reinterpret_cast(gobject_); - } - - ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. - gnc_commodity* gobj_copy(); - -private: -public: - - Glib::ustring get_mnemonic() const - { - return gnc_commodity_get_mnemonic(gobj()); - } - Glib::ustring get_namespace() const - { - return gnc_commodity_get_namespace(gobj()); - } - Glib::ustring get_fullname() const - { - return gnc_commodity_get_fullname(gobj()); - } - Glib::ustring get_printname() const - { - return gnc_commodity_get_printname(gobj()); - } - - int get_fraction() const - { - return gnc_commodity_get_fraction(gobj()); - } - bool get_quote_flag() const - { - return gnc_commodity_get_quote_flag(gobj()); - } - - bool is_currency() const - { - return gnc_commodity_is_currency(gobj()); - } - - bool equal(const Commodity& other) const - { - return gnc_commodity_equal(gobj(), other.gobj()); - } -}; - -inline bool operator==(const Commodity& a, const Commodity& b) -{ - return a.equal(b); -} - -inline bool operator!=(const Commodity& a, const Commodity& b) -{ - return !(a == b); -} - -} // END namespace gnc - -namespace Glib -{ -/** A Glib::wrap() method for this object. - * - * @param object The C instance. - * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. - * @result A C++ instance that wraps this C instance. - * - * @relates Gio::FileInfo - */ -Glib::RefPtr wrap(gnc_commodity* object, bool refuse_ownership = true); -} - - -#endif diff --git a/src/optional/gtkmm/gncmm/GncInstance.cpp b/src/optional/gtkmm/gncmm/GncInstance.cpp deleted file mode 100644 index 498e1944f8..0000000000 --- a/src/optional/gtkmm/gncmm/GncInstance.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/* - * GncInstance.cpp - * Copyright (C) 2011 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#include "GncInstance.hpp" -#include "private/GncInstance_p.hpp" -#include "Book.hpp" -#include "qofinstance-p.h" - - -namespace Glib -{ - -Glib::RefPtr wrap(::QofInstance* object, bool take_copy) -{ - return Glib::RefPtr( dynamic_cast (Glib::wrap_auto ((GObject*)(object), take_copy)) ); - //We use dynamic_cast<> in case of multiple inheritance. -} - -} /* namespace Glib */ - - -namespace gnc -{ - - -/* The *_Class implementation: */ - -const Glib::Class& GncInstance_Class::init() -{ - if (!gtype_) // create the GType if necessary - { - // Glib::Class has to know the class init function to clone custom types. - class_init_func_ = &GncInstance_Class::class_init_function; - - // This is actually just optimized away, apparently with no harm. - // Make sure that the parent type has been created. - //CppClassParent::CppObjectType::get_type(); - - // Create the wrapper type, with the same class/instance size as the base type. - register_derived_type(qof_instance_get_type()); - - // Add derived versions of interfaces, if the C type implements any interfaces: - - } - - return *this; -} - - -void GncInstance_Class::class_init_function(void* g_class, void* class_data) -{ - BaseClassType *const klass = static_cast(g_class); - CppClassParent::class_init_function(klass, class_data); -} - - -Glib::ObjectBase* GncInstance_Class::wrap_new(GObject* object) -{ - return new GncInstance((::QofInstance*)object); -} - - -/* The implementation: */ - -::QofInstance* GncInstance::gobj_copy() -{ - reference(); - return gobj(); -} - -GncInstance::GncInstance(const Glib::ConstructParams& construct_params) - : Glib::Object(construct_params) -{ - -} - -GncInstance::GncInstance(::QofInstance* castitem) - : Glib::Object((GObject*)(castitem)) -{} - - -GncInstance::~GncInstance() -{} - - -GncInstance::CppClassType GncInstance::gncInstance_class_; // initialize static member - -GType GncInstance::get_type() -{ - return gncInstance_class_.init().get_type(); -} - - -GType GncInstance::get_base_type() -{ - return qof_instance_get_type(); -} - -void GncInstance::set_dirty() -{ - return qof_instance_set_dirty(gobj()); -} -void GncInstance::mark_clean() -{ - return qof_instance_mark_clean(gobj()); -} - - -// //////////////////////////////////////// - -Glib::RefPtr GncInstance::get_book() const -{ - return Glib::wrap(qof_instance_get_book (gobj())); -} -void GncInstance::set_book(Glib::RefPtr book) -{ - g_assert (book); - qof_instance_set_book(gobj(), book->gobj()); -} - - - -} // END namespace gnc diff --git a/src/optional/gtkmm/gncmm/GncInstance.hpp b/src/optional/gtkmm/gncmm/GncInstance.hpp deleted file mode 100644 index 14a8369785..0000000000 --- a/src/optional/gtkmm/gncmm/GncInstance.hpp +++ /dev/null @@ -1,128 +0,0 @@ -/* - * GncInstance.hpp - * Copyright (C) 2011 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#ifndef GNC_GNCINSTANCE_HPP -#define GNC_GNCINSTANCE_HPP - -// gnucash includes -#include "config.h" -#include "engine/guid.hpp" -extern "C" -{ -#include "qof.h" -} - -#include - -namespace gnc -{ -class Book; -class GncInstance; -class GncInstance_Class; -} // END namespace gnc - -namespace gnc -{ - -/** Wrapper for ::QofInstance - * This - * base class offers some common methods. - * - * We cannot name it QofInstance because those stupid C macros (like - * QOF_CHECK_TYPE) would always confuse our namespaced declaration - * with the C declaration. I hate macros! - */ -class GncInstance : public Glib::Object -{ -#ifndef DOXYGEN_SHOULD_SKIP_THIS - typedef GncInstance CppObjectType; - typedef GncInstance_Class CppClassType; - typedef ::QofInstance BaseObjectType; - typedef ::QofInstanceClass BaseClassType; - -private: - friend class GncInstance_Class; - static CppClassType gncInstance_class_; - -private: - // noncopyable - GncInstance(const GncInstance&); - GncInstance& operator=(const GncInstance&); - -protected: - explicit GncInstance(const Glib::ConstructParams& construct_params); - explicit GncInstance(::QofInstance* castitem); - -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ - -public: - virtual ~GncInstance(); -#ifndef DOXYGEN_SHOULD_SKIP_THIS - static GType get_type() G_GNUC_CONST; - static GType get_base_type() G_GNUC_CONST; -#endif - - ///Provides access to the underlying C GObject. - ::QofInstance* gobj() - { - return reinterpret_cast< ::QofInstance*>(gobject_); - } - - ///Provides access to the underlying C GObject. - const ::QofInstance* gobj() const - { - return reinterpret_cast< ::QofInstance*>(gobject_); - } - - ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. - ::QofInstance* gobj_copy(); - -public: - - Glib::RefPtr get_book() const; - void set_book(Glib::RefPtr book); - const ::GncGUID* get_guid() const - { - return qof_entity_get_guid(gobj_const()); - } - - bool is_dirty() const - { - return qof_instance_get_dirty(gobj_const()); - } - void set_dirty(); - void mark_clean(); - - //bool check_type(const char* type_id) { return (0 == g_strcmp0(type_id, QOF_INSTANCE(base_class::get())->e_type)); } - //Slots getSlots() const { return qof_instance_get_slots(QOF_INSTANCE(get())); } - -private: - /*const*/ - ::QofInstance* gobj_const() const - { - return const_cast< ::QofInstance*>(gobj()); - } -}; - -} // END namespace gnc - -#endif diff --git a/src/optional/gtkmm/gncmm/Numeric.cpp b/src/optional/gtkmm/gncmm/Numeric.cpp deleted file mode 100644 index ebdeda1282..0000000000 --- a/src/optional/gtkmm/gncmm/Numeric.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Numeric.cpp - * Copyright (C) 2011 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#include "Numeric.hpp" -#include "Account.hpp" -#include "Split.hpp" - -extern "C" -{ -#include "app-utils/gnc-exp-parser.h" -} - -namespace gnc -{ - -// These are in the cpp file to avoid circular dependency between the -// headers - -PrintAmountInfo::PrintAmountInfo(const Glib::RefPtr account, bool use_symbol) - : base_class(gnc_account_print_info(account->gobj(), use_symbol)) -{} -PrintAmountInfo::PrintAmountInfo(const Glib::RefPtr split, bool use_symbol) - : base_class(gnc_split_amount_print_info(split->gobj(), use_symbol)) -{} - -Glib::ustring Numeric::printAmount(const PrintAmountInfo& info) const -{ - char buf[256]; - if (!xaccSPrintAmount (buf, *this, info)) - buf[0] = '\0'; - return Glib::ustring(buf); -} - -Glib::ustring Numeric::parse(const Glib::ustring& str) -{ - Glib::ustring errorString; - - const char* input = str.c_str(); - char *error_loc; - Numeric result; - gboolean p = gnc_exp_parser_parse(input, &result, &error_loc); - if (p) - { - *this = result; - } - else - { - errorString = Glib::ustring(gnc_exp_parser_error_string()); - } - - return errorString; -} - - -} // END namespace gnc diff --git a/src/optional/gtkmm/gncmm/Numeric.hpp b/src/optional/gtkmm/gncmm/Numeric.hpp deleted file mode 100644 index 74e80419d4..0000000000 --- a/src/optional/gtkmm/gncmm/Numeric.hpp +++ /dev/null @@ -1,340 +0,0 @@ -/* - * Numeric.hpp - * Copyright (C) 2011 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#ifndef GNC_NUMERIC_HPP -#define GNC_NUMERIC_HPP - -// gnucash includes -#include "config.h" -#include "engine/guid.hpp" -extern "C" -{ -#include "qof.h" -#include "gnc-date.h" -#include "app-utils/gnc-ui-util.h" -#include "app-utils/gnc-ui-balances.h" -} - -#include -#include - -#if GLIB_HAVE_DATETIME -// Glib::DateTime is new in glibmm-2.29 but very useful -# include -#endif - -namespace gnc -{ - -class Account; -class Split; - -/** Conversion of a newly allocated gchar* to QString, which will - * correctly g_free() the newly allocated gchar* as well. - * - * If a gchar* does not have to be freed again, the standard - * conversion constructor Glib::ustring(const gchar*) is sufficient - * (as it expects its input in UTF-8) and we do not need to define an - * extra function for that. - */ -inline Glib::ustring gchar_to_ustring(gchar* tmp_string) -{ - if (!tmp_string) - return Glib::ustring(); - Glib::ustring result(tmp_string); // implies source string in UTF-8 - g_free(tmp_string); - return result; -} - -#if GLIB_HAVE_DATETIME -// Glib::DateTime is new in glibmm-2.29 but very useful -inline Glib::DateTime to_gdatetime(const ::Timespec& timespec) -{ - Glib::DateTime result = Glib::DateTime::create_now_utc(timespec.tv_sec); - result.add_seconds(timespec.tv_nsec * 1e-9); - return result; -} -inline ::Timespec to_timespec(const Glib::DateTime& gdt) -{ - ::Timespec result; - result.tv_sec = qdt.to_unix; - result.tv_nsec = qdt.get_microseconds() * 1000; - return result; -} -#endif - -/** Copies the pointer values from the given GList into the specified output - * list type, such as std::vector. */ -template -ResultListType from_glist(GList* glist) -{ - ResultListType result; - GList* list = glist; - while (list) - { - result.push_back(reinterpret_cast< typename ResultListType::value_type >(list->data)); - list = g_list_next(list); - } - return result; -} - -/** Wrapper around a gnucash ::GNCPrintAmountInfo structure with C++ - * methods for easier setter and getter access. - * - * Since this class is a derived class of the original gnucash struct, - * it keeps the data by-value and its member variables will always - * exist as long as this object exists. - */ -class PrintAmountInfo : public ::GNCPrintAmountInfo -{ -public: - typedef ::GNCPrintAmountInfo base_class; - - PrintAmountInfo(const base_class& other) - : base_class(other) - {} - PrintAmountInfo(bool use_symbol) - : base_class(gnc_default_print_info(use_symbol)) - {} - - /* If the boolean set to true, then prefix 3 letter ISO 4217 - currency code to the amount. */ - PrintAmountInfo(const Glib::RefPtr account, bool use_symbol); - PrintAmountInfo(const Glib::RefPtr split, bool use_symbol); - - static PrintAmountInfo share_places(int decplaces) - { - return gnc_share_print_info_places(decplaces); - } - static PrintAmountInfo default_share() - { - return gnc_default_share_print_info(); - } - static PrintAmountInfo default_price() - { - return gnc_default_price_print_info(); - } - static PrintAmountInfo integral() - { - return gnc_integral_print_info(); - } -}; - - -/** Wrapper around a gnucash ::gnc_numeric structure with C++ methods - * for easier setter and getter access. - * - * Since this class is a derived class of the original gnucash struct, - * it keeps the data by-value and its member variables will always - * exist as long as this object exists. - */ -class Numeric : public ::gnc_numeric -{ -public: - typedef ::gnc_numeric base_class; - - /// Constructor for value zero - Numeric() - { - base_class::num = 0; - base_class::denom = 1; - } - - /// Constructor with given nominator and denominator - Numeric(gint64 num, gint64 denom) - { - base_class::num = num; - base_class::denom = denom; - } - - /// Copy constructor - Numeric(const base_class& other) : base_class(other) {} - - /// Constructor for value zero - static Numeric zero() - { - return Numeric(0, 1); - } - - /// Constructor for value one - static Numeric one() - { - return Numeric(1, 1); - } - - /// Conversion from a double value, with the given target - /// denominator and the specified rounding method "how". - Numeric(double in, gint64 denom, gint how) - { - *this = double_to_gnc_numeric(in, denom, how); - } - - /// Watch out: This conversion never seems to work! - static bool string_to_numeric(const Glib::ustring& str, Numeric& n) - { - return string_to_gnc_numeric(str.c_str(), &n); - } - - /// Constructor for representing any of the given - /// GNCNumericErrorCode values - Numeric(GNCNumericErrorCode error_code) - { - *this = gnc_numeric_error(error_code); - } - - /// Returns the numerator - gint64 num() const - { - return base_class::num; - } - /// Returns the denominator - gint64 denom() const - { - return base_class::denom; - } - /// Conversion to double - gdouble to_double() const - { - return gnc_numeric_to_double(*this); - } - - /// Conversion to string, but only as a fractional representation - /// i.e. "123/456". Use printAmount() for user-visible values - /// instead. - Glib::ustring to_string() const - { - return gchar_to_ustring(gnc_numeric_to_string(*this)); - } - - GNCNumericErrorCode check() const - { - return gnc_numeric_check(*this); - } - gint compare(const Numeric& b) const - { - return gnc_numeric_compare(*this, b); - } - bool zero_p() const - { - return gnc_numeric_zero_p(*this); - } - bool negative_p() const - { - return gnc_numeric_negative_p(*this); - } - bool positive_p() const - { - return gnc_numeric_positive_p(*this); - } - bool eq(const Numeric& b) const - { - return gnc_numeric_eq(*this, b); - } - bool equal(const Numeric& b) const - { - return gnc_numeric_equal(*this, b); - } - bool same(const Numeric& b, gint64 denom, gint how) const - { - return gnc_numeric_same(*this, b, denom, how); - } - - Numeric add(const Numeric& b, gint64 denom, gint how) const - { - return gnc_numeric_add(*this, b, denom, how); - } - Numeric sub(const Numeric& b, gint64 denom, gint how) const - { - return gnc_numeric_sub(*this, b, denom, how); - } - Numeric mul(const Numeric& b, gint64 denom, gint how) const - { - return gnc_numeric_mul(*this, b, denom, how); - } - Numeric div(const Numeric& b, gint64 denom, gint how) const - { - return gnc_numeric_div(*this, b, denom, how); - } - Numeric neg() const - { - return gnc_numeric_neg(*this); - } - Numeric abs() const - { - return gnc_numeric_abs(*this); - } - - Numeric add_fixed(const Numeric& b) const - { - return gnc_numeric_add_fixed(*this, b); - } - Numeric sub_fixed(const Numeric& b) const - { - return gnc_numeric_sub_fixed(*this, b); - } - - Numeric reduce() const - { - return gnc_numeric_reduce(*this); - } - - Glib::ustring printAmount(const PrintAmountInfo& info) const; - - /** Parses the given string by the expression parser. On success, - * the value is written into this object and an empty string is - * returned. On error, this object is unchanged and a string with - * the error message is returned. */ - Glib::ustring parse(const Glib::ustring& str); -}; - -inline bool operator==(const Numeric& a, const Numeric& b) -{ - return a.equal(b); -} - -inline bool operator!=(const Numeric& a, const Numeric& b) -{ - return !(a == b); -} - -/// Returns the negative value of a -inline Numeric operator-(const Numeric& a) -{ - return a.neg(); -} - -/// Returns a + b -inline Numeric operator+(const Numeric& a, const Numeric& b) -{ - return a.add_fixed(b); -} - -/// Returns a - b -inline Numeric operator-(const Numeric& a, const Numeric& b) -{ - return a.sub_fixed(b); -} - -} // END namespace gnc - - -#endif diff --git a/src/optional/gtkmm/gncmm/Split.cpp b/src/optional/gtkmm/gncmm/Split.cpp deleted file mode 100644 index d4fe73a4d6..0000000000 --- a/src/optional/gtkmm/gncmm/Split.cpp +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Split.cpp - * Copyright (C) 2010 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#include "Split.hpp" - -#include "Account.hpp" -#include "Book.hpp" -#include "Transaction.hpp" -#include "private/Split_p.hpp" - -namespace Glib -{ - -Glib::RefPtr wrap(::Split* object, bool take_copy) -{ - return Glib::RefPtr( dynamic_cast (Glib::wrap_auto ((GObject*)(object), take_copy)) ); - //We use dynamic_cast<> in case of multiple inheritance. -} - -} /* namespace Glib */ - -namespace gnc -{ - -/* The *_Class implementation: */ - -const Glib::Class& Split_Class::init() -{ - if (!gtype_) // create the GType if necessary - { - // Glib::Class has to know the class init function to clone custom types. - class_init_func_ = &Split_Class::class_init_function; - - // This is actually just optimized away, apparently with no harm. - // Make sure that the parent type has been created. - //CppClassParent::CppObjectType::get_type(); - - // Create the wrapper type, with the same class/instance size as the base type. - register_derived_type(gnc_split_get_type()); - - // Add derived versions of interfaces, if the C type implements any interfaces: - - } - - return *this; -} - - -void Split_Class::class_init_function(void* g_class, void* class_data) -{ - BaseClassType *const klass = static_cast(g_class); - CppClassParent::class_init_function(klass, class_data); -} - - -Glib::ObjectBase* Split_Class::wrap_new(GObject* object) -{ - return new Split((::Split*)object); -} - - -/* The implementation: */ - -::Split* Split::gobj_copy() -{ - reference(); - return gobj(); -} - -Split::Split(const Glib::ConstructParams& construct_params) - : GncInstance(construct_params) -{ - -} - -Split::Split(::Split* castitem) - : GncInstance((::QofInstance*)(castitem)) -{} - - -Split::~Split() -{} - - -Split::CppClassType Split::split_class_; // initialize static member - -GType Split::get_type() -{ - return split_class_.init().get_type(); -} - - -GType Split::get_base_type() -{ - return gnc_split_get_type(); -} - - - -Glib::RefPtr Split::get_account() const -{ - return Glib::wrap(xaccSplitGetAccount(gobj())); -} -void Split::set_account(Glib::RefPtr acc) -{ - if (acc) xaccSplitSetAccount(gobj(), acc->gobj()); -} -void Split::set_account(::Account* acc) -{ - xaccSplitSetAccount(gobj(), acc); -} - - -Glib::RefPtr Split::get_parent() const -{ - return Glib::wrap(xaccSplitGetParent(gobj())); -} -void Split::set_parent(Glib::RefPtr trans) -{ - if (trans) xaccSplitSetParent(gobj(), trans->gobj()); -} -void Split::set_parent(Transaction& trans) -{ - xaccSplitSetParent(gobj(), trans.gobj()); -} - -Glib::RefPtr Split::get_other_split() const -{ - return Glib::wrap(xaccSplitGetOtherSplit(gobj())); -} - - -TmpSplit::TmpSplit(const Glib::RefPtr& s, const TmpTransaction* parent_trans) - : m_account(s->get_account()->gobj()) - , m_parent(parent_trans) - , m_memo(s->get_memo()) - , m_action(s->get_action()) - , m_reconcile(s->get_reconcile()) - , m_amount(s->get_amount()) - , m_value(s->get_value()) -{} - -TmpSplit::TmpSplit(::Account* account) -{ - clear(account); -} - -TmpSplit* TmpSplit::get_other_split() const -{ - if (!m_parent) - return NULL; - const TmpTransaction& p = *m_parent; - if (p.get_num_splits() != 2) - return NULL; - TmpTransaction::TmpSplitList& splits = const_cast(p).get_splits(); - if (splits.front().get_account() != m_account) - return &splits.front(); - else - return &splits.back(); -} - -void TmpSplit::clear(::Account* account) -{ - m_account = account; - m_parent = NULL; - m_memo.clear(); - m_action.clear(); - m_reconcile = NREC; - m_amount = Numeric::zero(); - m_value = Numeric::zero(); -} - -void TmpSplit::copy_into(Glib::RefPtr t) const -{ - g_assert(t); - Glib::RefPtr s(Glib::wrap(xaccMallocSplit(t->get_book()->gobj()))); - s->set_account(m_account); - s->set_parent(t); - s->set_memo(m_memo); - s->set_action(m_action); - s->set_reconcile(m_reconcile); - s->set_amount(m_amount); - s->set_value(m_value); -} - -} // END namespace gnc diff --git a/src/optional/gtkmm/gncmm/Split.hpp b/src/optional/gtkmm/gncmm/Split.hpp deleted file mode 100644 index 0465bc5b62..0000000000 --- a/src/optional/gtkmm/gncmm/Split.hpp +++ /dev/null @@ -1,322 +0,0 @@ -/* - * Split.hpp - * Copyright (C) 2011 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#ifndef GNC_SPLIT_HPP -#define GNC_SPLIT_HPP - -// gnucash includes -#include "config.h" -#include "engine/guid.hpp" -extern "C" -{ -#include "qof.h" -#include "engine/Split.h" -} - -#include -#include -#include -#include - -#include "GncInstance.hpp" -#include "Numeric.hpp" - -namespace gnc -{ -class Split_Class; -} // END namespace gnc - -namespace gnc -{ -class Book; -class Account; -class Transaction; -class TmpTransaction; - -typedef std::vector< ::Split*> SplitQList; - -/** Wrapper around a gnucash ::Split pointer with C++ methods for - * easier setter and getter access. - */ -class Split : public GncInstance -{ -#ifndef DOXYGEN_SHOULD_SKIP_THIS - typedef Split CppObjectType; - typedef Split_Class CppClassType; - typedef ::Split BaseObjectType; - typedef ::SplitClass BaseClassType; - -private: - friend class Split_Class; - static CppClassType split_class_; - -private: - // noncopyable - Split(const Split&); - Split& operator=(const Split&); - -protected: - explicit Split(const Glib::ConstructParams& construct_params); - explicit Split(::Split* castitem); - -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ - -public: - virtual ~Split(); -#ifndef DOXYGEN_SHOULD_SKIP_THIS - static GType get_type() G_GNUC_CONST; - static GType get_base_type() G_GNUC_CONST; -#endif - - ///Provides access to the underlying C GObject. - ::Split* gobj() - { - return reinterpret_cast< ::Split*>(gobject_); - } - - ///Provides access to the underlying C GObject. - const ::Split* gobj() const - { - return reinterpret_cast< ::Split*>(gobject_); - } - - ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. - ::Split* gobj_copy(); - -private: -public: - - - Glib::RefPtr get_account() const; - void set_account(Glib::RefPtr acc); - void set_account(::Account* acc); - - Glib::RefPtr get_parent() const; - void set_parent(Glib::RefPtr trans); - void set_parent(Transaction& trans); - - Glib::ustring get_memo() const - { - return xaccSplitGetMemo(gobj()); - } - void set_memo(const Glib::ustring& v) - { - xaccSplitSetMemo(gobj(), v.c_str()); - } - - Glib::ustring get_action() const - { - return xaccSplitGetAction(gobj()); - } - void set_action(const Glib::ustring& v) - { - xaccSplitSetAction(gobj(), v.c_str()); - } - - char get_reconcile() const - { - return xaccSplitGetReconcile(gobj()); - } - void set_reconcile(char v) - { - xaccSplitSetReconcile(gobj(), v); - } - - Glib::RefPtr get_other_split() const; - - Glib::ustring get_corr_account_full_name() const - { - return gchar_to_ustring(xaccSplitGetCorrAccountFullName(gobj())); - } - Glib::ustring get_corr_account_name() const - { - return xaccSplitGetCorrAccountName(gobj()); - } - Glib::ustring get_corr_account_code() const - { - return xaccSplitGetCorrAccountCode(gobj()); - } - - void set_amount(const Numeric& amount) - { - xaccSplitSetAmount(gobj(), amount); - } - Numeric get_amount() const - { - return xaccSplitGetAmount(gobj()); - } - void set_value(const Numeric& value) - { - xaccSplitSetValue(gobj(), value); - } - Numeric get_value() const - { - return xaccSplitGetValue(gobj()); - } - Numeric get_share_price() const - { - return xaccSplitGetSharePrice(gobj()); - } - Numeric get_balance() const - { - return xaccSplitGetBalance(gobj()); - } - Numeric get_cleared_balance() const - { - return xaccSplitGetClearedBalance(gobj()); - } - Numeric get_reconciled_balance() const - { - return xaccSplitGetReconciledBalance(gobj()); - } - - - static SplitQList from_glist(GList* glist) - { - return gnc::from_glist(glist); - } -}; - - -/** This is a temporary split which belongs to a temporary transaction - * (class gnc::TmpTransaction). Each of this tmp splits has all data - * fields just like a "real" split, but it is not (yet) added to the - * respective Account and Book. In other words, it is not stored in - * the book yet. - * - * For this reason this class supports a full copy-by-value, which - * will create new independent instances of all data fields. */ -class TmpSplit -{ -public: - /** Creates a new tmp split whose content is copied from the given - * real transaction and it should belong to the given - * TmpTransaction (but it is not added to the TmpTransaction's - * split list here). */ - TmpSplit(const Glib::RefPtr& s, const TmpTransaction* parent_trans); - - /** Creates a new empty tmp split, with the Account pointer - * initialized with the given value. */ - TmpSplit(::Account* account = NULL); - - /** Clears all data fields of this split. */ - void clear(::Account* account = NULL); - - /** Copies the content of this tmp split into the given real - * transaction by allocating a new real gnc::Split and adding it - * to the given real gnc::Transaction. */ - void copy_into(Glib::RefPtr t) const; - - ::Account* get_account() const - { - return m_account; - } - void set_account(::Account* v) - { - m_account = v; - } - - const TmpTransaction* get_parent() const - { - return m_parent; - } - void set_parent(const TmpTransaction* v) - { - m_parent = v; - } - - /** Returns a pointer to the "Other" split if it exists, or NULL - * if none or multiple of them exist. */ - TmpSplit* get_other_split() const; - - Glib::ustring get_memo() const - { - return m_memo; - } - void set_memo(const Glib::ustring& v) - { - m_memo = v; - } - - Glib::ustring get_action() const - { - return m_action; - } - void set_action(const Glib::ustring& v) - { - m_action = v; - } - - char get_reconcile() const - { - return m_reconcile; - } - void set_reconcile(char v) - { - m_reconcile = v; - } - - Numeric get_amount() const - { - return m_amount; - } - void set_amount(const Numeric& v) - { - m_amount = v; - } - - Numeric get_value() const - { - return m_value; - } - void set_value(const Numeric& v) - { - m_value = v; - } - -private: - ::Account* m_account; - const TmpTransaction* m_parent; - Glib::ustring m_memo; - Glib::ustring m_action; - char m_reconcile; - Numeric m_amount; - Numeric m_value; -}; - -} // END namespace gnc - -namespace Glib -{ -/** A Glib::wrap() method for this object. - * - * @param object The C instance. - * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. - * @result A C++ instance that wraps this C instance. - * - * @relates Gio::FileInfo - */ -Glib::RefPtr wrap(::Split* object, bool refuse_ownership = true); -} - - -#endif diff --git a/src/optional/gtkmm/gncmm/Transaction.cpp b/src/optional/gtkmm/gncmm/Transaction.cpp deleted file mode 100644 index ecc31d08b8..0000000000 --- a/src/optional/gtkmm/gncmm/Transaction.cpp +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Transaction.cpp - * Copyright (C) 2011 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#include "Transaction.hpp" -#include "Split.hpp" -#include -#if HAVE_GLIBMM_VECTORUTILS_H -// new in glibmm-2.29 -#include -#endif -#include "private/Transaction_p.hpp" - -namespace Glib -{ - -Glib::RefPtr wrap(::Transaction* object, bool take_copy) -{ - return Glib::RefPtr( dynamic_cast (Glib::wrap_auto ((GObject*)(object), take_copy)) ); - //We use dynamic_cast<> in case of multiple inheritance. -} - -} /* namespace Glib */ - -namespace gnc -{ - -/* The *_Class implementation: */ - -const Glib::Class& Transaction_Class::init() -{ - if (!gtype_) // create the GType if necessary - { - // Glib::Class has to know the class init function to clone custom types. - class_init_func_ = &Transaction_Class::class_init_function; - - // This is actually just optimized away, apparently with no harm. - // Make sure that the parent type has been created. - //CppClassParent::CppObjectType::get_type(); - - // Create the wrapper type, with the same class/instance size as the base type. - register_derived_type(gnc_transaction_get_type()); - - // Add derived versions of interfaces, if the C type implements any interfaces: - - } - - return *this; -} - - -void Transaction_Class::class_init_function(void* g_class, void* class_data) -{ - BaseClassType *const klass = static_cast(g_class); - CppClassParent::class_init_function(klass, class_data); -} - - -Glib::ObjectBase* Transaction_Class::wrap_new(GObject* object) -{ - return new Transaction((::Transaction*)object); -} - - -/* The implementation: */ - -::Transaction* Transaction::gobj_copy() -{ - reference(); - return gobj(); -} - -Transaction::Transaction(const Glib::ConstructParams& construct_params) - : GncInstance(construct_params) -{ - -} - -Transaction::Transaction(::Transaction* castitem) - : GncInstance((::QofInstance*)(castitem)) -{} - - -Transaction::~Transaction() -{} - - -Transaction::CppClassType Transaction::transaction_class_; // initialize static member - -GType Transaction::get_type() -{ - return transaction_class_.init().get_type(); -} - - -GType Transaction::get_base_type() -{ - return gnc_transaction_get_type(); -} - - - -Glib::RefPtr Transaction::find_split_by_account(const Account& acc) const -{ - return Glib::wrap(xaccTransFindSplitByAccount(gobj(), acc.gobj())); -} -Glib::RefPtr Transaction::get_split(int i) const -{ - return Glib::wrap(xaccTransGetSplit(gobj(), i)); -} -void Transaction::append_split(Glib::RefPtr split) -{ - g_assert(split); - xaccSplitSetParent(split->gobj(), gobj()); -} -int Transaction::get_split_index(const Split& split) const -{ - return xaccTransGetSplitIndex(gobj(), split.gobj()); -} -::Transaction* Transaction::new_instance(const Glib::RefPtr b) -{ - if (b) - return xaccMallocTransaction (const_cast< ::QofBook*>(b->gobj())); - else - return NULL; -} - -// //////////////////////////////////////////////////////////// - -TmpTransaction::TmpTransaction() -{ - clear(); -} -TmpTransaction::TmpTransaction(const Transaction& t) - : m_num(t.get_num()) - , m_description(t.get_description()) - , m_notes(t.get_notes()) - , m_commodity(t.get_currency()) - , m_datePosted(t.get_date_posted()) - , m_dateTimeEntered(t.get_date_entered_tt()) -{ - SplitQList slist = Split::from_glist(t.get_split_list()); - for (SplitQList::const_iterator iter = slist.begin(); iter != slist.end(); ++iter) - { - m_splits.push_back(TmpSplit(Glib::wrap(*iter), this)); - } -} - -void TmpTransaction::clear() -{ - m_splits.clear(); - reset_content(); -} - -void TmpTransaction::reset_content() -{ - m_num.clear(); - m_description.clear(); - m_notes.clear(); - m_commodity.reset(); - m_datePosted = Glib::Date(); - m_dateTimeEntered = 0; - for (int i = 0; i < m_splits.size(); ++i) - { - TmpSplit& split = m_splits[i]; - split.clear(); - split.set_parent(this); - } -} - -void TmpTransaction::copy_to(Glib::RefPtr t) const -{ - assert(t); - t->set_num(m_num); - t->set_description(m_description); - if (!m_notes.empty()) - t->set_notes(m_notes); - t->set_currency(m_commodity); - t->set_date_posted(m_datePosted); - t->set_date_entered(m_dateTimeEntered); - for (int i = 0; i < m_splits.size(); ++i) - { - m_splits[i].copy_into(t); - } -} - -Glib::RefPtr TmpTransaction::create_as_real() const -{ - assert (!m_splits.empty()); - Glib::RefPtr acc(Glib::wrap(m_splits.front().get_account())); - assert (acc); - Glib::RefPtr book(acc->get_book()); - assert (book); - Glib::RefPtr trans(Glib::wrap(Transaction::new_instance(book))); - trans->begin_edit(); - copy_to(trans); - trans->commit_edit(); - return trans; -} - -void TmpTransaction::push_back(const TmpSplit& s) -{ - m_splits.push_back(s); - m_splits.back().set_parent(this); -} - -} // END namespace gnc diff --git a/src/optional/gtkmm/gncmm/Transaction.hpp b/src/optional/gtkmm/gncmm/Transaction.hpp deleted file mode 100644 index c921739a17..0000000000 --- a/src/optional/gtkmm/gncmm/Transaction.hpp +++ /dev/null @@ -1,336 +0,0 @@ -/* - * Transaction.hpp - * Copyright (C) 2011 Christian Stimming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -#ifndef GNC_TRANSACTION_HPP -#define GNC_TRANSACTION_HPP - -// gnucash includes -#include "config.h" -#include "libqof/qof/guid.hpp" -extern "C" -{ -#include "qof.h" -#include "engine/Transaction.h" -} - -#include "Account.hpp" -#include "Book.hpp" -#include "Commodity.hpp" -#include "Numeric.hpp" -#include "GncInstance.hpp" -#include "Split.hpp" - -#include -#include -#include -#include - -namespace gnc -{ -class Transaction_Class; -} // END namespace gnc - -namespace gnc -{ -class Account; -class Split; -class TmpSplit; - -/** Wrapper around a gnucash ::Transaction pointer with C++ methods for - * easier setter and getter access. - */ -class Transaction : public GncInstance -{ -#ifndef DOXYGEN_SHOULD_SKIP_THIS - typedef Transaction CppObjectType; - typedef Transaction_Class CppClassType; - typedef ::Transaction BaseObjectType; - typedef ::TransactionClass BaseClassType; - -private: - friend class Transaction_Class; - static CppClassType transaction_class_; - -private: - // noncopyable - Transaction(const Transaction&); - Transaction& operator=(const Transaction&); - -protected: - explicit Transaction(const Glib::ConstructParams& construct_params); - explicit Transaction(::Transaction* castitem); - -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ - -public: - virtual ~Transaction(); -#ifndef DOXYGEN_SHOULD_SKIP_THIS - static GType get_type() G_GNUC_CONST; - static GType get_base_type() G_GNUC_CONST; -#endif - - ///Provides access to the underlying C GObject. - ::Transaction* gobj() - { - return reinterpret_cast< ::Transaction*>(gobject_); - } - - ///Provides access to the underlying C GObject. - const ::Transaction* gobj() const - { - return reinterpret_cast< ::Transaction*>(gobject_); - } - - ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. - ::Transaction* gobj_copy(); - -private: -public: - - void begin_edit() - { - xaccTransBeginEdit(gobj()); - } - void commit_edit() - { - xaccTransCommitEdit(gobj()); - } - void rollback_edit() - { - xaccTransRollbackEdit(gobj()); - } - bool is_open() const - { - return xaccTransIsOpen(gobj()); - } - - - Glib::ustring get_num() const - { - return xaccTransGetNum(gobj()); - } - void set_num(const Glib::ustring& v) - { - xaccTransSetNum(gobj(), v.c_str()); - } - - Glib::ustring get_description() const - { - return xaccTransGetDescription(gobj()); - } - void set_description(const Glib::ustring& v) - { - xaccTransSetDescription(gobj(), v.c_str()); - } - - Glib::ustring get_notes() const - { - return xaccTransGetNotes(gobj()); - } - void set_notes(const Glib::ustring& v) - { - xaccTransSetNotes(gobj(), v.c_str()); - } - - int get_num_splits() const - { - return xaccTransCountSplits(gobj()); - } - Glib::RefPtr find_split_by_account(const Account& acc) const; - void append_split(Glib::RefPtr split); - Glib::RefPtr get_split(int i) const; - int get_split_index(const Split& split) const; - ::SplitList* get_split_list() const - { - return xaccTransGetSplitList(gobj()); - } - - Glib::RefPtr get_currency() const - { - return Glib::wrap(xaccTransGetCurrency(gobj())); - } - void set_currency(const Glib::RefPtr& c) - { - if (c) xaccTransSetCurrency(gobj(), c->gobj()); - } - - Numeric get_imbalance_value() const - { - return xaccTransGetImbalanceValue(gobj()); - } - bool is_balanced() const - { - return xaccTransIsBalanced(gobj()); - } - Numeric get_account_conv_rate(const Account& acc) const - { - return xaccTransGetAccountConvRate(gobj(), acc.gobj()); - } - - void set_date_posted(const Glib::Date& d) - { - xaccTransSetDatePostedGDate(gobj(), *d.gobj()); - } - Glib::Date get_date_posted() const - { - return Glib::Date(xaccTransGetDatePostedGDate(gobj())); - } - void set_date_entered(time_t t) - { - xaccTransSetDateEnteredSecs(gobj(), t); - } -// void set_date_entered(const Glib::DateTime& t) { xaccTransSetDateEnteredSecs(gobj(), t.toTime_t()); } - time_t get_date_entered_tt() const - { - return timespecToTime64 (xaccTransRetDateEnteredTS(gobj())); - } - //Glib::DateTime get_date_entered() const { return toGDateTime(xaccTransRetDateEnteredTS(gobj())); } - - static ::Transaction* new_instance(const Glib::RefPtr b); -}; - - -/** This is a temporary transaction. Each of this tmp transactions has - * all data fields just like a "real" transaction, but it is not (yet) - * added to the respective Account and Book. In other words, it is not - * stored in the book yet. - * - * For this reason this class supports a full copy-by-value, which - * will create new independent instances of all data fields. */ -class TmpTransaction -{ -public: - typedef std::vector TmpSplitList; - - /** Creates an empty tmp transaction */ - TmpTransaction(); - - /** Creates a tmp transaction whose content is copied from the - * given real transaction */ - TmpTransaction(const Transaction& t); - - /** Clears all data fields of this transaction, including deletion - * of all splits stored here. */ - void clear(); - - /** Clears all data fields, but does not delete the splits and - * instead only resets the data fields of all splits */ - void reset_content(); - - /** Copies the content of this tmp transaction into the given real - * transaction. */ - void copy_to(Glib::RefPtr t) const; - - /** Allocates a new real transaction in the Book and Account as - * stored in the tmp transaction, copies the content of this tmp - * transaction into the newly allocated one, and returns the - * pointer to the newly created real transaction. */ - Glib::RefPtr create_as_real() const; - - Glib::ustring get_num() const - { - return m_num; - } - void set_num(const Glib::ustring& v) - { - m_num = v; - } - - Glib::ustring get_description() const - { - return m_description; - } - void set_description(const Glib::ustring& v) - { - m_description = v; - } - - void push_back(const TmpSplit& s); - const TmpSplitList& get_splits() const - { - return m_splits; - } - TmpSplitList& get_splits() - { - return m_splits; - } - int get_num_splits() const - { - return m_splits.size(); - } - - Glib::RefPtr get_commodity() const - { - return m_commodity; - } - void set_commodity(const Glib::RefPtr& v) - { - m_commodity = v; - } - - Glib::Date get_date_posted() const - { - return m_datePosted; - } - void set_date_posted(const Glib::Date& v) - { - m_datePosted = v; - } - - time_t get_date_entered_tt() const - { - return m_dateTimeEntered; - } - void set_date_entered(time_t v) - { - m_dateTimeEntered = v; - } - //Glib::DateTime get_date_entered() const { return m_dateTimeEntered; } - //void set_date_entered(const Glib::DateTime& v) { m_dateTimeEntered = v; } - -private: - Glib::ustring m_num; - Glib::ustring m_description; - Glib::ustring m_notes; - TmpSplitList m_splits; - Glib::RefPtr m_commodity; - Glib::Date m_datePosted; - time_t m_dateTimeEntered; - //Glib::DateTime m_dateTimeEntered; -}; - -} // END namespace gnc - -namespace Glib -{ -/** A Glib::wrap() method for this object. - * - * @param object The C instance. - * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. - * @result A C++ instance that wraps this C instance. - * - * @relates Gio::FileInfo - */ -Glib::RefPtr wrap(::Transaction* object, bool refuse_ownership = true); -} - -#endif diff --git a/src/optional/gtkmm/gncmm/private/Account_p.hpp b/src/optional/gtkmm/gncmm/private/Account_p.hpp deleted file mode 100644 index e73a3160c5..0000000000 --- a/src/optional/gtkmm/gncmm/private/Account_p.hpp +++ /dev/null @@ -1,48 +0,0 @@ -// -*- c++ -*- -// Generated by gtkmmproc -- DO NOT MODIFY! -#ifndef _GNCMM_PRIVATE_ACCOUNT_P_HPP -#define _GNCMM_PRIVATE_ACCOUNT_P_HPP - - -#include - -#include - -namespace gnc -{ - -class Account_Class : public Glib::Class -{ -public: -#ifndef DOXYGEN_SHOULD_SKIP_THIS - typedef Account CppObjectType; - typedef ::Account BaseObjectType; - typedef ::AccountClass BaseClassType; - typedef Glib::Object_Class CppClassParent; - typedef GObjectClass BaseClassParent; - - friend class Account; -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ - - const Glib::Class& init(); - - - static void class_init_function(void* g_class, void* class_data); - - static Glib::ObjectBase* wrap_new(GObject*); - -protected: - - //Callbacks (default signal handlers): - //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. - //You could prevent the original default signal handlers being called by overriding the *_impl method. - - //Callbacks (virtual functions): -}; - - -} // namespace gnc - - -#endif /* _GNCMM_PRIVATE_ACCOUNT_P_HPP */ - diff --git a/src/optional/gtkmm/gncmm/private/Book_p.hpp b/src/optional/gtkmm/gncmm/private/Book_p.hpp deleted file mode 100644 index b24dbe1f8b..0000000000 --- a/src/optional/gtkmm/gncmm/private/Book_p.hpp +++ /dev/null @@ -1,48 +0,0 @@ -// -*- c++ -*- -// Generated by gtkmmproc -- DO NOT MODIFY! -#ifndef _GNCMM_PRIVATE_BOOK_P_HPP -#define _GNCMM_PRIVATE_BOOK_P_HPP - - -#include - -#include - -namespace gnc -{ - -class Book_Class : public Glib::Class -{ -public: -#ifndef DOXYGEN_SHOULD_SKIP_THIS - typedef Book CppObjectType; - typedef QofBook BaseObjectType; - typedef QofBookClass BaseClassType; - typedef Glib::Object_Class CppClassParent; - typedef GObjectClass BaseClassParent; - - friend class Book; -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ - - const Glib::Class& init(); - - - static void class_init_function(void* g_class, void* class_data); - - static Glib::ObjectBase* wrap_new(GObject*); - -protected: - - //Callbacks (default signal handlers): - //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. - //You could prevent the original default signal handlers being called by overriding the *_impl method. - - //Callbacks (virtual functions): -}; - - -} // namespace gnc - - -#endif /* _GNCMM_PRIVATE_BOOK_P_HPP */ - diff --git a/src/optional/gtkmm/gncmm/private/Commodity_p.hpp b/src/optional/gtkmm/gncmm/private/Commodity_p.hpp deleted file mode 100644 index 816fd9d731..0000000000 --- a/src/optional/gtkmm/gncmm/private/Commodity_p.hpp +++ /dev/null @@ -1,48 +0,0 @@ -// -*- c++ -*- -// Generated by gtkmmproc -- DO NOT MODIFY! -#ifndef _GNCMM_GNC_COMMODITY_P_H -#define _GNCMM_GNC_COMMODITY_P_H - - -#include - -#include - -namespace gnc -{ - -class Commodity_Class : public Glib::Class -{ -public: -#ifndef DOXYGEN_SHOULD_SKIP_THIS - typedef Commodity CppObjectType; - typedef gnc_commodity BaseObjectType; - typedef gnc_commodityClass BaseClassType; - typedef Glib::Object_Class CppClassParent; - typedef GObjectClass BaseClassParent; - - friend class Commodity; -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ - - const Glib::Class& init(); - - - static void class_init_function(void* g_class, void* class_data); - - static Glib::ObjectBase* wrap_new(GObject*); - -protected: - - //Callbacks (default signal handlers): - //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. - //You could prevent the original default signal handlers being called by overriding the *_impl method. - - //Callbacks (virtual functions): -}; - - -} // namespace gnc - - -#endif /* _GNCMM_GNC_COMMODITY_P_H */ - diff --git a/src/optional/gtkmm/gncmm/private/GncInstance_p.hpp b/src/optional/gtkmm/gncmm/private/GncInstance_p.hpp deleted file mode 100644 index 62b30a8164..0000000000 --- a/src/optional/gtkmm/gncmm/private/GncInstance_p.hpp +++ /dev/null @@ -1,48 +0,0 @@ -// -*- c++ -*- -// Generated by gtkmmproc -- DO NOT MODIFY! -#ifndef _GNCMM_GNC_COMMODITY_P_H -#define _GNCMM_GNC_COMMODITY_P_H - - -#include - -#include - -namespace gnc -{ - -class GncInstance_Class : public Glib::Class -{ -public: -#ifndef DOXYGEN_SHOULD_SKIP_THIS - typedef GncInstance CppObjectType; - typedef ::QofInstance BaseObjectType; - typedef ::QofInstanceClass BaseClassType; - typedef Glib::Object_Class CppClassParent; - typedef GObjectClass BaseClassParent; - - friend class GncInstance; -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ - - const Glib::Class& init(); - - - static void class_init_function(void* g_class, void* class_data); - - static Glib::ObjectBase* wrap_new(GObject*); - -protected: - - //Callbacks (default signal handlers): - //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. - //You could prevent the original default signal handlers being called by overriding the *_impl method. - - //Callbacks (virtual functions): -}; - - -} // namespace gnc - - -#endif /* _GNCMM_GNC_COMMODITY_P_H */ - diff --git a/src/optional/gtkmm/gncmm/private/Split_p.hpp b/src/optional/gtkmm/gncmm/private/Split_p.hpp deleted file mode 100644 index 3fdea56b27..0000000000 --- a/src/optional/gtkmm/gncmm/private/Split_p.hpp +++ /dev/null @@ -1,48 +0,0 @@ -// -*- c++ -*- -// Generated by gtkmmproc -- DO NOT MODIFY! -#ifndef _GNCMM_PRIVATE_SPLIT_P_HPP -#define _GNCMM_PRIVATE_SPLIT_P_HPP - - -#include - -#include - -namespace gnc -{ - -class Split_Class : public Glib::Class -{ -public: -#ifndef DOXYGEN_SHOULD_SKIP_THIS - typedef Split CppObjectType; - typedef ::Split BaseObjectType; - typedef ::SplitClass BaseClassType; - typedef Glib::Object_Class CppClassParent; - typedef GObjectClass BaseClassParent; - - friend class Split; -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ - - const Glib::Class& init(); - - - static void class_init_function(void* g_class, void* class_data); - - static Glib::ObjectBase* wrap_new(GObject*); - -protected: - - //Callbacks (default signal handlers): - //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. - //You could prevent the original default signal handlers being called by overriding the *_impl method. - - //Callbacks (virtual functions): -}; - - -} // namespace gnc - - -#endif /* _GNCMM_PRIVATE_SPLIT_P_HPP */ - diff --git a/src/optional/gtkmm/gncmm/private/Transaction_p.hpp b/src/optional/gtkmm/gncmm/private/Transaction_p.hpp deleted file mode 100644 index 7a93517df0..0000000000 --- a/src/optional/gtkmm/gncmm/private/Transaction_p.hpp +++ /dev/null @@ -1,48 +0,0 @@ -// -*- c++ -*- -// Generated by gtkmmproc -- DO NOT MODIFY! -#ifndef _GNCMM_PRIVATE_TRANSACTION_P_HPP -#define _GNCMM_PRIVATE_TRANSACTION_P_HPP - - -#include - -#include - -namespace gnc -{ - -class Transaction_Class : public Glib::Class -{ -public: -#ifndef DOXYGEN_SHOULD_SKIP_THIS - typedef Transaction CppObjectType; - typedef ::Transaction BaseObjectType; - typedef ::TransactionClass BaseClassType; - typedef Glib::Object_Class CppClassParent; - typedef GObjectClass BaseClassParent; - - friend class Transaction; -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ - - const Glib::Class& init(); - - - static void class_init_function(void* g_class, void* class_data); - - static Glib::ObjectBase* wrap_new(GObject*); - -protected: - - //Callbacks (default signal handlers): - //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. - //You could prevent the original default signal handlers being called by overriding the *_impl method. - - //Callbacks (virtual functions): -}; - - -} // namespace gnc - - -#endif /* _GNCMM_PRIVATE_TRANSACTION_P_HPP */ - diff --git a/src/optional/gtkmm/gncmm/wrap_init.cpp b/src/optional/gtkmm/gncmm/wrap_init.cpp deleted file mode 100644 index 3087a28d3b..0000000000 --- a/src/optional/gtkmm/gncmm/wrap_init.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/********************************************************************\ - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License as * - * published by the Free Software Foundation; either version 2 of * - * the License, or (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License* - * along with this program; if not, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * - * Boston, MA 02110-1301, USA gnu@gnu.org * - * * -\********************************************************************/ - - -#include - -// Disable the 'const' function attribute of the get_type() functions. -// GCC would optimize them out because we don't use the return value. -#undef G_GNUC_CONST -#define G_GNUC_CONST /* empty */ - -//#include -#include -#include - -// #include the widget headers so that we can call the get_type() static methods: - -#include "config.h" -#include "Account.hpp" -#include "Book.hpp" -#include "Commodity.hpp" -#include "Split.hpp" -#include "Transaction.hpp" - -extern "C" -{ - -//Declarations of the *_get_type() functions: - - GType gnc_account_get_type(void); - GType qof_book_get_type(void); - GType gnc_commodity_get_type(void); - GType gnc_split_get_type(void); - GType gnc_transaction_get_type(void); - GType qof_instance_get_type (void); -} // extern "C" - -//Declarations of the *_Class::wrap_new() methods, instead of including all the private headers: - -namespace gnc { class Account_Class { public: static Glib::ObjectBase* wrap_new(GObject*); }; } -namespace gnc { class Book_Class { public: static Glib::ObjectBase* wrap_new(GObject*); }; } -namespace gnc { class Commodity_Class { public: static Glib::ObjectBase* wrap_new(GObject*); }; } -namespace gnc { class GncInstance_Class { public : static Glib::ObjectBase* wrap_new(GObject*); }; } -namespace gnc { class Split_Class { public: static Glib::ObjectBase* wrap_new(GObject*); }; } -namespace gnc { class Transaction_Class { public: static Glib::ObjectBase* wrap_new(GObject*); }; } - -namespace gnc -{ -void wrap_init() -{ -// Map gtypes to gtkmm wrapper-creation functions: - Glib::wrap_register(gnc_account_get_type(), &gnc::Account_Class::wrap_new); - Glib::wrap_register(qof_book_get_type(), &gnc::Book_Class::wrap_new); - Glib::wrap_register(gnc_commodity_get_type(), &gnc::Commodity_Class::wrap_new); - Glib::wrap_register(qof_instance_get_type(), &gnc::GncInstance_Class::wrap_new); - Glib::wrap_register(gnc_split_get_type(), &gnc::Split_Class::wrap_new); - Glib::wrap_register(gnc_transaction_get_type(), &gnc::Transaction_Class::wrap_new); - - // Register our gtkmm gtypes: - gnc::Account::get_type(); - gnc::Book::get_type(); - gnc::Commodity::get_type(); - gnc::GncInstance::get_type(); - gnc::Split::get_type(); - gnc::Transaction::get_type(); -} // wrap_init() -} // END namespace gnc - diff --git a/src/optional/gtkmm/gncmm/wrap_init.hpp b/src/optional/gtkmm/gncmm/wrap_init.hpp deleted file mode 100644 index 41d11902f4..0000000000 --- a/src/optional/gtkmm/gncmm/wrap_init.hpp +++ /dev/null @@ -1,32 +0,0 @@ -// -*- c++ -*- -#ifndef _GNCMM_WRAP_INIT_H -#define _GNCMM_WRAP_INIT_H - -#include - -/* wrap_init.h - * - * Copyright (C) 2007 The gtkmm development team - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -namespace gnc -{ -void wrap_init () ; -} - -#endif //_GNCMM_WRAP_INIT_H - diff --git a/src/optional/gtkmm/gncmod-gtkmm.cpp b/src/optional/gtkmm/gncmod-gtkmm.cpp deleted file mode 100644 index 3a380eb2be..0000000000 --- a/src/optional/gtkmm/gncmod-gtkmm.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - * gncmod-gtkmm.cpp -- - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact: - * - * Free Software Foundation Voice: +1-617-542-5942 - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 - * Boston, MA 02110-1301, USA gnu@gnu.org - */ - -/** - * @internal - * @file gncmod-gtkmm.cpp - * @brief Module definition/initialization for gtkmm support - * @author Copyright (C) 2011 Christian Stimming - */ - -#include "config.h" -/*#include */ -#include - -extern "C" { -#include "gnc-module/gnc-module.h" -#include "gnc-module/gnc-module-api.h" - - GNC_MODULE_API_DECL(libgncmod_gtkmm) - - /* version of the gnc module system interface we require */ - gint libgncmod_gtkmm_gnc_module_system_interface = 0; - - /* module versioning uses libtool semantics. */ - gint libgncmod_gtkmm_gnc_module_current = 0; - gint libgncmod_gtkmm_gnc_module_revision = 0; - gint libgncmod_gtkmm_gnc_module_age = 0; -} // END extern "C" - -// c++ includes -#include - -// And our own plugin -#include "gncmm/wrap_init.hpp" -#include "gnc-plugin-gtkmm.hpp" - -extern "C" { - - gchar * - libgncmod_gtkmm_gnc_module_path(void) - { - return g_strdup("gnucash/gtkmm"); - } - - gchar * - libgncmod_gtkmm_gnc_module_description(void) - { - return g_strdup("Support for gtkmm gui"); - } - - gint - libgncmod_gtkmm_gnc_module_init(gint refcount) - { - // Load modules we depend on - if (!gnc_module_load("gnucash/engine", 0) - || !gnc_module_load("gnucash/app-utils", 0) - || !gnc_module_load("gnucash/gnome-utils", 0)) - { - return FALSE; - } - - // Initialize glibmm - Glib::init(); - - // Register our own gncmm wrapper classes at glib type system - gnc::wrap_init(); - - // Initialize the gtkmm framework. Calling this static method - // is sufficient; we don't actually need a Gtk::Main object. - Gtk::Main::init_gtkmm_internals(); - - // Register our plugin, adding menu items with callbacks - gncmm::gnc_plugin_gtkmm_create_plugin(); - - return 1; - } - - gint - libgncmod_gtkmm_gnc_module_end(gint refcount) - { - return 1; - } - -} // END extern "C" diff --git a/src/optional/gtkmm/test/CMakeLists.txt b/src/optional/gtkmm/test/CMakeLists.txt deleted file mode 100644 index eec21b25f7..0000000000 --- a/src/optional/gtkmm/test/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ - -SET_DIST_LIST(test_gtkmm_DIST CMakeLists.txt Makefile.am test-book.cpp test-gtkmm.cpp) diff --git a/src/optional/gtkmm/test/Makefile.am b/src/optional/gtkmm/test/Makefile.am deleted file mode 100644 index c36d0a04ec..0000000000 --- a/src/optional/gtkmm/test/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -# A template Makefile.am for GLib g_test-based test directories. -# Copyright 2011 John Ralls - -include $(top_srcdir)/test-templates/Makefile.decl - - -#You will only need one of these: It points to the module directory -#after $(top_srcdir) or $(top_builddir): -MODULEPATH = src/optional/gtkmm - -#The test program. You'll need to add to this if you have more than one module above. - -check_PROGRAMS = test-gtkmm - -TESTS = ${check_PROGRAMS} - -test_gtkmmdir = ${top_srcdir}/${MODULEPATH}/test - -#Program files for tests go here. It's probably best to have one for -#each file in the parent directory. Include -#test_foo_support.c if you have one and aren't building the -#support library. -test_gtkmm_SOURCES = \ - test-gtkmm.cpp \ - test-book.cpp - -test_gtkmm_HEADERS = \ - $(top_srcdir)/${MODULEPATH}/gncmm/Book.hpp - -#The tests might require more libraries, but try to keep them -#as independent as possible. -test_gtkmm_LDADD = ${top_builddir}/${MODULEPATH}/libgncmod-gtkmm.la \ - ${top_builddir}/src/engine/libgncmod-engine.la \ - ${GTKMM_LIBS} \ - ${GLIB_LIBS} - -AM_CPPFLAGS = \ - ${DEFAULT_INCLUDES} \ - -DTESTPROG=test_gtkmm \ - -I${top_srcdir}/src \ - -I${top_srcdir}/src/test-core \ - -I${top_srcdir}/src/libqof/qof \ - -I${top_srcdir}/src/gnc-module \ - -I${top_srcdir}/src/core-utils \ - -I${top_srcdir}/src/engine \ - -I${top_srcdir}/src/optional/gtkmm \ - ${GTKMM_CFLAGS} \ - ${GLIB_CFLAGS} - -EXTRA_DIST += CMakeLists.txt diff --git a/src/optional/gtkmm/test/test-book.cpp b/src/optional/gtkmm/test/test-book.cpp deleted file mode 100644 index bc029c9e45..0000000000 --- a/src/optional/gtkmm/test/test-book.cpp +++ /dev/null @@ -1,176 +0,0 @@ -/******************************************************************** - * test-book.cpp: GLib g_test test suite for gnc::Book. * - * Copyright 2011 Christian Stimming - * Copyright 2011 John Ralls * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License as * - * published by the Free Software Foundation; either version 2 of * - * the License, or (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License* - * along with this program; if not, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * - * Boston, MA 02110-1301, USA gnu@gnu.org * -\********************************************************************/ - -#include "config.h" - -#include -#include - -#include "gncmm/Book.hpp" - -extern "C" { -#include -#include -#include -} - -static const gchar *suitename = "/optional/gtkmm"; -void test_suite_gtkmm_book(); - -typedef struct -{ - QofBook *book; -} Fixture; - -static struct -{ - guint param; - gpointer data; - gboolean called; - gchar* msg; -} test_struct; - -static struct -{ - gboolean col1_called; - gboolean col2_called; - gpointer data; -} col_struct; - -static void -setup( Fixture *fixture, gconstpointer pData ) -{ - fixture->book = qof_book_new(); -} - -static void -teardown( Fixture *fixture, gconstpointer pData ) -{ - qof_book_destroy( fixture->book ); -} - -/* use g_free on test_struct.msg after this function been called */ -static gboolean -handle_faults ( const char * log_domain, GLogLevelFlags log_level, const gchar *msg, gpointer user_data) -{ - test_struct.msg = (gchar *) g_strdup( msg ); - return FALSE; -} - -/* mock dirty callback function */ -static void -mock_dirty_cb (QofBook *book, gboolean dirty, gpointer user_data) -{ - test_struct.called = TRUE; - g_test_message( "Checking if book is valid" ); - g_assert( book ); - g_assert( QOF_IS_BOOK( book ) ); - g_test_message( "Checking parameters" ); - g_assert( dirty ); - g_assert( user_data == test_struct.data ); -} - -/* mock callback for qof_book_foreach_collection testing */ -static void -mock_foreach_collection (QofCollection *col, gpointer user_data) -{ - g_test_message( "Checking if collection and data passed correctly" ); - g_assert( col ); - g_assert( user_data == col_struct.data ); - if ( g_strcmp0( qof_collection_get_type(col), "my_type" ) == 0 ) - col_struct.col1_called = TRUE; - else if ( g_strcmp0( qof_collection_get_type(col), "my_type2" ) == 0 ) - col_struct.col2_called = TRUE; -} - -/* mock final callback function */ -static void -mock_final_cb (QofBook *book, gpointer key, gpointer user_data) -{ - test_struct.called = TRUE; - g_assert( book ); - g_assert( QOF_IS_BOOK( book ) ); - g_test_message( "Checking parameters" ); - g_assert_cmpstr( (gchar*)key, == , "key" ); - g_assert_cmpstr( (gchar*)user_data, == , "data" ); -} - -static void -test_book_readonly( Fixture *fixture, gconstpointer pData ) -{ - g_assert( fixture->book != NULL ); - g_assert( !qof_book_is_readonly( fixture->book ) ); - qof_book_mark_readonly( fixture->book ); - g_assert( qof_book_is_readonly( fixture->book ) ); -} -static void -test_book_wrap( Fixture *fixture, gconstpointer pData ) -{ - g_assert( fixture->book != NULL ); - { - // WATCH OUT: The second "true" argument is very important, as it says - // the Glib::RefPtr must not take ownership of the original object. - Glib::RefPtr book = Glib::wrap(fixture->book, true); - g_assert( book->gobj() == fixture->book ); - g_assert(G_IS_OBJECT(fixture->book)); - } - g_assert(G_IS_OBJECT(fixture->book)); // All is fine due to the "true" above. - // The setup() and teardown() indeed uses the GObject ref counting correctly. - - qof_book_mark_readonly( fixture->book ); - g_assert( qof_book_is_readonly( fixture->book ) ); -} -static void -test_book_wrap_readonly( Fixture *fixture, gconstpointer pData ) -{ - Glib::RefPtr book = Glib::wrap(fixture->book, true); // "true" is important! - g_assert( book ); - g_assert( book->gobj() == fixture-> book); // indeed the identical object - g_assert( !book->is_readonly() ); - g_assert( !qof_book_is_readonly( fixture->book ) ); - book->mark_readonly(); - g_assert( book->is_readonly() ); - g_assert( qof_book_is_readonly( fixture->book ) ); // indeed the identical object -} -static void -test_book_get_string_option( Fixture *fixture, gconstpointer pData ) -{ - Glib::ustring opt_name("Option Name"); - Glib::ustring opt_value("Option Value"); - Glib::ustring opt_name_notset("Not Set"); - Glib::RefPtr book = Glib::wrap(fixture->book, true); // "true" is important! - g_assert( book ); - book->string_option_set( opt_name, opt_value); - g_assert_cmpstr( book->string_option_get( opt_name ).c_str(), == , opt_value.c_str()); - g_assert( book->string_option_exists(opt_name) == true); - g_assert( book->string_option_get( opt_name_notset ).empty()); - g_assert( book->string_option_exists( opt_name_notset ) == false); -} - -void test_suite_gtkmm_book() -{ - GNC_TEST_ADD( suitename, "readonly", Fixture, NULL, setup, test_book_readonly, teardown ); - GNC_TEST_ADD( suitename, "wrap", Fixture, NULL, setup, test_book_wrap, teardown ); - GNC_TEST_ADD( suitename, "wrapped-readonly", Fixture, NULL, setup, test_book_wrap_readonly, teardown ); - GNC_TEST_ADD( suitename, "wrapped-get_string_option", Fixture, NULL, setup, test_book_get_string_option, teardown ); -} diff --git a/src/optional/gtkmm/test/test-gtkmm.cpp b/src/optional/gtkmm/test/test-gtkmm.cpp deleted file mode 100644 index 7556c6e1f8..0000000000 --- a/src/optional/gtkmm/test/test-gtkmm.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************** - * testmain.c: GLib g_test test execution file. * - * Copyright 2011 Christian Stimming - * Copyright 2011 John Ralls * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License as * - * published by the Free Software Foundation; either version 2 of * - * the License, or (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License* - * along with this program; if not, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * - * Boston, MA 02110-1301, USA gnu@gnu.org * -\********************************************************************/ - - -#include "config.h" -#include -#include -extern "C" { -#include "qof.h" - -// gint libgncmod_gtkmm_gnc_module_init(gint refcount); -} -// c++ includes -//#include -// And our own plugin -#include "gncmm/wrap_init.hpp" - - -extern void test_suite_gtkmm_book(); - -int -main (int argc, - char *argv[]) -{ - qof_init(); /* Initialize the GObject system */ - qof_log_init_filename_special("stderr"); /* Init the log system */ - g_test_init ( &argc, &argv, NULL ); /* initialize test program */ - g_test_bug_base("https://bugzilla.gnome.org/show_bug.cgi?id="); /* init the bugzilla URL */ - - // Initialize glibmm - Glib::init(); - gnc::wrap_init(); - - // The below only needed if we use gtkmm stuff - //Gtk::Main::init_gtkmm_internals(); - - //libgncmod_gtkmm_gnc_module_init(1); - - test_suite_gtkmm_book(); - - return g_test_run( ); -} - -