insilmaril@382
|
1 |
#include "editxlinkdialog.h"
|
insilmaril@382
|
2 |
|
insilmaril@603
|
3 |
#include <typeinfo>
|
insilmaril@382
|
4 |
#include <QColorDialog>
|
insilmaril@382
|
5 |
|
insilmaril@382
|
6 |
EditXLinkDialog::EditXLinkDialog (QWidget *parent):QDialog (parent)
|
insilmaril@382
|
7 |
{
|
insilmaril@382
|
8 |
ui.setupUi (this);
|
insilmaril@382
|
9 |
|
insilmaril@382
|
10 |
delink=false;
|
insilmaril@382
|
11 |
xlo=false;
|
insilmaril@382
|
12 |
selection=NULL;
|
insilmaril@382
|
13 |
|
insilmaril@382
|
14 |
connect ( ui.widthBox, SIGNAL (valueChanged( int)), this, SLOT (widthChanged (int)));
|
insilmaril@382
|
15 |
connect ( ui.colorButton, SIGNAL (clicked( )), this, SLOT (colorButtonPressed()));
|
insilmaril@382
|
16 |
connect ( ui.setColorHeadingButton, SIGNAL (clicked( )), this, SLOT (setColorHeadingButtonPressed()));
|
insilmaril@382
|
17 |
connect ( ui.deleteButton, SIGNAL (clicked( )), this, SLOT (deleteButtonPressed()));
|
insilmaril@382
|
18 |
}
|
insilmaril@382
|
19 |
|
insilmaril@382
|
20 |
void EditXLinkDialog::deleteButtonPressed()
|
insilmaril@382
|
21 |
{
|
insilmaril@382
|
22 |
delink=true;
|
insilmaril@382
|
23 |
accept();
|
insilmaril@382
|
24 |
}
|
insilmaril@382
|
25 |
|
insilmaril@382
|
26 |
bool EditXLinkDialog::deleteXLink()
|
insilmaril@382
|
27 |
{
|
insilmaril@382
|
28 |
return delink;
|
insilmaril@382
|
29 |
}
|
insilmaril@382
|
30 |
|
insilmaril@382
|
31 |
|
insilmaril@382
|
32 |
void EditXLinkDialog::widthChanged( int w)
|
insilmaril@382
|
33 |
{
|
insilmaril@382
|
34 |
xlo->setWidth(w);
|
insilmaril@382
|
35 |
}
|
insilmaril@382
|
36 |
|
insilmaril@382
|
37 |
void EditXLinkDialog::setXLink( XLinkObj * xo)
|
insilmaril@382
|
38 |
{
|
insilmaril@382
|
39 |
xlo=xo;
|
insilmaril@382
|
40 |
ui.colorButton->setPaletteBackgroundColor (xlo->getColor() );
|
insilmaril@382
|
41 |
ui.widthBox->setValue(xlo->getWidth());
|
insilmaril@382
|
42 |
}
|
insilmaril@382
|
43 |
|
insilmaril@382
|
44 |
void EditXLinkDialog::setSelection(LinkableMapObj *s)
|
insilmaril@382
|
45 |
{
|
insilmaril@382
|
46 |
selection=s;
|
insilmaril@382
|
47 |
}
|
insilmaril@382
|
48 |
|
insilmaril@382
|
49 |
void EditXLinkDialog::colorButtonPressed()
|
insilmaril@382
|
50 |
{
|
insilmaril@382
|
51 |
if (xlo)
|
insilmaril@382
|
52 |
{
|
insilmaril@382
|
53 |
QColor col = QColorDialog::getColor(xlo->getColor(), this );
|
insilmaril@382
|
54 |
if ( !col.isValid() ) return;
|
insilmaril@382
|
55 |
xlo->setColor( col );
|
insilmaril@382
|
56 |
ui.colorButton->setPaletteBackgroundColor (col);
|
insilmaril@382
|
57 |
}
|
insilmaril@382
|
58 |
}
|
insilmaril@382
|
59 |
|
insilmaril@773
|
60 |
void EditXLinkDialog::setColorHeadingButtonPressed() //FIXME-2
|
insilmaril@382
|
61 |
{
|
insilmaril@773
|
62 |
/*
|
insilmaril@382
|
63 |
if (xlo)
|
insilmaril@382
|
64 |
{
|
insilmaril@382
|
65 |
if (selection &&
|
insilmaril@773
|
66 |
(typid(*selection) == typid(BranchObj) ||
|
insilmaril@773
|
67 |
typid(*selection) == typid(MapCenterObj)) )
|
insilmaril@382
|
68 |
{
|
insilmaril@382
|
69 |
QColor col=((BranchObj*)(selection))->getColor();
|
insilmaril@382
|
70 |
xlo->setColor(col);
|
insilmaril@382
|
71 |
ui.colorButton->setPaletteBackgroundColor (col);
|
insilmaril@382
|
72 |
}
|
insilmaril@382
|
73 |
}
|
insilmaril@773
|
74 |
*/
|
insilmaril@382
|
75 |
}
|
insilmaril@382
|
76 |
|
insilmaril@382
|
77 |
bool EditXLinkDialog::useSettingsGlobal ()
|
insilmaril@382
|
78 |
{
|
insilmaril@382
|
79 |
return ui.useSettings->isChecked();
|
insilmaril@382
|
80 |
}
|