defuze.me  Client
controlswidget.cpp
00001 /**************************************************************************
00002 ** defuze.me Epitech Innovative Project
00003 **
00004 ** Copyright 2010-2011
00005 **   Athena Calmettes - Jocelyn De La Rosa - Francois Gaillard
00006 **   Adrien Jarthon - Alexandre Moore - Luc Peres - Arnaud Sellier
00007 **
00008 ** All rights reserved.
00009 **************************************************************************/
00010 
00011 #include <QDebug>
00012 #include <QTimer>
00013 #include "controlswidget.hpp"
00014 
00015 using namespace Queue;
00016 
00017 ControlsWidget::ControlsWidget(Queueable *parent) : /*QWidget(parent->getWidget()),*/ queueable(parent)
00018 {
00019     setupUi(this);
00020     if (parent)
00021     {/*
00022         setMinimumHeight(parent->getWidget()->height());
00023         move(parent->getWidget()->width() - sizeHint().width(), 0);
00024         connect(deleteButton, SIGNAL(clicked()), parent, SLOT(remove()));
00025         show();
00026 
00027         animation = new QPropertyAnimation(this, "geometry");
00028         animation->setDuration(200);
00029         animation->setStartValue(QRect(parent->getWidget()->width(), 0, sizeHint().width(), minimumHeight()));
00030         animation->setEndValue(QRect(parent->getWidget()->width() - sizeHint().width(), 0, sizeHint().width(), minimumHeight()));
00031         animation->start();*/
00032     }
00033 }
00034 
00035 ControlsWidget::~ControlsWidget()
00036 {
00037     delete animation;
00038 }
00039 
00040 void    ControlsWidget::dissapear()
00041 {
00042 /*  delete animation;
00043     animation = new QPropertyAnimation(this, "geometry");
00044     animation->setDuration(200);
00045     animation->setStartValue(QRect(queueable->getWidget()->width() - sizeHint().width(), 0, sizeHint().width(), minimumHeight()));
00046     animation->setEndValue(QRect(queueable->getWidget()->width(), 0, sizeHint().width(), minimumHeight()));
00047     animation->start();
00048     QTimer::singleShot(200, this, SLOT(deleteLater()));*/
00049 }
00050 
00051 void ControlsWidget::changeEvent(QEvent *e)
00052 {
00053     QWidget::changeEvent(e);
00054     switch (e->type()) {
00055     case QEvent::LanguageChange:
00056         retranslateUi(this);
00057         break;
00058     default:
00059         break;
00060     }
00061 }