From: onil Date: Sat, 6 Feb 2010 09:49:46 +0000 (+0000) Subject: git-svn-id: file:///svnroot/family-shop-mgr@17 26eb2498-383b-47a6-be48-5d6f36779e85 X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;h=6b123284a767b5488c96d3db7690c9e9f7d5d044;hp=3932e368f35b670d8d2b427aa582afe166807d33;p=family-shop-mgr git-svn-id: file:///svnroot/family-shop-mgr@17 26eb2498-383b-47a6-be48-5d6f36779e85 --- diff --git a/code/family-shop-mgr/FamilyShoppingManagerMainWindow.cpp b/code/family-shop-mgr/FamilyShoppingManagerMainWindow.cpp index 3d0162a..7f78599 100644 --- a/code/family-shop-mgr/FamilyShoppingManagerMainWindow.cpp +++ b/code/family-shop-mgr/FamilyShoppingManagerMainWindow.cpp @@ -25,27 +25,22 @@ #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); } diff --git a/code/family-shop-mgr/FamilyShoppingManagerMainWindow.h b/code/family-shop-mgr/FamilyShoppingManagerMainWindow.h index 3e71196..0ef19a6 100644 --- a/code/family-shop-mgr/FamilyShoppingManagerMainWindow.h +++ b/code/family-shop-mgr/FamilyShoppingManagerMainWindow.h @@ -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 index 4265334..0000000 --- a/code/family-shop-mgr/FamilyShoppingManagerStartView.cpp +++ /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 . - * - * 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 index b8f22b7..0000000 --- a/code/family-shop-mgr/FamilyShoppingManagerStartView.h +++ /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 . - * - * Author: Unai IRIGOYEN - * Date: 12/07/2009 - * - */ - -#ifndef FAMILYSHOPPINGMANAGERSTARTVIEW_H -#define FAMILYSHOPPINGMANAGERSTARTVIEW_H - -#include - -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 diff --git a/code/family-shop-mgr/GoShoppingView.cpp b/code/family-shop-mgr/GoShoppingView.cpp index 5304afa..0421948 100644 --- a/code/family-shop-mgr/GoShoppingView.cpp +++ b/code/family-shop-mgr/GoShoppingView.cpp @@ -20,21 +20,18 @@ */ #include "GoShoppingView.h" -#include "ui_GoShopping.h" #include "ShoppingTreeModel.h" GoShoppingView::GoShoppingView(QString xmlFileName, QWidget *parent) - :QDialog(parent), ui(new Ui::GoShoppingView) + :QTreeView(parent) { - ui->setupUi(this); ShoppingTreeModel *model = new ShoppingTreeModel(xmlFileName, this); - ui->treeView->setModel(model); + this->setModel(model); for(int column = 0; column < model->columnCount(); column++) - ui->treeView->resizeColumnToContents(column); + this->resizeColumnToContents(column); } GoShoppingView::~GoShoppingView() { - delete ui; } diff --git a/code/family-shop-mgr/GoShoppingView.h b/code/family-shop-mgr/GoShoppingView.h index fad1591..edbdf1d 100644 --- a/code/family-shop-mgr/GoShoppingView.h +++ b/code/family-shop-mgr/GoShoppingView.h @@ -22,14 +22,9 @@ #ifndef GOSHOPPINGVIEW_H #define GOSHOPPINGVIEW_H -#include +#include -namespace Ui -{ - class GoShoppingView; -} - -class GoShoppingView : public QDialog +class GoShoppingView : public QTreeView { Q_OBJECT @@ -38,7 +33,6 @@ public: ~GoShoppingView(); private: - Ui::GoShoppingView *ui; }; #endif // GOSHOPPINGVIEW_H diff --git a/code/family-shop-mgr/ListManagerView.cpp b/code/family-shop-mgr/ListManagerView.cpp index 38525f7..535444e 100644 --- a/code/family-shop-mgr/ListManagerView.cpp +++ b/code/family-shop-mgr/ListManagerView.cpp @@ -20,29 +20,24 @@ */ #include "ListManagerView.h" -#include "ui_ListManager.h" #include "ShoppingTreeModel.h" ListManagerView::ListManagerView(QString xmlFileName, QWidget *parent) - :QDialog(parent), ui(new Ui::ListManagerView) + :QTreeView(parent) { - ui->setupUi(this); ShoppingTreeModel *model = new ShoppingTreeModel(xmlFileName, this); - ui->treeView->setModel(model); + this->setModel(model); for(int column = 0; column < model->columnCount(); column++) - ui->treeView->resizeColumnToContents(column); - - show(); + this->resizeColumnToContents(column); } ListManagerView::~ListManagerView() { - delete ui; } void ListManagerView::updateActions() { - bool hasSelection = !ui->treeView->selectionModel()->selection().isEmpty(); + bool hasSelection = !this->selectionModel()->selection().isEmpty(); } diff --git a/code/family-shop-mgr/ListManagerView.h b/code/family-shop-mgr/ListManagerView.h index bd32332..595d99d 100644 --- a/code/family-shop-mgr/ListManagerView.h +++ b/code/family-shop-mgr/ListManagerView.h @@ -22,14 +22,9 @@ #ifndef LISTMANAGERVIEW_H #define LISTMANAGERVIEW_H -#include +#include -namespace Ui -{ - class ListManagerView; -} - -class ListManagerView : public QDialog +class ListManagerView : public QTreeView { Q_OBJECT @@ -38,7 +33,6 @@ public: ~ListManagerView(); private: - Ui::ListManagerView *ui; void updateActions(); }; diff --git a/code/family-shop-mgr/family-shop-mgr.pro b/code/family-shop-mgr/family-shop-mgr.pro index b2bd24d..f3e4c6a 100644 --- a/code/family-shop-mgr/family-shop-mgr.pro +++ b/code/family-shop-mgr/family-shop-mgr.pro @@ -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 diff --git a/code/family-shop-mgr/family-shop-mgr.pro.user b/code/family-shop-mgr/family-shop-mgr.pro.user index c5de9dc..e7b4303 100644 --- a/code/family-shop-mgr/family-shop-mgr.pro.user +++ b/code/family-shop-mgr/family-shop-mgr.pro.user @@ -97,11 +97,11 @@ Debug - DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-21hFrv8OuU,guid=63ff99b453359d96a6bd09924b645f2a + DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-wQ2ScvWU3G,guid=8b21ab67206236c5c7975e424b6d31c6 DESKTOP_SESSION=default DISPLAY=:0.0 DM_CONTROL=/var/run/xdmctl - GPG_AGENT_INFO=/tmp/gpg-pfLcXv/S.gpg-agent:1922:1 + GPG_AGENT_INFO=/tmp/gpg-rKitZ6/S.gpg-agent:1958:1 GS_LIB=/home/onil/.fonts 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 GTK_RC_FILES=/etc/gtk/gtkrc:/home/onil/.gtkrc::/home/onil/.kde/share/config/gtkrc @@ -118,16 +118,16 @@ PWD=/home/onil/Documents QTDIR=/usr/share/qt4 QT_PLUGIN_PATH=/home/onil/.kde/lib/kde4/plugins/:/usr/lib/kde4/plugins/ - SESSION_MANAGER=local/onil-netbook:@/tmp/.ICE-unix/2011,unix/onil-netbook:/tmp/.ICE-unix/2011 + SESSION_MANAGER=local/onil-netbook:@/tmp/.ICE-unix/2049,unix/onil-netbook:/tmp/.ICE-unix/2049 SHELL=/bin/bash SHLVL=0 - SSH_AGENT_PID=1921 - SSH_AUTH_SOCK=/tmp/ssh-xwUQXF1871/agent.1871 + SSH_AGENT_PID=1957 + SSH_AUTH_SOCK=/tmp/ssh-XVjNkq1907/agent.1907 USER=onil WINDOWPATH=7 XCURSOR_THEME=oxy-white XDG_DATA_DIRS=/usr/share:/usr/share:/usr/local/share - XDG_SESSION_COOKIE=67465ad3dd74e5003d0b02474b126985-1264869161.939016-301214867 + XDG_SESSION_COOKIE=67465ad3dd74e5003d0b02474b126985-1265447365.410173-1351979716 XDM_MANAGED=method=classic @@ -148,11 +148,11 @@ Debug - DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-21hFrv8OuU,guid=63ff99b453359d96a6bd09924b645f2a + DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-wQ2ScvWU3G,guid=8b21ab67206236c5c7975e424b6d31c6 DESKTOP_SESSION=default DISPLAY=:0.0 DM_CONTROL=/var/run/xdmctl - GPG_AGENT_INFO=/tmp/gpg-pfLcXv/S.gpg-agent:1922:1 + GPG_AGENT_INFO=/tmp/gpg-rKitZ6/S.gpg-agent:1958:1 GS_LIB=/home/onil/.fonts 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 GTK_RC_FILES=/etc/gtk/gtkrc:/home/onil/.gtkrc::/home/onil/.kde/share/config/gtkrc @@ -169,16 +169,16 @@ PWD=/home/onil/Documents QTDIR=/usr/share/qt4 QT_PLUGIN_PATH=/home/onil/.kde/lib/kde4/plugins/:/usr/lib/kde4/plugins/ - SESSION_MANAGER=local/onil-netbook:@/tmp/.ICE-unix/2011,unix/onil-netbook:/tmp/.ICE-unix/2011 + SESSION_MANAGER=local/onil-netbook:@/tmp/.ICE-unix/2049,unix/onil-netbook:/tmp/.ICE-unix/2049 SHELL=/bin/bash SHLVL=0 - SSH_AGENT_PID=1921 - SSH_AUTH_SOCK=/tmp/ssh-xwUQXF1871/agent.1871 + SSH_AGENT_PID=1957 + SSH_AUTH_SOCK=/tmp/ssh-XVjNkq1907/agent.1907 USER=onil WINDOWPATH=7 XCURSOR_THEME=oxy-white XDG_DATA_DIRS=/usr/share:/usr/share:/usr/local/share - XDG_SESSION_COOKIE=67465ad3dd74e5003d0b02474b126985-1264869161.939016-301214867 + XDG_SESSION_COOKIE=67465ad3dd74e5003d0b02474b126985-1265447365.410173-1351979716 XDM_MANAGED=method=classic false diff --git a/code/family-shop-mgr/main.cpp b/code/family-shop-mgr/main.cpp index 6ff5808..670e43f 100644 --- a/code/family-shop-mgr/main.cpp +++ b/code/family-shop-mgr/main.cpp @@ -20,12 +20,12 @@ */ #include -#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(); }