diff --git a/Doxyfile b/Doxyfile index 092d8c9..00a6fd3 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1254,7 +1254,7 @@ SERVER_BASED_SEARCH = NO # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. -GENERATE_LATEX = NO +GENERATE_LATEX = YES # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be @@ -1325,7 +1325,7 @@ USE_PDFLATEX = YES # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. -LATEX_BATCHMODE = NO +LATEX_BATCHMODE = YES # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) @@ -1633,7 +1633,7 @@ HIDE_UNDOC_RELATIONS = YES # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) -HAVE_DOT = NO +HAVE_DOT = YES # The DOT_NUM_THREADS specifies the number of dot invocations doxygen is # allowed to run in parallel. When set to 0 (the default) doxygen will @@ -1668,7 +1668,7 @@ DOT_FONTPATH = # indirect inheritance relations. Setting this tag to YES will force the # CLASS_DIAGRAMS tag to NO. -CLASS_GRAPH = YES +CLASS_GRAPH = NO # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and @@ -1686,7 +1686,7 @@ GROUP_GRAPHS = YES # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. -UML_LOOK = NO +UML_LOOK = YES # If the UML_LOOK tag is enabled, the fields and methods are shown inside # the class node. If there are many fields or methods and many nodes the diff --git a/src/mainandlog/logviewerdialog.cpp b/src/mainandlog/logviewerdialog.cpp index 8eaa646..3ac3cf1 100644 --- a/src/mainandlog/logviewerdialog.cpp +++ b/src/mainandlog/logviewerdialog.cpp @@ -1,13 +1,24 @@ #include "logviewerdialog.h" - +#include + +#if QT_VERSION >= 0x050000 #include #include #include #include #include +#include +#else +#include +#include +#include +#include +#include +#include +#endif + #include #include -#include #include #include #include diff --git a/src/mainandlog/logviewerdialog.h b/src/mainandlog/logviewerdialog.h index 629c3fd..a6727d5 100644 --- a/src/mainandlog/logviewerdialog.h +++ b/src/mainandlog/logviewerdialog.h @@ -1,8 +1,14 @@ #ifndef LOGVIEWERDIALOG_H #define LOGVIEWERDIALOG_H -#include +#include + +#if QT_VERSION >= 0x050000 +#include +#else +#include +#endif QT_BEGIN_NAMESPACE class QTextBrowser; class QPlainTextEdit; diff --git a/src/mainandlog/main.cpp b/src/mainandlog/main.cpp index 884f601..306efc0 100644 --- a/src/mainandlog/main.cpp +++ b/src/mainandlog/main.cpp @@ -4,7 +4,7 @@ The main function instantiates the Main Window object, to which all the various 'wigets' are attached. (ie: the serial_widget) */ - +#include #ifndef __PRETTY_FUNCTION__ #ifndef __FUNCDNAME__ @@ -21,7 +21,12 @@ */ bool VERBOSE = true; -#include +#if QT_VERSION >= 0x050000 + #include +#else + #include +#endif + #include #include #include @@ -40,11 +45,22 @@ QPointer logViewer; /*! Custom message handler that redirects messages to a log viewer (if available). */ +#if QT_VERSION >= 0x050000 void MyMessageOutput(QtMsgType Type, const QMessageLogContext& Context, const QString &Message) { if(logViewer) logViewer->outputMessage( Type, Message ); } +#else +void myMessageOutput(QtMsgType type, const char *msg) +{ + if(logViewer) + { + logViewer->outputMessage( type, msg ); + } +} +#endif + int main(int argc, char *argv[]) { @@ -59,8 +75,12 @@ int main(int argc, char *argv[]) // Instantiate a log viewer and redirect debug messages to it. logViewer = new LogViewer; - qInstallMessageHandler(MyMessageOutput); +#if QT_VERSION >= 0x050000 + qInstallMessageHandler(MyMessageOutput); +#else + qInstallMsgHandler(myMessageOutput); +#endif // Instantiate the Main Window MainWindow w(0, logViewer); w.setAttribute(Qt::WA_AlwaysShowToolTips); diff --git a/src/mainandlog/mainwindow.h b/src/mainandlog/mainwindow.h index e1b803f..0b4bdee 100644 --- a/src/mainandlog/mainwindow.h +++ b/src/mainandlog/mainwindow.h @@ -1,13 +1,22 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H +#include + +#if QT_VERSION >= 0x050000 #include -#include #include #include #include -#include +#else +#include +#include +#include +#include +#endif +#include +#include #include "serialtools/connectioncontroller.h" #include "servoboard/servoboardcontroller.h" diff --git a/src/serialtools/connectioncontroller.cpp b/src/serialtools/connectioncontroller.cpp index 4e79e6d..c508378 100644 --- a/src/serialtools/connectioncontroller.cpp +++ b/src/serialtools/connectioncontroller.cpp @@ -120,6 +120,8 @@ void ConnectionController::open(QString port) if (!this->port->open(QIODevice::ReadWrite)) { qDebug() << "Port failed to open in connectControl"; + view->connectionFailedWarning(); + return; } this->port->setBaudRate("9600 baud"); diff --git a/src/serialtools/infowidget.h b/src/serialtools/infowidget.h index ecf9fb6..e781354 100644 --- a/src/serialtools/infowidget.h +++ b/src/serialtools/infowidget.h @@ -1,7 +1,13 @@ #ifndef INFOWIDGET_H #define INFOWIDGET_H +#include + +#if QT_VERSION >= 0x050000 #include +#else +#include +#endif namespace Ui { class InfoWidget; diff --git a/src/serialtools/serial_widget.cpp b/src/serialtools/serial_widget.cpp index a9d416c..c985506 100644 --- a/src/serialtools/serial_widget.cpp +++ b/src/serialtools/serial_widget.cpp @@ -1,6 +1,16 @@ +#include + + +#if QT_VERSION >= 0x050000 + #include +#else + #include +#endif + #include #include -#include + + #include "serial_widget.h" #include "ui_serial_widget.h" @@ -389,6 +399,14 @@ void SerialWidget::updateInfoData(SerialDeviceEnumerator* enumerator, QString& n this->infoWidget->updateInfo(data); } } + +void SerialWidget::connectionFailedWarning() +{ + QMessageBox warn(this); + warn.setText(tr("Connection failed, check to make sure the port is not being used elsewhere")); + warn.setIcon(QMessageBox::Warning); + warn.exec(); +} /* Returns the AbstractSerial Object. diff --git a/src/serialtools/serial_widget.h b/src/serialtools/serial_widget.h index f034700..773de77 100644 --- a/src/serialtools/serial_widget.h +++ b/src/serialtools/serial_widget.h @@ -1,8 +1,16 @@ #ifndef SERIALWIDGET_H #define SERIALWIDGET_H +#include + + +#if QT_VERSION >= 0x050000 + #include + #include +#else + #include + #include +#endif -#include -#include QT_BEGIN_NAMESPACE @@ -38,7 +46,7 @@ class SerialWidget : public QWidget QStringList& parity, QStringList& stopBits, QStringList& flow); void updateInfoData(SerialDeviceEnumerator* enumerator,QString& name); - + void connectionFailedWarning(); void initSerialWidgetCloseState(); void initSerialWidgetOpenState(); diff --git a/src/serialtools/tracewidget.cpp b/src/serialtools/tracewidget.cpp index 3c78882..24d41f3 100644 --- a/src/serialtools/tracewidget.cpp +++ b/src/serialtools/tracewidget.cpp @@ -1,4 +1,11 @@ +#include + + +#if QT_VERSION >= 0x050000 #include +#else +#include +#endif #include "tracewidget.h" #include "ui_tracewidget.h" diff --git a/src/serialtools/tracewidget.h b/src/serialtools/tracewidget.h index 4c7b220..7a5d339 100644 --- a/src/serialtools/tracewidget.h +++ b/src/serialtools/tracewidget.h @@ -1,7 +1,13 @@ #ifndef TRACEWIDGET_H #define TRACEWIDGET_H +#include -#include + +#if QT_VERSION >= 0x050000 + #include +#else + #include +#endif namespace Ui { class TraceWidget; diff --git a/src/servoboard/advancedlineoptionsdialog.h b/src/servoboard/advancedlineoptionsdialog.h index 5d5ea35..26ffa12 100644 --- a/src/servoboard/advancedlineoptionsdialog.h +++ b/src/servoboard/advancedlineoptionsdialog.h @@ -1,7 +1,13 @@ #ifndef ADVANCEDLINEOPTIONSDIALOG_H #define ADVANCEDLINEOPTIONSDIALOG_H +#include + +#if QT_VERSION >= 0x050000 #include +#else + #include +#endif #include namespace Ui { diff --git a/src/servoboard/servoboardcontroller.h b/src/servoboard/servoboardcontroller.h index 5e35e10..3dd2c60 100644 --- a/src/servoboard/servoboardcontroller.h +++ b/src/servoboard/servoboardcontroller.h @@ -1,8 +1,15 @@ #ifndef SERVOBOARDCONTROLLER_H #define SERVOBOARDCONTROLLER_H +#include + + #include -#include +#if QT_VERSION >= 0x050000 + #include +#else + #include +#endif #include #include diff --git a/src/servoboard/servocontrolbundle.h b/src/servoboard/servocontrolbundle.h index 8650a9e..2a14f16 100644 --- a/src/servoboard/servocontrolbundle.h +++ b/src/servoboard/servocontrolbundle.h @@ -1,7 +1,13 @@ #ifndef SERVOCONTROLBUNDLE_H #define SERVOCONTROLBUNDLE_H +#include -#include + +#if QT_VERSION >= 0x050000 + #include +#else + #include +#endif #include "ui_servocontrolbundle.h" class ServoControlBundle : public QWidget