git-svn-id: file:///svnroot/family-shop-mgr@14 26eb2498-383b-47a6-be48-5d6f36779e85
[family-shop-mgr] / code / family-shop-mgr / FamilyShoppingManagerStartView.cpp
1 /*
2  * This file is part of family-shop-mgr.
3  *
4  * family-shop-mgr is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * family-shop-mgr is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with family-shop-mgr.  If not, see <http://www.gnu.org/licenses/>.
16  *
17  * Author: Unai IRIGOYEN
18  * Date: 12/07/2009
19  *
20  */
21
22 #include "FamilyShoppingManagerStartView.h"
23 #include "ui_FamilyShoppingManagerStartView.h"
24
25 #include "ListManagerView.h"
26 #include "GoShoppingView.h"
27
28 FamilyShoppingManagerStartView::FamilyShoppingManagerStartView(QWidget *parent)
29     : QDialog(parent), ui(new Ui::FamilyShoppingManagerStartView), activityView(NULL)
30 {
31     ui->setupUi(this);
32     connect(ui->manageButton, SIGNAL(clicked()), this, SLOT(openListManager()));
33     connect(ui->goShoppingButton, SIGNAL(clicked()), this, SLOT(openGoShopping()));
34 }
35
36 FamilyShoppingManagerStartView::~FamilyShoppingManagerStartView()
37 {
38     delete ui;
39     delete activityView;
40 }
41
42 void FamilyShoppingManagerStartView::openListManager()
43 {
44     this->hide();
45     activityView = new ListManagerView("ShoppingList.xml", this);
46 }
47
48 void FamilyShoppingManagerStartView::openGoShopping()
49 {
50     //this->hide();
51     activityView = new GoShoppingView("ShoppingList.xml", this);
52 }