commit 04bf3a4b58deef073503ae4b45d694fad92107ed Author: user Date: Sun Jul 12 13:56:05 2026 +0400 Initial commit diff --git a/CoffeBeans/CMakeLists.txt b/CoffeBeans/CMakeLists.txt new file mode 100644 index 0000000..63db673 --- /dev/null +++ b/CoffeBeans/CMakeLists.txt @@ -0,0 +1,57 @@ +cmake_minimum_required(VERSION 3.13) + +project(CoffeBeans) + +set(CMAKE_INSTALL_PREFIX ${PROJECT_SOURCE_DIR}) + +set(SOURCE_DIR ${PROJECT_SOURCE_DIR}/src) +set(ICON_DIR ${PROJECT_SOURCE_DIR}/icons) + +add_subdirectory(src/sqltreenode) +add_subdirectory(src/databaseinfo) +add_subdirectory(src/virtualmodelinterface) +add_subdirectory(src/stylesheethandler) +add_subdirectory(src/sqltablenoticedelegate) +add_subdirectory(src/editproductdialog) +add_subdirectory(src/addproductdialog) +add_subdirectory(src/integervalidator) +add_subdirectory(src/sqlqueryproductsmodel) + +add_subdirectory(src/colouredlineedit) +# StyleSheetHandler +add_subdirectory(src/verificationwidget) +# ColouredLineEdit +add_subdirectory(src/renamedialog) +# VerificationWidget +# ColouredLineEdit +add_subdirectory(src/deletedialog) +# VerificationWidget +# ColouredLineEdit + +add_subdirectory(src/virtualmodeladapter) +# VirtualModelInterface +add_subdirectory(src/virtualtreemodel) +# VirtualModelAdapter +add_subdirectory(src/sqlscript) +# DatabaseInfo +add_subdirectory(src/virtualsqltreenodeadapter) +# VirtualModelAdapter +# SqlTreeNode +add_subdirectory(src/addproducttypedialog) +# VerificationWidget +# SqlTreeNode +# ColouredLineEdit +# SqlScript +add_subdirectory(src/sqltreemodel) +# VirtualTreeModel +# SqlScript +# SqlTreeNode +# VirtualSqlTreeNodeAdapter +add_subdirectory(src/productswidget) +# VerificationWidget +# SqlTreeModel +# AddProductTypeDialog +add_subdirectory(src/mainwindow) +# ProductsWidget +add_subdirectory(src/main) +# MainWindow diff --git a/CoffeBeans/CMakeLists.txt.user b/CoffeBeans/CMakeLists.txt.user new file mode 100644 index 0000000..65cefde --- /dev/null +++ b/CoffeBeans/CMakeLists.txt.user @@ -0,0 +1,294 @@ + + + + + + EnvironmentId + {afdb69da-3625-476f-81e8-547ccb18a676} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + *.md, *.MD, Makefile + false + true + + + + ProjectExplorer.Project.PluginSettings + + + true + true + true + true + true + + + 0 + true + + -fno-delayed-template-parsing + + true + Builtin.Questionable + + true + Builtin.DefaultTidyAndClazy + 2 + + + + true + + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop Qt 5.12.10 MSVC2015 64bit + Desktop Qt 5.12.10 MSVC2015 64bit + qt.qt5.51210.win64_msvc2015_64_kit + 0 + 0 + 0 + + -GNinja +-DCMAKE_BUILD_TYPE:String=Release +-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} +-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} +-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} +-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} + 2 + C:\Users\Brewer\Desktop\CoffeBeans\..\build-CoffeBeans-Desktop_Qt_5_12_10_MSVC2015_64bit-Release + + + + + all + + + true + CMakeProjectManager.MakeStep + + 1 + Сборка + Сборка + ProjectExplorer.BuildSteps.Build + + + + + + clean + + + true + CMakeProjectManager.MakeStep + + 1 + Очистка + Очистка + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Выпуск + CMakeProjectManager.CMakeBuildConfiguration + + + -GNinja +-DCMAKE_BUILD_TYPE:String=RelWithDebInfo +-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} +-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} +-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} +-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} + 2 + C:\Users\Brewer\Desktop\CoffeBeans\..\build-CoffeBeans-Desktop_Qt_5_12_10_MSVC2015_64bit-RelWithDebInfo + + + + + all + + + true + CMakeProjectManager.MakeStep + + 1 + Сборка + Сборка + ProjectExplorer.BuildSteps.Build + + + + + + clean + + + true + CMakeProjectManager.MakeStep + + 1 + Очистка + Очистка + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Выпуск с отладочной информацией + CMakeProjectManager.CMakeBuildConfiguration + + 2 + + + 0 + Развёртывание + Развёртывание + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + + 2 + + CoffeBeans + CMakeProjectManager.CMakeRunConfiguration.CoffeBeans + CoffeBeans + + false + + false + true + true + false + false + true + + C:/Users/Brewer/Desktop/build-CoffeBeans-Desktop_Qt_5_12_10_MSVC2015_64bit-Release/src/main + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/CoffeBeans/Project tree.txt b/CoffeBeans/Project tree.txt new file mode 100644 index 0000000..b8e50ca --- /dev/null +++ b/CoffeBeans/Project tree.txt @@ -0,0 +1,35 @@ +* SqlTreeNode +* DatabaseInfo +* VirtualModelInterface +* ColouredLineEdit + +main +| +MainWindow +| +ProductsWidget--------<-*---*--* +|| | | | +|AddProductTypeDialog | | | +|||| | | | +|||SqlTreeNode----------|->-|--* +||ColouredLineEdit | | | +|SqlScript--------------|->-* | +|| | | | +|DatabaseInfo--------->-* | | +SqlTreeModel----------<-|-* | | *--<<== +|||| | | | | +|||SqlTreeNode-------->-|-|-|--* +||SqlScript----------->-|-|-* | +||| | | | +||DatabaseInfo-------->-* | | +|VirtualTreeModel | | +|| | | +|VirtualModelAdapter---->-* | +|| | | +|VirtualModelInterface | | +VirtualSqlTreeNodeAdapter | | *--<<== +|| | | +|SqlTreeNode------------>-|----* +VirtualModelAdapter----->-* +| +VirtualModelInterface diff --git a/CoffeBeans/icons/custom/16x16/cash-counter/cash-counter.png b/CoffeBeans/icons/custom/16x16/cash-counter/cash-counter.png new file mode 100644 index 0000000..6a2a515 Binary files /dev/null and b/CoffeBeans/icons/custom/16x16/cash-counter/cash-counter.png differ diff --git a/CoffeBeans/icons/custom/16x16/cash-in-hand/cash-in-hand.png b/CoffeBeans/icons/custom/16x16/cash-in-hand/cash-in-hand.png new file mode 100644 index 0000000..f8d9010 Binary files /dev/null and b/CoffeBeans/icons/custom/16x16/cash-in-hand/cash-in-hand.png differ diff --git a/CoffeBeans/icons/custom/16x16/cash-register/cash-register.png b/CoffeBeans/icons/custom/16x16/cash-register/cash-register.png new file mode 100644 index 0000000..d578060 Binary files /dev/null and b/CoffeBeans/icons/custom/16x16/cash-register/cash-register.png differ diff --git a/CoffeBeans/icons/custom/16x16/cash/cash.png b/CoffeBeans/icons/custom/16x16/cash/cash.png new file mode 100644 index 0000000..3637ff6 Binary files /dev/null and b/CoffeBeans/icons/custom/16x16/cash/cash.png differ diff --git a/CoffeBeans/icons/custom/16x16/coffe-beans/coffee-beans.png b/CoffeBeans/icons/custom/16x16/coffe-beans/coffee-beans.png new file mode 100644 index 0000000..79a2ba8 Binary files /dev/null and b/CoffeBeans/icons/custom/16x16/coffe-beans/coffee-beans.png differ diff --git a/CoffeBeans/icons/custom/16x16/grocery-shelf/grocery-shelf.png b/CoffeBeans/icons/custom/16x16/grocery-shelf/grocery-shelf.png new file mode 100644 index 0000000..d5607e5 Binary files /dev/null and b/CoffeBeans/icons/custom/16x16/grocery-shelf/grocery-shelf.png differ diff --git a/CoffeBeans/icons/custom/16x16/price-tag/price-tag.png b/CoffeBeans/icons/custom/16x16/price-tag/price-tag.png new file mode 100644 index 0000000..8910c7b Binary files /dev/null and b/CoffeBeans/icons/custom/16x16/price-tag/price-tag.png differ diff --git a/CoffeBeans/icons/custom/16x16/supplier/supplier.png b/CoffeBeans/icons/custom/16x16/supplier/supplier.png new file mode 100644 index 0000000..249f455 Binary files /dev/null and b/CoffeBeans/icons/custom/16x16/supplier/supplier.png differ diff --git a/CoffeBeans/icons/custom/22x22/cash-counter/cash-counter.png b/CoffeBeans/icons/custom/22x22/cash-counter/cash-counter.png new file mode 100644 index 0000000..1364113 Binary files /dev/null and b/CoffeBeans/icons/custom/22x22/cash-counter/cash-counter.png differ diff --git a/CoffeBeans/icons/custom/22x22/cash-in-hand/cash-in-hand.png b/CoffeBeans/icons/custom/22x22/cash-in-hand/cash-in-hand.png new file mode 100644 index 0000000..ec0081a Binary files /dev/null and b/CoffeBeans/icons/custom/22x22/cash-in-hand/cash-in-hand.png differ diff --git a/CoffeBeans/icons/custom/22x22/cash-register/cash-register.png b/CoffeBeans/icons/custom/22x22/cash-register/cash-register.png new file mode 100644 index 0000000..6b22e30 Binary files /dev/null and b/CoffeBeans/icons/custom/22x22/cash-register/cash-register.png differ diff --git a/CoffeBeans/icons/custom/22x22/cash/cash.png b/CoffeBeans/icons/custom/22x22/cash/cash.png new file mode 100644 index 0000000..e1d6dcd Binary files /dev/null and b/CoffeBeans/icons/custom/22x22/cash/cash.png differ diff --git a/CoffeBeans/icons/custom/22x22/coffe-beans/coffee-beans.png b/CoffeBeans/icons/custom/22x22/coffe-beans/coffee-beans.png new file mode 100644 index 0000000..6620d77 Binary files /dev/null and b/CoffeBeans/icons/custom/22x22/coffe-beans/coffee-beans.png differ diff --git a/CoffeBeans/icons/custom/22x22/grocery-shelf/grocery-shelf.png b/CoffeBeans/icons/custom/22x22/grocery-shelf/grocery-shelf.png new file mode 100644 index 0000000..e9d24de Binary files /dev/null and b/CoffeBeans/icons/custom/22x22/grocery-shelf/grocery-shelf.png differ diff --git a/CoffeBeans/icons/custom/22x22/price-tag/price-tag.png b/CoffeBeans/icons/custom/22x22/price-tag/price-tag.png new file mode 100644 index 0000000..e903461 Binary files /dev/null and b/CoffeBeans/icons/custom/22x22/price-tag/price-tag.png differ diff --git a/CoffeBeans/icons/custom/22x22/supplier/supplier.png b/CoffeBeans/icons/custom/22x22/supplier/supplier.png new file mode 100644 index 0000000..f6e5e7d Binary files /dev/null and b/CoffeBeans/icons/custom/22x22/supplier/supplier.png differ diff --git a/CoffeBeans/icons/custom/32x32/cash-counter/cash-counter.png b/CoffeBeans/icons/custom/32x32/cash-counter/cash-counter.png new file mode 100644 index 0000000..4cb7c49 Binary files /dev/null and b/CoffeBeans/icons/custom/32x32/cash-counter/cash-counter.png differ diff --git a/CoffeBeans/icons/custom/32x32/cash-in-hand/cash-in-hand.png b/CoffeBeans/icons/custom/32x32/cash-in-hand/cash-in-hand.png new file mode 100644 index 0000000..248780a Binary files /dev/null and b/CoffeBeans/icons/custom/32x32/cash-in-hand/cash-in-hand.png differ diff --git a/CoffeBeans/icons/custom/32x32/cash-register/cash-register.png b/CoffeBeans/icons/custom/32x32/cash-register/cash-register.png new file mode 100644 index 0000000..bb40d5a Binary files /dev/null and b/CoffeBeans/icons/custom/32x32/cash-register/cash-register.png differ diff --git a/CoffeBeans/icons/custom/32x32/cash/cash.png b/CoffeBeans/icons/custom/32x32/cash/cash.png new file mode 100644 index 0000000..0cb12e6 Binary files /dev/null and b/CoffeBeans/icons/custom/32x32/cash/cash.png differ diff --git a/CoffeBeans/icons/custom/32x32/coffee-beans/coffee-beans.png b/CoffeBeans/icons/custom/32x32/coffee-beans/coffee-beans.png new file mode 100644 index 0000000..6b50901 Binary files /dev/null and b/CoffeBeans/icons/custom/32x32/coffee-beans/coffee-beans.png differ diff --git a/CoffeBeans/icons/custom/32x32/grocery-shelf/grocery-shelf.png b/CoffeBeans/icons/custom/32x32/grocery-shelf/grocery-shelf.png new file mode 100644 index 0000000..e22f9af Binary files /dev/null and b/CoffeBeans/icons/custom/32x32/grocery-shelf/grocery-shelf.png differ diff --git a/CoffeBeans/icons/custom/32x32/price-tag/price-tag.png b/CoffeBeans/icons/custom/32x32/price-tag/price-tag.png new file mode 100644 index 0000000..5378514 Binary files /dev/null and b/CoffeBeans/icons/custom/32x32/price-tag/price-tag.png differ diff --git a/CoffeBeans/icons/custom/32x32/supplier/supplier.png b/CoffeBeans/icons/custom/32x32/supplier/supplier.png new file mode 100644 index 0000000..2062208 Binary files /dev/null and b/CoffeBeans/icons/custom/32x32/supplier/supplier.png differ diff --git a/CoffeBeans/icons/custom/index.theme b/CoffeBeans/icons/custom/index.theme new file mode 100644 index 0000000..bb617db --- /dev/null +++ b/CoffeBeans/icons/custom/index.theme @@ -0,0 +1,15 @@ +[Icon Theme] +Name=custom +Comment=Custom icons +Inherits=default + +Directories=16x16,22x22,32x32 + +[16x16] +Size=16 + +[22x22] +Size=22 + +[32x32] +Size=32 diff --git a/CoffeBeans/icons/icons.qrc b/CoffeBeans/icons/icons.qrc new file mode 100644 index 0000000..5e76e44 --- /dev/null +++ b/CoffeBeans/icons/icons.qrc @@ -0,0 +1,35 @@ + + + custom/16x16/cash-in-hand/cash-in-hand.png + custom/22x22/cash-in-hand/cash-in-hand.png + custom/32x32/cash-in-hand/cash-in-hand.png + custom/16x16/cash/cash.png + custom/22x22/cash/cash.png + custom/32x32/cash/cash.png + custom/16x16/grocery-shelf/grocery-shelf.png + custom/22x22/grocery-shelf/grocery-shelf.png + custom/32x32/grocery-shelf/grocery-shelf.png + custom/16x16/supplier/supplier.png + custom/22x22/supplier/supplier.png + custom/32x32/supplier/supplier.png + custom/16x16/price-tag/price-tag.png + custom/22x22/price-tag/price-tag.png + custom/32x32/price-tag/price-tag.png + custom/16x16/coffe-beans/coffee-beans.png + custom/22x22/coffe-beans/coffee-beans.png + custom/32x32/coffee-beans/coffee-beans.png + custom/index.theme + + + tango/16x16/tango/actions/document-new.png + tango/22x22/tango/actions/document-new.png + tango/32x32/tango/actions/document-new.png + tango/16x16/tango/actions/document-open.png + tango/22x22/tango/actions/document-open.png + tango/32x32/tango/actions/document-open.png + tango/16x16/tango/mimetypes/text-x-generic.png + tango/22x22/tango/mimetypes/text-x-generic.png + tango/32x32/tango/mimetypes/text-x-generic.png + tango/index.theme + + diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/address-book-new.png b/CoffeBeans/icons/tango/16x16/tango/actions/address-book-new.png new file mode 100644 index 0000000..2098cfd Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/address-book-new.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/appointment-new.png b/CoffeBeans/icons/tango/16x16/tango/actions/appointment-new.png new file mode 100644 index 0000000..18b7c67 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/appointment-new.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/bookmark-new.png b/CoffeBeans/icons/tango/16x16/tango/actions/bookmark-new.png new file mode 100644 index 0000000..6cf6443 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/bookmark-new.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/contact-new.png b/CoffeBeans/icons/tango/16x16/tango/actions/contact-new.png new file mode 100644 index 0000000..46573ff Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/contact-new.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/document-new.png b/CoffeBeans/icons/tango/16x16/tango/actions/document-new.png new file mode 100644 index 0000000..4c3efdd Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/document-new.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/document-open.png b/CoffeBeans/icons/tango/16x16/tango/actions/document-open.png new file mode 100644 index 0000000..ab94046 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/document-open.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/document-print-preview.png b/CoffeBeans/icons/tango/16x16/tango/actions/document-print-preview.png new file mode 100644 index 0000000..ab92a30 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/document-print-preview.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/document-print.png b/CoffeBeans/icons/tango/16x16/tango/actions/document-print.png new file mode 100644 index 0000000..35c37bd Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/document-print.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/document-properties.png b/CoffeBeans/icons/tango/16x16/tango/actions/document-properties.png new file mode 100644 index 0000000..ab0e8ea Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/document-properties.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/document-revert.png b/CoffeBeans/icons/tango/16x16/tango/actions/document-revert.png new file mode 100644 index 0000000..cf3c13b Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/document-revert.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/document-save-as.png b/CoffeBeans/icons/tango/16x16/tango/actions/document-save-as.png new file mode 100644 index 0000000..9bed143 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/document-save-as.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/document-save.png b/CoffeBeans/icons/tango/16x16/tango/actions/document-save.png new file mode 100644 index 0000000..22ff495 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/document-save.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/edit-clear.png b/CoffeBeans/icons/tango/16x16/tango/actions/edit-clear.png new file mode 100644 index 0000000..e6c8e8b Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/edit-clear.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/edit-copy.png b/CoffeBeans/icons/tango/16x16/tango/actions/edit-copy.png new file mode 100644 index 0000000..8dd48c4 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/edit-copy.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/edit-cut.png b/CoffeBeans/icons/tango/16x16/tango/actions/edit-cut.png new file mode 100644 index 0000000..dc9eb9a Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/edit-cut.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/edit-delete.png b/CoffeBeans/icons/tango/16x16/tango/actions/edit-delete.png new file mode 100644 index 0000000..ea03150 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/edit-delete.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/edit-find-replace.png b/CoffeBeans/icons/tango/16x16/tango/actions/edit-find-replace.png new file mode 100644 index 0000000..6edbef6 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/edit-find-replace.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/edit-find.png b/CoffeBeans/icons/tango/16x16/tango/actions/edit-find.png new file mode 100644 index 0000000..d072d3c Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/edit-find.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/edit-paste.png b/CoffeBeans/icons/tango/16x16/tango/actions/edit-paste.png new file mode 100644 index 0000000..24588a3 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/edit-paste.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/edit-redo.png b/CoffeBeans/icons/tango/16x16/tango/actions/edit-redo.png new file mode 100644 index 0000000..c3b0df0 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/edit-redo.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/edit-select-all.png b/CoffeBeans/icons/tango/16x16/tango/actions/edit-select-all.png new file mode 100644 index 0000000..f4b0b19 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/edit-select-all.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/edit-undo.png b/CoffeBeans/icons/tango/16x16/tango/actions/edit-undo.png new file mode 100644 index 0000000..8b0fef9 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/edit-undo.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/folder-new.png b/CoffeBeans/icons/tango/16x16/tango/actions/folder-new.png new file mode 100644 index 0000000..628f4d5 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/folder-new.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/format-indent-less.png b/CoffeBeans/icons/tango/16x16/tango/actions/format-indent-less.png new file mode 100644 index 0000000..1787a7f Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/format-indent-less.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/format-indent-more.png b/CoffeBeans/icons/tango/16x16/tango/actions/format-indent-more.png new file mode 100644 index 0000000..6bad6bb Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/format-indent-more.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/format-justify-center.png b/CoffeBeans/icons/tango/16x16/tango/actions/format-justify-center.png new file mode 100644 index 0000000..207dc4c Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/format-justify-center.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/format-justify-fill.png b/CoffeBeans/icons/tango/16x16/tango/actions/format-justify-fill.png new file mode 100644 index 0000000..663cbad Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/format-justify-fill.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/format-justify-left.png b/CoffeBeans/icons/tango/16x16/tango/actions/format-justify-left.png new file mode 100644 index 0000000..d9b40a7 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/format-justify-left.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/format-justify-right.png b/CoffeBeans/icons/tango/16x16/tango/actions/format-justify-right.png new file mode 100644 index 0000000..c301307 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/format-justify-right.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/format-text-bold.png b/CoffeBeans/icons/tango/16x16/tango/actions/format-text-bold.png new file mode 100644 index 0000000..c9cb630 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/format-text-bold.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/format-text-italic.png b/CoffeBeans/icons/tango/16x16/tango/actions/format-text-italic.png new file mode 100644 index 0000000..977ea82 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/format-text-italic.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/format-text-strikethrough.png b/CoffeBeans/icons/tango/16x16/tango/actions/format-text-strikethrough.png new file mode 100644 index 0000000..ccee76e Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/format-text-strikethrough.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/format-text-underline.png b/CoffeBeans/icons/tango/16x16/tango/actions/format-text-underline.png new file mode 100644 index 0000000..0c48721 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/format-text-underline.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/go-bottom.png b/CoffeBeans/icons/tango/16x16/tango/actions/go-bottom.png new file mode 100644 index 0000000..2c5a803 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/go-bottom.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/go-down.png b/CoffeBeans/icons/tango/16x16/tango/actions/go-down.png new file mode 100644 index 0000000..3dd7fcc Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/go-down.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/go-first.png b/CoffeBeans/icons/tango/16x16/tango/actions/go-first.png new file mode 100644 index 0000000..9c15c09 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/go-first.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/go-home.png b/CoffeBeans/icons/tango/16x16/tango/actions/go-home.png new file mode 100644 index 0000000..a46fb22 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/go-home.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/go-jump.png b/CoffeBeans/icons/tango/16x16/tango/actions/go-jump.png new file mode 100644 index 0000000..1d218c3 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/go-jump.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/go-last.png b/CoffeBeans/icons/tango/16x16/tango/actions/go-last.png new file mode 100644 index 0000000..6e904ef Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/go-last.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/go-next.png b/CoffeBeans/icons/tango/16x16/tango/actions/go-next.png new file mode 100644 index 0000000..6ef8de7 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/go-next.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/go-previous.png b/CoffeBeans/icons/tango/16x16/tango/actions/go-previous.png new file mode 100644 index 0000000..659cd90 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/go-previous.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/go-top.png b/CoffeBeans/icons/tango/16x16/tango/actions/go-top.png new file mode 100644 index 0000000..70f2c99 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/go-top.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/go-up.png b/CoffeBeans/icons/tango/16x16/tango/actions/go-up.png new file mode 100644 index 0000000..fa9a7d7 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/go-up.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/list-add.png b/CoffeBeans/icons/tango/16x16/tango/actions/list-add.png new file mode 100644 index 0000000..1aa7f09 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/list-add.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/list-remove.png b/CoffeBeans/icons/tango/16x16/tango/actions/list-remove.png new file mode 100644 index 0000000..00b654e Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/list-remove.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/mail-forward.png b/CoffeBeans/icons/tango/16x16/tango/actions/mail-forward.png new file mode 100644 index 0000000..de0199b Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/mail-forward.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/mail-mark-junk.png b/CoffeBeans/icons/tango/16x16/tango/actions/mail-mark-junk.png new file mode 100644 index 0000000..f12d452 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/mail-mark-junk.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/mail-mark-not-junk.png b/CoffeBeans/icons/tango/16x16/tango/actions/mail-mark-not-junk.png new file mode 100644 index 0000000..87c425f Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/mail-mark-not-junk.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/mail-message-new.png b/CoffeBeans/icons/tango/16x16/tango/actions/mail-message-new.png new file mode 100644 index 0000000..7c68cb8 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/mail-message-new.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/mail-reply-all.png b/CoffeBeans/icons/tango/16x16/tango/actions/mail-reply-all.png new file mode 100644 index 0000000..2017b0a Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/mail-reply-all.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/mail-reply-sender.png b/CoffeBeans/icons/tango/16x16/tango/actions/mail-reply-sender.png new file mode 100644 index 0000000..a619741 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/mail-reply-sender.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/mail-send-receive.png b/CoffeBeans/icons/tango/16x16/tango/actions/mail-send-receive.png new file mode 100644 index 0000000..3eb6a9c Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/mail-send-receive.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/media-eject.png b/CoffeBeans/icons/tango/16x16/tango/actions/media-eject.png new file mode 100644 index 0000000..2084067 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/media-eject.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/media-playback-pause.png b/CoffeBeans/icons/tango/16x16/tango/actions/media-playback-pause.png new file mode 100644 index 0000000..c8b4fe2 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/media-playback-pause.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/media-playback-start.png b/CoffeBeans/icons/tango/16x16/tango/actions/media-playback-start.png new file mode 100644 index 0000000..a7de0fe Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/media-playback-start.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/media-playback-stop.png b/CoffeBeans/icons/tango/16x16/tango/actions/media-playback-stop.png new file mode 100644 index 0000000..ede2815 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/media-playback-stop.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/media-record.png b/CoffeBeans/icons/tango/16x16/tango/actions/media-record.png new file mode 100644 index 0000000..2f66cde Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/media-record.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/media-seek-backward.png b/CoffeBeans/icons/tango/16x16/tango/actions/media-seek-backward.png new file mode 100644 index 0000000..ffcac31 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/media-seek-backward.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/media-seek-forward.png b/CoffeBeans/icons/tango/16x16/tango/actions/media-seek-forward.png new file mode 100644 index 0000000..4d7e2cd Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/media-seek-forward.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/media-skip-backward.png b/CoffeBeans/icons/tango/16x16/tango/actions/media-skip-backward.png new file mode 100644 index 0000000..94381f5 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/media-skip-backward.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/media-skip-forward.png b/CoffeBeans/icons/tango/16x16/tango/actions/media-skip-forward.png new file mode 100644 index 0000000..758ec6f Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/media-skip-forward.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/process-stop.png b/CoffeBeans/icons/tango/16x16/tango/actions/process-stop.png new file mode 100644 index 0000000..ab6808f Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/process-stop.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/system-lock-screen.png b/CoffeBeans/icons/tango/16x16/tango/actions/system-lock-screen.png new file mode 100644 index 0000000..f7ea0cd Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/system-lock-screen.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/system-log-out.png b/CoffeBeans/icons/tango/16x16/tango/actions/system-log-out.png new file mode 100644 index 0000000..0010931 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/system-log-out.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/system-search.png b/CoffeBeans/icons/tango/16x16/tango/actions/system-search.png new file mode 100644 index 0000000..fd7f0b0 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/system-search.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/system-shutdown.png b/CoffeBeans/icons/tango/16x16/tango/actions/system-shutdown.png new file mode 100644 index 0000000..afe62de Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/system-shutdown.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/tab-new.png b/CoffeBeans/icons/tango/16x16/tango/actions/tab-new.png new file mode 100644 index 0000000..3e590f6 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/tab-new.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/view-fullscreen.png b/CoffeBeans/icons/tango/16x16/tango/actions/view-fullscreen.png new file mode 100644 index 0000000..ffdabd4 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/view-fullscreen.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/view-refresh.png b/CoffeBeans/icons/tango/16x16/tango/actions/view-refresh.png new file mode 100644 index 0000000..3fd71d6 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/view-refresh.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/actions/window-new.png b/CoffeBeans/icons/tango/16x16/tango/actions/window-new.png new file mode 100644 index 0000000..0e12ef9 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/actions/window-new.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/animations/process-working.png b/CoffeBeans/icons/tango/16x16/tango/animations/process-working.png new file mode 100644 index 0000000..984bde4 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/animations/process-working.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/accessories-calculator.png b/CoffeBeans/icons/tango/16x16/tango/apps/accessories-calculator.png new file mode 100644 index 0000000..9248971 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/accessories-calculator.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/accessories-character-map.png b/CoffeBeans/icons/tango/16x16/tango/apps/accessories-character-map.png new file mode 100644 index 0000000..5dd1124 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/accessories-character-map.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/accessories-text-editor.png b/CoffeBeans/icons/tango/16x16/tango/apps/accessories-text-editor.png new file mode 100644 index 0000000..188e1c1 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/accessories-text-editor.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/help-browser.png b/CoffeBeans/icons/tango/16x16/tango/apps/help-browser.png new file mode 100644 index 0000000..f25fc3f Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/help-browser.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/internet-group-chat.png b/CoffeBeans/icons/tango/16x16/tango/apps/internet-group-chat.png new file mode 100644 index 0000000..f6e8325 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/internet-group-chat.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/internet-mail.png b/CoffeBeans/icons/tango/16x16/tango/apps/internet-mail.png new file mode 100644 index 0000000..859251f Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/internet-mail.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/internet-news-reader.png b/CoffeBeans/icons/tango/16x16/tango/apps/internet-news-reader.png new file mode 100644 index 0000000..a9850ee Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/internet-news-reader.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/internet-web-browser.png b/CoffeBeans/icons/tango/16x16/tango/apps/internet-web-browser.png new file mode 100644 index 0000000..ac5957a Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/internet-web-browser.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/office-calendar.png b/CoffeBeans/icons/tango/16x16/tango/apps/office-calendar.png new file mode 100644 index 0000000..106a592 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/office-calendar.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-accessibility.png b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-accessibility.png new file mode 100644 index 0000000..b365c27 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-accessibility.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-assistive-technology.png b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-assistive-technology.png new file mode 100644 index 0000000..513d817 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-assistive-technology.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-font.png b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-font.png new file mode 100644 index 0000000..18a0149 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-font.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-keyboard-shortcuts.png b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-keyboard-shortcuts.png new file mode 100644 index 0000000..291dc1a Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-keyboard-shortcuts.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-locale.png b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-locale.png new file mode 100644 index 0000000..5ef73a6 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-locale.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-multimedia.png b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-multimedia.png new file mode 100644 index 0000000..2e5ba43 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-multimedia.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-remote-desktop.png b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-remote-desktop.png new file mode 100644 index 0000000..b790f63 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-remote-desktop.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-screensaver.png b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-screensaver.png new file mode 100644 index 0000000..dc297db Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-screensaver.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-theme.png b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-theme.png new file mode 100644 index 0000000..fbea772 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-theme.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-wallpaper.png b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-wallpaper.png new file mode 100644 index 0000000..e7cc834 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-desktop-wallpaper.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/preferences-system-network-proxy.png b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-system-network-proxy.png new file mode 100644 index 0000000..bdeb79d Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-system-network-proxy.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/preferences-system-session.png b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-system-session.png new file mode 100644 index 0000000..35f8b57 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-system-session.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/preferences-system-windows.png b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-system-windows.png new file mode 100644 index 0000000..596caf9 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/preferences-system-windows.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/system-file-manager.png b/CoffeBeans/icons/tango/16x16/tango/apps/system-file-manager.png new file mode 100644 index 0000000..60cade4 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/system-file-manager.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/system-installer.png b/CoffeBeans/icons/tango/16x16/tango/apps/system-installer.png new file mode 100644 index 0000000..d16abcb Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/system-installer.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/system-software-update.png b/CoffeBeans/icons/tango/16x16/tango/apps/system-software-update.png new file mode 100644 index 0000000..58f19c6 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/system-software-update.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/system-users.png b/CoffeBeans/icons/tango/16x16/tango/apps/system-users.png new file mode 100644 index 0000000..9d2d500 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/system-users.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/utilities-system-monitor.png b/CoffeBeans/icons/tango/16x16/tango/apps/utilities-system-monitor.png new file mode 100644 index 0000000..8734e77 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/utilities-system-monitor.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/apps/utilities-terminal.png b/CoffeBeans/icons/tango/16x16/tango/apps/utilities-terminal.png new file mode 100644 index 0000000..c5b797a Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/apps/utilities-terminal.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/categories/applications-accessories.png b/CoffeBeans/icons/tango/16x16/tango/categories/applications-accessories.png new file mode 100644 index 0000000..c8d899c Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/categories/applications-accessories.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/categories/applications-development.png b/CoffeBeans/icons/tango/16x16/tango/categories/applications-development.png new file mode 100644 index 0000000..4375227 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/categories/applications-development.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/categories/applications-games.png b/CoffeBeans/icons/tango/16x16/tango/categories/applications-games.png new file mode 100644 index 0000000..4ba874b Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/categories/applications-games.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/categories/applications-graphics.png b/CoffeBeans/icons/tango/16x16/tango/categories/applications-graphics.png new file mode 100644 index 0000000..4bb955f Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/categories/applications-graphics.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/categories/applications-internet.png b/CoffeBeans/icons/tango/16x16/tango/categories/applications-internet.png new file mode 100644 index 0000000..a588968 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/categories/applications-internet.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/categories/applications-multimedia.png b/CoffeBeans/icons/tango/16x16/tango/categories/applications-multimedia.png new file mode 100644 index 0000000..3e4ced5 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/categories/applications-multimedia.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/categories/applications-office.png b/CoffeBeans/icons/tango/16x16/tango/categories/applications-office.png new file mode 100644 index 0000000..f9b3bb9 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/categories/applications-office.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/categories/applications-other.png b/CoffeBeans/icons/tango/16x16/tango/categories/applications-other.png new file mode 100644 index 0000000..0d49f9d Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/categories/applications-other.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/categories/applications-system.png b/CoffeBeans/icons/tango/16x16/tango/categories/applications-system.png new file mode 100644 index 0000000..d90ab66 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/categories/applications-system.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/categories/preferences-desktop-peripherals.png b/CoffeBeans/icons/tango/16x16/tango/categories/preferences-desktop-peripherals.png new file mode 100644 index 0000000..2a63cee Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/categories/preferences-desktop-peripherals.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/categories/preferences-desktop.png b/CoffeBeans/icons/tango/16x16/tango/categories/preferences-desktop.png new file mode 100644 index 0000000..68f916c Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/categories/preferences-desktop.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/categories/preferences-system.png b/CoffeBeans/icons/tango/16x16/tango/categories/preferences-system.png new file mode 100644 index 0000000..9460dfc Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/categories/preferences-system.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/devices/audio-card.png b/CoffeBeans/icons/tango/16x16/tango/devices/audio-card.png new file mode 100644 index 0000000..aaa7907 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/devices/audio-card.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/devices/audio-input-microphone.png b/CoffeBeans/icons/tango/16x16/tango/devices/audio-input-microphone.png new file mode 100644 index 0000000..53a0393 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/devices/audio-input-microphone.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/devices/battery.png b/CoffeBeans/icons/tango/16x16/tango/devices/battery.png new file mode 100644 index 0000000..8684e2a Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/devices/battery.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/devices/camera-photo.png b/CoffeBeans/icons/tango/16x16/tango/devices/camera-photo.png new file mode 100644 index 0000000..1e8e886 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/devices/camera-photo.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/devices/camera-video.png b/CoffeBeans/icons/tango/16x16/tango/devices/camera-video.png new file mode 100644 index 0000000..98fc211 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/devices/camera-video.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/devices/computer.png b/CoffeBeans/icons/tango/16x16/tango/devices/computer.png new file mode 100644 index 0000000..d0b397b Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/devices/computer.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/devices/drive-harddisk.png b/CoffeBeans/icons/tango/16x16/tango/devices/drive-harddisk.png new file mode 100644 index 0000000..5c3b858 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/devices/drive-harddisk.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/devices/drive-optical.png b/CoffeBeans/icons/tango/16x16/tango/devices/drive-optical.png new file mode 100644 index 0000000..4ced6fe Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/devices/drive-optical.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/devices/drive-removable-media.png b/CoffeBeans/icons/tango/16x16/tango/devices/drive-removable-media.png new file mode 100644 index 0000000..9153898 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/devices/drive-removable-media.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/devices/input-gaming.png b/CoffeBeans/icons/tango/16x16/tango/devices/input-gaming.png new file mode 100644 index 0000000..9d040ee Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/devices/input-gaming.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/devices/input-keyboard.png b/CoffeBeans/icons/tango/16x16/tango/devices/input-keyboard.png new file mode 100644 index 0000000..fab414b Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/devices/input-keyboard.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/devices/input-mouse.png b/CoffeBeans/icons/tango/16x16/tango/devices/input-mouse.png new file mode 100644 index 0000000..eeda4db Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/devices/input-mouse.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/devices/media-flash.png b/CoffeBeans/icons/tango/16x16/tango/devices/media-flash.png new file mode 100644 index 0000000..bef542a Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/devices/media-flash.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/devices/media-floppy.png b/CoffeBeans/icons/tango/16x16/tango/devices/media-floppy.png new file mode 100644 index 0000000..f1d7a19 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/devices/media-floppy.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/devices/media-optical.png b/CoffeBeans/icons/tango/16x16/tango/devices/media-optical.png new file mode 100644 index 0000000..760de93 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/devices/media-optical.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/devices/multimedia-player.png b/CoffeBeans/icons/tango/16x16/tango/devices/multimedia-player.png new file mode 100644 index 0000000..461e9de Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/devices/multimedia-player.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/devices/network-wired.png b/CoffeBeans/icons/tango/16x16/tango/devices/network-wired.png new file mode 100644 index 0000000..3ac6b35 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/devices/network-wired.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/devices/network-wireless.png b/CoffeBeans/icons/tango/16x16/tango/devices/network-wireless.png new file mode 100644 index 0000000..2dc6250 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/devices/network-wireless.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/devices/printer.png b/CoffeBeans/icons/tango/16x16/tango/devices/printer.png new file mode 100644 index 0000000..12a4e39 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/devices/printer.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/devices/video-display.png b/CoffeBeans/icons/tango/16x16/tango/devices/video-display.png new file mode 100644 index 0000000..226881f Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/devices/video-display.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/emblems/emblem-favorite.png b/CoffeBeans/icons/tango/16x16/tango/emblems/emblem-favorite.png new file mode 100644 index 0000000..3acb57d Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/emblems/emblem-favorite.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/emblems/emblem-important.png b/CoffeBeans/icons/tango/16x16/tango/emblems/emblem-important.png new file mode 100644 index 0000000..81e9ed2 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/emblems/emblem-important.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/emblems/emblem-photos.png b/CoffeBeans/icons/tango/16x16/tango/emblems/emblem-photos.png new file mode 100644 index 0000000..ab40463 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/emblems/emblem-photos.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/emblems/emblem-readonly.png b/CoffeBeans/icons/tango/16x16/tango/emblems/emblem-readonly.png new file mode 100644 index 0000000..0466619 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/emblems/emblem-readonly.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/emblems/emblem-symbolic-link.png b/CoffeBeans/icons/tango/16x16/tango/emblems/emblem-symbolic-link.png new file mode 100644 index 0000000..800b9e8 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/emblems/emblem-symbolic-link.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/emblems/emblem-system.png b/CoffeBeans/icons/tango/16x16/tango/emblems/emblem-system.png new file mode 100644 index 0000000..259ed26 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/emblems/emblem-system.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/emblems/emblem-unreadable.png b/CoffeBeans/icons/tango/16x16/tango/emblems/emblem-unreadable.png new file mode 100644 index 0000000..5c08b05 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/emblems/emblem-unreadable.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/emotes/face-angel.png b/CoffeBeans/icons/tango/16x16/tango/emotes/face-angel.png new file mode 100644 index 0000000..d2c5e94 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/emotes/face-angel.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/emotes/face-crying.png b/CoffeBeans/icons/tango/16x16/tango/emotes/face-crying.png new file mode 100644 index 0000000..2620dab Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/emotes/face-crying.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/emotes/face-devilish.png b/CoffeBeans/icons/tango/16x16/tango/emotes/face-devilish.png new file mode 100644 index 0000000..6edf683 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/emotes/face-devilish.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/emotes/face-glasses.png b/CoffeBeans/icons/tango/16x16/tango/emotes/face-glasses.png new file mode 100644 index 0000000..00c2cd4 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/emotes/face-glasses.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/emotes/face-grin.png b/CoffeBeans/icons/tango/16x16/tango/emotes/face-grin.png new file mode 100644 index 0000000..0d013d5 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/emotes/face-grin.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/emotes/face-kiss.png b/CoffeBeans/icons/tango/16x16/tango/emotes/face-kiss.png new file mode 100644 index 0000000..809c1cf Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/emotes/face-kiss.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/emotes/face-monkey.png b/CoffeBeans/icons/tango/16x16/tango/emotes/face-monkey.png new file mode 100644 index 0000000..69db8fa Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/emotes/face-monkey.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/emotes/face-plain.png b/CoffeBeans/icons/tango/16x16/tango/emotes/face-plain.png new file mode 100644 index 0000000..31cf984 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/emotes/face-plain.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/emotes/face-sad.png b/CoffeBeans/icons/tango/16x16/tango/emotes/face-sad.png new file mode 100644 index 0000000..159c04b Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/emotes/face-sad.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/emotes/face-smile-big.png b/CoffeBeans/icons/tango/16x16/tango/emotes/face-smile-big.png new file mode 100644 index 0000000..9114fde Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/emotes/face-smile-big.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/emotes/face-smile.png b/CoffeBeans/icons/tango/16x16/tango/emotes/face-smile.png new file mode 100644 index 0000000..de862b1 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/emotes/face-smile.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/emotes/face-surprise.png b/CoffeBeans/icons/tango/16x16/tango/emotes/face-surprise.png new file mode 100644 index 0000000..4b4d423 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/emotes/face-surprise.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/emotes/face-wink.png b/CoffeBeans/icons/tango/16x16/tango/emotes/face-wink.png new file mode 100644 index 0000000..e2db57e Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/emotes/face-wink.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/mimetypes/application-certificate.png b/CoffeBeans/icons/tango/16x16/tango/mimetypes/application-certificate.png new file mode 100644 index 0000000..486913d Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/mimetypes/application-certificate.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/mimetypes/application-x-executable.png b/CoffeBeans/icons/tango/16x16/tango/mimetypes/application-x-executable.png new file mode 100644 index 0000000..003ded2 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/mimetypes/application-x-executable.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/mimetypes/audio-x-generic.png b/CoffeBeans/icons/tango/16x16/tango/mimetypes/audio-x-generic.png new file mode 100644 index 0000000..2bd5af9 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/mimetypes/audio-x-generic.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/mimetypes/font-x-generic.png b/CoffeBeans/icons/tango/16x16/tango/mimetypes/font-x-generic.png new file mode 100644 index 0000000..bdbc1a8 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/mimetypes/font-x-generic.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/mimetypes/image-x-generic.png b/CoffeBeans/icons/tango/16x16/tango/mimetypes/image-x-generic.png new file mode 100644 index 0000000..68da502 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/mimetypes/image-x-generic.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/mimetypes/package-x-generic.png b/CoffeBeans/icons/tango/16x16/tango/mimetypes/package-x-generic.png new file mode 100644 index 0000000..9015426 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/mimetypes/package-x-generic.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/mimetypes/text-html.png b/CoffeBeans/icons/tango/16x16/tango/mimetypes/text-html.png new file mode 100644 index 0000000..53014ab Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/mimetypes/text-html.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/mimetypes/text-x-generic-template.png b/CoffeBeans/icons/tango/16x16/tango/mimetypes/text-x-generic-template.png new file mode 100644 index 0000000..a0cc462 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/mimetypes/text-x-generic-template.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/mimetypes/text-x-generic.png b/CoffeBeans/icons/tango/16x16/tango/mimetypes/text-x-generic.png new file mode 100644 index 0000000..2d7f2d6 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/mimetypes/text-x-generic.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/mimetypes/text-x-script.png b/CoffeBeans/icons/tango/16x16/tango/mimetypes/text-x-script.png new file mode 100644 index 0000000..c923098 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/mimetypes/text-x-script.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/mimetypes/video-x-generic.png b/CoffeBeans/icons/tango/16x16/tango/mimetypes/video-x-generic.png new file mode 100644 index 0000000..64e7a30 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/mimetypes/video-x-generic.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-address-book.png b/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-address-book.png new file mode 100644 index 0000000..f3b5d9d Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-address-book.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-calendar.png b/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-calendar.png new file mode 100644 index 0000000..f6978d7 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-calendar.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-document-template.png b/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-document-template.png new file mode 100644 index 0000000..d1d9e7c Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-document-template.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-document.png b/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-document.png new file mode 100644 index 0000000..d18082e Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-document.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-drawing-template.png b/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-drawing-template.png new file mode 100644 index 0000000..dc384db Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-drawing-template.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-drawing.png b/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-drawing.png new file mode 100644 index 0000000..ffbb9e4 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-drawing.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-presentation-template.png b/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-presentation-template.png new file mode 100644 index 0000000..d90d034 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-presentation-template.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-presentation.png b/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-presentation.png new file mode 100644 index 0000000..f7ea302 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-presentation.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-spreadsheet-template.png b/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-spreadsheet-template.png new file mode 100644 index 0000000..e8bf570 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-spreadsheet-template.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-spreadsheet.png b/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-spreadsheet.png new file mode 100644 index 0000000..a6b1268 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/mimetypes/x-office-spreadsheet.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/places/folder-remote.png b/CoffeBeans/icons/tango/16x16/tango/places/folder-remote.png new file mode 100644 index 0000000..5234eab Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/places/folder-remote.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/places/folder-saved-search.png b/CoffeBeans/icons/tango/16x16/tango/places/folder-saved-search.png new file mode 100644 index 0000000..ca24a36 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/places/folder-saved-search.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/places/folder.png b/CoffeBeans/icons/tango/16x16/tango/places/folder.png new file mode 100644 index 0000000..65bd0bb Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/places/folder.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/places/network-server.png b/CoffeBeans/icons/tango/16x16/tango/places/network-server.png new file mode 100644 index 0000000..068ffeb Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/places/network-server.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/places/network-workgroup.png b/CoffeBeans/icons/tango/16x16/tango/places/network-workgroup.png new file mode 100644 index 0000000..5c140d8 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/places/network-workgroup.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/places/start-here.png b/CoffeBeans/icons/tango/16x16/tango/places/start-here.png new file mode 100644 index 0000000..bd516a5 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/places/start-here.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/places/user-desktop.png b/CoffeBeans/icons/tango/16x16/tango/places/user-desktop.png new file mode 100644 index 0000000..4c9787c Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/places/user-desktop.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/places/user-home.png b/CoffeBeans/icons/tango/16x16/tango/places/user-home.png new file mode 100644 index 0000000..7b9110d Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/places/user-home.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/places/user-trash.png b/CoffeBeans/icons/tango/16x16/tango/places/user-trash.png new file mode 100644 index 0000000..0e0953c Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/places/user-trash.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/audio-volume-high.png b/CoffeBeans/icons/tango/16x16/tango/status/audio-volume-high.png new file mode 100644 index 0000000..ec8f00b Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/audio-volume-high.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/audio-volume-low.png b/CoffeBeans/icons/tango/16x16/tango/status/audio-volume-low.png new file mode 100644 index 0000000..4d7239f Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/audio-volume-low.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/audio-volume-medium.png b/CoffeBeans/icons/tango/16x16/tango/status/audio-volume-medium.png new file mode 100644 index 0000000..36ca7b0 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/audio-volume-medium.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/audio-volume-muted.png b/CoffeBeans/icons/tango/16x16/tango/status/audio-volume-muted.png new file mode 100644 index 0000000..af5a97b Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/audio-volume-muted.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/battery-caution.png b/CoffeBeans/icons/tango/16x16/tango/status/battery-caution.png new file mode 100644 index 0000000..53a27d1 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/battery-caution.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/dialog-error.png b/CoffeBeans/icons/tango/16x16/tango/status/dialog-error.png new file mode 100644 index 0000000..3bbbb4a Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/dialog-error.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/dialog-information.png b/CoffeBeans/icons/tango/16x16/tango/status/dialog-information.png new file mode 100644 index 0000000..8851b99 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/dialog-information.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/dialog-warning.png b/CoffeBeans/icons/tango/16x16/tango/status/dialog-warning.png new file mode 100644 index 0000000..a9e4ff3 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/dialog-warning.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/folder-drag-accept.png b/CoffeBeans/icons/tango/16x16/tango/status/folder-drag-accept.png new file mode 100644 index 0000000..44055dc Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/folder-drag-accept.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/folder-open.png b/CoffeBeans/icons/tango/16x16/tango/status/folder-open.png new file mode 100644 index 0000000..b67403d Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/folder-open.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/folder-visiting.png b/CoffeBeans/icons/tango/16x16/tango/status/folder-visiting.png new file mode 100644 index 0000000..9002444 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/folder-visiting.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/image-loading.png b/CoffeBeans/icons/tango/16x16/tango/status/image-loading.png new file mode 100644 index 0000000..174994e Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/image-loading.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/image-missing.png b/CoffeBeans/icons/tango/16x16/tango/status/image-missing.png new file mode 100644 index 0000000..a644f24 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/image-missing.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/mail-attachment.png b/CoffeBeans/icons/tango/16x16/tango/status/mail-attachment.png new file mode 100644 index 0000000..529bb7f Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/mail-attachment.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/network-error.png b/CoffeBeans/icons/tango/16x16/tango/status/network-error.png new file mode 100644 index 0000000..3f18ed0 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/network-error.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/network-idle.png b/CoffeBeans/icons/tango/16x16/tango/status/network-idle.png new file mode 100644 index 0000000..0efee57 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/network-idle.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/network-offline.png b/CoffeBeans/icons/tango/16x16/tango/status/network-offline.png new file mode 100644 index 0000000..1f210fc Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/network-offline.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/network-receive.png b/CoffeBeans/icons/tango/16x16/tango/status/network-receive.png new file mode 100644 index 0000000..b57c65c Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/network-receive.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/network-transmit-receive.png b/CoffeBeans/icons/tango/16x16/tango/status/network-transmit-receive.png new file mode 100644 index 0000000..271d37d Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/network-transmit-receive.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/network-transmit.png b/CoffeBeans/icons/tango/16x16/tango/status/network-transmit.png new file mode 100644 index 0000000..08aa28b Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/network-transmit.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/network-wireless-encrypted.png b/CoffeBeans/icons/tango/16x16/tango/status/network-wireless-encrypted.png new file mode 100644 index 0000000..c73e33c Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/network-wireless-encrypted.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/printer-error.png b/CoffeBeans/icons/tango/16x16/tango/status/printer-error.png new file mode 100644 index 0000000..21d4ded Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/printer-error.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/software-update-available.png b/CoffeBeans/icons/tango/16x16/tango/status/software-update-available.png new file mode 100644 index 0000000..ab8d494 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/software-update-available.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/software-update-urgent.png b/CoffeBeans/icons/tango/16x16/tango/status/software-update-urgent.png new file mode 100644 index 0000000..433945d Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/software-update-urgent.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/user-trash-full.png b/CoffeBeans/icons/tango/16x16/tango/status/user-trash-full.png new file mode 100644 index 0000000..695d215 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/user-trash-full.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/weather-clear-night.png b/CoffeBeans/icons/tango/16x16/tango/status/weather-clear-night.png new file mode 100644 index 0000000..4345752 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/weather-clear-night.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/weather-clear.png b/CoffeBeans/icons/tango/16x16/tango/status/weather-clear.png new file mode 100644 index 0000000..7dc15ea Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/weather-clear.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/weather-few-clouds-night.png b/CoffeBeans/icons/tango/16x16/tango/status/weather-few-clouds-night.png new file mode 100644 index 0000000..d69efec Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/weather-few-clouds-night.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/weather-few-clouds.png b/CoffeBeans/icons/tango/16x16/tango/status/weather-few-clouds.png new file mode 100644 index 0000000..0e633a3 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/weather-few-clouds.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/weather-overcast.png b/CoffeBeans/icons/tango/16x16/tango/status/weather-overcast.png new file mode 100644 index 0000000..0045129 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/weather-overcast.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/weather-severe-alert.png b/CoffeBeans/icons/tango/16x16/tango/status/weather-severe-alert.png new file mode 100644 index 0000000..98e9f6c Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/weather-severe-alert.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/weather-showers-scattered.png b/CoffeBeans/icons/tango/16x16/tango/status/weather-showers-scattered.png new file mode 100644 index 0000000..8d10d84 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/weather-showers-scattered.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/weather-showers.png b/CoffeBeans/icons/tango/16x16/tango/status/weather-showers.png new file mode 100644 index 0000000..d9685d2 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/weather-showers.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/weather-snow.png b/CoffeBeans/icons/tango/16x16/tango/status/weather-snow.png new file mode 100644 index 0000000..a83d855 Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/weather-snow.png differ diff --git a/CoffeBeans/icons/tango/16x16/tango/status/weather-storm.png b/CoffeBeans/icons/tango/16x16/tango/status/weather-storm.png new file mode 100644 index 0000000..feebe1d Binary files /dev/null and b/CoffeBeans/icons/tango/16x16/tango/status/weather-storm.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/address-book-new.png b/CoffeBeans/icons/tango/22x22/tango/actions/address-book-new.png new file mode 100644 index 0000000..fad446c Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/address-book-new.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/appointment-new.png b/CoffeBeans/icons/tango/22x22/tango/actions/appointment-new.png new file mode 100644 index 0000000..d676ffd Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/appointment-new.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/bookmark-new.png b/CoffeBeans/icons/tango/22x22/tango/actions/bookmark-new.png new file mode 100644 index 0000000..3ec0300 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/bookmark-new.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/contact-new.png b/CoffeBeans/icons/tango/22x22/tango/actions/contact-new.png new file mode 100644 index 0000000..c9921be Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/contact-new.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/document-new.png b/CoffeBeans/icons/tango/22x22/tango/actions/document-new.png new file mode 100644 index 0000000..e3808a1 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/document-new.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/document-open.png b/CoffeBeans/icons/tango/22x22/tango/actions/document-open.png new file mode 100644 index 0000000..254a6b8 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/document-open.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/document-print-preview.png b/CoffeBeans/icons/tango/22x22/tango/actions/document-print-preview.png new file mode 100644 index 0000000..75f43aa Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/document-print-preview.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/document-print.png b/CoffeBeans/icons/tango/22x22/tango/actions/document-print.png new file mode 100644 index 0000000..52dd67e Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/document-print.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/document-properties.png b/CoffeBeans/icons/tango/22x22/tango/actions/document-properties.png new file mode 100644 index 0000000..a5ad728 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/document-properties.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/document-revert.png b/CoffeBeans/icons/tango/22x22/tango/actions/document-revert.png new file mode 100644 index 0000000..529abcb Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/document-revert.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/document-save-as.png b/CoffeBeans/icons/tango/22x22/tango/actions/document-save-as.png new file mode 100644 index 0000000..340a87e Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/document-save-as.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/document-save.png b/CoffeBeans/icons/tango/22x22/tango/actions/document-save.png new file mode 100644 index 0000000..a94e0ea Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/document-save.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/edit-clear.png b/CoffeBeans/icons/tango/22x22/tango/actions/edit-clear.png new file mode 100644 index 0000000..bbc77eb Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/edit-clear.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/edit-copy.png b/CoffeBeans/icons/tango/22x22/tango/actions/edit-copy.png new file mode 100644 index 0000000..345b2f1 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/edit-copy.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/edit-cut.png b/CoffeBeans/icons/tango/22x22/tango/actions/edit-cut.png new file mode 100644 index 0000000..7017d1b Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/edit-cut.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/edit-delete.png b/CoffeBeans/icons/tango/22x22/tango/actions/edit-delete.png new file mode 100644 index 0000000..3811b64 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/edit-delete.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/edit-find-replace.png b/CoffeBeans/icons/tango/22x22/tango/actions/edit-find-replace.png new file mode 100644 index 0000000..de3a75f Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/edit-find-replace.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/edit-find.png b/CoffeBeans/icons/tango/22x22/tango/actions/edit-find.png new file mode 100644 index 0000000..4f078cb Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/edit-find.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/edit-paste.png b/CoffeBeans/icons/tango/22x22/tango/actions/edit-paste.png new file mode 100644 index 0000000..f6a625c Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/edit-paste.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/edit-redo.png b/CoffeBeans/icons/tango/22x22/tango/actions/edit-redo.png new file mode 100644 index 0000000..576cfc7 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/edit-redo.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/edit-select-all.png b/CoffeBeans/icons/tango/22x22/tango/actions/edit-select-all.png new file mode 100644 index 0000000..e6331c6 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/edit-select-all.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/edit-undo.png b/CoffeBeans/icons/tango/22x22/tango/actions/edit-undo.png new file mode 100644 index 0000000..f37c696 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/edit-undo.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/folder-new.png b/CoffeBeans/icons/tango/22x22/tango/actions/folder-new.png new file mode 100644 index 0000000..1c3dc94 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/folder-new.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/format-indent-less.png b/CoffeBeans/icons/tango/22x22/tango/actions/format-indent-less.png new file mode 100644 index 0000000..5292012 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/format-indent-less.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/format-indent-more.png b/CoffeBeans/icons/tango/22x22/tango/actions/format-indent-more.png new file mode 100644 index 0000000..ad2b527 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/format-indent-more.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/format-justify-center.png b/CoffeBeans/icons/tango/22x22/tango/actions/format-justify-center.png new file mode 100644 index 0000000..0777a9a Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/format-justify-center.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/format-justify-fill.png b/CoffeBeans/icons/tango/22x22/tango/actions/format-justify-fill.png new file mode 100644 index 0000000..0ce4013 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/format-justify-fill.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/format-justify-left.png b/CoffeBeans/icons/tango/22x22/tango/actions/format-justify-left.png new file mode 100644 index 0000000..a8e1ca8 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/format-justify-left.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/format-justify-right.png b/CoffeBeans/icons/tango/22x22/tango/actions/format-justify-right.png new file mode 100644 index 0000000..8228d81 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/format-justify-right.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/format-text-bold.png b/CoffeBeans/icons/tango/22x22/tango/actions/format-text-bold.png new file mode 100644 index 0000000..7166e3d Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/format-text-bold.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/format-text-italic.png b/CoffeBeans/icons/tango/22x22/tango/actions/format-text-italic.png new file mode 100644 index 0000000..ef68fb3 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/format-text-italic.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/format-text-strikethrough.png b/CoffeBeans/icons/tango/22x22/tango/actions/format-text-strikethrough.png new file mode 100644 index 0000000..e4ca573 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/format-text-strikethrough.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/format-text-underline.png b/CoffeBeans/icons/tango/22x22/tango/actions/format-text-underline.png new file mode 100644 index 0000000..d33422b Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/format-text-underline.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/go-bottom.png b/CoffeBeans/icons/tango/22x22/tango/actions/go-bottom.png new file mode 100644 index 0000000..d81e071 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/go-bottom.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/go-down.png b/CoffeBeans/icons/tango/22x22/tango/actions/go-down.png new file mode 100644 index 0000000..af23788 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/go-down.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/go-first.png b/CoffeBeans/icons/tango/22x22/tango/actions/go-first.png new file mode 100644 index 0000000..bf0d8f2 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/go-first.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/go-home.png b/CoffeBeans/icons/tango/22x22/tango/actions/go-home.png new file mode 100644 index 0000000..9d62109 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/go-home.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/go-jump.png b/CoffeBeans/icons/tango/22x22/tango/actions/go-jump.png new file mode 100644 index 0000000..373dce9 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/go-jump.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/go-last.png b/CoffeBeans/icons/tango/22x22/tango/actions/go-last.png new file mode 100644 index 0000000..32df45d Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/go-last.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/go-next.png b/CoffeBeans/icons/tango/22x22/tango/actions/go-next.png new file mode 100644 index 0000000..6f3f65d Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/go-next.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/go-previous.png b/CoffeBeans/icons/tango/22x22/tango/actions/go-previous.png new file mode 100644 index 0000000..93be3d1 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/go-previous.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/go-top.png b/CoffeBeans/icons/tango/22x22/tango/actions/go-top.png new file mode 100644 index 0000000..96f98dd Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/go-top.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/go-up.png b/CoffeBeans/icons/tango/22x22/tango/actions/go-up.png new file mode 100644 index 0000000..b0a0cd7 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/go-up.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/list-add.png b/CoffeBeans/icons/tango/22x22/tango/actions/list-add.png new file mode 100644 index 0000000..306d3d8 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/list-add.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/list-remove.png b/CoffeBeans/icons/tango/22x22/tango/actions/list-remove.png new file mode 100644 index 0000000..45e5c2a Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/list-remove.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/mail-forward.png b/CoffeBeans/icons/tango/22x22/tango/actions/mail-forward.png new file mode 100644 index 0000000..51aa0b4 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/mail-forward.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/mail-mark-junk.png b/CoffeBeans/icons/tango/22x22/tango/actions/mail-mark-junk.png new file mode 100644 index 0000000..f980138 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/mail-mark-junk.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/mail-mark-not-junk.png b/CoffeBeans/icons/tango/22x22/tango/actions/mail-mark-not-junk.png new file mode 100644 index 0000000..da6fb95 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/mail-mark-not-junk.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/mail-message-new.png b/CoffeBeans/icons/tango/22x22/tango/actions/mail-message-new.png new file mode 100644 index 0000000..96ae0e9 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/mail-message-new.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/mail-reply-all.png b/CoffeBeans/icons/tango/22x22/tango/actions/mail-reply-all.png new file mode 100644 index 0000000..c158a72 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/mail-reply-all.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/mail-reply-sender.png b/CoffeBeans/icons/tango/22x22/tango/actions/mail-reply-sender.png new file mode 100644 index 0000000..4f077a1 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/mail-reply-sender.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/mail-send-receive.png b/CoffeBeans/icons/tango/22x22/tango/actions/mail-send-receive.png new file mode 100644 index 0000000..69e8272 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/mail-send-receive.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/media-eject.png b/CoffeBeans/icons/tango/22x22/tango/actions/media-eject.png new file mode 100644 index 0000000..5a232e6 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/media-eject.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/media-playback-pause.png b/CoffeBeans/icons/tango/22x22/tango/actions/media-playback-pause.png new file mode 100644 index 0000000..ee40fc2 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/media-playback-pause.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/media-playback-start.png b/CoffeBeans/icons/tango/22x22/tango/actions/media-playback-start.png new file mode 100644 index 0000000..10102d8 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/media-playback-start.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/media-playback-stop.png b/CoffeBeans/icons/tango/22x22/tango/actions/media-playback-stop.png new file mode 100644 index 0000000..d0e4733 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/media-playback-stop.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/media-record.png b/CoffeBeans/icons/tango/22x22/tango/actions/media-record.png new file mode 100644 index 0000000..fb53e14 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/media-record.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/media-seek-backward.png b/CoffeBeans/icons/tango/22x22/tango/actions/media-seek-backward.png new file mode 100644 index 0000000..e094d12 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/media-seek-backward.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/media-seek-forward.png b/CoffeBeans/icons/tango/22x22/tango/actions/media-seek-forward.png new file mode 100644 index 0000000..b9c2c6c Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/media-seek-forward.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/media-skip-backward.png b/CoffeBeans/icons/tango/22x22/tango/actions/media-skip-backward.png new file mode 100644 index 0000000..2a5e703 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/media-skip-backward.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/media-skip-forward.png b/CoffeBeans/icons/tango/22x22/tango/actions/media-skip-forward.png new file mode 100644 index 0000000..28bca3e Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/media-skip-forward.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/process-stop.png b/CoffeBeans/icons/tango/22x22/tango/actions/process-stop.png new file mode 100644 index 0000000..b68290b Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/process-stop.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/system-lock-screen.png b/CoffeBeans/icons/tango/22x22/tango/actions/system-lock-screen.png new file mode 100644 index 0000000..dc6b825 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/system-lock-screen.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/system-log-out.png b/CoffeBeans/icons/tango/22x22/tango/actions/system-log-out.png new file mode 100644 index 0000000..28ac66f Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/system-log-out.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/system-search.png b/CoffeBeans/icons/tango/22x22/tango/actions/system-search.png new file mode 100644 index 0000000..4e522b2 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/system-search.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/system-shutdown.png b/CoffeBeans/icons/tango/22x22/tango/actions/system-shutdown.png new file mode 100644 index 0000000..0c2a2d1 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/system-shutdown.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/tab-new.png b/CoffeBeans/icons/tango/22x22/tango/actions/tab-new.png new file mode 100644 index 0000000..c7c7cf2 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/tab-new.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/view-fullscreen.png b/CoffeBeans/icons/tango/22x22/tango/actions/view-fullscreen.png new file mode 100644 index 0000000..6f0f292 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/view-fullscreen.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/view-refresh.png b/CoffeBeans/icons/tango/22x22/tango/actions/view-refresh.png new file mode 100644 index 0000000..cab4d02 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/view-refresh.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/actions/window-new.png b/CoffeBeans/icons/tango/22x22/tango/actions/window-new.png new file mode 100644 index 0000000..314f997 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/actions/window-new.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/animations/process-working.png b/CoffeBeans/icons/tango/22x22/tango/animations/process-working.png new file mode 100644 index 0000000..9005de7 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/animations/process-working.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/accessories-calculator.png b/CoffeBeans/icons/tango/22x22/tango/apps/accessories-calculator.png new file mode 100644 index 0000000..e12d465 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/accessories-calculator.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/accessories-character-map.png b/CoffeBeans/icons/tango/22x22/tango/apps/accessories-character-map.png new file mode 100644 index 0000000..e630c7e Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/accessories-character-map.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/accessories-text-editor.png b/CoffeBeans/icons/tango/22x22/tango/apps/accessories-text-editor.png new file mode 100644 index 0000000..c3d245d Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/accessories-text-editor.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/help-browser.png b/CoffeBeans/icons/tango/22x22/tango/apps/help-browser.png new file mode 100644 index 0000000..c67c7a6 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/help-browser.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/internet-group-chat.png b/CoffeBeans/icons/tango/22x22/tango/apps/internet-group-chat.png new file mode 100644 index 0000000..3cac5df Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/internet-group-chat.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/internet-mail.png b/CoffeBeans/icons/tango/22x22/tango/apps/internet-mail.png new file mode 100644 index 0000000..68fc82e Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/internet-mail.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/internet-news-reader.png b/CoffeBeans/icons/tango/22x22/tango/apps/internet-news-reader.png new file mode 100644 index 0000000..43950eb Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/internet-news-reader.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/internet-web-browser.png b/CoffeBeans/icons/tango/22x22/tango/apps/internet-web-browser.png new file mode 100644 index 0000000..4125479 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/internet-web-browser.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/office-calendar.png b/CoffeBeans/icons/tango/22x22/tango/apps/office-calendar.png new file mode 100644 index 0000000..60ad82b Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/office-calendar.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-accessibility.png b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-accessibility.png new file mode 100644 index 0000000..919d735 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-accessibility.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-assistive-technology.png b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-assistive-technology.png new file mode 100644 index 0000000..483e4a6 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-assistive-technology.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-font.png b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-font.png new file mode 100644 index 0000000..d452db7 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-font.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-keyboard-shortcuts.png b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-keyboard-shortcuts.png new file mode 100644 index 0000000..c3e1328 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-keyboard-shortcuts.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-locale.png b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-locale.png new file mode 100644 index 0000000..ed0480b Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-locale.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-multimedia.png b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-multimedia.png new file mode 100644 index 0000000..e1bdf85 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-multimedia.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-remote-desktop.png b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-remote-desktop.png new file mode 100644 index 0000000..d25792b Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-remote-desktop.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-screensaver.png b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-screensaver.png new file mode 100644 index 0000000..619e196 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-screensaver.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-theme.png b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-theme.png new file mode 100644 index 0000000..7b5f0ba Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-theme.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-wallpaper.png b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-wallpaper.png new file mode 100644 index 0000000..3389e55 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-desktop-wallpaper.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/preferences-system-network-proxy.png b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-system-network-proxy.png new file mode 100644 index 0000000..bec24de Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-system-network-proxy.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/preferences-system-session.png b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-system-session.png new file mode 100644 index 0000000..9a09875 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-system-session.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/preferences-system-windows.png b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-system-windows.png new file mode 100644 index 0000000..2caa205 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/preferences-system-windows.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/system-file-manager.png b/CoffeBeans/icons/tango/22x22/tango/apps/system-file-manager.png new file mode 100644 index 0000000..44d6310 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/system-file-manager.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/system-installer.png b/CoffeBeans/icons/tango/22x22/tango/apps/system-installer.png new file mode 100644 index 0000000..b75c6b1 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/system-installer.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/system-software-update.png b/CoffeBeans/icons/tango/22x22/tango/apps/system-software-update.png new file mode 100644 index 0000000..5f7a362 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/system-software-update.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/system-users.png b/CoffeBeans/icons/tango/22x22/tango/apps/system-users.png new file mode 100644 index 0000000..bced28c Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/system-users.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/utilities-system-monitor.png b/CoffeBeans/icons/tango/22x22/tango/apps/utilities-system-monitor.png new file mode 100644 index 0000000..f2d266f Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/utilities-system-monitor.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/apps/utilities-terminal.png b/CoffeBeans/icons/tango/22x22/tango/apps/utilities-terminal.png new file mode 100644 index 0000000..ceb0fb9 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/apps/utilities-terminal.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/categories/applications-accessories.png b/CoffeBeans/icons/tango/22x22/tango/categories/applications-accessories.png new file mode 100644 index 0000000..f619403 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/categories/applications-accessories.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/categories/applications-development.png b/CoffeBeans/icons/tango/22x22/tango/categories/applications-development.png new file mode 100644 index 0000000..8ef08e2 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/categories/applications-development.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/categories/applications-games.png b/CoffeBeans/icons/tango/22x22/tango/categories/applications-games.png new file mode 100644 index 0000000..cc78378 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/categories/applications-games.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/categories/applications-graphics.png b/CoffeBeans/icons/tango/22x22/tango/categories/applications-graphics.png new file mode 100644 index 0000000..ca883da Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/categories/applications-graphics.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/categories/applications-internet.png b/CoffeBeans/icons/tango/22x22/tango/categories/applications-internet.png new file mode 100644 index 0000000..d4bfb82 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/categories/applications-internet.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/categories/applications-multimedia.png b/CoffeBeans/icons/tango/22x22/tango/categories/applications-multimedia.png new file mode 100644 index 0000000..ae2d28c Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/categories/applications-multimedia.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/categories/applications-office.png b/CoffeBeans/icons/tango/22x22/tango/categories/applications-office.png new file mode 100644 index 0000000..7e3be9b Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/categories/applications-office.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/categories/applications-other.png b/CoffeBeans/icons/tango/22x22/tango/categories/applications-other.png new file mode 100644 index 0000000..308acb2 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/categories/applications-other.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/categories/applications-system.png b/CoffeBeans/icons/tango/22x22/tango/categories/applications-system.png new file mode 100644 index 0000000..4decc89 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/categories/applications-system.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/categories/preferences-desktop-peripherals.png b/CoffeBeans/icons/tango/22x22/tango/categories/preferences-desktop-peripherals.png new file mode 100644 index 0000000..985bcde Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/categories/preferences-desktop-peripherals.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/categories/preferences-desktop.png b/CoffeBeans/icons/tango/22x22/tango/categories/preferences-desktop.png new file mode 100644 index 0000000..c359063 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/categories/preferences-desktop.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/categories/preferences-system.png b/CoffeBeans/icons/tango/22x22/tango/categories/preferences-system.png new file mode 100644 index 0000000..cc91d65 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/categories/preferences-system.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/devices/audio-card.png b/CoffeBeans/icons/tango/22x22/tango/devices/audio-card.png new file mode 100644 index 0000000..93d99aa Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/devices/audio-card.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/devices/audio-input-microphone.png b/CoffeBeans/icons/tango/22x22/tango/devices/audio-input-microphone.png new file mode 100644 index 0000000..496d244 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/devices/audio-input-microphone.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/devices/battery.png b/CoffeBeans/icons/tango/22x22/tango/devices/battery.png new file mode 100644 index 0000000..ad45674 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/devices/battery.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/devices/camera-photo.png b/CoffeBeans/icons/tango/22x22/tango/devices/camera-photo.png new file mode 100644 index 0000000..8d28baf Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/devices/camera-photo.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/devices/camera-video.png b/CoffeBeans/icons/tango/22x22/tango/devices/camera-video.png new file mode 100644 index 0000000..e84992c Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/devices/camera-video.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/devices/computer.png b/CoffeBeans/icons/tango/22x22/tango/devices/computer.png new file mode 100644 index 0000000..b6e6b39 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/devices/computer.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/devices/drive-harddisk.png b/CoffeBeans/icons/tango/22x22/tango/devices/drive-harddisk.png new file mode 100644 index 0000000..da41305 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/devices/drive-harddisk.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/devices/drive-optical.png b/CoffeBeans/icons/tango/22x22/tango/devices/drive-optical.png new file mode 100644 index 0000000..af2c826 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/devices/drive-optical.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/devices/drive-removable-media.png b/CoffeBeans/icons/tango/22x22/tango/devices/drive-removable-media.png new file mode 100644 index 0000000..f487310 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/devices/drive-removable-media.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/devices/input-gaming.png b/CoffeBeans/icons/tango/22x22/tango/devices/input-gaming.png new file mode 100644 index 0000000..18f7739 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/devices/input-gaming.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/devices/input-keyboard.png b/CoffeBeans/icons/tango/22x22/tango/devices/input-keyboard.png new file mode 100644 index 0000000..6ffb232 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/devices/input-keyboard.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/devices/input-mouse.png b/CoffeBeans/icons/tango/22x22/tango/devices/input-mouse.png new file mode 100644 index 0000000..c1bbc79 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/devices/input-mouse.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/devices/media-flash.png b/CoffeBeans/icons/tango/22x22/tango/devices/media-flash.png new file mode 100644 index 0000000..c6a2d0c Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/devices/media-flash.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/devices/media-floppy.png b/CoffeBeans/icons/tango/22x22/tango/devices/media-floppy.png new file mode 100644 index 0000000..af79de8 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/devices/media-floppy.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/devices/media-optical.png b/CoffeBeans/icons/tango/22x22/tango/devices/media-optical.png new file mode 100644 index 0000000..e86bfa3 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/devices/media-optical.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/devices/multimedia-player.png b/CoffeBeans/icons/tango/22x22/tango/devices/multimedia-player.png new file mode 100644 index 0000000..8be0228 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/devices/multimedia-player.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/devices/network-wired.png b/CoffeBeans/icons/tango/22x22/tango/devices/network-wired.png new file mode 100644 index 0000000..51c8b16 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/devices/network-wired.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/devices/network-wireless.png b/CoffeBeans/icons/tango/22x22/tango/devices/network-wireless.png new file mode 100644 index 0000000..2d7851f Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/devices/network-wireless.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/devices/printer.png b/CoffeBeans/icons/tango/22x22/tango/devices/printer.png new file mode 100644 index 0000000..65caccf Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/devices/printer.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/devices/video-display.png b/CoffeBeans/icons/tango/22x22/tango/devices/video-display.png new file mode 100644 index 0000000..f244adb Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/devices/video-display.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/emblems/emblem-favorite.png b/CoffeBeans/icons/tango/22x22/tango/emblems/emblem-favorite.png new file mode 100644 index 0000000..9b3d7ac Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/emblems/emblem-favorite.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/emblems/emblem-important.png b/CoffeBeans/icons/tango/22x22/tango/emblems/emblem-important.png new file mode 100644 index 0000000..0437a0d Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/emblems/emblem-important.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/emblems/emblem-photos.png b/CoffeBeans/icons/tango/22x22/tango/emblems/emblem-photos.png new file mode 100644 index 0000000..b8b1c63 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/emblems/emblem-photos.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/emblems/emblem-readonly.png b/CoffeBeans/icons/tango/22x22/tango/emblems/emblem-readonly.png new file mode 100644 index 0000000..33896d9 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/emblems/emblem-readonly.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/emblems/emblem-symbolic-link.png b/CoffeBeans/icons/tango/22x22/tango/emblems/emblem-symbolic-link.png new file mode 100644 index 0000000..d02781d Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/emblems/emblem-symbolic-link.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/emblems/emblem-system.png b/CoffeBeans/icons/tango/22x22/tango/emblems/emblem-system.png new file mode 100644 index 0000000..1f2b3b3 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/emblems/emblem-system.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/emblems/emblem-unreadable.png b/CoffeBeans/icons/tango/22x22/tango/emblems/emblem-unreadable.png new file mode 100644 index 0000000..6a88bdb Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/emblems/emblem-unreadable.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/emotes/face-angel.png b/CoffeBeans/icons/tango/22x22/tango/emotes/face-angel.png new file mode 100644 index 0000000..604bf17 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/emotes/face-angel.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/emotes/face-crying.png b/CoffeBeans/icons/tango/22x22/tango/emotes/face-crying.png new file mode 100644 index 0000000..761b0e8 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/emotes/face-crying.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/emotes/face-devilish.png b/CoffeBeans/icons/tango/22x22/tango/emotes/face-devilish.png new file mode 100644 index 0000000..fbd7808 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/emotes/face-devilish.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/emotes/face-glasses.png b/CoffeBeans/icons/tango/22x22/tango/emotes/face-glasses.png new file mode 100644 index 0000000..5551f12 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/emotes/face-glasses.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/emotes/face-grin.png b/CoffeBeans/icons/tango/22x22/tango/emotes/face-grin.png new file mode 100644 index 0000000..4513b92 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/emotes/face-grin.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/emotes/face-kiss.png b/CoffeBeans/icons/tango/22x22/tango/emotes/face-kiss.png new file mode 100644 index 0000000..a5d1bdd Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/emotes/face-kiss.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/emotes/face-monkey.png b/CoffeBeans/icons/tango/22x22/tango/emotes/face-monkey.png new file mode 100644 index 0000000..ced7b2e Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/emotes/face-monkey.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/emotes/face-plain.png b/CoffeBeans/icons/tango/22x22/tango/emotes/face-plain.png new file mode 100644 index 0000000..ea0ad6a Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/emotes/face-plain.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/emotes/face-sad.png b/CoffeBeans/icons/tango/22x22/tango/emotes/face-sad.png new file mode 100644 index 0000000..23afcb2 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/emotes/face-sad.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/emotes/face-smile-big.png b/CoffeBeans/icons/tango/22x22/tango/emotes/face-smile-big.png new file mode 100644 index 0000000..b2e8a36 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/emotes/face-smile-big.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/emotes/face-smile.png b/CoffeBeans/icons/tango/22x22/tango/emotes/face-smile.png new file mode 100644 index 0000000..45ff17d Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/emotes/face-smile.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/emotes/face-surprise.png b/CoffeBeans/icons/tango/22x22/tango/emotes/face-surprise.png new file mode 100644 index 0000000..9bae9b6 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/emotes/face-surprise.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/emotes/face-wink.png b/CoffeBeans/icons/tango/22x22/tango/emotes/face-wink.png new file mode 100644 index 0000000..cf10119 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/emotes/face-wink.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/mimetypes/application-certificate.png b/CoffeBeans/icons/tango/22x22/tango/mimetypes/application-certificate.png new file mode 100644 index 0000000..9657b43 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/mimetypes/application-certificate.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/mimetypes/application-x-executable.png b/CoffeBeans/icons/tango/22x22/tango/mimetypes/application-x-executable.png new file mode 100644 index 0000000..2bb2adf Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/mimetypes/application-x-executable.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/mimetypes/audio-x-generic.png b/CoffeBeans/icons/tango/22x22/tango/mimetypes/audio-x-generic.png new file mode 100644 index 0000000..318bebd Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/mimetypes/audio-x-generic.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/mimetypes/font-x-generic.png b/CoffeBeans/icons/tango/22x22/tango/mimetypes/font-x-generic.png new file mode 100644 index 0000000..bdc1814 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/mimetypes/font-x-generic.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/mimetypes/image-x-generic.png b/CoffeBeans/icons/tango/22x22/tango/mimetypes/image-x-generic.png new file mode 100644 index 0000000..10f4671 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/mimetypes/image-x-generic.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/mimetypes/package-x-generic.png b/CoffeBeans/icons/tango/22x22/tango/mimetypes/package-x-generic.png new file mode 100644 index 0000000..dc76287 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/mimetypes/package-x-generic.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/mimetypes/text-html.png b/CoffeBeans/icons/tango/22x22/tango/mimetypes/text-html.png new file mode 100644 index 0000000..51beaff Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/mimetypes/text-html.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/mimetypes/text-x-generic-template.png b/CoffeBeans/icons/tango/22x22/tango/mimetypes/text-x-generic-template.png new file mode 100644 index 0000000..f13f7c9 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/mimetypes/text-x-generic-template.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/mimetypes/text-x-generic.png b/CoffeBeans/icons/tango/22x22/tango/mimetypes/text-x-generic.png new file mode 100644 index 0000000..d68a56c Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/mimetypes/text-x-generic.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/mimetypes/text-x-script.png b/CoffeBeans/icons/tango/22x22/tango/mimetypes/text-x-script.png new file mode 100644 index 0000000..abf8f61 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/mimetypes/text-x-script.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/mimetypes/video-x-generic.png b/CoffeBeans/icons/tango/22x22/tango/mimetypes/video-x-generic.png new file mode 100644 index 0000000..6e26d9c Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/mimetypes/video-x-generic.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-address-book.png b/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-address-book.png new file mode 100644 index 0000000..2e519ce Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-address-book.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-calendar.png b/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-calendar.png new file mode 100644 index 0000000..0c224e9 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-calendar.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-document-template.png b/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-document-template.png new file mode 100644 index 0000000..18c4246 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-document-template.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-document.png b/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-document.png new file mode 100644 index 0000000..c9baeda Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-document.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-drawing-template.png b/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-drawing-template.png new file mode 100644 index 0000000..a7045ab Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-drawing-template.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-drawing.png b/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-drawing.png new file mode 100644 index 0000000..5d84f9f Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-drawing.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-presentation-template.png b/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-presentation-template.png new file mode 100644 index 0000000..1f7bc9b Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-presentation-template.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-presentation.png b/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-presentation.png new file mode 100644 index 0000000..3633f53 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-presentation.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-spreadsheet-template.png b/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-spreadsheet-template.png new file mode 100644 index 0000000..ea7d467 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-spreadsheet-template.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-spreadsheet.png b/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-spreadsheet.png new file mode 100644 index 0000000..c82d574 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/mimetypes/x-office-spreadsheet.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/places/folder-remote.png b/CoffeBeans/icons/tango/22x22/tango/places/folder-remote.png new file mode 100644 index 0000000..82db43b Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/places/folder-remote.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/places/folder-saved-search.png b/CoffeBeans/icons/tango/22x22/tango/places/folder-saved-search.png new file mode 100644 index 0000000..901f4a7 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/places/folder-saved-search.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/places/folder.png b/CoffeBeans/icons/tango/22x22/tango/places/folder.png new file mode 100644 index 0000000..01f45b8 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/places/folder.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/places/network-server.png b/CoffeBeans/icons/tango/22x22/tango/places/network-server.png new file mode 100644 index 0000000..a0d7118 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/places/network-server.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/places/network-workgroup.png b/CoffeBeans/icons/tango/22x22/tango/places/network-workgroup.png new file mode 100644 index 0000000..f96c9db Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/places/network-workgroup.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/places/start-here.png b/CoffeBeans/icons/tango/22x22/tango/places/start-here.png new file mode 100644 index 0000000..fc9b049 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/places/start-here.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/places/user-desktop.png b/CoffeBeans/icons/tango/22x22/tango/places/user-desktop.png new file mode 100644 index 0000000..d60b2f1 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/places/user-desktop.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/places/user-home.png b/CoffeBeans/icons/tango/22x22/tango/places/user-home.png new file mode 100644 index 0000000..c7eac99 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/places/user-home.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/places/user-trash.png b/CoffeBeans/icons/tango/22x22/tango/places/user-trash.png new file mode 100644 index 0000000..05ff036 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/places/user-trash.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/audio-volume-high.png b/CoffeBeans/icons/tango/22x22/tango/status/audio-volume-high.png new file mode 100644 index 0000000..1b2f30e Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/audio-volume-high.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/audio-volume-low.png b/CoffeBeans/icons/tango/22x22/tango/status/audio-volume-low.png new file mode 100644 index 0000000..46bcd19 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/audio-volume-low.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/audio-volume-medium.png b/CoffeBeans/icons/tango/22x22/tango/status/audio-volume-medium.png new file mode 100644 index 0000000..31883ef Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/audio-volume-medium.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/audio-volume-muted.png b/CoffeBeans/icons/tango/22x22/tango/status/audio-volume-muted.png new file mode 100644 index 0000000..3e74c1d Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/audio-volume-muted.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/battery-caution.png b/CoffeBeans/icons/tango/22x22/tango/status/battery-caution.png new file mode 100644 index 0000000..456f7a4 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/battery-caution.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/dialog-error.png b/CoffeBeans/icons/tango/22x22/tango/status/dialog-error.png new file mode 100644 index 0000000..7d6aaf6 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/dialog-error.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/dialog-information.png b/CoffeBeans/icons/tango/22x22/tango/status/dialog-information.png new file mode 100644 index 0000000..07cf010 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/dialog-information.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/dialog-warning.png b/CoffeBeans/icons/tango/22x22/tango/status/dialog-warning.png new file mode 100644 index 0000000..45b64a7 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/dialog-warning.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/folder-drag-accept.png b/CoffeBeans/icons/tango/22x22/tango/status/folder-drag-accept.png new file mode 100644 index 0000000..16a2b84 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/folder-drag-accept.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/folder-open.png b/CoffeBeans/icons/tango/22x22/tango/status/folder-open.png new file mode 100644 index 0000000..f81f70c Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/folder-open.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/folder-visiting.png b/CoffeBeans/icons/tango/22x22/tango/status/folder-visiting.png new file mode 100644 index 0000000..b4af525 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/folder-visiting.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/image-loading.png b/CoffeBeans/icons/tango/22x22/tango/status/image-loading.png new file mode 100644 index 0000000..a4be885 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/image-loading.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/image-missing.png b/CoffeBeans/icons/tango/22x22/tango/status/image-missing.png new file mode 100644 index 0000000..e12439a Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/image-missing.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/mail-attachment.png b/CoffeBeans/icons/tango/22x22/tango/status/mail-attachment.png new file mode 100644 index 0000000..c5d9633 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/mail-attachment.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/network-error.png b/CoffeBeans/icons/tango/22x22/tango/status/network-error.png new file mode 100644 index 0000000..d36ce29 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/network-error.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/network-idle.png b/CoffeBeans/icons/tango/22x22/tango/status/network-idle.png new file mode 100644 index 0000000..caebd98 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/network-idle.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/network-offline.png b/CoffeBeans/icons/tango/22x22/tango/status/network-offline.png new file mode 100644 index 0000000..72dd12c Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/network-offline.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/network-receive.png b/CoffeBeans/icons/tango/22x22/tango/status/network-receive.png new file mode 100644 index 0000000..11dfa07 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/network-receive.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/network-transmit-receive.png b/CoffeBeans/icons/tango/22x22/tango/status/network-transmit-receive.png new file mode 100644 index 0000000..54d145f Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/network-transmit-receive.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/network-transmit.png b/CoffeBeans/icons/tango/22x22/tango/status/network-transmit.png new file mode 100644 index 0000000..97b6301 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/network-transmit.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/network-wireless-encrypted.png b/CoffeBeans/icons/tango/22x22/tango/status/network-wireless-encrypted.png new file mode 100644 index 0000000..712771c Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/network-wireless-encrypted.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/printer-error.png b/CoffeBeans/icons/tango/22x22/tango/status/printer-error.png new file mode 100644 index 0000000..63863c2 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/printer-error.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/software-update-available.png b/CoffeBeans/icons/tango/22x22/tango/status/software-update-available.png new file mode 100644 index 0000000..c1d1348 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/software-update-available.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/software-update-urgent.png b/CoffeBeans/icons/tango/22x22/tango/status/software-update-urgent.png new file mode 100644 index 0000000..0ce38d9 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/software-update-urgent.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/user-trash-full.png b/CoffeBeans/icons/tango/22x22/tango/status/user-trash-full.png new file mode 100644 index 0000000..ffd7cc2 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/user-trash-full.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/weather-clear-night.png b/CoffeBeans/icons/tango/22x22/tango/status/weather-clear-night.png new file mode 100644 index 0000000..52ea3e9 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/weather-clear-night.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/weather-clear.png b/CoffeBeans/icons/tango/22x22/tango/status/weather-clear.png new file mode 100644 index 0000000..e17ca7c Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/weather-clear.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/weather-few-clouds-night.png b/CoffeBeans/icons/tango/22x22/tango/status/weather-few-clouds-night.png new file mode 100644 index 0000000..69fe49a Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/weather-few-clouds-night.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/weather-few-clouds.png b/CoffeBeans/icons/tango/22x22/tango/status/weather-few-clouds.png new file mode 100644 index 0000000..28b1147 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/weather-few-clouds.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/weather-overcast.png b/CoffeBeans/icons/tango/22x22/tango/status/weather-overcast.png new file mode 100644 index 0000000..79d7bc2 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/weather-overcast.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/weather-severe-alert.png b/CoffeBeans/icons/tango/22x22/tango/status/weather-severe-alert.png new file mode 100644 index 0000000..e4d09b6 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/weather-severe-alert.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/weather-showers-scattered.png b/CoffeBeans/icons/tango/22x22/tango/status/weather-showers-scattered.png new file mode 100644 index 0000000..9eddd93 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/weather-showers-scattered.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/weather-showers.png b/CoffeBeans/icons/tango/22x22/tango/status/weather-showers.png new file mode 100644 index 0000000..4450fb1 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/weather-showers.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/weather-snow.png b/CoffeBeans/icons/tango/22x22/tango/status/weather-snow.png new file mode 100644 index 0000000..5457799 Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/weather-snow.png differ diff --git a/CoffeBeans/icons/tango/22x22/tango/status/weather-storm.png b/CoffeBeans/icons/tango/22x22/tango/status/weather-storm.png new file mode 100644 index 0000000..3b7ca9c Binary files /dev/null and b/CoffeBeans/icons/tango/22x22/tango/status/weather-storm.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/address-book-new.png b/CoffeBeans/icons/tango/32x32/tango/actions/address-book-new.png new file mode 100644 index 0000000..420139d Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/address-book-new.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/appointment-new.png b/CoffeBeans/icons/tango/32x32/tango/actions/appointment-new.png new file mode 100644 index 0000000..85daef3 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/appointment-new.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/bookmark-new.png b/CoffeBeans/icons/tango/32x32/tango/actions/bookmark-new.png new file mode 100644 index 0000000..621312a Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/bookmark-new.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/contact-new.png b/CoffeBeans/icons/tango/32x32/tango/actions/contact-new.png new file mode 100644 index 0000000..8b10c1e Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/contact-new.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/document-new.png b/CoffeBeans/icons/tango/32x32/tango/actions/document-new.png new file mode 100644 index 0000000..e6d64bb Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/document-new.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/document-open.png b/CoffeBeans/icons/tango/32x32/tango/actions/document-open.png new file mode 100644 index 0000000..f35f258 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/document-open.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/document-print-preview.png b/CoffeBeans/icons/tango/32x32/tango/actions/document-print-preview.png new file mode 100644 index 0000000..772efe5 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/document-print-preview.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/document-print.png b/CoffeBeans/icons/tango/32x32/tango/actions/document-print.png new file mode 100644 index 0000000..3ef3930 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/document-print.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/document-properties.png b/CoffeBeans/icons/tango/32x32/tango/actions/document-properties.png new file mode 100644 index 0000000..fa697db Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/document-properties.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/document-revert.png b/CoffeBeans/icons/tango/32x32/tango/actions/document-revert.png new file mode 100644 index 0000000..3540188 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/document-revert.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/document-save-as.png b/CoffeBeans/icons/tango/32x32/tango/actions/document-save-as.png new file mode 100644 index 0000000..5c9f6b3 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/document-save-as.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/document-save.png b/CoffeBeans/icons/tango/32x32/tango/actions/document-save.png new file mode 100644 index 0000000..db5c52b Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/document-save.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/edit-clear.png b/CoffeBeans/icons/tango/32x32/tango/actions/edit-clear.png new file mode 100644 index 0000000..5542948 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/edit-clear.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/edit-copy.png b/CoffeBeans/icons/tango/32x32/tango/actions/edit-copy.png new file mode 100644 index 0000000..3348ee0 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/edit-copy.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/edit-cut.png b/CoffeBeans/icons/tango/32x32/tango/actions/edit-cut.png new file mode 100644 index 0000000..217663b Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/edit-cut.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/edit-delete.png b/CoffeBeans/icons/tango/32x32/tango/actions/edit-delete.png new file mode 100644 index 0000000..9becb3e Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/edit-delete.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/edit-find-replace.png b/CoffeBeans/icons/tango/32x32/tango/actions/edit-find-replace.png new file mode 100644 index 0000000..0f1b117 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/edit-find-replace.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/edit-find.png b/CoffeBeans/icons/tango/32x32/tango/actions/edit-find.png new file mode 100644 index 0000000..5594785 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/edit-find.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/edit-paste.png b/CoffeBeans/icons/tango/32x32/tango/actions/edit-paste.png new file mode 100644 index 0000000..dd429ce Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/edit-paste.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/edit-redo.png b/CoffeBeans/icons/tango/32x32/tango/actions/edit-redo.png new file mode 100644 index 0000000..3eb7b05 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/edit-redo.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/edit-select-all.png b/CoffeBeans/icons/tango/32x32/tango/actions/edit-select-all.png new file mode 100644 index 0000000..107fc60 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/edit-select-all.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/edit-undo.png b/CoffeBeans/icons/tango/32x32/tango/actions/edit-undo.png new file mode 100644 index 0000000..61b2ce9 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/edit-undo.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/folder-new.png b/CoffeBeans/icons/tango/32x32/tango/actions/folder-new.png new file mode 100644 index 0000000..fcd15c0 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/folder-new.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/format-indent-less.png b/CoffeBeans/icons/tango/32x32/tango/actions/format-indent-less.png new file mode 100644 index 0000000..7ced16f Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/format-indent-less.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/format-indent-more.png b/CoffeBeans/icons/tango/32x32/tango/actions/format-indent-more.png new file mode 100644 index 0000000..6a18867 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/format-indent-more.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/format-justify-center.png b/CoffeBeans/icons/tango/32x32/tango/actions/format-justify-center.png new file mode 100644 index 0000000..a0db2bb Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/format-justify-center.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/format-justify-fill.png b/CoffeBeans/icons/tango/32x32/tango/actions/format-justify-fill.png new file mode 100644 index 0000000..2a34a8f Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/format-justify-fill.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/format-justify-left.png b/CoffeBeans/icons/tango/32x32/tango/actions/format-justify-left.png new file mode 100644 index 0000000..ba0e914 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/format-justify-left.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/format-justify-right.png b/CoffeBeans/icons/tango/32x32/tango/actions/format-justify-right.png new file mode 100644 index 0000000..2144cb9 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/format-justify-right.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/format-text-bold.png b/CoffeBeans/icons/tango/32x32/tango/actions/format-text-bold.png new file mode 100644 index 0000000..99ed19c Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/format-text-bold.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/format-text-italic.png b/CoffeBeans/icons/tango/32x32/tango/actions/format-text-italic.png new file mode 100644 index 0000000..87ed6f9 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/format-text-italic.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/format-text-strikethrough.png b/CoffeBeans/icons/tango/32x32/tango/actions/format-text-strikethrough.png new file mode 100644 index 0000000..b9b55ab Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/format-text-strikethrough.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/format-text-underline.png b/CoffeBeans/icons/tango/32x32/tango/actions/format-text-underline.png new file mode 100644 index 0000000..0de6b1c Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/format-text-underline.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/go-bottom.png b/CoffeBeans/icons/tango/32x32/tango/actions/go-bottom.png new file mode 100644 index 0000000..bf973fe Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/go-bottom.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/go-down.png b/CoffeBeans/icons/tango/32x32/tango/actions/go-down.png new file mode 100644 index 0000000..dce3f15 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/go-down.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/go-first.png b/CoffeBeans/icons/tango/32x32/tango/actions/go-first.png new file mode 100644 index 0000000..5e2a6b1 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/go-first.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/go-home.png b/CoffeBeans/icons/tango/32x32/tango/actions/go-home.png new file mode 100644 index 0000000..a3ca103 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/go-home.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/go-jump.png b/CoffeBeans/icons/tango/32x32/tango/actions/go-jump.png new file mode 100644 index 0000000..34dc4c0 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/go-jump.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/go-last.png b/CoffeBeans/icons/tango/32x32/tango/actions/go-last.png new file mode 100644 index 0000000..48fe95b Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/go-last.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/go-next.png b/CoffeBeans/icons/tango/32x32/tango/actions/go-next.png new file mode 100644 index 0000000..a68e2db Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/go-next.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/go-previous.png b/CoffeBeans/icons/tango/32x32/tango/actions/go-previous.png new file mode 100644 index 0000000..c37bc04 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/go-previous.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/go-top.png b/CoffeBeans/icons/tango/32x32/tango/actions/go-top.png new file mode 100644 index 0000000..d99552b Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/go-top.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/go-up.png b/CoffeBeans/icons/tango/32x32/tango/actions/go-up.png new file mode 100644 index 0000000..afb307b Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/go-up.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/list-add.png b/CoffeBeans/icons/tango/32x32/tango/actions/list-add.png new file mode 100644 index 0000000..2acdd8f Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/list-add.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/list-remove.png b/CoffeBeans/icons/tango/32x32/tango/actions/list-remove.png new file mode 100644 index 0000000..c5524f7 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/list-remove.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/mail-forward.png b/CoffeBeans/icons/tango/32x32/tango/actions/mail-forward.png new file mode 100644 index 0000000..bea94ab Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/mail-forward.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/mail-mark-junk.png b/CoffeBeans/icons/tango/32x32/tango/actions/mail-mark-junk.png new file mode 100644 index 0000000..0af3006 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/mail-mark-junk.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/mail-mark-not-junk.png b/CoffeBeans/icons/tango/32x32/tango/actions/mail-mark-not-junk.png new file mode 100644 index 0000000..296e92a Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/mail-mark-not-junk.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/mail-message-new.png b/CoffeBeans/icons/tango/32x32/tango/actions/mail-message-new.png new file mode 100644 index 0000000..9f51246 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/mail-message-new.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/mail-reply-all.png b/CoffeBeans/icons/tango/32x32/tango/actions/mail-reply-all.png new file mode 100644 index 0000000..0216e39 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/mail-reply-all.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/mail-reply-sender.png b/CoffeBeans/icons/tango/32x32/tango/actions/mail-reply-sender.png new file mode 100644 index 0000000..3f248dc Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/mail-reply-sender.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/mail-send-receive.png b/CoffeBeans/icons/tango/32x32/tango/actions/mail-send-receive.png new file mode 100644 index 0000000..99349b9 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/mail-send-receive.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/media-eject.png b/CoffeBeans/icons/tango/32x32/tango/actions/media-eject.png new file mode 100644 index 0000000..b218e7a Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/media-eject.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/media-playback-pause.png b/CoffeBeans/icons/tango/32x32/tango/actions/media-playback-pause.png new file mode 100644 index 0000000..1e9f4d5 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/media-playback-pause.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/media-playback-start.png b/CoffeBeans/icons/tango/32x32/tango/actions/media-playback-start.png new file mode 100644 index 0000000..66f32d8 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/media-playback-start.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/media-playback-stop.png b/CoffeBeans/icons/tango/32x32/tango/actions/media-playback-stop.png new file mode 100644 index 0000000..a094787 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/media-playback-stop.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/media-record.png b/CoffeBeans/icons/tango/32x32/tango/actions/media-record.png new file mode 100644 index 0000000..43f034b Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/media-record.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/media-seek-backward.png b/CoffeBeans/icons/tango/32x32/tango/actions/media-seek-backward.png new file mode 100644 index 0000000..535c536 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/media-seek-backward.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/media-seek-forward.png b/CoffeBeans/icons/tango/32x32/tango/actions/media-seek-forward.png new file mode 100644 index 0000000..96ebe01 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/media-seek-forward.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/media-skip-backward.png b/CoffeBeans/icons/tango/32x32/tango/actions/media-skip-backward.png new file mode 100644 index 0000000..aa08251 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/media-skip-backward.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/media-skip-forward.png b/CoffeBeans/icons/tango/32x32/tango/actions/media-skip-forward.png new file mode 100644 index 0000000..52be942 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/media-skip-forward.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/process-stop.png b/CoffeBeans/icons/tango/32x32/tango/actions/process-stop.png new file mode 100644 index 0000000..e7a8d17 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/process-stop.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/system-lock-screen.png b/CoffeBeans/icons/tango/32x32/tango/actions/system-lock-screen.png new file mode 100644 index 0000000..2c220fc Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/system-lock-screen.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/system-log-out.png b/CoffeBeans/icons/tango/32x32/tango/actions/system-log-out.png new file mode 100644 index 0000000..fddbc2b Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/system-log-out.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/system-search.png b/CoffeBeans/icons/tango/32x32/tango/actions/system-search.png new file mode 100644 index 0000000..950d792 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/system-search.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/system-shutdown.png b/CoffeBeans/icons/tango/32x32/tango/actions/system-shutdown.png new file mode 100644 index 0000000..36acd46 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/system-shutdown.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/tab-new.png b/CoffeBeans/icons/tango/32x32/tango/actions/tab-new.png new file mode 100644 index 0000000..294d150 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/tab-new.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/view-fullscreen.png b/CoffeBeans/icons/tango/32x32/tango/actions/view-fullscreen.png new file mode 100644 index 0000000..00e6b83 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/view-fullscreen.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/view-refresh.png b/CoffeBeans/icons/tango/32x32/tango/actions/view-refresh.png new file mode 100644 index 0000000..606ea9e Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/view-refresh.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/actions/window-new.png b/CoffeBeans/icons/tango/32x32/tango/actions/window-new.png new file mode 100644 index 0000000..e091702 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/actions/window-new.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/animations/process-working.png b/CoffeBeans/icons/tango/32x32/tango/animations/process-working.png new file mode 100644 index 0000000..f19c528 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/animations/process-working.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/accessories-calculator.png b/CoffeBeans/icons/tango/32x32/tango/apps/accessories-calculator.png new file mode 100644 index 0000000..7de1c44 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/accessories-calculator.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/accessories-character-map.png b/CoffeBeans/icons/tango/32x32/tango/apps/accessories-character-map.png new file mode 100644 index 0000000..a86c23e Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/accessories-character-map.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/accessories-text-editor.png b/CoffeBeans/icons/tango/32x32/tango/apps/accessories-text-editor.png new file mode 100644 index 0000000..c6b6285 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/accessories-text-editor.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/help-browser.png b/CoffeBeans/icons/tango/32x32/tango/apps/help-browser.png new file mode 100644 index 0000000..d60425f Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/help-browser.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/internet-group-chat.png b/CoffeBeans/icons/tango/32x32/tango/apps/internet-group-chat.png new file mode 100644 index 0000000..9cb1d3b Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/internet-group-chat.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/internet-mail.png b/CoffeBeans/icons/tango/32x32/tango/apps/internet-mail.png new file mode 100644 index 0000000..dc3b9dd Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/internet-mail.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/internet-news-reader.png b/CoffeBeans/icons/tango/32x32/tango/apps/internet-news-reader.png new file mode 100644 index 0000000..ebc528f Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/internet-news-reader.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/internet-web-browser.png b/CoffeBeans/icons/tango/32x32/tango/apps/internet-web-browser.png new file mode 100644 index 0000000..10d2ed4 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/internet-web-browser.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/office-calendar.png b/CoffeBeans/icons/tango/32x32/tango/apps/office-calendar.png new file mode 100644 index 0000000..7817c12 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/office-calendar.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-accessibility.png b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-accessibility.png new file mode 100644 index 0000000..adfe247 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-accessibility.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-assistive-technology.png b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-assistive-technology.png new file mode 100644 index 0000000..70adb92 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-assistive-technology.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-font.png b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-font.png new file mode 100644 index 0000000..b4ec434 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-font.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-keyboard-shortcuts.png b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-keyboard-shortcuts.png new file mode 100644 index 0000000..178dd29 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-keyboard-shortcuts.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-locale.png b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-locale.png new file mode 100644 index 0000000..66224ae Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-locale.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-multimedia.png b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-multimedia.png new file mode 100644 index 0000000..56a5662 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-multimedia.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-remote-desktop.png b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-remote-desktop.png new file mode 100644 index 0000000..6da67c6 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-remote-desktop.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-screensaver.png b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-screensaver.png new file mode 100644 index 0000000..dba2455 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-screensaver.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-theme.png b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-theme.png new file mode 100644 index 0000000..7af777d Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-theme.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-wallpaper.png b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-wallpaper.png new file mode 100644 index 0000000..4eb744c Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-desktop-wallpaper.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/preferences-system-network-proxy.png b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-system-network-proxy.png new file mode 100644 index 0000000..e75f6f7 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-system-network-proxy.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/preferences-system-session.png b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-system-session.png new file mode 100644 index 0000000..f8c2d11 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-system-session.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/preferences-system-windows.png b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-system-windows.png new file mode 100644 index 0000000..517e48a Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/preferences-system-windows.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/system-file-manager.png b/CoffeBeans/icons/tango/32x32/tango/apps/system-file-manager.png new file mode 100644 index 0000000..1d6ce31 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/system-file-manager.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/system-installer.png b/CoffeBeans/icons/tango/32x32/tango/apps/system-installer.png new file mode 100644 index 0000000..c26576e Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/system-installer.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/system-software-update.png b/CoffeBeans/icons/tango/32x32/tango/apps/system-software-update.png new file mode 100644 index 0000000..470b5d4 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/system-software-update.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/system-users.png b/CoffeBeans/icons/tango/32x32/tango/apps/system-users.png new file mode 100644 index 0000000..749c825 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/system-users.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/utilities-system-monitor.png b/CoffeBeans/icons/tango/32x32/tango/apps/utilities-system-monitor.png new file mode 100644 index 0000000..b62959e Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/utilities-system-monitor.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/apps/utilities-terminal.png b/CoffeBeans/icons/tango/32x32/tango/apps/utilities-terminal.png new file mode 100644 index 0000000..f86c784 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/apps/utilities-terminal.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/categories/applications-accessories.png b/CoffeBeans/icons/tango/32x32/tango/categories/applications-accessories.png new file mode 100644 index 0000000..fd43de3 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/categories/applications-accessories.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/categories/applications-development.png b/CoffeBeans/icons/tango/32x32/tango/categories/applications-development.png new file mode 100644 index 0000000..bc88a5c Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/categories/applications-development.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/categories/applications-games.png b/CoffeBeans/icons/tango/32x32/tango/categories/applications-games.png new file mode 100644 index 0000000..ff4044c Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/categories/applications-games.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/categories/applications-graphics.png b/CoffeBeans/icons/tango/32x32/tango/categories/applications-graphics.png new file mode 100644 index 0000000..36b77c2 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/categories/applications-graphics.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/categories/applications-internet.png b/CoffeBeans/icons/tango/32x32/tango/categories/applications-internet.png new file mode 100644 index 0000000..096e848 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/categories/applications-internet.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/categories/applications-multimedia.png b/CoffeBeans/icons/tango/32x32/tango/categories/applications-multimedia.png new file mode 100644 index 0000000..d09995a Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/categories/applications-multimedia.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/categories/applications-office.png b/CoffeBeans/icons/tango/32x32/tango/categories/applications-office.png new file mode 100644 index 0000000..efb850e Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/categories/applications-office.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/categories/applications-other.png b/CoffeBeans/icons/tango/32x32/tango/categories/applications-other.png new file mode 100644 index 0000000..1990dbb Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/categories/applications-other.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/categories/applications-system.png b/CoffeBeans/icons/tango/32x32/tango/categories/applications-system.png new file mode 100644 index 0000000..565f406 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/categories/applications-system.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/categories/preferences-desktop-peripherals.png b/CoffeBeans/icons/tango/32x32/tango/categories/preferences-desktop-peripherals.png new file mode 100644 index 0000000..4682b36 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/categories/preferences-desktop-peripherals.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/categories/preferences-desktop.png b/CoffeBeans/icons/tango/32x32/tango/categories/preferences-desktop.png new file mode 100644 index 0000000..3ec71a3 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/categories/preferences-desktop.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/categories/preferences-system.png b/CoffeBeans/icons/tango/32x32/tango/categories/preferences-system.png new file mode 100644 index 0000000..6e52db7 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/categories/preferences-system.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/devices/audio-card.png b/CoffeBeans/icons/tango/32x32/tango/devices/audio-card.png new file mode 100644 index 0000000..5b15dd6 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/devices/audio-card.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/devices/audio-input-microphone.png b/CoffeBeans/icons/tango/32x32/tango/devices/audio-input-microphone.png new file mode 100644 index 0000000..9fe3b96 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/devices/audio-input-microphone.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/devices/battery.png b/CoffeBeans/icons/tango/32x32/tango/devices/battery.png new file mode 100644 index 0000000..ef08925 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/devices/battery.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/devices/camera-photo.png b/CoffeBeans/icons/tango/32x32/tango/devices/camera-photo.png new file mode 100644 index 0000000..ffbffc7 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/devices/camera-photo.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/devices/camera-video.png b/CoffeBeans/icons/tango/32x32/tango/devices/camera-video.png new file mode 100644 index 0000000..7473dd7 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/devices/camera-video.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/devices/computer.png b/CoffeBeans/icons/tango/32x32/tango/devices/computer.png new file mode 100644 index 0000000..e34eb4e Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/devices/computer.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/devices/drive-harddisk.png b/CoffeBeans/icons/tango/32x32/tango/devices/drive-harddisk.png new file mode 100644 index 0000000..b34d8b7 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/devices/drive-harddisk.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/devices/drive-optical.png b/CoffeBeans/icons/tango/32x32/tango/devices/drive-optical.png new file mode 100644 index 0000000..bf2e8c8 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/devices/drive-optical.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/devices/drive-removable-media.png b/CoffeBeans/icons/tango/32x32/tango/devices/drive-removable-media.png new file mode 100644 index 0000000..2d28909 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/devices/drive-removable-media.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/devices/input-gaming.png b/CoffeBeans/icons/tango/32x32/tango/devices/input-gaming.png new file mode 100644 index 0000000..26e2a98 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/devices/input-gaming.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/devices/input-keyboard.png b/CoffeBeans/icons/tango/32x32/tango/devices/input-keyboard.png new file mode 100644 index 0000000..788c717 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/devices/input-keyboard.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/devices/input-mouse.png b/CoffeBeans/icons/tango/32x32/tango/devices/input-mouse.png new file mode 100644 index 0000000..49a923c Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/devices/input-mouse.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/devices/media-flash.png b/CoffeBeans/icons/tango/32x32/tango/devices/media-flash.png new file mode 100644 index 0000000..7540f3f Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/devices/media-flash.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/devices/media-floppy.png b/CoffeBeans/icons/tango/32x32/tango/devices/media-floppy.png new file mode 100644 index 0000000..17b1274 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/devices/media-floppy.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/devices/media-optical.png b/CoffeBeans/icons/tango/32x32/tango/devices/media-optical.png new file mode 100644 index 0000000..5853a75 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/devices/media-optical.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/devices/multimedia-player.png b/CoffeBeans/icons/tango/32x32/tango/devices/multimedia-player.png new file mode 100644 index 0000000..8d59208 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/devices/multimedia-player.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/devices/network-wired.png b/CoffeBeans/icons/tango/32x32/tango/devices/network-wired.png new file mode 100644 index 0000000..c3ca691 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/devices/network-wired.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/devices/network-wireless.png b/CoffeBeans/icons/tango/32x32/tango/devices/network-wireless.png new file mode 100644 index 0000000..aa5f9f2 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/devices/network-wireless.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/devices/printer.png b/CoffeBeans/icons/tango/32x32/tango/devices/printer.png new file mode 100644 index 0000000..05b49e0 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/devices/printer.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/devices/video-display.png b/CoffeBeans/icons/tango/32x32/tango/devices/video-display.png new file mode 100644 index 0000000..b95ea5d Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/devices/video-display.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/emblems/emblem-favorite.png b/CoffeBeans/icons/tango/32x32/tango/emblems/emblem-favorite.png new file mode 100644 index 0000000..8a9ad39 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/emblems/emblem-favorite.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/emblems/emblem-important.png b/CoffeBeans/icons/tango/32x32/tango/emblems/emblem-important.png new file mode 100644 index 0000000..263fbd5 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/emblems/emblem-important.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/emblems/emblem-photos.png b/CoffeBeans/icons/tango/32x32/tango/emblems/emblem-photos.png new file mode 100644 index 0000000..f7dfd88 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/emblems/emblem-photos.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/emblems/emblem-readonly.png b/CoffeBeans/icons/tango/32x32/tango/emblems/emblem-readonly.png new file mode 100644 index 0000000..5e972d1 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/emblems/emblem-readonly.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/emblems/emblem-symbolic-link.png b/CoffeBeans/icons/tango/32x32/tango/emblems/emblem-symbolic-link.png new file mode 100644 index 0000000..56ef039 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/emblems/emblem-symbolic-link.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/emblems/emblem-system.png b/CoffeBeans/icons/tango/32x32/tango/emblems/emblem-system.png new file mode 100644 index 0000000..abac7e9 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/emblems/emblem-system.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/emblems/emblem-unreadable.png b/CoffeBeans/icons/tango/32x32/tango/emblems/emblem-unreadable.png new file mode 100644 index 0000000..b94fc97 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/emblems/emblem-unreadable.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/emotes/face-angel.png b/CoffeBeans/icons/tango/32x32/tango/emotes/face-angel.png new file mode 100644 index 0000000..abd0285 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/emotes/face-angel.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/emotes/face-crying.png b/CoffeBeans/icons/tango/32x32/tango/emotes/face-crying.png new file mode 100644 index 0000000..d8bc41e Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/emotes/face-crying.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/emotes/face-devilish.png b/CoffeBeans/icons/tango/32x32/tango/emotes/face-devilish.png new file mode 100644 index 0000000..7a3cb08 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/emotes/face-devilish.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/emotes/face-glasses.png b/CoffeBeans/icons/tango/32x32/tango/emotes/face-glasses.png new file mode 100644 index 0000000..1b25394 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/emotes/face-glasses.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/emotes/face-grin.png b/CoffeBeans/icons/tango/32x32/tango/emotes/face-grin.png new file mode 100644 index 0000000..2e8268f Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/emotes/face-grin.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/emotes/face-kiss.png b/CoffeBeans/icons/tango/32x32/tango/emotes/face-kiss.png new file mode 100644 index 0000000..1e3fa54 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/emotes/face-kiss.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/emotes/face-monkey.png b/CoffeBeans/icons/tango/32x32/tango/emotes/face-monkey.png new file mode 100644 index 0000000..fb0204a Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/emotes/face-monkey.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/emotes/face-plain.png b/CoffeBeans/icons/tango/32x32/tango/emotes/face-plain.png new file mode 100644 index 0000000..f8128a6 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/emotes/face-plain.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/emotes/face-sad.png b/CoffeBeans/icons/tango/32x32/tango/emotes/face-sad.png new file mode 100644 index 0000000..2fbecde Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/emotes/face-sad.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/emotes/face-smile-big.png b/CoffeBeans/icons/tango/32x32/tango/emotes/face-smile-big.png new file mode 100644 index 0000000..28704ae Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/emotes/face-smile-big.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/emotes/face-smile.png b/CoffeBeans/icons/tango/32x32/tango/emotes/face-smile.png new file mode 100644 index 0000000..a52e44d Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/emotes/face-smile.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/emotes/face-surprise.png b/CoffeBeans/icons/tango/32x32/tango/emotes/face-surprise.png new file mode 100644 index 0000000..af7cef4 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/emotes/face-surprise.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/emotes/face-wink.png b/CoffeBeans/icons/tango/32x32/tango/emotes/face-wink.png new file mode 100644 index 0000000..494d785 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/emotes/face-wink.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/mimetypes/application-certificate.png b/CoffeBeans/icons/tango/32x32/tango/mimetypes/application-certificate.png new file mode 100644 index 0000000..b75ba54 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/mimetypes/application-certificate.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/mimetypes/application-x-executable.png b/CoffeBeans/icons/tango/32x32/tango/mimetypes/application-x-executable.png new file mode 100644 index 0000000..8a150b8 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/mimetypes/application-x-executable.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/mimetypes/audio-x-generic.png b/CoffeBeans/icons/tango/32x32/tango/mimetypes/audio-x-generic.png new file mode 100644 index 0000000..c60b595 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/mimetypes/audio-x-generic.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/mimetypes/font-x-generic.png b/CoffeBeans/icons/tango/32x32/tango/mimetypes/font-x-generic.png new file mode 100644 index 0000000..b166f4b Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/mimetypes/font-x-generic.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/mimetypes/image-x-generic.png b/CoffeBeans/icons/tango/32x32/tango/mimetypes/image-x-generic.png new file mode 100644 index 0000000..6f118cd Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/mimetypes/image-x-generic.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/mimetypes/package-x-generic.png b/CoffeBeans/icons/tango/32x32/tango/mimetypes/package-x-generic.png new file mode 100644 index 0000000..4b55b50 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/mimetypes/package-x-generic.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/mimetypes/text-html.png b/CoffeBeans/icons/tango/32x32/tango/mimetypes/text-html.png new file mode 100644 index 0000000..a896697 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/mimetypes/text-html.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/mimetypes/text-x-generic-template.png b/CoffeBeans/icons/tango/32x32/tango/mimetypes/text-x-generic-template.png new file mode 100644 index 0000000..5b7e649 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/mimetypes/text-x-generic-template.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/mimetypes/text-x-generic.png b/CoffeBeans/icons/tango/32x32/tango/mimetypes/text-x-generic.png new file mode 100644 index 0000000..928a679 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/mimetypes/text-x-generic.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/mimetypes/text-x-script.png b/CoffeBeans/icons/tango/32x32/tango/mimetypes/text-x-script.png new file mode 100644 index 0000000..801dcd6 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/mimetypes/text-x-script.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/mimetypes/video-x-generic.png b/CoffeBeans/icons/tango/32x32/tango/mimetypes/video-x-generic.png new file mode 100644 index 0000000..5d6c8d1 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/mimetypes/video-x-generic.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-address-book.png b/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-address-book.png new file mode 100644 index 0000000..53dde74 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-address-book.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-calendar.png b/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-calendar.png new file mode 100644 index 0000000..bc6db5b Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-calendar.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-document-template.png b/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-document-template.png new file mode 100644 index 0000000..9619241 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-document-template.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-document.png b/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-document.png new file mode 100644 index 0000000..daf84b2 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-document.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-drawing-template.png b/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-drawing-template.png new file mode 100644 index 0000000..6fc043c Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-drawing-template.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-drawing.png b/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-drawing.png new file mode 100644 index 0000000..5cd66c1 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-drawing.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-presentation-template.png b/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-presentation-template.png new file mode 100644 index 0000000..bc348f1 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-presentation-template.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-presentation.png b/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-presentation.png new file mode 100644 index 0000000..047355c Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-presentation.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-spreadsheet-template.png b/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-spreadsheet-template.png new file mode 100644 index 0000000..6a81f36 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-spreadsheet-template.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-spreadsheet.png b/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-spreadsheet.png new file mode 100644 index 0000000..c0ccb7a Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/mimetypes/x-office-spreadsheet.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/places/folder-remote.png b/CoffeBeans/icons/tango/32x32/tango/places/folder-remote.png new file mode 100644 index 0000000..3e0d9ad Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/places/folder-remote.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/places/folder-saved-search.png b/CoffeBeans/icons/tango/32x32/tango/places/folder-saved-search.png new file mode 100644 index 0000000..88d4541 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/places/folder-saved-search.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/places/folder.png b/CoffeBeans/icons/tango/32x32/tango/places/folder.png new file mode 100644 index 0000000..472484f Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/places/folder.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/places/network-server.png b/CoffeBeans/icons/tango/32x32/tango/places/network-server.png new file mode 100644 index 0000000..1d38e4f Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/places/network-server.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/places/network-workgroup.png b/CoffeBeans/icons/tango/32x32/tango/places/network-workgroup.png new file mode 100644 index 0000000..4137b3c Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/places/network-workgroup.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/places/start-here.png b/CoffeBeans/icons/tango/32x32/tango/places/start-here.png new file mode 100644 index 0000000..1e54d01 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/places/start-here.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/places/user-desktop.png b/CoffeBeans/icons/tango/32x32/tango/places/user-desktop.png new file mode 100644 index 0000000..57fb177 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/places/user-desktop.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/places/user-home.png b/CoffeBeans/icons/tango/32x32/tango/places/user-home.png new file mode 100644 index 0000000..a29bd69 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/places/user-home.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/places/user-trash.png b/CoffeBeans/icons/tango/32x32/tango/places/user-trash.png new file mode 100644 index 0000000..9b7a462 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/places/user-trash.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/audio-volume-high.png b/CoffeBeans/icons/tango/32x32/tango/status/audio-volume-high.png new file mode 100644 index 0000000..70ae43a Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/audio-volume-high.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/audio-volume-low.png b/CoffeBeans/icons/tango/32x32/tango/status/audio-volume-low.png new file mode 100644 index 0000000..34546f9 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/audio-volume-low.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/audio-volume-medium.png b/CoffeBeans/icons/tango/32x32/tango/status/audio-volume-medium.png new file mode 100644 index 0000000..4d48a9a Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/audio-volume-medium.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/audio-volume-muted.png b/CoffeBeans/icons/tango/32x32/tango/status/audio-volume-muted.png new file mode 100644 index 0000000..a602c85 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/audio-volume-muted.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/battery-caution.png b/CoffeBeans/icons/tango/32x32/tango/status/battery-caution.png new file mode 100644 index 0000000..ede9788 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/battery-caution.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/dialog-error.png b/CoffeBeans/icons/tango/32x32/tango/status/dialog-error.png new file mode 100644 index 0000000..cdd95ba Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/dialog-error.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/dialog-information.png b/CoffeBeans/icons/tango/32x32/tango/status/dialog-information.png new file mode 100644 index 0000000..2ac5747 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/dialog-information.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/dialog-warning.png b/CoffeBeans/icons/tango/32x32/tango/status/dialog-warning.png new file mode 100644 index 0000000..7233d45 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/dialog-warning.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/folder-drag-accept.png b/CoffeBeans/icons/tango/32x32/tango/status/folder-drag-accept.png new file mode 100644 index 0000000..2feba85 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/folder-drag-accept.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/folder-open.png b/CoffeBeans/icons/tango/32x32/tango/status/folder-open.png new file mode 100644 index 0000000..901816c Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/folder-open.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/folder-visiting.png b/CoffeBeans/icons/tango/32x32/tango/status/folder-visiting.png new file mode 100644 index 0000000..be02b6a Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/folder-visiting.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/image-loading.png b/CoffeBeans/icons/tango/32x32/tango/status/image-loading.png new file mode 100644 index 0000000..9442085 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/image-loading.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/image-missing.png b/CoffeBeans/icons/tango/32x32/tango/status/image-missing.png new file mode 100644 index 0000000..27fccd5 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/image-missing.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/mail-attachment.png b/CoffeBeans/icons/tango/32x32/tango/status/mail-attachment.png new file mode 100644 index 0000000..78f1e1c Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/mail-attachment.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/network-error.png b/CoffeBeans/icons/tango/32x32/tango/status/network-error.png new file mode 100644 index 0000000..3de26e7 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/network-error.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/network-idle.png b/CoffeBeans/icons/tango/32x32/tango/status/network-idle.png new file mode 100644 index 0000000..dca03af Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/network-idle.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/network-offline.png b/CoffeBeans/icons/tango/32x32/tango/status/network-offline.png new file mode 100644 index 0000000..428aaa5 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/network-offline.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/network-receive.png b/CoffeBeans/icons/tango/32x32/tango/status/network-receive.png new file mode 100644 index 0000000..b149c5d Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/network-receive.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/network-transmit-receive.png b/CoffeBeans/icons/tango/32x32/tango/status/network-transmit-receive.png new file mode 100644 index 0000000..10ad0ac Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/network-transmit-receive.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/network-transmit.png b/CoffeBeans/icons/tango/32x32/tango/status/network-transmit.png new file mode 100644 index 0000000..aaa91b8 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/network-transmit.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/network-wireless-encrypted.png b/CoffeBeans/icons/tango/32x32/tango/status/network-wireless-encrypted.png new file mode 100644 index 0000000..0d4e368 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/network-wireless-encrypted.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/printer-error.png b/CoffeBeans/icons/tango/32x32/tango/status/printer-error.png new file mode 100644 index 0000000..a6aa460 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/printer-error.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/software-update-available.png b/CoffeBeans/icons/tango/32x32/tango/status/software-update-available.png new file mode 100644 index 0000000..aadcb91 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/software-update-available.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/software-update-urgent.png b/CoffeBeans/icons/tango/32x32/tango/status/software-update-urgent.png new file mode 100644 index 0000000..3d67d9e Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/software-update-urgent.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/user-trash-full.png b/CoffeBeans/icons/tango/32x32/tango/status/user-trash-full.png new file mode 100644 index 0000000..462ef39 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/user-trash-full.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/weather-clear-night.png b/CoffeBeans/icons/tango/32x32/tango/status/weather-clear-night.png new file mode 100644 index 0000000..aa2714c Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/weather-clear-night.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/weather-clear.png b/CoffeBeans/icons/tango/32x32/tango/status/weather-clear.png new file mode 100644 index 0000000..c84e8d3 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/weather-clear.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/weather-few-clouds-night.png b/CoffeBeans/icons/tango/32x32/tango/status/weather-few-clouds-night.png new file mode 100644 index 0000000..62e21d7 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/weather-few-clouds-night.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/weather-few-clouds.png b/CoffeBeans/icons/tango/32x32/tango/status/weather-few-clouds.png new file mode 100644 index 0000000..8c14e0d Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/weather-few-clouds.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/weather-overcast.png b/CoffeBeans/icons/tango/32x32/tango/status/weather-overcast.png new file mode 100644 index 0000000..cc22e4c Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/weather-overcast.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/weather-severe-alert.png b/CoffeBeans/icons/tango/32x32/tango/status/weather-severe-alert.png new file mode 100644 index 0000000..fb75808 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/weather-severe-alert.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/weather-showers-scattered.png b/CoffeBeans/icons/tango/32x32/tango/status/weather-showers-scattered.png new file mode 100644 index 0000000..6e85a7b Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/weather-showers-scattered.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/weather-showers.png b/CoffeBeans/icons/tango/32x32/tango/status/weather-showers.png new file mode 100644 index 0000000..0074348 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/weather-showers.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/weather-snow.png b/CoffeBeans/icons/tango/32x32/tango/status/weather-snow.png new file mode 100644 index 0000000..fef6e4d Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/weather-snow.png differ diff --git a/CoffeBeans/icons/tango/32x32/tango/status/weather-storm.png b/CoffeBeans/icons/tango/32x32/tango/status/weather-storm.png new file mode 100644 index 0000000..8a7db96 Binary files /dev/null and b/CoffeBeans/icons/tango/32x32/tango/status/weather-storm.png differ diff --git a/CoffeBeans/icons/tango/index.theme b/CoffeBeans/icons/tango/index.theme new file mode 100644 index 0000000..45b1be8 --- /dev/null +++ b/CoffeBeans/icons/tango/index.theme @@ -0,0 +1,14 @@ +[Icon Theme] +Name=tango +Comment=Original tango icons +Inherits=default +Directories=16x16,22x22,32x32 + +[16x16] +Size=16 + +[22x22] +Size=22 + +[32x32] +Size=32 diff --git a/CoffeBeans/src/addproductdialog/CMakeLists.txt b/CoffeBeans/src/addproductdialog/CMakeLists.txt new file mode 100644 index 0000000..bd7ea72 --- /dev/null +++ b/CoffeBeans/src/addproductdialog/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 3.13) + +project(addproductdialog) + +set(TARGET_NAME AddProductDialog) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS REQUIRED Sql Widgets) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS REQUIRED Sql Widgets) + +add_library(${TARGET_NAME} + addproductdialog.cpp + addproductdialog.h + addproductdialog.ui) + +target_link_libraries(${TARGET_NAME} PRIVATE + ColouredLineEdit + IntegerValidator) + +target_link_libraries(${TARGET_NAME} PRIVATE + Qt${QT_VERSION_MAJOR}::Sql + Qt${QT_VERSION_MAJOR}::Widgets) diff --git a/CoffeBeans/src/addproductdialog/addproductdialog.cpp b/CoffeBeans/src/addproductdialog/addproductdialog.cpp new file mode 100644 index 0000000..3f76eea --- /dev/null +++ b/CoffeBeans/src/addproductdialog/addproductdialog.cpp @@ -0,0 +1,92 @@ +#include "addproductdialog.h" + +#include "ui_addproductdialog.h" + +#include "../colouredlineedit/colouredlineedit.h" + +#include "../sqlscript/sqlscript.h" + +#include "../integervalidator/integervalidator.h" + +#include + +#include + +#include + +AddProductDialog::AddProductDialog(QWidget *parent) + : QDialog(parent), m_ui(new Ui::AddProductDialog) { + m_ui->setupUi(this); + setWindowTitle(tr("Product addition")); + createWidgets(); + configureWidgets(); + setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); +} + +AddProductDialog::~AddProductDialog() { delete m_ui; } + +void AddProductDialog::createWidgets() { + m_nameLineEdit = new ColouredLineEdit; + m_ui->m_nameLineEditLayout->addWidget(m_nameLineEdit); + m_ui->nameLabel->setBuddy(m_nameLineEdit); + + m_barcodeLineEdit = new ColouredLineEdit; + m_ui->m_barcodeLineEditLayout->addWidget(m_barcodeLineEdit); + m_ui->barcodeLabel->setBuddy(m_barcodeLineEdit); +} + +void AddProductDialog::configureWidgets() { + CREATE_NAME(viewName, VIEW::AvailableProductTypes); + auto tableModel = new QSqlTableModel(this, QSqlDatabase::database()); + tableModel->setTable(viewName); + tableModel->select(); + m_ui->m_productType->setModel(tableModel); + + CREATE_INDEX(nameIndex, COLUMN::AvailableProductTypes_Name); + m_ui->m_productType->setModelColumn(nameIndex); + + m_barcodeLineEdit->setMaxLength(13); + m_barcodeLineEdit->setValidator(new IntegerValidator(m_barcodeLineEdit)); +} + +int AddProductDialog::insertedId() { return m_insertedId; } + +void AddProductDialog::done(int resultCode) { + if (QDialog::Accepted == resultCode) { + QString nameText = m_nameLineEdit->text(); + QString barcodeText = m_barcodeLineEdit->text(); + + bool existName = SqlScript::doesProductExist(nameText); + bool badName = nameText.isEmpty() || existName; + if (badName) + m_nameLineEdit->notice(QColor(Qt::red)); + + int length = barcodeText.length(); + long long barcode = barcodeText.toLongLong(); + bool badBarcode = length != 13 || SqlScript::doesBarcodeExist(barcode); + if (badBarcode) + m_barcodeLineEdit->notice(QColor(Qt::red)); + + if (badName || badBarcode) + return; + + auto *productType = m_ui->m_productType; + int row = productType->currentIndex(); + if (row < 0) + return; + + CREATE_INDEX(idIndex, COLUMN::AvailableProductTypes_Id); + auto *model = productType->model(); + int productTypeId = model->index(row, idIndex).data().toUInt(); + m_insertedId = SqlScript::insertProduct(nameText, productTypeId, + barcodeText.toLongLong()); + auto *list = m_ui->m_properties; + int end = list->count(); + for (int index = 0; index != end; ++index) + if (list->item(index)->checkState() == Qt::CheckState::Checked) + SqlScript::insertProductAttribute(m_insertedId, + index + 1 /*to order number*/); + } + QDialog::done(resultCode); + return; +} diff --git a/CoffeBeans/src/addproductdialog/addproductdialog.h b/CoffeBeans/src/addproductdialog/addproductdialog.h new file mode 100644 index 0000000..3a0aa8a --- /dev/null +++ b/CoffeBeans/src/addproductdialog/addproductdialog.h @@ -0,0 +1,43 @@ +#ifndef ADDPRODUCTDIALOG_H +#define ADDPRODUCTDIALOG_H + +#include "../databaseinfo/databaseinfo.h" + +#include + +namespace Ui { +class AddProductDialog; +} + +class ColouredLineEdit; + +class AddProductDialog : public QDialog { + Q_OBJECT + +private: + ColouredLineEdit *m_nameLineEdit; + ColouredLineEdit *m_barcodeLineEdit; + Ui::AddProductDialog *m_ui; + +private: + int m_insertedId; + +public: + explicit AddProductDialog(QWidget *parent = nullptr); + ~AddProductDialog(); + +private: + void createWidgets(); + void configureWidgets(); + +private: + void createAttribute(int productId, DatabaseInfo::Attribute attribute); + +private: + void done(int resultCode) override; + +public: + int insertedId(); +}; + +#endif // ADDPRODUCTDIALOG_H diff --git a/CoffeBeans/src/addproductdialog/addproductdialog.ui b/CoffeBeans/src/addproductdialog/addproductdialog.ui new file mode 100644 index 0000000..980885b --- /dev/null +++ b/CoffeBeans/src/addproductdialog/addproductdialog.ui @@ -0,0 +1,157 @@ + + + AddProductDialog + + + + 0 + 0 + 300 + 327 + + + + Dialog + + + + + + QFrame::StyledPanel + + + QFrame::Plain + + + + + + + + &Name: + + + + + + + + + + + &Barcode: + + + + + + + + + &Type: + + + m_productType + + + + + + + + + + &Properties: + + + m_properties + + + + + + + + Article number + + + Unchecked + + + + + Date of manufacture + + + Unchecked + + + + + Expiration date + + + Unchecked + + + + + Unit + + + Unchecked + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + AddProductDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + AddProductDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/CoffeBeans/src/addproducttypedialog/CMakeLists.txt b/CoffeBeans/src/addproducttypedialog/CMakeLists.txt new file mode 100644 index 0000000..4d1a0c5 --- /dev/null +++ b/CoffeBeans/src/addproducttypedialog/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 3.13) + +project(addproducttypedialog) + +set(TARGET_NAME AddProductTypeDialog) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS REQUIRED Sql Widgets) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS REQUIRED Sql Widgets) + +add_library(${TARGET_NAME} + addproducttypedialog.cpp + addproducttypedialog.h + addproducttypedialog.ui) + +target_include_directories(${TARGET_NAME} PRIVATE + &{SOURCE_DIR}/colouredlineedit) + +target_link_libraries(${TARGET_NAME} PRIVATE + ColouredLineEdit) + +target_link_libraries(${TARGET_NAME} PRIVATE + Qt${QT_VERSION_MAJOR}::Sql + Qt${QT_VERSION_MAJOR}::Widgets) diff --git a/CoffeBeans/src/addproducttypedialog/addproducttypedialog.cpp b/CoffeBeans/src/addproducttypedialog/addproducttypedialog.cpp new file mode 100644 index 0000000..0fb2953 --- /dev/null +++ b/CoffeBeans/src/addproducttypedialog/addproducttypedialog.cpp @@ -0,0 +1,156 @@ +#include "addproducttypedialog.h" + +#include "ui_addproducttypedialog.h" + +#include "../sqlscript/sqlscript.h" + +#include "../sqltreenode/sqltreenode.h" + +#include "../colouredlineedit/colouredlineedit.h" + +#include + +#include + +AddProductTypeDialog::AddProductTypeDialog( + const SqlTreeNode *sqlTreeNode, QWidget *parent, Qt::WindowFlags f) + : QDialog(parent, f), m_ui(new Ui::AddProductTypeDialog) { + m_ui->setupUi(this); + setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); + initializeWidgetItems(); + createLineEditWidgets(); + configureConnections(); + configureTreeWidget(); + configureStandardText(); + showCase(sqlTreeNode); +} + +AddProductTypeDialog::~AddProductTypeDialog() { delete m_ui; } + +void AddProductTypeDialog::createLineEditWidgets() { + m_currentTypeNameLineEdit = new ColouredLineEdit; + m_ui->m_currentTypeNameLabel->setBuddy(m_currentTypeNameLineEdit); + m_ui->m_interactionLayout->addWidget(m_currentTypeNameLineEdit, 1, 1, 1, 1); + + m_futureTypeNameLineEdit = new ColouredLineEdit; + m_ui->m_futureTypeNameLabel->setBuddy(m_futureTypeNameLineEdit); + m_ui->m_interactionLayout->addWidget(m_futureTypeNameLineEdit, 2, 1, 1, 1); +} + +void AddProductTypeDialog::initializeWidgetItems() { + m_commonTreeWidgetItem = m_ui->m_futureTreeWidget->topLevelItem(0); + m_currentTreeWidgetItem = m_commonTreeWidgetItem->child(0); + m_futureTreeWidgetItem = m_commonTreeWidgetItem->child(1); +} + +void AddProductTypeDialog::configureConnections() { + auto pairsLineEditTreeWidgetItem = { + QPair(m_futureTypeNameLineEdit, m_futureTreeWidgetItem), + QPair(m_currentTypeNameLineEdit, m_currentTreeWidgetItem)}; + using namespace std::placeholders; + for (auto &pairs : pairsLineEditTreeWidgetItem) + connect(pairs.first, &QLineEdit::textChanged, this, + [pairs](const QString &text) { + auto &[edit, item] = pairs; + if (text.isEmpty()) + item->setText(m_textColumn, edit->placeholderText()); + else + item->setText(m_textColumn, text); + }); +} + +void AddProductTypeDialog::configureTreeWidget() { + m_ui->m_futureTreeWidget->expandAll(); + m_ui->m_futureTreeWidget->setItemsExpandable(false); +} + +void AddProductTypeDialog::configureStandardText() { + m_futureTreeWidgetItem->setText(m_textColumn, tr("New products")); + m_futureTypeNameLineEdit->setPlaceholderText( + m_futureTreeWidgetItem->text(m_textColumn)); + + m_currentTreeWidgetItem->setText(m_textColumn, tr("Existing products")); + m_currentTypeNameLineEdit->setPlaceholderText( + m_currentTreeWidgetItem->text(m_textColumn)); +} + +void AddProductTypeDialog::showCase(const SqlTreeNode *sqlTreeNode) { + QString selectedNodeName = sqlTreeNode->data; + QString topText = m_ui->m_topLabel->text(); + topText = topText.arg(selectedNodeName); + m_ui->m_topLabel->setText(topText); + + bool hasNestedNodes = !sqlTreeNode->nestedNodes.empty(); + if (hasNestedNodes) { + showGoodCase(std::move(selectedNodeName)); + return; + } + + int productTypeId = int(sqlTreeNode->recordIdentifier); + bool hasProducts = SqlScript::doesProductExist(productTypeId); + if (!hasProducts) { + showGoodCase(std::move(selectedNodeName)); + return; + } + showBadCase(std::move(selectedNodeName)); +} + +void AddProductTypeDialog::done(int resultCode) { + if (QDialog::Accepted == resultCode) { + foreach (auto *lineEdit, findChildren()) + if (!lineEdit->isHidden() && lineEdit->isEnabled() && + lineEdit->text().isEmpty()) { + notifyInputError(); + QApplication::beep(); + return; + } + } + QDialog::done(resultCode); + return; +} + +void AddProductTypeDialog::setHiddenBadCaseGroup(bool hidden) { + m_ui->m_currentTypeNameLabel->setHidden(hidden); + m_currentTypeNameLineEdit->setHidden(hidden); + m_currentTreeWidgetItem->setHidden(hidden); +} + +bool AddProductTypeDialog::lastCase() { return m_lastCase; } + +QString AddProductTypeDialog::futureTypeName() { + return m_futureTypeNameLineEdit->text(); +} + +QString AddProductTypeDialog::currentTypeName() { + return m_currentTypeNameLineEdit->text(); +} + +void AddProductTypeDialog::setTopText(const QString &value) { + m_ui->m_topLabel->setText(value); +} + +void AddProductTypeDialog::showGoodCase(QString &&commonNodeName) { + m_lastCase = true; + setHiddenBadCaseGroup(m_lastCase); + + m_ui->m_stackedWidget->setCurrentWidget(m_ui->m_goodCasePage); + m_commonTreeWidgetItem->setText(m_textColumn, commonNodeName); + + m_futureTypeNameLineEdit->setFocus(); +} + +void AddProductTypeDialog::showBadCase(QString &&commonNodeName) { + m_lastCase = false; + setHiddenBadCaseGroup(m_lastCase); + + m_ui->m_stackedWidget->setCurrentWidget(m_ui->m_badCasePage); + m_commonTreeWidgetItem->setText(m_textColumn, commonNodeName); + + m_currentTypeNameLineEdit->setFocus(); +} + +void AddProductTypeDialog::notifyInputError() { + foreach (auto *lineEdit, findChildren()) + if (lineEdit->isEnabled() && lineEdit->text().isEmpty()) + lineEdit->notice(Qt::red); +} diff --git a/CoffeBeans/src/addproducttypedialog/addproducttypedialog.h b/CoffeBeans/src/addproducttypedialog/addproducttypedialog.h new file mode 100644 index 0000000..e6b8353 --- /dev/null +++ b/CoffeBeans/src/addproducttypedialog/addproducttypedialog.h @@ -0,0 +1,58 @@ +#ifndef ADDPRODUCTTYPEDIALOG_H +#define ADDPRODUCTTYPEDIALOG_H + +#include + +#include + +namespace Ui { +class AddProductTypeDialog; +} + +template struct SqlTreeNode; + +class ColouredLineEdit; + +class AddProductTypeDialog : public QDialog { +private: + static constexpr int m_textColumn = 0; + QTreeWidgetItem *m_currentTreeWidgetItem; + QTreeWidgetItem *m_futureTreeWidgetItem; + QTreeWidgetItem *m_commonTreeWidgetItem; + Ui::AddProductTypeDialog *m_ui; + +private: + bool m_lastCase; + ColouredLineEdit *m_currentTypeNameLineEdit; + ColouredLineEdit *m_futureTypeNameLineEdit; + +public: + explicit AddProductTypeDialog(const SqlTreeNode *sqlTreeNode, + QWidget *parent = nullptr, + Qt::WindowFlags f = Qt::WindowFlags()); + ~AddProductTypeDialog(); + +private: + void createLineEditWidgets(); + void initializeWidgetItems(); + void configureConnections(); + void configureTreeWidget(); + void configureStandardText(); + void showCase(const SqlTreeNode *sqlTreeNode); + +private: + void done(int resultCode) override; + void setHiddenBadCaseGroup(bool hidden); + void showGoodCase(QString &&generalNodeName); + void showBadCase(QString &&generalNodeName); + +public: + // m_lastCase is true when case was good + bool lastCase(); + QString futureTypeName(); + QString currentTypeName(); + void setTopText(const QString &value); + void notifyInputError(); +}; + +#endif // ADDPRODUCTTYPEDIALOG_H diff --git a/CoffeBeans/src/addproducttypedialog/addproducttypedialog.ui b/CoffeBeans/src/addproducttypedialog/addproducttypedialog.ui new file mode 100644 index 0000000..a363b63 --- /dev/null +++ b/CoffeBeans/src/addproducttypedialog/addproducttypedialog.ui @@ -0,0 +1,243 @@ + + + AddProductTypeDialog + + + Qt::ApplicationModal + + + + 0 + 0 + 337 + 245 + + + + Dialog + + + + QLayout::SetFixedSize + + + + + + + + + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + + + + 0 + + + + + + 0 + 0 + + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + This type does not specify products and is a general type. + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + This type already specifies products. +Create a generic type that specifies all the others. + + + + + + + + + + + &Type name of future products: + + + + + + + &Type name of existing products: + + + + + + + + + &After accepting: + + + m_futureTreeWidget + + + + + + + + 16777215 + 70 + + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::NoSelection + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Save + + + + + futureFrame + buttonBox + m_topLabel + + + m_futureTreeWidget + + + + + buttonBox + accepted() + AddProductTypeDialog + accept() + + + 227 + 283 + + + 157 + 274 + + + + + buttonBox + rejected() + AddProductTypeDialog + reject() + + + 295 + 289 + + + 286 + 274 + + + + + diff --git a/CoffeBeans/src/colouredlineedit/CMakeLists.txt b/CoffeBeans/src/colouredlineedit/CMakeLists.txt new file mode 100644 index 0000000..17479e2 --- /dev/null +++ b/CoffeBeans/src/colouredlineedit/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.13) + +project(colouredlineedit) + +set(TARGET_NAME ColouredLineEdit) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS REQUIRED Widgets) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS REQUIRED Widgets) + +add_library(${TARGET_NAME} + colouredlineedit.cpp + colouredlineedit.h) + +target_link_libraries(${TARGET_NAME} PRIVATE + StyleSheetHandler) + +target_link_libraries(${TARGET_NAME} PRIVATE + Qt${QT_VERSION_MAJOR}::Widgets) + + diff --git a/CoffeBeans/src/colouredlineedit/colouredlineedit.cpp b/CoffeBeans/src/colouredlineedit/colouredlineedit.cpp new file mode 100644 index 0000000..b6b8943 --- /dev/null +++ b/CoffeBeans/src/colouredlineedit/colouredlineedit.cpp @@ -0,0 +1,130 @@ +#include "colouredlineedit.h" + +#include "../stylesheethandler/stylesheethandler.h" + +#include + +QColor ColouredLineEdit::defaultTextColor() noexcept { + const static QColor m_text = + QApplication::palette("QLineEdit").color(QPalette::Text); + return m_text; +} + +QColor ColouredLineEdit::defaultBackgroundColor() noexcept { + const static QColor m_background = + QApplication::palette("QLineEdit").color(QPalette::Background); + return m_background; +} + +QColor ColouredLineEdit::defaultBorderColor() noexcept { + const static QColor m_border = + QApplication::palette("QLineEdit").color(QPalette::Dark); + return m_border; +} + +void ColouredLineEdit::createAnimators() { + m_colorProperty = new Animator(this, "text"); + m_backgroundColorProperty = new Animator(this, "background"); + m_borderColorProperty = new Animator(this, "border"); + m_parallelAnimationGroup = new QParallelAnimationGroup(this); + m_parallelAnimationGroup->addAnimation(m_colorProperty); + m_parallelAnimationGroup->addAnimation(m_backgroundColorProperty); + m_parallelAnimationGroup->addAnimation(m_borderColorProperty); +} + +void ColouredLineEdit::setStartColors(const QColor &color) { + foreach (auto currentColor, findChildren()) + currentColor->setStartValue(color); + return; +} + +void ColouredLineEdit::setEndColors(const QColor &color) { + foreach (auto currentColor, findChildren()) + currentColor->setEndValue(color); + return; +} + +void ColouredLineEdit::setStartColors() { + m_colorProperty->setStartValue(defaultTextColor()); + m_backgroundColorProperty->setStartValue(defaultBackgroundColor()); + m_borderColorProperty->setStartValue(defaultBorderColor()); +} + +void ColouredLineEdit::setEndColors() { + m_colorProperty->setEndValue(defaultTextColor()); + m_backgroundColorProperty->setEndValue(defaultBackgroundColor()); + m_borderColorProperty->setEndValue(defaultBorderColor()); +} + +void ColouredLineEdit::setTextColor(const QColor &color) { + StyleSheetHandler::setValue(this, "color", 0, color); +} + +void ColouredLineEdit::setBackgroundColor(const QColor &color) { + StyleSheetHandler::setValue(this, "background-color", 0, color); +} + +void ColouredLineEdit::setBorderColor(const QColor &color) { + StyleSheetHandler::setValue(this, "border-color", 0, color); +} + +ColouredLineEdit::ColouredLineEdit(QWidget *parent) : QLineEdit(parent) { + createAnimators(); + configureAnimators(); + setStyleSheet(styleSheet()); +} + +void ColouredLineEdit::configureAnimators() { + m_colorProperty->setEasingCurve(QEasingCurve::OutExpo); + m_backgroundColorProperty->setEasingCurve(QEasingCurve::OutCirc); + m_borderColorProperty->setEasingCurve(QEasingCurve::InCubic); +} + +void ColouredLineEdit::setIntermediateColor(const QColor &color) noexcept { + qreal step = 0.5; + m_colorProperty->setKeyValueAt(step, color); + m_backgroundColorProperty->setKeyValueAt(step, color); + m_borderColorProperty->setKeyValueAt(step, color); +} + +void ColouredLineEdit::setDuration(int milliseconds) noexcept { + m_colorProperty->setDuration(milliseconds); + m_backgroundColorProperty->setDuration(milliseconds); + m_borderColorProperty->setDuration(milliseconds); +} + +void ColouredLineEdit::animate() { + m_parallelAnimationGroup->stop(); + m_parallelAnimationGroup->start(); +} + +void ColouredLineEdit::notice(const QColor &color, bool illuminate) { + setStartColors(color); + if (illuminate) { + StyleSheetHandler::setValue(this, "border-width", 0, "2px"); + m_colorProperty->setEndValue(defaultTextColor()); + m_backgroundColorProperty->setEndValue(defaultBackgroundColor()); + m_borderColorProperty->setEndValue(color); + } else { + StyleSheetHandler::setValue(this, "border-width", 0, "1px"); + setEndColors(); + } + setDuration(2000); + animate(); +} + +// void ColouredLineEdit::softlyReset() {} + +constexpr const char *ColouredLineEdit::styleSheetTemplate() const noexcept { + return "color: %1;" + "background-color: %2;" + "border-color: %3;" + "border-style: solid;" + "border-width: 1px;"; +} + +QString ColouredLineEdit::styleSheet() const noexcept { + return QString(styleSheetTemplate()) + .arg(defaultTextColor().name(), defaultBackgroundColor().name(), + defaultBorderColor().name()); +} diff --git a/CoffeBeans/src/colouredlineedit/colouredlineedit.h b/CoffeBeans/src/colouredlineedit/colouredlineedit.h new file mode 100644 index 0000000..4f34de0 --- /dev/null +++ b/CoffeBeans/src/colouredlineedit/colouredlineedit.h @@ -0,0 +1,66 @@ +#ifndef COLOUREDLINEEDIT_H +#define COLOUREDLINEEDIT_H + +#include "../stylesheethandler/stylesheethandler.h" + +#include + +#include + +#include + +#include + +#include + +class AnimatedPropertyStyleSheet; + +class ColouredLineEdit : public QLineEdit { + Q_OBJECT + Q_PROPERTY(QColor text MEMBER m_currentTextColor WRITE setTextColor) + Q_PROPERTY(QColor background MEMBER m_currentBackgroundColor WRITE + setBackgroundColor) + Q_PROPERTY(QColor border MEMBER m_currentBorderColor WRITE setBorderColor) + +public: + void setTextColor(const QColor &color); + void setBackgroundColor(const QColor &color); + void setBorderColor(const QColor &color); + +private: + using Animator = QPropertyAnimation; + QColor m_currentTextColor; + QColor m_currentBackgroundColor; + QColor m_currentBorderColor; + Animator *m_colorProperty; + Animator *m_backgroundColorProperty; + Animator *m_borderColorProperty; + QParallelAnimationGroup *m_parallelAnimationGroup; + +public: + explicit ColouredLineEdit(QWidget *parent = nullptr); + +private: + void createAnimators(); + void configureAnimators(); + void setStartColors(const QColor &color); + void setEndColors(const QColor &color); + void setStartColors(); + void setEndColors(); + +private: + static QColor defaultTextColor() noexcept; + static QColor defaultBackgroundColor() noexcept; + static QColor defaultBorderColor() noexcept; + constexpr const char *styleSheetTemplate() const noexcept; + QString styleSheet() const noexcept; + void setIntermediateColor(const QColor &color) noexcept; + void setDuration(int milliseconds) noexcept; + +public slots: + void animate(); + void notice(const QColor &color, bool illuminate = false); + // void softlyReset(); +}; + +#endif // COLOUREDLINEEDIT_H diff --git a/CoffeBeans/src/databaseinfo/CMakeLists.txt b/CoffeBeans/src/databaseinfo/CMakeLists.txt new file mode 100644 index 0000000..6a436d7 --- /dev/null +++ b/CoffeBeans/src/databaseinfo/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.13) + +project(databaseinfo) + +set(TARGET_NAME DatabaseInfo) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +add_library(${TARGET_NAME} INTERFACE) + + diff --git a/CoffeBeans/src/databaseinfo/databaseinfo.h b/CoffeBeans/src/databaseinfo/databaseinfo.h new file mode 100644 index 0000000..649fbce --- /dev/null +++ b/CoffeBeans/src/databaseinfo/databaseinfo.h @@ -0,0 +1,127 @@ +#ifndef DATABASEINFO_H +#define DATABASEINFO_H + +struct DatabaseInfo { +public: + enum class Table : int { + AdditionalVariables, + Attributes, + PriceHistoryRecords, + ProductAttributes, + ProductInflowRecords, + ProductOutflowRecords, + ProductTypes, + ProductValues, + ProductWriteOffRecords, + Products, + Suppliers, + WriteOffReasons, + }; + enum class View : int { ProductProperties, AvailableProductTypes }; + enum class Column : unsigned int { + AdditionalVariables_Id, + AdditionalVariables_Name, + AdditionalVariables_Value, + Attributes_Id, + Attributes_Name, + PriceHistoryRecords_Id, + PriceHistoryRecords_ProductId, + PriceHistoryRecords_Datetime, + PriceHistoryRecords_Price, + ProductAttributes_ProductId, + ProductAttributes_AttributeId, + ProductInflowRecords_Id, + ProductInflowRecords_ProductId, + ProductInflowRecords_Barcode, + ProductInflowRecords_SupplierId, + ProductInflowRecords_Count, + ProductInflowRecords_FullPrice, + ProductInflowRecords_Datetime, + ProductOutflowRecords_Id, + ProductOutflowRecords_ProductId, + ProductOutflowRecords_Barcode, + ProductOutflowRecords_Count, + ProductOutflowRecords_Datetime, + ProductTypes_Id, + ProductTypes_ParentId, + ProductTypes_Name, + ProductValues_Id, + ProductValues_ProductId, + ProductValues_AttributeId, + ProductValues_Value, + ProductWriteOffRecords_Id, + ProductWriteOffRecords_ProductId, + ProductWriteOffRecords_Barcode, + ProductWriteOffRecords_ReasonId, + ProductWriteOffRecords_Count, + ProductWriteOffRecords_Datetime, + Products_Id, + Products_Barcode, + Products_Name, + Products_ProductTypeId, + Suppliers_Id, + Suppliers_Name, + Suppliers_Address, + Suppliers_TelephoneNumber, + WriteOffReasons_Id, + WriteOffReasons_Name, + Products_ProductTypes_ProductId, + Products_ProductTypes_Barcode, + Products_ProductTypes_ProductTypeId, + Products_ProductTypes_ProductName, + Products_ProductTypes_ProductTypeName, + ProductProperties_ProductId, + ProductProperties_AttributeId, + ProductProperties_Name, + ProductProperties_Value, + AvailableProductTypes_Id, + AvailableProductTypes_ParentId, + AvailableProductTypes_Name + }; + // the order corresponds to the record number + enum class Attribute : int { + ArticleNumber = 1, + DateOfManufacture, + ExpirationDate, + Unit + }; + +public: + static constexpr const char *name(Table table); + static constexpr const char *name(View view); + static constexpr const char *name(Column column); + static constexpr unsigned int ordinalNumber(Column column); + static constexpr unsigned int indexNumber(Column column); +}; + +#include "databaseinfo.tpp" + +#ifndef NDATABASE_INFO_MACRO + +#define TABLE DatabaseInfo::Table +#define VIEW DatabaseInfo::View +#define COLUMN DatabaseInfo::Column + +#define NAME(value) DatabaseInfo::name((value)) +#define NUMBER(value) DatabaseInfo::ordinalNumber((value)) +#define INDEX(value) DatabaseInfo::indexNumber((value)) + +#define ASSERT_NAME(value) assert((value) != nullptr) +#define ASSERT_NUMBER(value) assert((value) > 0) +#define ASSERT_INDEX(value) assert((value) < UINT_MAX) + +#define CREATE_NAME(variableName, variableValue) \ + auto((variableName)) = NAME((variableValue)); \ + ASSERT_NAME(variableName) + +#define CREATE_NUMBER(variableName, variableValue) \ + auto((variableName)) = NUMBER((variableValue)); \ + ASSERT_NUMBER(variableName) + +#define CREATE_INDEX(variableName, variableValue) \ + auto((variableName)) = INDEX((variableValue)); \ + ASSERT_INDEX(variableName) + +#endif // NDATABASE_INFO_MACRO + +#endif // DATABASEINFO_H diff --git a/CoffeBeans/src/databaseinfo/databaseinfo.tpp b/CoffeBeans/src/databaseinfo/databaseinfo.tpp new file mode 100644 index 0000000..efd6cf5 --- /dev/null +++ b/CoffeBeans/src/databaseinfo/databaseinfo.tpp @@ -0,0 +1,204 @@ +#ifndef DATABASEINFO_HPP +#define DATABASEINFO_HPP + +#include "databaseinfo.h" + +inline constexpr const char *DatabaseInfo::name(DatabaseInfo::Table table) { + switch (table) { + case Table::AdditionalVariables: + return "additional_variables"; + case Table::Attributes: + return "attributes"; + case Table::PriceHistoryRecords: + return "price_history_records"; + case Table::ProductAttributes: + return "product_attributes"; + case Table::ProductInflowRecords: + return "product_inflow_records"; + case Table::ProductOutflowRecords: + return "product_outflow_records"; + case Table::ProductTypes: + return "product_types"; + case Table::ProductValues: + return "product_values"; + case Table::ProductWriteOffRecords: + return "product_write_off_records"; + case Table::Products: + return "products"; + case Table::Suppliers: + return "suppliers"; + case Table::WriteOffReasons: + return "write_off_reasons"; + } + return nullptr; +} + +inline constexpr const char *DatabaseInfo::name(DatabaseInfo::View view) { + switch (view) { + case View::ProductProperties: + return "product_properties"; + case View::AvailableProductTypes: + return "available_product_types"; + } + return nullptr; +} + +inline constexpr const char *DatabaseInfo::name(DatabaseInfo::Column column) { + switch (column) { + case Column::AdditionalVariables_Id: + case Column::Attributes_Id: + case Column::PriceHistoryRecords_Id: + case Column::ProductInflowRecords_Id: + case Column::ProductOutflowRecords_Id: + case Column::ProductTypes_Id: + case Column::ProductValues_Id: + case Column::ProductWriteOffRecords_Id: + case Column::Products_Id: + case Column::Suppliers_Id: + case Column::WriteOffReasons_Id: + case Column::AvailableProductTypes_Id: + return "id"; + case Column::AdditionalVariables_Name: + case Column::Attributes_Name: + case Column::ProductTypes_Name: + case Column::Products_Name: + case Column::Suppliers_Name: + case Column::ProductProperties_Name: + case Column::AvailableProductTypes_Name: + return "name"; + case Column::Products_Barcode: + case Column::ProductInflowRecords_Barcode: + case Column::ProductOutflowRecords_Barcode: + case Column::ProductWriteOffRecords_Barcode: + case Column::Products_ProductTypes_Barcode: + return "barcode"; + case Column::WriteOffReasons_Name: + case Column::AdditionalVariables_Value: + case Column::ProductValues_Value: + case Column::ProductProperties_Value: + return "value"; + case Column::PriceHistoryRecords_ProductId: + case Column::ProductAttributes_ProductId: + case Column::ProductValues_ProductId: + case Column::Products_ProductTypes_ProductId: + case Column::ProductProperties_ProductId: + case Column::ProductInflowRecords_ProductId: + case Column::ProductOutflowRecords_ProductId: + case Column::ProductWriteOffRecords_ProductId: + return "product_id"; + case Column::Products_ProductTypeId: + case Column::Products_ProductTypes_ProductTypeId: + return "product_type_id"; + case Column::Products_ProductTypes_ProductName: + return "product_name"; + case Column::Products_ProductTypes_ProductTypeName: + return "product_type_name"; + case Column::PriceHistoryRecords_Datetime: + case Column::ProductInflowRecords_Datetime: + case Column::ProductOutflowRecords_Datetime: + case Column::ProductWriteOffRecords_Datetime: + return "datetime"; + case Column::PriceHistoryRecords_Price: + return "price"; + case Column::ProductAttributes_AttributeId: + case Column::ProductValues_AttributeId: + case Column::ProductProperties_AttributeId: + return "attribute_id"; + case Column::ProductInflowRecords_SupplierId: + return "supplier_id"; + case Column::ProductInflowRecords_Count: + case Column::ProductOutflowRecords_Count: + case Column::ProductWriteOffRecords_Count: + return "count"; + case Column::ProductInflowRecords_FullPrice: + return "full_price"; + case Column::ProductTypes_ParentId: + case Column::AvailableProductTypes_ParentId: + return "parent_id"; + case Column::ProductWriteOffRecords_ReasonId: + return "reason_id"; + case Column::Suppliers_Address: + return "address"; + case Column::Suppliers_TelephoneNumber: + return "telephone_number"; + } + return nullptr; +} + +inline constexpr unsigned +DatabaseInfo::ordinalNumber(DatabaseInfo::Column column) { + switch (column) { + case Column::AdditionalVariables_Id: + case Column::Attributes_Id: + case Column::PriceHistoryRecords_Id: + case Column::ProductAttributes_ProductId: + case Column::ProductInflowRecords_Id: + case Column::ProductOutflowRecords_Id: + case Column::ProductTypes_Id: + case Column::ProductValues_Id: + case Column::ProductWriteOffRecords_Id: + case Column::Products_Id: + case Column::Suppliers_Id: + case Column::WriteOffReasons_Id: + case Column::Products_ProductTypes_ProductId: + case Column::ProductProperties_ProductId: + case Column::AvailableProductTypes_Id: + return 1; + case Column::AdditionalVariables_Name: + case Column::Attributes_Name: + case Column::PriceHistoryRecords_ProductId: + case Column::ProductAttributes_AttributeId: + case Column::ProductTypes_ParentId: + case Column::ProductValues_ProductId: + case Column::Products_Name: + case Column::Suppliers_Name: + case Column::WriteOffReasons_Name: + case Column::ProductProperties_AttributeId: + case Column::ProductInflowRecords_ProductId: + case Column::ProductOutflowRecords_ProductId: + case Column::ProductWriteOffRecords_ProductId: + case Column::Products_Barcode: + case Column::Products_ProductTypes_Barcode: + case Column::AvailableProductTypes_ParentId: + return 2; + case Column::AdditionalVariables_Value: + case Column::PriceHistoryRecords_Datetime: + case Column::ProductInflowRecords_SupplierId: + case Column::ProductOutflowRecords_Count: + case Column::ProductTypes_Name: + case Column::ProductValues_AttributeId: + case Column::ProductWriteOffRecords_ReasonId: + case Column::Products_ProductTypeId: + case Column::Suppliers_Address: + case Column::ProductProperties_Name: + case Column::ProductInflowRecords_Barcode: + case Column::ProductOutflowRecords_Barcode: + case Column::ProductWriteOffRecords_Barcode: + case Column::Products_ProductTypes_ProductTypeId: + case Column::AvailableProductTypes_Name: + return 3; + case Column::PriceHistoryRecords_Price: + case Column::ProductInflowRecords_Count: + case Column::ProductOutflowRecords_Datetime: + case Column::ProductValues_Value: + case Column::ProductWriteOffRecords_Count: + case Column::Suppliers_TelephoneNumber: + case Column::Products_ProductTypes_ProductName: + case Column::ProductProperties_Value: + return 4; + case Column::ProductInflowRecords_FullPrice: + case Column::ProductWriteOffRecords_Datetime: + case Column::Products_ProductTypes_ProductTypeName: + return 5; + case Column::ProductInflowRecords_Datetime: + return 6; + } + return 0; +} + +inline constexpr unsigned +DatabaseInfo::indexNumber(DatabaseInfo::Column column) { + return ordinalNumber(column) - 1; +} + +#endif // DATABASEINFO_HPP diff --git a/CoffeBeans/src/deletedialog/CMakeLists.txt b/CoffeBeans/src/deletedialog/CMakeLists.txt new file mode 100644 index 0000000..65df7f8 --- /dev/null +++ b/CoffeBeans/src/deletedialog/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 3.13) + +project(deletedialog) + +set(TARGET_NAME DeleteDialog) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS REQUIRED Sql Widgets) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS REQUIRED Sql Widgets) + +add_library(${TARGET_NAME} + deletedialog.cpp + deletedialog.h + deletedialog.ui) + +target_link_libraries(${TARGET_NAME} PRIVATE + ColouredLineEdit + VerificationWidget) + +target_link_libraries(${TARGET_NAME} PRIVATE + Qt${QT_VERSION_MAJOR}::Sql + Qt${QT_VERSION_MAJOR}::Widgets) diff --git a/CoffeBeans/src/deletedialog/deletedialog.cpp b/CoffeBeans/src/deletedialog/deletedialog.cpp new file mode 100644 index 0000000..637af99 --- /dev/null +++ b/CoffeBeans/src/deletedialog/deletedialog.cpp @@ -0,0 +1,49 @@ +#include "deletedialog.h" + +#include "ui_deletedialog.h" + +#include "../verificationwidget/verificationwidget.h" + +#include + +void DeleteDialog::done(int resultCode) { + if (QDialog::Accepted == resultCode && + m_verificationWidget->inputVerified() == false) { + m_verificationWidget->noticeRed(); + QApplication::beep(); + return; + } + QDialog::done(resultCode); + return; +} + +DeleteDialog::DeleteDialog(const QString &reference, QDialog *parent, + Qt::WindowFlags f) + : QDialog(parent, f), m_ui(new Ui::DeleteDialog) { + m_ui->setupUi(this); + setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); + createWidgets(); + configureText(); + setReference(reference); +} + +DeleteDialog::~DeleteDialog() { delete m_ui; } + +void DeleteDialog::createWidgets() { + m_verificationWidget = new VerificationWidget; + m_ui->m_verificationLayout->addWidget(m_verificationWidget); + m_verificationWidget->setFocus(); +} + +void DeleteDialog::configureText() { + setWindowTitle(tr("Removing process")); + m_ui->m_buttonBoxLabel->setText(tr("Do you confirm the removal?")); +} + +void DeleteDialog::setReference(const QString &reference) { + m_verificationWidget->setReference(reference); +} + +void DeleteDialog::setTopText(const QString &value) { + m_ui->m_topLabel->setText(value); +} diff --git a/CoffeBeans/src/deletedialog/deletedialog.h b/CoffeBeans/src/deletedialog/deletedialog.h new file mode 100644 index 0000000..b46cc94 --- /dev/null +++ b/CoffeBeans/src/deletedialog/deletedialog.h @@ -0,0 +1,37 @@ +#ifndef DELETEDIALOG_H +#define DELETEDIALOG_H + +#include + +namespace Ui { +class DeleteDialog; +} + +class VerificationWidget; + +class DeleteDialog : public QDialog { +private: + using QDialog::setWindowTitle; + +private: + VerificationWidget *m_verificationWidget; + Ui::DeleteDialog *m_ui; + +private: + void done(int resultCode) override; + +public: + DeleteDialog(const QString &reference, QDialog *parent = nullptr, + Qt::WindowFlags f = Qt::WindowFlags()); + ~DeleteDialog(); + +private: + void createWidgets(); + void configureText(); + +public: + void setReference(const QString &reference); + void setTopText(const QString &value); +}; + +#endif // DELETEDIALOG_H diff --git a/CoffeBeans/src/deletedialog/deletedialog.ui b/CoffeBeans/src/deletedialog/deletedialog.ui new file mode 100644 index 0000000..14c4c1b --- /dev/null +++ b/CoffeBeans/src/deletedialog/deletedialog.ui @@ -0,0 +1,104 @@ + + + DeleteDialog + + + + 0 + 0 + 350 + 103 + + + + + 350 + 0 + + + + Data deletion process + + + + QLayout::SetFixedSize + + + + + + + + + + + + QFrame::StyledPanel + + + + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + Qt::Horizontal + + + QDialogButtonBox::No|QDialogButtonBox::Yes + + + false + + + + + + + + + buttonBox + accepted() + DeleteDialog + accept() + + + 227 + 183 + + + 157 + 198 + + + + + buttonBox + rejected() + DeleteDialog + reject() + + + 295 + 189 + + + 286 + 198 + + + + + diff --git a/CoffeBeans/src/editproductdialog/CMakeLists.txt b/CoffeBeans/src/editproductdialog/CMakeLists.txt new file mode 100644 index 0000000..0054f18 --- /dev/null +++ b/CoffeBeans/src/editproductdialog/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 3.13) + +project(editproductdialog) + +set(TARGET_NAME EditProductDialog) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS REQUIRED Sql Widgets) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS REQUIRED Sql Widgets) + +add_library(${TARGET_NAME} + editproductdialog.cpp + editproductdialog.h + editproductdialog.ui) + +target_link_libraries(${TARGET_NAME} PRIVATE + SqlTableNoticeDelegate + IntegerValidator) + +target_link_libraries(${TARGET_NAME} PRIVATE + Qt${QT_VERSION_MAJOR}::Sql + Qt${QT_VERSION_MAJOR}::Widgets) diff --git a/CoffeBeans/src/editproductdialog/editproductdialog.cpp b/CoffeBeans/src/editproductdialog/editproductdialog.cpp new file mode 100644 index 0000000..26067a6 --- /dev/null +++ b/CoffeBeans/src/editproductdialog/editproductdialog.cpp @@ -0,0 +1,245 @@ +#include "editproductdialog.h" + +#include "ui_editproductdialog.h" + +#include "../databaseinfo/databaseinfo.h" + +#include "../sqltablenoticedelegate/sqltablenoticedelegate.h" + +#include "../sqlscript/sqlscript.h" + +#include "../integervalidator/integervalidator.h" + +#include "../colouredlineedit/colouredlineedit.h" + +#include + +#include + +void EditProductDialog::done(int resultCode) { + if (resultCode == QDialog::Rejected) { + QDialog::done(resultCode); + return; + } + + int productIdIndex, attributeIdIndex, valueIndex; + currentRecordInfo(&productIdIndex, &attributeIdIndex, nullptr, &valueIndex); + for (int row = 0, end = m_model->rowCount(); row != end; ++row) { + if (m_clearData[row].isNull()) { + QModelIndex rowIndex = m_model->index(row, valueIndex); + if (m_model->isDirty(std::move(rowIndex))) { + int productId = m_model->record(row).value(productIdIndex).toUInt(); + int attributeId = + m_model->record(row).value(attributeIdIndex).toUInt(); + QVariant value = m_model->record(row).value(valueIndex); + SqlScript::insertProductValue(productId, attributeId, std::move(value)); + } + } + } + m_model->submitAll(); + + auto barcodeText = m_barcodeLineEdit->text(); + if (barcodeText.isEmpty() == false && newBarcodeCorrect == true) + SqlScript::updateBarcode(m_productId, barcodeText.toLongLong()); + QDialog::done(resultCode); + return; +} + +void EditProductDialog::initializeRecordValues( + const QSqlRecord &productsJoinProductTypes) { + CREATE_INDEX(productIdIndex, COLUMN::Products_ProductTypes_ProductId); + m_productId = productsJoinProductTypes.value(productIdIndex).toUInt(); + CREATE_INDEX(barcodeIndex, COLUMN::Products_ProductTypes_Barcode); + m_barcode = productsJoinProductTypes.value(barcodeIndex).toLongLong(); + CREATE_INDEX(nameIndex, COLUMN::Products_ProductTypes_ProductName); + m_name = productsJoinProductTypes.value(nameIndex).toString(); +} + +void EditProductDialog::createWidgets() { + m_barcodeLineEdit = new ColouredLineEdit; + m_ui->m_barcodeLayout->addWidget(m_barcodeLineEdit); + m_ui->barcodeLabel->setBuddy(m_barcodeLineEdit); +} + +void EditProductDialog::configureSqlModel() { + CREATE_NAME(productId, COLUMN::ProductProperties_ProductId); + m_model->setEditStrategy(QSqlTableModel::OnManualSubmit); + m_model->setTable("product_properties"); + m_model->setFilter(QString("[%1] = %2").arg(productId).arg(m_productId)); + m_model->select(); + + CREATE_INDEX(valueIndex, COLUMN::ProductProperties_Value); + int rowCount = m_model->rowCount(); + m_clearData.reserve(rowCount); + for (int row = 0, end = rowCount; row != end; ++row) { + QModelIndex valueModelIndex = m_model->index(row, valueIndex); + QString clearDate = m_model->data(valueModelIndex).toString(); + m_clearData.push_back(clearDate); + } + + m_ui->m_tableView->setModel(m_model); + m_ui->m_tableView->setCurrentIndex(QModelIndex()); +} + +void EditProductDialog::configureWidgets() { + CREATE_INDEX(productIdIndex, COLUMN::ProductProperties_ProductId); + m_ui->m_tableView->hideColumn(productIdIndex); + CREATE_INDEX(attributeIdIndex, COLUMN::ProductProperties_AttributeId); + m_ui->m_tableView->hideColumn(attributeIdIndex); + m_ui->m_tableView->horizontalHeader()->setSectionResizeMode( + QHeaderView::ResizeToContents); + m_ui->m_tableView->horizontalHeader()->setStretchLastSection(true); + + m_barcodeLineEdit->setMaxLength(13); + m_barcodeLineEdit->setValidator(new IntegerValidator(m_barcodeLineEdit)); + QString displayedBarcode = QString::number(m_barcode).rightJustified(13, '0'); + m_barcodeLineEdit->setPlaceholderText(displayedBarcode); +} + +void EditProductDialog::configureConnections() { + auto *selectionModel = m_ui->m_tableView->selectionModel(); + connect(selectionModel, &QItemSelectionModel::currentRowChanged, this, + &EditProductDialog::refreshInputWidgets); + connect(m_ui->m_modifyProperty, &QPushButton::pressed, this, + &EditProductDialog::modifyModelValue); + connect(m_ui->m_modifyBarcode, &QPushButton::pressed, this, + &EditProductDialog::checkBarcode); +} + +void EditProductDialog::configureDisplayedData() { + bool isEmpty = m_model->rowCount() == 0; + if (isEmpty ^ m_ui->m_tableView->horizontalHeader()->isHidden()) + m_ui->m_tableView->horizontalHeader()->setHidden( + /*if table model*/ isEmpty); + if (isEmpty) + return; + + CREATE_INDEX(nameIndex, COLUMN::ProductProperties_Name); + m_model->setHeaderData(nameIndex, Qt::Orientation::Horizontal, tr("Name")); + CREATE_INDEX(valueIndex, COLUMN::ProductProperties_Value); + m_model->setHeaderData(valueIndex, Qt::Orientation::Horizontal, tr("Value")); + + setWindowTitle(tr("Editing product \"%1\"").arg(m_name)); +} + +void EditProductDialog::setEnableProperties(bool enable) { + m_ui->m_inputWidgets->setEnabled(enable); + m_ui->m_modifyProperty->setEnabled(enable); +} + +void EditProductDialog::refreshInputWidgets(const QModelIndex ¤tIndex) { + bool isValid = currentIndex.isValid(); + setEnableProperties(isValid); + + if (isValid == false) + return; + + int attributeIdIndex, valueIndex; + currentRecordInfo(nullptr, &attributeIdIndex, nullptr, &valueIndex); + + QSqlRecord record = m_model->record(currentIndex.row()); + auto value = record.value(valueIndex); + + auto attribute = static_cast( + record.value(attributeIdIndex).toInt()); + switch (attribute) { + case DatabaseInfo::Attribute::ArticleNumber: + case DatabaseInfo::Attribute::Unit: + m_ui->m_inputWidgets->setCurrentIndex(int(Input::LineEdit)); + m_ui->m_lineEdit->setText(value.toString()); + break; + case DatabaseInfo::Attribute::DateOfManufacture: + m_ui->m_inputWidgets->setCurrentIndex(int(Input::DateEdit)); + m_ui->m_dateEdit->setDate(value.toDate()); + break; + case DatabaseInfo::Attribute::ExpirationDate: + m_ui->m_inputWidgets->setCurrentIndex(int(Input::SpinBox)); + m_ui->m_spinBox->setValue(value.toInt()); + break; + default: + return; + } +} + +void EditProductDialog::modifyModelValue() { + int attributeIdIndex, nameIndex, valueIndex; + currentRecordInfo(nullptr, &attributeIdIndex, &nameIndex, &valueIndex); + + int row = m_ui->m_tableView->currentIndex().row(); + QSqlRecord record = m_model->record(row); + QModelIndex valueModelIndex = m_model->index(row, valueIndex); + + auto attribute = static_cast( + record.value(attributeIdIndex).toInt()); + + switch (attribute) { + case DatabaseInfo::Attribute::ArticleNumber: + case DatabaseInfo::Attribute::Unit: + m_model->setData(valueModelIndex, m_ui->m_lineEdit->text()); + break; + case DatabaseInfo::Attribute::DateOfManufacture: { + const QDate &date = m_ui->m_dateEdit->date(); + m_model->setData(valueModelIndex, date.toString(Qt::ISODate)); + } break; + case DatabaseInfo::Attribute::ExpirationDate: + m_model->setData(valueModelIndex, m_ui->m_spinBox->text()); + default: + return; + } +} + +void EditProductDialog::checkBarcode() { + newBarcodeCorrect = false; + QString text = m_barcodeLineEdit->text(); + if (text.length() < 13) { + m_barcodeLineEdit->notice(QColor(0xEEE644), false); + return; + } + bool barcodeExists = SqlScript::doesBarcodeExist(text.toLongLong()); + if (text.length() == 13 && barcodeExists) { + m_barcodeLineEdit->notice(Qt::red, true); + return; + } + m_barcodeLineEdit->notice(QColor(0xA0EF95), true); + newBarcodeCorrect = true; +} + +void EditProductDialog::currentRecordInfo(int *productIdIndex, + int *attributeIdIndex, + int *nameIndex, int *valueIndex) { + if (productIdIndex) { + CREATE_INDEX(value, COLUMN::ProductProperties_ProductId); + (*productIdIndex) = value; + } + if (attributeIdIndex) { + CREATE_INDEX(value, COLUMN::ProductProperties_AttributeId); + (*attributeIdIndex) = value; + } + if (nameIndex) { + CREATE_INDEX(value, COLUMN::ProductProperties_Name); + (*nameIndex) = value; + } + if (valueIndex) { + CREATE_INDEX(value, COLUMN::ProductProperties_Value); + (*valueIndex) = value; + } +} + +EditProductDialog::EditProductDialog(const QSqlRecord &product, QWidget *parent) + : QDialog(parent), + m_model(new QSqlTableModel(this, QSqlDatabase::database())), + m_ui(new Ui::EditProductDialog) { + m_ui->setupUi(this); + setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); + setWindowTitle(tr("Product editing")); + initializeRecordValues(product); + configureSqlModel(); + createWidgets(); + configureWidgets(); + configureConnections(); + configureDisplayedData(); + m_ui->m_tableView->setItemDelegate( + new SqlTableNoticeDelegate(m_ui->m_tableView)); +} + +EditProductDialog::~EditProductDialog() { delete m_ui; } diff --git a/CoffeBeans/src/editproductdialog/editproductdialog.h b/CoffeBeans/src/editproductdialog/editproductdialog.h new file mode 100644 index 0000000..42590da --- /dev/null +++ b/CoffeBeans/src/editproductdialog/editproductdialog.h @@ -0,0 +1,59 @@ +#ifndef EDITPRODUCTDIALOG_H +#define EDITPRODUCTDIALOG_H + +#include + +#include + +namespace Ui { +class EditProductDialog; +} + +class ColouredLineEdit; + +class EditProductDialog : public QDialog { + Q_OBJECT + +private: + enum class Input : int { LineEdit, DateEdit, SpinBox, DoubleSpinBox }; + +private: + bool newBarcodeCorrect; + int m_productId; + long long m_barcode; + QString m_name; + std::vector m_clearData; + +private: + QSqlTableModel *m_model; + ColouredLineEdit *m_barcodeLineEdit; + Ui::EditProductDialog *m_ui; + +private: + void done(int resultCode) override; + +private: + void initializeRecordValues(const QSqlRecord &productsJoinProductTypes); + void configureSqlModel(); + void createWidgets(); + void configureWidgets(); + void configureConnections(); + void configureDisplayedData(); + +private: + void setEnableProperties(bool enable); + void refreshInputWidgets(const QModelIndex ¤tIndex); + void modifyModelValue(); + void checkBarcode(); + +private: + void currentRecordInfo(int *productIdIndex, int *attributeIdIndex, + int *nameIndex, int *valueIndex); + +public: + explicit EditProductDialog(const QSqlRecord &product, + QWidget *parent = nullptr); + ~EditProductDialog(); +}; + +#endif // EDITPRODUCTDIALOG_H diff --git a/CoffeBeans/src/editproductdialog/editproductdialog.ui b/CoffeBeans/src/editproductdialog/editproductdialog.ui new file mode 100644 index 0000000..f30fa56 --- /dev/null +++ b/CoffeBeans/src/editproductdialog/editproductdialog.ui @@ -0,0 +1,311 @@ + + + EditProductDialog + + + + 0 + 0 + 590 + 382 + + + + Dialog + + + + QLayout::SetMinimumSize + + + + + QFrame::StyledPanel + + + + + + + + &Barcode: + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + &Modify + + + + + + + + + + 0 + 0 + + + + &Properties: + + + m_tableView + + + + + + + + 0 + 0 + + + + + 0 + 150 + + + + QAbstractItemView::NoEditTriggers + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + + + + + + + + 0 + 0 + + + + The value of the property: + + + + + + + false + + + + 0 + 0 + + + + 2 + + + + + 0 + + + 0 + + + + + + + + + + 0 + + + 0 + + + + + + + + + + 0 + + + 0 + + + + + 0 + + + 2147483647 + + + + + + + + + 0 + + + 0 + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + false + + + &Modify + + + + + + + + + + + + + 0 + 0 + + + + Do you confirm the save of the modified values? + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Save + + + + + + + m_tableView + m_lineEdit + m_modifyProperty + m_dateEdit + m_spinBox + m_doubleSpinBox + + + + + buttonBox + accepted() + EditProductDialog + accept() + + + 227 + 316 + + + 157 + 232 + + + + + buttonBox + rejected() + EditProductDialog + reject() + + + 261 + 322 + + + 270 + 232 + + + + + m_modifyProperty + pressed() + m_tableView + clearSelection() + + + 508 + 255 + + + 185 + 83 + + + + + diff --git a/CoffeBeans/src/integervalidator/CMakeLists.txt b/CoffeBeans/src/integervalidator/CMakeLists.txt new file mode 100644 index 0000000..6d62c38 --- /dev/null +++ b/CoffeBeans/src/integervalidator/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.13) + +project(integervalidator) + +set(TARGET_NAME IntegerValidator) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS REQUIRED Widgets) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS REQUIRED Widgets) + +add_library(${TARGET_NAME} + integervalidator.cpp + integervalidator.h) + +target_link_libraries(${TARGET_NAME} PRIVATE + Qt${QT_VERSION_MAJOR}::Widgets) + + diff --git a/CoffeBeans/src/integervalidator/integervalidator.cpp b/CoffeBeans/src/integervalidator/integervalidator.cpp new file mode 100644 index 0000000..3e1df04 --- /dev/null +++ b/CoffeBeans/src/integervalidator/integervalidator.cpp @@ -0,0 +1,14 @@ +#include "integervalidator.h" + +#include + +IntegerValidator::IntegerValidator(QObject *parent) : QValidator(parent) { + m_expression.setPattern("^[0-9]*$"); +} + +QValidator::State IntegerValidator::validate(QString &string, int &pos) const { + Q_UNUSED(pos); + if (m_expression.match(string).hasMatch()) + return Acceptable; + return Invalid; +} diff --git a/CoffeBeans/src/integervalidator/integervalidator.h b/CoffeBeans/src/integervalidator/integervalidator.h new file mode 100644 index 0000000..077f197 --- /dev/null +++ b/CoffeBeans/src/integervalidator/integervalidator.h @@ -0,0 +1,17 @@ +#ifndef INTEGERVALIDATOR_H +#define INTEGERVALIDATOR_H + +#include + +#include + +class IntegerValidator : public QValidator { +private: + QRegularExpression m_expression; + +public: + IntegerValidator(QObject *parent = nullptr); + State validate(QString &string, int &pos) const override; +}; + +#endif // INTEGERVALIDATOR_H diff --git a/CoffeBeans/src/main/CMakeLists.txt b/CoffeBeans/src/main/CMakeLists.txt new file mode 100644 index 0000000..28b2a5a --- /dev/null +++ b/CoffeBeans/src/main/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.13) + +project(main) + +set(TARGET_NAME ${CMAKE_PROJECT_NAME}) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS REQUIRED Sql Widgets) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS REQUIRED Sql Widgets) + +add_executable(${TARGET_NAME} + main.cpp + ${ICON_DIR}/icons.qrc) + +target_include_directories(${TARGET_NAME} PRIVATE + ${SOURCE_DIR}/mainwindow) + +target_link_libraries(${TARGET_NAME} PRIVATE + MainWindow) + +target_link_libraries(${TARGET_NAME} PRIVATE + Qt${QT_VERSION_MAJOR}::Sql + Qt${QT_VERSION_MAJOR}::Widgets) diff --git a/CoffeBeans/src/main/addproducttypedialog.ui b/CoffeBeans/src/main/addproducttypedialog.ui new file mode 100644 index 0000000..a363b63 --- /dev/null +++ b/CoffeBeans/src/main/addproducttypedialog.ui @@ -0,0 +1,243 @@ + + + AddProductTypeDialog + + + Qt::ApplicationModal + + + + 0 + 0 + 337 + 245 + + + + Dialog + + + + QLayout::SetFixedSize + + + + + + + + + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + + + + 0 + + + + + + 0 + 0 + + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + This type does not specify products and is a general type. + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + This type already specifies products. +Create a generic type that specifies all the others. + + + + + + + + + + + &Type name of future products: + + + + + + + &Type name of existing products: + + + + + + + + + &After accepting: + + + m_futureTreeWidget + + + + + + + + 16777215 + 70 + + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::NoSelection + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Save + + + + + futureFrame + buttonBox + m_topLabel + + + m_futureTreeWidget + + + + + buttonBox + accepted() + AddProductTypeDialog + accept() + + + 227 + 283 + + + 157 + 274 + + + + + buttonBox + rejected() + AddProductTypeDialog + reject() + + + 295 + 289 + + + 286 + 274 + + + + + diff --git a/CoffeBeans/src/main/deletedialog.ui b/CoffeBeans/src/main/deletedialog.ui new file mode 100644 index 0000000..14c4c1b --- /dev/null +++ b/CoffeBeans/src/main/deletedialog.ui @@ -0,0 +1,104 @@ + + + DeleteDialog + + + + 0 + 0 + 350 + 103 + + + + + 350 + 0 + + + + Data deletion process + + + + QLayout::SetFixedSize + + + + + + + + + + + + QFrame::StyledPanel + + + + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + Qt::Horizontal + + + QDialogButtonBox::No|QDialogButtonBox::Yes + + + false + + + + + + + + + buttonBox + accepted() + DeleteDialog + accept() + + + 227 + 183 + + + 157 + 198 + + + + + buttonBox + rejected() + DeleteDialog + reject() + + + 295 + 189 + + + 286 + 198 + + + + + diff --git a/CoffeBeans/src/main/editproductdialog.ui b/CoffeBeans/src/main/editproductdialog.ui new file mode 100644 index 0000000..7eac73f --- /dev/null +++ b/CoffeBeans/src/main/editproductdialog.ui @@ -0,0 +1,269 @@ + + + EditProductDialog + + + + 0 + 0 + 590 + 332 + + + + Dialog + + + + QLayout::SetMinimumSize + + + + + QFrame::StyledPanel + + + + + + + 0 + 0 + + + + Product "%1" &properties: + + + m_tableView + + + + + + + + 0 + 0 + + + + + 0 + 150 + + + + QAbstractItemView::NoEditTriggers + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + + + + + + + + 0 + 0 + + + + The value of the property: + + + + + + + false + + + + 0 + 0 + + + + 0 + + + + + 0 + + + 0 + + + + + + + + + + 0 + + + 0 + + + + + + + + + + 0 + + + 0 + + + + + + + + + + 0 + + + 0 + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + false + + + &Modify + + + + + + + + + + + + + 0 + 0 + + + + Do you confirm the save of the modified values? + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Save + + + + + + + m_tableView + m_lineEdit + m_modifyPushButton + m_dateEdit + m_spinBox + m_doubleSpinBox + + + + + buttonBox + accepted() + EditProductDialog + accept() + + + 227 + 316 + + + 157 + 232 + + + + + buttonBox + rejected() + EditProductDialog + reject() + + + 261 + 322 + + + 270 + 232 + + + + + m_modifyPushButton + pressed() + m_tableView + clearSelection() + + + 508 + 255 + + + 185 + 83 + + + + + diff --git a/CoffeBeans/src/main/main.cpp b/CoffeBeans/src/main/main.cpp new file mode 100644 index 0000000..6ae42d3 --- /dev/null +++ b/CoffeBeans/src/main/main.cpp @@ -0,0 +1,47 @@ +#include "mainwindow.h" + +#include + +#include + +#include + +bool createConnection(QString userName, QString password, QString driver, + QString server, QString database, + QString persistSecurityInfo) { + auto db = QSqlDatabase::addDatabase("QODBC"); + QString databaseName("DRIVER={%1};"); + databaseName.append("SERVER=%2;"); + databaseName.append("DATABASE=%3;"); + databaseName.append("Persist Security Info=%4;"); + databaseName = + databaseName.arg(driver, server, database, persistSecurityInfo); + db.setDatabaseName(databaseName); + db.setUserName(userName); + db.setPassword(password); + return db.open(); +} + +int main(int argc, char *argv[]) { + QApplication a(argc, argv); + bool success = createConnection("user", "user", "SQL Server", + "(local)\\SQLEXPRESS", "Database", "true"); + + if (!success) { +#ifndef NDEBUG + QMessageBox::critical(nullptr, QObject::tr("Error"), + QObject::tr("Database connection error: %2") + .arg(QSqlDatabase().lastError().text())); +#else + QMessageBox::critical( + nullptr, QObject::tr("Database error"), + QObject::tr("Connection to the database is not possible.")); +#endif + return 1; + } + + MainWindow mainWindow; + mainWindow.show(); + + return a.exec(); +} diff --git a/CoffeBeans/src/main/mainwindow.ui b/CoffeBeans/src/main/mainwindow.ui new file mode 100644 index 0000000..ec9c128 --- /dev/null +++ b/CoffeBeans/src/main/mainwindow.ui @@ -0,0 +1,199 @@ + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + Coffe beans + + + + .. + + + + + + + + 0 + 0 + + + + + + + + + + + QFrame::Panel + + + QFrame::Sunken + + + + 6 + + + 6 + + + 6 + + + 6 + + + 6 + + + + + QFrame::Panel + + + QFrame::Raised + + + + + + + + + + + + 0 + 0 + 800 + 20 + + + + + &Create + + + + + + &Open + + + + &Database + + + + + + + + + + + &About + + + + + &Settings + + + + + + + + + + + + + &Report... + + + Reports + + + Open the report generation wizard + + + Ctrl+R + + + + + &Workplace + + + Open the cashier's workplace + + + Ctrl+W + + + + + &Prices... + + + Interact with product prices + + + Ctrl+P + + + + + Pro&ducts... + + + Interact with the list of products + + + Ctrl+D + + + + + S&uppliers... + + + Interact with the list of suppliers + + + Ctrl+U + + + + + &Language... + + + Change the language + + + + + La&yout... + + + Change the layout and location of the displayed components + + + + + + diff --git a/CoffeBeans/src/main/renamedialog.ui b/CoffeBeans/src/main/renamedialog.ui new file mode 100644 index 0000000..cf202da --- /dev/null +++ b/CoffeBeans/src/main/renamedialog.ui @@ -0,0 +1,117 @@ + + + RenameDialog + + + + 0 + 0 + 350 + 135 + + + + + 350 + 0 + + + + Dialog + + + + QLayout::SetFixedSize + + + + + + + + + + + + QFrame::StyledPanel + + + + + + 0 + + + + + + + + + Enter the new name: + + + + + + + false + + + + + + + + + + + + true + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Save + + + + + + + + + buttonBox + accepted() + RenameDialog + accept() + + + 227 + 183 + + + 157 + 198 + + + + + buttonBox + rejected() + RenameDialog + reject() + + + 295 + 189 + + + 286 + 198 + + + + + diff --git a/CoffeBeans/src/main/verificationwidget.ui b/CoffeBeans/src/main/verificationwidget.ui new file mode 100644 index 0000000..27fd504 --- /dev/null +++ b/CoffeBeans/src/main/verificationwidget.ui @@ -0,0 +1,50 @@ + + + VerificationWidget + + + + 0 + 0 + 213 + 58 + + + + Form + + + + + + Entering the old value: + + + + + + + + Consolas + 12 + 50 + false + false + + + + QFrame::StyledPanel + + + + + + Qt::AlignCenter + + + + + + + + diff --git a/CoffeBeans/src/mainwindow/CMakeLists.txt b/CoffeBeans/src/mainwindow/CMakeLists.txt new file mode 100644 index 0000000..c71329c --- /dev/null +++ b/CoffeBeans/src/mainwindow/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.13) + +project(mainwindow) + +set(TARGET_NAME MainWindow) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS REQUIRED Sql Widgets) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS REQUIRED Sql Widgets) + +add_library(${TARGET_NAME} + mainwindow.cpp + mainwindow.h + mainwindow.ui) + +target_link_libraries(${TARGET_NAME} PRIVATE + ProductsWidget) + +target_link_libraries(${TARGET_NAME} PRIVATE + Qt${QT_VERSION_MAJOR}::Sql + Qt${QT_VERSION_MAJOR}::Widgets) diff --git a/CoffeBeans/src/mainwindow/mainwindow.cpp b/CoffeBeans/src/mainwindow/mainwindow.cpp new file mode 100644 index 0000000..3f4e718 --- /dev/null +++ b/CoffeBeans/src/mainwindow/mainwindow.cpp @@ -0,0 +1,104 @@ +#include "mainwindow.h" + +#include "ui_mainwindow.h" + +#include "../productswidget/productswidget.h" + +#include + +#include + +#include + +#include + +void MainWindow::createToolBar() { + auto toolBar = new QToolBar; + toolBar->setObjectName("m_toolBar"); + + toolBar->setIconSize(QSize(32, 32)); + toolBar->setMovable(true); + toolBar->setFloatable(false); + toolBar->setToolButtonStyle(Qt::ToolButtonStyle::ToolButtonTextUnderIcon); + + toolBar->addAction(m_ui->m_actionWorkplace); + toolBar->addAction(m_ui->m_actionReport); + toolBar->addAction(m_ui->m_actionProducts); + toolBar->addAction(m_ui->m_actionPrices); + toolBar->addAction(m_ui->m_actionSuppliers); + addToolBar(Qt::ToolBarArea::LeftToolBarArea, toolBar); +} + +void MainWindow::configureCentralWidget() { + m_ui->m_innerWidget->addWidget(new QLabel("Workplace")); + m_ui->m_innerWidget->addWidget(new QLabel("Reports")); + m_ui->m_innerWidget->addWidget(new ProductsWidget); + m_ui->m_innerWidget->addWidget(new QLabel("Prices")); + m_ui->m_innerWidget->addWidget(new QLabel("Suppliers")); +} + +void MainWindow::configureConnections() { +#define CONNECT_ACTION_SLOT(value) \ + connect(m_ui->m_action##value, &QAction::triggered, this, \ + [this]() { setCentralWidget(CentralWidget::value); }); + + CONNECT_ACTION_SLOT(Workplace); + CONNECT_ACTION_SLOT(Report); + CONNECT_ACTION_SLOT(Products); + CONNECT_ACTION_SLOT(Prices); + CONNECT_ACTION_SLOT(Suppliers); + +#undef CONNECT_ACTION_SLOT +} + +void MainWindow::configureText() { + auto toolBarToggleViewAction = + findChild("m_toolBar")->toggleViewAction(); + toolBarToggleViewAction->setText("Show tool bar"); +} + +void MainWindow::configureIcons() { + QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); + QIcon::setThemeName("custom"); + + using Path = const char *; + constexpr Path windowIconFallback = ":/icons/custom/32x32/coffee-beans.png"; + constexpr Path workplaceIconFallback = ":/icons/custom/32x32/cash.png"; + constexpr Path suppliersFallback = ":/icons/custom/32x32/supplier.png"; + constexpr Path productsIconFallback = + ":/icons/custom/32x32/grocery-shelf.png"; + constexpr Path pricesIconFallback = ":/icons/custom/32x32/price-tag.png"; + constexpr Path reportIconFallback = ":/icons/tango/32x32/text-x-generic.png"; + + setWindowIcon(QIcon::fromTheme("coffee-beans", QIcon(windowIconFallback))); + + auto setIcon = [](QAction *action, const char *fromTheme, + const char *fallback) -> void { + action->setIcon(QIcon::fromTheme(fromTheme, QIcon(fallback))); + }; + + setIcon(m_ui->m_actionWorkplace, "cash", workplaceIconFallback); + setIcon(m_ui->m_actionSuppliers, "supplier", suppliersFallback); + setIcon(m_ui->m_actionProducts, "grocery-shelf", productsIconFallback); + setIcon(m_ui->m_actionPrices, "price-tag", pricesIconFallback); + setIcon(m_ui->m_actionReport, "text-x-generic", reportIconFallback); +} + +MainWindow::MainWindow(QWidget *parent) + : QMainWindow(parent), m_ui(new Ui::MainWindow) { + m_ui->setupUi(this); + createToolBar(); + configureCentralWidget(); + configureConnections(); + configureText(); + configureIcons(); + emit m_ui->m_actionWorkplace->triggered(); +} + +MainWindow::~MainWindow() { delete m_ui; } + +void MainWindow::setCentralWidget(MainWindow::CentralWidget index) { + m_ui->m_innerWidget->setCurrentIndex(int(index)); + QString labelText = qobject_cast(sender())->iconText() + ":"; + m_ui->m_topLabel->setText(labelText); +} diff --git a/CoffeBeans/src/mainwindow/mainwindow.h b/CoffeBeans/src/mainwindow/mainwindow.h new file mode 100644 index 0000000..2129cd8 --- /dev/null +++ b/CoffeBeans/src/mainwindow/mainwindow.h @@ -0,0 +1,40 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +namespace Ui { +class MainWindow; +} + +class MainWindow : public QMainWindow { + Q_OBJECT + +private: + enum class CentralWidget : int { + Workplace, + Report, + Products, + Prices, + Suppliers + }; + +private: + Ui::MainWindow *m_ui; + +private: + void createToolBar(); + void configureCentralWidget(); + void configureConnections(); + void configureText(); + void configureIcons(); + +public: + explicit MainWindow(QWidget *parent = nullptr); + ~MainWindow(); + +private: + void setCentralWidget(CentralWidget index); +}; + +#endif // MAINWINDOW_H diff --git a/CoffeBeans/src/mainwindow/mainwindow.ui b/CoffeBeans/src/mainwindow/mainwindow.ui new file mode 100644 index 0000000..939b7d0 --- /dev/null +++ b/CoffeBeans/src/mainwindow/mainwindow.ui @@ -0,0 +1,199 @@ + + + MainWindow + + + + 0 + 0 + 900 + 600 + + + + Coffe beans + + + + .. + + + + + + + + 0 + 0 + + + + + + + + + + + QFrame::Panel + + + QFrame::Sunken + + + + 6 + + + 6 + + + 6 + + + 6 + + + 6 + + + + + QFrame::Panel + + + QFrame::Raised + + + + + + + + + + + + 0 + 0 + 900 + 20 + + + + + &Create + + + + + + &Open + + + + &Database + + + + + + + + + + + &About + + + + + &Settings + + + + + + + + + + + + + &Report... + + + Reports + + + Open the report generation wizard + + + Ctrl+R + + + + + &Workplace + + + Open the cashier's workplace + + + Ctrl+W + + + + + &Prices... + + + Interact with product prices + + + Ctrl+P + + + + + Pro&ducts... + + + Interact with the list of products + + + Ctrl+D + + + + + S&uppliers... + + + Interact with the list of suppliers + + + Ctrl+U + + + + + &Language... + + + Change the language + + + + + La&yout... + + + Change the layout and location of the displayed components + + + + + + diff --git a/CoffeBeans/src/productswidget/CMakeLists.txt b/CoffeBeans/src/productswidget/CMakeLists.txt new file mode 100644 index 0000000..89d6a6f --- /dev/null +++ b/CoffeBeans/src/productswidget/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 3.13) + +project(productswidget) + +set(TARGET_NAME ProductsWidget) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS REQUIRED Sql Widgets) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS REQUIRED Sql Widgets) + +add_library(${TARGET_NAME} + productswidget.cpp + productswidget.h) + +target_link_libraries(${TARGET_NAME} PRIVATE + SqlScript + VirtualTreeModel + AddProductTypeDialog + VirtualModelAdapter + RenameDialog + DeleteDialog + EditProductDialog + AddProductDialog + SqlQueryProductsModel) + +target_link_libraries(${TARGET_NAME} PRIVATE + Qt${QT_VERSION_MAJOR}::Sql + Qt${QT_VERSION_MAJOR}::Widgets) diff --git a/CoffeBeans/src/productswidget/productswidget.cpp b/CoffeBeans/src/productswidget/productswidget.cpp new file mode 100644 index 0000000..1082340 --- /dev/null +++ b/CoffeBeans/src/productswidget/productswidget.cpp @@ -0,0 +1,462 @@ +#include "productswidget.h" + +#include "../sqltreemodel/sqltreemodel.h" + +#include "../addproducttypedialog/addproducttypedialog.h" + +#include "../renamedialog/renamedialog.h" + +#include "../deletedialog/deletedialog.h" + +#include "../editproductdialog/editproductdialog.h" + +#include "../addproductdialog/addproductdialog.h" + +#include "../sqlqueryproductsmodel/sqlqueryproductsmodel.h" + +#include + +#include + +#include + +#include + +#include + +#include + +#include + +#include + +void ProductsWidget::createTreeWidget() { + m_treeLabel = new QLabel(tr("Types of products:")); + + m_treeModel = new SqlTreeModel(this); + + m_expandAll = new QPushButton(tr("Expand all product types")); + m_collapseAll = new QPushButton(tr("Сollapse all product types")); + m_deleteProductType = new QPushButton(tr("Delete product type...")); + m_renameProductType = new QPushButton(tr("Rename product type...")); + m_addProductType = new QPushButton(tr("Add product type...")); + + for (auto &pushButton : {m_expandAll, m_collapseAll, m_deleteProductType, + m_renameProductType, m_addProductType}) + pushButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred); + + auto buttonLayout = new QVBoxLayout; + buttonLayout->addWidget(m_expandAll); + buttonLayout->addWidget(m_collapseAll); + buttonLayout->addWidget(m_deleteProductType); + buttonLayout->addWidget(m_renameProductType); + buttonLayout->addWidget(m_addProductType); + buttonLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, + QSizePolicy::MinimumExpanding)); + + m_treeView = new QTreeView; + m_treeView->setModel(m_treeModel); + m_treeView->setHeaderHidden(true); + m_treeView->setSelectionMode( + QAbstractItemView::SelectionMode::SingleSelection); + m_treeView->setEditTriggers(QAbstractItemView::NoEditTriggers); + m_treeView->setSizePolicy(QSizePolicy::MinimumExpanding, + QSizePolicy::MinimumExpanding); + + auto layout = new QHBoxLayout; + layout->addWidget(m_treeView); + layout->addLayout(buttonLayout); + + auto mainLayout = new QVBoxLayout; + mainLayout->addWidget(m_treeLabel); + mainLayout->addLayout(layout); + + m_treeWidget = new QWidget; + m_treeWidget->setLayout(mainLayout); +} + +void ProductsWidget::createTableWidget() { + m_tableLabel = new QLabel(tr("Products:")); + + m_tableModel = new SqlQueryProductsModel(this); + + m_showAll = new QPushButton(tr("Show all products")); + m_deleteProduct = new QPushButton(tr("Delete product...")); + m_renameProduct = new QPushButton(tr("Rename product...")); + m_editProduct = new QPushButton(tr("Edit product...")); + m_addProduct = new QPushButton(tr("Add product...")); + + for (auto &pushButton : {m_deleteProduct, m_renameProduct, m_addProduct}) + pushButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred); + + auto buttonLayout = new QVBoxLayout; + buttonLayout->addWidget(m_showAll); + buttonLayout->addWidget(m_deleteProduct); + buttonLayout->addWidget(m_renameProduct); + buttonLayout->addWidget(m_editProduct); + buttonLayout->addWidget(m_addProduct); + buttonLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, + QSizePolicy::MinimumExpanding)); + + m_tableView = new QTableView; + m_tableView->setModel(m_tableModel); + m_tableView->setItemDelegate(new QSqlRelationalDelegate(this)); + m_tableView->setSelectionMode(QAbstractItemView::SingleSelection); + m_tableView->setSelectionBehavior(QAbstractItemView::SelectRows); + m_tableView->setEditTriggers(QAbstractItemView::NoEditTriggers); + + auto layout = new QHBoxLayout; + layout->addWidget(m_tableView); + layout->addLayout(buttonLayout); + + auto mainLayout = new QVBoxLayout; + mainLayout->addWidget(m_tableLabel); + mainLayout->addLayout(layout); + + m_tableWidget = new QWidget; + m_tableWidget->setLayout(mainLayout); +} + +void ProductsWidget::createLayout() { + createTreeWidget(); + createTableWidget(); + + auto horizontalLine = new QFrame; + horizontalLine->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + horizontalLine->setLineWidth(2); + horizontalLine->setFixedHeight(2); + horizontalLine->setFrameShape(QFrame::HLine); + horizontalLine->setFrameShadow(QFrame::Sunken); + + auto splitter = new QSplitter; + splitter->setOrientation(Qt::Orientation::Vertical); + splitter->addWidget(m_treeWidget); + splitter->addWidget(horizontalLine); + splitter->setCollapsible(1, false); + splitter->addWidget(m_tableWidget); + + auto layout = new QVBoxLayout; + layout->addWidget(splitter); + setLayout(layout); +} + +void ProductsWidget::configureConnections() { + // product types + auto *treeSelectionModel = m_treeView->selectionModel(); + connect(treeSelectionModel, &QItemSelectionModel::currentChanged, this, + &ProductsWidget::updateTreePushButtonsPropertyEnabled); + connect(treeSelectionModel, &QItemSelectionModel::currentChanged, this, + &ProductsWidget::refreshTableModel); + connect(m_expandAll, &QPushButton::pressed, m_treeView, + &QTreeView::expandAll); + connect(m_collapseAll, &QPushButton::pressed, m_treeView, + &QTreeView::collapseAll); + connect(m_deleteProductType, &QPushButton::pressed, this, + &ProductsWidget::showDeleteProductTypeDialogWindow); + connect(m_renameProductType, &QPushButton::pressed, this, + &ProductsWidget::showRenameProductTypeDialogWindow); + connect(m_addProductType, &QPushButton::pressed, this, + &ProductsWidget::showAddProductTypeDialogWindow); + // products + auto *tableSelectionModel = m_tableView->selectionModel(); + connect(tableSelectionModel, &QItemSelectionModel::currentChanged, this, + &ProductsWidget::selectProductType); + connect(tableSelectionModel, &QItemSelectionModel::currentChanged, this, + &ProductsWidget::updateTablePushButtonsPropertyEnabled); + connect(this, &ProductsWidget::changedTableWidgetModel, + &ProductsWidget::updateTablePushButtonsPropertyEnabled); + connect(m_tableView, &QTableView::doubleClicked, this, + &ProductsWidget::showSameGroup); + connect(m_showAll, &QPushButton::pressed, this, + &ProductsWidget::showAllProducts); + connect(m_renameProduct, &QPushButton::pressed, this, + &ProductsWidget::showRenameProductDialogWindow); + connect(m_editProduct, &QPushButton::pressed, this, + &ProductsWidget::showEditProductDialogWindow); + connect(m_deleteProduct, &QPushButton::pressed, this, + &ProductsWidget::showDeleteProductDialogWindow); + connect(this, &ProductsWidget::changedTableWidgetModel, + &ProductsWidget::refreshTableView); + connect(m_addProduct, &QPushButton::pressed, this, + &ProductsWidget::showAddProductDialogWindow); +} + +void ProductsWidget::configureDisplayedData() { + CREATE_NAME(productTypesName, TABLE::ProductTypes); + m_treeModel->selectFromTable(productTypesName); + m_tableModel->setQuery(SqlScript::productsJoinProductTypes()); + + CREATE_INDEX(productIdIndex, COLUMN::Products_ProductTypes_ProductId); + m_tableView->setColumnHidden(productIdIndex, true); + + CREATE_INDEX(productTypeIdIndex, COLUMN::Products_ProductTypes_ProductTypeId); + m_tableView->setColumnHidden(productTypeIdIndex, true); + + CREATE_INDEX(barcodeIndex, COLUMN::Products_ProductTypes_Barcode); + m_tableModel->setHeaderData(barcodeIndex, Qt::Orientation::Horizontal, + tr("Barcode")); + + CREATE_INDEX(productIndex, COLUMN::Products_ProductTypes_ProductName); + m_tableModel->setHeaderData(productIndex, Qt::Orientation::Horizontal, + tr("Product name")); + CREATE_INDEX(productTypeNameIndex, + COLUMN::Products_ProductTypes_ProductTypeName); + m_tableModel->setHeaderData(productTypeNameIndex, Qt::Orientation::Horizontal, + tr("Product type name")); + emit changedTableWidgetModel(); +} + +QModelIndex ProductsWidget::treeSelectedItem() { + auto buffer = m_treeView->selectionModel()->selectedRows(); + return buffer.isEmpty() ? QModelIndex() : buffer.last(); +} + +ProductsWidget::ProductsWidget(QWidget *parent) : QWidget(parent) { + createLayout(); + configureConnections(); + configureDisplayedData(); + updateTreePushButtonsPropertyEnabled(); + updateTablePushButtonsPropertyEnabled(); +} + +ProductsWidget::~ProductsWidget() {} + +void ProductsWidget::selectProductType(const QModelIndex &tableModelIndex) { + CREATE_INDEX(productTypeId, COLUMN::Products_ProductTypes_ProductTypeId); + auto valueProductTypeId = + m_tableModel->record(tableModelIndex.row()).value(productTypeId).toInt(); + auto itemIndex = + m_treeModel->getItemModelIndex(m_treeModel->getNode(valueProductTypeId)); + // Only select + m_treeView->selectionModel()->select(itemIndex, + QItemSelectionModel::ClearAndSelect); + + SqlTreeNode *currentNode = m_treeModel->getNode(itemIndex); + do { + m_treeView->expand(m_treeModel->getItemModelIndex(currentNode)); + currentNode = currentNode->parent; + } while (currentNode != nullptr); + m_treeView->scrollTo(itemIndex); +} + +void ProductsWidget::refreshTableModel() { + auto treeModelIndex = m_treeView->currentIndex(); + if (treeModelIndex.isValid()) { + int currentNodeId = + int(m_treeModel->getNode(treeModelIndex)->recordIdentifier); + m_tableModel->setQuery( + SqlScript::subgroupsProductsJoinProductTypes(currentNodeId)); + } else { + m_tableModel->setQuery(SqlScript::productsJoinProductTypes()); + } + emit changedTableWidgetModel(); +} + +void ProductsWidget::showSameGroup(const QModelIndex &tableModelIndex) { + selectProductType(tableModelIndex); + CREATE_INDEX(productTypeId, COLUMN::Products_ProductTypes_ProductTypeId); + auto valueProductTypeId = + m_tableModel->record(tableModelIndex.row()).value(productTypeId).toInt(); + m_tableModel->setQuery( + SqlScript::sameProductsJoinProductTypes(valueProductTypeId)); + emit changedTableWidgetModel(); +} + +void ProductsWidget::showDeleteProductTypeDialogWindow() { + SqlTreeNode *productTypeNode = + m_treeModel->getNode(m_treeView->currentIndex()); + QString &productTypeName = productTypeNode->data; + int recordIdentifier = int(productTypeNode->recordIdentifier); + // first check + if (SqlScript::doesProductExist(recordIdentifier)) { + QMessageBox::critical( + nullptr, tr("Removal is not possible"), + tr("There are products of product type \"%1\".\nIt is necessary to " + "remove these products to successfully complete the operation.") + .arg(productTypeName)); + return; + } + // second check + DeleteDialog deleteDialog(productTypeName); + deleteDialog.setTopText(tr("Product type name: \"%1\"").arg(productTypeName)); + if (deleteDialog.exec() != QDialog::Accepted) + return; + SqlScript::deleteProductType(recordIdentifier); + auto *parent = productTypeNode->parent; + auto &outputNestedNodes = parent->nestedNodes; + auto &inputNestedNodes = productTypeNode->nestedNodes; + + m_treeModel->beginUpdate(); + std::for_each( // change parent + inputNestedNodes.begin(), inputNestedNodes.end(), + [parent](const std::unique_ptr> &node) { + node->parent = parent; + }); + outputNestedNodes.insert( + outputNestedNodes.end(), // insert with move new nested nodes + std::make_move_iterator(inputNestedNodes.begin()), + std::make_move_iterator(inputNestedNodes.end())); + parent->remove(productTypeNode); + m_treeModel->endUpdate(); + // Don't refresh table view +} + +void ProductsWidget::showRenameProductTypeDialogWindow() { + auto currentModelIndex = m_treeView->currentIndex(); + SqlTreeNode *productTypeNode = + m_treeModel->getNode(currentModelIndex); + QString &productTypeName = productTypeNode->data; + RenameDialog renameDialog(productTypeName); + renameDialog.setWindowTitle(tr("Renaming process")); + renameDialog.setTopText(tr("Product type name: \"%1\"").arg(productTypeName)); + if (renameDialog.exec() != QDialog::Accepted) + return; + QString newValue = renameDialog.newValue(); + SqlScript::renameProductType(int(productTypeNode->recordIdentifier), + newValue); + m_treeModel->beginUpdate(); + productTypeName = newValue; + m_treeModel->endUpdate(); + // Don't refresh table view +} + +void ProductsWidget::showAddProductTypeDialogWindow() { + auto currentTreeItem = m_treeView->currentIndex(); + SqlTreeNode *productTypeNode = m_treeModel->getNode(currentTreeItem); + AddProductTypeDialog addProductTypeDialog(productTypeNode); + addProductTypeDialog.setWindowTitle(tr("Creating a new type of product")); + addProductTypeDialog.setTopText( + tr("Execution of the operation for the product type \"%1\"") + .arg(productTypeNode->data)); + if (addProductTypeDialog.exec() != QDialog::Accepted) + return; + const QString &futureTypeName = addProductTypeDialog.futureTypeName(); + int productTypeId = int(productTypeNode->recordIdentifier); + + QModelIndex insertedItem; + if (addProductTypeDialog.lastCase() /*is good case?*/) { + insertedItem = + m_treeModel->insertProductType(productTypeId, futureTypeName); + } else { /*no, it's not*/ + const QString ¤tTypeName = addProductTypeDialog.currentTypeName(); + m_treeModel->specifyProductType(productTypeId, + currentTypeName); // first call + insertedItem = + m_treeModel->insertProductType(productTypeId, + futureTypeName); // second call + } + m_treeView->setCurrentIndex(insertedItem); + m_treeView->expand(currentTreeItem); +} + +void ProductsWidget::showAllProducts() { + m_treeView->setCurrentIndex(QModelIndex()); // signal sould not emit + m_tableModel->setQuery(SqlScript::productsJoinProductTypes()); + emit changedTableWidgetModel(); +} + +void ProductsWidget::showRenameProductDialogWindow() { + QModelIndex currentTreeItem = m_tableView->currentIndex(); + auto record = m_tableModel->record(currentTreeItem.row()); + CREATE_INDEX(indexProductName, COLUMN::Products_ProductTypes_ProductName); + CREATE_INDEX(indexProductId, COLUMN::Products_ProductTypes_ProductId); + const QString &productName = record.value(indexProductName).toString(); + int productId = record.value(indexProductId).toUInt(); + + RenameDialog renameDialog(productName); + renameDialog.setWindowTitle(tr("Renaming process")); + renameDialog.setTopText(tr("Product name: \"%1\"").arg(productName)); + if (renameDialog.exec() != QDialog::Accepted) + return; + const QString &newProductName = renameDialog.newValue(); + if (SqlScript::doesProductTypeExist(newProductName)) { + QMessageBox::critical(nullptr, tr("Renaming is not possible"), + tr("There is already a product \"%1\".\n" + "Another name must be specified.") + .arg(newProductName)); + return; + } + SqlScript::renameProduct(std::move(productId), std::move(newProductName)); + refreshTableModel(); +} + +void ProductsWidget::showEditProductDialogWindow() { + QModelIndex currentTreeItem = m_tableView->currentIndex(); + QSqlRecord record = m_tableModel->record(currentTreeItem.row()); + EditProductDialog editDialog(record); + if (editDialog.exec() == QDialog::Accepted) + refreshTableModel(); +} + +void ProductsWidget::showDeleteProductDialogWindow() { + QModelIndex currentProductIndex = m_tableView->currentIndex(); + auto record = m_tableModel->record(currentProductIndex.row()); + CREATE_INDEX(indexProductName, COLUMN::Products_ProductTypes_ProductName); + CREATE_INDEX(indexProductId, COLUMN::Products_ProductTypes_ProductId); + const QString &productName = record.value(indexProductName).toString(); + int productId = record.value(indexProductId).toUInt(); + + DeleteDialog deleteDialog(productName); + deleteDialog.setTopText(tr("Product name: \"%1\"").arg(productName)); + if (deleteDialog.exec() == QDialog::Accepted) { + auto query = SqlScript::deleteProduct(productId); + if (query.lastError().isValid()) { + QMessageBox::critical( + nullptr, tr("Removal is not possible"), + tr("The product \"%1\" is referenced by other database entries.\n" + "Deletion is not possible if these records exist.") + .arg(productName)); + return; + } + refreshTableModel(); + } +} + +void ProductsWidget::showAddProductDialogWindow() { + AddProductDialog addProductDialog; + if (addProductDialog.exec() == QDialog::Rejected) + return; + int productId = addProductDialog.insertedId(); + int productTypeId = SqlScript::productTypeId(productId); + auto productTypeNode = m_treeModel->getNode(productTypeId); + auto productTypeIndex = m_treeModel->getItemModelIndex(productTypeNode); + if (m_treeView->currentIndex().isValid()) + m_treeView->setCurrentIndex(productTypeIndex); + refreshTableModel(); + CREATE_INDEX(indexProductId, COLUMN::Products_ProductTypes_ProductId); + QModelIndex firstColumn = m_tableModel->index(0, indexProductId); + QModelIndexList match = + m_tableModel->match(firstColumn, Qt::DisplayRole, productId); + m_tableView->setCurrentIndex(match.back() /*rowIndex*/); + emit changedTableWidgetModel(); +} + +void ProductsWidget::updateTreePushButtonsPropertyEnabled() { + // product types + QModelIndex currentTreeItem = m_treeView->currentIndex(); + bool enabledTreeFlag = currentTreeItem.isValid(); + m_deleteProductType->setEnabled(enabledTreeFlag); + m_renameProductType->setEnabled(enabledTreeFlag); + m_addProductType->setEnabled(enabledTreeFlag); +} + +void ProductsWidget::updateTablePushButtonsPropertyEnabled() { + // products + QModelIndex currentTabeItem = m_tableView->currentIndex(); + bool enabledTabeFlag = currentTabeItem.isValid(); + m_deleteProduct->setEnabled(enabledTabeFlag); + m_renameProduct->setEnabled(enabledTabeFlag); + m_editProduct->setEnabled(enabledTabeFlag); +} + +void ProductsWidget::refreshTableView() { + bool isEmpty = m_tableModel->rowCount() == 0; + if (isEmpty ^ m_tableView->horizontalHeader()->isHidden()) + m_tableView->horizontalHeader()->setHidden(/*if table model*/ isEmpty); + if (isEmpty) + return; + + m_tableView->horizontalHeader()->setStretchLastSection(false); + m_tableView->resizeColumnsToContents(); + m_tableView->horizontalHeader()->setStretchLastSection(true); +} diff --git a/CoffeBeans/src/productswidget/productswidget.h b/CoffeBeans/src/productswidget/productswidget.h new file mode 100644 index 0000000..7e9ee0b --- /dev/null +++ b/CoffeBeans/src/productswidget/productswidget.h @@ -0,0 +1,87 @@ +#ifndef PRODUCTSWIDGET_H +#define PRODUCTSWIDGET_H + +#include "../databaseinfo/databaseinfo.h" + +#include + +#include + +#include + +#include + +#include + +template +class SqlTreeModel; + +class ProductsWidget : public QWidget { + Q_OBJECT + +private: + using SqlTreeModel = SqlTreeModel; + +private: + // tree + QLabel *m_treeLabel; + QTreeView *m_treeView; + SqlTreeModel *m_treeModel; + QWidget *m_treeWidget; + QPushButton *m_expandAll; + QPushButton *m_collapseAll; + QPushButton *m_deleteProductType; + QPushButton *m_renameProductType; + QPushButton *m_addProductType; + + // table + QLabel *m_tableLabel; + QTableView *m_tableView; + QSqlQueryModel *m_tableModel; + QWidget *m_tableWidget; + QPushButton *m_showAll; + QPushButton *m_deleteProduct; + QPushButton *m_renameProduct; + QPushButton *m_editProduct; + QPushButton *m_addProduct; + +private: + void createTreeWidget(); + void createTableWidget(); + void createLayout(); + void configureConnections(); + void configureDisplayedData(); + +private: + QModelIndex treeSelectedItem(); + +public: + explicit ProductsWidget(QWidget *parent = nullptr); + ~ProductsWidget(); + +private slots: + // product types + void showDeleteProductTypeDialogWindow(); + void showRenameProductTypeDialogWindow(); + void showAddProductTypeDialogWindow(); + void showSameGroup(const QModelIndex &treeModelIndex); + void updateTreePushButtonsPropertyEnabled(); + void selectProductType(const QModelIndex &tableModelIndex); + // products + void showAllProducts(); + void showRenameProductDialogWindow(); + void showEditProductDialogWindow(); + void showDeleteProductDialogWindow(); + void showAddProductDialogWindow(); + void refreshTableModel(); + void refreshTableView(); + void updateTablePushButtonsPropertyEnabled(); + +signals: + void changedTableWidgetModel(); +}; + +#endif // PRODUCTSWIDGET_H diff --git a/CoffeBeans/src/renamedialog/CMakeLists.txt b/CoffeBeans/src/renamedialog/CMakeLists.txt new file mode 100644 index 0000000..10329ae --- /dev/null +++ b/CoffeBeans/src/renamedialog/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 3.13) + +project(renamedialog) + +set(TARGET_NAME RenameDialog) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS REQUIRED Sql Widgets) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS REQUIRED Sql Widgets) + +add_library(${TARGET_NAME} + renamedialog.cpp + renamedialog.h + renamedialog.ui) + +target_link_libraries(${TARGET_NAME} PRIVATE + ColouredLineEdit + VerificationWidget) + +target_link_libraries(${TARGET_NAME} PRIVATE + Qt${QT_VERSION_MAJOR}::Sql + Qt${QT_VERSION_MAJOR}::Widgets) diff --git a/CoffeBeans/src/renamedialog/renamedialog.cpp b/CoffeBeans/src/renamedialog/renamedialog.cpp new file mode 100644 index 0000000..d08a6ff --- /dev/null +++ b/CoffeBeans/src/renamedialog/renamedialog.cpp @@ -0,0 +1,74 @@ +#include "renamedialog.h" + +#include "ui_renamedialog.h" + +#include "../verificationwidget/verificationwidget.h" + +#include + +#include + +void RenameDialog::done(int resultCode) { + if (QDialog::Accepted == resultCode) { + if (m_verificationWidget->inputVerified() == false) { + m_verificationWidget->noticeRed(); + m_verificationWidget->setFocus(); + QApplication::beep(); + return; + } else { + auto newValue = m_ui->m_newValueLineEdit->text().trimmed(); + m_ui->m_newValueLineEdit->setText(newValue); + if (newValue.isEmpty()) { + QString errorString(tr("No text is unacceptable")); + QSize frameSize = m_ui->m_newValueLineEdit->frameSize(); + QPoint point(frameSize.width() / 2.5, -frameSize.height() * 1.5); + QToolTip::showText(m_ui->m_newValueLineEdit->mapToGlobal(point), + errorString); + QApplication::beep(); + return; + } + } + } + QDialog::done(resultCode); + return; +} + +RenameDialog::RenameDialog(const QString &reference, QWidget *parent, + Qt::WindowFlags f) + : QDialog(parent, f), m_ui(new Ui::RenameDialog) { + m_ui->setupUi(this); + setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); + createWidgets(); + configureConnections(); + setReference(reference); +} + +RenameDialog::~RenameDialog() { delete m_ui; } + +void RenameDialog::createWidgets() { + m_verificationWidget = new VerificationWidget; + m_ui->m_verificationLayout->addWidget(m_verificationWidget); + m_verificationWidget->setFocus(); +} + +void RenameDialog::configureConnections() { + connect(m_verificationWidget, &VerificationWidget::benchmarkMatching, this, + &RenameDialog::toggleLineEditFocus); +} + +void RenameDialog::toggleLineEditFocus(bool checkPassed) { + if (!checkPassed) + return; + m_ui->m_newValueLineEdit->setEnabled(true); + m_ui->m_newValueLineEdit->setFocus(); +} + +void RenameDialog::setReference(const QString &reference) { + m_verificationWidget->setReference(reference); +} + +void RenameDialog::setTopText(const QString &value) { + m_ui->m_topLabel->setText(value); +} + +QString RenameDialog::newValue() { return m_ui->m_newValueLineEdit->text(); } diff --git a/CoffeBeans/src/renamedialog/renamedialog.h b/CoffeBeans/src/renamedialog/renamedialog.h new file mode 100644 index 0000000..1251086 --- /dev/null +++ b/CoffeBeans/src/renamedialog/renamedialog.h @@ -0,0 +1,40 @@ +#ifndef RENAMEDIALOG_H +#define RENAMEDIALOG_H + +#include + +#include + +namespace Ui { +class RenameDialog; +} + +class VerificationWidget; + +class RenameDialog : public QDialog { +private: + VerificationWidget *m_verificationWidget; + Ui::RenameDialog *m_ui; + +private: + void done(int resultCode) override; + +public: + RenameDialog(const QString &reference, QWidget *parent = nullptr, + Qt::WindowFlags f = Qt::WindowFlags()); + ~RenameDialog(); + +private: + void createWidgets(); + void configureConnections(); + +private: + void toggleLineEditFocus(bool checkPassed); + +public: + void setReference(const QString &reference); + void setTopText(const QString &value); + QString newValue(); +}; + +#endif // RENAMEDIALOG_H diff --git a/CoffeBeans/src/renamedialog/renamedialog.ui b/CoffeBeans/src/renamedialog/renamedialog.ui new file mode 100644 index 0000000..cf202da --- /dev/null +++ b/CoffeBeans/src/renamedialog/renamedialog.ui @@ -0,0 +1,117 @@ + + + RenameDialog + + + + 0 + 0 + 350 + 135 + + + + + 350 + 0 + + + + Dialog + + + + QLayout::SetFixedSize + + + + + + + + + + + + QFrame::StyledPanel + + + + + + 0 + + + + + + + + + Enter the new name: + + + + + + + false + + + + + + + + + + + + true + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Save + + + + + + + + + buttonBox + accepted() + RenameDialog + accept() + + + 227 + 183 + + + 157 + 198 + + + + + buttonBox + rejected() + RenameDialog + reject() + + + 295 + 189 + + + 286 + 198 + + + + + diff --git a/CoffeBeans/src/sqlqueryproductsmodel/CMakeLists.txt b/CoffeBeans/src/sqlqueryproductsmodel/CMakeLists.txt new file mode 100644 index 0000000..f267873 --- /dev/null +++ b/CoffeBeans/src/sqlqueryproductsmodel/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.13) + +project(sqlqueryproductsmodel) + +set(TARGET_NAME SqlQueryProductsModel) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS REQUIRED Sql Widgets) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS REQUIRED Sql Widgets) + +add_library(${TARGET_NAME} + sqlqueryproductsmodel.cpp + sqlqueryproductsmodel.h) + +target_link_libraries(${TARGET_NAME} PRIVATE + Qt${QT_VERSION_MAJOR}::Sql + Qt${QT_VERSION_MAJOR}::Widgets) + +target_link_libraries(${TARGET_NAME}) + + diff --git a/CoffeBeans/src/sqlqueryproductsmodel/sqlqueryproductsmodel.cpp b/CoffeBeans/src/sqlqueryproductsmodel/sqlqueryproductsmodel.cpp new file mode 100644 index 0000000..098860d --- /dev/null +++ b/CoffeBeans/src/sqlqueryproductsmodel/sqlqueryproductsmodel.cpp @@ -0,0 +1,16 @@ +#include "sqlqueryproductsmodel.h" + +#include "../databaseinfo/databaseinfo.h" + +SqlQueryProductsModel::SqlQueryProductsModel(QObject *parent) + : QSqlQueryModel(parent) {} + +QVariant SqlQueryProductsModel::data(const QModelIndex &item, int role) const { + auto data = QSqlQueryModel::data(item, role); + if (role == Qt::DisplayRole) { + CREATE_INDEX(barcodeIndex, COLUMN::Products_ProductTypes_Barcode); + if (item.column() == int(barcodeIndex)) + return data.toString().rightJustified(13, '0'); + } + return data; +} diff --git a/CoffeBeans/src/sqlqueryproductsmodel/sqlqueryproductsmodel.h b/CoffeBeans/src/sqlqueryproductsmodel/sqlqueryproductsmodel.h new file mode 100644 index 0000000..ffda6b5 --- /dev/null +++ b/CoffeBeans/src/sqlqueryproductsmodel/sqlqueryproductsmodel.h @@ -0,0 +1,15 @@ +#ifndef SQLQUERYPRODUCTSMODEL_H +#define SQLQUERYPRODUCTSMODEL_H + +#include + +class SqlQueryProductsModel : public QSqlQueryModel { +public: + SqlQueryProductsModel(QObject *parent = nullptr); + +public: + QVariant data(const QModelIndex &item, + int role = Qt::DisplayRole) const override; +}; + +#endif // SQLQUERYPRODUCTSMODEL_H diff --git a/CoffeBeans/src/sqlscript/CMakeLists.txt b/CoffeBeans/src/sqlscript/CMakeLists.txt new file mode 100644 index 0000000..6c86e3a --- /dev/null +++ b/CoffeBeans/src/sqlscript/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.13) + +project(sqlscript) + +set(TARGET_NAME SqlScript) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS REQUIRED Sql Widgets) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS REQUIRED Sql Widgets) + +add_library(${TARGET_NAME} + sqlscript.cpp + sqlscript.h) + +target_link_libraries(${TARGET_NAME} PRIVATE + Qt${QT_VERSION_MAJOR}::Sql + Qt${QT_VERSION_MAJOR}::Widgets) + +target_link_libraries(${TARGET_NAME}) + + diff --git a/CoffeBeans/src/sqlscript/sqlscript.cpp b/CoffeBeans/src/sqlscript/sqlscript.cpp new file mode 100644 index 0000000..f420fd1 --- /dev/null +++ b/CoffeBeans/src/sqlscript/sqlscript.cpp @@ -0,0 +1,246 @@ +#include "sqlscript.h" + +#include + +#include + +#include + +#include + +int SqlScript::specifyProductType(int productTypeId, + const QString &productTypeName) { + auto query = QSqlQuery(QSqlDatabase::database()); + query.prepare("EXECUTE [Procedures].[specify_product_type]" + ":productTypeId, :productTypeName;"); + query.bindValue(":productTypeId", productTypeId); + query.bindValue(":productTypeName", productTypeName); + query.exec(); + return query.lastInsertId().toInt(); +} +int SqlScript::insertProductType(int productTypeId, + const QString &productTypeName) { + auto query = QSqlQuery(QSqlDatabase::database()); + query.prepare("EXECUTE [Procedures].[insert_product_type]" + ":productTypeId, :productTypeName;"); + query.bindValue(":productTypeId", productTypeId); + query.bindValue(":productTypeName", productTypeName); + query.exec(); + return query.lastInsertId().toInt(); +} + +void SqlScript::deleteProductType(int productTypeId) { + auto query = QSqlQuery(QSqlDatabase::database()); + query.prepare("EXECUTE [Procedures].[delete_product_type] :productTypeId;"); + query.bindValue(":productTypeId", productTypeId); + query.exec(); +} + +bool SqlScript::doesBarcodeExist(long long barcode) { + auto query = QSqlQuery(QSqlDatabase::database()); + query.prepare("SELECT [Functions].[does_barcode_exist](:value);"); + query.bindValue(":value", barcode); + query.exec(); + query.next(); + return query.value(0).toBool(); +} + +bool SqlScript::doesProductTypeExist(const QString &typeName) { + auto query = QSqlQuery(QSqlDatabase::database()); + query.prepare( + "SELECT [Functions].[does_product_exist_with_name](:typeName);"); + query.bindValue(":typeName", typeName); + query.exec(); + query.next(); + return query.value(0).toBool(); +} + +void SqlScript::renameProductType(int productTypeId, + const QString &productTypeName) { + auto query = QSqlQuery(QSqlDatabase::database()); + query.prepare("EXECUTE [Procedures].[rename_product_type]" + ":productTypeId, :productTypeName;"); + query.bindValue(":productTypeId", productTypeId); + query.bindValue(":productTypeName", productTypeName); + query.exec(); +} + +bool SqlScript::doesProductExist(int productTypeId) { + auto query = QSqlQuery(QSqlDatabase::database()); + query.prepare( + "SELECT" + "[Functions].[does_product_exist_with_product_type_id](:productTypeId);"); + query.bindValue(":productTypeId", productTypeId); + query.exec(); + query.next(); + return query.value(0).toBool(); +} + +bool SqlScript::doesProductExist(const QString &productName) { + auto query = QSqlQuery(QSqlDatabase::database()); + query.prepare( + "SELECT [Functions].[does_product_exist_with_name](:productName);"); + query.bindValue(":productName", productName); + query.exec(); + query.next(); + return query.value(0).toBool(); +} + +QSqlQuery SqlScript::subgroupsProductsJoinProductTypes(int productTypeId) { + auto query = QSqlQuery(QSqlDatabase::database()); + query.prepare( + "SELECT * FROM" + "[Functions].[subgroup_products_join_product_types](:productTypeId);"); + query.bindValue(":productTypeId", productTypeId); + query.exec(); + return query; +} + +QSqlQuery SqlScript::sameProductsJoinProductTypes(int productTypeId) { + auto query = QSqlQuery(QSqlDatabase::database()); + query.prepare( + "SELECT * FROM " + "[Functions].[same_products_join_product_types](:productTypeId);"); + query.bindValue(":productTypeId", productTypeId); + query.exec(); + return query; +} + +QSqlQuery SqlScript::productsJoinProductTypes() { + auto queryText = + QString("EXECUTE [Procedures].[products_join_product_types];"); + return QSqlQuery(queryText, QSqlDatabase::database()); +} + +int SqlScript::productTypeId(int productId) { + auto query = QSqlQuery(QSqlDatabase::database()); + query.prepare("SELECT [Functions].[product_type_id](:productId);"); + query.bindValue(":productId", productId); + query.exec(); + query.next(); + return query.value(0).toInt(); +} + +void SqlScript::updateBarcode(int productId, long long barcode) { + auto query = QSqlQuery(QSqlDatabase::database()); + query.prepare("EXECUTE [Procedures].[update_barcode] :productId, :barcode;"); + query.bindValue(":productId", productId); + query.bindValue(":barcode", barcode); + query.exec(); +} + +void SqlScript::renameProduct(int productId, const QString &productName) { + auto query = QSqlQuery(QSqlDatabase::database()); + query.prepare( + "EXECUTE [Procedures].[rename_product] :productId, :productName;"); + query.bindValue(":productId", productId); + query.bindValue(":productName", productName); + query.exec(); +} + +int SqlScript::insertProduct(const QString &name, int productTypId, + long long barcode) { + auto query = QSqlQuery(QSqlDatabase::database()); + query.prepare("EXECUTE [Procedures].[insert_product]" + ":name, :productTypeId, :barcode, :insertedId;"); + query.bindValue(":name", name); + query.bindValue(":productTypeId", productTypId); + query.bindValue(":barcode", barcode); + query.bindValue(":insertedId", 0, QSql::Out); + query.exec(); + return query.boundValue(":insertedId").toInt(); +} + +void SqlScript::insertProductAttribute(int productId, int attributeId) { + auto query = QSqlQuery(QSqlDatabase::database()); + query.prepare("EXECUTE [Procedures].[insert_product_attribute]" + ":productId, :attributeId;"); + query.bindValue(":productId", productId); + query.bindValue(":attributeId", attributeId); + query.exec(); +} + +void SqlScript::insertProductValue(int productId, int attributeId, + const QVariant &value) { + auto query = QSqlQuery(QSqlDatabase::database()); + query.prepare("EXECUTE [Procedures].[insert_product_value] :productId, " + ":attributeId, :value;"); + query.bindValue(":productId", productId); + query.bindValue(":attributeId", attributeId); + query.bindValue(":value", value); + query.exec(); +} + +QSqlQuery SqlScript::deleteProduct(int productId) { + auto query = QSqlQuery(QSqlDatabase::database()); + query.prepare("EXECUTE [Procedures].[delete_product] :productId;"); + query.bindValue(":productId", productId); + query.exec(); + return query; +} + +QSqlQuery SqlScript::select(TableType table) { + auto tableName = NAME(table); + ASSERT_NAME(tableName); + + auto queryText = QString("SELECT * FROM [Tables].[%1];").arg(tableName); + + return QSqlQuery(queryText, QSqlDatabase::database()); +} + +QSqlQuery SqlScript::selectValue(int recordId, ColumnType columnId, + ColumnType columnValue, TableType table) { + auto tableName = NAME(table); + ASSERT_NAME(tableName); + + auto columnIdName = NAME(columnId); + ASSERT_NAME(columnIdName); + + auto columnValueName = NAME(columnValue); + ASSERT_NAME(columnValueName); + + auto queryText = + QString("SELECT [%1].[%2] FROM [Tables].[%1] WHERE [%3] = %4;") + .arg(tableName, columnValueName, columnIdName) + .arg(recordId); + + return QSqlQuery(queryText, QSqlDatabase::database()); +} + +template +QSqlQuery SqlScript::selectOrderBy(const QString &tableName, + const Container &columns) { + auto queryText = + QString("SELECT * FROM [Tables].[%1] ORDER BY").arg(tableName); + constexpr const char *modification = + std::is_integral_v ? " %1," : " [%1],"; + + for (const auto &column : columns) + queryText = queryText.append(modification).arg(column); + queryText.chop(1); // last comma + return QSqlQuery(queryText, QSqlDatabase::database()); +} + +QSqlQuery SqlScript::selectOrderBy(TableType table, ColumnType column) { + auto tableName = NAME(table); + ASSERT_NAME(tableName); + + auto columnIndex = INDEX(column); + ASSERT_INDEX(columnIndex); + + return selectOrderBy(tableName, {columnIndex}); +} + +QSqlQuery SqlScript::selectOrderBy(TableType table, ColumnType column1, + ColumnType column2) { + auto tableName = NAME(table); + ASSERT_NAME(tableName); + + auto column1Index = INDEX(column1); + ASSERT_INDEX(column1Index); + + auto column2Index = INDEX(column2); + ASSERT_INDEX(column2Index); + + return selectOrderBy(tableName, {column1Index, column2Index}); +} diff --git a/CoffeBeans/src/sqlscript/sqlscript.h b/CoffeBeans/src/sqlscript/sqlscript.h new file mode 100644 index 0000000..851b195 --- /dev/null +++ b/CoffeBeans/src/sqlscript/sqlscript.h @@ -0,0 +1,62 @@ +#ifndef SQLSCRIPT_H +#define SQLSCRIPT_H + +#include "../databaseinfo/databaseinfo.h" + +#include + +#include + +#include + +class SqlScript { +public: + SqlScript() = delete; + ~SqlScript() = delete; + +public: + using TableType = DatabaseInfo::Table; + using ColumnType = DatabaseInfo::Column; + +public: + static QSqlQuery lastTableQuery() noexcept; + +public: // product types + static bool doesBarcodeExist(long long barcode); + static bool doesProductTypeExist(const QString &typeName); + static void renameProductType(int productTypeId, const QString &typeName); + static int specifyProductType(int productTypeId, const QString &typeName); + static int insertProductType(int productTypeId, const QString &typeName); + static void deleteProductType(int productTypeId); + +public: // products + static bool doesProductExist(const QString &productName); + static bool doesProductExist(int productTypeId); + static void updateBarcode(int productId, long long barcode); + static void renameProduct(int productId, const QString &productName); + static int insertProduct(const QString &name, int productTypId, + long long barcode); + static void insertProductAttribute(int productId, int attributeId); + static void insertProductValue(int productId, int attributeId, + const QVariant &value); + static QSqlQuery deleteProduct(int productId); + static QSqlQuery subgroupsProductsJoinProductTypes(int productTypeId); + static QSqlQuery sameProductsJoinProductTypes(int productTypeId); + static QSqlQuery productsJoinProductTypes(); + +public: + static int productTypeId(int productId); + +public: + template > + static QSqlQuery selectOrderBy(const QString &tableName, + const Container &args); + QSqlQuery selectOrderBy(TableType table, ColumnType column); + QSqlQuery selectOrderBy(TableType table, ColumnType column1, + ColumnType column2); + static QSqlQuery select(TableType table); + static QSqlQuery selectValue(int recordId, ColumnType columnId, + ColumnType columnValue, TableType table); +}; + +#endif // SQLSCRIPT_H diff --git a/CoffeBeans/src/sqltablenoticedelegate/CMakeLists.txt b/CoffeBeans/src/sqltablenoticedelegate/CMakeLists.txt new file mode 100644 index 0000000..d36a096 --- /dev/null +++ b/CoffeBeans/src/sqltablenoticedelegate/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.13) + +project(sqltablenoticedelegate) + +set(TARGET_NAME SqlTableNoticeDelegate) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS REQUIRED Sql Widgets) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS REQUIRED Sql Widgets) + +add_library(${TARGET_NAME} + sqltablenoticedelegate.cpp + sqltablenoticedelegate.h) + +target_link_libraries(${TARGET_NAME} PRIVATE + Qt${QT_VERSION_MAJOR}::Sql + Qt${QT_VERSION_MAJOR}::Widgets) + +target_link_libraries(${TARGET_NAME}) + + diff --git a/CoffeBeans/src/sqltablenoticedelegate/sqltablenoticedelegate.cpp b/CoffeBeans/src/sqltablenoticedelegate/sqltablenoticedelegate.cpp new file mode 100644 index 0000000..b878121 --- /dev/null +++ b/CoffeBeans/src/sqltablenoticedelegate/sqltablenoticedelegate.cpp @@ -0,0 +1,69 @@ +#include "sqltablenoticedelegate.h" + +#include "../databaseinfo/databaseinfo.h" + +#include "../sqlscript/sqlscript.h" + +#include + +#include + +#include + +#include + +#include + +SqlTableNoticeDelegate::SqlTableNoticeDelegate(QObject *parent) + : QStyledItemDelegate(parent) {} + +void SqlTableNoticeDelegate::refreshPainter(QPainter *painter, + const QRect &rect, + const QColor &borderColor) const { + QColor background = + qApp->palette("QTableView").color(QPalette::ColorRole::Background); + background.setAlpha(0); + QLinearGradient gradientRight(rect.topLeft(), rect.topRight()); + QLinearGradient gradientBottom(rect.topLeft(), rect.bottomLeft()); + QLinearGradient gradientLeft(rect.topRight(), rect.topLeft()); + QLinearGradient gradientTop(rect.bottomLeft(), rect.topLeft()); + for (auto *gradient : + {&gradientRight, &gradientBottom, &gradientLeft, &gradientTop}) { + gradient->setColorAt(0, background); + gradient->setColorAt(1, borderColor); + } + double thickPercent = 2.0; + double thickVertical = 1.0 - thickPercent / rect.width(); + double thickHorizontal = 1.0 - thickPercent / rect.height(); + gradientRight.setColorAt(thickVertical, background); + gradientLeft.setColorAt(thickVertical, background); + gradientBottom.setColorAt(thickHorizontal, background); + gradientTop.setColorAt(thickHorizontal, background); + + painter->save(); + painter->fillRect(rect, gradientRight); + painter->fillRect(rect, gradientLeft); + painter->fillRect(rect, gradientTop); + painter->fillRect(rect, gradientBottom); + painter->restore(); +} + +void SqlTableNoticeDelegate::paint(QPainter *painter, + const QStyleOptionViewItem &option, + const QModelIndex &index) const { + auto model = static_cast(index.model()); + if (model->isDirty(index)) { + QColor borderColor = QColor::fromHsvF(30.0 / 360.0, 0.5, 1.0); + refreshPainter(painter, option.rect, borderColor); + QStyledItemDelegate::paint(painter, option, index); + return; + } + if (index.data().isNull()) { + QColor borderColor = QColor::fromHsvF(0.0, 0.5, 1.0); + refreshPainter(painter, option.rect, borderColor); + QStyledItemDelegate::paint(painter, option, index); + return; + } + QStyledItemDelegate::paint(painter, option, index); + return; +} diff --git a/CoffeBeans/src/sqltablenoticedelegate/sqltablenoticedelegate.h b/CoffeBeans/src/sqltablenoticedelegate/sqltablenoticedelegate.h new file mode 100644 index 0000000..d8a9745 --- /dev/null +++ b/CoffeBeans/src/sqltablenoticedelegate/sqltablenoticedelegate.h @@ -0,0 +1,19 @@ +#ifndef SQLTABLENOTICEDELEGATE_H +#define SQLTABLENOTICEDELEGATE_H + +#include + +class SqlTableNoticeDelegate : public QStyledItemDelegate { +public: + explicit SqlTableNoticeDelegate(QObject *parent = nullptr); + +private: + void refreshPainter(QPainter *painter, const QRect &rect, + const QColor &borderColor) const; + +public: + void paint(QPainter *painter, const QStyleOptionViewItem &option, + const QModelIndex &index) const override; +}; + +#endif // SQLTABLENOTICEDELEGATE_H diff --git a/CoffeBeans/src/sqltreemodel/CMakeLists.txt b/CoffeBeans/src/sqltreemodel/CMakeLists.txt new file mode 100644 index 0000000..c225b91 --- /dev/null +++ b/CoffeBeans/src/sqltreemodel/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.13) + +project(sqltreemodel) + +set(TARGET_NAME SqlTreeModel) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS REQUIRED Widgets) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS REQUIRED Widgets) + +add_library(${TARGET_NAME} INTERFACE) + +target_link_libraries(${TARGET_NAME} INTERFACE + Qt${QT_VERSION_MAJOR}::Widgets) + + + diff --git a/CoffeBeans/src/sqltreemodel/sqltreemodel.h b/CoffeBeans/src/sqltreemodel/sqltreemodel.h new file mode 100644 index 0000000..ccb1ad6 --- /dev/null +++ b/CoffeBeans/src/sqltreemodel/sqltreemodel.h @@ -0,0 +1,46 @@ +#ifndef SQLTREEMODEL_H +#define SQLTREEMODEL_H + +#include "../virtualsqltreenodeadapter/virtualsqltreenodeadapter.h" + +#include "../virtualtreemodel/virtualtreemodel.h" + +#include + +template +class SqlTreeModel : public VirtualTreeModel { +public: +private: + using SqlTreeNode = SqlTreeNode; + using VirtualSqlTreeNodeAdapter = VirtualSqlTreeNodeAdapter; + using IdType = size_t; + +private: + QString m_tableName; + SqlTreeNode m_root; + std::map m_nodes; + VirtualSqlTreeNodeAdapter m_adapter; + +public: + explicit SqlTreeModel(QObject *parent = nullptr); + explicit SqlTreeModel(QString tableName, QObject *parent = nullptr); + ~SqlTreeModel(); + +public: + SqlTreeNode *getNode(const QModelIndex &index); + SqlTreeNode *getNode(IdType productTypeId); + +public: + QModelIndex insertProductType(int productTypeId, const QString &newTypeName); + void selectFromTable(const QString &tableName); + void specifyProductType(int productTypeId, const QString &newTypeName); + void renameProductType(int productTypeId, const QString &newTypeName); + +private: + SqlTreeNode *currentNode(); +}; + +#include "sqltreemodel.tpp" + +#endif // SQLTREEMODEL_H diff --git a/CoffeBeans/src/sqltreemodel/sqltreemodel.tpp b/CoffeBeans/src/sqltreemodel/sqltreemodel.tpp new file mode 100644 index 0000000..c1b3503 --- /dev/null +++ b/CoffeBeans/src/sqltreemodel/sqltreemodel.tpp @@ -0,0 +1,121 @@ +#ifndef SQLTREEMODEL_HPP +#define SQLTREEMODEL_HPP + +#include "sqltreemodel.h" + +#include "../sqlscript/sqlscript.h" + +#include + +#include + +#include + +#define SQLTREEMODEL_TEMPLATE \ + template + +#define SQLTREEMODEL_CLASS \ + SqlTreeModel + +SQLTREEMODEL_TEMPLATE +inline SQLTREEMODEL_CLASS::SqlTreeModel(QObject *parent) + : VirtualTreeModel(nullptr, parent), m_adapter(m_root) { + ASSERT_INDEX(idColumnIndex); + ASSERT_INDEX(parentIdColumnIndex); + ASSERT_INDEX(dataColumnIndex); + // initialize VirtualTreeModel's adapter after VirtualNodeAdapter + setModelAdapter(&m_adapter); +} + +SQLTREEMODEL_TEMPLATE +inline SQLTREEMODEL_CLASS::SqlTreeModel(QString tableName, QObject *parent) + : SqlTreeModel(parent) { + selectFromTable(tableName); +} + +SQLTREEMODEL_TEMPLATE +inline SQLTREEMODEL_CLASS::~SqlTreeModel() {} + +SQLTREEMODEL_TEMPLATE +inline typename SQLTREEMODEL_CLASS::SqlTreeNode * +SQLTREEMODEL_CLASS::getNode(const QModelIndex &index) { + return m_adapter.getValue(getItem(index)); +} + +SQLTREEMODEL_TEMPLATE +inline typename SQLTREEMODEL_CLASS::SqlTreeNode * +SQLTREEMODEL_CLASS::getNode(IdType productTypeId) { + const auto searchResult = m_nodes.find(productTypeId); + return searchResult == m_nodes.end() ? nullptr : searchResult->second; +} + +SQLTREEMODEL_TEMPLATE +inline void SQLTREEMODEL_CLASS::selectFromTable(const QString &tableName) { + m_tableName = tableName; + + std::vector columnNumbers{parentIdColumnIndex + 1, idColumnIndex + 1}; + auto select = SqlScript::selectOrderBy(tableName, columnNumbers); + if (select.isActive()) { + queuedUpdate(); + std::for_each(m_root.nestedNodes.begin(), m_root.nestedNodes.end(), + [this](const auto &value) { m_root.remove(value.get()); }); + + m_nodes.clear(); + beginUpdate(); + while (select.next()) { + int parentId = select.value(parentIdColumnIndex).toInt(); + if (parentId > idColumnIndex) + break; + auto id = select.value(idColumnIndex).value(); + auto *newNode = m_root.createFront( + id, select.value(dataColumnIndex).value()); + m_nodes.insert({id, newNode}); + } + + if (select.isValid()) + do { + int id = select.value(idColumnIndex).toInt(); + int parentId = select.value(parentIdColumnIndex).toInt(); + auto *newNode = m_nodes[parentId]->createFront( + id, select.value(dataColumnIndex).value()); + m_nodes.insert({id, newNode}); + } while (select.next()); + endUpdate(); + } +} + +SQLTREEMODEL_TEMPLATE +QModelIndex SQLTREEMODEL_CLASS::insertProductType(int productTypeId, + const QString &newTypeName) { + int lastInsertId = SqlScript::insertProductType(productTypeId, newTypeName); + SqlTreeNode *node = getNode(productTypeId); + beginUpdate(); + SqlTreeNode *newNode = node->createFront(lastInsertId, newTypeName); + m_nodes.insert({lastInsertId, newNode}); + endUpdate(); + return getItemModelIndex(newNode); +} + +SQLTREEMODEL_TEMPLATE +void SQLTREEMODEL_CLASS::specifyProductType(int productTypeId, + const QString &newTypeName) { + int lastInsertId = SqlScript::specifyProductType(productTypeId, newTypeName); + SqlTreeNode *node = getNode(productTypeId); + beginUpdate(); + SqlTreeNode *newNode = node->createBack(lastInsertId, newTypeName); + m_nodes.insert({lastInsertId, newNode}); + endUpdate(); +} + +SQLTREEMODEL_TEMPLATE +void SQLTREEMODEL_CLASS::renameProductType(int productTypeId, + const QString &newTypeName) { + SqlScript::renameProductType(productTypeId, newTypeName); + SqlTreeNode *node = getNode(productTypeId); + beginUpdate(); + node->data = newTypeName; + endUpdate(); +} + +#endif // SQLTREEMODEL_HPP diff --git a/CoffeBeans/src/sqltreenode/CMakeLists.txt b/CoffeBeans/src/sqltreenode/CMakeLists.txt new file mode 100644 index 0000000..48ff83a --- /dev/null +++ b/CoffeBeans/src/sqltreenode/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.13) + +project(sqltreenode) + +set(TARGET_NAME SqlTreeNode) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS REQUIRED Sql Widgets) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS REQUIRED Sql Widgets) + +add_library(${TARGET_NAME} INTERFACE) + +target_link_libraries(${TARGET_NAME} INTERFACE + Qt${QT_VERSION_MAJOR}::Sql + Qt${QT_VERSION_MAJOR}::Widgets) + + diff --git a/CoffeBeans/src/sqltreenode/sqltreenode.h b/CoffeBeans/src/sqltreenode/sqltreenode.h new file mode 100644 index 0000000..b41a508 --- /dev/null +++ b/CoffeBeans/src/sqltreenode/sqltreenode.h @@ -0,0 +1,50 @@ +#ifndef SQLTREENODE_H +#define SQLTREENODE_H + +#include + +#include + +#include + +#include + +#include + +// bi-directional node +// the way back is realized + +template +struct SqlTreeNode { +public: + const size_t recordIdentifier; + DataType data; + SqlTreeNode *parent; + //std::unique_ptr>> nestedNodes; + std::vector> nestedNodes; + +public: + explicit SqlTreeNode(); +// explicit SqlTreeNode(SqlTreeNode &&other); + explicit SqlTreeNode(const SqlTreeNode &other) = delete; + + explicit SqlTreeNode(SqlTreeNode *parent, size_t recordIdentifier, + const DataType &data); + explicit SqlTreeNode(SqlTreeNode *parent, size_t recordIdentifier, + DataType &&data); + +public: + template >>::value>> + SqlTreeNode *createFront(size_t recordIdentifier, T &&newNodeData); + template >>::value>> + SqlTreeNode *createBack(size_t recordIdentifier, T &&newNodeData); + void remove(SqlTreeNode *node); +}; + +#include "sqltreenode.tpp" + +#endif // SQLTREENODE_H diff --git a/CoffeBeans/src/sqltreenode/sqltreenode.tpp b/CoffeBeans/src/sqltreenode/sqltreenode.tpp new file mode 100644 index 0000000..f0ca37e --- /dev/null +++ b/CoffeBeans/src/sqltreenode/sqltreenode.tpp @@ -0,0 +1,64 @@ +#ifndef SQLTREENODE_HPP +#define SQLTREENODE_HPP + +#include "../sqltreenode/sqltreenode.h" + +template +// zero in recordIdentifier - nonexistent record +inline SqlTreeNode::SqlTreeNode() + : recordIdentifier(0), parent(nullptr) {} + +// template +// SqlTreeNode::SqlTreeNode(SqlTreeNode &&other) : SqlTreeNode() { +// other.parent = this; +// nestedNodes.push_back(std::move(other)); +// } + +template +inline SqlTreeNode::SqlTreeNode(SqlTreeNode *_parent, + size_t _recordIdentifier, + const DataType &_data) + : parent(_parent), recordIdentifier(_recordIdentifier), data(_data) {} + +template +inline SqlTreeNode::SqlTreeNode(SqlTreeNode *_parent, + size_t _recordIdentifier, + DataType &&_data) + : parent(_parent), recordIdentifier(_recordIdentifier), data(_data) {} + +template +template +SqlTreeNode * +SqlTreeNode::createFront(size_t recordIdentifier, + T &&newSqlTreeNodeData) { + auto *newNode = new struct SqlTreeNode(this, recordIdentifier, + std::forward(newSqlTreeNodeData)); + nestedNodes.emplace_back(newNode); + return newNode; +} +template +template +SqlTreeNode * +SqlTreeNode::createBack(size_t recordIdentifier, + T &&newSqlTreeNodeData) { + auto *newNode = new struct SqlTreeNode(this, recordIdentifier, + std::forward(newSqlTreeNodeData)); + // passing on the inheritance to a descendant + auto &nestedNodesNewNode = newNode->nestedNodes; + std::copy(std::make_move_iterator(nestedNodes.begin()), + std::make_move_iterator(nestedNodes.end()), + std::inserter(nestedNodesNewNode, nestedNodesNewNode.end())); + // making a descendant + nestedNodes.emplace_back(newNode); + return newNode; +} + +template +inline void SqlTreeNode::remove(SqlTreeNode *node) { + auto it = std::find_if( + nestedNodes.begin(), nestedNodes.end(), + [&](std::unique_ptr &p) { return p.get() == node; }); + nestedNodes.erase(it); +} + +#endif // SQLTREENODE_HPP diff --git a/CoffeBeans/src/stylesheethandler/CMakeLists.txt b/CoffeBeans/src/stylesheethandler/CMakeLists.txt new file mode 100644 index 0000000..1426fc9 --- /dev/null +++ b/CoffeBeans/src/stylesheethandler/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.13) + +project(stylesheethandler) + +set(TARGET_NAME StyleSheetHandler) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS REQUIRED Widgets) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS REQUIRED Widgets) + +add_library(${TARGET_NAME} + stylesheethandler.cpp + stylesheethandler.h) + +target_link_libraries(${TARGET_NAME} PRIVATE + Qt${QT_VERSION_MAJOR}::Widgets) diff --git a/CoffeBeans/src/stylesheethandler/stylesheethandler.cpp b/CoffeBeans/src/stylesheethandler/stylesheethandler.cpp new file mode 100644 index 0000000..6dd4f37 --- /dev/null +++ b/CoffeBeans/src/stylesheethandler/stylesheethandler.cpp @@ -0,0 +1,57 @@ +#include "stylesheethandler.h" + +#include + +#include + +#include + +QString StyleSheetHandler::find(const QString &styleSheet, + const QString &property, int index, + int &start, int &length) { + auto propertyPattern = QString("%1:.*?;").arg(property); + auto propertyMatch = QRegularExpression(propertyPattern).match(styleSheet); + auto capturePattern = + QString(R"(([^\s\d\w]{0,1}\w+))"); // [^\s\d\w] - punctuation category + auto captures = QRegularExpression(capturePattern) + .globalMatch(propertyMatch.captured(0), + property.length() + 1 /* ':' */); + if (index > 0) { + int captureIndex = 0; + while (++captureIndex <= index) + captures.next(); + } + auto value = captures.next(); + start = propertyMatch.capturedStart(0) + value.capturedStart(0); + length = value.capturedLength(0); + return value.captured(0); +} + +QVariant StyleSheetHandler::value(const QWidget *widget, + const QString &property, int index) { + if (widget == nullptr) + return QVariant(); + + int ignore; + QString styleSheet = widget->styleSheet(); + if (styleSheet.isEmpty()) + return QVariant(); + + QString result = find(styleSheet, property, index, ignore, ignore); + return QVariant::fromValue(result); +} + +void StyleSheetHandler::setValue(QWidget *widget, const QString &property, + int index, const QVariant &value) { + if (widget == nullptr) + return; + + int start, length; + QString styleSheet = widget->styleSheet(); + if (styleSheet.isEmpty()) + return; + + find(styleSheet, property, index, start, length); + styleSheet = styleSheet.replace(start, length, value.toString()); + widget->setStyleSheet(styleSheet); +} diff --git a/CoffeBeans/src/stylesheethandler/stylesheethandler.h b/CoffeBeans/src/stylesheethandler/stylesheethandler.h new file mode 100644 index 0000000..c6e74f6 --- /dev/null +++ b/CoffeBeans/src/stylesheethandler/stylesheethandler.h @@ -0,0 +1,24 @@ +#ifndef STYLESHEETHANDLER_H +#define STYLESHEETHANDLER_H + +#include + +#include + +class StyleSheetHandler { +public: + StyleSheetHandler() = delete; + ~StyleSheetHandler() = delete; + +private: + static QString find(const QString &styleSheet, const QString &property, int index, + int &start, int &length); + +public: + static QVariant value(const QWidget *widget, const QString &property, + int index); + static void setValue(QWidget *widget, const QString &property, + int index, const QVariant &value); +}; + +#endif // STYLESHEETHANDLER_H diff --git a/CoffeBeans/src/verificationwidget/CMakeLists.txt b/CoffeBeans/src/verificationwidget/CMakeLists.txt new file mode 100644 index 0000000..d86b3bf --- /dev/null +++ b/CoffeBeans/src/verificationwidget/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.13) + +project(verificationwidget) + +set(TARGET_NAME VerificationWidget) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS REQUIRED Widgets) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS REQUIRED Widgets) + +add_library(${TARGET_NAME} + verificationwidget.cpp + verificationwidget.h + verificationwidget.ui) + +target_link_libraries(${TARGET_NAME} PRIVATE + ColouredLineEdit) + +target_link_libraries(${TARGET_NAME} PRIVATE + Qt${QT_VERSION_MAJOR}::Widgets) diff --git a/CoffeBeans/src/verificationwidget/verificationwidget.cpp b/CoffeBeans/src/verificationwidget/verificationwidget.cpp new file mode 100644 index 0000000..296182c --- /dev/null +++ b/CoffeBeans/src/verificationwidget/verificationwidget.cpp @@ -0,0 +1,79 @@ +#include "verificationwidget.h" + +#include "ui_verificationwidget.h" + +#include "../colouredlineedit/colouredlineedit.h" + +#include + +VerificationWidget::VerificationWidget(QWidget *parent, LineEditFlag flags) + : QWidget(parent), m_inputVerified(false), + m_ui(new Ui::VerificationWidget) { + m_ui->setupUi(this); + createWidgets(); + configureConnections(); + setLineEditFlags(flags); +} + +VerificationWidget::~VerificationWidget() { delete m_ui; } + +void VerificationWidget::createWidgets() { + m_lineEdit = new ColouredLineEdit; + m_ui->m_mainLayout->addWidget(m_lineEdit); +} + +void VerificationWidget::configureConnections() { + connect(m_lineEdit, &QLineEdit::textEdited, this, + &VerificationWidget::checkWithEmit); +} + +void VerificationWidget::setReference(const QString &value) { + m_ui->m_referenceValueLabel->setText(value); +} + +void VerificationWidget::setOldValueEnterText(const QString &value) { + m_ui->m_oldValueEnterLabel->setText(value); +} + +void VerificationWidget::setFocus() { m_lineEdit->setFocus(); } + +void VerificationWidget::noticeRed() { m_lineEdit->notice(Qt::red); } + +void VerificationWidget::setLineEditFlags(LineEditFlag flags) { + m_lineEditFlags = flags; + m_luminousInvalidInput = m_lastLineEditFlag & LuminousAcceptableInput; +} + +bool VerificationWidget::checkWithEmit() { + const QString &reference = m_ui->m_referenceValueLabel->text(); + const QString &oldValue = m_lineEdit->text(); + m_inputVerified = !reference.isNull() && reference == oldValue; + handleLineEditClassFlags(m_inputVerified); + emit benchmarkMatching(m_inputVerified); + return m_inputVerified; +} + +void VerificationWidget::handleLineEditClassFlags(bool check) { + int mask = m_lastLineEditFlag; + while (mask > 0x00) { + if (m_lineEditFlags & mask) + switch (mask) { + case LineEditFlag::LockOnCorrectInput: { + if (check != true) + break; + m_lineEdit->clearFocus(); + m_lineEdit->setDisabled(true); + } break; + case LineEditFlag::NoticeOnAcceptableInput: { + if (check != true) + break; + m_lineEdit->notice(QColor(0xA0EF95), m_luminousAcceptableInput); + } break; + default: + break; + } + mask >>= 1; + } +} + +bool VerificationWidget::inputVerified() { return m_inputVerified; } diff --git a/CoffeBeans/src/verificationwidget/verificationwidget.h b/CoffeBeans/src/verificationwidget/verificationwidget.h new file mode 100644 index 0000000..6a80b9d --- /dev/null +++ b/CoffeBeans/src/verificationwidget/verificationwidget.h @@ -0,0 +1,65 @@ +#ifndef VERIFICATIONWIDGET_H +#define VERIFICATIONWIDGET_H + +#include + +#include + +namespace Ui { +class VerificationWidget; +} + +class ColouredLineEdit; + +class VerificationWidget : public QWidget { + Q_OBJECT + +public: + enum LineEditFlag : int { + LockOnCorrectInput = 0x01, + LuminousAcceptableInput = 0x02, + NoticeOnAcceptableInput = 0x04, + }; + static constexpr LineEditFlag lineEditFlag() noexcept { + auto result = + LuminousAcceptableInput | LockOnCorrectInput | NoticeOnAcceptableInput; + return static_cast(result); + } + +private: + static constexpr LineEditFlag m_lastLineEditFlag = NoticeOnAcceptableInput; + +private: + bool m_inputVerified; + bool m_luminousAcceptableInput; + bool m_luminousInvalidInput; + LineEditFlag m_lineEditFlags; + ColouredLineEdit *m_lineEdit; + Ui::VerificationWidget *m_ui; + +public: + explicit VerificationWidget(QWidget *parent = nullptr, + LineEditFlag flags = lineEditFlag()); + ~VerificationWidget(); + +private: + void createWidgets(); + void configureConnections(); + +private: + bool checkWithEmit(); + void handleLineEditClassFlags(bool check); + +public: + bool inputVerified(); + void setReference(const QString &value); + void setOldValueEnterText(const QString &value); + void setFocus(); + void noticeRed(); + void setLineEditFlags(LineEditFlag flags); + +signals: + void benchmarkMatching(bool); +}; + +#endif // VERIFICATIONWIDGET_H diff --git a/CoffeBeans/src/verificationwidget/verificationwidget.ui b/CoffeBeans/src/verificationwidget/verificationwidget.ui new file mode 100644 index 0000000..27fd504 --- /dev/null +++ b/CoffeBeans/src/verificationwidget/verificationwidget.ui @@ -0,0 +1,50 @@ + + + VerificationWidget + + + + 0 + 0 + 213 + 58 + + + + Form + + + + + + Entering the old value: + + + + + + + + Consolas + 12 + 50 + false + false + + + + QFrame::StyledPanel + + + + + + Qt::AlignCenter + + + + + + + + diff --git a/CoffeBeans/src/virtualmodeladapter/CMakeLists.txt b/CoffeBeans/src/virtualmodeladapter/CMakeLists.txt new file mode 100644 index 0000000..d2c218e --- /dev/null +++ b/CoffeBeans/src/virtualmodeladapter/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.13) + +project(virtualmodeladapter) + +set(TARGET_NAME VirtualModelAdapter) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS REQUIRED Widgets) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS REQUIRED Widgets) + +add_library(${TARGET_NAME} + virtualmodeladapter.cpp + virtualmodeladapter.h) + +target_link_libraries(${TARGET_NAME} PRIVATE + Qt${QT_VERSION_MAJOR}::Widgets) + +target_link_libraries(${TARGET_NAME} PRIVATE + VirtualModelInterface) diff --git a/CoffeBeans/src/virtualmodeladapter/virtualmodeladapter.cpp b/CoffeBeans/src/virtualmodeladapter/virtualmodeladapter.cpp new file mode 100644 index 0000000..d1944ed --- /dev/null +++ b/CoffeBeans/src/virtualmodeladapter/virtualmodeladapter.cpp @@ -0,0 +1,38 @@ +#include "virtualmodeladapter.h" + +#include "../virtualmodelinterface/virtualmodelinterface.h" + +int VirtualModelAdapter::indexOfItem(void *parent, void *item, int start) { + int count = getItemsCount(parent); + for (int i = start; i < count; ++i) + if (getItem(parent, i) == item) + return i; + return -1; +} + +bool VirtualModelAdapter::hasItems(void *parent) { + return getItemsCount(parent) > 0; +} + +void *VirtualModelAdapter::getItemParent(void *item) { return item; } + +void VirtualModelAdapter::beginUpdate() { + if (m_virtualModelInterface) + m_virtualModelInterface->beginUpdate(); +} + +void VirtualModelAdapter::endUpdate() { + if (m_virtualModelInterface) + m_virtualModelInterface->endUpdate(); +} + +void VirtualModelAdapter::queuedUpdate() { + if (m_virtualModelInterface) + m_virtualModelInterface->queuedUpdate(); +} + +void VirtualModelAdapter::setModel(VirtualModelInterface *virtualModel) { + m_virtualModelInterface = virtualModel; +} + +VirtualModelInterface *VirtualModelAdapter::getModel() { return m_virtualModelInterface; } diff --git a/CoffeBeans/src/virtualmodeladapter/virtualmodeladapter.h b/CoffeBeans/src/virtualmodeladapter/virtualmodeladapter.h new file mode 100644 index 0000000..7827dfa --- /dev/null +++ b/CoffeBeans/src/virtualmodeladapter/virtualmodeladapter.h @@ -0,0 +1,33 @@ +#ifndef VIRTUALMODELADAPTER_H +#define VIRTUALMODELADAPTER_H + +#include + +class VirtualModelInterface; + +class VirtualModelAdapter { +private: + VirtualModelInterface *m_virtualModelInterface; + +public: + VirtualModelInterface *getModel(); + void setModel(VirtualModelInterface *virtualModel); + +public: + void beginUpdate(); + void endUpdate(); + void queuedUpdate(); + +public: + virtual int getItemsCount(void *parent) = 0; + virtual void *getItem(void *parent, int index) = 0; + virtual QVariant data(void *item, int role) = 0; + + // reimplement if you can optimize them + virtual int indexOfItem(void *parent, void *item, int start = 0); + virtual bool hasItems(void *parent); + // needed to map item to QIndex by VirtualTreeModel::getItemIndex only + virtual void *getItemParent(void *item); +}; + +#endif // VIRTUALMODELADAPTER_H diff --git a/CoffeBeans/src/virtualmodelinterface/CMakeLists.txt b/CoffeBeans/src/virtualmodelinterface/CMakeLists.txt new file mode 100644 index 0000000..98e8e9a --- /dev/null +++ b/CoffeBeans/src/virtualmodelinterface/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.13) + +project(virtualmodelinterface) + +set(TARGET_NAME VirtualModelInterface) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +add_library(${TARGET_NAME} INTERFACE) diff --git a/CoffeBeans/src/virtualmodelinterface/virtualmodelinterface.h b/CoffeBeans/src/virtualmodelinterface/virtualmodelinterface.h new file mode 100644 index 0000000..0e64eb7 --- /dev/null +++ b/CoffeBeans/src/virtualmodelinterface/virtualmodelinterface.h @@ -0,0 +1,15 @@ +#ifndef VIRTUALMODELINTERFACE_H +#define VIRTUALMODELINTERFACE_H + +// link to VirtualTreeModel +class VirtualModelInterface { +public: + virtual ~VirtualModelInterface() = default; + +public: + virtual void beginUpdate() = 0; + virtual void endUpdate() = 0; + virtual void queuedUpdate() = 0; +}; + +#endif // VIRTUALMODELINTERFACE_H diff --git a/CoffeBeans/src/virtualmodelstubadapter/CMakeLists.txt b/CoffeBeans/src/virtualmodelstubadapter/CMakeLists.txt new file mode 100644 index 0000000..6cc9cbb --- /dev/null +++ b/CoffeBeans/src/virtualmodelstubadapter/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 3.13) + +project(virtualmodelstubadapter) + +set(TARGET_NAME VirtualModelStubAdapter) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS REQUIRED Widgets) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS REQUIRED Widgets) + +add_library(${TARGET_NAME} + virtualmodelstubadapter.cpp + virtualmodelstubadapter.h) + +include_directories(${INCLUDE_DIR}) + +target_link_libraries(${TARGET_NAME} PRIVATE + Qt${QT_VERSION_MAJOR}::Widgets) + +#target_link_libraries(${TARGET_NAME} PRIVATE) + + diff --git a/CoffeBeans/src/virtualmodelstubadapter/virtualmodelstubadapter.cpp b/CoffeBeans/src/virtualmodelstubadapter/virtualmodelstubadapter.cpp new file mode 100644 index 0000000..11b20c9 --- /dev/null +++ b/CoffeBeans/src/virtualmodelstubadapter/virtualmodelstubadapter.cpp @@ -0,0 +1,18 @@ +#include "virtualmodelstubadapter.h" + +int VirtualModelStubAdapter::getItemsCount(void *parent) { + Q_UNUSED(parent) + return 0; +} + +void *VirtualModelStubAdapter::getItem(void *parent, int index) { + Q_UNUSED(parent) + Q_UNUSED(index) + return nullptr; +} + +QVariant VirtualModelStubAdapter::data(void *item, int role) { + Q_UNUSED(item) + Q_UNUSED(role) + return QVariant(); +} diff --git a/CoffeBeans/src/virtualmodelstubadapter/virtualmodelstubadapter.h b/CoffeBeans/src/virtualmodelstubadapter/virtualmodelstubadapter.h new file mode 100644 index 0000000..38a83e2 --- /dev/null +++ b/CoffeBeans/src/virtualmodelstubadapter/virtualmodelstubadapter.h @@ -0,0 +1,13 @@ +#ifndef VIRTUALMODELSTUBADAPTER_H +#define VIRTUALMODELSTUBADAPTER_H + +#include "../virtualmodeladapter/virtualmodeladapter.h" + +class VirtualModelStubAdapter : public VirtualModelAdapter { +public: + int getItemsCount(void *parent); + void *getItem(void *parent, int index); + QVariant data(void *item, int role); +}; + +#endif // VIRTUALMODELSTUBADAPTER_H diff --git a/CoffeBeans/src/virtualsqltreenodeadapter/CMakeLists.txt b/CoffeBeans/src/virtualsqltreenodeadapter/CMakeLists.txt new file mode 100644 index 0000000..970defd --- /dev/null +++ b/CoffeBeans/src/virtualsqltreenodeadapter/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.13) + +project(virtualsqltreenodeadapter) + +set(TARGET_NAME VirtualSqlTreeNodeAdapter) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS REQUIRED Sql Widgets) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS REQUIRED Sql Widgets) + +add_library(${TARGET_NAME} + virtualsqltreenodeadapter.cpp + virtualsqltreenodeadapter.h + virtualsqltreenodeadapter.tpp) + +target_link_libraries(${TARGET_NAME} PRIVATE + Qt${QT_VERSION_MAJOR}::Sql + Qt${QT_VERSION_MAJOR}::Widgets) + + diff --git a/CoffeBeans/src/virtualsqltreenodeadapter/virtualsqltreenodeadapter.cpp b/CoffeBeans/src/virtualsqltreenodeadapter/virtualsqltreenodeadapter.cpp new file mode 100644 index 0000000..302973c --- /dev/null +++ b/CoffeBeans/src/virtualsqltreenodeadapter/virtualsqltreenodeadapter.cpp @@ -0,0 +1,3 @@ +#include "virtualsqltreenodeadapter.h" + +template class VirtualSqlTreeNodeAdapter; diff --git a/CoffeBeans/src/virtualsqltreenodeadapter/virtualsqltreenodeadapter.h b/CoffeBeans/src/virtualsqltreenodeadapter/virtualsqltreenodeadapter.h new file mode 100644 index 0000000..b3c2c05 --- /dev/null +++ b/CoffeBeans/src/virtualsqltreenodeadapter/virtualsqltreenodeadapter.h @@ -0,0 +1,34 @@ +#ifndef VIRTUALSQLTREENODEADAPTER_H +#define VIRTUALSQLTREENODEADAPTER_H + +#include "../virtualmodeladapter/virtualmodeladapter.h" + +#include + +template +struct SqlTreeNode; + +template +class VirtualSqlTreeNodeAdapter : public VirtualModelAdapter { +private: + using SqlTreeNode = SqlTreeNode; + +private: + SqlTreeNode &m_root; + +public: + explicit VirtualSqlTreeNodeAdapter(SqlTreeNode &root); + +public: + SqlTreeNode *getValue(void *data); + +public: + int getItemsCount(void *parent) override; + void *getItem(void *parent, int index) override; + QVariant data(void *item, int role) override; + void *getItemParent(void *item) override; +}; + +#include "virtualsqltreenodeadapter.tpp" + +#endif // VIRTUALSQLTREENODEADAPTER_H diff --git a/CoffeBeans/src/virtualsqltreenodeadapter/virtualsqltreenodeadapter.tpp b/CoffeBeans/src/virtualsqltreenodeadapter/virtualsqltreenodeadapter.tpp new file mode 100644 index 0000000..68d9041 --- /dev/null +++ b/CoffeBeans/src/virtualsqltreenodeadapter/virtualsqltreenodeadapter.tpp @@ -0,0 +1,46 @@ +#ifndef VIRTUALSQLTREENODEADAPTER_HPP +#define VIRTUALSQLTREENODEADAPTER_HPP + +#include "virtualsqltreenodeadapter.h" + +#include "../sqltreenode/sqltreenode.h" + +template +inline VirtualSqlTreeNodeAdapter::VirtualSqlTreeNodeAdapter( + SqlTreeNode &root) + : m_root(root) {} + +template +inline QVariant VirtualSqlTreeNodeAdapter::data(void *item, + int role) { + auto value = getValue(item); + if (role == Qt::DisplayRole) { + return QVariant::fromValue(value->data); + } else { + return QVariant(); + } +} + +template +inline void *VirtualSqlTreeNodeAdapter::getItemParent(void *item) { + return item ? reinterpret_cast(item)->parent : nullptr; +} + +template +inline void *VirtualSqlTreeNodeAdapter::getItem(void *parent, + int index) { + return getValue(parent)->nestedNodes[index].get(); +} + +template +inline typename VirtualSqlTreeNodeAdapter::SqlTreeNode * +VirtualSqlTreeNodeAdapter::getValue(void *data) { + return data ? static_cast(data) : &m_root; +} + +template +inline int VirtualSqlTreeNodeAdapter::getItemsCount(void *parent) { + return static_cast(getValue(parent)->nestedNodes.size()); +} + +#endif // VIRTUALSQLTREENODEADAPTER_HPP diff --git a/CoffeBeans/src/virtualtreemodel/CMakeLists.txt b/CoffeBeans/src/virtualtreemodel/CMakeLists.txt new file mode 100644 index 0000000..42a41c9 --- /dev/null +++ b/CoffeBeans/src/virtualtreemodel/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.13) + +project(virtualtreemodel) + +set(TARGET_NAME VirtualTreeModel) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS REQUIRED Widgets) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS REQUIRED Widgets) + +add_library(${TARGET_NAME} + virtualtreemodel.cpp + virtualtreemodel.h + virtualtreemodel.cpp + virtualtreemodel.h + internalnode.cpp + internalnode.h + virtualtreemodelprivate.cpp + virtualtreemodelprivate.h) + +target_link_libraries(${TARGET_NAME} PRIVATE + Qt${QT_VERSION_MAJOR}::Widgets) + diff --git a/CoffeBeans/src/virtualtreemodel/internalnode.cpp b/CoffeBeans/src/virtualtreemodel/internalnode.cpp new file mode 100644 index 0000000..2e3a6ed --- /dev/null +++ b/CoffeBeans/src/virtualtreemodel/internalnode.cpp @@ -0,0 +1,55 @@ +#include "internalnode.h" + +#include "../virtualmodeladapter/virtualmodeladapter.h" + +VirtualTreeModel::InternalNode::InternalNode( + VirtualTreeModel::InternalNode *parent, void *obj, size_t index) + : parent(parent), item(obj), parentIndex(index) {} + +bool VirtualTreeModel::InternalNode::isInitialized( + VirtualModelAdapter *adapter) { + if (!childInitialized) { + // if node children have not been added to model + // but model asks node by hasChildren() + // the only way to notify model about changes is to initialize node + // children + if (hasChildrenQueryed) { + if (hasChildren != (adapter->getItemsCount(item) > 0)) + childInitialized = true; + } + return childInitialized; + } else + return true; +} + +void VirtualTreeModel::InternalNode::loadChildren( + VirtualModelAdapter *adapter) { + if (!childInitialized) { + if (adapter->hasItems(item)) { + int childCount = adapter->getItemsCount(item); + for (int k = 0; k < childCount; ++k) + children.emplace_back( + new InternalNode(this, adapter->getItem(item, k), k)); + } + childInitialized = true; + } +} + +int VirtualTreeModel::InternalNode::childCount(VirtualModelAdapter *adapter) { + loadChildren(adapter); + return static_cast(children.size()); +} + +void VirtualTreeModel::InternalNode::eraseChildren( + const InternalChildren::iterator &begin, + const InternalChildren::iterator &end) { + size_t curParent = begin->get()->parentIndex; + auto newEnd = children.erase(begin, end); + for (auto it = newEnd; it != children.end(); ++it) + it->get()->parentIndex = curParent++; +} + +void VirtualTreeModel::InternalNode::insertedChildren(size_t lastIndex) { + for (auto index = lastIndex; index < children.size(); ++index) + children[index]->parentIndex = index; +} diff --git a/CoffeBeans/src/virtualtreemodel/internalnode.h b/CoffeBeans/src/virtualtreemodel/internalnode.h new file mode 100644 index 0000000..c97c75e --- /dev/null +++ b/CoffeBeans/src/virtualtreemodel/internalnode.h @@ -0,0 +1,39 @@ +#ifndef INTERNALNODE_H +#define INTERNALNODE_H + +#include "virtualtreemodel.h" + +#include + +#include + +class VirtualModelAdapter; + +// internal tree structure +struct VirtualTreeModel::InternalNode { +public: + using InternalChildren = std::vector>; + +public: + InternalNode *parent; + void *item; + size_t parentIndex; + InternalChildren children; + + bool hasChildrenQueryed = false; + bool hasChildren = false; + bool childInitialized = false; + +public: + explicit InternalNode(InternalNode *parent, void *obj, size_t index); + +public: + bool isInitialized(VirtualModelAdapter *adapter); + void loadChildren(VirtualModelAdapter *adapter); + int childCount(VirtualModelAdapter *adapter); + void eraseChildren(const InternalChildren::iterator &begin, + const InternalChildren::iterator &end); + void insertedChildren(size_t lastIndex); +}; + +#endif // INTERNALNODE_H diff --git a/CoffeBeans/src/virtualtreemodel/virtualtreemodel.cpp b/CoffeBeans/src/virtualtreemodel/virtualtreemodel.cpp new file mode 100644 index 0000000..b429d55 --- /dev/null +++ b/CoffeBeans/src/virtualtreemodel/virtualtreemodel.cpp @@ -0,0 +1,239 @@ +#include "virtualtreemodel.h" + +#include "internalnode.h" + +#include "virtualtreemodelprivate.h" + +#include "../virtualmodeladapter/virtualmodeladapter.h" + +VirtualTreeModel::VirtualTreeModel(VirtualModelAdapter *adapter, + QObject *parent) + : QAbstractItemModel(parent), m_adapter(adapter), m_updating(0), + m_syncing(false) { + m_root = new InternalNode(nullptr, nullptr, 0); + m_model = new VirtualTreeModelPrivate(*this); + if (m_adapter) + adapter->setModel(m_model); + syncTree(); +} + +VirtualTreeModel::~VirtualTreeModel() { + delete m_root; + delete m_model; +} + +void VirtualTreeModel::syncNodeList(InternalNode &node, void *parent) { + QModelIndex modelIndex = getIndex(node); + InternalNode::InternalChildren &nestedNodes = node.children; + int nestedCount = int(nestedNodes.size()); + int currentIndex = -1; + bool complete; + do { + // variable initialization + InternalNode *currentNestedNode; + int cachedNestedNodeIndex; + + complete = (++currentIndex >= nestedCount); + if (complete) { + currentNestedNode = nullptr; + cachedNestedNodeIndex = 0; + } else { + currentNestedNode = nestedNodes[currentIndex].get(); + // index of "item" with "parent" from "destinationStart" + cachedNestedNodeIndex = + m_adapter->indexOfItem(parent, currentNestedNode->item, currentIndex); + } + // if doesn't exist - remove + if (cachedNestedNodeIndex < 0) { + beginRemoveRows(modelIndex, currentIndex, currentIndex); + node.eraseChildren(nestedNodes.begin() + currentIndex, + nestedNodes.begin() + currentIndex + 1 /*to end*/); + endRemoveRows(); + complete = (currentIndex >= --nestedCount); + } else if (currentNestedNode != nullptr && + currentNestedNode->isInitialized(m_adapter)) + syncNodeList(*currentNestedNode, currentNestedNode->item); + } while (!complete); + + int distance = m_adapter->getItemsCount(parent) - currentIndex; + if (distance > 0) { + beginInsertRows(modelIndex, currentIndex, + currentIndex + distance - 1 /*to index*/); + for (int i = 0; i < distance; ++i, ++currentIndex) { + void *cachedItem = m_adapter->getItem(parent, currentIndex); + auto newNode = new InternalNode(&node, cachedItem, currentIndex); + nestedNodes.emplace(nestedNodes.begin() + currentIndex, newNode); + } + node.insertedChildren(currentIndex); + endInsertRows(); + } + + node.childInitialized = true; +} + +QVariant VirtualTreeModel::data(const QModelIndex &index, int role) const { + if (!index.isValid()) + return QVariant(); + + if (m_updating > 0 || m_adapter == nullptr) + return QVariant(); + + void *item = getNode(index).item; + return m_adapter->data(item, role); +} + +QModelIndex VirtualTreeModel::index(int row, int column, + const QModelIndex &parent) const { + InternalNode &parentItem = getNode(parent); + if (row < static_cast(parentItem.children.size())) { + InternalNode *childItem = parentItem.children.at(row).get(); + return getIndex(*childItem, column); + } else + return QModelIndex(); +} + +QModelIndex VirtualTreeModel::parent(const QModelIndex &index) const { + if (!index.isValid() || !m_adapter) + return QModelIndex(); + + InternalNode &childItem = getNode(index); + InternalNode *parentItem = childItem.parent; + if (parentItem == nullptr || parentItem == m_root) + return QModelIndex(); + return getIndex(*parentItem); +} + +int VirtualTreeModel::rowCount(const QModelIndex &parent) const { + if (parent.isValid() && !this->parent(parent).isValid()) + parent.internalId(); + InternalNode &parentItem = getNode(parent); + if (m_syncing) + return static_cast(parentItem.children.size()); + else if (m_adapter) + // lazy children loading + return parentItem.childCount(m_adapter); + else + return 0; +} + +int VirtualTreeModel::columnCount(const QModelIndex &parent) const { + Q_UNUSED(parent); + return 1; +} + +VirtualTreeModel::InternalNode & +VirtualTreeModel::getNode(const QModelIndex &index) const { + if (index.isValid()) + return *(InternalNode *)index.internalPointer(); + else + return *m_root; +} + +VirtualTreeModel::InternalNode * +VirtualTreeModel::getItemNode(void *item) const { + if (m_adapter == nullptr) + return nullptr; + void *parentItem = m_adapter->getItemParent(item); + if (parentItem == item) + return nullptr; + if (parentItem == nullptr) + return m_root; + else { + auto parentNode = getItemNode(parentItem); + int index = m_adapter->indexOfItem(parentItem, item); + if (index >= 0) { + parentNode->loadChildren(m_adapter); + return parentNode->children[index].get(); + } else { + return nullptr; + } + } +} + +QModelIndex VirtualTreeModel::getIndex(const InternalNode &node, + int column) const { + if (&node == m_root) + return QModelIndex(); + else + return createIndex(static_cast(node.parentIndex), column, + quintptr(&node)); +} + +void VirtualTreeModel::doQueuedUpdate() { endUpdate(); } + +bool VirtualTreeModel::hasChildren(const QModelIndex &parent) const { + if (!parent.isValid()) + return true; + InternalNode &item = getNode(parent); + if (item.childInitialized) { + return item.children.size() > 0; + } else if (m_adapter) { + item.hasChildrenQueryed = true; + bool has = m_adapter->hasItems(item.item); + item.hasChildren = has; + return has; + } else + return false; +} + +void *VirtualTreeModel::getItem(const QModelIndex &index) const { + return getNode(index).item; +} + +QModelIndex VirtualTreeModel::getItemModelIndex(void *item) const { + auto node = getItemNode(item); + if (node) + return getIndex(*node); + else + return QModelIndex(); +} + +VirtualModelAdapter * +VirtualTreeModel::setModelAdapter(VirtualModelAdapter *adapter) { + VirtualModelAdapter *oldAdapter = m_adapter; + beginUpdate(); + if (m_adapter) + m_adapter->setModel(nullptr); + m_adapter = adapter; + beginResetModel(); + m_root->children.clear(); + endResetModel(); + if (m_adapter) + m_adapter->setModel(m_model); + endUpdate(); + return oldAdapter; +} + +VirtualModelAdapter *VirtualTreeModel::getModelAdapter() const { + return m_adapter; +} + +void VirtualTreeModel::beginUpdate() { ++m_updating; } + +void VirtualTreeModel::endUpdate() { + if (m_updating == 1) + syncTree(); + --m_updating; + // force tree to repaint all nestedNodes + if (m_updating == 0) + emit dataChanged(QModelIndex(), QModelIndex()); +} + +bool VirtualTreeModel::isUpdating() const { + return m_updating > 0 || m_syncing; +} + +void VirtualTreeModel::queuedUpdate() { + if (m_updating == 0) { + beginUpdate(); + QMetaObject::invokeMethod(this, "doQueuedUpdate", Qt::QueuedConnection); + } +} + +void VirtualTreeModel::syncTree() { + if (m_adapter) { + m_syncing = true; + syncNodeList(*m_root, nullptr); + m_syncing = false; + } +} diff --git a/CoffeBeans/src/virtualtreemodel/virtualtreemodel.h b/CoffeBeans/src/virtualtreemodel/virtualtreemodel.h new file mode 100644 index 0000000..703a553 --- /dev/null +++ b/CoffeBeans/src/virtualtreemodel/virtualtreemodel.h @@ -0,0 +1,65 @@ +#ifndef VIRTUALTREEADAPTER_H +#define VIRTUALTREEADAPTER_H + +#include + +#include + +#include + +class VirtualModelAdapter; + +class VirtualTreeModel : public QAbstractItemModel { + Q_OBJECT + +private: + struct InternalNode; + class VirtualTreeModelPrivate; + +private: + VirtualModelAdapter *m_adapter; + VirtualTreeModelPrivate *m_model; + // we need mutable nodes to allow lazy loading + mutable InternalNode *m_root; + int m_updating; + bool m_syncing; + +private: + InternalNode &getNode(const QModelIndex &index) const; + InternalNode *getItemNode(void *item) const; + QModelIndex getIndex(const InternalNode &node, int column = 0) const; + + void syncNodeList(InternalNode &node, void *parent); + void syncTree(); + +public: + explicit VirtualTreeModel(VirtualModelAdapter *adapter, QObject *parent = nullptr); + ~VirtualTreeModel(); + +public: + QVariant data(const QModelIndex &index, int role) const override; + QModelIndex index(int row, int column, + const QModelIndex &parent = QModelIndex()) const override; + QModelIndex parent(const QModelIndex &index) const override; + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + int columnCount(const QModelIndex &parent = QModelIndex()) const override; + bool hasChildren(const QModelIndex &parent = QModelIndex()) const override; + +public: + void *getItem(const QModelIndex &index) const; + QModelIndex getItemModelIndex(void *item) const; + + VirtualModelAdapter *setModelAdapter(VirtualModelAdapter *adapter); + VirtualModelAdapter *getModelAdapter() const; + + // tree is updating that means items in internal nodes may be invalid + bool isUpdating() const; + void beginUpdate(); + void endUpdate(); + void queuedUpdate(); + +private slots: + void doQueuedUpdate(); +}; + +#endif // VIRTUALTREEADAPTER_H diff --git a/CoffeBeans/src/virtualtreemodel/virtualtreemodelprivate.cpp b/CoffeBeans/src/virtualtreemodel/virtualtreemodelprivate.cpp new file mode 100644 index 0000000..114b36c --- /dev/null +++ b/CoffeBeans/src/virtualtreemodel/virtualtreemodelprivate.cpp @@ -0,0 +1,19 @@ +#include "virtualtreemodelprivate.h" + +#include "virtualtreemodel.h" + +VirtualTreeModel::VirtualTreeModelPrivate::VirtualTreeModelPrivate( + VirtualTreeModel &model) + : m_model(model) {} + +void VirtualTreeModel::VirtualTreeModelPrivate::beginUpdate() { + m_model.beginUpdate(); +} + +void VirtualTreeModel::VirtualTreeModelPrivate::endUpdate() { + m_model.endUpdate(); +} + +void VirtualTreeModel::VirtualTreeModelPrivate::queuedUpdate() { + m_model.queuedUpdate(); +} diff --git a/CoffeBeans/src/virtualtreemodel/virtualtreemodelprivate.h b/CoffeBeans/src/virtualtreemodel/virtualtreemodelprivate.h new file mode 100644 index 0000000..ff9153c --- /dev/null +++ b/CoffeBeans/src/virtualtreemodel/virtualtreemodelprivate.h @@ -0,0 +1,21 @@ +#ifndef VIRTUALTREEMODELPRIVATE_H +#define VIRTUALTREEMODELPRIVATE_H + +#include "virtualtreemodel.h" + +#include "../virtualmodelinterface/virtualmodelinterface.h" + +class VirtualTreeModel::VirtualTreeModelPrivate : public VirtualModelInterface { +private: + VirtualTreeModel &m_model; + +public: + explicit VirtualTreeModelPrivate(VirtualTreeModel &model); + +public: + void beginUpdate() override; + void endUpdate() override; + void queuedUpdate() override; +}; + +#endif // VIRTUALTREEMODELPRIVATE_H diff --git a/QtCreator_CMakeLists.txt.bat b/QtCreator_CMakeLists.txt.bat new file mode 100644 index 0000000..95b6432 --- /dev/null +++ b/QtCreator_CMakeLists.txt.bat @@ -0,0 +1,6 @@ +@echo off + +reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /t reg_expand_sz /d "chcp 1252 1>nul" /f +cd .\CoffeBeans\ +call qtcreator CMakeLists.txt +reg delete "HKCU\Software\Microsoft\Command Processor" /v AutoRun /f \ No newline at end of file diff --git a/QtCreator_CMakeLists.txt_chcp1251.bat b/QtCreator_CMakeLists.txt_chcp1251.bat new file mode 100644 index 0000000..d23ef9d --- /dev/null +++ b/QtCreator_CMakeLists.txt_chcp1251.bat @@ -0,0 +1,6 @@ +@echo off + +reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /t reg_expand_sz /d "chcp 1251 1>nul" /f +cd CoffeBeans +call qtcreator CMakeLists.txt +reg delete "HKCU\Software\Microsoft\Command Processor" /v AutoRun /f \ No newline at end of file diff --git a/QtCreator_CMakeLists.txt_chcp1252.bat b/QtCreator_CMakeLists.txt_chcp1252.bat new file mode 100644 index 0000000..35b08f5 --- /dev/null +++ b/QtCreator_CMakeLists.txt_chcp1252.bat @@ -0,0 +1,6 @@ +@echo off + +reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /t reg_expand_sz /d "chcp 1252 1>nul" /f +cd CoffeBeans +call qtcreator CMakeLists.txt +reg delete "HKCU\Software\Microsoft\Command Processor" /v AutoRun /f \ No newline at end of file diff --git a/Run_CoffeBeans_chcp1251.vbs b/Run_CoffeBeans_chcp1251.vbs new file mode 100644 index 0000000..24e6713 --- /dev/null +++ b/Run_CoffeBeans_chcp1251.vbs @@ -0,0 +1,2 @@ +set WShell = CreateObject("WScript.shell") +ACode = WShell.Run("QtCreator_CMakeLists.txt_chcp1251.bat", 0, false) \ No newline at end of file diff --git a/Run_CoffeBeans_chcp1252.vbs b/Run_CoffeBeans_chcp1252.vbs new file mode 100644 index 0000000..0f372c9 --- /dev/null +++ b/Run_CoffeBeans_chcp1252.vbs @@ -0,0 +1,2 @@ +set WShell = CreateObject("WScript.shell") +ACode = WShell.Run("QtCreator_CMakeLists.txt_chcp1252.bat", 0, false) \ No newline at end of file diff --git a/drop-create-all-initialize.bat b/drop-create-all-initialize.bat new file mode 100644 index 0000000..c371999 --- /dev/null +++ b/drop-create-all-initialize.bat @@ -0,0 +1,30 @@ +@echo off + +chcp 1251 + +set SSMS_SERVER_NAME=(local)\SQLEXPRESS +set SSMS_USER_NAME=sa +set SSMS_USER_PASSWORD=gfhjkm + +cd .\sqlscripts\ + +@echo Batch file name: .\..\sqlscripts\drop-create-tables.bat +call .\drop-create-tables.bat + +@echo Batch file name: .\..\sqlscripts\create-triggers.bat +call .\create-triggers.bat + +@echo Batch file name: .\..\sqlscripts\create-functions.bat +call .\create-functions.bat + +@echo Batch file name: .\..\sqlscripts\create-procedures.bat +call .\create-procedures.bat + +@echo Batch file name: .\..\sqlscripts\initialize-tables.bat +call .\initialize-tables.bat + +@echo Batch file name: .\..\sqlscripts\create-users.bat +call .\create-users.bat + +@echo Complete +pause \ No newline at end of file diff --git a/run-tests.bat b/run-tests.bat new file mode 100644 index 0000000..0f04b62 --- /dev/null +++ b/run-tests.bat @@ -0,0 +1,15 @@ +@echo off + +chcp 1251 + +set SSMS_SERVER_NAME=(local) +set SSMS_USER_NAME=sa +set SSMS_USER_PASSWORD=gfhjkm + +cd .\sqlscripts\ + +@echo Batch file name: .\..\sqlscripts\run-tests.bat +call .\run-tests.bat + +@echo Complete +pause \ No newline at end of file diff --git a/sqlscripts/create-functions.bat b/sqlscripts/create-functions.bat new file mode 100644 index 0000000..8eb95df --- /dev/null +++ b/sqlscripts/create-functions.bat @@ -0,0 +1,11 @@ +@echo off + +sqlcmd -S %SSMS_SERVER_NAME% -U %SSMS_USER_NAME% -P %SSMS_USER_PASSWORD% -i ^ +.\functions\function-does_barcode_exist.sql ^ +.\functions\function-does_product_exist_with_name.sql ^ +.\functions\function-does_product_exist_with_product_type_id.sql ^ +.\functions\function-does_product_type_exist_with_name.sql ^ +.\functions\function-subgroup_products_join_product_types.sql ^ +.\functions\function-same_products_join_product_types.sql ^ +.\functions\function-product_type_id.sql ^ +-r1 1> NUL \ No newline at end of file diff --git a/sqlscripts/create-procedures.bat b/sqlscripts/create-procedures.bat new file mode 100644 index 0000000..4839679 --- /dev/null +++ b/sqlscripts/create-procedures.bat @@ -0,0 +1,15 @@ +@echo off + +sqlcmd -S %SSMS_SERVER_NAME% -U %SSMS_USER_NAME% -P %SSMS_USER_PASSWORD% -i ^ +.\procedures\specific-procedures\procedure-products_join_product_types.sql ^ +.\procedures\specific-procedures\procedure-rename_product.sql ^ +.\procedures\specific-procedures\procedure-rename_product_type.sql ^ +.\procedures\specific-procedures\procedure-specify_product_type.sql ^ +.\procedures\specific-procedures\procedure-update_barcode.sql ^ +.\procedures\standard-procedures\removal-procedures\procedures-delete_product.sql ^ +.\procedures\standard-procedures\removal-procedures\procedure-delete_product_type.sql ^ +.\procedures\standard-procedures\insertion-procedures\procedure-insert_product.sql ^ +.\procedures\standard-procedures\insertion-procedures\procedure-insert_product_type.sql ^ +.\procedures\standard-procedures\insertion-procedures\procedure-insert_product_attribute.sql ^ +.\procedures\standard-procedures\insertion-procedures\procedure-insert_product_value.sql ^ +-r1 1> NUL \ No newline at end of file diff --git a/sqlscripts/create-triggers.bat b/sqlscripts/create-triggers.bat new file mode 100644 index 0000000..eb68986 --- /dev/null +++ b/sqlscripts/create-triggers.bat @@ -0,0 +1,6 @@ +@echo off + +sqlcmd -S %SSMS_SERVER_NAME% -U %SSMS_USER_NAME% -P %SSMS_USER_PASSWORD% -i ^ +.\triggers\ddl-trigger-trg_drop_table.sql ^ +.\triggers\dml-trigger-trg_insert_product_types.sql ^ +-r1 1> NUL \ No newline at end of file diff --git a/sqlscripts/create-users.bat b/sqlscripts/create-users.bat new file mode 100644 index 0000000..7509ad5 --- /dev/null +++ b/sqlscripts/create-users.bat @@ -0,0 +1,5 @@ +@echo off + +sqlcmd -S %SSMS_SERVER_NAME% -U %SSMS_USER_NAME% -P %SSMS_USER_PASSWORD% -i ^ +.\users\create-a-user-user.sql ^ +-r1 1> NUL \ No newline at end of file diff --git a/sqlscripts/delete-tables.bat b/sqlscripts/delete-tables.bat new file mode 100644 index 0000000..6630d54 --- /dev/null +++ b/sqlscripts/delete-tables.bat @@ -0,0 +1,5 @@ +@echo off + +sqlcmd -S %SSMS_SERVER_NAME% -U %SSMS_USER_NAME% -P %SSMS_USER_PASSWORD% -i ^ +.\deleting\delete-tables.sql ^ +-r1 1> NUL \ No newline at end of file diff --git a/sqlscripts/deleting/delete-tables.sql b/sqlscripts/deleting/delete-tables.sql new file mode 100644 index 0000000..b694ad5 --- /dev/null +++ b/sqlscripts/deleting/delete-tables.sql @@ -0,0 +1,26 @@ +USE [Database] + +IF OBJECT_ID('[Tables].[product_write_off_records]', 'U') IS NOT NULL + DELETE [Tables].[product_write_off_records]; +IF OBJECT_ID('[Tables].[additional_variables]', 'U') IS NOT NULL + DELETE [Tables].[additional_variables]; +IF OBJECT_ID('[Tables].[price_history_records]', 'U') IS NOT NULL + DELETE [Tables].[price_history_records]; +IF OBJECT_ID('[Tables].[product_outflow_records]', 'U') IS NOT NULL + DELETE [Tables].[product_outflow_records]; +IF OBJECT_ID('[Tables].[product_inflow_records]', 'U') IS NOT NULL + DELETE [Tables].[product_inflow_records]; +IF OBJECT_ID('[Tables].[write_off_reasons]', 'U') IS NOT NULL + DELETE [Tables].[write_off_reasons]; +IF OBJECT_ID('[Tables].[product_values]', 'U') IS NOT NULL + DELETE [Tables].[product_values]; +IF OBJECT_ID('[Tables].[product_attributes]', 'U') IS NOT NULL + DELETE [Tables].[product_attributes]; +IF OBJECT_ID('[Tables].[attributes]', 'U') IS NOT NULL + DELETE [Tables].[attributes]; +IF OBJECT_ID('[Tables].[suppliers]', 'U') IS NOT NULL + DELETE [Tables].[suppliers]; +IF OBJECT_ID('[Tables].[products]', 'U') IS NOT NULL + DELETE [Tables].[products]; +IF OBJECT_ID('[Tables].[product_types]', 'U') IS NOT NULL + DELETE [Tables].[product_types]; \ No newline at end of file diff --git a/sqlscripts/drop-create-tables.bat b/sqlscripts/drop-create-tables.bat new file mode 100644 index 0000000..eb45e88 --- /dev/null +++ b/sqlscripts/drop-create-tables.bat @@ -0,0 +1,5 @@ +@echo off + +sqlcmd -S %SSMS_SERVER_NAME% -U %SSMS_USER_NAME% -P %SSMS_USER_PASSWORD% -i ^ +.\drop-create\drop-create-Database.sql ^ +-r1 1> NUL \ No newline at end of file diff --git a/sqlscripts/drop-create/drop-create-Database.sql b/sqlscripts/drop-create/drop-create-Database.sql new file mode 100644 index 0000000..e321991 --- /dev/null +++ b/sqlscripts/drop-create/drop-create-Database.sql @@ -0,0 +1,195 @@ +USE [master]; + +IF EXISTS (SELECT 1 FROM sys.databases WHERE [name] = N'Database') +BEGIN + EXECUTE sp_executesql + @stmt = + N'USE [Database]; + ALTER DATABASE [Database] + SET SINGLE_USER WITH ROLLBACK IMMEDIATE; + USE [tempdb]; + DROP DATABASE [Database];' +END; +GO + +CREATE DATABASE [Database]; +GO + +USE [Database]; +GO + +CREATE SCHEMA [Tables] AUTHORIZATION [dbo]; +GO + +CREATE SCHEMA [Views] AUTHORIZATION [dbo]; +GO + +CREATE SCHEMA [Functions] AUTHORIZATION [dbo]; +GO + +CREATE SCHEMA [Procedures] AUTHORIZATION [dbo]; +GO + +CREATE TABLE [Tables].[product_types]( + [id] INT NOT NULL IDENTITY(1, 1), + [parent_id] INT DEFAULT(NULL), + [name] NVARCHAR(128) NOT NULL, + CONSTRAINT PK_product_types + PRIMARY KEY([id]), + CONSTRAINT FK_product_types FOREIGN KEY([parent_id]) + REFERENCES [Tables].[product_types]([id]) +); + +CREATE TABLE [Tables].[products]( + [id] INT NOT NULL IDENTITY(1, 1), + [barcode] BIGINT NOT NULL UNIQUE, + [name] NVARCHAR(128) NOT NULL UNIQUE, + [product_type_id] INT NOT NULL, + CONSTRAINT PK_products + PRIMARY KEY([id]), + CONSTRAINT CHECK_products + CHECK([barcode] > -1 AND [barcode] < 10000000000000), + CONSTRAINT FK_product_type_id FOREIGN KEY([product_type_id]) + REFERENCES [Tables].[product_types]([id]) +); + +CREATE TABLE [Tables].[suppliers]( + [id] INT NOT NULL IDENTITY(1, 1), + [name] NVARCHAR(128) NOT NULL UNIQUE, + [address] NVARCHAR(128) NOT NULL, + [telephone_number] NVARCHAR(128) NOT NULL, + CONSTRAINT PK_suppliers + PRIMARY KEY([id]) +); + +--CREATE TABLE [Tables].[additional_variables]( +-- [id] INT NOT NULL IDENTITY(1, 1), +-- [name] NVARCHAR(128) NOT NULL UNIQUE, +-- [value] NVARCHAR(128) NOT NULL +-- CONSTRAINT PK_additionalVariables +-- PRIMARY KEY([id]) +--); + +CREATE TABLE [Tables].[attributes]( + [id] INT NOT NULL IDENTITY(1, 1), + [name] NVARCHAR(128) NOT NULL UNIQUE, + CONSTRAINT PK_attributes + PRIMARY KEY([id]) +); + +CREATE TABLE [Tables].[product_attributes]( + [product_id] INT NOT NULL, + [attribute_id] INT NOT NULL, + [description] NVARCHAR(128) + CONSTRAINT PK_product_attributes + PRIMARY KEY([product_id], [attribute_id]), + CONSTRAINT FK_product_attributes_product_id FOREIGN KEY([product_id]) + REFERENCES [Tables].[products]([id]), + CONSTRAINT FK_product_attributes_attribute_id FOREIGN KEY([attribute_id]) + REFERENCES [Tables].[attributes]([id]) +); + +CREATE TABLE [Tables].[product_values]( + [id] INT NOT NULL IDENTITY(1, 1), + [product_id] INT NOT NULL, + [attribute_id] INT NOT NULL, + [value] NVARCHAR(128) NOT NULL, + CONSTRAINT PK_product_values + PRIMARY KEY([id]), + CONSTRAINT FK_product_values FOREIGN KEY([product_id], [attribute_id]) + REFERENCES [Tables].[product_attributes]([product_id], [attribute_id]) +); + +CREATE TABLE [Tables].[price_history_records]( + [id] INT NOT NULL IDENTITY(1, 1), + [product_id] INT NOT NULL, + [datetime] DATETIME NOT NULL DEFAULT(SYSDATETIME()), + [price] MONEY NOT NULL, + CONSTRAINT PK_price_history_records + PRIMARY KEY([id]), + CONSTRAINT FK_price_history_records_product_id FOREIGN KEY([product_id]) + REFERENCES [Tables].[products]([id]), + CONSTRAINT CHECK_price_history_records + CHECK([price] >= 0) +); + +-- CREATE TABLE [Tables].[barcode_history]... + +CREATE TABLE [Tables].[product_outflow_records]( + [id] INT NOT NULL IDENTITY(1, 1), + [product_id] INT NOT NULL, -- without reference (temp) + [barcode] BIGINT NOT NULL, + [count] INT NOT NULL, + [datetime] DATETIME NOT NULL DEFAULT(SYSDATETIME()) + CONSTRAINT PK_product_outflow_records + PRIMARY KEY([id]), + CONSTRAINT CHECK_product_outflow_records + CHECK([count] > 0), + CONSTRAINT FK_product_outflow_records FOREIGN KEY([product_id]) + REFERENCES [Tables].[products]([id]) +); + +CREATE TABLE [Tables].[product_inflow_records]( + [id] INT NOT NULL IDENTITY(1, 1), + [product_id] INT NOT NULL, + [barcode] BIGINT NOT NULL, -- without reference (temp) + [supplier_id] INT NOT NULL, + [count] INT NOT NULL, + [full_price] MONEY NOT NULL, + [datetime] DATETIME NOT NULL DEFAULT(SYSDATETIME()) + CONSTRAINT PK_product_inflow_records + PRIMARY KEY([id]) + CONSTRAINT FK_product_inflow_records_supplier_id FOREIGN KEY([supplier_id]) + REFERENCES [Tables].[suppliers]([id]), + CONSTRAINT CHECK_product_inflow_records + CHECK([count] > 0 AND [full_price] >= 0), + CONSTRAINT FK_product_inflow_records FOREIGN KEY([product_id]) + REFERENCES [Tables].[products]([id]) +); + +CREATE TABLE [Tables].[write_off_reasons]( + [id] INT NOT NULL IDENTITY(1, 1), + [name] NVARCHAR(128) NOT NULL, + CONSTRAINT PK_write_off_reasons + PRIMARY KEY([id]), +); + +CREATE TABLE [Tables].[product_write_off_records]( + [id] INT NOT NULL IDENTITY(1, 1), + [product_id] INT NOT NULL, + [barcode] BIGINT NOT NULL, -- without reference (temp) + [reason_id] INT NOT NULL, + [count] INT NOT NULL, + [datetime] DATETIME NOT NULL DEFAULT(SYSDATETIME()) + CONSTRAINT PK_product_write_off_records + PRIMARY KEY([id]) + CONSTRAINT FK_product_write_off_records_reason_id FOREIGN KEY([reason_id]) + REFERENCES [Tables].[write_off_reasons]([id]), + CONSTRAINT CHECK_product_write_off_records + CHECK([count] > 0), + CONSTRAINT FK_product_write_off_records FOREIGN KEY([product_id]) + REFERENCES [Tables].[products]([id]) +); +GO + +CREATE VIEW [Views].[product_properties] +WITH SCHEMABINDING +AS + SELECT [PA].[product_id], [PA].[attribute_id], [A].[name], [PV].[value] + FROM [Tables].[product_attributes] AS [PA] + LEFT OUTER JOIN [Tables].[product_values] AS [PV] + ON [PV].[product_id] = [PA].[product_id] + AND [PV].[attribute_id] = [PA].[attribute_id] + JOIN [Tables].[attributes] AS [A] + ON [A].[id] = [PA].[attribute_id]; +GO + +CREATE VIEW [Views].[available_product_types] +WITH SCHEMABINDING +AS + SELECT [B].[id], [B].[parent_id], [B].[name] + FROM [Tables].[product_types] AS [A] + RIGHT JOIN [Tables].[product_types] AS [B] + ON [B].[id] = [A].[parent_id] + WHERE [A].[id] IS NULL; +GO diff --git a/sqlscripts/drop-create/version-with-denormalization/drop-create-Database.sql b/sqlscripts/drop-create/version-with-denormalization/drop-create-Database.sql new file mode 100644 index 0000000..9bfdc3e --- /dev/null +++ b/sqlscripts/drop-create/version-with-denormalization/drop-create-Database.sql @@ -0,0 +1,161 @@ +USE [master]; + +IF EXISTS (SELECT 1 FROM sys.databases WHERE [name] = N'Database') +BEGIN + EXECUTE sp_executesql + @stmt = + N'USE [Database]; + ALTER DATABASE [Database] + SET SINGLE_USER WITH ROLLBACK IMMEDIATE; + USE [tempdb]; + DROP DATABASE [Database];' +END; +GO + +CREATE DATABASE [Database]; +GO + +USE [Database]; +GO + +CREATE SCHEMA [Tables] AUTHORIZATION [dbo]; +GO + +CREATE SCHEMA [Functions] AUTHORIZATION [dbo]; +GO + +CREATE SCHEMA [Procedures] AUTHORIZATION [dbo]; +GO + +CREATE TABLE [Tables].[product_types]( + [id] INT NOT NULL IDENTITY(1, 1), + [parent_id] INT DEFAULT(NULL), + [name] NVARCHAR(128) NOT NULL, + CONSTRAINT PK_product_types + PRIMARY KEY([id]), + CONSTRAINT FK_product_types FOREIGN KEY([parent_id]) + REFERENCES [Tables].[product_types]([id]) +); + +CREATE TABLE [Tables].[products]( + [id] INT NOT NULL IDENTITY(1, 1), + [name] NVARCHAR(128) NOT NULL UNIQUE, + [product_type_id] INT NOT NULL, + CONSTRAINT PK_products + PRIMARY KEY([id]), + CONSTRAINT FK_product_type_id FOREIGN KEY([product_type_id]) + REFERENCES [Tables].[product_types]([id]) +); + +CREATE TABLE [Tables].[suppliers]( + [id] INT NOT NULL IDENTITY(1, 1), + [name] NVARCHAR(128) NOT NULL UNIQUE, + [address] NVARCHAR(128) NOT NULL, + [telephone_number] NVARCHAR(128) NOT NULL, + CONSTRAINT PK_suppliers + PRIMARY KEY([id]) +); + +CREATE TABLE [Tables].[additional_variables]( + [id] INT NOT NULL IDENTITY(1, 1), + [name] NVARCHAR(128) NOT NULL UNIQUE, + [value] NVARCHAR(128) NOT NULL + CONSTRAINT PK_additionalVariables + PRIMARY KEY([id]) +); + +CREATE TABLE [Tables].[attributes]( + [id] INT NOT NULL IDENTITY(1, 1), + [name] NVARCHAR(128) NOT NULL UNIQUE, + CONSTRAINT PK_attributes + PRIMARY KEY([id]) +); + +CREATE TABLE [Tables].[product_attributes]( + [product_id] INT NOT NULL, + [attribute_id] INT NOT NULL, + CONSTRAINT PK_product_attributes + PRIMARY KEY([product_id], [attribute_id]), + CONSTRAINT FK_product_attributes_product_id FOREIGN KEY([product_id]) + REFERENCES [Tables].[products]([id]), + CONSTRAINT FK_product_attributes_attribute_id FOREIGN KEY([attribute_id]) + REFERENCES [Tables].[attributes]([id]) +); + +CREATE TABLE [Tables].[product_values]( + [id] INT NOT NULL IDENTITY(1, 1), + [product_id] INT NOT NULL, + [attribute_id] INT NOT NULL, + [value] NVARCHAR(128) NOT NULL, + CONSTRAINT PK_product_values + PRIMARY KEY([id]), + CONSTRAINT FK_product_values FOREIGN KEY([product_id], [attribute_id]) + REFERENCES [Tables].[product_attributes]([product_id], [attribute_id]) +); + +CREATE TABLE [Tables].[price_history_records]( + [id] INT NOT NULL IDENTITY(1, 1), + [product_id] INT NOT NULL, + [datetime] DATETIME NOT NULL DEFAULT(SYSDATETIME()), + [price] MONEY NOT NULL, + CONSTRAINT PK_price_history_records + PRIMARY KEY([id]), + CONSTRAINT FK_price_history_records_product_id FOREIGN KEY([product_id]) + REFERENCES [Tables].[products]([id]), + CONSTRAINT CHECK_price_history_records + CHECK(price >= 0) +); + +CREATE TABLE [Tables].[product_outflow_records]( + [id] INT NOT NULL IDENTITY(1, 1), + [barcode_product_value_id] INT NOT NULL, + [count] INT NOT NULL, + [datetime] DATETIME NOT NULL DEFAULT(SYSDATETIME()) + CONSTRAINT PK_product_outflow_records + PRIMARY KEY([id]), + CONSTRAINT FK_product_outflow_records FOREIGN KEY([barcode_product_value_id]) + REFERENCES [Tables].[product_values]([id]), + CONSTRAINT CHECK_product_outflow_records + CHECK([count] > 0) +); + +CREATE TABLE [Tables].[product_inflow_records]( + [id] INT NOT NULL IDENTITY(1, 1), + [barcode_product_value_id] INT NOT NULL, + [supplier_id] INT NOT NULL, + [count] INT NOT NULL, + [full_price] MONEY NOT NULL, + [datetime] DATETIME NOT NULL DEFAULT(SYSDATETIME()) + CONSTRAINT PK_product_inflow_records + PRIMARY KEY([id]) + CONSTRAINT FK_product_inflow_records_barcode_id FOREIGN KEY([barcode_product_value_id]) + REFERENCES [Tables].[product_values]([id]), + CONSTRAINT FK_product_inflow_records_supplier_id FOREIGN KEY([supplier_id]) + REFERENCES [Tables].[suppliers]([id]), + CONSTRAINT CHECK_product_inflow_records + CHECK([count] > 0 AND [full_price] >= 0) +); + +CREATE TABLE [Tables].[write_off_reasons]( + [id] INT NOT NULL IDENTITY(1, 1), + [name] NVARCHAR(128) NOT NULL, + CONSTRAINT PK_write_off_reasons + PRIMARY KEY([id]), +); + +CREATE TABLE [Tables].[product_write_off_records]( + [id] INT NOT NULL IDENTITY(1, 1), + [barcode_product_value_id] INT NOT NULL, + [reason_id] INT NOT NULL, + [count] INT NOT NULL, + [datetime] DATETIME NOT NULL DEFAULT(SYSDATETIME()) + CONSTRAINT PK_product_write_off_records + PRIMARY KEY([id]) + CONSTRAINT FK_product_write_off_records_barcode_id FOREIGN KEY([barcode_product_value_id]) + REFERENCES [Tables].[product_values]([id]), + CONSTRAINT FK_product_write_off_records_reason_id FOREIGN KEY([reason_id]) + REFERENCES [Tables].[write_off_reasons]([id]), + CONSTRAINT CHECK_product_write_off_records + CHECK([count] > 0) +); +GO \ No newline at end of file diff --git a/sqlscripts/functions/function-does_barcode_exist.sql b/sqlscripts/functions/function-does_barcode_exist.sql new file mode 100644 index 0000000..a78a22a --- /dev/null +++ b/sqlscripts/functions/function-does_barcode_exist.sql @@ -0,0 +1,19 @@ +USE [Database] + +IF OBJECT_ID('[Functions].[does_barcode_exist]') IS NOT NULL + DROP FUNCTION [Functions].[does_barcode_exist]; +GO +CREATE FUNCTION [Functions].[does_barcode_exist]( + @barcode AS BIGINT +) +RETURNS BIT +AS +BEGIN + IF EXISTS( + SELECT * + FROM [Tables].[products] + WHERE [barcode] = @barcode + ) + RETURN CAST(1 AS BIT); + RETURN CAST(0 AS BIT); +END diff --git a/sqlscripts/functions/function-does_product_exist_with_name.sql b/sqlscripts/functions/function-does_product_exist_with_name.sql new file mode 100644 index 0000000..51412de --- /dev/null +++ b/sqlscripts/functions/function-does_product_exist_with_name.sql @@ -0,0 +1,19 @@ +USE [Database] + +IF OBJECT_ID('[Functions].[does_product_exist_with_name]') IS NOT NULL + DROP FUNCTION [Functions].[does_product_exist_with_name]; +GO +CREATE FUNCTION [Functions].[does_product_exist_with_name]( + @name AS NVARCHAR(128) +) +RETURNS BIT +AS +BEGIN + IF EXISTS ( + SELECT * + FROM [Tables].[products] + WHERE [name] = @name + ) + RETURN CAST(1 AS BIT); + RETURN CAST(0 AS BIT); +END \ No newline at end of file diff --git a/sqlscripts/functions/function-does_product_exist_with_product_type_id.sql b/sqlscripts/functions/function-does_product_exist_with_product_type_id.sql new file mode 100644 index 0000000..ffc150c --- /dev/null +++ b/sqlscripts/functions/function-does_product_exist_with_product_type_id.sql @@ -0,0 +1,19 @@ +USE [Database] + +IF OBJECT_ID('[Functions].[does_product_exist_with_product_type_id]') IS NOT NULL + DROP FUNCTION [Functions].[does_product_exist_with_product_type_id]; +GO +CREATE FUNCTION [Functions].[does_product_exist_with_product_type_id]( + @product_type_id AS INT +) +RETURNS BIT +AS +BEGIN + IF EXISTS ( + SELECT * + FROM [Tables].[products] + WHERE [product_type_id] = @product_type_id + ) + RETURN CAST(1 AS BIT); + RETURN CAST(0 AS BIT); +END \ No newline at end of file diff --git a/sqlscripts/functions/function-does_product_type_exist_with_name.sql b/sqlscripts/functions/function-does_product_type_exist_with_name.sql new file mode 100644 index 0000000..a782403 --- /dev/null +++ b/sqlscripts/functions/function-does_product_type_exist_with_name.sql @@ -0,0 +1,19 @@ +USE [Database] + +IF OBJECT_ID('[Functions].[does_product_type_exist_with_name]') IS NOT NULL + DROP FUNCTION [Functions].[does_product_type_exist_with_name]; +GO +CREATE FUNCTION [Functions].[does_product_type_exist_with_name]( + @name AS NVARCHAR(128) +) +RETURNS BIT +AS +BEGIN + IF EXISTS ( + SELECT * + FROM [Tables].[product_types] + WHERE [name] = @name + ) + RETURN CAST(1 AS BIT); + RETURN CAST(0 AS BIT); +END \ No newline at end of file diff --git a/sqlscripts/functions/function-product_type_id.sql b/sqlscripts/functions/function-product_type_id.sql new file mode 100644 index 0000000..6e6b230 --- /dev/null +++ b/sqlscripts/functions/function-product_type_id.sql @@ -0,0 +1,17 @@ +USE [Database] + +IF OBJECT_ID('[Functions].[product_type_id]') IS NOT NULL + DROP FUNCTION [Functions].[product_type_id]; +GO +CREATE FUNCTION [Functions].[product_type_id]( + @product_id AS INT +) +RETURNS INT +BEGIN + DECLARE @product_type AS INT; + SET @product_type = ( + SELECT [product_type_id] + FROM [Tables].[products] + WHERE [id] = @product_id); + RETURN @product_type; +END diff --git a/sqlscripts/functions/function-same_products_join_product_types.sql b/sqlscripts/functions/function-same_products_join_product_types.sql new file mode 100644 index 0000000..98fbf18 --- /dev/null +++ b/sqlscripts/functions/function-same_products_join_product_types.sql @@ -0,0 +1,26 @@ +USE [Database] + +IF OBJECT_ID('[Functions].[same_products_join_product_types]') IS NOT NULL + DROP FUNCTION [Functions].[same_products_join_product_types]; +GO + +CREATE FUNCTION [Functions].[same_products_join_product_types]( + @product_type_id AS INT +) +RETURNS TABLE + RETURN + WITH [result] AS ( + SELECT [id], [parent_id], [name] + FROM [Tables].[product_types] + WHERE [id] = @product_type_id + ) + SELECT [P].[id] AS [product_id], + [P].[barcode] AS [product_barcode], + [P].[product_type_id], + [P].[name] AS [product_name], + [PT].[name] AS [product_type_name] + FROM [result] AS [R] + JOIN [Tables].[products] AS [P] + ON [P].[product_type_id] = [R].[id] + JOIN [Tables].[product_types] AS [PT] + ON [PT].[id] = [P].[product_type_id] \ No newline at end of file diff --git a/sqlscripts/functions/function-subgroup_products_join_product_types.sql b/sqlscripts/functions/function-subgroup_products_join_product_types.sql new file mode 100644 index 0000000..638d5e5 --- /dev/null +++ b/sqlscripts/functions/function-subgroup_products_join_product_types.sql @@ -0,0 +1,34 @@ +USE [Database] + +IF OBJECT_ID('[Functions].[subgroup_products_join_product_types]') IS NOT NULL + DROP FUNCTION [Functions].[subgroup_products_join_product_types]; +GO + +CREATE FUNCTION [Functions].[subgroup_products_join_product_types]( + @product_type_id AS INT +) +RETURNS TABLE + RETURN + WITH [result] AS + ( + SELECT [id], [parent_id], [name] + FROM [Tables].[product_types] + WHERE [id] = @product_type_id + + UNION ALL + + SELECT [PT].[id], [PT].[parent_id], [PT].[name] + FROM [result] AS [R] + JOIN [Tables].[product_types] AS [PT] + ON [PT].[parent_id] = [R].[id] + ) + SELECT [P].[id] AS [product_id], + [P].[barcode] AS [product_barcode], + [P].[product_type_id], + [P].[name] AS [product_name], + [PT].[name] AS [product_type_name] + FROM [result] AS [R] + JOIN [Tables].[products] AS [P] + ON [P].[product_type_id] = [R].[id] + JOIN [Tables].[product_types] AS [PT] + ON [PT].[id] = [P].[product_type_id] \ No newline at end of file diff --git a/sqlscripts/functions/unused/function-fill_CHAR_128.sql b/sqlscripts/functions/unused/function-fill_CHAR_128.sql new file mode 100644 index 0000000..e46a30e --- /dev/null +++ b/sqlscripts/functions/unused/function-fill_CHAR_128.sql @@ -0,0 +1,16 @@ +USE [Database] + +IF OBJECT_ID('[Functions].[fill_CHAR_128]') IS NOT NULL + DROP FUNCTION [Functions].[fill_CHAR_128]; +GO + +CREATE FUNCTION [Functions].[fill_CHAR_128]( + @string AS NVARCHAR(128), + @symbol AS NVARCHAR, + @width AS INT +) +RETURNS NVARCHAR(128) AS +BEGIN + RETURN CONCAT(REPLICATE(@symbol, @width - LEN(@string)), @string); +END +GO \ No newline at end of file diff --git a/sqlscripts/functions/unused/function-product_with_barcode_stock.sql b/sqlscripts/functions/unused/function-product_with_barcode_stock.sql new file mode 100644 index 0000000..24056ac --- /dev/null +++ b/sqlscripts/functions/unused/function-product_with_barcode_stock.sql @@ -0,0 +1,39 @@ +USE [Database] + +IF OBJECT_ID('[Functions].[product_with_barcode_stock]') IS NOT NULL + DROP FUNCTION [Functions].[product_with_barcode_stock]; +GO + +CREATE FUNCTION [Functions].[product_with_barcode_stock]( + @barcode AS BIGINT +) +RETURNS INT AS +BEGIN + DECLARE @product_inflow_sum AS INT; + SET @product_inflow_sum = ( + SELECT ISNULL(SUM([count]), 0) AS [sum] + FROM [Tables].[product_inflow_records] + WHERE [barcode] = @barcode + ); + DECLARE @result AS INT; + WITH [counts] AS ( + SELECT [POR].[count] AS [outflow_count], [PWOR].[count] AS [write_off_count] + FROM [Tables].[products] AS [P] + LEFT OUTER JOIN [Tables].[product_outflow_records] AS [POR] + ON [POR].[barcode] = [P].[barcode] + LEFT OUTER JOIN [Tables].[product_write_off_records] AS [PWOR] + ON [PWOR].[barcode] = [P].[barcode] + GROUP BY + GROUPING SETS + ( + ([POR].[count]), + ([PWOR].[count]) + ) + ) + SELECT @result = ( + @product_inflow_sum - ISNULL(SUM([outflow_count]), 0) - ISNULL(SUM([write_off_count]), 0) + ) + FROM [counts]; + RETURN @result; +END +GO \ No newline at end of file diff --git a/sqlscripts/initialize-tables.bat b/sqlscripts/initialize-tables.bat new file mode 100644 index 0000000..91e06ba --- /dev/null +++ b/sqlscripts/initialize-tables.bat @@ -0,0 +1,5 @@ +@echo off + +sqlcmd -S %SSMS_SERVER_NAME% -U %SSMS_USER_NAME% -P %SSMS_USER_PASSWORD% -i ^ +.\Initializing\initialize-all.sql ^ +-r1 1> NUL \ No newline at end of file diff --git a/sqlscripts/initializing/initialize-all.sql b/sqlscripts/initializing/initialize-all.sql new file mode 100644 index 0000000..f9d98db --- /dev/null +++ b/sqlscripts/initializing/initialize-all.sql @@ -0,0 +1,88 @@ +USE [Database] + +SET IDENTITY_INSERT [Tables].[product_types] ON; +INSERT INTO [Tables].[product_types]([id], [parent_id], [name]) +VALUES + (1, DEFAULT, N' '), + (2, 1, N''), + (3, 1, N' '), + (4, 1, N' '), + (5, 1, N' '), + (6, 5, N' '), + (7, 6, N' '), + (8, 6, N''), + (9, 6, N' '), + (10, 5, N' '), + (11, 1, N' '), + (12, 1, N''), + (13, 12, N' '), + (14, 13, N' '), + (15, DEFAULT, N' '), + (16, 15, N', , '), + (17, 16, N''), + (18, 15, N' '), + (19, 18, N''), + (20, 19, N''), + (21, 18, N', '), + (22, 21, N''), + (23, 18, N' '); +SET IDENTITY_INSERT [Tables].[product_types] OFF; + +SET IDENTITY_INSERT [Tables].[attributes] ON; +INSERT INTO [Tables].[attributes]([id], [name]) +VALUES + (1, 'Article number'), + (2, 'Date of manufacture'), + (3, 'Expiration date'), + (4, 'Unit'); +SET IDENTITY_INSERT [Tables].[attributes] OFF; + +SET IDENTITY_INSERT [Tables].[products] ON; +INSERT INTO [Tables].[products] ([id], [barcode], [name], [product_type_id]) +VALUES(1, 1111111111111, N'Hobby World ', 9), + (2, 2222222222222, N' Orbit Mega , , 16,4 ', 23), + (3, 3333333333333, N' Mentos Pure White , 15,5 ', 23); +SET IDENTITY_INSERT [Tables].[products] OFF; + +INSERT INTO [Tables].[product_attributes] ([product_id], [attribute_id]) +VALUES (2, 2), (2, 3), (3, 2), (3, 3); + +INSERT INTO [Tables].[product_values] ([product_id], [attribute_id], [value]) +-- ; +VALUES (2, 2, N'1900-01-01'), (2, 3, N'3650'), (3, 2, N'1900-01-01'), (3, 3, N'30'); + +SET IDENTITY_INSERT [Tables].[suppliers] ON; +INSERT INTO [Tables].[suppliers]([id], [name], [telephone_number], [address]) +VALUES + (1, N'First supplier', N'First telephone number', N'First address'), + (2, N'Second supplier', N'Second telephone number', N'Second address'), + (3, N'Thied supplier', N'Third telephone number', N'Third address'); +SET IDENTITY_INSERT [Tables].[suppliers] OFF; + +SET IDENTITY_INSERT [Tables].[product_inflow_records] ON; +INSERT INTO [Tables].[product_inflow_records] ([id], [product_id], [barcode], [supplier_id], [count], [full_price], [datetime]) +VALUES + (1, 1, 1111111111111, 1, 5, 10, N'1900-01-01'), + (2, 1, 1111111111111, 2, 5, 5, N'1900-01-01'), + (3, 2, 2222222222222, 3, 5, 10, N'1900-01-01'); +SET IDENTITY_INSERT [Tables].[product_inflow_records] OFF; + +SET IDENTITY_INSERT [Tables].[product_outflow_records] ON; +INSERT INTO [Tables].[product_outflow_records] ([id], [product_id], [barcode], [count], [datetime]) +VALUES + (2, 1, 1111111111111, 2, N'1900-01-01'), + (3, 1, 1111111111111, 3, N'1900-01-02') +SET IDENTITY_INSERT [Tables].[product_outflow_records] OFF; + +SET IDENTITY_INSERT [Tables].[write_off_reasons] ON; +INSERT INTO [Tables].[write_off_reasons]([id], [name]) +VALUES + (1, N' '), + (2, N' '); +SET IDENTITY_INSERT [Tables].[write_off_reasons] OFF; + +SET IDENTITY_INSERT [Tables].[product_write_off_records] ON; +INSERT INTO [Tables].[product_write_off_records] ([id], [product_id], [barcode], [reason_id], [count], [datetime]) +VALUES + (1, 1, 1111111111111, 2, 2, N'1900-01-03') +SET IDENTITY_INSERT [Tables].[product_write_off_records] OFF; \ No newline at end of file diff --git a/sqlscripts/initializing/unused/initialize-last-barcode.sql b/sqlscripts/initializing/unused/initialize-last-barcode.sql new file mode 100644 index 0000000..8f89fed --- /dev/null +++ b/sqlscripts/initializing/unused/initialize-last-barcode.sql @@ -0,0 +1,8 @@ +USE [Database] + +-- , +-- +SET IDENTITY_INSERT [Tables].[additional_variables] ON; +INSERT INTO [Tables].[additional_variables]([id], [name], [value]) +VALUES(1, N'last_barcode', N'-1'); +SET IDENTITY_INSERT [Tables].[additional_variables] OFF; \ No newline at end of file diff --git a/sqlscripts/initializing/version-with-denormalization/initialize-attributes.sql b/sqlscripts/initializing/version-with-denormalization/initialize-attributes.sql new file mode 100644 index 0000000..2eaa771 --- /dev/null +++ b/sqlscripts/initializing/version-with-denormalization/initialize-attributes.sql @@ -0,0 +1,12 @@ +USE [Database] + +-- , +-- +SET IDENTITY_INSERT [Tables].[attributes] ON; +INSERT INTO [Tables].[attributes]([id], [name]) +VALUES + (1, 'Article number'), + (2, 'Barcode'), + (3, 'Date of manufacture'), + (4, 'Expiration date'); +SET IDENTITY_INSERT [Tables].[attributes] OFF; \ No newline at end of file diff --git a/sqlscripts/initializing/version-with-denormalization/initialize-products.sql b/sqlscripts/initializing/version-with-denormalization/initialize-products.sql new file mode 100644 index 0000000..be2ce3c --- /dev/null +++ b/sqlscripts/initializing/version-with-denormalization/initialize-products.sql @@ -0,0 +1,65 @@ +USE [Database] + +DECLARE + @article_number_attribute_id AS INT, + @barcode_attribute_id AS INT, + @date_of_manufacture_attribute_id AS INT, + @expiration_date_attribute_id AS INT; + +SET @article_number_attribute_id = + (SELECT [id] + FROM [Tables].[attributes] + WHERE [name] = N'Article number'); +SET @barcode_attribute_id = + (SELECT [id] + FROM [Tables].[attributes] + WHERE [name] = N'Barcode'); +SET @date_of_manufacture_attribute_id = + (SELECT [id] + FROM [Tables].[attributes] + WHERE [name] = N'Date of manufacture'); +SET @expiration_date_attribute_id = + (SELECT [id] + FROM [Tables].[attributes] + WHERE [name] = N'Expiration date'); + +DECLARE + @product_id_1 AS INT, + @product_id_2 AS INT, + @product_id_3 AS INT, + @product_id_4 AS INT; + +EXECUTE [Procedures].[insert_product] + @name = N'Hobby World ', + @product_type_id = 9, -- + @barcode_attribute_id = @barcode_attribute_id, + @inserted_product_id = @product_id_1 OUTPUT; +EXECUTE [Procedures].[insert_product] + @name = N' Orbit Mega , , 16,4 ', + @product_type_id = 23, -- + @barcode_attribute_id = @barcode_attribute_id, + @inserted_product_id = @product_id_2 OUTPUT; +EXECUTE [Procedures].[insert_product] + @name = N' Mentos Pure White , 15,5 ', + @product_type_id = 23, -- + @barcode_attribute_id = @barcode_attribute_id, + @inserted_product_id = @product_id_3 OUTPUT; +EXECUTE [Procedures].[insert_product] + @name = N' Oreo, , 228 ', + @product_type_id = 22, -- + @barcode_attribute_id = @barcode_attribute_id, + @inserted_product_id = @product_id_4 OUTPUT; + +INSERT INTO [Tables].[product_attributes]([product_id], [attribute_id]) +VALUES + (@product_id_2, 3), + (@product_id_2, 4), + (@product_id_3, 3), + (@product_id_3, 4); + +INSERT INTO [Tables].[product_values]([product_id], [attribute_id], [value]) +VALUES + (2, 3, N'1900-01-01'), -- + (2, 4, N'3650'), -- + (3, 3, N'1900-01-01'), + (3, 4, N'30'); \ No newline at end of file diff --git a/sqlscripts/procedures/specific-procedures/procedure-products_join_product_types.sql b/sqlscripts/procedures/specific-procedures/procedure-products_join_product_types.sql new file mode 100644 index 0000000..448464b --- /dev/null +++ b/sqlscripts/procedures/specific-procedures/procedure-products_join_product_types.sql @@ -0,0 +1,16 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[products_join_product_types]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[products_join_product_types]; +GO + +CREATE PROCEDURE [Procedures].[products_join_product_types] +AS + SELECT [P].[id] AS [product_id], [P].[barcode], + [P].[product_type_id] AS [product_type_id], + [P].[name] AS [product_name], + [PT].[name] AS [product_type_name] + FROM [Tables].[products] AS [P] + JOIN [Tables].[product_types] AS [PT] + ON [PT].[id] = [P].[product_type_id] +GO \ No newline at end of file diff --git a/sqlscripts/procedures/specific-procedures/procedure-rename_product.sql b/sqlscripts/procedures/specific-procedures/procedure-rename_product.sql new file mode 100644 index 0000000..2bcb8aa --- /dev/null +++ b/sqlscripts/procedures/specific-procedures/procedure-rename_product.sql @@ -0,0 +1,14 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[rename_product]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[rename_product]; +GO +CREATE PROCEDURE [Procedures].[rename_product] + @product_id AS INT, + @name AS NVARCHAR(128) +AS + UPDATE [Tables].[products] + SET + [name] = @name + WHERE [id] = @product_id; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/specific-procedures/procedure-rename_product_type.sql b/sqlscripts/procedures/specific-procedures/procedure-rename_product_type.sql new file mode 100644 index 0000000..d38d73b --- /dev/null +++ b/sqlscripts/procedures/specific-procedures/procedure-rename_product_type.sql @@ -0,0 +1,14 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[rename_product_type]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[rename_product_type]; +GO +CREATE PROCEDURE [Procedures].[rename_product_type] + @product_type_id AS INT, + @name AS NVARCHAR(128) +AS + UPDATE [Tables].[product_types] + SET + [name] = @name + WHERE [id] = @product_type_id; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/specific-procedures/procedure-specify_product_type.sql b/sqlscripts/procedures/specific-procedures/procedure-specify_product_type.sql new file mode 100644 index 0000000..e97bf36 --- /dev/null +++ b/sqlscripts/procedures/specific-procedures/procedure-specify_product_type.sql @@ -0,0 +1,27 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[specify_product_type]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[specify_product_type]; +GO +CREATE PROCEDURE [Procedures].[specify_product_type] + @parent_id INT = NULL, + @name NVARCHAR(128), + @inserted_product_type_id AS INT = NULL OUTPUT +AS + BEGIN TRANSACTION; + SET NOCOUNT ON; + + INSERT INTO [Tables].[product_types]([parent_id], [name]) + VALUES(DEFAULT, @name); + SET @inserted_product_type_id = SCOPE_IDENTITY(); + + UPDATE [Tables].[products] + SET [product_type_id] = @inserted_product_type_id + WHERE [product_type_id] = @parent_id; + + UPDATE [Tables].[product_types] + SET [parent_id] = @parent_id + WHERE [id] = @inserted_product_type_id + + COMMIT TRANSACTION; +GO diff --git a/sqlscripts/procedures/specific-procedures/procedure-update_barcode.sql b/sqlscripts/procedures/specific-procedures/procedure-update_barcode.sql new file mode 100644 index 0000000..f810598 --- /dev/null +++ b/sqlscripts/procedures/specific-procedures/procedure-update_barcode.sql @@ -0,0 +1,18 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[update_barcode]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[update_barcode]; +GO +CREATE PROCEDURE [Procedures].[update_barcode] + @product_id INT, + @barcode BIGINT +AS + BEGIN TRANSACTION; + SET NOCOUNT ON; + + UPDATE [Tables].[products] + SET [barcode] = @barcode + WHERE [id] = @product_id + + COMMIT TRANSACTION; +GO diff --git a/sqlscripts/procedures/specific-procedures/unused/procedure-get_next_barcode.sql b/sqlscripts/procedures/specific-procedures/unused/procedure-get_next_barcode.sql new file mode 100644 index 0000000..d01a9e2 --- /dev/null +++ b/sqlscripts/procedures/specific-procedures/unused/procedure-get_next_barcode.sql @@ -0,0 +1,22 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[get_next_barcode]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[get_next_barcode]; +GO +CREATE PROCEDURE [Procedures].[get_next_barcode] + @next_barcode AS BIGINT OUTPUT +AS + BEGIN TRANSACTION; + SET NOCOUNT ON; + + SET @next_barcode = ( + SELECT CAST([value] AS BIGINT) + 1 + FROM [Tables].[additional_variables] + WHERE [id] = 1 + ); + + UPDATE [Tables].[additional_variables] + SET [value] = CAST(@next_barcode AS NVARCHAR(13)) + WHERE [id] = 1; + COMMIT TRANSACTION; +GO diff --git a/sqlscripts/procedures/specific-procedures/unused/procedure-insert_or_update_barcode.sql b/sqlscripts/procedures/specific-procedures/unused/procedure-insert_or_update_barcode.sql new file mode 100644 index 0000000..5772e00 --- /dev/null +++ b/sqlscripts/procedures/specific-procedures/unused/procedure-insert_or_update_barcode.sql @@ -0,0 +1,79 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[insert_or_update_barcode]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[insert_or_update_barcode]; +GO +CREATE PROCEDURE [Procedures].[insert_or_update_barcode] + @product_id AS INT, + @barcode_attribute_id AS INT, + @barcode AS BIGINT = NULL, + @record_id AS INT = NULL OUTPUT +AS + BEGIN TRANSACTION; + SET NOCOUNT ON; + + IF @barcode IS NOT NULL AND EXISTS( + SELECT * + FROM [Tables].[product_values] + WHERE [attribute_id] = @barcode_attribute_id + AND CAST([value] AS BIGINT) = @barcode + ) + BEGIN; + IF @@TRANCOUNT > 0 + ROLLBACK TRANSACTION; + THROW 53000, 'The barcode is not unique', 1; + END; + + CREATE TABLE [Tables].[#existing_hash_codes]( + [hash_code] NVARCHAR(13) + ); + INSERT INTO [#existing_hash_codes]([hash_code]) + SELECT [value] + FROM [Tables].[product_attributes] AS [pa] + JOIN [Tables].[product_values] AS [pv] + ON [pv].[product_id] = [pa].[product_id] + AND [pv].[attribute_id] = [pa].[attribute_id] + WHERE [pa].[attribute_id] = @barcode_attribute_id + + -- begin creating barcode + IF @barcode IS NULL + EXECUTE [Procedures].[get_next_barcode] @next_barcode = @barcode OUTPUT; + + WHILE EXISTS( + SELECT * + FROM [#existing_hash_codes] + WHERE CAST([hash_code] AS BIGINT) = @barcode + ) + OR EXISTS( + SELECT * + FROM [Tables].[product_values] + WHERE [attribute_id] = @barcode_attribute_id + AND CAST([value] AS BIGINT) = @barcode + ) + BEGIN + SET @barcode += 1; + END + -- end creating barcode + + IF EXISTS( + SELECT * + FROM [Tables].[product_values] + WHERE [attribute_id] = @barcode_attribute_id + AND [product_id] = @product_id + AND [value] IS NOT NULL + ) + BEGIN + UPDATE [Tables].[product_values] + SET @record_id = [id], + [value] = [Functions].[to_barcode_ean_13](@barcode) + WHERE [product_id] = @product_id + AND [attribute_id] = @barcode_attribute_id; + END + ELSE BEGIN + INSERT INTO [Tables].[product_values]([product_id], [attribute_id], [value]) + VALUES(@product_id, @barcode_attribute_id, [Functions].[to_barcode_ean_13](@barcode)); + SET @record_id = SCOPE_IDENTITY(); + END + + COMMIT TRANSACTION; +GO diff --git a/sqlscripts/procedures/specific-procedures/unused/procedure-product-properties.sql b/sqlscripts/procedures/specific-procedures/unused/procedure-product-properties.sql new file mode 100644 index 0000000..0968d2a --- /dev/null +++ b/sqlscripts/procedures/specific-procedures/unused/procedure-product-properties.sql @@ -0,0 +1,16 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[product-properties]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[product-properties]; +GO +CREATE PROCEDURE [Procedures].[product-properties] + @product_id AS INT +AS +SELECT [A].[id], [A].[name], [PV].[value] +FROM [Tables].[product_attributes] AS [PA] +LEFT OUTER JOIN [Tables].[product_values] AS [PV] +ON [PV].[product_id] = [PA].[product_id] + AND [PV].[attribute_id] = [PA].[attribute_id] +JOIN [Tables].[attributes] AS [A] +ON [A].[id] = [PA].[attribute_id] +WHERE [PA].[product_id] = @product_id; \ No newline at end of file diff --git a/sqlscripts/procedures/specific-procedures/unused/procedure-select_expired_products.sql b/sqlscripts/procedures/specific-procedures/unused/procedure-select_expired_products.sql new file mode 100644 index 0000000..7df7329 --- /dev/null +++ b/sqlscripts/procedures/specific-procedures/unused/procedure-select_expired_products.sql @@ -0,0 +1,31 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[select_expired_products]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[select_expired_products]; +GO +CREATE PROCEDURE [Procedures].[select_expired_products] + @date_of_manufacture_attribute_id AS INT , + @expiration_date_attribute_id AS INT , + @actual_date AS DATE +AS +WITH [values] AS ( + SELECT [p].[id], [pa].[attribute_id], [pv].[value] + FROM [Tables].[products] AS [p] + JOIN [Tables].[product_attributes] AS [pa] + ON [pa].[product_id] = [p].[id] + JOIN [Tables].[product_values] AS [pv] + ON [pv].[attribute_id] = [pa].[attribute_id] + AND [pv].[product_id] = [pa].[product_id] + WHERE [pa].[attribute_id] IN (@date_of_manufacture_attribute_id, @expiration_date_attribute_id) +) +SELECT [date_of_manufacture_attributes].[id] +FROM [values] AS date_of_manufacture_attributes +JOIN [values] AS expiration_date_attributes + ON [expiration_date_attributes].[id] = [date_of_manufacture_attributes].[id] + AND [expiration_date_attributes].[attribute_id] = @expiration_date_attribute_id +WHERE [date_of_manufacture_attributes].[attribute_id] = @date_of_manufacture_attribute_id + AND DATEADD( + DAY, CAST([expiration_date_attributes].[value] AS INT), + CAST([date_of_manufacture_attributes].[value] AS DATE) + ) < @actual_date; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/specific-procedures/unused/procedure-tree_positions.sql b/sqlscripts/procedures/specific-procedures/unused/procedure-tree_positions.sql new file mode 100644 index 0000000..1dc9c5e --- /dev/null +++ b/sqlscripts/procedures/specific-procedures/unused/procedure-tree_positions.sql @@ -0,0 +1,37 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[tree_positions]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[tree_positions]; +GO + +CREATE PROCEDURE [Procedures].[tree_positions] + @product_type_id INT +AS +IF OBJECT_ID('[tempdb].[dbo].[#product_types_row_number]') IS NOT NULL + DROP TABLE [dbo].[#product_types_row_number]; +CREATE TABLE [#product_types_row_number] +( + [id] INT NOT NULL, + [parent_id] INT, + [row_number] INT NOT NULL +); +INSERT INTO [#product_types_row_number] + SELECT [id], [parent_id], ROW_NUMBER() OVER (PARTITION BY [parent_id] ORDER BY [parent_id], [id] ASC) - 1 + FROM [Tables].[product_types]; + +WITH [result] AS ( +SELECT + [id], [parent_id], [row_number] +FROM [#product_types_row_number] +WHERE [id] = @product_type_id + +UNION ALL + +SELECT [PT].[id], [PT].[parent_id], [PT].[row_number] +FROM [result] AS [R] +JOIN [#product_types_row_number] AS [PT] +ON [PT].[id] = [R].[parent_id] +) +SELECT [id], [parent_id], [row_number] +FROM [result] +ORDER BY [id]; \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/insertion-procedures/procedure-insert_product.sql b/sqlscripts/procedures/standard-procedures/insertion-procedures/procedure-insert_product.sql new file mode 100644 index 0000000..9158248 --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/insertion-procedures/procedure-insert_product.sql @@ -0,0 +1,17 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[insert_product]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[insert_product]; +GO +CREATE PROCEDURE [Procedures].[insert_product] + @name AS NVARCHAR(128), + @product_type_id AS INT, + @barcode AS BIGINT, + @inserted_product_id AS INT = NULL OUTPUT +AS + BEGIN TRANSACTION; + INSERT INTO [Tables].[products]([barcode], [name], [product_type_id]) + VALUES(@barcode, @name, @product_type_id); + SET @inserted_product_id = SCOPE_IDENTITY(); + COMMIT TRANSACTION; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/insertion-procedures/procedure-insert_product_attribute.sql b/sqlscripts/procedures/standard-procedures/insertion-procedures/procedure-insert_product_attribute.sql new file mode 100644 index 0000000..8e7620b --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/insertion-procedures/procedure-insert_product_attribute.sql @@ -0,0 +1,14 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[insert_product_attribute]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[insert_product_attribute]; +GO +CREATE PROCEDURE [Procedures].[insert_product_attribute] + @product_id AS INT, + @attribute_id AS INT +AS + BEGIN TRANSACTION; + INSERT INTO [Tables].[product_attributes]([product_id], [attribute_id]) + VALUES (@product_id, @attribute_id); + COMMIT TRANSACTION; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/insertion-procedures/procedure-insert_product_type.sql b/sqlscripts/procedures/standard-procedures/insertion-procedures/procedure-insert_product_type.sql new file mode 100644 index 0000000..f360a15 --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/insertion-procedures/procedure-insert_product_type.sql @@ -0,0 +1,26 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[insert_product_type]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[insert_product_type]; +GO +CREATE PROCEDURE [Procedures].[insert_product_type] + @parent_id AS INT = NULL, + @name AS NVARCHAR(128), + @inserted_product_type_id AS INT = NULL OUTPUT +AS + BEGIN TRY + INSERT INTO [Tables].[product_types]([parent_id], [name]) + VALUES(@parent_id, @name); + SET @inserted_product_type_id = SCOPE_IDENTITY(); + END TRY + BEGIN CATCH + DECLARE @message NVARCHAR(128); + SET @message = + 'Cannot create [a] subgroup. Cause: the group ' + + '(name: "'+ (SELECT [name] FROM [Tables].[product_types] WHERE [id] = @parent_id) +'"; [id]:'+ LTRIM(STR(@parent_id)) +')' + + ' is referenced by [a] product object.'; + PRINT 'Actual error number: ' + CAST(ERROR_NUMBER() AS NVARCHAR(10)); + PRINT 'Actual line number: ' + CAST(ERROR_LINE() AS NVARCHAR(10)); + THROW 51000, @message, 1; + END CATCH +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/insertion-procedures/procedure-insert_product_value.sql b/sqlscripts/procedures/standard-procedures/insertion-procedures/procedure-insert_product_value.sql new file mode 100644 index 0000000..7b94c79 --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/insertion-procedures/procedure-insert_product_value.sql @@ -0,0 +1,15 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[insert_product_value]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[insert_product_value]; +GO +CREATE PROCEDURE [Procedures].[insert_product_value] + @product_id AS INT, + @attribute_id AS INT, + @value AS NVARCHAR(128) +AS + BEGIN TRANSACTION; + INSERT INTO [Tables].[product_values]([product_id], [attribute_id], [value]) + VALUES (@product_id, @attribute_id, @value); + COMMIT TRANSACTION; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/insertion-procedures/version-with-denormalization/procedure-insert_product.sql b/sqlscripts/procedures/standard-procedures/insertion-procedures/version-with-denormalization/procedure-insert_product.sql new file mode 100644 index 0000000..c324b6e --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/insertion-procedures/version-with-denormalization/procedure-insert_product.sql @@ -0,0 +1,20 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[insert_product]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[insert_product]; +GO +CREATE PROCEDURE [Procedures].[insert_product] + @name AS NVARCHAR(128), + @product_type_id AS INT, + @barcode_attribute_id AS INT, + @inserted_product_id AS INT = NULL OUTPUT +AS + BEGIN TRANSACTION; + INSERT INTO [Tables].[products]([barcode], [name], [product_type_id]) + VALUES(@name, @product_type_id); + SET @inserted_product_id = SCOPE_IDENTITY(); + + INSERT INTO [Tables].[product_attributes]([product_id], [attribute_id]) + VALUES (@inserted_product_id, @barcode_attribute_id); + COMMIT TRANSACTION; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/removal-procedures/procedure-delete_product_type.sql b/sqlscripts/procedures/standard-procedures/removal-procedures/procedure-delete_product_type.sql new file mode 100644 index 0000000..4f43663 --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/removal-procedures/procedure-delete_product_type.sql @@ -0,0 +1,23 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[delete_product_type]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[delete_product_type]; +GO +CREATE PROCEDURE [Procedures].[delete_product_type] + @product_type_id AS INT +AS + DECLARE @newParentId INT; + SET @newParentId = ( + SELECT [parent_id] + FROM [Tables].[product_types] + WHERE [id] = @product_type_id + ) + BEGIN TRANSACTION; + UPDATE [Tables].[product_types] + SET [parent_id] = @newParentId + WHERE [parent_id] = @product_type_id + + DELETE FROM [Tables].[product_types] + WHERE [id] = @product_type_id; + COMMIT TRANSACTION; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/removal-procedures/procedures-delete_product.sql b/sqlscripts/procedures/standard-procedures/removal-procedures/procedures-delete_product.sql new file mode 100644 index 0000000..46e2e7a --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/removal-procedures/procedures-delete_product.sql @@ -0,0 +1,17 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[delete_product]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[delete_product]; +GO +CREATE PROCEDURE [Procedures].[delete_product] + @product_id AS INT +AS + BEGIN TRANSACTION; + DELETE FROM [Tables].[product_values] + WHERE [product_id] = @product_id; + DELETE FROM [Tables].[product_attributes] + WHERE [product_id] = @product_id; + DELETE FROM [Tables].[products] + WHERE [id] = @product_id; + COMMIT TRANSACTION; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_attribute.sql b/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_attribute.sql new file mode 100644 index 0000000..76a0bc3 --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_attribute.sql @@ -0,0 +1,15 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[insert_attribute]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[insert_attribute]; +GO +CREATE PROCEDURE [Procedures].[insert_attribute] + @name AS NVARCHAR(128), + @inserted_attribute_id AS INT = NULL OUTPUT +AS + BEGIN TRANSACTION; + INSERT INTO [Tables].[attributes]([name]) + VALUES (@name); + SET @inserted_attribute_id = SCOPE_IDENTITY(); + COMMIT TRANSACTION; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_price_history_record.sql b/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_price_history_record.sql new file mode 100644 index 0000000..8af1972 --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_price_history_record.sql @@ -0,0 +1,17 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[insert_price_history_record]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[insert_price_history_record]; +GO +CREATE PROCEDURE [Procedures].[insert_price_history_record] + @product_id AS INT, + @datetime AS DATETIME, + @price AS MONEY, + @inserted_price_history_record_id INT = NULL OUTPUT +AS + BEGIN TRANSACTION; + INSERT INTO [Tables].[price_history_records]([product_id], [datetime], [price]) + VALUES (@product_id, @datetime, @price); + SET @inserted_price_history_record_id = SCOPE_IDENTITY(); + COMMIT TRANSACTION; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_product_inflow_record.sql b/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_product_inflow_record.sql new file mode 100644 index 0000000..fe8acd7 --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_product_inflow_record.sql @@ -0,0 +1,20 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[insert_product_inflow_record]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[insert_product_inflow_record]; +GO +CREATE PROCEDURE [Procedures].[insert_product_inflow_record] + @barcode_product_value_id AS INT, + @barcode_product_attribute_id AS INT, + @supplier_id AS INT, + @count AS INT, + @full_price AS INT, + @datetime AS DATETIME, + @inserted_product_inflow_record_id INT = NULL OUTPUT +AS + BEGIN TRANSACTION; + INSERT INTO [Tables].[product_inflow_records]([barcode_product_value_id], [supplier_id], [count], [full_price], [datetime]) + VALUES (@barcode_product_value_id, @supplier_id, @count, @full_price, @datetime); + SET @inserted_product_inflow_record_id = SCOPE_IDENTITY(); + COMMIT TRANSACTION; +GO diff --git a/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_product_outflow_record.sql b/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_product_outflow_record.sql new file mode 100644 index 0000000..4801313 --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_product_outflow_record.sql @@ -0,0 +1,17 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[insert_product_outflow_record]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[insert_product_outflow_record]; +GO +CREATE PROCEDURE [Procedures].[insert_product_outflow_record] + @barcode_product_outflow_record_id AS INT, + @count AS INT, + @datetime AS DATETIME, + @inserted_product_outflow_records INT = NULL OUTPUT +AS + BEGIN TRANSACTION; + INSERT INTO [Tables].[product_outflow_records]([barcode_product_value_id], [count], [datetime]) + VALUES (@barcode_product_outflow_record_id, @count, @datetime); + SET @inserted_product_outflow_records = SCOPE_IDENTITY(); + COMMIT TRANSACTION; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_product_value.sql b/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_product_value.sql new file mode 100644 index 0000000..4d2144a --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_product_value.sql @@ -0,0 +1,17 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[insert_product_value]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[insert_product_value]; +GO +CREATE PROCEDURE [Procedures].[insert_product_value] + @product_id AS INT, + @attribute_id AS INT, + @value AS NVARCHAR(128), + @inserted_product_value_id INT = NULL OUTPUT +AS + BEGIN TRANSACTION; + INSERT INTO [Tables].[product_values]([product_id], [attribute_id], [value]) + VALUES (@product_id, @attribute_id, @value); + SET @inserted_product_value_id = SCOPE_IDENTITY(); + COMMIT TRANSACTION; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_product_write_off_record.sql b/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_product_write_off_record.sql new file mode 100644 index 0000000..a6bc517 --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_product_write_off_record.sql @@ -0,0 +1,18 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[insert_product_write_off_record]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[insert_product_write_off_record]; +GO +CREATE PROCEDURE [Procedures].[insert_product_write_off_record] + @barcode_product_value_id AS INT, + @reason_id AS INT, + @count AS INT, + @datetime AS DATETIME, + @inserted_product_write_off_record_id AS INT = NULL OUTPUT +AS + BEGIN TRANSACTION; + INSERT INTO [Tables].[product_write_off_records]([barcode_product_value_id], [reason_id], [count], [datetime]) + VALUES (@barcode_product_value_id, @reason_id, @count, @datetime); + SET @inserted_product_write_off_record_id = SCOPE_IDENTITY(); + COMMIT TRANSACTION; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_supplier.sql b/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_supplier.sql new file mode 100644 index 0000000..827921f --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_supplier.sql @@ -0,0 +1,17 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[insert_supplier]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[insert_supplier]; +GO +CREATE PROCEDURE [Procedures].[insert_supplier] + @name AS NVARCHAR(128), + @address AS NVARCHAR(128), + @telephone_number AS NVARCHAR(128), + @inserted_supplier_id AS INT = NULL OUTPUT +AS + BEGIN TRANSACTION; + INSERT INTO [Tables].[suppliers]([name], [address], [telephone_number]) + VALUES (@name, @address, @telephone_number); + SET @inserted_supplier_id = SCOPE_IDENTITY(); + COMMIT TRANSACTION; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_write_off_reason.sql b/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_write_off_reason.sql new file mode 100644 index 0000000..42def95 --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/insertion-procedures/procedure-insert_write_off_reason.sql @@ -0,0 +1,15 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[insert_write_off_reason]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[insert_write_off_reason]; +GO +CREATE PROCEDURE [Procedures].[insert_write_off_reason] + @name AS NVARCHAR(128), + @inserted_write_off_reason_id AS INT = NULL OUTPUT +AS + BEGIN TRANSACTION; + INSERT INTO [Tables].[write_off_reasons]([name]) + VALUES (@name); + SET @inserted_write_off_reason_id = SCOPE_IDENTITY(); + COMMIT TRANSACTION; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedure-delete_product_inflow_record.sql b/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedure-delete_product_inflow_record.sql new file mode 100644 index 0000000..bff9dd6 --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedure-delete_product_inflow_record.sql @@ -0,0 +1,11 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[delete_product_inflow_record]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[delete_product_inflow_record]; +GO +CREATE PROCEDURE [Procedures].[delete_product_inflow_record] + @product_inflow_record_id AS INT +AS + DELETE FROM [Tables].[product_inflow_records] + WHERE [id] = @product_inflow_record_id; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedure-delete_product_type.sql b/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedure-delete_product_type.sql new file mode 100644 index 0000000..8b9521d --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedure-delete_product_type.sql @@ -0,0 +1,11 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[delete_product_type]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[delete_product_type]; +GO +CREATE PROCEDURE [Procedures].[delete_product_type] + @product_type_id AS INT +AS + DELETE FROM [Tables].[product_types] + WHERE [id] = @product_type_id; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedure-delete_write_off_reason.sql b/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedure-delete_write_off_reason.sql new file mode 100644 index 0000000..003ab72 --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedure-delete_write_off_reason.sql @@ -0,0 +1,11 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[delete_product_write_off_record]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[delete_product_write_off_record]; +GO +CREATE PROCEDURE [Procedures].[delete_product_write_off_record] + @product_write_off_record_id AS INT +AS + DELETE FROM [Tables].[product_write_off_records] + WHERE [id] = @product_write_off_record_id; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedures-delete_attribute.sql b/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedures-delete_attribute.sql new file mode 100644 index 0000000..2c8cd3d --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedures-delete_attribute.sql @@ -0,0 +1,11 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[delete_attribute]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[delete_attribute]; +GO +CREATE PROCEDURE [Procedures].[delete_attribute] + @attribute_id AS INT +AS + DELETE FROM [Tables].[attributes] + WHERE [id] = @attribute_id; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedures-delete_price_history_record.sql b/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedures-delete_price_history_record.sql new file mode 100644 index 0000000..a1a2dba --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedures-delete_price_history_record.sql @@ -0,0 +1,11 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[delete_price_history_record]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[delete_price_history_record]; +GO +CREATE PROCEDURE [Procedures].[delete_price_history_record] + @price_history_record_id AS INT +AS + DELETE FROM [Tables].[price_history_records] + WHERE [id] = @price_history_record_id; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedures-delete_product_attribute.sql b/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedures-delete_product_attribute.sql new file mode 100644 index 0000000..0d1ec9f --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedures-delete_product_attribute.sql @@ -0,0 +1,13 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[delete_product_attribute]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[delete_product_attribute]; +GO +CREATE PROCEDURE [Procedures].[delete_product_attribute] + @product_id AS INT, + @product_attribute_id AS INT +AS + DELETE FROM [Tables].[product_attributes] + WHERE [product_id] = @product_attribute_id + AND [attribute_id] = @product_attribute_id +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedures-delete_product_outflow_record.sql b/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedures-delete_product_outflow_record.sql new file mode 100644 index 0000000..f9bdee9 --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedures-delete_product_outflow_record.sql @@ -0,0 +1,11 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[delete_product_outflow_record]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[delete_product_outflow_record]; +GO +CREATE PROCEDURE [Procedures].[delete_product_outflow_record] + @product_outflow_record_id AS INT +AS + DELETE FROM [Tables].[product_outflow_records] + WHERE [id] = @product_outflow_record_id; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedures-delete_product_value.sql b/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedures-delete_product_value.sql new file mode 100644 index 0000000..619c1b7 --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedures-delete_product_value.sql @@ -0,0 +1,11 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[delete_product_value]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[delete_product_value]; +GO +CREATE PROCEDURE [Procedures].[delete_product_value] + @product_value_id AS INT +AS + DELETE FROM [Tables].[product_values] + WHERE [id] = @product_value_id; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedures-delete_supplier.sql b/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedures-delete_supplier.sql new file mode 100644 index 0000000..2676b22 --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/removal-procedures/procedures-delete_supplier.sql @@ -0,0 +1,11 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[delete_supplier]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[delete_supplier]; +GO +CREATE PROCEDURE [Procedures].[delete_supplier] + @supplier_id AS INT +AS + DELETE FROM [Tables].[suppliers] + WHERE [id] = @supplier_id; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_attribute.sql b/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_attribute.sql new file mode 100644 index 0000000..a363011 --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_attribute.sql @@ -0,0 +1,13 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[update_attribute]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[update_attribute]; +GO +CREATE PROCEDURE [Procedures].[update_attribute] + @attribute_id AS INT, + @name AS NVARCHAR(128) +AS + UPDATE [Tables].[attributes] + SET [name] = @name + WHERE [id] = @attribute_id; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_price_history_record.sql b/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_price_history_record.sql new file mode 100644 index 0000000..3112c4f --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_price_history_record.sql @@ -0,0 +1,18 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[update_price_history_record]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[update_price_history_record]; +GO +CREATE PROCEDURE [Procedures].[update_price_history_record] + @price_history_record_id AS INT, + @product_id AS INT, + @datetime AS DATETIME, + @price AS MONEY +AS + UPDATE [Tables].[price_history_records] + SET + [product_id] = @product_id, + [datetime] = @datetime, + [price] = @price + WHERE [id] = @price_history_record_id; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_product.sql b/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_product.sql new file mode 100644 index 0000000..55b55d5 --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_product.sql @@ -0,0 +1,17 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[update_product]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[update_product]; +GO +CREATE PROCEDURE [Procedures].[update_product] + @product_id AS INT, + @name AS NVARCHAR(128), + @product_type_id AS INT, + @barcode_attribute_id AS INT +AS + UPDATE [Tables].[products] + SET + [name] = @name, + [product_type_id] = @product_type_id + WHERE [id] = @product_id; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_product_inflow_record.sql b/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_product_inflow_record.sql new file mode 100644 index 0000000..1474ee5 --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_product_inflow_record.sql @@ -0,0 +1,22 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[update_product_inflow_record]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[update_product_inflow_record]; +GO +CREATE PROCEDURE [Procedures].[update_product_inflow_record] + @product_inflow_record_id AS INT, + @barcode_product_value_id AS INT, + @supplier_id AS INT, + @count AS INT, + @full_price AS INT, + @datetime AS DATETIME +AS + UPDATE [Tables].[product_inflow_records] + SET + [barcode_product_value_id] = @barcode_product_value_id, + [supplier_id] = @supplier_id, + [count] = @count, + [full_price] = @full_price, + [datetime] = @datetime + WHERE [id] = @product_inflow_record_id; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_product_outflow_record.sql b/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_product_outflow_record.sql new file mode 100644 index 0000000..459322d --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_product_outflow_record.sql @@ -0,0 +1,19 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[update_product_outflow_record]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[update_product_outflow_record]; +GO +CREATE PROCEDURE [Procedures].[update_product_outflow_record] + @product_outflow_record_id AS INT, + @barcode_product_value_record_id AS INT, + @count AS INT, + @datetime AS INT, + @inserted_product_outflow_records AS INT = NULL OUTPUT +AS + UPDATE [Tables].[product_outflow_records] + SET + [barcode_product_value_id] = @barcode_product_value_record_id, + [count] = @count, + [datetime] = @datetime + WHERE [id] = @product_outflow_record_id; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_product_type.sql b/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_product_type.sql new file mode 100644 index 0000000..6703d61 --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_product_type.sql @@ -0,0 +1,17 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[update_product_type]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[update_product_type]; +GO +CREATE PROCEDURE [Procedures].[update_product_type] + @product_type_id AS INT, + @parent_id AS INT = NULL, + @name AS NVARCHAR(128) +AS + UPDATE [Tables].[product_types] + SET + [parent_id] = @parent_id, + [name] = @name + WHERE [id] = @product_type_id; +GO + diff --git a/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_product_value.sql b/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_product_value.sql new file mode 100644 index 0000000..8f65c90 --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_product_value.sql @@ -0,0 +1,18 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[update_product_value]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[update_product_value]; +GO +CREATE PROCEDURE [Procedures].[update_product_value] + @product_value_id AS INT, + @product_id AS INT, + @attribute_id AS INT, + @value AS NVARCHAR(128) +AS + UPDATE [Tables].[product_values] + SET + [product_id] = @product_id, + [attribute_id] = @attribute_id, + [value] = @value + WHERE [id] = @product_value_id; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_product_write_off_record.sql b/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_product_write_off_record.sql new file mode 100644 index 0000000..bef475f --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_product_write_off_record.sql @@ -0,0 +1,20 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[update_product_write_off_record]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[update_product_write_off_record]; +GO +CREATE PROCEDURE [Procedures].[update_product_write_off_record] + @product_write_off_record_id AS INT, + @barcode_product_value_id AS INT, + @reason_id AS INT, + @count AS INT, + @datetime AS DATETIME +AS + UPDATE [Tables].[product_write_off_records] + SET + [barcode_product_value_id] = @barcode_product_value_id, + [reason_id] = @reason_id, + [count] = @count, + [datetime] = @datetime + WHERE [id] = @product_write_off_record_id; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_supplier.sql b/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_supplier.sql new file mode 100644 index 0000000..5fd0a7e --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_supplier.sql @@ -0,0 +1,18 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[update_supplier]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[update_supplier]; +GO +CREATE PROCEDURE [Procedures].[update_supplier] + @supplier_id AS INT, + @name AS NVARCHAR(128), + @address AS NVARCHAR(128), + @telephone_number AS NVARCHAR(128) +AS + UPDATE [Tables].[suppliers] + SET + [name] = @name, + [address] = @address, + [telephone_number] = @telephone_number + WHERE [id] = @supplier_id; +GO \ No newline at end of file diff --git a/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_write_off_reason.sql b/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_write_off_reason.sql new file mode 100644 index 0000000..077fc1f --- /dev/null +++ b/sqlscripts/procedures/standard-procedures/unusable/update-procedures/procedure-update_write_off_reason.sql @@ -0,0 +1,13 @@ +USE [Database] + +IF OBJECT_ID('[Procedures].[update_write_off_reason]', 'P') IS NOT NULL + DROP PROCEDURE [Procedures].[update_write_off_reason]; +GO +CREATE PROCEDURE [Procedures].[update_write_off_reason] + @write_off_reason_id AS INT, + @name AS NVARCHAR(128) +AS + UPDATE [Tables].[write_off_reasons] + SET [name] = @name + WHERE [id] = @write_off_reason_id; +GO \ No newline at end of file diff --git a/sqlscripts/run-tests.bat b/sqlscripts/run-tests.bat new file mode 100644 index 0000000..c34a9a8 --- /dev/null +++ b/sqlscripts/run-tests.bat @@ -0,0 +1,8 @@ +@echo off + +sqlcmd -S %SSMS_SERVER_NAME% -U %SSMS_USER_NAME% -P %SSMS_USER_PASSWORD% -i ^ +.\tests\test-1-Database.sql ^ +.\tests\test-2-Database.sql ^ +.\tests\test-3-Database.sql ^ +.\tests\test-4-Database.sql ^ +-r1 1> NUL \ No newline at end of file diff --git a/sqlscripts/tests/test-1-Database.sql b/sqlscripts/tests/test-1-Database.sql new file mode 100644 index 0000000..e4eee0a --- /dev/null +++ b/sqlscripts/tests/test-1-Database.sql @@ -0,0 +1,15 @@ +USE [Database] + +SELECT [E].[id], [E].[name], [T].[name], [A].[attribute_id], [AN].[name], [V].[value] +FROM [Tables].[products] AS [E] +JOIN [Tables].[product_types] AS [T] + ON [T].[id] = [E].[product_type_id] +JOIN [Tables].[product_attributes] AS [A] + ON [A].[product_id] = [E].[id] +JOIN [Tables].[attributes] AS [AN] + ON [AN].[id] = [A].attribute_id +LEFT JOIN [Tables].[product_values] AS [V] + ON [V].[product_id] = [A].[product_id] + AND [V].[attribute_id] = [A].[attribute_id] + +EXECUTE [Procedures].[select_expired_products] @date_of_manufacture_attribute_id, @expiration_date_attribute_id, N'19000201' \ No newline at end of file diff --git a/sqlscripts/tests/test-2-Database.sql b/sqlscripts/tests/test-2-Database.sql new file mode 100644 index 0000000..6bb7508 --- /dev/null +++ b/sqlscripts/tests/test-2-Database.sql @@ -0,0 +1,44 @@ +USE [Database] + +--<< 1 +SELECT [p].[id], [p].[name], [pt].[id], [pt].[name] +FROM [Tables].[product_types] AS [pt] +LEFT JOIN [Tables].[products] AS [p] + ON [p].[product_type_id] = [pt].[id] + +BEGIN TRY + EXECUTE [Procedures].[insert_product_type] 23, N'Orbit'; +END TRY +BEGIN CATCH + PRINT N'The error occurred - the right case' +END CATCH + +--<< 2 +EXECUTE [Procedures].[specify_product_type] 23, N'Orbit'; + +SELECT [p].[id], [p].[name], [pt].[id], [pt].[name] +FROM [Tables].[product_types] AS [pt] +LEFT JOIN [Tables].[products] AS [p] + ON [p].[product_type_id] = [pt].[id] + +--<< 3 +EXECUTE [Procedures].[insert_product_type] 23, N'Mentos'; + +SELECT [p].[id], [p].[name], [pt].[id], [pt].[name] +FROM [Tables].[product_types] AS [pt] +LEFT JOIN [Tables].[products] AS [p] + ON [p].[product_type_id] = [pt].[id] + +--<< 4 + UPDATE [Tables].[products] +SET [product_type_id] = ( + SELECT [id] + FROM [Tables].[product_types] + WHERE [name] = N'Mentos' +) +WHERE UPPER([name]) LIKE N'%MENTOS%'; + +SELECT [p].[id], [p].[name], [pt].[id], [pt].[name] +FROM [Tables].[product_types] AS [pt] +LEFT JOIN [Tables].[products] AS [p] + ON [p].[product_type_id] = [pt].[id] \ No newline at end of file diff --git a/sqlscripts/tests/test-4-Database.sql b/sqlscripts/tests/test-4-Database.sql new file mode 100644 index 0000000..58a9357 --- /dev/null +++ b/sqlscripts/tests/test-4-Database.sql @@ -0,0 +1,13 @@ +USE [Database] + +SELECT [p].[name] AS [product_name], [a].[name] AS [attribute_name], + ISNULL(TRY_CONVERT(NVARCHAR(128), TRY_PARSE([pv].[value] AS datetime), 103), [pv].[value]) +FROM [Tables].[product_attributes] AS [pa] +JOIN [Tables].[attributes] AS [a] + ON [a].[id] = [pa].[attribute_id] +JOIN [Tables].[products] AS [p] + ON [p].[id] = [pa].[product_id] +LEFT OUTER JOIN [Tables].[product_values] AS [pv] + ON [pv].[product_id] = [pa].[product_id] + AND [pv].[attribute_id] = [pa].[attribute_id] +ORDER BY [p].[id]; \ No newline at end of file diff --git a/sqlscripts/tests/test-5-Database.sql b/sqlscripts/tests/test-5-Database.sql new file mode 100644 index 0000000..095285e --- /dev/null +++ b/sqlscripts/tests/test-5-Database.sql @@ -0,0 +1,4 @@ +USE [Database] + +SELECT [Functions].[does_barcode_exist](1111111111111); +SELECT [Functions].[does_barcode_exist](4444444444444); \ No newline at end of file diff --git a/sqlscripts/tests/version-with-denormalization/test-3-Database.sql b/sqlscripts/tests/version-with-denormalization/test-3-Database.sql new file mode 100644 index 0000000..da88756 --- /dev/null +++ b/sqlscripts/tests/version-with-denormalization/test-3-Database.sql @@ -0,0 +1,153 @@ +USE [Database] +GO + +IF OBJECT_ID(N'[Functions].[product_information]') IS NOT NULL + DROP FUNCTION [Functions].[product_information]; +GO +CREATE FUNCTION [Functions].[product_information] () +RETURNS TABLE +AS + RETURN + SELECT [E].[id], [E].[name] AS [product_name], [T].[name] AS [type_name], [A].[attribute_id], [AN].[name], [V].[value] + FROM [Tables].[products] AS [E] + JOIN [Tables].[product_types] AS [T] + ON [T].[id] = [E].[product_type_id] + JOIN [Tables].[product_attributes] AS [A] + ON [A].[product_id] = [E].[id] + JOIN [Tables].[attributes] AS [AN] + ON [AN].[id] = [A].[attribute_id] + LEFT JOIN [Tables].[product_values] AS [V] + ON [V].[product_id] = [A].[product_id] + AND [V].[attribute_id] = [A].[attribute_id] +GO + +IF OBJECT_ID(N'[Functions].[product_inflow_records_information]') IS NOT NULL + DROP FUNCTION [Functions].[product_inflow_records_information]; +GO +CREATE FUNCTION [Functions].[product_inflow_records_information] () +RETURNS TABLE +AS +RETURN + SELECT [pir].[id], [V].[value], [S].[name], [pir].[count], [pir].[full_price], [pir].[datetime] + FROM [Tables].[product_inflow_records] AS [pir] + JOIN [Tables].[product_values] AS [V] + ON [V].[id] = [pir].[barcode_product_value_id] + JOIN [Tables].[suppliers] AS [S] + ON [S].[id] = [pir].supplier_id +GO + +--<< 0 +SELECT * +FROM [Functions].[product_information](); + +--<< 1 +DECLARE @first_barcode_attribute_id AS INT, + @second_barcode_attribute_id AS INT; + +DECLARE @barcode_attribute_id AS INT; +SET @barcode_attribute_id = + (SELECT [id] + FROM [Tables].[attributes] + WHERE [name] = N'Barcode'); + +EXECUTE [Procedures].[insert_barcode] +@product_id = 1, +@barcode_attribute_id = @barcode_attribute_id, +@barcode = N'7145621037931', +@inserted_barcode_attribute_id = @first_barcode_attribute_id OUTPUT; + +SELECT * +FROM [Functions].[product_information](); + +--<< 2 +BEGIN TRY + EXECUTE [Procedures].[insert_barcode] 1, @barcode_attribute_id, N'7145621037931'; +END TRY +BEGIN CATCH -- The barcode is not unique + PRINT N'The error occurred - the right case' +END CATCH + +BEGIN TRY + EXECUTE [Procedures].[insert_barcode] 1, @barcode_attribute_id, N'0289713447192'; +END TRY +BEGIN CATCH -- The barcode is already exsist + PRINT N'The error occurred - the right case' +END CATCH + +EXECUTE [Procedures].[insert_barcode] 2, @barcode_attribute_id, N'0000000000000', @inserted_barcode_attribute_id = @second_barcode_attribute_id OUTPUT; +EXECUTE [Procedures].[insert_barcode] 3, @barcode_attribute_id; +EXECUTE [Procedures].[insert_barcode] 4, @barcode_attribute_id; + +SELECT * +FROM [Functions].[product_information](); + +--<< 3 +DECLARE + @buffer_date_1 AS DATE, + @buffer_date_2 AS DATE, + @buffer_date_3 AS DATE, + @buffer_date_4 AS DATE, + @buffer_date_5 AS DATE; + +SET @buffer_date_1 = CAST(N'1900-01-01' AS DATE); +SET @buffer_date_2 = CAST(N'1900-01-02' AS DATE); +SET @buffer_date_3 = CAST(N'1900-01-03' AS DATE); +SET @buffer_date_4 = CAST(N'1900-01-04' AS DATE); +SET @buffer_date_5 = CAST(N'1900-01-05' AS DATE); + +EXECUTE [Procedures].[insert_product_inflow_record] + @barcode_product_value_id = @first_barcode_attribute_id, + @barcode_product_attribute_id = @barcode_attribute_id, + @supplier_id = 1, + @count = 2, + @full_price = 3000, + @datetime = @buffer_date_1; + +EXECUTE [Procedures].[insert_product_inflow_record] + @barcode_product_value_id = @second_barcode_attribute_id, + @barcode_product_attribute_id = @barcode_attribute_id, + @supplier_id = 3, + @count = 50, + @full_price = 1600, + @datetime = @buffer_date_2; + +SELECT * +FROM [Functions].[product_inflow_records_information](); + +--<< 4 +BEGIN TRY + EXECUTE [Procedures].[insert_product_outflow_record] @second_barcode_attribute_id, 5, @buffer_date_2; +END TRY +BEGIN CATCH -- Price not specified + PRINT N'The error occurred - the right case' +END CATCH + +EXECUTE [Procedures].[insert_price_history_record] 2, @buffer_date_1, 40 -- Orbit Mega , , 16,4 +EXECUTE [Procedures].[insert_product_outflow_record] @second_barcode_attribute_id, 5, @buffer_date_2; + +SELECT [Functions].[product_with_barcode_stock](@barcode_attribute_id, @second_barcode_attribute_id); + +EXECUTE [Procedures].[insert_price_history_record] 2, @buffer_date_3, 45 -- Orbit Mega , , 16,4 +EXECUTE [Procedures].[insert_product_outflow_record] @second_barcode_attribute_id, 10, @buffer_date_4; + +SELECT [Functions].[product_with_barcode_stock](@barcode_attribute_id, @second_barcode_attribute_id); +EXECUTE [Procedures].[details_of_product_outflow_records]; + +--<< 5 +EXECUTE [Procedures].[insert_product_write_off_record] @second_barcode_attribute_id, 1, 5, @buffer_date_5; -- + +SELECT * +FROM [Tables].[product_write_off_records]; + +SELECT [Functions].[product_with_barcode_stock](@barcode_attribute_id, @second_barcode_attribute_id); + +BEGIN TRY + INSERT INTO [Tables].[product_outflow_records]([barcode_product_value_id], [count], [datetime]) + VALUES(@first_barcode_attribute_id, 3, @buffer_date_1); +END TRY +BEGIN CATCH + PRINT N'The error occurred - the right case' +END CATCH + +DROP FUNCTION [Functions].[product_information]; +DROP FUNCTION [Functions].[product_inflow_records_information]; \ No newline at end of file diff --git a/sqlscripts/triggers/ddl-trigger-trg_drop_table.sql b/sqlscripts/triggers/ddl-trigger-trg_drop_table.sql new file mode 100644 index 0000000..39d1cc6 --- /dev/null +++ b/sqlscripts/triggers/ddl-trigger-trg_drop_table.sql @@ -0,0 +1,12 @@ +USE [Database] + +IF EXISTS(SELECT OBJECT_ID FROM [sys].[triggers] WHERE name = 'trg_drop_table') +DROP TRIGGER [trg_drop_table] ON DATABASE +GO + +CREATE TRIGGER [trg_drop_table] + ON DATABASE FOR DROP_TABLE + AS + SET NOCOUNT ON; + ROLLBACK TRANSACTION; +GO \ No newline at end of file diff --git a/sqlscripts/triggers/dml-trigger-trg_insert_product_types.sql b/sqlscripts/triggers/dml-trigger-trg_insert_product_types.sql new file mode 100644 index 0000000..89b7876 --- /dev/null +++ b/sqlscripts/triggers/dml-trigger-trg_insert_product_types.sql @@ -0,0 +1,20 @@ +USE [Database] + +IF OBJECT_ID('[Tables].[trg_insert_product_types]', 'TR') IS NOT NULL + DROP TRIGGER [Tables].[trg_insert_product_types]; +GO +CREATE TRIGGER [Tables].[trg_insert_product_types] ON [Tables].[product_types] AFTER INSERT + AS + IF EXISTS( + SELECT * + FROM [inserted] AS [I] + JOIN [Tables].[product_types] AS [PT] + ON [PT].[id] = [I].[parent_id] + JOIN [Tables].[products] AS [p] + ON [p].[product_type_id] = [PT].[id] + ) + BEGIN + ROLLBACK TRANSACTION; + RETURN; + END +GO \ No newline at end of file diff --git a/sqlscripts/triggers/unused/dml-trigger-trg_insert_product_outflow_records.sql b/sqlscripts/triggers/unused/dml-trigger-trg_insert_product_outflow_records.sql new file mode 100644 index 0000000..d1c92c7 --- /dev/null +++ b/sqlscripts/triggers/unused/dml-trigger-trg_insert_product_outflow_records.sql @@ -0,0 +1,34 @@ +USE [Database] + +IF OBJECT_ID('[Tables].[trg_insert_product_outflow_records]', 'TR') IS NOT NULL + DROP TRIGGER [Tables].[trg_insert_product_outflow_records]; +GO +CREATE TRIGGER [Tables].[trg_insert_product_outflow_records] ON [Tables].[product_outflow_records] AFTER INSERT +AS + IF NOT EXISTS( + SELECT * + FROM [inserted] AS [i] + JOIN [Tables].[price_history_records] AS [phr] + ON [phr].[product_id] = [i].[product_id] + ) + BEGIN + ROLLBACK TRANSACTION; + RETURN; + END + DECLARE @barcode_attribute_id AS INT; + SET @barcode_attribute_id = ( + SELECT [id] + FROM [Tables].[attributes] + WHERE [name] = 'Barcode' + ); + DECLARE @stocks AS INT; + SET @stocks = ( + SELECT [Functions].[product_with_barcode_stock]([barcode]) + FROM [inserted] + ); + IF @stocks < 0 + BEGIN + ROLLBACK TRANSACTION; + RETURN; + END +GO \ No newline at end of file diff --git a/sqlscripts/triggers/unused/dml-trigger-trg_insert_product_values.sql b/sqlscripts/triggers/unused/dml-trigger-trg_insert_product_values.sql new file mode 100644 index 0000000..e12dd98 --- /dev/null +++ b/sqlscripts/triggers/unused/dml-trigger-trg_insert_product_values.sql @@ -0,0 +1,22 @@ +USE [Database] + +IF OBJECT_ID('[Tables].[trg_insert_product_values]', 'TR') IS NOT NULL + DROP TRIGGER [Tables].[trg_insert_product_values]; +GO +CREATE TRIGGER [Tables].[trg_insert_product_values] ON [Tables].[product_values] AFTER INSERT +AS + IF EXISTS( + SELECT * + FROM ( + SELECT [i].[value], COUNT(*) AS [count] + FROM [Tables].[product_values] AS [PV] + JOIN [inserted] AS [i] + ON [i].[id] = [PV].[product_id] + ) AS [values] + WHERE [count] > 1 + ) + BEGIN + ROLLBACK TRANSACTION; + RETURN; + END +GO \ No newline at end of file diff --git a/sqlscripts/triggers/version-with-denormalization/dml-trigger-trg_insert_product_outflow_records.sql b/sqlscripts/triggers/version-with-denormalization/dml-trigger-trg_insert_product_outflow_records.sql new file mode 100644 index 0000000..09daa46 --- /dev/null +++ b/sqlscripts/triggers/version-with-denormalization/dml-trigger-trg_insert_product_outflow_records.sql @@ -0,0 +1,36 @@ +USE [Database] + +IF OBJECT_ID('[Tables].[trg_insert_product_outflow_records]', 'TR') IS NOT NULL + DROP TRIGGER [Tables].[trg_insert_product_outflow_records]; +GO +CREATE TRIGGER [Tables].[trg_insert_product_outflow_records] ON [Tables].[product_outflow_records] AFTER INSERT +AS + IF NOT EXISTS( + SELECT * + FROM [inserted] AS [i] + JOIN [Tables].[product_values] AS [pv] + ON [pv].[id] = [i].[barcode_product_value_id] + JOIN [Tables].[price_history_records] AS [phr] + ON [phr].[product_id] = [pv].[product_id] + ) + BEGIN + ROLLBACK TRANSACTION; + RETURN; + END + DECLARE @barcode_attribute_id AS INT; + SET @barcode_attribute_id = ( + SELECT [id] + FROM [Tables].[attributes] + WHERE [name] = 'Barcode' + ); + DECLARE @stocks AS INT; + SET @stocks = ( + SELECT [Functions].[product_with_barcode_stock](@barcode_attribute_id, [barcode_product_value_id]) + FROM [inserted] + ); + IF @stocks < 0 + BEGIN + ROLLBACK TRANSACTION; + RETURN; + END +GO \ No newline at end of file diff --git a/sqlscripts/triggers/version-with-denormalization/dml-trigger-trg_insert_product_write_off_records.sql b/sqlscripts/triggers/version-with-denormalization/dml-trigger-trg_insert_product_write_off_records.sql new file mode 100644 index 0000000..1acbb74 --- /dev/null +++ b/sqlscripts/triggers/version-with-denormalization/dml-trigger-trg_insert_product_write_off_records.sql @@ -0,0 +1,25 @@ +USE [Database] + +IF OBJECT_ID('[Tables].[trg_insert_product_write_off_records]', 'TR') IS NOT NULL + DROP TRIGGER [Tables].[trg_insert_product_write_off_records]; +GO +CREATE TRIGGER [Tables].[trg_insert_product_write_off_records] ON [Tables].[product_write_off_records] AFTER INSERT +AS + DECLARE @barcode_attribute_id AS INT; + SET @barcode_attribute_id = ( + SELECT [id] + FROM [Tables].[attributes] + WHERE [name] = 'Barcode' + ); + + DECLARE @stocks AS INT; + SET @stocks = ( + SELECT [Functions].[product_with_barcode_stock](@barcode_attribute_id, [barcode_product_value_id]) + FROM [inserted] + ); + IF @stocks < 0 + BEGIN + ROLLBACK TRANSACTION; + RETURN; + END +GO \ No newline at end of file diff --git a/sqlscripts/users/create-a-user-user.sql b/sqlscripts/users/create-a-user-user.sql new file mode 100644 index 0000000..e2b70c1 --- /dev/null +++ b/sqlscripts/users/create-a-user-user.sql @@ -0,0 +1,40 @@ +USE [Database] +GO + +IF NOT EXISTS ( + SELECT [name] + FROM [master].[sys].[server_principals] + WHERE [name] = 'user') +BEGIN + CREATE LOGIN [user] + WITH PASSWORD = 'user', + DEFAULT_DATABASE = [Database]; +END +GO + +IF NOT EXISTS ( + SELECT * + FROM [dbo].[sysusers] + WHERE name = N'Casual user') +BEGIN + CREATE USER [Casual user] + FOR LOGIN [user] + WITH DEFAULT_SCHEMA = [Views] +END +GO + +GRANT INSERT, SELECT, UPDATE, DELETE +ON SCHEMA :: [Tables] +TO [Casual user]; + +GRANT EXECUTE, SELECT +ON SCHEMA :: [Functions] +TO [Casual user]; + +GRANT EXECUTE, SELECT +ON SCHEMA :: [Procedures] +TO [Casual user]; + +GRANT SELECT, UPDATE +ON SCHEMA :: [Views] +TO [Casual user]; \ No newline at end of file