#include "GoShoppingView.h"
FamilyShoppingManagerMainWindow::FamilyShoppingManagerMainWindow(QWidget *parent)
- : QMainWindow(parent), activityView(new ListManagerView(this))
+ : QMainWindow(parent), activityView(new ListManagerView("ShoppingList.xml", this))
{
- ui->setupUi(this);
- connect(ui->manageButton, SIGNAL(clicked()), this, SLOT(openListManager()));
- connect(ui->goShoppingButton, SIGNAL(clicked()), this, SLOT(openGoShopping()));
+
}
-FamilyShoppingManagerStartView::~FamilyShoppingManagerStartView()
+FamilyShoppingManagerMainWindow::~FamilyShoppingManagerMainWindow()
{
- delete ui;
delete activityView;
}
-void FamilyShoppingManagerStartView::openListManager()
+void FamilyShoppingManagerMainWindow::showListManager()
{
- this->hide();
activityView = new ListManagerView("ShoppingList.xml", this);
}
-void FamilyShoppingManagerStartView::openGoShopping()
+void FamilyShoppingManagerMainWindow::showGoShopping()
{
- //this->hide();
activityView = new GoShoppingView("ShoppingList.xml", this);
}
public:
FamilyShoppingManagerMainWindow(QWidget *parent = 0);
- ~FamilyShoppingManagerStartView();
+ ~FamilyShoppingManagerMainWindow();
private slots:
+ void showListManager();
+ void showGoShopping();
private:
QWidget *activityView;
+++ /dev/null
-/*
- * This file is part of family-shop-mgr.
- *
- * family-shop-mgr is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * family-shop-mgr is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with family-shop-mgr. If not, see <http://www.gnu.org/licenses/>.
- *
- * Author: Unai IRIGOYEN
- * Date: 12/07/2009
- *
- */
-
-#include "FamilyShoppingManagerStartView.h"
-#include "ui_FamilyShoppingManagerStartView.h"
-
-#include "ListManagerView.h"
-#include "GoShoppingView.h"
-
-FamilyShoppingManagerStartView::FamilyShoppingManagerStartView(QWidget *parent)
- : QDialog(parent), ui(new Ui::FamilyShoppingManagerStartView), activityView(NULL)
-{
- ui->setupUi(this);
- connect(ui->manageButton, SIGNAL(clicked()), this, SLOT(openListManager()));
- connect(ui->goShoppingButton, SIGNAL(clicked()), this, SLOT(openGoShopping()));
-}
-
-FamilyShoppingManagerStartView::~FamilyShoppingManagerStartView()
-{
- delete ui;
- delete activityView;
-}
-
-void FamilyShoppingManagerStartView::openListManager()
-{
- this->hide();
- activityView = new ListManagerView("ShoppingList.xml", this);
-}
-
-void FamilyShoppingManagerStartView::openGoShopping()
-{
- //this->hide();
- activityView = new GoShoppingView("ShoppingList.xml", this);
-}
+++ /dev/null
-/*
- * This file is part of family-shop-mgr.
- *
- * family-shop-mgr is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * family-shop-mgr is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with family-shop-mgr. If not, see <http://www.gnu.org/licenses/>.
- *
- * Author: Unai IRIGOYEN
- * Date: 12/07/2009
- *
- */
-
-#ifndef FAMILYSHOPPINGMANAGERSTARTVIEW_H
-#define FAMILYSHOPPINGMANAGERSTARTVIEW_H
-
-#include <QDialog>
-
-namespace Ui
-{
- class FamilyShoppingManagerStartView;
-}
-
-class FamilyShoppingManagerStartView : public QDialog
-{
- Q_OBJECT
-
-public:
- FamilyShoppingManagerStartView(QWidget *parent = 0);
- ~FamilyShoppingManagerStartView();
-
-private slots:
- void openListManager();
- void openGoShopping();
-
-private:
- Ui::FamilyShoppingManagerStartView *ui;
- QWidget *activityView;
-};
-
-#endif // FAMILYSHOPPINGMANAGERSTARTVIEW_H
*/\r
\r
#include "GoShoppingView.h"\r
-#include "ui_GoShopping.h"\r
\r
#include "ShoppingTreeModel.h"\r
\r
GoShoppingView::GoShoppingView(QString xmlFileName, QWidget *parent)\r
- :QDialog(parent), ui(new Ui::GoShoppingView)\r
+ :QTreeView(parent)\r
{\r
- ui->setupUi(this);\r
ShoppingTreeModel *model = new ShoppingTreeModel(xmlFileName, this);\r
- ui->treeView->setModel(model);\r
+ this->setModel(model);\r
for(int column = 0; column < model->columnCount(); column++)\r
- ui->treeView->resizeColumnToContents(column);\r
+ this->resizeColumnToContents(column);\r
}\r
\r
GoShoppingView::~GoShoppingView()\r
{\r
- delete ui;\r
}\r
#ifndef GOSHOPPINGVIEW_H\r
#define GOSHOPPINGVIEW_H\r
\r
-#include <QDialog>\r
+#include <QTreeView>\r
\r
-namespace Ui\r
-{\r
- class GoShoppingView;\r
-}\r
-\r
-class GoShoppingView : public QDialog\r
+class GoShoppingView : public QTreeView\r
{\r
Q_OBJECT\r
\r
~GoShoppingView();\r
\r
private:\r
- Ui::GoShoppingView *ui;\r
};\r
\r
#endif // GOSHOPPINGVIEW_H\r
*/\r
\r
#include "ListManagerView.h"\r
-#include "ui_ListManager.h"\r
\r
#include "ShoppingTreeModel.h"\r
\r
ListManagerView::ListManagerView(QString xmlFileName, QWidget *parent)\r
- :QDialog(parent), ui(new Ui::ListManagerView)\r
+ :QTreeView(parent)\r
{\r
- ui->setupUi(this);\r
ShoppingTreeModel *model = new ShoppingTreeModel(xmlFileName, this);\r
- ui->treeView->setModel(model);\r
+ this->setModel(model);\r
for(int column = 0; column < model->columnCount(); column++)\r
- ui->treeView->resizeColumnToContents(column);\r
-\r
- show();\r
+ this->resizeColumnToContents(column);\r
}\r
\r
ListManagerView::~ListManagerView()\r
{\r
- delete ui;\r
}\r
\r
void ListManagerView::updateActions()\r
{\r
- bool hasSelection = !ui->treeView->selectionModel()->selection().isEmpty();\r
+ bool hasSelection = !this->selectionModel()->selection().isEmpty();\r
\r
}\r
#ifndef LISTMANAGERVIEW_H\r
#define LISTMANAGERVIEW_H\r
\r
-#include <QDialog>\r
+#include <QTreeView>\r
\r
-namespace Ui\r
-{\r
- class ListManagerView;\r
-}\r
-\r
-class ListManagerView : public QDialog\r
+class ListManagerView : public QTreeView\r
{\r
Q_OBJECT\r
\r
~ListManagerView();\r
\r
private:\r
- Ui::ListManagerView *ui;\r
\r
void updateActions();\r
};\r
TARGET = build/family-shop-mgr
TEMPLATE = app
SOURCES += main.cpp \
- FamilyShoppingManagerStartView.cpp \
+ FamilyShoppingManagerMainWindow.cpp \
ShoppingTreeModel.cpp \
ShoppingTreeItem.cpp \
GoShoppingView.cpp \
- ListManagerView.cpp \
- FamilyShoppingManagerMainWindow.cpp
-HEADERS += ShoppingTreeModel.h \
+ ListManagerView.cpp
+HEADERS += FamilyShoppingManagerMainWindow.h \
+ ShoppingTreeModel.h \
ShoppingTreeItem.h \
GoShoppingView.h \
ListManagerView.h \
- FamilyShoppingManagerMainWindow.h
-FORMS += FamilyShoppingManagerStartView.ui \
- ListManager.ui \
- GoShopping.ui
+#FORMS += FamilyShoppingManagerStartView.ui \
+# ListManager.ui \
+# GoShopping.ui
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList">
- <value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-21hFrv8OuU,guid=63ff99b453359d96a6bd09924b645f2a</value>
+ <value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-wQ2ScvWU3G,guid=8b21ab67206236c5c7975e424b6d31c6</value>
<value type="QString">DESKTOP_SESSION=default</value>
<value type="QString">DISPLAY=:0.0</value>
<value type="QString">DM_CONTROL=/var/run/xdmctl</value>
- <value type="QString">GPG_AGENT_INFO=/tmp/gpg-pfLcXv/S.gpg-agent:1922:1</value>
+ <value type="QString">GPG_AGENT_INFO=/tmp/gpg-rKitZ6/S.gpg-agent:1958:1</value>
<value type="QString">GS_LIB=/home/onil/.fonts</value>
<value type="QString">GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/onil/.gtkrc-2.0:/home/onil/.gtkrc-2.0-kde4:/home/onil/.kde/share/config/gtkrc-2.0</value>
<value type="QString">GTK_RC_FILES=/etc/gtk/gtkrc:/home/onil/.gtkrc::/home/onil/.kde/share/config/gtkrc</value>
<value type="QString">PWD=/home/onil/Documents</value>
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">QT_PLUGIN_PATH=/home/onil/.kde/lib/kde4/plugins/:/usr/lib/kde4/plugins/</value>
- <value type="QString">SESSION_MANAGER=local/onil-netbook:@/tmp/.ICE-unix/2011,unix/onil-netbook:/tmp/.ICE-unix/2011</value>
+ <value type="QString">SESSION_MANAGER=local/onil-netbook:@/tmp/.ICE-unix/2049,unix/onil-netbook:/tmp/.ICE-unix/2049</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SHLVL=0</value>
- <value type="QString">SSH_AGENT_PID=1921</value>
- <value type="QString">SSH_AUTH_SOCK=/tmp/ssh-xwUQXF1871/agent.1871</value>
+ <value type="QString">SSH_AGENT_PID=1957</value>
+ <value type="QString">SSH_AUTH_SOCK=/tmp/ssh-XVjNkq1907/agent.1907</value>
<value type="QString">USER=onil</value>
<value type="QString">WINDOWPATH=7</value>
<value type="QString">XCURSOR_THEME=oxy-white</value>
<value type="QString">XDG_DATA_DIRS=/usr/share:/usr/share:/usr/local/share</value>
- <value type="QString">XDG_SESSION_COOKIE=67465ad3dd74e5003d0b02474b126985-1264869161.939016-301214867</value>
+ <value type="QString">XDG_SESSION_COOKIE=67465ad3dd74e5003d0b02474b126985-1265447365.410173-1351979716</value>
<value type="QString">XDM_MANAGED=method=classic</value>
</valuelist>
<valuelist key="abstractProcess.arguments" type="QVariantList">
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList">
- <value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-21hFrv8OuU,guid=63ff99b453359d96a6bd09924b645f2a</value>
+ <value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-wQ2ScvWU3G,guid=8b21ab67206236c5c7975e424b6d31c6</value>
<value type="QString">DESKTOP_SESSION=default</value>
<value type="QString">DISPLAY=:0.0</value>
<value type="QString">DM_CONTROL=/var/run/xdmctl</value>
- <value type="QString">GPG_AGENT_INFO=/tmp/gpg-pfLcXv/S.gpg-agent:1922:1</value>
+ <value type="QString">GPG_AGENT_INFO=/tmp/gpg-rKitZ6/S.gpg-agent:1958:1</value>
<value type="QString">GS_LIB=/home/onil/.fonts</value>
<value type="QString">GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/onil/.gtkrc-2.0:/home/onil/.gtkrc-2.0-kde4:/home/onil/.kde/share/config/gtkrc-2.0</value>
<value type="QString">GTK_RC_FILES=/etc/gtk/gtkrc:/home/onil/.gtkrc::/home/onil/.kde/share/config/gtkrc</value>
<value type="QString">PWD=/home/onil/Documents</value>
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">QT_PLUGIN_PATH=/home/onil/.kde/lib/kde4/plugins/:/usr/lib/kde4/plugins/</value>
- <value type="QString">SESSION_MANAGER=local/onil-netbook:@/tmp/.ICE-unix/2011,unix/onil-netbook:/tmp/.ICE-unix/2011</value>
+ <value type="QString">SESSION_MANAGER=local/onil-netbook:@/tmp/.ICE-unix/2049,unix/onil-netbook:/tmp/.ICE-unix/2049</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SHLVL=0</value>
- <value type="QString">SSH_AGENT_PID=1921</value>
- <value type="QString">SSH_AUTH_SOCK=/tmp/ssh-xwUQXF1871/agent.1871</value>
+ <value type="QString">SSH_AGENT_PID=1957</value>
+ <value type="QString">SSH_AUTH_SOCK=/tmp/ssh-XVjNkq1907/agent.1907</value>
<value type="QString">USER=onil</value>
<value type="QString">WINDOWPATH=7</value>
<value type="QString">XCURSOR_THEME=oxy-white</value>
<value type="QString">XDG_DATA_DIRS=/usr/share:/usr/share:/usr/local/share</value>
- <value type="QString">XDG_SESSION_COOKIE=67465ad3dd74e5003d0b02474b126985-1264869161.939016-301214867</value>
+ <value type="QString">XDG_SESSION_COOKIE=67465ad3dd74e5003d0b02474b126985-1265447365.410173-1351979716</value>
<value type="QString">XDM_MANAGED=method=classic</value>
</valuelist>
<value key="abstractProcess.IgnoreReturnValue" type="bool">false</value>
*/
#include <QtGui/QApplication>
-#include "FamilyShoppingManagerStartView.h"
+#include "FamilyShoppingManagerMainWindow.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
- FamilyShoppingManagerStartView w;
+ FamilyShoppingManagerMainWindow w;
w.show();
return a.exec();
}