Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

:D, mainwindow, auth, session, ++

  • Loading branch information...
commit ef0881eb1b2fe994b17d287bced06f49ff3b7510 1 parent 7373812
@nycholas authored
Showing with 10,161 additions and 0 deletions.
  1. +9 −0 .gitignore
  2. +26 −0 COPYING
  3. +750 −0 Makefile
  4. +17 −0 README
  5. +73 −0 apps/changepassword.cpp
  6. +57 −0 apps/changepassword.h
  7. +289 −0 apps/contenttypes.cpp
  8. +100 −0 apps/contenttypes.h
  9. +248 −0 apps/contenttypesform.cpp
  10. +90 −0 apps/contenttypesform.h
  11. +149 −0 apps/contenttypesmodel.cpp
  12. +68 −0 apps/contenttypesmodel.h
  13. +104 −0 apps/contenttypessearch.cpp
  14. +70 −0 apps/contenttypessearch.h
  15. +286 −0 apps/group.cpp
  16. +98 −0 apps/group.h
  17. +242 −0 apps/groupform.cpp
  18. +90 −0 apps/groupform.h
  19. +121 −0 apps/groupmodel.cpp
  20. +65 −0 apps/groupmodel.h
  21. +96 −0 apps/groupsearch.cpp
  22. +70 −0 apps/groupsearch.h
  23. +131 −0 apps/login.cpp
  24. +66 −0 apps/login.h
  25. +231 −0 apps/mainwindow.cpp
  26. +75 −0 apps/mainwindow.h
  27. +297 −0 apps/permission.cpp
  28. +100 −0 apps/permission.h
  29. +255 −0 apps/permissionform.cpp
  30. +91 −0 apps/permissionform.h
  31. +158 −0 apps/permissionmodel.cpp
  32. +70 −0 apps/permissionmodel.h
  33. +100 −0 apps/permissionsearch.cpp
  34. +70 −0 apps/permissionsearch.h
  35. +286 −0 apps/user.cpp
  36. +98 −0 apps/user.h
  37. +242 −0 apps/userform.cpp
  38. +90 −0 apps/userform.h
  39. +121 −0 apps/usermodel.cpp
  40. +64 −0 apps/usermodel.h
  41. +96 −0 apps/usersearch.cpp
  42. +70 −0 apps/usersearch.h
  43. BIN  c-project
  44. +69 −0 c-project.pro
  45. +80 −0 commons/connection.h
  46. +73 −0 db/connection.h
  47. +59 −0 main.cpp
  48. BIN  resources/db/eer/c-project.mwb
  49. +198 −0 resources/db/mysql/create-database.sql
  50. +3 −0  resources/ui/.directory
  51. +173 −0 resources/ui/changepassword.ui
  52. +301 −0 resources/ui/contenttypes.ui
  53. +198 −0 resources/ui/contenttypesform.ui
  54. +182 −0 resources/ui/contenttypessearch.ui
  55. +301 −0 resources/ui/group.ui
  56. +179 −0 resources/ui/groupform.ui
  57. +157 −0 resources/ui/groupsearch.ui
  58. +218 −0 resources/ui/login.ui
  59. +493 −0 resources/ui/mainwindow.ui
  60. +301 −0 resources/ui/permission.ui
  61. +213 −0 resources/ui/permissionform.ui
  62. +191 −0 resources/ui/permissionsearch.ui
  63. +53 −0 resources/ui/resources.qrc
  64. +3 −0  resources/ui/static/default/icons/22x22/.directory
  65. BIN  resources/ui/static/default/icons/22x22/application-exit.png
  66. BIN  resources/ui/static/default/icons/22x22/configure.png
  67. BIN  resources/ui/static/default/icons/22x22/dialog-cancel.png
  68. BIN  resources/ui/static/default/icons/22x22/dialog-error.png
  69. BIN  resources/ui/static/default/icons/22x22/dialog-information.png
  70. BIN  resources/ui/static/default/icons/22x22/dialog-ok-apply.png
  71. BIN  resources/ui/static/default/icons/22x22/dialog-ok.png
  72. BIN  resources/ui/static/default/icons/22x22/dialog-password.png
  73. BIN  resources/ui/static/default/icons/22x22/dialog-warning.png
  74. BIN  resources/ui/static/default/icons/22x22/document-new.png
  75. BIN  resources/ui/static/default/icons/22x22/document-open-recent.png
  76. BIN  resources/ui/static/default/icons/22x22/document-open-remote.png
  77. BIN  resources/ui/static/default/icons/22x22/document-open.png
  78. BIN  resources/ui/static/default/icons/22x22/document-print.png
  79. BIN  resources/ui/static/default/icons/22x22/document-save-all.png
  80. BIN  resources/ui/static/default/icons/22x22/document-save-as.png
  81. BIN  resources/ui/static/default/icons/22x22/document-save.png
  82. BIN  resources/ui/static/default/icons/22x22/documentation.png
  83. BIN  resources/ui/static/default/icons/22x22/edit-copy.png
  84. BIN  resources/ui/static/default/icons/22x22/edit-cut.png
  85. BIN  resources/ui/static/default/icons/22x22/edit-delete.png
  86. BIN  resources/ui/static/default/icons/22x22/edit-paste.png
  87. BIN  resources/ui/static/default/icons/22x22/edit-redo.png
  88. BIN  resources/ui/static/default/icons/22x22/edit-undo.png
  89. BIN  resources/ui/static/default/icons/22x22/face-devilish.png
  90. BIN  resources/ui/static/default/icons/22x22/go-next-view.png
  91. BIN  resources/ui/static/default/icons/22x22/go-next.png
  92. BIN  resources/ui/static/default/icons/22x22/go-previous-view.png
  93. BIN  resources/ui/static/default/icons/22x22/go-previous.png
  94. BIN  resources/ui/static/default/icons/22x22/help-about.png
  95. BIN  resources/ui/static/default/icons/22x22/help-contents.png
  96. BIN  resources/ui/static/default/icons/22x22/im-status-message-edit.png
  97. BIN  resources/ui/static/default/icons/22x22/irc-operator.png
  98. BIN  resources/ui/static/default/icons/22x22/list-add-user.png
  99. BIN  resources/ui/static/default/icons/22x22/meeting-organizer.png
  100. BIN  resources/ui/static/default/icons/22x22/page-zoom.png
  101. BIN  resources/ui/static/default/icons/22x22/preferences-desktop.png
  102. BIN  resources/ui/static/default/icons/22x22/project-open.png
  103. BIN  resources/ui/static/default/icons/22x22/resource-group.png
  104. BIN  resources/ui/static/default/icons/22x22/system-log-out.png
  105. BIN  resources/ui/static/default/icons/22x22/system-shutdown.png
  106. BIN  resources/ui/static/default/icons/22x22/tools-report-bug.png
  107. BIN  resources/ui/static/default/icons/22x22/video-display.png
  108. BIN  resources/ui/static/default/icons/22x22/view-fullscreen.png
  109. BIN  resources/ui/static/default/icons/22x22/view-left-close.png
  110. BIN  resources/ui/static/default/icons/22x22/view-left-new.png
  111. BIN  resources/ui/static/default/icons/22x22/view-refresh.png
  112. BIN  resources/ui/static/default/icons/22x22/view-restore.png
  113. BIN  resources/ui/static/default/icons/22x22/window-close.png
  114. +3 −0  resources/ui/static/default/icons/32x32/.directory
  115. BIN  resources/ui/static/default/icons/32x32/meeting-organizer.png
  116. +301 −0 resources/ui/user.ui
  117. +426 −0 resources/ui/userform.ui
  118. +157 −0 resources/ui/usersearch.ui
