Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch add FEM preferrences dialog. There is currently only one option to define if internal or external editor should be used to open CalculiX input .inp files. Disabling internal editor allows to define path to external editor. Signed-off-by: Przemo Firszt <przemo@firszt.eu>
- Loading branch information
Showing
8 changed files
with
2,035 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,200 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>FemGui::DlgSettingsFemImp</class> | ||
<widget class="QWidget" name="FemGui::DlgSettingsFemImp"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>555</width> | ||
<height>429</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>FEM</string> | ||
</property> | ||
<layout class="QGridLayout" name="gridLayout1"> | ||
<property name="margin"> | ||
<number>9</number> | ||
</property> | ||
<property name="spacing"> | ||
<number>6</number> | ||
</property> | ||
<item row="1" column="0"> | ||
<widget class="QGroupBox" name="gb_calculix"> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="layoutDirection"> | ||
<enum>Qt::LeftToRight</enum> | ||
</property> | ||
<property name="title"> | ||
<string>CalculiX</string> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> | ||
</property> | ||
<layout class="QHBoxLayout" name="horizontalLayout"> | ||
<property name="sizeConstraint"> | ||
<enum>QLayout::SetNoConstraint</enum> | ||
</property> | ||
<item> | ||
<layout class="QGridLayout" name="gl_calculix"> | ||
<item row="0" column="0"> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<widget class="Gui::PrefCheckBox" name="cb_int_editor"> | ||
<property name="text"> | ||
<string>Use internal editor for .inp files</string> | ||
</property> | ||
<property name="checked"> | ||
<bool>true</bool> | ||
</property> | ||
<property name="prefEntry" stdset="0"> | ||
<cstring>UseInternalEditor</cstring> | ||
</property> | ||
<property name="prefPath" stdset="0"> | ||
<cstring>Mod/Fem</cstring> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<layout class="QHBoxLayout" name="hl_ext_editor"> | ||
<item> | ||
<widget class="QLabel" name="l_ext_editor"> | ||
<property name="enabled"> | ||
<bool>false</bool> | ||
</property> | ||
<property name="text"> | ||
<string>External editor:</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="Gui::PrefFileChooser" name="fc_ext_editor"> | ||
<property name="enabled"> | ||
<bool>false</bool> | ||
</property> | ||
<property name="prefEntry" stdset="0"> | ||
<cstring>ExternalEditorPath</cstring> | ||
</property> | ||
<property name="prefPath" stdset="0"> | ||
<cstring>Mod/Fem</cstring> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
</layout> | ||
</item> | ||
</layout> | ||
</item> | ||
</layout> | ||
</widget> | ||
</item> | ||
<item row="2" column="0"> | ||
<spacer name="verticalSpacer"> | ||
<property name="orientation"> | ||
<enum>Qt::Vertical</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>20</width> | ||
<height>40</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
</layout> | ||
</widget> | ||
<layoutdefault spacing="6" margin="11"/> | ||
<customwidgets> | ||
<customwidget> | ||
<class>Gui::FileChooser</class> | ||
<extends>QWidget</extends> | ||
<header>Gui/FileDialog.h</header> | ||
</customwidget> | ||
<customwidget> | ||
<class>Gui::PrefFileChooser</class> | ||
<extends>Gui::FileChooser</extends> | ||
<header>Gui/PrefWidgets.h</header> | ||
</customwidget> | ||
<customwidget> | ||
<class>Gui::PrefCheckBox</class> | ||
<extends>QCheckBox</extends> | ||
<header>Gui/PrefWidgets.h</header> | ||
</customwidget> | ||
</customwidgets> | ||
<resources> | ||
<include location="Resources/Fem.qrc"/> | ||
</resources> | ||
<connections> | ||
<connection> | ||
<sender>cb_int_editor</sender> | ||
<signal>toggled(bool)</signal> | ||
<receiver>l_ext_editor</receiver> | ||
<slot>setEnabled(bool)</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>100</x> | ||
<y>47</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>99</x> | ||
<y>76</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
<connection> | ||
<sender>cb_int_editor</sender> | ||
<signal>toggled(bool)</signal> | ||
<receiver>l_ext_editor</receiver> | ||
<slot>setDisabled(bool)</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>125</x> | ||
<y>49</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>120</x> | ||
<y>74</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
<connection> | ||
<sender>cb_int_editor</sender> | ||
<signal>toggled(bool)</signal> | ||
<receiver>fc_ext_editor</receiver> | ||
<slot>setEnabled(bool)</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>327</x> | ||
<y>54</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>323</x> | ||
<y>79</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
<connection> | ||
<sender>cb_int_editor</sender> | ||
<signal>toggled(bool)</signal> | ||
<receiver>fc_ext_editor</receiver> | ||
<slot>setDisabled(bool)</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>409</x> | ||
<y>50</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>406</x> | ||
<y>78</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
</connections> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/*************************************************************************** | ||
* Copyright (c) 2015 FreeCAD Developers * | ||
* Author: Przemo Firszt <przemo@firszt.eu> * | ||
* Based on src/Mod/Raytracing/Gui/DlgSettingsRayImp.cpp * | ||
* * | ||
* This file is part of the FreeCAD CAx development system. * | ||
* * | ||
* This library is free software; you can redistribute it and/or * | ||
* modify it under the terms of the GNU Library General Public * | ||
* License as published by the Free Software Foundation; either * | ||
* version 2 of the License, or (at your option) any later version. * | ||
* * | ||
* This library is distributed in the hope that it will be useful, * | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
* GNU Library General Public License for more details. * | ||
* * | ||
* You should have received a copy of the GNU Library General Public * | ||
* License along with this library; see the file COPYING.LIB. If not, * | ||
* write to the Free Software Foundation, Inc., 59 Temple Place, * | ||
* Suite 330, Boston, MA 02111-1307, USA * | ||
* * | ||
***************************************************************************/ | ||
|
||
|
||
#include "PreCompiled.h" | ||
|
||
#include "DlgSettingsFemImp.h" | ||
#include <Gui/PrefWidgets.h> | ||
|
||
using namespace FemGui; | ||
|
||
DlgSettingsFemImp::DlgSettingsFemImp( QWidget* parent ) | ||
: PreferencePage( parent ) | ||
{ | ||
this->setupUi(this); | ||
} | ||
|
||
DlgSettingsFemImp::~DlgSettingsFemImp() | ||
{ | ||
// no need to delete child widgets, Qt does it all for us | ||
} | ||
|
||
void DlgSettingsFemImp::saveSettings() | ||
{ | ||
cb_int_editor->onSave(); | ||
fc_ext_editor->onSave(); | ||
} | ||
|
||
void DlgSettingsFemImp::loadSettings() | ||
{ | ||
cb_int_editor->onRestore(); | ||
fc_ext_editor->onRestore(); | ||
} | ||
|
||
/** | ||
* Sets the strings of the subwidgets using the current language. | ||
*/ | ||
void DlgSettingsFemImp::changeEvent(QEvent *e) | ||
{ | ||
if (e->type() == QEvent::LanguageChange) { | ||
retranslateUi(this); | ||
} | ||
else { | ||
QWidget::changeEvent(e); | ||
} | ||
} | ||
|
||
#include "moc_DlgSettingsFemImp.cpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/************************************************************************** | ||
* Copyright (c) 2015 FreeCAD Developers * | ||
* Author: Przemo Firszt <przemo@firszt.eu> * | ||
* Based on src/Mod/Raytracing/Gui/DlgSettingsRayImp.h * | ||
* * | ||
* This file is part of the FreeCAD CAx development system. * | ||
* * | ||
* This library is free software; you can redistribute it and/or * | ||
* modify it under the terms of the GNU Library General Public * | ||
* License as published by the Free Software Foundation; either * | ||
* version 2 of the License, or (at your option) any later version. * | ||
* * | ||
* This library is distributed in the hope that it will be useful, * | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
* GNU Library General Public License for more details. * | ||
* * | ||
* You should have received a copy of the GNU Library General Public * | ||
* License along with this library; see the file COPYING.LIB. If not, * | ||
* write to the Free Software Foundation, Inc., 59 Temple Place, * | ||
* Suite 330, Boston, MA 02111-1307, USA * | ||
* * | ||
***************************************************************************/ | ||
|
||
|
||
#ifndef FEMGUI_DLGSETTINGSFEMIMP_H | ||
#define FEMGUI_DLGSETTINGSFEMIMP_H | ||
|
||
#include "ui_DlgSettingsFem.h" | ||
#include <Gui/PropertyPage.h> | ||
|
||
namespace FemGui { | ||
|
||
class DlgSettingsFemImp : public Gui::Dialog::PreferencePage, public Ui_DlgSettingsFemImp | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
DlgSettingsFemImp( QWidget* parent = 0 ); | ||
~DlgSettingsFemImp(); | ||
|
||
protected: | ||
void saveSettings(); | ||
void loadSettings(); | ||
void changeEvent(QEvent *e); | ||
}; | ||
|
||
} // namespace FemGui | ||
|
||
#endif // FEMGUI_DLGSETTINGSFEMIMP_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.