diff --git a/DSView/main.cpp b/DSView/main.cpp index 0fce15d8..d0cb7161 100755 --- a/DSView/main.cpp +++ b/DSView/main.cpp @@ -42,7 +42,7 @@ void usage() { - fprintf(stdout, + printf( "Usage:\n" " %s [OPTION…] [FILE] — %s\n" "\n" @@ -132,7 +132,7 @@ int main(int argc, char *argv[]) case 'V': // Print version info - fprintf(stdout, "%s %s\n", DS_TITLE, DS_VERSION_STRING); + printf("%s %s\n", DS_TITLE, DS_VERSION_STRING); return 0; case 'h': @@ -143,7 +143,7 @@ int main(int argc, char *argv[]) } if (argcFinal - optind > 1) { - fprintf(stderr, "Only one file can be openened.\n"); + printf("Only one file can be openened.\n"); return 1; } else if (argcFinal - optind == 1){ open_file = argvFinal[argcFinal - 1]; @@ -159,7 +159,7 @@ int main(int argc, char *argv[]) //init core if (!control->Init()){ - fprintf(stderr, "init error!"); + printf("init error!"); qDebug() << control->GetLastError(); return 1; } @@ -183,7 +183,7 @@ int main(int argc, char *argv[]) } catch (const std::exception &e) { - fprintf(stderr, "main() catch a except!"); + printf("main() catch a except!"); const char *exstr = e.what(); qDebug() << exstr; } diff --git a/DSView/pv/appcontrol.cpp b/DSView/pv/appcontrol.cpp index 52275e88..15c0e52d 100644 --- a/DSView/pv/appcontrol.cpp +++ b/DSView/pv/appcontrol.cpp @@ -75,7 +75,18 @@ bool AppControl::Init() } QString resdir = GetResourceDir(); - sr_set_firmware_resource_dir(resdir.toUtf8()); + sr_set_firmware_resource_dir(resdir.toUtf8().data()); + +#ifdef _WIN32 + QString pythonHome = GetAppDataDir() + "/Python"; + QDir pydir; + if (pydir.exists(pythonHome)){ + srd_set_python_home(pythonHome.toUtf8().data()); + }else{ + qDebug()<<"python home directory not exists,"< + #include "sigsession.h" #include "mainwindow.h" #include "devicemanager.h" diff --git a/DSView/pv/sigsession.h b/DSView/pv/sigsession.h index 7f478af0..ca38e3bd 100755 --- a/DSView/pv/sigsession.h +++ b/DSView/pv/sigsession.h @@ -22,9 +22,7 @@ #ifndef DSVIEW_PV_SIGSESSION_H #define DSVIEW_PV_SIGSESSION_H - -#include - + #include #include #include @@ -39,8 +37,11 @@ #include "interface/icallbacks.h" #include "dstimer.h" +#include + struct srd_decoder; struct srd_channel; + class DecoderStatus; diff --git a/DSView/pv/toolbars/titlebar.cpp b/DSView/pv/toolbars/titlebar.cpp index 982fab1d..aae90e15 100755 --- a/DSView/pv/toolbars/titlebar.cpp +++ b/DSView/pv/toolbars/titlebar.cpp @@ -188,7 +188,8 @@ void TitleBar::setRestoreButton(bool max) void TitleBar::mousePressEvent(QMouseEvent* event) { - if(event->button() == Qt::LeftButton && !parentWidget()->isMaximized()) { + if(event->button() == Qt::LeftButton && !parentWidget()->isMaximized()) + { int x = event->pos().x(); int y = event->pos().y(); bool bTopWidow = app::is_app_top_window(_parent); diff --git a/INSTALL b/INSTALL index 94bdb080..abe9eafe 100755 --- a/INSTALL +++ b/INSTALL @@ -26,6 +26,7 @@ Requirements This is part of the standard OpenBSD install (not an extra package), apparently. - check >= 0.9.4 (optional, only needed to run unit tests) - libfftw3 >= 3.3 + - zlib Building and installing ----------------------- diff --git a/libsigrokdecode4DSL/libsigrokdecode.h b/libsigrokdecode4DSL/libsigrokdecode.h index 491c3371..d66cc74e 100755 --- a/libsigrokdecode4DSL/libsigrokdecode.h +++ b/libsigrokdecode4DSL/libsigrokdecode.h @@ -361,6 +361,7 @@ struct srd_pd_callback { SRD_API int srd_init(const char *path); SRD_API int srd_exit(void); SRD_API GSList *srd_searchpaths_get(void); +SRD_API void srd_set_python_home(const char *path); /* session.c */ SRD_API int srd_session_new(struct srd_session **sess); diff --git a/libsigrokdecode4DSL/srd.c b/libsigrokdecode4DSL/srd.c index 92be591f..caec1fd0 100755 --- a/libsigrokdecode4DSL/srd.c +++ b/libsigrokdecode4DSL/srd.c @@ -386,4 +386,10 @@ SRD_API GSList *srd_searchpaths_get(void) return paths; } +//set python home directory +SRD_API void srd_set_python_home(const char *path) +{ + Py_SetPythonHome((wchar_t*)path); +} + /** @} */ diff --git a/qtpro/DSView.pro b/qtpro/DSView.pro index c3540636..575d247e 100644 --- a/qtpro/DSView.pro +++ b/qtpro/DSView.pro @@ -13,8 +13,9 @@ QT += svg CONFIG += exceptions CONFIG += object_parallel_to_source -greaterThan(QT_MAJOR_VERSION, 4): CONFIG += c++11 -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +//QT += core5compat +CONFIG += c++11 +QT += widgets #QMAKE_CFLAGS_ISYSTEM = -I diff --git a/qtpro/DSView.pro.user b/qtpro/DSView.pro.user index 994a2dc4..536a527e 100644 --- a/qtpro/DSView.pro.user +++ b/qtpro/DSView.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId