Skip to content

Commit b279394

Browse files
committed
Merge branch 'master' into renderer-work
2 parents bcddc46 + a87cf66 commit b279394

File tree

8 files changed

+41
-25
lines changed

8 files changed

+41
-25
lines changed

src/CMakeLists.txt

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,25 +93,30 @@ MESSAGE(STATUS "Git version tag: " "${VERSION_TAG}")
9393
MESSAGE(STATUS "Git version branch: " "${VERSION_BRANCH}")
9494
MESSAGE(STATUS "Git version commit hash: " "${VERSION_HASHVAR}")
9595

96-
#TODO: parse the version information into pieces.
97-
#string(REGEX REPLACE "^v([0-9]+)\\..*" "\\1" VERSION_MAJOR "${VERSION}")
98-
#string(REGEX REPLACE "^v[0-9]+\\.([0-9]+).*" "\\1" VERSION_MINOR "${VERSION}")
99-
#string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" VERSION_PATCH "${VERSION}")
96+
#parse the version information into pieces.
97+
string(REGEX REPLACE "^v([0-9]+)\\..*" "\\1" VERSION_MAJOR "${VERSION_TAG}")
98+
string(REGEX REPLACE "^v[0-9]+\\.([0-9]+).*" "\\1" VERSION_MINOR "${VERSION_TAG}")
99+
#TODO: make generic
100+
string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\-(alpha.[A-Z]+)\\-.*" "\\1" VERSION_PATCH "${VERSION_TAG}")
101+
#TODO: parse SHA
100102
#string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.[0-9]+(.*)" "\\1" VERSION_SHA1 "${VERSION}")
101103
#set(VERSION_SHORT "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
102104

105+
#MESSAGE(STATUS "Git version major: " "${VERSION_MAJOR}")
106+
#MESSAGE(STATUS "Git version minor: " "${VERSION_MINOR}")
107+
#MESSAGE(STATUS "Git version patch name: " "${VERSION_PATCH}")
108+
103109
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMake/Modules/Version.cc.in
104110
${CMAKE_CURRENT_SOURCE_DIR}/Core/Application/Version.cc)
105111
set(version_file "${CMAKE_CURRENT_SOURCE_DIR}/Core/Application/Version.cc")
106112

107113

108114
########################################################################
109115
# SCIRUN version number.
110-
# TODO: update using parsed tag from above
111116

112-
SET(SCIRUN_VERSION_MAJOR "5")
113-
SET(SCIRUN_VERSION_MINOR "0")
114-
SET(SCIRUN_VERSION_PATCH "0")
117+
SET(SCIRUN_VERSION_MAJOR "${VERSION_MAJOR}")
118+
SET(SCIRUN_VERSION_MINOR "${VERSION_MINOR}")
119+
SET(SCIRUN_VERSION_PATCH "${VERSION_PATCH}")
115120

116121
SET(SCIRUN_VERSION_STRING "${SCIRUN_VERSION_MAJOR}.${SCIRUN_VERSION_MINOR}")
117122

@@ -215,6 +220,8 @@ IF(UNIX)
215220
ENDIF()
216221

