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