Permalink
Browse files

:))), Finalize coupon -> act

  • Loading branch information...
1 parent e1b609f commit e05bfa5f37cbe08a5d9e68ab6c4f99c38a1afb68 @nycholas committed Aug 6, 2010
View
2 Makefile
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: c-project
-# Generated by qmake (2.01a) (Qt 4.6.3) on: Thu Aug 5 16:45:48 2010
+# Generated by qmake (2.01a) (Qt 4.6.3) on: Fri Aug 6 18:00:57 2010
# Project: c-project.pro
# Template: subdirs
# Command: /usr/bin/qmake -unix -o Makefile c-project.pro
View
BIN doc/database/eer/c-project.mwb
Binary file not shown.
View
22 doc/database/mysql/create-database.sql
@@ -195,7 +195,7 @@ COLLATE = utf8_unicode_ci;
-- Table `cprojectdb`.`admin_register_act`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `cprojectdb`.`admin_register_act` (
- `id` INT ZEROFILL NOT NULL AUTO_INCREMENT ,
+ `id` INT NOT NULL AUTO_INCREMENT ,
`name` VARCHAR(60) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NOT NULL ,
`description` TINYTEXT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NULL ,
`value` DECIMAL(10,5) NOT NULL ,
@@ -212,7 +212,7 @@ COLLATE = utf8_unicode_ci;
-- Table `cprojectdb`.`admin_register_coupon`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `cprojectdb`.`admin_register_coupon` (
- `id` INT ZEROFILL NOT NULL AUTO_INCREMENT ,
+ `id` INT NOT NULL AUTO_INCREMENT ,
`id_auth_user` INT NOT NULL ,
`name` VARCHAR(60) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NOT NULL ,
`description` TINYTEXT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NULL ,
@@ -229,19 +229,19 @@ COLLATE = utf8_unicode_ci;
-- Table `cprojectdb`.`admin_register_act_coupon`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `cprojectdb`.`admin_register_act_coupon` (
- `id` INT ZEROFILL NOT NULL AUTO_INCREMENT ,
- `act_id` INT NOT NULL ,
- `coupon_id` INT NOT NULL ,
+ `id` INT NOT NULL AUTO_INCREMENT ,
+ `admin_register_act_id` INT NOT NULL ,
+ `admin_register_coupon_id` INT NOT NULL ,
PRIMARY KEY (`id`) ,
- INDEX `fk_cupom_atos_atos1` (`act_id` ASC) ,
- INDEX `fk_cupom_atos_cupom1` (`coupon_id` ASC) ,
- CONSTRAINT `fk_cupom_atos_atos1`
- FOREIGN KEY (`act_id` )
+ INDEX `fk_admin_register_act_coupon_admin_register_act1` (`admin_register_act_id` ASC) ,
+ INDEX `fk_admin_register_act_coupon_admin_register_coupon1` (`admin_register_coupon_id` ASC) ,
+ CONSTRAINT `fk_admin_register_act_coupon_admin_register_act1`
+ FOREIGN KEY (`admin_register_act_id` )
REFERENCES `cprojectdb`.`admin_register_act` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
- CONSTRAINT `fk_cupom_atos_cupom1`
- FOREIGN KEY (`coupon_id` )
+ CONSTRAINT `fk_admin_register_act_coupon_admin_register_coupon1`
+ FOREIGN KEY (`admin_register_coupon_id` )
REFERENCES `cprojectdb`.`admin_register_coupon` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
View
2 doc/database/mysql/populate-auth_user.sql
@@ -1,3 +1,3 @@
INSERT INTO cprojectdb.auth_user
- (username, password, is_active, last_login, date_joined)
+ (username, password, is_active, date_joined)
VALUES ('admin', 'd033e22ae348aeb5660fc2140aec35850c4da997', 1, now());
View
2 share/Makefile
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: share
-# Generated by qmake (2.01a) (Qt 4.6.3) on: Thu Aug 5 16:45:48 2010
+# Generated by qmake (2.01a) (Qt 4.6.3) on: Fri Aug 6 18:00:57 2010
# Project: share.pro
# Template: subdirs
# Command: /usr/bin/qmake -unix -o Makefile share.pro
View
2 share/c-project/Makefile.static
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: phony_target
-# Generated by qmake (2.01a) (Qt 4.6.3) on: Thu Aug 5 16:45:48 2010
+# Generated by qmake (2.01a) (Qt 4.6.3) on: Fri Aug 6 18:00:57 2010
# Project: static.pro
# Template: app
# Command: /usr/bin/qmake -unix -o Makefile.static static.pro
View
2 share/c-project/translations/Makefile
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: phony_target2
-# Generated by qmake (2.01a) (Qt 4.6.3) on: Thu Aug 5 16:45:48 2010
+# Generated by qmake (2.01a) (Qt 4.6.3) on: Fri Aug 6 18:00:57 2010
# Project: translations.pro
# Template: app
# Command: /usr/bin/qmake -unix -o Makefile translations.pro
View
2 src/Makefile
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: src
-# Generated by qmake (2.01a) (Qt 4.6.3) on: Thu Aug 5 16:45:47 2010
+# Generated by qmake (2.01a) (Qt 4.6.3) on: Fri Aug 6 18:00:57 2010
# Project: src.pro
# Template: subdirs
# Command: /usr/bin/qmake -unix -o Makefile src.pro
View
66 src/app/Makefile
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: ../../bin/c-project
-# Generated by qmake (2.01a) (Qt 4.6.3) on: Thu Aug 5 16:45:47 2010
+# Generated by qmake (2.01a) (Qt 4.6.3) on: Fri Aug 6 18:00:56 2010
# Project: app.pro
# Template: app
# Command: /usr/bin/qmake -unix -o Makefile app.pro
@@ -74,6 +74,7 @@ SOURCES = ../core/changepassword.cpp \
../modules/admin/couponform.cpp \
../modules/admin/models/couponmodel.cpp \
../modules/admin/couponsearch.cpp \
+ ../modules/admin/models/actcouponmodel.cpp \
main.cpp .moc/release-shared/moc_changepassword.cpp \
.moc/release-shared/moc_contenttypes.cpp \
.moc/release-shared/moc_contenttypesform.cpp \
@@ -105,6 +106,7 @@ SOURCES = ../core/changepassword.cpp \
.moc/release-shared/moc_couponform.cpp \
.moc/release-shared/moc_couponmodel.cpp \
.moc/release-shared/moc_couponsearch.cpp \
+ .moc/release-shared/moc_actcouponmodel.cpp \
.rcc/qrc_resources.cpp
OBJECTS = .obj/release-shared/changepassword.o \
.obj/release-shared/contenttypes.o \
@@ -137,6 +139,7 @@ OBJECTS = .obj/release-shared/changepassword.o \
.obj/release-shared/couponform.o \
.obj/release-shared/couponmodel.o \
.obj/release-shared/couponsearch.o \
+ .obj/release-shared/actcouponmodel.o \
.obj/release-shared/main.o \
.obj/release-shared/moc_changepassword.o \
.obj/release-shared/moc_contenttypes.o \
@@ -169,6 +172,7 @@ OBJECTS = .obj/release-shared/changepassword.o \
.obj/release-shared/moc_couponform.o \
.obj/release-shared/moc_couponmodel.o \
.obj/release-shared/moc_couponsearch.o \
+ .obj/release-shared/moc_actcouponmodel.o \
.obj/release-shared/qrc_resources.o
DIST = /usr/share/qt/mkspecs/common/g++.conf \
/usr/share/qt/mkspecs/common/unix.conf \
@@ -284,7 +288,7 @@ qmake: FORCE
dist:
@$(CHK_DIR_EXISTS) .obj/release-shared/c-project1.0.0 || $(MKDIR) .obj/release-shared/c-project1.0.0
- $(COPY_FILE) --parents $(SOURCES) $(DIST) .obj/release-shared/c-project1.0.0/ && $(COPY_FILE) --parents ../core/changepassword.h ../core/contenttypes.h ../core/contenttypesform.h ../core/models/contenttypesmodel.h ../core/contenttypessearch.h ../core/group.h ../core/groupform.h ../core/models/groupmodel.h ../core/groupsearch.h ../core/login.h ../core/mainwindow.h ../core/permission.h ../core/permissionform.h ../core/models/permissionmodel.h ../core/permissionsearch.h ../core/user.h ../core/userform.h ../core/models/usermodel.h ../core/usersearch.h ../modules/admin/register.h ../modules/admin/registerform.h ../modules/admin/models/registermodel.h ../modules/admin/registersearch.h ../modules/admin/act.h ../modules/admin/actform.h ../modules/admin/models/actmodel.h ../modules/admin/actsearch.h ../modules/admin/coupon.h ../modules/admin/couponform.h ../modules/admin/models/couponmodel.h ../modules/admin/couponsearch.h .obj/release-shared/c-project1.0.0/ && $(COPY_FILE) --parents ../core/widgets/resources.qrc ../modules/admin/widgets/resources.qrc .obj/release-shared/c-project1.0.0/ && $(COPY_FILE) --parents ../core/changepassword.cpp ../core/contenttypes.cpp ../core/contenttypesform.cpp ../core/models/contenttypesmodel.cpp ../core/contenttypessearch.cpp ../core/group.cpp ../core/groupform.cpp ../core/models/groupmodel.cpp ../core/groupsearch.cpp ../core/login.cpp ../core/mainwindow.cpp ../core/permission.cpp ../core/permissionform.cpp ../core/models/permissionmodel.cpp ../core/permissionsearch.cpp ../core/user.cpp ../core/userform.cpp ../core/models/usermodel.cpp ../core/usersearch.cpp ../modules/admin/register.cpp ../modules/admin/registerform.cpp ../modules/admin/models/registermodel.cpp ../modules/admin/registersearch.cpp ../modules/admin/act.cpp ../modules/admin/actform.cpp ../modules/admin/models/actmodel.cpp ../modules/admin/actsearch.cpp ../modules/admin/coupon.cpp ../modules/admin/couponform.cpp ../modules/admin/models/couponmodel.cpp ../modules/admin/couponsearch.cpp main.cpp .obj/release-shared/c-project1.0.0/ && $(COPY_FILE) --parents ../core/widgets/changepassword.ui ../core/widgets/contenttypes.ui ../core/widgets/contenttypesform.ui ../core/widgets/contenttypessearch.ui ../core/widgets/group.ui ../core/widgets/groupform.ui ../core/widgets/groupsearch.ui ../core/widgets/login.ui ../core/widgets/mainwindow.ui ../core/widgets/permission.ui ../core/widgets/permissionform.ui ../core/widgets/permissionsearch.ui ../core/widgets/user.ui ../core/widgets/userform.ui ../core/widgets/usersearch.ui ../modules/admin/widgets/register.ui ../modules/admin/widgets/registerform.ui ../modules/admin/widgets/registersearch.ui ../modules/admin/widgets/act.ui ../modules/admin/widgets/actform.ui ../modules/admin/widgets/actsearch.ui ../modules/admin/widgets/coupon.ui ../modules/admin/widgets/couponform.ui ../modules/admin/widgets/couponsearch.ui .obj/release-shared/c-project1.0.0/ && (cd `dirname .obj/release-shared/c-project1.0.0` && $(TAR) c-project1.0.0.tar c-project1.0.0 && $(COMPRESS) c-project1.0.0.tar) && $(MOVE) `dirname .obj/release-shared/c-project1.0.0`/c-project1.0.0.tar.gz . && $(DEL_FILE) -r .obj/release-shared/c-project1.0.0
+ $(COPY_FILE) --parents $(SOURCES) $(DIST) .obj/release-shared/c-project1.0.0/ && $(COPY_FILE) --parents ../core/changepassword.h ../core/contenttypes.h ../core/contenttypesform.h ../core/models/contenttypesmodel.h ../core/contenttypessearch.h ../core/group.h ../core/groupform.h ../core/models/groupmodel.h ../core/groupsearch.h ../core/login.h ../core/mainwindow.h ../core/permission.h ../core/permissionform.h ../core/models/permissionmodel.h ../core/permissionsearch.h ../core/user.h ../core/userform.h ../core/models/usermodel.h ../core/usersearch.h ../modules/admin/register.h ../modules/admin/registerform.h ../modules/admin/models/registermodel.h ../modules/admin/registersearch.h ../modules/admin/act.h ../modules/admin/actform.h ../modules/admin/models/actmodel.h ../modules/admin/actsearch.h ../modules/admin/coupon.h ../modules/admin/couponform.h ../modules/admin/models/couponmodel.h ../modules/admin/couponsearch.h ../modules/admin/models/actcouponmodel.h .obj/release-shared/c-project1.0.0/ && $(COPY_FILE) --parents ../core/widgets/resources.qrc ../modules/admin/widgets/resources.qrc .obj/release-shared/c-project1.0.0/ && $(COPY_FILE) --parents ../core/changepassword.cpp ../core/contenttypes.cpp ../core/contenttypesform.cpp ../core/models/contenttypesmodel.cpp ../core/contenttypessearch.cpp ../core/group.cpp ../core/groupform.cpp ../core/models/groupmodel.cpp ../core/groupsearch.cpp ../core/login.cpp ../core/mainwindow.cpp ../core/permission.cpp ../core/permissionform.cpp ../core/models/permissionmodel.cpp ../core/permissionsearch.cpp ../core/user.cpp ../core/userform.cpp ../core/models/usermodel.cpp ../core/usersearch.cpp ../modules/admin/register.cpp ../modules/admin/registerform.cpp ../modules/admin/models/registermodel.cpp ../modules/admin/registersearch.cpp ../modules/admin/act.cpp ../modules/admin/actform.cpp ../modules/admin/models/actmodel.cpp ../modules/admin/actsearch.cpp ../modules/admin/coupon.cpp ../modules/admin/couponform.cpp ../modules/admin/models/couponmodel.cpp ../modules/admin/couponsearch.cpp ../modules/admin/models/actcouponmodel.cpp main.cpp .obj/release-shared/c-project1.0.0/ && $(COPY_FILE) --parents ../core/widgets/changepassword.ui ../core/widgets/contenttypes.ui ../core/widgets/contenttypesform.ui ../core/widgets/contenttypessearch.ui ../core/widgets/group.ui ../core/widgets/groupform.ui ../core/widgets/groupsearch.ui ../core/widgets/login.ui ../core/widgets/mainwindow.ui ../core/widgets/permission.ui ../core/widgets/permissionform.ui ../core/widgets/permissionsearch.ui ../core/widgets/user.ui ../core/widgets/userform.ui ../core/widgets/usersearch.ui ../modules/admin/widgets/register.ui ../modules/admin/widgets/registerform.ui ../modules/admin/widgets/registersearch.ui ../modules/admin/widgets/act.ui ../modules/admin/widgets/actform.ui ../modules/admin/widgets/actsearch.ui ../modules/admin/widgets/coupon.ui ../modules/admin/widgets/couponform.ui ../modules/admin/widgets/couponsearch.ui .obj/release-shared/c-project1.0.0/ && (cd `dirname .obj/release-shared/c-project1.0.0` && $(TAR) c-project1.0.0.tar c-project1.0.0 && $(COMPRESS) c-project1.0.0.tar) && $(MOVE) `dirname .obj/release-shared/c-project1.0.0`/c-project1.0.0.tar.gz . && $(DEL_FILE) -r .obj/release-shared/c-project1.0.0
clean:compiler_clean
@@ -305,9 +309,9 @@ 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/release-shared/moc_changepassword.cpp .moc/release-shared/moc_contenttypes.cpp .moc/release-shared/moc_contenttypesform.cpp .moc/release-shared/moc_contenttypesmodel.cpp .moc/release-shared/moc_contenttypessearch.cpp .moc/release-shared/moc_group.cpp .moc/release-shared/moc_groupform.cpp .moc/release-shared/moc_groupmodel.cpp .moc/release-shared/moc_groupsearch.cpp .moc/release-shared/moc_login.cpp .moc/release-shared/moc_mainwindow.cpp .moc/release-shared/moc_permission.cpp .moc/release-shared/moc_permissionform.cpp .moc/release-shared/moc_permissionmodel.cpp .moc/release-shared/moc_permissionsearch.cpp .moc/release-shared/moc_user.cpp .moc/release-shared/moc_userform.cpp .moc/release-shared/moc_usermodel.cpp .moc/release-shared/moc_usersearch.cpp .moc/release-shared/moc_register.cpp .moc/release-shared/moc_registerform.cpp .moc/release-shared/moc_registermodel.cpp .moc/release-shared/moc_registersearch.cpp .moc/release-shared/moc_act.cpp .moc/release-shared/moc_actform.cpp .moc/release-shared/moc_actmodel.cpp .moc/release-shared/moc_actsearch.cpp .moc/release-shared/moc_coupon.cpp .moc/release-shared/moc_couponform.cpp .moc/release-shared/moc_couponmodel.cpp .moc/release-shared/moc_couponsearch.cpp
+compiler_moc_header_make_all: .moc/release-shared/moc_changepassword.cpp .moc/release-shared/moc_contenttypes.cpp .moc/release-shared/moc_contenttypesform.cpp .moc/release-shared/moc_contenttypesmodel.cpp .moc/release-shared/moc_contenttypessearch.cpp .moc/release-shared/moc_group.cpp .moc/release-shared/moc_groupform.cpp .moc/release-shared/moc_groupmodel.cpp .moc/release-shared/moc_groupsearch.cpp .moc/release-shared/moc_login.cpp .moc/release-shared/moc_mainwindow.cpp .moc/release-shared/moc_permission.cpp .moc/release-shared/moc_permissionform.cpp .moc/release-shared/moc_permissionmodel.cpp .moc/release-shared/moc_permissionsearch.cpp .moc/release-shared/moc_user.cpp .moc/release-shared/moc_userform.cpp .moc/release-shared/moc_usermodel.cpp .moc/release-shared/moc_usersearch.cpp .moc/release-shared/moc_register.cpp .moc/release-shared/moc_registerform.cpp .moc/release-shared/moc_registermodel.cpp .moc/release-shared/moc_registersearch.cpp .moc/release-shared/moc_act.cpp .moc/release-shared/moc_actform.cpp .moc/release-shared/moc_actmodel.cpp .moc/release-shared/moc_actsearch.cpp .moc/release-shared/moc_coupon.cpp .moc/release-shared/moc_couponform.cpp .moc/release-shared/moc_couponmodel.cpp .moc/release-shared/moc_couponsearch.cpp .moc/release-shared/moc_actcouponmodel.cpp
compiler_moc_header_clean:
- -$(DEL_FILE) .moc/release-shared/moc_changepassword.cpp .moc/release-shared/moc_contenttypes.cpp .moc/release-shared/moc_contenttypesform.cpp .moc/release-shared/moc_contenttypesmodel.cpp .moc/release-shared/moc_contenttypessearch.cpp .moc/release-shared/moc_group.cpp .moc/release-shared/moc_groupform.cpp .moc/release-shared/moc_groupmodel.cpp .moc/release-shared/moc_groupsearch.cpp .moc/release-shared/moc_login.cpp .moc/release-shared/moc_mainwindow.cpp .moc/release-shared/moc_permission.cpp .moc/release-shared/moc_permissionform.cpp .moc/release-shared/moc_permissionmodel.cpp .moc/release-shared/moc_permissionsearch.cpp .moc/release-shared/moc_user.cpp .moc/release-shared/moc_userform.cpp .moc/release-shared/moc_usermodel.cpp .moc/release-shared/moc_usersearch.cpp .moc/release-shared/moc_register.cpp .moc/release-shared/moc_registerform.cpp .moc/release-shared/moc_registermodel.cpp .moc/release-shared/moc_registersearch.cpp .moc/release-shared/moc_act.cpp .moc/release-shared/moc_actform.cpp .moc/release-shared/moc_actmodel.cpp .moc/release-shared/moc_actsearch.cpp .moc/release-shared/moc_coupon.cpp .moc/release-shared/moc_couponform.cpp .moc/release-shared/moc_couponmodel.cpp .moc/release-shared/moc_couponsearch.cpp
+ -$(DEL_FILE) .moc/release-shared/moc_changepassword.cpp .moc/release-shared/moc_contenttypes.cpp .moc/release-shared/moc_contenttypesform.cpp .moc/release-shared/moc_contenttypesmodel.cpp .moc/release-shared/moc_contenttypessearch.cpp .moc/release-shared/moc_group.cpp .moc/release-shared/moc_groupform.cpp .moc/release-shared/moc_groupmodel.cpp .moc/release-shared/moc_groupsearch.cpp .moc/release-shared/moc_login.cpp .moc/release-shared/moc_mainwindow.cpp .moc/release-shared/moc_permission.cpp .moc/release-shared/moc_permissionform.cpp .moc/release-shared/moc_permissionmodel.cpp .moc/release-shared/moc_permissionsearch.cpp .moc/release-shared/moc_user.cpp .moc/release-shared/moc_userform.cpp .moc/release-shared/moc_usermodel.cpp .moc/release-shared/moc_usersearch.cpp .moc/release-shared/moc_register.cpp .moc/release-shared/moc_registerform.cpp .moc/release-shared/moc_registermodel.cpp .moc/release-shared/moc_registersearch.cpp .moc/release-shared/moc_act.cpp .moc/release-shared/moc_actform.cpp .moc/release-shared/moc_actmodel.cpp .moc/release-shared/moc_actsearch.cpp .moc/release-shared/moc_coupon.cpp .moc/release-shared/moc_couponform.cpp .moc/release-shared/moc_couponmodel.cpp .moc/release-shared/moc_couponsearch.cpp .moc/release-shared/moc_actcouponmodel.cpp
.moc/release-shared/moc_changepassword.cpp: .uic/ui_changepassword.h \
../core/changepassword.h
/usr/bin/moc $(DEFINES) $(INCPATH) ../core/changepassword.h -o .moc/release-shared/moc_changepassword.cpp
@@ -357,12 +361,14 @@ compiler_moc_header_clean:
/usr/bin/moc $(DEFINES) $(INCPATH) ../core/groupsearch.h -o .moc/release-shared/moc_groupsearch.cpp
.moc/release-shared/moc_login.cpp: .uic/ui_login.h \
+ ../core/models/usermodel.h \
../core/login.h
/usr/bin/moc $(DEFINES) $(INCPATH) ../core/login.h -o .moc/release-shared/moc_login.cpp
.moc/release-shared/moc_mainwindow.cpp: .uic/ui_mainwindow.h \
../core/login.h \
.uic/ui_login.h \
+ ../core/models/usermodel.h \
../core/changepassword.h \
.uic/ui_changepassword.h \
../core/contenttypes.h \
@@ -388,7 +394,6 @@ compiler_moc_header_clean:
.uic/ui_groupsearch.h \
../core/user.h \
.uic/ui_user.h \
- ../core/models/usermodel.h \
../core/userform.h \
.uic/ui_userform.h \
../core/usersearch.h \
@@ -412,6 +417,7 @@ compiler_moc_header_clean:
../modules/admin/models/couponmodel.h \
../modules/admin/couponform.h \
.uic/ui_couponform.h \
+ ../modules/admin/models/actcouponmodel.h \
../modules/admin/couponsearch.h \
.uic/ui_couponsearch.h \
../core/mainwindow.h
@@ -513,13 +519,25 @@ compiler_moc_header_clean:
../modules/admin/models/couponmodel.h \
../modules/admin/couponform.h \
.uic/ui_couponform.h \
+ ../modules/admin/models/actmodel.h \
+ ../modules/admin/models/actcouponmodel.h \
+ ../modules/admin/actform.h \
+ .uic/ui_actform.h \
+ ../modules/admin/actsearch.h \
+ .uic/ui_actsearch.h \
../modules/admin/couponsearch.h \
.uic/ui_couponsearch.h \
../modules/admin/coupon.h
/usr/bin/moc $(DEFINES) $(INCPATH) ../modules/admin/coupon.h -o .moc/release-shared/moc_coupon.cpp
.moc/release-shared/moc_couponform.cpp: .uic/ui_couponform.h \
../modules/admin/models/couponmodel.h \
+ ../modules/admin/models/actmodel.h \
+ ../modules/admin/models/actcouponmodel.h \
+ ../modules/admin/actform.h \
+ .uic/ui_actform.h \
+ ../modules/admin/actsearch.h \
+ .uic/ui_actsearch.h \
../modules/admin/couponform.h
/usr/bin/moc $(DEFINES) $(INCPATH) ../modules/admin/couponform.h -o .moc/release-shared/moc_couponform.cpp
@@ -531,6 +549,9 @@ compiler_moc_header_clean:
../modules/admin/couponsearch.h
/usr/bin/moc $(DEFINES) $(INCPATH) ../modules/admin/couponsearch.h -o .moc/release-shared/moc_couponsearch.cpp
+.moc/release-shared/moc_actcouponmodel.cpp: ../modules/admin/models/actcouponmodel.h
+ /usr/bin/moc $(DEFINES) $(INCPATH) ../modules/admin/models/actcouponmodel.h -o .moc/release-shared/moc_actcouponmodel.cpp
+
compiler_rcc_make_all: .rcc/qrc_resources.cpp .rcc/qrc_resources.cpp
compiler_rcc_clean:
-$(DEL_FILE) .rcc/qrc_resources.cpp .rcc/qrc_resources.cpp
@@ -592,6 +613,7 @@ compiler_rcc_clean:
../modules/admin/widgets/static/default/icons/22x22/page-zoom.png \
../modules/admin/widgets/static/default/icons/22x22/edit-delete.png \
../modules/admin/widgets/static/default/icons/22x22/dialog-ok-apply.png \
+ ../modules/admin/widgets/static/default/icons/22x22/arrow-left.png \
../modules/admin/widgets/static/default/icons/22x22/edit-redo.png \
../modules/admin/widgets/static/default/icons/22x22/irc-operator.png \
../modules/admin/widgets/static/default/icons/22x22/im-status-message-edit.png \
@@ -601,6 +623,7 @@ compiler_rcc_clean:
../modules/admin/widgets/static/default/icons/22x22/dialog-error.png \
../modules/admin/widgets/static/default/icons/22x22/meeting-organizer.png \
../modules/admin/widgets/static/default/icons/22x22/preferences-desktop.png \
+ ../modules/admin/widgets/static/default/icons/22x22/arrow-right.png \
../modules/admin/widgets/static/default/icons/22x22/resource-group.png \
../modules/admin/widgets/static/default/icons/22x22/help-contents.png \
../modules/admin/widgets/static/default/icons/22x22/go-next.png \
@@ -793,13 +816,15 @@ compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/release-shared/groupsearch.o ../core/groupsearch.cpp
.obj/release-shared/login.o: ../core/login.cpp ../core/login.h \
- .uic/ui_login.h
+ .uic/ui_login.h \
+ ../core/models/usermodel.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/release-shared/login.o ../core/login.cpp
.obj/release-shared/mainwindow.o: ../core/mainwindow.cpp ../core/mainwindow.h \
.uic/ui_mainwindow.h \
../core/login.h \
.uic/ui_login.h \
+ ../core/models/usermodel.h \
../core/changepassword.h \
.uic/ui_changepassword.h \
../core/contenttypes.h \
@@ -825,7 +850,6 @@ compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean
.uic/ui_groupsearch.h \
../core/user.h \
.uic/ui_user.h \
- ../core/models/usermodel.h \
../core/userform.h \
.uic/ui_userform.h \
../core/usersearch.h \
@@ -849,6 +873,7 @@ compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean
../modules/admin/models/couponmodel.h \
../modules/admin/couponform.h \
.uic/ui_couponform.h \
+ ../modules/admin/models/actcouponmodel.h \
../modules/admin/couponsearch.h \
.uic/ui_couponsearch.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/release-shared/mainwindow.o ../core/mainwindow.cpp
@@ -982,6 +1007,12 @@ compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean
../modules/admin/models/couponmodel.h \
../modules/admin/couponform.h \
.uic/ui_couponform.h \
+ ../modules/admin/models/actmodel.h \
+ ../modules/admin/models/actcouponmodel.h \
+ ../modules/admin/actform.h \
+ .uic/ui_actform.h \
+ ../modules/admin/actsearch.h \
+ .uic/ui_actsearch.h \
../modules/admin/couponsearch.h \
.uic/ui_couponsearch.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/release-shared/coupon.o ../modules/admin/coupon.cpp
@@ -991,6 +1022,12 @@ compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean
../modules/admin/models/couponmodel.h \
../modules/admin/couponform.h \
.uic/ui_couponform.h \
+ ../modules/admin/models/actmodel.h \
+ ../modules/admin/models/actcouponmodel.h \
+ ../modules/admin/actform.h \
+ .uic/ui_actform.h \
+ ../modules/admin/actsearch.h \
+ .uic/ui_actsearch.h \
../modules/admin/couponsearch.h \
.uic/ui_couponsearch.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/release-shared/couponform.o ../modules/admin/couponform.cpp
@@ -1003,15 +1040,25 @@ compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean
../modules/admin/models/couponmodel.h \
../modules/admin/couponform.h \
.uic/ui_couponform.h \
+ ../modules/admin/models/actmodel.h \
+ ../modules/admin/models/actcouponmodel.h \
+ ../modules/admin/actform.h \
+ .uic/ui_actform.h \
+ ../modules/admin/actsearch.h \
+ .uic/ui_actsearch.h \
../modules/admin/couponsearch.h \
.uic/ui_couponsearch.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/release-shared/couponsearch.o ../modules/admin/couponsearch.cpp
+.obj/release-shared/actcouponmodel.o: ../modules/admin/models/actcouponmodel.cpp ../modules/admin/models/actcouponmodel.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/release-shared/actcouponmodel.o ../modules/admin/models/actcouponmodel.cpp
+
.obj/release-shared/main.o: main.cpp ../shared/database/connection.h \
../core/mainwindow.h \
.uic/ui_mainwindow.h \
../core/login.h \
.uic/ui_login.h \
+ ../core/models/usermodel.h \
../core/changepassword.h \
.uic/ui_changepassword.h \
../core/contenttypes.h \
@@ -1037,7 +1084,6 @@ compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean
.uic/ui_groupsearch.h \
../core/user.h \
.uic/ui_user.h \
- ../core/models/usermodel.h \
../core/userform.h \
.uic/ui_userform.h \
../core/usersearch.h \
@@ -1061,6 +1107,7 @@ compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean
../modules/admin/models/couponmodel.h \
../modules/admin/couponform.h \
.uic/ui_couponform.h \
+ ../modules/admin/models/actcouponmodel.h \
../modules/admin/couponsearch.h \
.uic/ui_couponsearch.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/release-shared/main.o main.cpp
@@ -1158,6 +1205,9 @@ compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean
.obj/release-shared/moc_couponsearch.o: .moc/release-shared/moc_couponsearch.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/release-shared/moc_couponsearch.o .moc/release-shared/moc_couponsearch.cpp
+.obj/release-shared/moc_actcouponmodel.o: .moc/release-shared/moc_actcouponmodel.cpp
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/release-shared/moc_actcouponmodel.o .moc/release-shared/moc_actcouponmodel.cpp
+
.obj/release-shared/qrc_resources.o: .rcc/qrc_resources.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/release-shared/qrc_resources.o .rcc/qrc_resources.cpp
View
2 src/core/Makefile
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: core
-# Generated by qmake (2.01a) (Qt 4.6.3) on: Thu Aug 5 16:45:47 2010
+# Generated by qmake (2.01a) (Qt 4.6.3) on: Fri Aug 6 18:00:56 2010
# Project: core.pro
# Template: subdirs
# Command: /usr/bin/qmake -unix -o Makefile core.pro
View
2 src/modules/Makefile
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: modules
-# Generated by qmake (2.01a) (Qt 4.6.3) on: Thu Aug 5 16:45:47 2010
+# Generated by qmake (2.01a) (Qt 4.6.3) on: Fri Aug 6 18:00:56 2010
# Project: modules.pro
# Template: subdirs
# Command: /usr/bin/qmake -unix -o Makefile modules.pro
View
2 src/modules/admin/Makefile
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: admin
-# Generated by qmake (2.01a) (Qt 4.6.3) on: Thu Aug 5 16:45:47 2010
+# Generated by qmake (2.01a) (Qt 4.6.3) on: Fri Aug 6 18:00:56 2010
# Project: admin.pro
# Template: subdirs
# Command: /usr/bin/qmake -unix -o Makefile admin.pro
View
2 src/modules/admin/admin.pri
@@ -23,6 +23,7 @@ HEADERS += \
$$PWD/couponform.h \
$$PWD/models/couponmodel.h \
$$PWD/couponsearch.h \
+ $$PWD/models/actcouponmodel.h \
SOURCES += \
$$PWD/register.cpp \
@@ -37,6 +38,7 @@ SOURCES += \
$$PWD/couponform.cpp \
$$PWD/models/couponmodel.cpp \
$$PWD/couponsearch.cpp \
+ $$PWD/models/actcouponmodel.cpp \
FORMS += \
$$PWD/widgets/register.ui \
View
17 src/modules/admin/coupon.cpp
@@ -218,17 +218,16 @@ void Coupon::createModels(void) {
couponModel = new CouponModel(0, this);
couponModel->setTable("admin_register_coupon");
couponModel->setHeaderData(coupon_id, Qt::Horizontal, qApp->tr("Id"));
- couponModel->setHeaderData(coupon_name, Qt::Horizontal,
- qApp->tr("Name"));
- couponModel->setHeaderData(coupon_description, Qt::Horizontal,
- qApp->tr("Description"));
+ couponModel->setHeaderData(coupon_name, Qt::Horizontal, qApp->tr("Name"));
+ couponModel->setHeaderData(coupon_description, Qt::Horizontal, qApp->tr(
+ "Description"));
couponModel->setSort(coupon_id, Qt::DescendingOrder);
}
void Coupon::createViews(void) {
couponTableView->setModel(couponModel);
- couponTableView->setItemDelegate(new QSqlRelationalDelegate(
- couponTableView));
+ couponTableView->setItemDelegate(
+ new QSqlRelationalDelegate(couponTableView));
couponTableView->setSelectionMode(QAbstractItemView::SingleSelection);
couponTableView->setSelectionBehavior(QAbstractItemView::SelectRows);
couponTableView->setColumnHidden(coupon_dateJoined, true);
@@ -240,7 +239,7 @@ void Coupon::createViews(void) {
QHeaderView *header = couponTableView->horizontalHeader();
header->setStretchLastSection(true);
connect(header, SIGNAL(sortIndicatorChanged(int, Qt::SortOrder)), this,
- SLOT(updateModels()));
+ SLOT(updateModels()));
}
void Coupon::createActions(void) {
@@ -292,8 +291,8 @@ void Coupon::updateModels(void) {
int size = couponModel->query().size();
statusCouponTableViewLabel->setText(sizeAll > 1 ? QString(qApp->tr(
- "%1 coupons")).arg(sizeAll)
- : QString(qApp->tr("%1 coupon")).arg(sizeAll));
+ "%1 coupons")).arg(sizeAll) : QString(qApp->tr("%1 coupon")).arg(
+ sizeAll));
statusPaginationLabel->setText(QString(qApp->tr(
"<b>%1</b> - <b>%2</b> de <b>%3</b>")).arg(begin).arg(limit).arg(
sizeAll));
View
478 src/modules/admin/couponform.cpp
@@ -34,16 +34,28 @@ CouponForm::CouponForm(CouponModel *model, QDialog *parent) :
setupUi(this);
couponModel = model;
statusTimer = new QTimer(this);
+ actStatusTimer = new QTimer(this);
+ actCreateModels();
+ actCreateViews();
+ actCouponCreateModels();
+ actCouponCreateViews();
+ actCreateActions();
createActions();
+ actUpdateModels();
+ actCouponCreateActions();
+ actCreateSearchAdvanceWidget();
+ actCouponUpdateModels();
+ actCouponUpdateWidgets();
+ actUpdateWidgets();
updateWidgets();
}
CouponForm::~CouponForm(void) {
}
void CouponForm::timerStatusAction(void) {
- statusLabel->hide();
- statusLabel->setText("");
+ actStatusLabel->hide();
+ actStatusLabel->setText("");
}
void CouponForm::nextAction(void) {
@@ -154,9 +166,9 @@ void CouponForm::removeAction(void) {
emit
formDeleted();
emit
- sendStatus(
- QString(qApp->tr("Successfully deleted %1 coupon.")).arg(
- "1"), 0);
+ sendStatus(
+ QString(qApp->tr("Successfully deleted %1 coupon.")).arg("1"),
+ 0);
updateModels();
updateForms();
@@ -184,7 +196,7 @@ void CouponForm::createActions(void) {
void CouponForm::updateWidgets(void) {
updateForms();
- statusLabel->hide();
+ actStatusLabel->hide();
}
void CouponForm::updateModels(void) {
@@ -256,34 +268,464 @@ void CouponForm::timerStatus(void) {
}
void CouponForm::okStatus(const QString &msg) {
- statusLabel->setText(msg);
- statusLabel->setStyleSheet("color: green; background-color: white;"
+ actStatusLabel->setText(msg);
+ actStatusLabel->setStyleSheet("color: green; background-color: white;"
"margin: 2px; padding: 3px; border: 1px solid green;");
- statusLabel->show();
+ actStatusLabel->show();
timerStatus();
}
void CouponForm::infoStatus(const QString &msg) {
- statusLabel->setText(msg);
- statusLabel->setStyleSheet("color: blue; background-color: white;"
+ actStatusLabel->setText(msg);
+ actStatusLabel->setStyleSheet("color: blue; background-color: white;"
"margin: 2px; padding: 3px; border: 1px solid blue;");
- statusLabel->show();
+ actStatusLabel->show();
timerStatus();
}
void CouponForm::alertStatus(const QString &msg) {
- statusLabel->setText(msg);
- statusLabel->setStyleSheet("color: yellow; background-color: white;"
+ actStatusLabel->setText(msg);
+ actStatusLabel->setStyleSheet("color: yellow; background-color: white;"
"margin: 2px; padding: 3px; border: 1px solid yellow;");
- statusLabel->show();
+ actStatusLabel->show();
timerStatus();
}
void CouponForm::errorStatus(const QString &msg) {
- statusLabel->setText(msg);
- statusLabel->setStyleSheet("color: red; background-color: white;"
+ actStatusLabel->setText(msg);
+ actStatusLabel->setStyleSheet("color: red; background-color: white;"
"margin: 2px; padding: 3px; border: 1px solid red;");
- statusLabel->show();
+ actStatusLabel->show();
timerStatus();
}
+/**
+ * act
+ */
+
+void CouponForm::actTimerStatusAction(void) {
+ actStatusLabel->hide();
+ actStatusLabel->setText("");
+}
+
+void CouponForm::actNewAction(void) {
+ actModel->setId(0);
+ ActForm *form = new ActForm(actModel);
+ connect(form, SIGNAL(formAdded()), this, SLOT(actUpdateModels()));
+ connect(form, SIGNAL(formChanged()), this, SLOT(actUpdateModels()));
+ connect(form, SIGNAL(formDeleted()), this, SLOT(actUpdateModels()));
+ connect(form, SIGNAL(sendStatus(const QString &, int)), this,
+ SLOT(actUpdateStatus(const QString &, int)));
+ form->show();
+}
+
+void CouponForm::actActivateAction(void) {
+ QModelIndex index = actTableView->currentIndex();
+ if (!index.isValid()) {
+ actInfoStatus(qApp->tr("Please select an item to edit."));
+ return;
+ }
+
+ QSqlRecord record = actModel->record(index.row());
+ int id = record.value(act_id).toInt();
+
+ ActModel *m = new ActModel(0, this);
+ ActModel::selectById(id, m);
+ m->setDateChanged(QDateTime::currentDateTime());
+ m->setIsActive(1);
+ if (!m->status()) {
+ actErrorStatus(qApp->tr("Failure trying to register the record."));
+ return;
+ }
+ actOkStatus(qApp->tr("Successfully changed act."));
+ actUpdateModels();
+}
+
+void CouponForm::actDesactivateAction(void) {
+ QModelIndex index = actTableView->currentIndex();
+ if (!index.isValid()) {
+ actInfoStatus(qApp->tr("Please select an item to edit."));
+ return;
+ }
+
+ QSqlRecord record = actModel->record(index.row());
+ int id = record.value(act_id).toInt();
+
+ ActModel *m = new ActModel(0, this);
+ ActModel::selectById(id, m);
+ m->setDateChanged(QDateTime::currentDateTime());
+ m->setIsActive(0);
+ if (!m->status()) {
+ actErrorStatus(qApp->tr("Failure trying to register the record."));
+ return;
+ }
+ actOkStatus(qApp->tr("Successfully changed act."));
+ actUpdateModels();
+}
+
+void CouponForm::actRemoveAction(void) {
+ QModelIndex index = actTableView->currentIndex();
+ if (!index.isValid()) {
+ actInfoStatus(qApp->tr("Please select an item to edit."));
+ return;
+ }
+
+ QSqlRecord record = actModel->record(index.row());
+ int id = record.value(act_id).toInt();
+ QString name = record.value(act_name).toString();
+
+ QMessageBox msgBox;
+ msgBox.setText("Are you sure?");
+ msgBox.setInformativeText(QString(qApp->tr(
+ "Are you sure you want to delete the selected act objects?\n"
+ "All of the following objects and their related items will be "
+ "deleted:\n\nCouponForm: %1\n").arg(name)));
+ msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No
+ | QMessageBox::Cancel);
+ msgBox.setDefaultButton(QMessageBox::Yes);
+ int ret = msgBox.exec();
+ if (ret == QMessageBox::Cancel) {
+ return;
+ } else if (ret == QMessageBox::No)
+ return;
+
+ ActModel *m = new ActModel(0, this);
+ ActModel::selectById(id, m);
+ if (!m->remove()) {
+ actErrorStatus(qApp->tr("Fails to remove the record."));
+ return;
+ }
+ actOkStatus(qApp->tr("Successfully deleted act."));
+ actUpdateModels();
+}
+
+void CouponForm::actCreateSearchAdvanceWidget(void) {
+ actSearch = new ActSearch(actModel);
+ connect(actSearch, SIGNAL(formSearched()), this, SLOT(
+ actUpdateSearchForm()));
+ connect(actSearch, SIGNAL(formSearchClose()), this, SLOT(
+ actUpdateSearchFormClose()));
+}
+
+void CouponForm::actSearchAdvancedAction(void) {
+ if (!actSearch->isVisible()) {
+ actSearch->show();
+ actSearch->raise();
+ actSearch->activateWindow();
+ } else {
+ actSearch->hide();
+ }
+}
+
+void CouponForm::actSearchTextChangedAction() {
+ QString text = searchLineEdit->text();
+ if (text.isEmpty() || text.isNull()) {
+ actModel->setF("");
+ } else {
+ actModel->setF(QString("name LIKE '%1\%'").arg(text));
+ }
+ actModel->setBegin(0);
+ actUpdateModels();
+}
+
+void CouponForm::actCloseAction(void) {
+ close();
+}
+
+void CouponForm::actSelectedItemViewAction(const QModelIndex &index) {
+ if (!index.isValid()) {
+ actInfoStatus(qApp->tr("Please select an item to edit."));
+ return;
+ }
+
+ QSqlRecord record = actModel->record(index.row());
+ int id = record.value(act_id).toInt();
+ actModel->setId(id);
+
+ ActForm *form = new ActForm(actModel);
+ connect(form, SIGNAL(formAdded()), this, SLOT(actUpdateModels()));
+ connect(form, SIGNAL(formChanged()), this, SLOT(actUpdateModels()));
+ connect(form, SIGNAL(formDeleted()), this, SLOT(actUpdateModels()));
+ connect(form, SIGNAL(sendStatus(const QString &, int)), this,
+ SLOT(actUpdateStatus(const QString &, int)));
+ form->show();
+}
+
+void CouponForm::actLastestAction(void) {
+ actModel->setBegin(0);
+ actUpdateModels();
+}
+
+void CouponForm::actNextAction(void) {
+ actModel->setBegin(actModel->begin() - actModel->limit());
+ actUpdateModels();
+}
+
+void CouponForm::actPreviousAction(void) {
+ actModel->setBegin(actModel->begin() + actModel->limit());
+ actUpdateModels();
+}
+
+void CouponForm::actOldestAction(void) {
+ int count = actModel->count();
+ int limit = actModel->limit();
+ actModel->setBegin((limit * count / limit) - limit);
+ actUpdateModels();
+}
+
+void CouponForm::actCreateModels(void) {
+ actModel = new ActModel(0, this);
+ actModel->setTable("admin_register_act");
+ actModel->setHeaderData(act_id, Qt::Horizontal, qApp->tr("Id"));
+ actModel->setHeaderData(act_name, Qt::Horizontal, qApp->tr("Name"));
+ actModel->setHeaderData(act_description, Qt::Horizontal, qApp->tr(
+ "Description"));
+ actModel->setHeaderData(act_value, Qt::Horizontal, qApp->tr("Value"));
+ actModel->setSort(act_id, Qt::DescendingOrder);
+}
+
+void CouponForm::actCreateViews(void) {
+ actTableView->setModel(actModel);
+ actTableView->setItemDelegate(new QSqlRelationalDelegate(actTableView));
+ actTableView->setSelectionMode(QAbstractItemView::SingleSelection);
+ actTableView->setSelectionBehavior(QAbstractItemView::SelectRows);
+ actTableView->setColumnHidden(act_dateJoined, true);
+ actTableView->setColumnHidden(act_dateChanged, true);
+ actTableView->setColumnHidden(act_isActive, true);
+ actTableView->resizeColumnsToContents();
+ actTableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
+
+ QHeaderView *header = actTableView->horizontalHeader();
+ header->setStretchLastSection(true);
+ connect(header, SIGNAL(sortIndicatorChanged(int, Qt::SortOrder)), this,
+ SLOT(actUpdateModels()));
+}
+
+void CouponForm::actCreateActions(void) {
+ connect(statusTimer, SIGNAL(timeout()), this, SLOT(actTimerStatusAction()));
+
+ connect(newPushButton, SIGNAL(released()), this, SLOT(actNewAction()));
+ connect(activatePushButton, SIGNAL(released()), this,
+ SLOT(actActivateAction()));
+ connect(deactivatePushButton, SIGNAL(released()), this, SLOT(
+ actDesactivateAction()));
+ connect(removePushButton, SIGNAL(released()), this, SLOT(actRemoveAction()));
+ connect(searchAdvancedPushButton, SIGNAL(released()), this, SLOT(
+ actSearchAdvancedAction()));
+ connect(searchLineEdit, SIGNAL(returnPressed()), this, SLOT(
+ actSearchTextChangedAction()));
+ //connect(closePushButton, SIGNAL(released()), this, SLOT(actCloseAction()));
+
+ connect(actTableView, SIGNAL(activated(const QModelIndex &)), this,
+ SLOT(actSelectedItemViewAction(const QModelIndex &)));
+
+ connect(latestPushButton, SIGNAL(released()), this,
+ SLOT(actLastestAction()));
+ connect(nextPushButton, SIGNAL(released()), this, SLOT(actNextAction()));
+ connect(previousPushButton, SIGNAL(released()), this,
+ SLOT(actPreviousAction()));
+ connect(oldestPushButton, SIGNAL(released()), this, SLOT(actOldestAction()));
+}
+
+void CouponForm::actUpdateWidgets(void) {
+ if (actModel->query().size() > 0) {
+ activatePushButton->hide();
+ deactivatePushButton->hide();
+ removePushButton->show();
+ } else {
+ activatePushButton->hide();
+ deactivatePushButton->hide();
+ removePushButton->hide();
+ }
+ actTableView->setTabKeyNavigation(true);
+ actStatusLabel->hide();
+}
+
+void CouponForm::actUpdateModels(void) {
+ actModel->paginator();
+ qDebug() << "Query:" << actModel->query().lastQuery();
+
+ int begin = actModel->begin();
+ int limit = actModel->limit();
+ int sizeAll = actModel->count();
+ int size = actModel->query().size();
+
+ statusActTableViewLabel->setText(
+ sizeAll > 1 ? QString(qApp->tr("%1 acts")).arg(sizeAll) : QString(
+ qApp->tr("%1 act")).arg(sizeAll));
+ statusPaginationLabel->setText(QString(qApp->tr(
+ "<b>%1</b> - <b>%2</b> de <b>%3</b>")).arg(begin).arg(limit).arg(
+ sizeAll));
+
+ latestPushButton->setEnabled(begin > 0);
+ nextPushButton->setEnabled(begin > 0);
+ previousPushButton->setEnabled(sizeAll > (size + begin));
+ oldestPushButton->setEnabled(sizeAll > (size + begin));
+
+ actUpdateWidgets();
+}
+
+void CouponForm::actTimerStatus(void) {
+ actStatusTimer->start(3000);
+}
+
+void CouponForm::actOkStatus(const QString &msg) {
+ actStatusLabel->setText(msg);
+ actStatusLabel->setStyleSheet("color: green; background-color: white;"
+ "margin: 2px; padding: 3px; border: 1px solid green;");
+ actStatusLabel->show();
+ actTimerStatus();
+}
+
+void CouponForm::actInfoStatus(const QString &msg) {
+ actStatusLabel->setText(msg);
+ actStatusLabel->setStyleSheet("color: blue; background-color: white;"
+ "margin: 2px; padding: 3px; border: 1px solid blue;");
+ actStatusLabel->show();
+ actTimerStatus();
+}
+
+void CouponForm::actAlertStatus(const QString &msg) {
+ actStatusLabel->setText(msg);
+ actStatusLabel->setStyleSheet("color: yellow; background-color: white;"
+ "margin: 2px; padding: 3px; border: 1px solid yellow;");
+ actStatusLabel->show();
+ actTimerStatus();
+}
+
+void CouponForm::actErrorStatus(const QString &msg) {
+ actStatusLabel->setText(msg);
+ actStatusLabel->setStyleSheet("color: red; background-color: white;"
+ "margin: 2px; padding: 3px; border: 1px solid red;");
+ actStatusLabel->show();
+ actTimerStatus();
+}
+
+void CouponForm::actUpdateSearchForm(void) {
+ searchLineEdit->clear();
+ actUpdateModels();
+}
+
+void CouponForm::actUpdateSearchFormClose(void) {
+ searchLineEdit->clear();
+ actUpdateModels();
+}
+
+void CouponForm::actUpdateStatus(const QString &msg, int code) {
+ switch (code) {
+ case 0:
+ actOkStatus(msg);
+ break;
+ case 1:
+ actInfoStatus(msg);
+ break;
+ case 2:
+ actAlertStatus(msg);
+ break;
+ case 3:
+ actErrorStatus(msg);
+ break;
+ default:
+ actOkStatus(msg);
+ break;
+ }
+}
+
+void CouponForm::actCouponChooseAction(void) {
+ if (!save())
+ return;
+
+ QModelIndex index = actTableView->currentIndex();
+ if (!index.isValid()) {
+ actInfoStatus(qApp->tr("Please select an item to edit."));
+ return;
+ }
+
+ QSqlRecord record = actModel->record(index.row());
+ int id = record.value(act_id).toInt();
+
+ actCouponModel->setActId(id);
+ actCouponModel->setCouponId(couponModel->getId());
+ if (!actCouponModel->save()) {
+ actErrorStatus(qApp->tr("Failure trying to register the record."));
+ }
+ actCouponUpdateModels();
+}
+
+void CouponForm::actCouponClearActivateAction(void) {
+ if (!save())
+ return;
+
+ QModelIndex index = actCouponTableView->currentIndex();
+ if (!index.isValid()) {
+ actInfoStatus(qApp->tr("Please select an item to edit."));
+ return;
+ }
+
+ QSqlRecord record = actCouponModel->record(index.row());
+ int id = record.value(actcoupon_id).toInt();
+
+ actCouponModel->setId(id);
+ if (!actCouponModel->remove()) {
+ actErrorStatus(qApp->tr("Fails to remove the record."));
+ }
+ actCouponUpdateModels();
+
+}
+
+void CouponForm::actCouponCreateModels(void) {
+ actCouponModel = new ActCouponModel(0, this);
+ actCouponModel->setTable("admin_register_act_coupon");
+ actCouponModel->setRelation(actcoupon_actId, QSqlRelation(
+ "admin_register_act", "id", "name"));
+ actCouponModel->setHeaderData(actcoupon_id, Qt::Horizontal, qApp->tr("Id"));
+ actCouponModel->setHeaderData(actcoupon_actId, Qt::Horizontal, qApp->tr(
+ "Act"));
+ actCouponModel->setSort(actcoupon_id, Qt::DescendingOrder);
+}
+
+void CouponForm::actCouponCreateViews(void) {
+ actCouponTableView->setModel(actCouponModel);
+ actCouponTableView->setItemDelegate(new QSqlRelationalDelegate(
+ actCouponTableView));
+ actCouponTableView->setSelectionMode(QAbstractItemView::SingleSelection);
+ actCouponTableView->setSelectionBehavior(QAbstractItemView::SelectRows);
+ //actCouponTableView->setColumnHidden(actcoupon_id, true);
+ actCouponTableView->setColumnHidden(actcoupon_couponId, true);
+ actCouponTableView->resizeColumnsToContents();
+ actCouponTableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
+
+ QHeaderView *header = actCouponTableView->horizontalHeader();
+ header->setStretchLastSection(true);
+ connect(header, SIGNAL(sortIndicatorChanged(int, Qt::SortOrder)), this,
+ SLOT(actCouponUpdateModels()));
+}
+
+void CouponForm::actCouponCreateActions(void) {
+ connect(choosePushButton, SIGNAL(released()), this,
+ SLOT(actCouponChooseAction()));
+ connect(clearPushButton, SIGNAL(released()), this,
+ SLOT(actCouponClearActivateAction()));
+}
+
+void CouponForm::actCouponUpdateWidgets(void) {
+ if (actModel->query().size() > 0) {
+ choosePushButton->setEnabled(true);
+ } else {
+ choosePushButton->setEnabled(false);
+ }
+ if (actCouponModel->query().size() > 0) {
+ clearPushButton->setEnabled(true);
+ } else {
+ clearPushButton->setEnabled(false);
+ }
+ actCouponTableView->setTabKeyNavigation(true);
+}
+
+void CouponForm::actCouponUpdateModels(void) {
+ actCouponModel->setFilter(QString("admin_register_coupon_id = %1").arg(
+ couponModel->getId()));
+ actCouponModel->select();
+ qDebug() << "Query:" << actCouponModel->query().lastQuery();
+ actCouponUpdateWidgets();
+}
View
72 src/modules/admin/couponform.h
@@ -43,9 +43,13 @@
#include "ui_couponform.h"
#include "models/couponmodel.h"
+#include "models/actmodel.h"
+#include "models/actcouponmodel.h"
+#include "actform.h"
+#include "actsearch.h"
class CouponForm: public QDialog, private Ui::CouponForm {
- Q_OBJECT
+Q_OBJECT
private slots:
void timerStatusAction(void);
@@ -56,6 +60,23 @@ private slots:
void removeAction(void);
void cancelAction(void);
+ void actTimerStatusAction(void);
+ void actNewAction(void);
+ void actActivateAction(void);
+ void actDesactivateAction(void);
+ void actRemoveAction(void);
+ void actSearchAdvancedAction(void);
+ void actSearchTextChangedAction(void);
+ void actCloseAction(void);
+ void actSelectedItemViewAction(const QModelIndex &index);
+ void actLastestAction(void);
+ void actNextAction(void);
+ void actPreviousAction(void);
+ void actOldestAction(void);
+
+ void actCouponChooseAction(void);
+ void actCouponClearActivateAction(void);
+
private:
void createActions(void);
void updateWidgets(void);
@@ -75,18 +96,65 @@ private slots:
void alertStatus(const QString &msg);
void errorStatus(const QString &msg);
+ void actCreateModels(void);
+ void actCreateViews(void);
+ void actCreateActions(void);
+ void actCreateSearchAdvanceWidget(void);
+ void actUpdateWidgets(void);
+
+ void actTimerStatus(void);
+ void actOkStatus(const QString &msg);
+ void actInfoStatus(const QString &msg);
+ void actAlertStatus(const QString &msg);
+ void actErrorStatus(const QString &msg);
+
+ void actCouponCreateModels(void);
+ void actCouponCreateViews(void);
+ void actCouponCreateActions(void);
+ void actCouponUpdateWidgets(void);
+
QTimer *statusTimer;
CouponModel *couponModel;
- signals:
+ QTimer *actStatusTimer;
+ ActModel *actModel;
+ QSqlRelationalDelegate *actDelegate;
+ ActSearch *actSearch;
+
+ ActCouponModel *actCouponModel;
+ QSqlRelationalDelegate *actCouponDelegate;
+
+signals:
void formAdded(void);
void formChanged(void);
void formDeleted(void);
void sendStatus(const QString &msg, int code);
+public slots:
+ void actUpdateModels(void);
+ void actUpdateSearchForm(void);
+ void actUpdateSearchFormClose(void);
+ void actUpdateStatus(const QString &msg, int code);
+
+ void actCouponUpdateModels(void);
+
public:
CouponForm(CouponModel *model, QDialog *parent = 0);
~CouponForm();
+
+ enum {
+ act_id = 0,
+ act_name = 1,
+ act_description = 2,
+ act_value = 2,
+ act_dateJoined = 3,
+ act_dateChanged = 4,
+ act_isActive = 5
+ };
+
+ enum {
+ actcoupon_id = 0, actcoupon_actId = 1, actcoupon_couponId = 2
+ };
};
#endif /* COUPONFORM_H_ */
View
197 src/modules/admin/models/actcouponmodel.cpp
@@ -0,0 +1,197 @@
+/**
+ * c-project - 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 "actcouponmodel.h"
+
+ActCouponModel::ActCouponModel(int id, QObject *parent, QSqlDatabase db) :
+ QSqlRelationalTableModel(parent, db) {
+ _id = id;
+ _f = "";
+ _begin = 0;
+ _limit = 25;
+}
+
+void ActCouponModel::paginator(void) {
+ QString f = _f.isEmpty() ? "1=1" : _f;
+ setFilter(QString("%1 %2 LIMIT %3, %4 --").arg(f).arg(orderByClause()).arg(
+ _begin).arg(_limit));
+ select();
+}
+
+int ActCouponModel::count(void) {
+ QSqlQuery query;
+ QString f = _f.isEmpty() ? "1=1" : _f;
+ query.prepare(QString(
+ "SELECT count(id) FROM admin_register_act_coupon WHERE %1").arg(f));
+ if (!query.exec())
+ return 0;
+ int count = 0;
+ if (query.next())
+ count = query.value(0).toInt();
+ return count;
+}
+
+QString ActCouponModel::f(void) {
+ return _f;
+}
+
+void ActCouponModel::setF(const QString &f) {
+ _f = f;
+}
+
+int ActCouponModel::begin(void) {
+ return _begin;
+}
+
+void ActCouponModel::setBegin(int begin) {
+ _begin = begin;
+}
+
+int ActCouponModel::limit(void) {
+ return _limit;
+}
+
+void ActCouponModel::setLimit(int limit) {
+ _limit = limit;
+}
+
+/*void ActCouponModel::selectAll(QList<ActCouponModel> *list) {
+ QSqlQuery query;
+ query.prepare("SELECT * FROM admin_register_act_coupon");
+ if (!query.exec())
+ return;
+ int idCol = query.record().indexOf("id");
+ int nameCol = query.record().indexOf("name");
+ int descriptionCol = query.record().indexOf("description");
+ int dateJoinedCol = query.record().indexOf("date_joined");
+ int dateChangedCol = query.record().indexOf("date_changed");
+ int isActiveCol = query.record().indexOf("is_active");
+ while (query.next()) {
+ ActCouponModel m;
+ m.setId(query.value(idCol).toInt());
+ m.setName(query.value(nameCol).toString());
+ m.setDescription(query.value(descriptionCol).toString());
+ m.setDateJoined(QDateTime::fromString(
+ query.value(dateJoinedCol).toString(), "yyyy-MM-dd hh:mm:ss"));
+ m.setDateChanged(QDateTime::fromString(
+ query.value(dateChangedCol).toString(), "yyyy-MM-dd hh:mm:ss"));
+ m.setIsActive((query.value(isActiveCol).toBool() ? true : false));
+ list->append(m);
+ }
+ }*/
+
+void ActCouponModel::selectById(int id, ActCouponModel *n) {
+ QSqlQuery query;
+ query.prepare("SELECT * "
+ "FROM admin_register_act_coupon "
+ "WHERE id=:id");
+ query.bindValue(":id", id);
+ if (!query.exec())
+ return;
+ int idCol = query.record().indexOf("id");
+ int actIdCol = query.record().indexOf("admin_register_act_id");
+ int couponIdCol = query.record().indexOf("admin_register_coupon_id");
+ if (query.next()) {
+ n->setId(query.value(idCol).toInt());
+ n->setActId(query.value(actIdCol).toInt());
+ n->setCouponId(query.value(couponIdCol).toInt());
+ }
+}
+
+bool ActCouponModel::save(void) {
+ if (_id > 0) {
+ return update();
+ }
+ return insert();
+}
+
+bool ActCouponModel::insert(void) {
+ QSqlQuery query;
+ query.prepare("INSERT INTO admin_register_act_coupon "
+ "(admin_register_act_id, admin_register_coupon_id) "
+ "VALUES (:act_id, :coupon_id)");
+ query.bindValue(":act_id", _actId);
+ query.bindValue(":coupon_id", _couponId);
+ int st = query.exec();
+ if (!st) {
+ qDebug() << "insert:" << query.lastError();
+ qDebug() << "insert:" << query.lastQuery() << _actId << _couponId;
+ }
+ return st;
+}
+
+bool ActCouponModel::update(void) {
+ QSqlQuery query;
+ query.prepare("UPDATE admin_register_act_coupon "
+ "SET admin_register_act_id=:act_id, admin_register_coupon_id=:coupon_id, "
+ "WHERE id=:id");
+ query.bindValue(":id", _id);
+ query.bindValue(":act_id", _actId);
+ query.bindValue(":coupon_id", _couponId);
+ int st = query.exec();
+ if (!st)
+ qDebug() << "update:" << query.lastError();
+ return st;
+}
+
+bool ActCouponModel::status(void) {
+ return false;
+}
+
+bool ActCouponModel::remove(void) {
+ QSqlQuery query;
+ query.prepare("DELETE FROM admin_register_act_coupon "
+ "WHERE id=:id");
+ query.bindValue(":id", _id);
+ return query.exec();
+}
+
+int ActCouponModel::getId(void) {
+ return _id;
+}
+
+void ActCouponModel::setId(int id) {
+ _id = id;
+}
+
+int ActCouponModel::getActId(void) {
+ return _actId;
+}
+
+void ActCouponModel::setActId(int actId) {
+ _actId = actId;
+}
+
+int ActCouponModel::getCouponId(void) {
+ return _couponId;
+}
+
+void ActCouponModel::setCouponId(int couponId) {
+ _couponId = couponId;
+}
View
85 src/modules/admin/models/actcouponmodel.h
@@ -0,0 +1,85 @@
+/**
+ * c-project - 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.
+ */
+#ifndef ACTCOUPONMODEL_H
+#define ACTCOUPONMODEL_H
+
+#include <QDebug>
+#include <QSqlRelationalTableModel>
+#include <QSqlQueryModel>
+#include <QSqlDatabase>
+#include <QSqlRecord>
+#include <QSqlQuery>
+#include <QSqlError>
+#include <QDateTime>
+#include <QVariant>
+#include <QColor>
+#include <QList>
+
+class ActCouponModel: public QSqlRelationalTableModel {
+Q_OBJECT
+
+private:
+ int _id;
+ int _actId;
+ int _couponId;
+
+ QString _f;
+ int _begin;
+ int _limit;
+
+public:
+ ActCouponModel(int id = 0, QObject *parent = 0, QSqlDatabase db =
+ QSqlDatabase());
+ void paginator(void);
+ int count(void);
+ QString f(void);
+ void setF(const QString &f = "");
+ int begin(void);
+ void setBegin(int begin);
+ int limit(void);
+ void setLimit(int limit);
+
+ //static void selectAll(QList<ActCouponModel> *list);
+ static void selectById(int id, ActCouponModel *actCouponModel);
+ bool save(void);
+ bool insert(void);
+ bool update(void);
+ bool status(void);
+ bool remove(void);
+
+ int getId(void);
+ void setId(int id);
+ int getActId(void);
+ void setActId(int actId);
+ int getCouponId(void);
+ void setCouponId(int couponId);
+};
+
+#endif /* ACTCOUPONMODEL_H */
View
7 src/modules/admin/models/couponmodel.cpp
@@ -147,7 +147,9 @@ bool CouponModel::insert(void) {
query.bindValue(":description", _description);
query.bindValue(":date_joined", _dateJoined.toString("yyyy-MM-dd hh:mm:ss"));
query.bindValue(":is_active", _isActive);
- return query.exec();
+ int st = query.exec();
+ _id = st;
+ return st;
}
bool CouponModel::update(void) {
@@ -161,7 +163,8 @@ bool CouponModel::update(void) {
query.bindValue(":description", _description);
query.bindValue(":date_changed", _dateChanged);
query.bindValue(":is_active", _isActive);
- return query.exec();
+ int st = query.exec();
+ return st;
}
bool CouponModel::status(void) {
View
367 src/modules/admin/widgets/couponform.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>531</width>
- <height>323</height>
+ <width>689</width>
+ <height>594</height>
</rect>
</property>
<property name="windowTitle">
@@ -17,9 +17,9 @@
<iconset resource="resources.qrc">
<normaloff>:/default/static/default/icons/22x22/face-devilish.png</normaloff>:/default/static/default/icons/22x22/face-devilish.png</iconset>
</property>
- <layout class="QGridLayout" name="gridLayout">
+ <layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
- <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="titleLabel">
<property name="styleSheet">
@@ -38,7 +38,7 @@ font: 75 14pt &quot;DejaVu Sans Mono&quot;;</string>
</property>
<property name="sizeHint" stdset="0">
<size>
- <width>40</width>
+ <width>353</width>
<height>20</height>
</size>
</property>
@@ -75,21 +75,14 @@ font: 75 14pt &quot;DejaVu Sans Mono&quot;;</string>
</layout>
</item>
<item row="1" column="0">
- <widget class="QLabel" name="statusLabel">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
- <layout class="QGridLayout" name="gridLayout_2">
+ <layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QGroupBox" name="couponGroupBox">
<property name="title">
@@ -152,6 +145,354 @@ font: 75 14pt &quot;DejaVu Sans Mono&quot;;</string>
</widget>
</item>
<item row="1" column="0">
+ <widget class="QGroupBox" name="actsGroupBox">
+ <property name="title">
+ <string>&amp;Acts</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QLabel" name="actTitleLabel">
+ <property name="styleSheet">
+ <string notr="true">color: rgb(85, 85, 127);
+font: 75 14pt &quot;DejaVu Sans Mono&quot;;</string>
+ </property>
+ <property name="text">
+ <string>Select act to change</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_5">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="newPushButton">
+ <property name="text">
+ <string>&amp;Add act</string>
+ </property>
+ <property name="icon">
+ <iconset resource="resources.qrc">
+ <normaloff>:/default/static/default/icons/22x22/document-new.png</normaloff>:/default/static/default/icons/22x22/document-new.png</iconset>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+N</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="actStatusLabel">
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QFrame" name="actFrame">
+ <property name="frameShape">
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QPushButton" name="activatePushButton">
+ <property name="text">
+ <string>&amp;Activate</string>
+ </property>
+ <property name="icon">
+ <iconset resource="resources.qrc">
+ <normaloff>:/default/static/default/icons/22x22/dialog-ok-apply.png</normaloff>:/default/static/default/icons/22x22/dialog-ok-apply.png</iconset>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+E</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="deactivatePushButton">
+ <property name="text">
+ <string>&amp;Deactivate</string>
+ </property>
+ <property name="icon">
+ <iconset resource="resources.qrc">
+ <normaloff>:/default/static/default/icons/22x22/dialog-ok.png</normaloff>:/default/static/default/icons/22x22/dialog-ok.png</iconset>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+Shift+E</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="removePushButton_2">
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ <property name="icon">
+ <iconset resource="resources.qrc">
+ <normaloff>:/default/static/default/icons/22x22/edit-delete.png</normaloff>:/default/static/default/icons/22x22/edit-delete.png</iconset>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+Del</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="searchAdvancedPushButton">
+ <property name="text">
+ <string>&amp;Search</string>
+ </property>
+ <property name="icon">
+ <iconset resource="resources.qrc">
+ <normaloff>:/default/static/default/icons/22x22/page-zoom.png</normaloff>:/default/static/default/icons/22x22/page-zoom.png</iconset>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+K</string>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="searchLineEdit">
+ <property name="minimumSize">
+ <size>
+ <width>200</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">color: rgb(170, 170, 255);
+font: oblique 8pt &quot;DejaVu Sans Mono&quot;;</string>
+ </property>
+ <property name="dragEnabled">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0">
+ <widget class="QSplitter" name="splitter">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <widget class="QTableView" name="actTableView">
+ <property name="alternatingRowColors">
+ <bool>true</bool>
+ </property>
+ <property name="sortingEnabled">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QWidget" name="layoutWidget">
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QPushButton" name="choosePushButton">
+ <property name="text">
+ <string>&amp;Choose</string>
+ </property>
+ <property name="icon">
+ <iconset resource="resources.qrc">
+ <normaloff>:/default/static/default/icons/22x22/arrow-right.png</normaloff>:/default/static/default/icons/22x22/arrow-right.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="clearPushButton">
+ <property name="text">
+ <string>&amp;Clear</string>
+ </property>
+ <property name="icon">
+ <iconset resource="resources.qrc">
+ <normaloff>:/default/static/default/icons/22x22/arrow-left.png</normaloff>:/default/static/default/icons/22x22/arrow-left.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QTableView" name="actCouponTableView"/>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <item>
+ <widget class="QLabel" name="statusActTableViewLabel">
+ <property name="styleSheet">
+ <string notr="true">color: rgb(85, 85, 255);</string>
+ </property>
+ <property name="text">
+ <string>0 act</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="latestPushButton">
+ <property name="text">
+ <string>&amp;Latest</string>
+ </property>
+ <property name="icon">
+ <iconset resource="resources.qrc">
+ <normaloff>:/default/static/default/icons/22x22/go-previous-view.png</normaloff>:/default/static/default/icons/22x22/go-previous-view.png</iconset>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+Shift+Left, Ctrl+Shift+PgUp</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="nextPushButton_2">
+ <property name="text">
+ <string>&amp;Next</string>
+ </property>
+ <property name="icon">
+ <iconset resource="resources.qrc">
+ <normaloff>:/default/static/default/icons/22x22/go-previous.png</normaloff>:/default/static/default/icons/22x22/go-previous.png</iconset>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+Left, Ctrl+PgUp</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="statusPaginationLabel">
+ <property name="text">
+ <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'DejaVu Sans Mono'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;1&lt;/span&gt; - &lt;span style=&quot; font-weight:600;&quot;&gt;25&lt;/span&gt; de &lt;span style=&quot; font-weight:600;&quot;&gt;100&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="previousPushButton_2">
+ <property name="text">
+ <string>&amp;Previous</string>
+ </property>
+ <property name="icon">
+ <iconset resource="resources.qrc">
+ <normaloff>:/default/static/default/icons/22x22/go-next.png</normaloff>:/default/static/default/icons/22x22/go-next.png</iconset>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+Right, Ctrl+PgDown</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="oldestPushButton">
+ <property name="text">
+ <string>&amp;Oldest</string>
+ </property>
+ <property name="icon">
+ <iconset resource="resources.qrc">
+ <normaloff>:/default/static/default/icons/22x22/go-next-view.png</normaloff>:/default/static/default/icons/22x22/go-next-view.png</iconset>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+Shift+Right, Ctrl+Shift+PgDown</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_6">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="sumValuesLabel">
+ <property name="styleSheet">
+ <string notr="true">color: rgb(85, 85, 255);</string>
+ </property>
+ <property name="text">
+ <string>Sum values: </string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="sumValuesNumberLabel">
+ <property name="styleSheet">
+ <string notr="true">color: rgb(85, 85, 255);</string>
+ </property>
+ <property name="text">
+ <string>0.0</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="removePushButton">
View
2 src/modules/admin/widgets/resources.qrc
@@ -1,5 +1,7 @@
<RCC>
<qresource prefix="/default">
+ <file>static/default/icons/22x22/arrow-left.png</file>
+ <file>static/default/icons/22x22/arrow-right.png</file>
<file>static/default/icons/22x22/system-log-out.png</file>
<file>static/default/icons/22x22/meeting-organizer.png</file>
<file>static/default/icons/32x32/meeting-organizer.png</file>
View
BIN src/modules/admin/widgets/static/default/icons/22x22/arrow-left.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN src/modules/admin/widgets/static/default/icons/22x22/arrow-right.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e05bfa5

Please sign in to comment.