-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclose.cpp
40 lines (33 loc) · 1014 Bytes
/
close.cpp
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
#include <QtGui>
#include <QWidget>
#include <QLabel>
#include <QDialogButtonBox>
#include "plot.h"
#include "curve.h"
#include "cselect.h"
#include "close.h"
CloseDialog::CloseDialog(Plot *plot, QWidget *parent) :
QDialog (parent)
{
p = plot;
QList<Curve*> curves = plot->curveList();
setWindowTitle(tr("Close pattern"));
QVBoxLayout *vlayout = new QVBoxLayout(this);
QLabel *sel = new QLabel(tr("Select patterns to close"),this);
vlayout->addWidget(sel);
list = new CurveSelector(curves,this);
vlayout->addWidget(list);
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok |
QDialogButtonBox::Cancel);
connect(buttons,SIGNAL(accepted()),this,SLOT(closefiles()));
connect(buttons,SIGNAL(rejected()),this,SLOT(close()));
vlayout->addWidget(buttons);
}
void CloseDialog::closefiles()
{
foreach(Curve* m, list->selected())
{
p->removeCurve(m);
}
this->close();
}