editxlinkdialog.ui.h
author insilmaril
Thu Jun 01 11:19:57 2006 +0000 (2006-06-01)
changeset 343 f5c1cdf79e6e
parent 97 0b048b6bb6f4
permissions -rw-r--r--
added warningdialog.ui
insilmaril@95
     1
/****************************************************************************
insilmaril@95
     2
** ui.h extension file, included from the uic-generated form implementation.
insilmaril@95
     3
**
insilmaril@95
     4
** If you wish to add, delete or rename functions or slots use
insilmaril@95
     5
** Qt Designer which will update this file, preserving your code. Create an
insilmaril@95
     6
** init() function in place of a constructor, and a destroy() function in
insilmaril@95
     7
** place of a destructor.
insilmaril@95
     8
*****************************************************************************/
insilmaril@95
     9
void EditXLinkDialog::init()
insilmaril@95
    10
{
insilmaril@95
    11
	delink=false;
insilmaril@97
    12
	xlo=false;
insilmaril@99
    13
	selection=NULL;
insilmaril@95
    14
}
insilmaril@95
    15
insilmaril@95
    16
void EditXLinkDialog::deleteButtonPressed()
insilmaril@95
    17
{
insilmaril@95
    18
	delink=true;
insilmaril@95
    19
	accept();
insilmaril@95
    20
}
insilmaril@95
    21
insilmaril@95
    22
bool EditXLinkDialog::deleteXLink()
insilmaril@95
    23
{
insilmaril@95
    24
	return delink;
insilmaril@95
    25
}	
insilmaril@97
    26
insilmaril@97
    27
insilmaril@97
    28
void EditXLinkDialog::widthChanged( int  w)
insilmaril@97
    29
{
insilmaril@97
    30
	xlo->setWidth(w);
insilmaril@97
    31
}
insilmaril@97
    32
insilmaril@97
    33
void EditXLinkDialog::setXLink( XLinkObj * xo)
insilmaril@97
    34
{
insilmaril@97
    35
	xlo=xo;
insilmaril@97
    36
	colorButton->setPaletteBackgroundColor (xlo->getColor() );
insilmaril@97
    37
	widthBox->setValue(xlo->getWidth());
insilmaril@97
    38
}
insilmaril@97
    39
insilmaril@99
    40
void EditXLinkDialog::setSelection(LinkableMapObj *s)
insilmaril@99
    41
{
insilmaril@99
    42
	selection=s;
insilmaril@99
    43
}
insilmaril@99
    44
insilmaril@97
    45
void EditXLinkDialog::colorButtonPressed()
insilmaril@97
    46
{
insilmaril@97
    47
	if (xlo)
insilmaril@97
    48
	{	
insilmaril@97
    49
		QColor col = QColorDialog::getColor(xlo->getColor(), this );
insilmaril@97
    50
		if ( !col.isValid() ) return;
insilmaril@97
    51
		xlo->setColor( col );
insilmaril@97
    52
		colorButton->setPaletteBackgroundColor (col);
insilmaril@97
    53
	}
insilmaril@97
    54
}
insilmaril@97
    55
insilmaril@99
    56
void EditXLinkDialog::setColorHeadingButtonPressed()
insilmaril@99
    57
{
insilmaril@99
    58
	if (xlo)
insilmaril@99
    59
	{	
insilmaril@99
    60
		if (selection && 
insilmaril@99
    61
			(typeid(*selection) == typeid(BranchObj)) || 
insilmaril@99
    62
			(typeid(*selection) == typeid(MapCenterObj))  )
insilmaril@99
    63
		{
insilmaril@99
    64
			QColor col=((BranchObj*)(selection))->getColor();
insilmaril@99
    65
			xlo->setColor(col);
insilmaril@99
    66
			colorButton->setPaletteBackgroundColor (col);
insilmaril@99
    67
		}
insilmaril@99
    68
	}
insilmaril@99
    69
}
insilmaril@99
    70
insilmaril@97
    71
bool EditXLinkDialog::useSettingsGlobal ()
insilmaril@97
    72
{
insilmaril@97
    73
	return useSettings->isChecked();
insilmaril@97
    74
}