1
/*
2
    <Interfaz Grafica>
3
    Copyright (C) <2011>  <José Antonio Sánchez Reynaga>
4
5
    This library is free software; you can redistribute it and/or
6
    modify it under the terms of the GNU Lesser General Public
7
    License as published by the Free Software Foundation; either
8
    version 2.1 of the License, or (at your option) any later version.
9
10
    This library is distributed in the hope that it will be useful,
11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
    Lesser General Public License for more details.
14
15
    You should have received a copy of the GNU Lesser General Public
16
    License along with this library; if not, write to the Free Software
17
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
18
*/
19
20
#ifndef WINDOW_H
21
#define WINDOW_H
22
23
#include <QtCore>
24
#include <QtGui>
25
#include "devices.h"
26
#include "threadformat.h"
27
#include "usbdevice.h"
28
29
namespace Ui {
30
    class Window;
31
}
32
33
class Window : public QWidget
34
{
35
    Q_OBJECT
36
37
public:
38
    explicit Window(DeviceList& dl, QWidget *parent = 0);
39
    ~Window();
40
    Ui::Window* getUi();
41
42
    
43
public slots:
44
    void refreshDeviceProperties();
45
    void newDeviceProperties(QString);
46
		void refreshListDevices(USBDevice, bool);
47
48
    void preFormatOperations();
49
    void checkFormat();
50
    
51
    void controlLabel(int);
52
    void enableGUI();
53
    void disableGUI();
54
55
private:
56
    Ui::Window *ui;
57
    Device actual;  //Dispositivo que esta seleccionado
58
    DeviceList &devList;
59
    ThreadFormat *threadFormat; //Hilo para la ejecucion de comandos para el formato
60
    
61
    Device getCurrentDevice();
62
    void applyFormat();
63
};
64
65
#endif // WINDOW_H