-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.h
More file actions
121 lines (99 loc) · 2.9 KB
/
mainwindow.h
File metadata and controls
121 lines (99 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QDebug>
#include <QFile>
#include <QFileDialog>
#include <QMessageBox>
#include <QList>
#include <QDir>
#include <QSettings>
#include "instancia.h"
#include "Dialogos/dialogodatoscodigoresumen.h"
#include "Dialogos/dialogonuevacertificacion.h"
#include "Dialogos/dialogoajustarprecio.h"
#include "Dialogos/dialogoabout.h"
namespace Ui {
class MainWindow;
}
struct MetaObra;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
QString strippedName(const QString &fullFileName);
private slots:
/*********MENU***************/
void ActionNuevo();
bool ActionAbrir();
bool ActionGuardar();
bool ActionGuardarComo();
void ActionCerrar();
void ActionSalir();
void ActionCopiar();
void ActionPegar();
void ActionCortar();
void ActionUndo();
void ActionRedo();
void ActionAdelante();
void ActionAtras();
void ActionInicio();
void ActionVerArbol();
void ActionSeleccionarTodo();
void ActionDeseleccionarTodo();
void ActionAjustarPresupuesto();
void AcercaDe();
void AcercaDeQt();
/**********OTROS**************/
void CambiarObraActual(int indice);
void CambiarMedCert(int indice);
void NuevaCertificacion();
void CambiarCertificacionActual(int actual);
void AbrirArchivo(const QString& nombrefichero);
bool ActionAbrirDesdeReciente();
void updateArchivosRecientesActions();
void ActivarDesactivarBotonesPila(int indice);
protected:
void closeEvent(QCloseEvent* event);
private:
struct MetaObra
{
Instancia* miobra;
QString nombrefichero;
MetaObra():miobra(nullptr){}
//~MetaObra(){delete miobra;}
};
std::list<MetaObra>ListaObras;
std::list<MetaObra>::iterator obraActual;
QString rutaarchivo;
//menu abrir reciente
QStringList recentFiles;
enum { MaxRecentFiles = 5 };
QAction *recentFileActions[MaxRecentFiles];
QAction *separatorAction;
//fin de menu abrir reciente
Ui::MainWindow *ui;
bool ConfirmarContinuar();
void setupActions();
void AnadirObraAVentanaPrincipal(MetaObra& nuevaobra);
bool GuardarObra(QString nombreFichero);
bool HayObra();
//combo ver medicion/certificacion
//el combo he de annadirlo a mano porque no se puede insertar un widget a una qToolBar desde QtDesigner
QLabel* labelVerMedCert;
QComboBox* comboMedCert;
//boton nueva certificacion
QPushButton* botonNuevaCertificacion;
//combo certificacion actual
QLabel* labelCertificacionActual;
QComboBox* comboCertificacionActual;
QDir ruta;
//listas para copiar y pegar
std::list<std::pair<pArista,pNodo>>ListaNodosCopiarPegar;
Medicion ListaMedicionCopiarPegar;
void writeSettings();
void readSettings();
};
#endif // MAINWINDOW_H