Skip to content

Commit

Permalink
ScopyExceptionHandler: changed exception message and layout in pref menu
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Suciu <[email protected]>
  • Loading branch information
adisuciu committed Aug 31, 2020
1 parent 431b242 commit 2c8ed13
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/scopyApplication.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "client/linux/handler/exception_handler.h"
#endif

#define CATCH_UNHANDLED_EXCEPTIONS
//#define CATCH_UNHANDLED_EXCEPTIONS
#endif
#define GetScopyApplicationInstance() dynamic_cast<ScopyApplication*>(qApp)

Expand Down
9 changes: 5 additions & 4 deletions src/scopyExceptionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ using namespace adiscope;
if(GetScopyApplicationInstance()->getDebugMode()) { \
QMessageBox msg; \
QString str; \
if(dynamic_cast<libm2k::m2k_exception*>(&e)) { \
str = QString("Exception %1 - %2 %3 thrown from %2:%3 caught in %4:%5. Scopy git tag %6.") \
.arg("m2k_exception").arg(e.type()).arg(e.what()).arg(QString::fromStdString(e.file())).arg(QString::number(e.line())).arg(__FILE__).arg(__LINE__).arg(SCOPY_VERSION_GIT); \
auto me = dynamic_cast<libm2k::m2k_exception*>(&e);\
if(me) { \
str = QString("Exception %1\ne.type() - %2\ne.what() - %3\ne.iioCode() - %4\nthrown from %5:%6\ncaught in %7:%8\nScopy git tag %9\n") \
.arg("m2k_exception").arg(me->type()).arg(me->what()).arg(me->iioCode()).arg(QString::fromStdString(me->file())).arg(QString::number(me->line())).arg(__FILE__).arg(__LINE__).arg(SCOPY_VERSION_GIT); \
} \
else { str = QString("Exception %1 - caught in %2:%3. Scopy git tag %4").arg(e.what()).arg(__FILE__).arg(__LINE__).arg(SCOPY_VERSION_GIT);} \
else { str = QString("Exception %1\ncaught in %2:%3\nScopy git tag %4\n").arg(e.what()).arg(__FILE__).arg(__LINE__).arg(SCOPY_VERSION_GIT);} \
if(WriteScopyMinidump()) str = str + "Created minidump.";\
msg.setText(str);\
msg.exec();\
Expand Down
7 changes: 5 additions & 2 deletions ui/preferences.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>1082</width>
<height>722</height>
<height>777</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -1009,7 +1009,7 @@ color: white;
<number>0</number>
</property>
<property name="verticalSpacing">
<number>15</number>
<number>10</number>
</property>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_13">
Expand Down Expand Up @@ -1570,6 +1570,9 @@ QCheckBox::indicator:checked { background-color: rgb(74,100,255); }</string>
</item>
<item row="8" column="1">
<layout class="QVBoxLayout" name="verticalLayout_8">
<property name="spacing">
<number>10</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
Expand Down

0 comments on commit 2c8ed13

Please sign in to comment.