00001 /*************************************************************************** 00002 * Copyright (c) 2009 Werner Mayer <wmayer[at]users.sourceforge.net> * 00003 * * 00004 * This file is part of the FreeCAD CAx development system. * 00005 * * 00006 * This library is free software; you can redistribute it and/or * 00007 * modify it under the terms of the GNU Library General Public * 00008 * License as published by the Free Software Foundation; either * 00009 * version 2 of the License, or (at your option) any later version. * 00010 * * 00011 * This library is distributed in the hope that it will be useful, * 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00014 * GNU Library General Public License for more details. * 00015 * * 00016 * You should have received a copy of the GNU Library General Public * 00017 * License along with this library; see the file COPYING.LIB. If not, * 00018 * write to the Free Software Foundation, Inc., 59 Temple Place, * 00019 * Suite 330, Boston, MA 02111-1307, USA * 00020 * * 00021 ***************************************************************************/ 00022 00023 00024 #include "PreCompiled.h" 00025 00026 #ifndef _PreComp_ 00027 #endif 00028 00029 #include "DlgSettingsViewColor.h" 00030 #include "PrefWidgets.h" 00031 00032 using namespace Gui::Dialog; 00033 00034 /* TRANSLATOR Gui::Dialog::DlgSettingsViewColor */ 00035 00040 DlgSettingsViewColor::DlgSettingsViewColor(QWidget* parent) 00041 : PreferencePage(parent) 00042 { 00043 this->setupUi(this); 00044 this->HighlightColor->setEnabled(this->checkBoxPreselection->isChecked()); 00045 this->SelectionColor->setEnabled(this->checkBoxSelection->isChecked()); 00046 } 00047 00051 DlgSettingsViewColor::~DlgSettingsViewColor() 00052 { 00053 // no need to delete child widgets, Qt does it all for us 00054 } 00055 00056 void DlgSettingsViewColor::saveSettings() 00057 { 00058 SelectionColor_Background->onSave(); 00059 backgroundColorFrom->onSave(); 00060 backgroundColorTo->onSave(); 00061 backgroundColorMid->onSave(); 00062 radioButtonSimple->onSave(); 00063 radioButtonGradient->onSave(); 00064 checkMidColor->onSave(); 00065 checkBoxPreselection->onSave(); 00066 checkBoxSelection->onSave(); 00067 HighlightColor->onSave(); 00068 SelectionColor->onSave(); 00069 EditedEdgeColor->onSave(); 00070 EditedVertexColor->onSave(); 00071 ConstructionColor->onSave(); 00072 FullyConstrainedColor->onSave(); 00073 } 00074 00075 void DlgSettingsViewColor::loadSettings() 00076 { 00077 SelectionColor_Background->onRestore(); 00078 backgroundColorFrom->onRestore(); 00079 backgroundColorTo->onRestore(); 00080 backgroundColorMid->onRestore(); 00081 radioButtonSimple->onRestore(); 00082 radioButtonGradient->onRestore(); 00083 checkMidColor->onRestore(); 00084 checkBoxPreselection->onRestore(); 00085 checkBoxSelection->onRestore(); 00086 HighlightColor->onRestore(); 00087 SelectionColor->onRestore(); 00088 EditedEdgeColor->onRestore(); 00089 EditedVertexColor->onRestore(); 00090 ConstructionColor->onRestore(); 00091 FullyConstrainedColor->onRestore(); 00092 } 00093 00097 void DlgSettingsViewColor::changeEvent(QEvent *e) 00098 { 00099 if (e->type() == QEvent::LanguageChange) { 00100 retranslateUi(this); 00101 } 00102 else { 00103 QWidget::changeEvent(e); 00104 } 00105 } 00106 00107 #include "moc_DlgSettingsViewColor.cpp" 00108