217222
IF(APPLE)
223+
SET(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11")
224+
SET(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
218225
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -ftemplate-depth=256")
219226
SET(CMAKE_CXX_FLAGS_DEBUG "-Wshorten-64-to-32 ${CMAKE_CXX_FLAGS_DEBUG}")
220227

src/Interface/Application/GuiApplication.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ using namespace SCIRun::Gui;
3636

3737
int GuiApplication::run(int argc, const char* argv[])
3838
{
39+
QApplication app(argc, const_cast<char**>(argv));
40+
3941
try
4042
{
41-
QApplication app(argc, const_cast<char**>(argv));
42-
4343
SCIRun::Gui::SCIRunMainWindow* mainWin = SCIRun::Gui::SCIRunMainWindow::Instance();
4444

4545
mainWin->setController(Core::Application::Instance().controller());
@@ -49,14 +49,14 @@ int GuiApplication::run(int argc, const char* argv[])
4949
}
5050
catch (std::exception& e)
5151
{
52-
//QMessageBox::critical(0, "Critical error", "Unhandled exception: " + QString(e.what()) + "\nExiting now.");
53-
std::cout << "Unhandled exception: " << e.what() << std::endl;
52+
QMessageBox::critical(0, "Critical error", "Unhandled exception: " + QString(e.what()) + "\nExiting now.");
53+
std::cerr << "Unhandled exception: " << e.what() << std::endl;
5454
return 1;
5555
}
5656
catch (...)
5757
{
58-
//QMessageBox::critical(0, "Critical error", "Unknown unhandled exception: exiting now.");
59-
std::cout << "Unhandled exception: Unknown" << std::endl;
58+
QMessageBox::critical(0, "Critical error", "Unknown unhandled exception: exiting now.");
59+
std::cerr << "Unhandled exception: Unknown" << std::endl;
6060
return 1;
6161
}
6262
}

src/Interface/Application/ModuleWidget.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,7 @@ void ModuleWidget::makeOptionsDialog()
10461046
if (!dialog_)
10471047
{
10481048
if (!dialogFactory_)
1049-
dialogFactory_.reset(new ModuleDialogFactory(0));
1049+
dialogFactory_.reset(new ModuleDialogFactory(0, addWidgetToExecutionDisableList));
10501050

10511051
dialog_ = dialogFactory_->makeDialog(moduleId_, theModule_->get_state());
10521052
dialog_->pull();

src/Interface/Modules/Base/ModuleDialogGeneric.cc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ using namespace SCIRun::Dataflow::Networks;
3636
using namespace SCIRun::Core::Algorithms;
3737
using namespace SCIRun::Core::Logging;
3838

39+
ExecutionDisablingServiceFunction ModuleDialogGeneric::disabler_;
40+
3941
ModuleDialogGeneric::ModuleDialogGeneric(SCIRun::Dataflow::Networks::ModuleStateHandle state, QWidget* parent) : QDialog(parent),
4042
state_(state),
4143
pulling_(false),
@@ -65,6 +67,8 @@ ModuleDialogGeneric::~ModuleDialogGeneric()
6567
void ModuleDialogGeneric::connectButtonToExecuteSignal(QAbstractButton* button)
6668
{
6769
connect(button, SIGNAL(clicked()), this, SIGNAL(executeActionTriggered()));
70+
if (disabler_)
71+
disabler_(button);
6872
}
6973

7074
void ModuleDialogGeneric::updateWindowTitle(const QString& title)
@@ -239,7 +243,7 @@ class CompositeSlotManager : public WidgetSlotManager
239243
{
240244
public:
241245
CompositeSlotManager(ModuleStateHandle state, ModuleDialogGeneric& dialog, const AlgorithmParameterName& stateKey, const std::vector<Widget*>& widgets)
242-
: WidgetSlotManager(state, dialog)
246+
: WidgetSlotManager(state, dialog)
243247
{
244248
std::transform(widgets.begin(), widgets.end(), std::back_inserter(managers_), [&](Widget* w) { return boost::make_shared<Manager>(state, dialog, stateKey, w); });
245249
}
@@ -380,7 +384,7 @@ class DoubleLineEditSlotManager : public WidgetSlotManager
380384
virtual void pushImpl() override
381385
{
382386
LOG_DEBUG("In new version of push code for LineEdit: " << lineEdit_->text().toStdString());
383-
try
387+
try
384388
{
385389
auto value = boost::lexical_cast<double>(lineEdit_->text().toStdString());
386390
state_->setValue(stateKey_, value);
@@ -607,5 +611,5 @@ void ModuleDialogGeneric::tableHeaderStyle(QTableWidget* tableHeader)
607611
{
608612
tableHeader->setStyleSheet(
609613
"QHeaderView::section {background: rgb(66,66,69);}"
610-
);
611-
}
614+
);
615+
}

src/Interface/Modules/Base/ModuleDialogGeneric.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
namespace SCIRun {
4242
namespace Gui {
4343

44+
typedef std::function<void(QWidget*)> ExecutionDisablingServiceFunction;
4445
typedef boost::bimap<std::string,std::string> GuiStringTranslationMap;
4546
typedef GuiStringTranslationMap::value_type StringPair;
4647

@@ -53,6 +54,7 @@ namespace Gui {
5354
QAction* getExecuteAction() { return executeAction_; }
5455
void setDockable(QDockWidget* dock) { dock_ = dock; } // to enable title changes
5556
void updateWindowTitle(const QString& title);
57+
static void setExecutionDisablingServiceFunction(ExecutionDisablingServiceFunction disabler) { disabler_ = disabler; }
5658

5759
//TODO: input state hookup?
5860
//yeah: eventually replace int with generic dialog state object, but needs to be two-way (set/get)
@@ -86,7 +88,7 @@ namespace Gui {
8688
ModuleDialogGeneric* m_;
8789
};
8890
void tabStyle(QTabWidget* tabs);
89-
void tableHeaderStyle(QTableWidget* tableHeader);
91+
void tableHeaderStyle(QTableWidget* tableHeader);
9092
void addComboBoxManager(QComboBox* comboBox, const Core::Algorithms::AlgorithmParameterName& stateKey);
9193
void addComboBoxManager(QComboBox* comboBox, const Core::Algorithms::AlgorithmParameterName& stateKey, const GuiStringTranslationMap& stringMap);
9294
void addTextEditManager(QTextEdit* textEdit, const Core::Algorithms::AlgorithmParameterName& stateKey);
@@ -112,6 +114,7 @@ namespace Gui {
112114
QString windowTitle_;
113115
QDockWidget* dock_;
114116
QSize oldSize_;
117+
static ExecutionDisablingServiceFunction disabler_;
115118
};
116119

117120
}

src/Interface/Modules/Factory/ModuleDialogFactory.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,11 @@ using namespace SCIRun::Gui;
101101
using namespace SCIRun::Dataflow::Networks;
102102
using namespace boost::assign;
103103

104-
ModuleDialogFactory::ModuleDialogFactory(QWidget* parentToUse) : parentToUse_(parentToUse)
104+
ModuleDialogFactory::ModuleDialogFactory(QWidget* parentToUse, ExecutionDisablingServiceFunction disabler) : parentToUse_(parentToUse)
105105
{
106106
addDialogsToMakerMap1();
107107
addDialogsToMakerMap2();
108+
ModuleDialogGeneric::setExecutionDisablingServiceFunction(disabler);
108109
}
109110

110111
void ModuleDialogFactory::addDialogsToMakerMap1()

src/Interface/Modules/Factory/ModuleDialogFactory.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,17 @@ namespace SCIRun
3838
{
3939
namespace Gui
4040
{
41-
class ModuleDialogGeneric;
42-
4341
class SCISHARE ModuleDialogFactory
4442
{
4543
public:
46-
explicit ModuleDialogFactory(QWidget* parentToUse);
44+
ModuleDialogFactory(QWidget* parentToUse, ExecutionDisablingServiceFunction disabler);
4745
ModuleDialogGeneric* makeDialog(const std::string& moduleId, SCIRun::Dataflow::Networks::ModuleStateHandle state);
4846
private:
4947
QWidget* parentToUse_;
5048
typedef boost::function<ModuleDialogGeneric*(const std::string&, SCIRun::Dataflow::Networks::ModuleStateHandle, QWidget*)> DialogMaker;
5149
typedef std::map<std::string, DialogMaker> DialogMakerMap;
5250
DialogMakerMap dialogMakerMap_;
51+
ExecutionDisablingServiceFunction disabler_;
5352
void addDialogsToMakerMap1();
5453
void addDialogsToMakerMap2();
5554
};
@@ -58,4 +57,4 @@ namespace SCIRun
5857

5958
#define ADD_MODULE_DIALOG(module, dialog) (#module, boost::factory<dialog*>())
6059

61-
#endif
60+
#endif

src/Interface/Modules/Inverse/SolveInverseProblemWithTikhonovDialog.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ SolveInverseProblemWithTikhonovDialog::SolveInverseProblemWithTikhonovDialog(con
4646
lambdaMethod_.insert(StringPair("Slider", "slider"));
4747
lambdaMethod_.insert(StringPair("L-curve", "lcurve"));
4848

49+
tabStyle(inputTabWidget_);
50+
4951
addDoubleLineEditManager(lCurveLambdaLineEdit_, SolveInverseProblemWithTikhonovModule::LambdaCorner);
5052
addSpinBoxManager(lambdaNumberSpinBox_, SolveInverseProblemWithTikhonovModule::LambdaNum);
5153
addDoubleSpinBoxManager(lambdaDoubleSpinBox_, SolveInverseProblemWithTikhonovModule::LambdaFromDirectEntry);

0 commit comments

Comments
 (0)