View
9 .gitignore
@@ -0,0 +1,9 @@
+*~
+*.swp
+*.out
+*.log
+*.bak
+*.so
+*.o
+*.cproject
+*.project
View
26 COPYING
@@ -0,0 +1,26 @@
+Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of the Nycholas de Oliveira e Oliveira nor the names of
+ its contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
View
750 Makefile
@@ -0,0 +1,750 @@
+#############################################################################
+# Makefile for building: c-project
+# Generated by qmake (2.01a) (Qt 4.6.3) on: Mon Jun 21 12:05:49 2010
+# Project: c-project.pro
+# Template: app
+# Command: /usr/bin/qmake -unix -o Makefile c-project.pro
+#############################################################################
+
+####### Compiler, tools and options
+
+CC = gcc
+CXX = g++
+DEFINES = -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
+CFLAGS = -m64 -pipe -march=x86-64 -mtune=generic -O2 -pipe -Wall -W -D_REENTRANT $(DEFINES)
+CXXFLAGS = -m64 -pipe -march=x86-64 -mtune=generic -O2 -pipe -Wall -W -D_REENTRANT $(DEFINES)
+INCPATH = -I/usr/share/qt/mkspecs/linux-g++-64 -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtSql -I/usr/include -I. -Icommons -Iapps -I. -Iapps/widgets
+LINK = g++
+LFLAGS = -m64 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-O1
+LIBS = $(SUBLIBS) -L/usr/lib -lQtSql -lQtGui -lQtCore -lpthread
+AR = ar cqs
+RANLIB =
+QMAKE = /usr/bin/qmake
+TAR = tar -cf
+COMPRESS = gzip -9f
+COPY = cp -f
+SED = sed
+COPY_FILE = $(COPY)
+COPY_DIR = $(COPY) -r
+STRIP = strip
+INSTALL_FILE = install -m 644 -p
+INSTALL_DIR = $(COPY_DIR)
+INSTALL_PROGRAM = install -m 755 -p
+DEL_FILE = rm -f
+SYMLINK = ln -f -s
+DEL_DIR = rmdir
+MOVE = mv -f
+CHK_DIR_EXISTS= test -d
+MKDIR = mkdir -p
+
+####### Output directory
+
+OBJECTS_DIR = ./
+
+####### Files
+
+SOURCES = main.cpp \
+ apps/changepassword.cpp \
+ apps/contenttypes.cpp \
+ apps/contenttypesform.cpp \
+ apps/contenttypesmodel.cpp \
+ apps/contenttypessearch.cpp \
+ apps/group.cpp \
+ apps/groupform.cpp \
+ apps/groupmodel.cpp \
+ apps/groupsearch.cpp \
+ apps/login.cpp \
+ apps/mainwindow.cpp \
+ apps/permission.cpp \
+ apps/permissionform.cpp \
+ apps/permissionmodel.cpp \
+ apps/permissionsearch.cpp \
+ apps/user.cpp \
+ apps/userform.cpp \
+ apps/usermodel.cpp \
+ apps/usersearch.cpp moc_changepassword.cpp \
+ moc_contenttypes.cpp \
+ moc_contenttypesform.cpp \
+ moc_contenttypessearch.cpp \
+ moc_group.cpp \
+ moc_groupform.cpp \
+ moc_groupsearch.cpp \
+ moc_login.cpp \
+ moc_mainwindow.cpp \
+ moc_permission.cpp \
+ moc_permissionform.cpp \
+ moc_permissionsearch.cpp \
+ moc_user.cpp \
+ moc_userform.cpp \
+ moc_usersearch.cpp \
+ qrc_resources.cpp
+OBJECTS = main.o \
+ changepassword.o \
+ contenttypes.o \
+ contenttypesform.o \
+ contenttypesmodel.o \
+ contenttypessearch.o \
+ group.o \
+ groupform.o \
+ groupmodel.o \
+ groupsearch.o \
+ login.o \
+ mainwindow.o \
+ permission.o \
+ permissionform.o \
+ permissionmodel.o \
+ permissionsearch.o \
+ user.o \
+ userform.o \
+ usermodel.o \
+ usersearch.o \
+ moc_changepassword.o \
+ moc_contenttypes.o \
+ moc_contenttypesform.o \
+ moc_contenttypessearch.o \
+ moc_group.o \
+ moc_groupform.o \
+ moc_groupsearch.o \
+ moc_login.o \
+ moc_mainwindow.o \
+ moc_permission.o \
+ moc_permissionform.o \
+ moc_permissionsearch.o \
+ moc_user.o \
+ moc_userform.o \
+ moc_usersearch.o \
+ qrc_resources.o
+DIST = /usr/share/qt/mkspecs/common/g++.conf \
+ /usr/share/qt/mkspecs/common/unix.conf \
+ /usr/share/qt/mkspecs/common/linux.conf \
+ /usr/share/qt/mkspecs/qconfig.pri \
+ /usr/share/qt/mkspecs/features/qt_functions.prf \
+ /usr/share/qt/mkspecs/features/qt_config.prf \
+ /usr/share/qt/mkspecs/features/exclusive_builds.prf \
+ /usr/share/qt/mkspecs/features/default_pre.prf \
+ /usr/share/qt/mkspecs/features/release.prf \
+ /usr/share/qt/mkspecs/features/default_post.prf \
+ /usr/share/qt/mkspecs/features/warn_on.prf \
+ /usr/share/qt/mkspecs/features/qt.prf \
+ /usr/share/qt/mkspecs/features/unix/thread.prf \
+ /usr/share/qt/mkspecs/features/moc.prf \
+ /usr/share/qt/mkspecs/features/resources.prf \
+ /usr/share/qt/mkspecs/features/uic.prf \
+ /usr/share/qt/mkspecs/features/yacc.prf \
+ /usr/share/qt/mkspecs/features/lex.prf \
+ /usr/share/qt/mkspecs/features/include_source_dir.prf \
+ c-project.pro
+QMAKE_TARGET = c-project
+DESTDIR =
+TARGET = c-project
+
+first: all
+####### Implicit rules
+
+.SUFFIXES: .o .c .cpp .cc .cxx .C
+
+.cpp.o:
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.cc.o:
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.cxx.o:
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.C.o:
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.c.o:
+ $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
+
+####### Build rules
+
+all: Makefile $(TARGET)
+
+$(TARGET): apps/widgets/ui_changepassword.h apps/widgets/ui_contenttypes.h apps/widgets/ui_contenttypesform.h apps/widgets/ui_contenttypessearch.h apps/widgets/ui_group.h apps/widgets/ui_groupform.h apps/widgets/ui_groupsearch.h apps/widgets/ui_login.h apps/widgets/ui_mainwindow.h apps/widgets/ui_permission.h apps/widgets/ui_permissionform.h apps/widgets/ui_permissionsearch.h apps/widgets/ui_user.h apps/widgets/ui_userform.h apps/widgets/ui_usersearch.h $(OBJECTS)
+ $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
+
+Makefile: c-project.pro /usr/share/qt/mkspecs/linux-g++-64/qmake.conf /usr/share/qt/mkspecs/common/g++.conf \
+ /usr/share/qt/mkspecs/common/unix.conf \
+ /usr/share/qt/mkspecs/common/linux.conf \
+ /usr/share/qt/mkspecs/qconfig.pri \
+ /usr/share/qt/mkspecs/features/qt_functions.prf \
+ /usr/share/qt/mkspecs/features/qt_config.prf \
+ /usr/share/qt/mkspecs/features/exclusive_builds.prf \
+ /usr/share/qt/mkspecs/features/default_pre.prf \
+ /usr/share/qt/mkspecs/features/release.prf \
+ /usr/share/qt/mkspecs/features/default_post.prf \
+ /usr/share/qt/mkspecs/features/warn_on.prf \
+ /usr/share/qt/mkspecs/features/qt.prf \
+ /usr/share/qt/mkspecs/features/unix/thread.prf \
+ /usr/share/qt/mkspecs/features/moc.prf \
+ /usr/share/qt/mkspecs/features/resources.prf \
+ /usr/share/qt/mkspecs/features/uic.prf \
+ /usr/share/qt/mkspecs/features/yacc.prf \
+ /usr/share/qt/mkspecs/features/lex.prf \
+ /usr/share/qt/mkspecs/features/include_source_dir.prf \
+ /usr/lib/libQtSql.prl \
+ /usr/lib/libQtGui.prl \
+ /usr/lib/libQtCore.prl
+ $(QMAKE) -unix -o Makefile c-project.pro
+/usr/share/qt/mkspecs/common/g++.conf:
+/usr/share/qt/mkspecs/common/unix.conf:
+/usr/share/qt/mkspecs/common/linux.conf:
+/usr/share/qt/mkspecs/qconfig.pri:
+/usr/share/qt/mkspecs/features/qt_functions.prf:
+/usr/share/qt/mkspecs/features/qt_config.prf:
+/usr/share/qt/mkspecs/features/exclusive_builds.prf:
+/usr/share/qt/mkspecs/features/default_pre.prf:
+/usr/share/qt/mkspecs/features/release.prf:
+/usr/share/qt/mkspecs/features/default_post.prf:
+/usr/share/qt/mkspecs/features/warn_on.prf:
+/usr/share/qt/mkspecs/features/qt.prf:
+/usr/share/qt/mkspecs/features/unix/thread.prf:
+/usr/share/qt/mkspecs/features/moc.prf:
+/usr/share/qt/mkspecs/features/resources.prf:
+/usr/share/qt/mkspecs/features/uic.prf:
+/usr/share/qt/mkspecs/features/yacc.prf:
+/usr/share/qt/mkspecs/features/lex.prf:
+/usr/share/qt/mkspecs/features/include_source_dir.prf:
+/usr/lib/libQtSql.prl:
+/usr/lib/libQtGui.prl:
+/usr/lib/libQtCore.prl:
+qmake: FORCE
+ @$(QMAKE) -unix -o Makefile c-project.pro
+
+dist:
+ @$(CHK_DIR_EXISTS) .tmp/c-project1.0.0 || $(MKDIR) .tmp/c-project1.0.0
+ $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/c-project1.0.0/ && $(COPY_FILE) --parents apps/changepassword.h apps/contenttypes.h apps/contenttypesform.h apps/contenttypesmodel.h apps/contenttypessearch.h apps/group.h apps/groupform.h apps/groupmodel.h apps/groupsearch.h apps/login.h apps/mainwindow.h apps/permission.h apps/permissionform.h apps/permissionmodel.h apps/permissionsearch.h apps/user.h apps/userform.h apps/usermodel.h apps/usersearch.h commons/connection.h db/connection.h .tmp/c-project1.0.0/ && $(COPY_FILE) --parents resources/ui/resources.qrc .tmp/c-project1.0.0/ && $(COPY_FILE) --parents main.cpp apps/changepassword.cpp apps/contenttypes.cpp apps/contenttypesform.cpp apps/contenttypesmodel.cpp apps/contenttypessearch.cpp apps/group.cpp apps/groupform.cpp apps/groupmodel.cpp apps/groupsearch.cpp apps/login.cpp apps/mainwindow.cpp apps/permission.cpp apps/permissionform.cpp apps/permissionmodel.cpp apps/permissionsearch.cpp apps/user.cpp apps/userform.cpp apps/usermodel.cpp apps/usersearch.cpp .tmp/c-project1.0.0/ && $(COPY_FILE) --parents resources/ui/changepassword.ui resources/ui/contenttypes.ui resources/ui/contenttypesform.ui resources/ui/contenttypessearch.ui resources/ui/group.ui resources/ui/groupform.ui resources/ui/groupsearch.ui resources/ui/login.ui resources/ui/mainwindow.ui resources/ui/permission.ui resources/ui/permissionform.ui resources/ui/permissionsearch.ui resources/ui/user.ui resources/ui/userform.ui resources/ui/usersearch.ui .tmp/c-project1.0.0/ && (cd `dirname .tmp/c-project1.0.0` && $(TAR) c-project1.0.0.tar c-project1.0.0 && $(COMPRESS) c-project1.0.0.tar) && $(MOVE) `dirname .tmp/c-project1.0.0`/c-project1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/c-project1.0.0
+
+
+clean:compiler_clean
+ -$(DEL_FILE) $(OBJECTS)
+ -$(DEL_FILE) *~ core *.core
+
+
+####### Sub-libraries
+
+distclean: clean
+ -$(DEL_FILE) $(TARGET)
+ -$(DEL_FILE) Makefile
+
+
+check: first
+
+mocclean: compiler_moc_header_clean compiler_moc_source_clean
+
+mocables: compiler_moc_header_make_all compiler_moc_source_make_all
+
+compiler_moc_header_make_all: moc_changepassword.cpp moc_contenttypes.cpp moc_contenttypesform.cpp moc_contenttypessearch.cpp moc_group.cpp moc_groupform.cpp moc_groupsearch.cpp moc_login.cpp moc_mainwindow.cpp moc_permission.cpp moc_permissionform.cpp moc_permissionsearch.cpp moc_user.cpp moc_userform.cpp moc_usersearch.cpp
+compiler_moc_header_clean:
+ -$(DEL_FILE) moc_changepassword.cpp moc_contenttypes.cpp moc_contenttypesform.cpp moc_contenttypessearch.cpp moc_group.cpp moc_groupform.cpp moc_groupsearch.cpp moc_login.cpp moc_mainwindow.cpp moc_permission.cpp moc_permissionform.cpp moc_permissionsearch.cpp moc_user.cpp moc_userform.cpp moc_usersearch.cpp
+moc_changepassword.cpp: apps/widgets/ui_changepassword.h \
+ apps/changepassword.h
+ /usr/bin/moc $(DEFINES) $(INCPATH) apps/changepassword.h -o moc_changepassword.cpp
+
+moc_contenttypes.cpp: apps/widgets/ui_contenttypes.h \
+ apps/contenttypesmodel.h \
+ apps/contenttypesform.h \
+ apps/widgets/ui_contenttypesform.h \
+ apps/contenttypessearch.h \
+ apps/widgets/ui_contenttypessearch.h \
+ apps/contenttypes.h
+ /usr/bin/moc $(DEFINES) $(INCPATH) apps/contenttypes.h -o moc_contenttypes.cpp
+
+moc_contenttypesform.cpp: apps/widgets/ui_contenttypesform.h \
+ apps/contenttypesmodel.h \
+ apps/contenttypesform.h
+ /usr/bin/moc $(DEFINES) $(INCPATH) apps/contenttypesform.h -o moc_contenttypesform.cpp
+
+moc_contenttypessearch.cpp: apps/widgets/ui_contenttypessearch.h \
+ apps/contenttypessearch.h
+ /usr/bin/moc $(DEFINES) $(INCPATH) apps/contenttypessearch.h -o moc_contenttypessearch.cpp
+
+moc_group.cpp: apps/widgets/ui_group.h \
+ apps/groupmodel.h \
+ apps/contenttypesmodel.h \
+ apps/groupform.h \
+ apps/widgets/ui_groupform.h \
+ apps/groupsearch.h \
+ apps/widgets/ui_groupsearch.h \
+ apps/group.h
+ /usr/bin/moc $(DEFINES) $(INCPATH) apps/group.h -o moc_group.cpp
+
+moc_groupform.cpp: apps/widgets/ui_groupform.h \
+ apps/groupmodel.h \
+ apps/contenttypesmodel.h \
+ apps/groupform.h
+ /usr/bin/moc $(DEFINES) $(INCPATH) apps/groupform.h -o moc_groupform.cpp
+
+moc_groupsearch.cpp: apps/widgets/ui_groupsearch.h \
+ apps/groupsearch.h
+ /usr/bin/moc $(DEFINES) $(INCPATH) apps/groupsearch.h -o moc_groupsearch.cpp
+
+moc_login.cpp: apps/widgets/ui_login.h \
+ apps/login.h
+ /usr/bin/moc $(DEFINES) $(INCPATH) apps/login.h -o moc_login.cpp
+
+moc_mainwindow.cpp: apps/widgets/ui_mainwindow.h \
+ apps/login.h \
+ apps/widgets/ui_login.h \
+ apps/changepassword.h \
+ apps/widgets/ui_changepassword.h \
+ apps/contenttypes.h \
+ apps/widgets/ui_contenttypes.h \
+ apps/contenttypesmodel.h \
+ apps/contenttypesform.h \
+ apps/widgets/ui_contenttypesform.h \
+ apps/contenttypessearch.h \
+ apps/widgets/ui_contenttypessearch.h \
+ apps/permission.h \
+ apps/widgets/ui_permission.h \
+ apps/permissionmodel.h \
+ apps/permissionform.h \
+ apps/widgets/ui_permissionform.h \
+ apps/permissionsearch.h \
+ apps/widgets/ui_permissionsearch.h \
+ apps/group.h \
+ apps/widgets/ui_group.h \
+ apps/groupmodel.h \
+ apps/groupform.h \
+ apps/widgets/ui_groupform.h \
+ apps/groupsearch.h \
+ apps/widgets/ui_groupsearch.h \
+ apps/user.h \
+ apps/widgets/ui_user.h \
+ apps/usermodel.h \
+ apps/userform.h \
+ apps/widgets/ui_userform.h \
+ apps/usersearch.h \
+ apps/widgets/ui_usersearch.h \
+ apps/mainwindow.h
+ /usr/bin/moc $(DEFINES) $(INCPATH) apps/mainwindow.h -o moc_mainwindow.cpp
+
+moc_permission.cpp: apps/widgets/ui_permission.h \
+ apps/permissionmodel.h \
+ apps/contenttypesmodel.h \
+ apps/permissionform.h \
+ apps/widgets/ui_permissionform.h \
+ apps/permissionsearch.h \
+ apps/widgets/ui_permissionsearch.h \
+ apps/permission.h
+ /usr/bin/moc $(DEFINES) $(INCPATH) apps/permission.h -o moc_permission.cpp
+
+moc_permissionform.cpp: apps/widgets/ui_permissionform.h \
+ apps/permissionmodel.h \
+ apps/contenttypesmodel.h \
+ apps/permissionform.h
+ /usr/bin/moc $(DEFINES) $(INCPATH) apps/permissionform.h -o moc_permissionform.cpp
+
+moc_permissionsearch.cpp: apps/widgets/ui_permissionsearch.h \
+ apps/permissionsearch.h
+ /usr/bin/moc $(DEFINES) $(INCPATH) apps/permissionsearch.h -o moc_permissionsearch.cpp
+
+moc_user.cpp: apps/widgets/ui_user.h \
+ apps/usermodel.h \
+ apps/contenttypesmodel.h \
+ apps/userform.h \
+ apps/widgets/ui_userform.h \
+ apps/usersearch.h \
+ apps/widgets/ui_usersearch.h \
+ apps/user.h
+ /usr/bin/moc $(DEFINES) $(INCPATH) apps/user.h -o moc_user.cpp
+
+moc_userform.cpp: apps/widgets/ui_userform.h \
+ apps/usermodel.h \
+ apps/contenttypesmodel.h \
+ apps/userform.h
+ /usr/bin/moc $(DEFINES) $(INCPATH) apps/userform.h -o moc_userform.cpp
+
+moc_usersearch.cpp: apps/widgets/ui_usersearch.h \
+ apps/usersearch.h
+ /usr/bin/moc $(DEFINES) $(INCPATH) apps/usersearch.h -o moc_usersearch.cpp
+
+compiler_rcc_make_all: qrc_resources.cpp
+compiler_rcc_clean:
+ -$(DEL_FILE) qrc_resources.cpp
+qrc_resources.cpp: resources/ui/resources.qrc \
+ resources/ui/static/default/icons/32x32/meeting-organizer.png \
+ resources/ui/static/default/icons/22x22/documentation.png \
+ resources/ui/static/default/icons/22x22/page-zoom.png \
+ resources/ui/static/default/icons/22x22/edit-delete.png \
+ resources/ui/static/default/icons/22x22/dialog-ok-apply.png \
+ resources/ui/static/default/icons/22x22/edit-redo.png \
+ resources/ui/static/default/icons/22x22/irc-operator.png \
+ resources/ui/static/default/icons/22x22/im-status-message-edit.png \
+ resources/ui/static/default/icons/22x22/dialog-warning.png \
+ resources/ui/static/default/icons/22x22/go-next-view.png \
+ resources/ui/static/default/icons/22x22/edit-copy.png \
+ resources/ui/static/default/icons/22x22/dialog-error.png \
+ resources/ui/static/default/icons/22x22/meeting-organizer.png \
+ resources/ui/static/default/icons/22x22/preferences-desktop.png \
+ resources/ui/static/default/icons/22x22/resource-group.png \
+ resources/ui/static/default/icons/22x22/help-contents.png \
+ resources/ui/static/default/icons/22x22/go-next.png \
+ resources/ui/static/default/icons/22x22/configure.png \
+ resources/ui/static/default/icons/22x22/tools-report-bug.png \
+ resources/ui/static/default/icons/22x22/system-log-out.png \
+ resources/ui/static/default/icons/22x22/document-save.png \
+ resources/ui/static/default/icons/22x22/video-display.png \
+ resources/ui/static/default/icons/22x22/view-left-new.png \
+ resources/ui/static/default/icons/22x22/dialog-ok.png \
+ resources/ui/static/default/icons/22x22/document-save-all.png \
+ resources/ui/static/default/icons/22x22/document-open-recent.png \
+ resources/ui/static/default/icons/22x22/document-save-as.png \
+ resources/ui/static/default/icons/22x22/edit-undo.png \
+ resources/ui/static/default/icons/22x22/go-previous-view.png \
+ resources/ui/static/default/icons/22x22/project-open.png \
+ resources/ui/static/default/icons/22x22/edit-cut.png \
+ resources/ui/static/default/icons/22x22/face-devilish.png \
+ resources/ui/static/default/icons/22x22/help-about.png \
+ resources/ui/static/default/icons/22x22/dialog-password.png \
+ resources/ui/static/default/icons/22x22/window-close.png \
+ resources/ui/static/default/icons/22x22/view-restore.png \
+ resources/ui/static/default/icons/22x22/list-add-user.png \
+ resources/ui/static/default/icons/22x22/dialog-information.png \
+ resources/ui/static/default/icons/22x22/document-print.png \
+ resources/ui/static/default/icons/22x22/go-previous.png \
+ resources/ui/static/default/icons/22x22/document-new.png \
+ resources/ui/static/default/icons/22x22/view-fullscreen.png \
+ resources/ui/static/default/icons/22x22/view-left-close.png \
+ resources/ui/static/default/icons/22x22/document-open.png \
+ resources/ui/static/default/icons/22x22/dialog-cancel.png \
+ resources/ui/static/default/icons/22x22/view-refresh.png \
+ resources/ui/static/default/icons/22x22/document-open-remote.png \
+ resources/ui/static/default/icons/22x22/application-exit.png \
+ resources/ui/static/default/icons/22x22/edit-paste.png
+ /usr/bin/rcc -name resources resources/ui/resources.qrc -o qrc_resources.cpp
+
+compiler_image_collection_make_all: qmake_image_collection.cpp
+compiler_image_collection_clean:
+ -$(DEL_FILE) qmake_image_collection.cpp
+compiler_moc_source_make_all:
+compiler_moc_source_clean:
+compiler_uic_make_all: apps/widgets/ui_changepassword.h apps/widgets/ui_contenttypes.h apps/widgets/ui_contenttypesform.h apps/widgets/ui_contenttypessearch.h apps/widgets/ui_group.h apps/widgets/ui_groupform.h apps/widgets/ui_groupsearch.h apps/widgets/ui_login.h apps/widgets/ui_mainwindow.h apps/widgets/ui_permission.h apps/widgets/ui_permissionform.h apps/widgets/ui_permissionsearch.h apps/widgets/ui_user.h apps/widgets/ui_userform.h apps/widgets/ui_usersearch.h
+compiler_uic_clean:
+ -$(DEL_FILE) apps/widgets/ui_changepassword.h apps/widgets/ui_contenttypes.h apps/widgets/ui_contenttypesform.h apps/widgets/ui_contenttypessearch.h apps/widgets/ui_group.h apps/widgets/ui_groupform.h apps/widgets/ui_groupsearch.h apps/widgets/ui_login.h apps/widgets/ui_mainwindow.h apps/widgets/ui_permission.h apps/widgets/ui_permissionform.h apps/widgets/ui_permissionsearch.h apps/widgets/ui_user.h apps/widgets/ui_userform.h apps/widgets/ui_usersearch.h
+apps/widgets/ui_changepassword.h: resources/ui/changepassword.ui
+ /usr/bin/uic resources/ui/changepassword.ui -o apps/widgets/ui_changepassword.h
+
+apps/widgets/ui_contenttypes.h: resources/ui/contenttypes.ui
+ /usr/bin/uic resources/ui/contenttypes.ui -o apps/widgets/ui_contenttypes.h
+
+apps/widgets/ui_contenttypesform.h: resources/ui/contenttypesform.ui
+ /usr/bin/uic resources/ui/contenttypesform.ui -o apps/widgets/ui_contenttypesform.h
+
+apps/widgets/ui_contenttypessearch.h: resources/ui/contenttypessearch.ui
+ /usr/bin/uic resources/ui/contenttypessearch.ui -o apps/widgets/ui_contenttypessearch.h
+
+apps/widgets/ui_group.h: resources/ui/group.ui
+ /usr/bin/uic resources/ui/group.ui -o apps/widgets/ui_group.h
+
+apps/widgets/ui_groupform.h: resources/ui/groupform.ui
+ /usr/bin/uic resources/ui/groupform.ui -o apps/widgets/ui_groupform.h
+
+apps/widgets/ui_groupsearch.h: resources/ui/groupsearch.ui
+ /usr/bin/uic resources/ui/groupsearch.ui -o apps/widgets/ui_groupsearch.h
+
+apps/widgets/ui_login.h: resources/ui/login.ui
+ /usr/bin/uic resources/ui/login.ui -o apps/widgets/ui_login.h
+
+apps/widgets/ui_mainwindow.h: resources/ui/mainwindow.ui
+ /usr/bin/uic resources/ui/mainwindow.ui -o apps/widgets/ui_mainwindow.h
+
+apps/widgets/ui_permission.h: resources/ui/permission.ui
+ /usr/bin/uic resources/ui/permission.ui -o apps/widgets/ui_permission.h
+
+apps/widgets/ui_permissionform.h: resources/ui/permissionform.ui
+ /usr/bin/uic resources/ui/permissionform.ui -o apps/widgets/ui_permissionform.h
+
+apps/widgets/ui_permissionsearch.h: resources/ui/permissionsearch.ui
+ /usr/bin/uic resources/ui/permissionsearch.ui -o apps/widgets/ui_permissionsearch.h
+
+apps/widgets/ui_user.h: resources/ui/user.ui
+ /usr/bin/uic resources/ui/user.ui -o apps/widgets/ui_user.h
+
+apps/widgets/ui_userform.h: resources/ui/userform.ui
+ /usr/bin/uic resources/ui/userform.ui -o apps/widgets/ui_userform.h
+
+apps/widgets/ui_usersearch.h: resources/ui/usersearch.ui
+ /usr/bin/uic resources/ui/usersearch.ui -o apps/widgets/ui_usersearch.h
+
+compiler_yacc_decl_make_all:
+compiler_yacc_decl_clean:
+compiler_yacc_impl_make_all:
+compiler_yacc_impl_clean:
+compiler_lex_make_all:
+compiler_lex_clean:
+compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean
+
+####### Compile
+
+main.o: main.cpp commons/connection.h \
+ apps/mainwindow.h \
+ apps/widgets/ui_mainwindow.h \
+ apps/login.h \
+ apps/widgets/ui_login.h \
+ apps/changepassword.h \
+ apps/widgets/ui_changepassword.h \
+ apps/contenttypes.h \
+ apps/widgets/ui_contenttypes.h \
+ apps/contenttypesmodel.h \
+ apps/contenttypesform.h \
+ apps/widgets/ui_contenttypesform.h \
+ apps/contenttypessearch.h \
+ apps/widgets/ui_contenttypessearch.h \
+ apps/permission.h \
+ apps/widgets/ui_permission.h \
+ apps/permissionmodel.h \
+ apps/permissionform.h \
+ apps/widgets/ui_permissionform.h \
+ apps/permissionsearch.h \
+ apps/widgets/ui_permissionsearch.h \
+ apps/group.h \
+ apps/widgets/ui_group.h \
+ apps/groupmodel.h \
+ apps/groupform.h \
+ apps/widgets/ui_groupform.h \
+ apps/groupsearch.h \
+ apps/widgets/ui_groupsearch.h \
+ apps/user.h \
+ apps/widgets/ui_user.h \
+ apps/usermodel.h \
+ apps/userform.h \
+ apps/widgets/ui_userform.h \
+ apps/usersearch.h \
+ apps/widgets/ui_usersearch.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
+
+changepassword.o: apps/changepassword.cpp apps/changepassword.h \
+ apps/widgets/ui_changepassword.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o changepassword.o apps/changepassword.cpp
+
+contenttypes.o: apps/contenttypes.cpp apps/contenttypes.h \
+ apps/widgets/ui_contenttypes.h \
+ apps/contenttypesmodel.h \
+ apps/contenttypesform.h \
+ apps/widgets/ui_contenttypesform.h \
+ apps/contenttypessearch.h \
+ apps/widgets/ui_contenttypessearch.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o contenttypes.o apps/contenttypes.cpp
+
+contenttypesform.o: apps/contenttypesform.cpp apps/contenttypes.h \
+ apps/widgets/ui_contenttypes.h \
+ apps/contenttypesmodel.h \
+ apps/contenttypesform.h \
+ apps/widgets/ui_contenttypesform.h \
+ apps/contenttypessearch.h \
+ apps/widgets/ui_contenttypessearch.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o contenttypesform.o apps/contenttypesform.cpp
+
+contenttypesmodel.o: apps/contenttypesmodel.cpp apps/contenttypesmodel.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o contenttypesmodel.o apps/contenttypesmodel.cpp
+
+contenttypessearch.o: apps/contenttypessearch.cpp apps/contenttypes.h \
+ apps/widgets/ui_contenttypes.h \
+ apps/contenttypesmodel.h \
+ apps/contenttypesform.h \
+ apps/widgets/ui_contenttypesform.h \
+ apps/contenttypessearch.h \
+ apps/widgets/ui_contenttypessearch.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o contenttypessearch.o apps/contenttypessearch.cpp
+
+group.o: apps/group.cpp apps/group.h \
+ apps/widgets/ui_group.h \
+ apps/groupmodel.h \
+ apps/contenttypesmodel.h \
+ apps/groupform.h \
+ apps/widgets/ui_groupform.h \
+ apps/groupsearch.h \
+ apps/widgets/ui_groupsearch.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o group.o apps/group.cpp
+
+groupform.o: apps/groupform.cpp apps/group.h \
+ apps/widgets/ui_group.h \
+ apps/groupmodel.h \
+ apps/contenttypesmodel.h \
+ apps/groupform.h \
+ apps/widgets/ui_groupform.h \
+ apps/groupsearch.h \
+ apps/widgets/ui_groupsearch.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o groupform.o apps/groupform.cpp
+
+groupmodel.o: apps/groupmodel.cpp apps/groupmodel.h \
+ apps/contenttypesmodel.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o groupmodel.o apps/groupmodel.cpp
+
+groupsearch.o: apps/groupsearch.cpp apps/group.h \
+ apps/widgets/ui_group.h \
+ apps/groupmodel.h \
+ apps/contenttypesmodel.h \
+ apps/groupform.h \
+ apps/widgets/ui_groupform.h \
+ apps/groupsearch.h \
+ apps/widgets/ui_groupsearch.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o groupsearch.o apps/groupsearch.cpp
+
+login.o: apps/login.cpp apps/login.h \
+ apps/widgets/ui_login.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o login.o apps/login.cpp
+
+mainwindow.o: apps/mainwindow.cpp apps/mainwindow.h \
+ apps/widgets/ui_mainwindow.h \
+ apps/login.h \
+ apps/widgets/ui_login.h \
+ apps/changepassword.h \
+ apps/widgets/ui_changepassword.h \
+ apps/contenttypes.h \
+ apps/widgets/ui_contenttypes.h \
+ apps/contenttypesmodel.h \
+ apps/contenttypesform.h \
+ apps/widgets/ui_contenttypesform.h \
+ apps/contenttypessearch.h \
+ apps/widgets/ui_contenttypessearch.h \
+ apps/permission.h \
+ apps/widgets/ui_permission.h \
+ apps/permissionmodel.h \
+ apps/permissionform.h \
+ apps/widgets/ui_permissionform.h \
+ apps/permissionsearch.h \
+ apps/widgets/ui_permissionsearch.h \
+ apps/group.h \
+ apps/widgets/ui_group.h \
+ apps/groupmodel.h \
+ apps/groupform.h \
+ apps/widgets/ui_groupform.h \
+ apps/groupsearch.h \
+ apps/widgets/ui_groupsearch.h \
+ apps/user.h \
+ apps/widgets/ui_user.h \
+ apps/usermodel.h \
+ apps/userform.h \
+ apps/widgets/ui_userform.h \
+ apps/usersearch.h \
+ apps/widgets/ui_usersearch.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o apps/mainwindow.cpp
+
+permission.o: apps/permission.cpp apps/permission.h \
+ apps/widgets/ui_permission.h \
+ apps/permissionmodel.h \
+ apps/contenttypesmodel.h \
+ apps/permissionform.h \
+ apps/widgets/ui_permissionform.h \
+ apps/permissionsearch.h \
+ apps/widgets/ui_permissionsearch.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o permission.o apps/permission.cpp
+
+permissionform.o: apps/permissionform.cpp apps/permission.h \
+ apps/widgets/ui_permission.h \
+ apps/permissionmodel.h \
+ apps/contenttypesmodel.h \
+ apps/permissionform.h \
+ apps/widgets/ui_permissionform.h \
+ apps/permissionsearch.h \
+ apps/widgets/ui_permissionsearch.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o permissionform.o apps/permissionform.cpp
+
+permissionmodel.o: apps/permissionmodel.cpp apps/permissionmodel.h \
+ apps/contenttypesmodel.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o permissionmodel.o apps/permissionmodel.cpp
+
+permissionsearch.o: apps/permissionsearch.cpp apps/permission.h \
+ apps/widgets/ui_permission.h \
+ apps/permissionmodel.h \
+ apps/contenttypesmodel.h \
+ apps/permissionform.h \
+ apps/widgets/ui_permissionform.h \
+ apps/permissionsearch.h \
+ apps/widgets/ui_permissionsearch.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o permissionsearch.o apps/permissionsearch.cpp
+
+user.o: apps/user.cpp apps/user.h \
+ apps/widgets/ui_user.h \
+ apps/usermodel.h \
+ apps/contenttypesmodel.h \
+ apps/userform.h \
+ apps/widgets/ui_userform.h \
+ apps/usersearch.h \
+ apps/widgets/ui_usersearch.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o user.o apps/user.cpp
+
+userform.o: apps/userform.cpp apps/user.h \
+ apps/widgets/ui_user.h \
+ apps/usermodel.h \
+ apps/contenttypesmodel.h \
+ apps/userform.h \
+ apps/widgets/ui_userform.h \
+ apps/usersearch.h \
+ apps/widgets/ui_usersearch.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o userform.o apps/userform.cpp
+
+usermodel.o: apps/usermodel.cpp apps/usermodel.h \
+ apps/contenttypesmodel.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o usermodel.o apps/usermodel.cpp
+
+usersearch.o: apps/usersearch.cpp apps/user.h \
+ apps/widgets/ui_user.h \
+ apps/usermodel.h \
+ apps/contenttypesmodel.h \
+ apps/userform.h \
+ apps/widgets/ui_userform.h \
+ apps/usersearch.h \
+ apps/widgets/ui_usersearch.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o usersearch.o apps/usersearch.cpp
+
+moc_changepassword.o: moc_changepassword.cpp
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_changepassword.o moc_changepassword.cpp
+
+moc_contenttypes.o: moc_contenttypes.cpp
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_contenttypes.o moc_contenttypes.cpp
+
+moc_contenttypesform.o: moc_contenttypesform.cpp
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_contenttypesform.o moc_contenttypesform.cpp
+
+moc_contenttypessearch.o: moc_contenttypessearch.cpp
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_contenttypessearch.o moc_contenttypessearch.cpp
+
+moc_group.o: moc_group.cpp
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_group.o moc_group.cpp
+
+moc_groupform.o: moc_groupform.cpp
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_groupform.o moc_groupform.cpp
+
+moc_groupsearch.o: moc_groupsearch.cpp
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_groupsearch.o moc_groupsearch.cpp
+
+moc_login.o: moc_login.cpp
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_login.o moc_login.cpp
+
+moc_mainwindow.o: moc_mainwindow.cpp
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainwindow.o moc_mainwindow.cpp
+
+moc_permission.o: moc_permission.cpp
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_permission.o moc_permission.cpp
+
+moc_permissionform.o: moc_permissionform.cpp
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_permissionform.o moc_permissionform.cpp
+
+moc_permissionsearch.o: moc_permissionsearch.cpp
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_permissionsearch.o moc_permissionsearch.cpp
+
+moc_user.o: moc_user.cpp
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_user.o moc_user.cpp
+
+moc_userform.o: moc_userform.cpp
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_userform.o moc_userform.cpp
+
+moc_usersearch.o: moc_usersearch.cpp
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_usersearch.o moc_usersearch.cpp
+
+qrc_resources.o: qrc_resources.cpp
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_resources.o qrc_resources.cpp
+
+####### Install
+
+install: FORCE
+
+uninstall: FORCE
+
+FORCE:
+
View
17 README
@@ -0,0 +1,17 @@
+== C-Project
+:D, Hello!
+
+== COMPLILE
+$ mysql -u root -p << resources/db/mysql/create-database.sql
+$ qmake -project "QT += sql" "UI_DIR = apps/widgets"
+$ make
+$ ./c-project
+
+== INFORMATION
+Username: admin
+Password: admin
+
+
+--
+So long and good luck,
+Nycholas de Oliveira e Oliveira.
View
73 apps/changepassword.cpp
@@ -0,0 +1,73 @@
+/**
+ * cproject - a digital registry.
+ * Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the Nycholas de Oliveira e Oliveira nor the names of
+ * its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written group.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "changepassword.h"
+
+ChangePassword::ChangePassword(QDialog *parent) :
+ QDialog(parent) {
+ setupUi(this);
+ createActions();
+ updateWidgets();
+}
+
+ChangePassword::~ChangePassword(void) {
+}
+
+void ChangePassword::changeMyPasswordAction(void) {
+}
+
+void ChangePassword::cancelAction(void) {
+ close();
+}
+
+void ChangePassword::createActions(void) {
+ connect(changeMyPasswordPushButton, SIGNAL(released()), this,
+ SLOT(changeMyPasswordAction()));
+ connect(cancelPushButton, SIGNAL(released()), this, SLOT(cancelAction()));
+}
+
+void ChangePassword::updateWidgets(void) {
+ updateForms();
+}
+
+void ChangePassword::updateForms(void) {
+ clear();
+ focusDefault();
+ changeMyPasswordPushButton->setDefault(true);
+}
+
+void ChangePassword::clear(void) {
+ oldPasswordLineEdit->clear();
+ newPasswordLineEdit->clear();
+ passwordLineEdit->clear();
+}
+
+void ChangePassword::focusDefault(void) {
+ oldPasswordLineEdit->setFocus();
+}
View
57 apps/changepassword.h
@@ -0,0 +1,57 @@
+/**
+ * Simple example Qt - CRUD.
+ * Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the Nycholas de Oliveira e Oliveira nor the names of
+ * its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written changepassword.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef CHANGEPASSWORD_H
+#define CHANGEPASSWORD_H
+
+#include <QtCore/QDebug>
+
+#include "widgets/ui_changepassword.h"
+
+class ChangePassword: public QDialog, private Ui::ChangePassword {
+Q_OBJECT
+
+private slots:
+ void changeMyPasswordAction(void);
+ void cancelAction(void);
+
+private:
+ void createActions(void);
+ void updateWidgets(void);
+ void updateForms(void);
+
+ void clear(void);
+ void focusDefault(void);
+
+public:
+ ChangePassword(QDialog *parent = 0);
+ ~ChangePassword();
+};
+
+#endif /* CHANGEPASSWORD_H_ */
View
289 apps/contenttypes.cpp
@@ -0,0 +1,289 @@
+/**
+ * cproject - a digital registry.
+ * Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the Nycholas de Oliveira e Oliveira nor the names of
+ * its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "contenttypes.h"
+
+ContentTypes::ContentTypes(QWidget *parent) :
+ QWidget(parent) {
+ setupUi(this);
+ statusTimer = new QTimer(this);
+ createModels();
+ createViews();
+ createActions();
+ updateModels();
+ updateWidgets();
+}
+
+ContentTypes::~ContentTypes(void) {
+}
+
+void ContentTypes::timerStatusAction(void) {
+ statusLabel->hide();
+ statusLabel->setText("");
+}
+
+void ContentTypes::newAction(void) {
+ ContentTypesForm *form = new ContentTypesForm();
+ connect(form, SIGNAL(formAdded()), this, SLOT(updateModels()));
+ connect(form, SIGNAL(formChanged()), this, SLOT(updateModels()));
+ connect(form, SIGNAL(formDeleted()), this, SLOT(updateModels()));
+ form->exec();
+}
+
+void ContentTypes::activateAction(void) {
+ qDebug() << "In ContentTypes::activateAction()";
+ qDebug() << "Not implemented";
+}
+
+void ContentTypes::desactivateAction(void) {
+ qDebug() << "In ContentTypes::desactivateAction()";
+ qDebug() << "Not implemented";
+}
+
+void ContentTypes::removeAction(void) {
+ QModelIndex index = contentTypesTableView->currentIndex();
+ if (!index.isValid()) {
+ infoStatus(qApp->tr("Please select an item to edit."));
+ return;
+ }
+
+ QSqlRecord record = contentTypesModel->record(index.row());
+ int id = record.value(contenttype_id).toInt();
+ QString name = record.value(contenttype_name).toString();
+
+ QMessageBox msgBox;
+ msgBox.setText("Are you sure?");
+ msgBox.setInformativeText(QString(qApp->tr(
+ "Are you sure you want to delete the selected content types objects?\n"
+ "All of the following objects and their related items will be "
+ "deleted:\n\nContent Types: %1\n").arg(name)));
+ msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No
+ | QMessageBox::Cancel);
+ msgBox.setDefaultButton(QMessageBox::No);
+ int ret = msgBox.exec();
+ if (ret == QMessageBox::Cancel) {
+ return;
+ } else if (ret == QMessageBox::No)
+ return;
+
+ ContentTypesModel *m = new ContentTypesModel();
+ ContentTypesModel::selectById(id, m);
+ if (!m->remove()) {
+ errorStatus(qApp->tr("Fails to remove the record."));
+ return;
+ }
+ okStatus(qApp->tr("Successfully deleted content types."));
+ updateModels();
+}
+
+void ContentTypes::searchAdvancedAction(bool checked) {
+ if (checked) {
+ contentTypesSearch = new ContentTypesSearch(contentTypesModel);
+ contentTypesSearch->setAttribute(Qt::WA_DeleteOnClose);
+ connect(contentTypesSearch, SIGNAL(formSearched()), this, SLOT(
+ updateSearchForm()));
+ connect(contentTypesSearch, SIGNAL(formSearchClose()), this, SLOT(
+ updateSearchFormClose()));
+ //connect(contentTypesSearch, SIGNAL(hide()), this, SLOT(formSearchClose()));
+ contentTypesSearch->exec();
+ } else {
+ contentTypesSearch->close();
+ }
+}
+
+void ContentTypes::searchTextChangedAction(const QString &text) {
+ if (text.isEmpty() || text.isNull()) {
+ contentTypesModel->setFilter("");
+ } else {
+ contentTypesModel->setFilter(QString("name LIKE '%1\%'").arg(text));
+ }
+ updateModels();
+}
+
+void ContentTypes::doubleClickedItemViewAction(const QModelIndex &index) {
+ if (!index.isValid()) {
+ infoStatus(qApp->tr("Please select an item to edit."));
+ return;
+ }
+
+ QSqlRecord record = contentTypesModel->record(index.row());
+ int id = record.value(contenttype_id).toInt();
+
+ ContentTypesForm *form = new ContentTypesForm(id);
+ connect(form, SIGNAL(formAdded()), this, SLOT(updateModels()));
+ connect(form, SIGNAL(formChanged()), this, SLOT(updateModels()));
+ connect(form, SIGNAL(formDeleted()), this, SLOT(updateModels()));
+ form->exec();
+}
+
+void ContentTypes::lastestAction(void) {
+ contentTypesModel->query().first();
+ updateModels();
+}
+
+void ContentTypes::nextAction(void) {
+ contentTypesModel->query().next();
+ updateModels();
+}
+
+void ContentTypes::previousAction(void) {
+ contentTypesModel->query().previous();
+ updateModels();
+}
+
+void ContentTypes::oldestAction(void) {
+ contentTypesModel->query().last();
+ updateModels();
+}
+
+void ContentTypes::createModels(void) {
+ contentTypesModel = new QSqlRelationalTableModel(this);
+ contentTypesModel->setTable("app_content_type");
+ contentTypesModel->setHeaderData(contenttype_id, Qt::Horizontal, qApp->tr(
+ "Id"));
+ contentTypesModel->setHeaderData(contenttype_name, Qt::Horizontal,
+ qApp->tr("Name"));
+ contentTypesModel->setHeaderData(contenttype_appLabel, Qt::Horizontal,
+ qApp->tr("App Label"));
+ contentTypesModel->setHeaderData(contenttype_model, Qt::Horizontal,
+ qApp->tr("Model"));
+ contentTypesModel->setSort(contenttype_id, Qt::DescendingOrder);
+}
+
+void ContentTypes::createViews(void) {
+ contentTypesTableView->setModel(contentTypesModel);
+ contentTypesTableView->setItemDelegate(new QSqlRelationalDelegate(
+ contentTypesTableView));
+ contentTypesTableView->setSelectionMode(QAbstractItemView::SingleSelection);
+ contentTypesTableView->setSelectionBehavior(QAbstractItemView::SelectRows);
+ contentTypesTableView->resizeColumnsToContents();
+ contentTypesTableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
+
+ QHeaderView *header = contentTypesTableView->horizontalHeader();
+ header->setStretchLastSection(true);
+}
+
+void ContentTypes::createActions(void) {
+ connect(statusTimer, SIGNAL(timeout()), this, SLOT(timerStatusAction()));
+
+ connect(newPushButton, SIGNAL(released()), this, SLOT(newAction()));
+ connect(activatePushButton, SIGNAL(released()), this,
+ SLOT(activateAction()));
+ connect(deactivatePushButton, SIGNAL(released()), this, SLOT(
+ desactivateAction()));
+ connect(removePushButton, SIGNAL(released()), this, SLOT(removeAction()));
+ connect(searchAdvancedToolButton, SIGNAL(toggled(bool)), this,
+ SLOT(searchAdvancedAction(bool)));
+ connect(searchLineEdit, SIGNAL(textChanged(const QString &)), this,
+ SLOT(searchTextChangedAction(const QString &)));
+
+ connect(contentTypesTableView, SIGNAL(doubleClicked(const QModelIndex &)),
+ this, SLOT(doubleClickedItemViewAction(const QModelIndex &)));
+
+ connect(latestPushButton, SIGNAL(released()), this, SLOT(lastestAction()));
+ connect(nextPushButton, SIGNAL(released()), this, SLOT(nextAction()));
+ connect(previousPushButton, SIGNAL(released()), this,
+ SLOT(previousAction()));
+ connect(oldestPushButton, SIGNAL(released()), this, SLOT(oldestAction()));
+}
+
+void ContentTypes::updateWidgets(void) {
+ if (contentTypesModel->query().size() > 0) {
+ //activatePushButton->show();
+ //deactivatePushButton->show();
+ removePushButton->show();
+ } else {
+ //activatePushButton->hide();
+ //deactivatePushButton->hide();
+ removePushButton->hide();
+ }
+ activatePushButton->hide();
+ deactivatePushButton->hide();
+ statusLabel->hide();
+}
+
+void ContentTypes::updateModels(void) {
+ contentTypesModel->select();
+ qDebug() << "Query:" << contentTypesModel->query().lastQuery();
+
+ int size = contentTypesModel->query().size() < 0 ? 0
+ : contentTypesModel->query().size();
+ statusTableViewLabel->setText(size > 1 ? QString(qApp->tr(
+ "%1 content types")).arg(size) : QString(qApp->tr(
+ "%1 content types")).arg(size));
+ statusPaginationLabel->setText(QString(qApp->tr(
+ "<b>%1</b> - <b>%2</b> de <b>%3</b>")).arg(1).arg(25).arg(size));
+}
+
+void ContentTypes::timerStatus(void) {
+ statusTimer->start(3000);
+}
+
+void ContentTypes::okStatus(const QString &msg) {
+ statusLabel->setText(msg);
+ statusLabel->setStyleSheet("color: green; background-color: white;"
+ "margin: 2px; padding: 3px; border: 1px solid green;");
+ statusLabel->show();
+ timerStatus();
+}
+
+void ContentTypes::infoStatus(const QString &msg) {
+ statusLabel->setText(msg);
+ statusLabel->setStyleSheet("color: blue; background-color: white;"
+ "margin: 2px; padding: 3px; border: 1px solid blue;");
+ statusLabel->show();
+ timerStatus();
+}
+
+void ContentTypes::alertStatus(const QString &msg) {
+ statusLabel->setText(msg);
+ statusLabel->setStyleSheet("color: yellow; background-color: white;"
+ "margin: 2px; padding: 3px; border: 1px solid yellow;");
+ statusLabel->show();
+ timerStatus();
+}
+
+void ContentTypes::errorStatus(const QString &msg) {
+ statusLabel->setText(msg);
+ statusLabel->setStyleSheet("color: red; background-color: white;"
+ "margin: 2px; padding: 3px; border: 1px solid red;");
+ statusLabel->show();
+ timerStatus();
+}
+
+void ContentTypes::updateSearchForm(void) {
+ searchLineEdit->clear();
+ updateModels();
+}
+
+void ContentTypes::updateSearchFormClose(void) {
+ searchLineEdit->clear();
+ searchAdvancedToolButton->setChecked(false);
+ updateModels();
+}
View
100 apps/contenttypes.h
@@ -0,0 +1,100 @@
+/**
+ * Simple example Qt - CRUD.
+ * Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the Nycholas de Oliveira e Oliveira nor the names of
+ * its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef CONTENTTYPES_H
+#define CONTENTTYPES_H
+
+#include <QDebug>
+#include <QSqlQuery>
+#include <QSqlRecord>
+#include <QSqlRelationalTableModel>
+#include <QSqlRelationalDelegate>
+#include <QSqlError>
+#include <QModelIndex>
+#include <QDateTime>
+#include <QTimer>
+#include <QMessageBox>
+
+#include "widgets/ui_contenttypes.h"
+#include "contenttypesmodel.h"
+#include "contenttypesform.h"
+#include "contenttypessearch.h"
+
+class ContentTypes: public QWidget, private Ui::ContentTypes {
+Q_OBJECT
+
+private slots:
+ void timerStatusAction(void);
+ void newAction(void);
+ void activateAction(void);
+ void desactivateAction(void);
+ void removeAction(void);
+ void searchAdvancedAction(bool checked);
+ void searchTextChangedAction(const QString &text);
+ void doubleClickedItemViewAction(const QModelIndex &index);
+ void lastestAction(void);
+ void nextAction(void);
+ void previousAction(void);
+ void oldestAction(void);
+
+private:
+ void createModels(void);
+ void createViews(void);
+ void createActions(void);
+ void updateWidgets(void);
+
+ void timerStatus(void);
+ void okStatus(const QString &msg);
+ void infoStatus(const QString &msg);
+ void alertStatus(const QString &msg);
+ void errorStatus(const QString &msg);
+
+ QTimer *statusTimer;
+ QSqlRelationalTableModel *contentTypesModel;
+ QSqlRelationalDelegate *contentTypesDelegate;
+ ContentTypesSearch *contentTypesSearch;
+
+public slots:
+ void updateModels(void);
+ void updateSearchForm(void);
+ void updateSearchFormClose(void);
+
+public:
+ ContentTypes(QWidget *parent = 0);
+ ~ContentTypes();
+
+ enum {
+ contenttype_id = 0,
+ contenttype_name = 1,
+ contenttype_appLabel = 2,
+ contenttype_model = 3
+ };
+};
+
+#endif /* CONTENTTYPES_H_ */
View
248 apps/contenttypesform.cpp
@@ -0,0 +1,248 @@
+/**
+ * cproject - a digital registry.
+ * Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the Nycholas de Oliveira e Oliveira nor the names of
+ * its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "contenttypes.h"
+
+ContentTypesForm::ContentTypesForm(QDialog *parent) :
+ QDialog(parent) {
+ setupUi(this);
+ contentTypesModel = new ContentTypesModel();
+ statusTimer = new QTimer(this);
+ createActions();
+ updateWidgets();
+}
+
+ContentTypesForm::ContentTypesForm(int id, QDialog *parent) :
+ QDialog(parent) {
+ setupUi(this);
+ contentTypesModel = new ContentTypesModel();
+ contentTypesModel->setId(id);
+ statusTimer = new QTimer(this);
+ createActions();
+ updateWidgets();
+}
+
+ContentTypesForm::~ContentTypesForm(void) {
+}
+
+void ContentTypesForm::timerStatusAction(void) {
+ statusLabel->hide();
+ statusLabel->setText("");
+}
+
+void ContentTypesForm::saveAction(void) {
+ if (!save()) {
+ errorStatus(qApp->tr("Failure trying to register the record."));
+ } else {
+ if (contentTypesModel->getId() > 0) {
+ QMessageBox::information(
+ 0,
+ qApp->tr("Content Types changed"),
+ QString(
+ qApp->tr(
+ "The content types \"%1\" was changed successfully.")).arg(
+ contentTypesModel->getName()), QMessageBox::Ok);
+ emit formChanged();
+ } else {
+ QMessageBox::information(
+ 0,
+ qApp->tr("Content Types added"),
+ QString(qApp->tr(
+ "The content types \"%1\" was added successfully.")).arg(
+ contentTypesModel->getName()), QMessageBox::Ok);
+ emit formAdded();
+ }
+ updateModels();
+ updateForms();
+ close();
+ }
+}
+
+void ContentTypesForm::saveAndContinueSavingAction(void) {
+ if (!save()) {
+ errorStatus(qApp->tr("Failure trying to register the record."));
+ } else {
+ if (contentTypesModel->getId() > 0) {
+ okStatus(QString(qApp->tr(
+ "The content types \"%1\" was changed successfully.")).arg(
+ contentTypesModel->getName()));
+ emit formChanged();
+ } else {
+ okStatus(QString(qApp->tr(
+ "The content types \"%1\" was added successfully.")).arg(
+ contentTypesModel->getName()));
+ emit formAdded();
+ }
+ updateModels();
+ updateForms();
+ }
+}
+
+void ContentTypesForm::removeAction(void) {
+ QMessageBox msgBox;
+ msgBox.setText(qApp->tr("Are you sure?"));
+ msgBox.setInformativeText(QString(qApp->tr(
+ "Are you sure you want to delete the selected content types objects?\n"
+ "All of the following objects and their related items will be "
+ "deleted:\n\nContent Types: %1\n").arg(
+ contentTypesModel->getName())));
+ msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No
+ | QMessageBox::Cancel);
+ msgBox.setDefaultButton(QMessageBox::No);
+ int ret = msgBox.exec();
+ if (ret == QMessageBox::Cancel) {
+ updateModels();
+ updateForms();
+ close();
+ return;
+ } else if (ret == QMessageBox::No)
+ return;
+ if (!remove()) {
+ errorStatus(qApp->tr("Fails to remove the record."));
+ } else {
+ QMessageBox::information(0, qApp->tr("Content Types deleted"), QString(
+ qApp->tr("Successfully deleted %1 content types.")).arg("1"),
+ QMessageBox::Ok);
+ emit
+ formDeleted();
+ updateModels();
+ updateForms();
+ close();
+ }
+}
+
+void ContentTypesForm::cancelAction(void) {
+ close();
+}
+
+void ContentTypesForm::createActions(void) {
+ connect(statusTimer, SIGNAL(timeout()), this, SLOT(timerStatusAction()));
+
+ connect(savePushButton, SIGNAL(released()), this, SLOT(saveAction()));
+ connect(saveAndContinueSavingPushButton, SIGNAL(released()), this,
+ SLOT(saveAndContinueSavingAction()));
+ connect(removePushButton, SIGNAL(released()), this, SLOT(removeAction()));
+ connect(cancelPushButton, SIGNAL(released()), this, SLOT(cancelAction()));
+}
+
+void ContentTypesForm::updateWidgets(void) {
+ setWindowFlags(Qt::Dialog);
+ updateForms();
+ statusLabel->hide();
+}
+
+void ContentTypesForm::updateModels(void) {
+ contentTypesModel = new ContentTypesModel();
+}
+
+void ContentTypesForm::updateForms(void) {
+ clear();
+ focusDefault();
+ if (contentTypesModel->getId() > 0) {
+ select();
+ titleLabel->setText(qApp->tr("Change Content Types"));
+ formGroupBox->setTitle(qApp->tr("&Content Types details"));
+ savePushButton->setText(qApp->tr("&Update"));
+ saveAndContinueSavingPushButton->setText(qApp->tr(
+ "Update and &continue saving"));
+ removePushButton->show();
+ } else {
+ titleLabel->setText(qApp->tr("Add Content Types"));
+ formGroupBox->setTitle(qApp->tr("&Content Types details"));
+ savePushButton->setText(qApp->tr("&Save"));
+ saveAndContinueSavingPushButton->setText(qApp->tr(
+ "Save and &continue saving"));
+ removePushButton->hide();
+ }
+ savePushButton->setDefault(true);
+}
+
+void ContentTypesForm::select(void) {
+ ContentTypesModel::selectById(contentTypesModel->getId(), contentTypesModel);
+ nameLineEdit->setText(contentTypesModel->getName());
+ appLabelLineEdit->setText(contentTypesModel->getAppLabel());
+ modelLineEdit->setText(contentTypesModel->getModel());
+}
+
+bool ContentTypesForm::save(void) {
+ contentTypesModel->setName(nameLineEdit->text());
+ contentTypesModel->setAppLabel(appLabelLineEdit->text());
+ contentTypesModel->setModel(modelLineEdit->text());
+ return contentTypesModel->save();
+}
+
+bool ContentTypesForm::remove(void) {
+ return contentTypesModel->remove();
+}
+
+void ContentTypesForm::clear(void) {
+ nameLineEdit->clear();
+ appLabelLineEdit->clear();
+ modelLineEdit->clear();
+}
+
+void ContentTypesForm::focusDefault(void) {
+ nameLineEdit->setFocus();
+}
+
+void ContentTypesForm::timerStatus(void) {
+ statusTimer->start(3000);
+}
+
+void ContentTypesForm::okStatus(const QString &msg) {
+ statusLabel->setText(msg);
+ statusLabel->setStyleSheet("color: green; background-color: white;"
+ "margin: 2px; padding: 3px; border: 1px solid green;");
+ statusLabel->show();
+ timerStatus();
+}
+
+void ContentTypesForm::infoStatus(const QString &msg) {
+ statusLabel->setText(msg);
+ statusLabel->setStyleSheet("color: blue; background-color: white;"
+ "margin: 2px; padding: 3px; border: 1px solid blue;");
+ statusLabel->show();
+ timerStatus();
+}
+
+void ContentTypesForm::alertStatus(const QString &msg) {
+ statusLabel->setText(msg);
+ statusLabel->setStyleSheet("color: yellow; background-color: white;"
+ "margin: 2px; padding: 3px; border: 1px solid yellow;");
+ statusLabel->show();
+ timerStatus();
+}
+
+void ContentTypesForm::errorStatus(const QString &msg) {
+ statusLabel->setText(msg);
+ statusLabel->setStyleSheet("color: red; background-color: white;"
+ "margin: 2px; padding: 3px; border: 1px solid red;");
+ statusLabel->show();
+ timerStatus();
+}
View
90 apps/contenttypesform.h
@@ -0,0 +1,90 @@
+/**
+ * Simple example Qt - CRUD.
+ * Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the Nycholas de Oliveira e Oliveira nor the names of
+ * its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef CONTENTTYPESFORM_H
+#define CONTENTTYPESFORM_H
+
+#include <QDebug>
+#include <QSqlQuery>
+#include <QSqlRecord>
+#include <QSqlRelationalTableModel>
+#include <QSqlRelationalDelegate>
+#include <QSqlError>
+#include <QModelIndex>
+#include <QDateTime>
+#include <QTimer>
+#include <QMessageBox>
+
+#include "widgets/ui_contenttypesform.h"
+#include "contenttypesmodel.h"
+
+class ContentTypesForm: public QDialog, private Ui::ContentTypesForm {
+Q_OBJECT
+
+private slots:
+ void timerStatusAction(void);
+ void saveAction(void);
+ void saveAndContinueSavingAction(void);
+ void removeAction(void);
+ void cancelAction(void);
+
+private:
+ void createActions(void);
+ void updateWidgets(void);
+ void updateModels(void);
+ void updateForms(void);
+
+ void select(void);
+ bool save(void);
+ bool remove(void);
+
+ void clear(void);
+ void focusDefault(void);
+
+ void timerStatus(void);
+ void okStatus(const QString &msg);
+ void infoStatus(const QString &msg);
+ void alertStatus(const QString &msg);
+ void errorStatus(const QString &msg);
+
+ QTimer *statusTimer;
+ ContentTypesModel *contentTypesModel;
+
+signals:
+ void formAdded(void);
+ void formChanged(void);
+ void formDeleted(void);
+
+public:
+ ContentTypesForm(QDialog *parent = 0);
+ ContentTypesForm(int id, QDialog *parent = 0);
+ ~ContentTypesForm();
+};
+
+#endif /* CONTENTTYPESFORM_H_ */
View
149 apps/contenttypesmodel.cpp
@@ -0,0 +1,149 @@
+/**
+ * cproject - a digital registry.
+ * Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the Nycholas de Oliveira e Oliveira nor the names of
+ * its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "contenttypesmodel.h"
+
+ContentTypesModel::ContentTypesModel() {
+ id = 0;
+}
+
+void ContentTypesModel::selectAll(QList<ContentTypesModel> *list) {
+ QSqlQuery query;
+ query.prepare("SELECT * FROM app_content_type");
+ if (!query.exec())
+ return;
+ int idCol = query.record().indexOf("id");
+ int nameCol = query.record().indexOf("name");
+ int appLabelCol = query.record().indexOf("app_label");
+ int modelCol = query.record().indexOf("model");
+ while (query.next()) {
+ ContentTypesModel m;
+ m.setId(query.value(idCol).toInt());
+ m.setName(query.value(nameCol).toString());
+ m.setAppLabel(query.value(appLabelCol).toString());
+ m.setModel(query.value(modelCol).toString());
+ list->append(m);
+ }
+}
+
+void ContentTypesModel::selectById(int _id, ContentTypesModel *m) {
+ QSqlQuery query;
+ query.prepare("SELECT * "
+ "FROM app_content_type "
+ "WHERE id=:id");
+ query.bindValue(":id", _id);
+ if (!query.exec())
+ return;
+ int idCol = query.record().indexOf("id");
+ int nameCol = query.record().indexOf("name");
+ int appLabelCol = query.record().indexOf("app_label");
+ int modelCol = query.record().indexOf("model");
+ if (query.next()) {
+ m->id = query.value(idCol).toInt();
+ m->name = query.value(nameCol).toString();
+ m->appLabel = query.value(appLabelCol).toString();
+ m->model = query.value(modelCol).toString();
+ }
+}
+
+bool ContentTypesModel::save(void) {
+ if (id > 0) {
+ return update();
+ }
+ return insert();
+}
+
+bool ContentTypesModel::insert(void) {
+ QSqlQuery query;
+ query.prepare("INSERT INTO app_content_type (name, app_label, model) "
+ "VALUES (:name, :app_label, :model)");
+ query.bindValue(":name", name);
+ query.bindValue(":app_label", appLabel);
+ query.bindValue(":model", model);
+ return query.exec();
+}
+
+bool ContentTypesModel::update(void) {
+ QSqlQuery query;
+ query.prepare("UPDATE app_content_type "
+ "SET name=:name, app_label=:app_label, "
+ "model=:model "
+ "WHERE id=:id");
+ query.bindValue(":id", id);
+ query.bindValue(":name", name);
+ query.bindValue(":app_label", appLabel);
+ query.bindValue(":model", model);
+ return query.exec();
+}
+
+bool ContentTypesModel::status(void) {
+ qDebug() << "In ContentTypesModel::status()";
+ qDebug() << "Not implemented";
+ return false;
+}
+
+bool ContentTypesModel::remove(void) {
+ QSqlQuery query;
+ query.prepare("DELETE FROM app_content_type "
+ "WHERE id=:id");
+ query.bindValue(":id", id);
+ return query.exec();
+}
+
+int ContentTypesModel::getId(void) {
+ return id;
+}
+
+void ContentTypesModel::setId(int _id) {
+ id = _id;
+}
+
+QString ContentTypesModel::getName(void) {
+ return name;
+}
+
+void ContentTypesModel::setName(QString _name) {
+ name = _name;
+}
+
+QString ContentTypesModel::getAppLabel(void) {
+ return appLabel;
+}
+
+void ContentTypesModel::setAppLabel(QString _appLabel) {
+ appLabel = _appLabel;
+}
+
+QString ContentTypesModel::getModel(void) {
+ return model;
+}
+
+void ContentTypesModel::setModel(QString _model) {
+ model = _model;
+}
View
68 apps/contenttypesmodel.h
@@ -0,0 +1,68 @@
+/**
+ * Simple example Qt - CRUD.
+ * Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the Nycholas de Oliveira e Oliveira nor the names of
+ * its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef CONTENTTYPESMODEL_H
+#define CONTENTTYPESMODEL_H
+
+#include <QDebug>
+#include <QSqlQueryModel>
+#include <QSqlRecord>
+#include <QSqlQuery>
+#include <QDateTime>
+#include <QVariant>
+#include <QColor>
+
+class ContentTypesModel {
+private:
+ int id;
+ QString name;
+ QString appLabel;
+ QString model;
+
+public:
+ ContentTypesModel();
+ static void selectAll(QList<ContentTypesModel> *list);
+ static void selectById(int id, ContentTypesModel *contenttypeModel);
+ bool save(void);
+ bool insert(void);
+ bool update(void);
+ bool status(void);
+ bool remove(void);
+
+ int getId(void);
+ void setId(int _id);
+ QString getName(void);
+ void setName(QString _name);
+ QString getAppLabel();
+ void setAppLabel(QString _appLabel);
+ QString getModel(void);
+ void setModel(QString _model);
+};
+
+#endif /* CONTENTTYPESMODEL_H_ */
View
104 apps/contenttypessearch.cpp
@@ -0,0 +1,104 @@
+/**
+ * cproject - a digital registry.
+ * Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the Nycholas de Oliveira e Oliveira nor the names of
+ * its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "contenttypes.h"
+
+ContentTypesSearch::ContentTypesSearch(QDialog *parent) :
+ QDialog(parent) {
+ setupUi(this);
+ createActions();
+ updateWidgets();
+}
+
+ContentTypesSearch::ContentTypesSearch(QSqlRelationalTableModel *model,
+ QDialog *parent) :
+ QDialog(parent) {
+ setupUi(this);
+ contentTypesModel = model;
+ createActions();
+ updateWidgets();
+}
+
+ContentTypesSearch::~ContentTypesSearch(void) {
+}
+
+void ContentTypesSearch::searchAction(void) {
+ QString name = nameLineEdit->text();
+ QString appLabel = appLabelLineEdit->text();
+ QString model = modelLineEdit->text();
+
+ QString query = " 1=1 ";
+ if (!name.isEmpty())
+ query.append(QString(" AND name LIKE '%1\%'").arg(name));
+ if (!appLabel.isEmpty())
+ query.append(QString(" AND app_label LIKE '\%%1\%'").arg(appLabel));
+ if (!model.isEmpty())
+ query.append(QString(" AND model LIKE '\%%1\%'").arg(model));
+ contentTypesModel->setFilter(query);
+ emit formSearched();
+}
+
+void ContentTypesSearch::cancelAction(void) {
+ contentTypesModel->setFilter("");
+ emit
+ formSearchClose();
+ close();
+}
+
+void ContentTypesSearch::closeAction(void) {
+ emit formSearchClose();
+ close();
+}
+
+void ContentTypesSearch::createActions(void) {
+ connect(searchPushButton, SIGNAL(released()), this, SLOT(searchAction()));
+ connect(cancelPushButton, SIGNAL(released()), this, SLOT(cancelAction()));
+ connect(closePushButton, SIGNAL(released()), this, SLOT(closeAction()));
+}
+
+void ContentTypesSearch::updateWidgets(void) {
+ setWindowFlags(Qt::Dialog);
+ updateForms();
+}
+
+void ContentTypesSearch::updateForms(void) {
+ clear();
+ focusDefault();
+ searchPushButton->setDefault(true);
+}
+
+void ContentTypesSearch::clear(void) {
+ nameLineEdit->clear();
+ appLabelLineEdit->clear();
+ modelLineEdit->clear();
+}
+
+void ContentTypesSearch::focusDefault(void) {
+ nameLineEdit->setFocus();
+}
View
70 apps/contenttypessearch.h
@@ -0,0 +1,70 @@
+/**
+ * Simple example Qt - CRUD.
+ * Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the Nycholas de Oliveira e Oliveira nor the names of
+ * its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef CONTENTTYPESSEARCH_H
+#define CONTENTTYPESSEARCH_H
+
+#include <QDebug>
+#include <QSqlQuery>
+#include <QSqlRecord>
+#include <QSqlRelationalTableModel>
+#include <QSqlRelationalDelegate>
+#include <QSqlError>
+
+#include "widgets/ui_contenttypessearch.h"
+
+class ContentTypesSearch: public QDialog, private Ui::ContentTypesSearch {
+ Q_OBJECT
+
+private slots:
+ void searchAction(void);
+ void cancelAction(void);
+ void closeAction(void);
+
+private:
+ void createActions(void);
+ void updateWidgets(void);
+ void updateForms(void);
+
+ void clear(void);
+ void focusDefault(void);
+
+ QSqlRelationalTableModel *contentTypesModel;
+
+signals:
+ void formSearched(void);
+ void formSearchClose(void);
+
+public:
+ ContentTypesSearch(QSqlRelationalTableModel *model, QDialog *parent = 0);
+ ContentTypesSearch(QDialog *parent = 0);
+ ~ContentTypesSearch();
+};
+
+#endif /* CONTENTTYPESSEARCH_H_ */
View
286 apps/group.cpp
@@ -0,0 +1,286 @@
+/**
+ * cproject - a digital registry.
+ * Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the Nycholas de Oliveira e Oliveira nor the names of
+ * its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written group.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "group.h"
+
+Group::Group(QWidget *parent) :
+ QWidget(parent) {
+ setupUi(this);
+ statusTimer = new QTimer(this);
+ createModels();
+ createViews();
+ createActions();
+ updateModels();
+ updateWidgets();
+}
+
+Group::~Group(void) {
+}
+
+void Group::timerStatusAction(void) {
+ statusLabel->hide();
+ statusLabel->setText("");
+}
+
+void Group::newAction(void) {
+ GroupForm *form = new GroupForm();
+ connect(form, SIGNAL(formAdded()), this, SLOT(updateModels()));
+ connect(form, SIGNAL(formChanged()), this, SLOT(updateModels()));
+ connect(form, SIGNAL(formDeleted()), this, SLOT(updateModels()));
+ form->show();
+ form->raise();
+ form->activateWindow();
+}
+
+void Group::activateAction(void) {
+ qDebug() << "In Group::activateAction()";
+ qDebug() << "Not implemented";
+}
+
+void Group::desactivateAction(void) {
+ qDebug() << "In Group::desactivateAction()";
+ qDebug() << "Not implemented";
+}
+
+void Group::removeAction(void) {
+ QModelIndex index = groupTableView->currentIndex();
+ if (!index.isValid()) {
+ infoStatus(qApp->tr("Please select an item to edit."));
+ return;
+ }
+
+ QSqlRecord record = groupModel->record(index.row());
+ int id = record.value(group_id).toInt();
+ QString name = record.value(group_name).toString();
+
+ QMessageBox msgBox;
+ msgBox.setText("Are you sure?");
+ msgBox.setInformativeText(QString(qApp->tr(
+ "Are you sure you want to delete the selected group objects?\n"
+ "All of the following objects and their related items will be "
+ "deleted:\n\nGroup: %1\n").arg(name)));
+ msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No
+ | QMessageBox::Cancel);
+ msgBox.setDefaultButton(QMessageBox::No);
+ int ret = msgBox.exec();
+ if (ret == QMessageBox::Cancel) {
+ return;
+ } else if (ret == QMessageBox::No)
+ return;
+
+ GroupModel *m = new GroupModel();
+ GroupModel::selectById(id, m);
+ if (!m->remove()) {
+ errorStatus(qApp->tr("Fails to remove the record."));
+ return;
+ }
+ okStatus(qApp->tr("Successfully deleted group."));
+ updateModels();
+}
+
+void Group::searchAdvancedAction(bool checked) {
+ if (checked) {
+ groupSearch = new GroupSearch(groupModel);
+ groupSearch->setAttribute(Qt::WA_DeleteOnClose);
+ connect(groupSearch, SIGNAL(formSearched()), this, SLOT(
+ updateSearchForm()));
+ connect(groupSearch, SIGNAL(formSearchClose()), this, SLOT(
+ updateSearchFormClose()));
+ //connect(groupSearch, SIGNAL(hide()), this, SLOT(formSearchClose()));
+ groupSearch->show();
+ groupSearch->raise();
+ groupSearch->activateWindow();
+ } else {
+ groupSearch->close();
+ }
+}
+
+void Group::searchTextChangedAction(const QString &text) {
+ if (text.isEmpty() || text.isNull()) {
+ groupModel->setFilter("");
+ } else {
+ groupModel->setFilter(QString("name LIKE '%1\%'").arg(text));
+ }
+ updateModels();
+}
+
+void Group::doubleClickedItemViewAction(const QModelIndex &index) {
+ if (!index.isValid()) {
+ infoStatus(qApp->tr("Please select an item to edit."));
+ return;
+ }
+
+ QSqlRecord record = groupModel->record(index.row());
+ int id = record.value(group_id).toInt();
+
+ GroupForm *form = new GroupForm(id);
+ connect(form, SIGNAL(formAdded()), this, SLOT(updateModels()));
+ connect(form, SIGNAL(formChanged()), this, SLOT(updateModels()));
+ connect(form, SIGNAL(formDeleted()), this, SLOT(updateModels()));
+ form->show();
+ form->raise();
+ form->activateWindow();
+}
+
+void Group::lastestAction(void) {
+ groupModel->query().first();
+ updateModels();
+}
+
+void Group::nextAction(void) {
+ groupModel->query().next();
+ updateModels();
+}
+
+void Group::previousAction(void) {
+ groupModel->query().previous();
+ updateModels();
+}
+
+void Group::oldestAction(void) {
+ groupModel->query().last();
+ updateModels();
+}
+
+void Group::createModels(void) {
+ groupModel = new QSqlRelationalTableModel(this);
+ groupModel->setTable("auth_group");
+ groupModel->setHeaderData(group_id, Qt::Horizontal, qApp->tr("Id"));
+ groupModel->setHeaderData(group_name, Qt::Horizontal, qApp->tr("Name"));
+ groupModel->setSort(group_id, Qt::DescendingOrder);
+}
+
+void Group::createViews(void) {
+ groupTableView->setModel(groupModel);
+ groupTableView->setItemDelegate(new QSqlRelationalDelegate(groupTableView));
+ groupTableView->setSelectionMode(QAbstractItemView::SingleSelection);
+ groupTableView->setSelectionBehavior(QAbstractItemView::SelectRows);
+ groupTableView->resizeColumnsToContents();
+ groupTableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
+
+ QHeaderView *header = groupTableView->horizontalHeader();
+ header->setStretchLastSection(true);
+}
+
+void Group::createActions(void) {
+ connect(statusTimer, SIGNAL(timeout()), this, SLOT(timerStatusAction()));
+
+ connect(newPushButton, SIGNAL(released()), this, SLOT(newAction()));
+ connect(activatePushButton, SIGNAL(released()), this,
+ SLOT(activateAction()));
+ connect(deactivatePushButton, SIGNAL(released()), this, SLOT(
+ desactivateAction()));
+ connect(removePushButton, SIGNAL(released()), this, SLOT(removeAction()));
+ connect(searchAdvancedToolButton, SIGNAL(toggled(bool)), this,
+ SLOT(searchAdvancedAction(bool)));
+ connect(searchLineEdit, SIGNAL(textChanged(const QString &)), this,
+ SLOT(searchTextChangedAction(const QString &)));
+
+ connect(groupTableView, SIGNAL(doubleClicked(const QModelIndex &)),
+ this, SLOT(doubleClickedItemViewAction(const QModelIndex &)));
+
+ connect(latestPushButton, SIGNAL(released()), this, SLOT(lastestAction()));
+ connect(nextPushButton, SIGNAL(released()), this, SLOT(nextAction()));
+ connect(previousPushButton, SIGNAL(released()), this,
+ SLOT(previousAction()));
+ connect(oldestPushButton, SIGNAL(released()), this, SLOT(oldestAction()));
+}
+
+void Group::updateWidgets(void) {
+ if (groupModel->query().size() > 0) {
+ //activatePushButton->show();
+ //deactivatePushButton->show();
+ removePushButton->show();
+ } else {
+ //activatePushButton->hide();
+ //deactivatePushButton->hide();