git-svn-id: file:///svnroot/family-shop-mgr@17 26eb2498-383b-47a6-be48-5d6f36779e85
authoronil <u.irigoyen@gmail.com>
Sat, 6 Feb 2010 09:49:46 +0000 (09:49 +0000)
committeronil <u.irigoyen@gmail.com>
Sat, 6 Feb 2010 09:49:46 +0000 (09:49 +0000)
code/family-shop-mgr/FamilyShoppingManagerMainWindow.cpp
code/family-shop-mgr/FamilyShoppingManagerMainWindow.h
code/family-shop-mgr/FamilyShoppingManagerStartView.cpp [deleted file]
code/family-shop-mgr/FamilyShoppingManagerStartView.h [deleted file]
code/family-shop-mgr/GoShoppingView.cpp
code/family-shop-mgr/GoShoppingView.h
code/family-shop-mgr/ListManagerView.cpp
code/family-shop-mgr/ListManagerView.h
code/family-shop-mgr/family-shop-mgr.pro
code/family-shop-mgr/family-shop-mgr.pro.user
code/family-shop-mgr/main.cpp

index 3d0162a..7f78599 100644 (file)
 #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);
 }
index 3e71196..0ef19a6 100644 (file)
@@ -30,9 +30,11 @@ class FamilyShoppingManagerMainWindow : public QMainWindow
 
 public:
     FamilyShoppingManagerMainWindow(QWidget *parent = 0);
-    ~FamilyShoppingManagerStartView();
+    ~FamilyShoppingManagerMainWindow();
 
 private slots:
+    void showListManager();
+    void showGoShopping();
 
 private:
     QWidget *activityView;
diff --git a/code/family-shop-mgr/FamilyShoppingManagerStartView.cpp b/code/family-shop-mgr/FamilyShoppingManagerStartView.cpp
deleted file mode 100644 (file)
index 4265334..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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);
-}
diff --git a/code/family-shop-mgr/FamilyShoppingManagerStartView.h b/code/family-shop-mgr/FamilyShoppingManagerStartView.h
deleted file mode 100644 (file)
index b8f22b7..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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
index 5304afa..0421948 100644 (file)
  */\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
index fad1591..edbdf1d 100644 (file)
 #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
@@ -38,7 +33,6 @@ public:
     ~GoShoppingView();\r
 \r
 private:\r
-    Ui::GoShoppingView *ui;\r
 };\r
 \r
 #endif // GOSHOPPINGVIEW_H\r
index 38525f7..535444e 100644 (file)
  */\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
index bd32332..595d99d 100644 (file)
 #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
@@ -38,7 +33,6 @@ public:
     ~ListManagerView();\r
 \r
 private:\r
-    Ui::ListManagerView *ui;\r
 \r
     void updateActions();\r
 };\r
index b2bd24d..f3e4c6a 100644 (file)
@@ -5,17 +5,16 @@ QT += xml
 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
index c5de9dc..e7b4303 100644 (file)
   <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>
index 6ff5808..670e43f 100644 (file)
  */
 
 #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();
 }