38525f7700100a9f8b9655e01054fd660bfac5ed
[family-shop-mgr] / code / family-shop-mgr / ListManagerView.cpp
1 /*\r
2  * This file is part of family-shop-mgr.\r
3  *\r
4  * family-shop-mgr is free software: you can redistribute it and/or modify\r
5  * it under the terms of the GNU General Public License as published by\r
6  * the Free Software Foundation, either version 3 of the License, or\r
7  * (at your option) any later version.\r
8  *\r
9  * family-shop-mgr is distributed in the hope that it will be useful,\r
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
12  * GNU General Public License for more details.\r
13  *\r
14  * You should have received a copy of the GNU General Public License\r
15  * along with family-shop-mgr.  If not, see <http://www.gnu.org/licenses/>.\r
16  *\r
17  * Author: Unai IRIGOYEN\r
18  * Date: 12/17/2009\r
19  *\r
20  */\r
21 \r
22 #include "ListManagerView.h"\r
23 #include "ui_ListManager.h"\r
24 \r
25 #include "ShoppingTreeModel.h"\r
26 \r
27 ListManagerView::ListManagerView(QString xmlFileName, QWidget *parent)\r
28     :QDialog(parent), ui(new Ui::ListManagerView)\r
29 {\r
30     ui->setupUi(this);\r
31     ShoppingTreeModel *model = new ShoppingTreeModel(xmlFileName, this);\r
32     ui->treeView->setModel(model);\r
33     for(int column = 0; column < model->columnCount(); column++)\r
34         ui->treeView->resizeColumnToContents(column);\r
35 \r
36     show();\r
37 }\r
38 \r
39 ListManagerView::~ListManagerView()\r
40 {\r
41     delete ui;\r
42 }\r
43 \r
44 void ListManagerView::updateActions()\r
45 {\r
46     bool hasSelection = !ui->treeView->selectionModel()->selection().isEmpty();\r
47 \r
48 }\r