From 30c7a0994e3bf5baaeda2f6228c60819c30c3395 Mon Sep 17 00:00:00 2001 From: Lars Wadefalk Date: Mon, 9 Mar 2015 00:11:14 +0100 Subject: [PATCH] Use QSerialPort instead of QextSerialPort. Made compiling again working for QT under MSVC and also as multicore if supported. --- README.TXT | 8 -- logger.cpp | 1 + mainwindow.cpp | 40 +++++----- mainwindow.hpp | 6 +- mountspecificfile.cpp | 1 + notes.txt | 99 +++++++++++------------ qcmdtextedit.cpp | 85 ++++++++++---------- rpi2iec.pro | 179 +++++++++++++++++++++--------------------- settingsdialog.cpp | 7 +- settingsdialog.hpp | 6 +- 10 files changed, 205 insertions(+), 227 deletions(-) diff --git a/README.TXT b/README.TXT index 4dfc088..2bc52e1 100755 --- a/README.TXT +++ b/README.TXT @@ -105,14 +105,6 @@ files in release and debug folders under the source folder. Build a single executable without dependencies: ----------------------------------------------- - - -REQUIREMENTS: (external dependencies): -QextSerialPort project: -https://code.google.com/p/qextserialport/ - -The QextSerialPort project should be located on the same directory level as the "rpi2iec" project. - Optional: Max7219 driver library (modified by Lars Wadefalk to c++ with support for progress bar display and scroller). Github project: https://github.com/Larswad/arduino_max7219.git diff --git a/logger.cpp b/logger.cpp index 9585d7f..bc8b910 100644 --- a/logger.cpp +++ b/logger.cpp @@ -1,4 +1,5 @@ #include "logger.hpp" +#include #include #include diff --git a/mainwindow.cpp b/mainwindow.cpp index 23dc6a1..0011fcf 100755 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -74,7 +74,7 @@ QStringList LOG_LEVELS = (QStringList() // Default Device and Arduino PIN configuration. -const uint DEFAULT_BAUDRATE = BAUD115200; +const uint DEFAULT_BAUDRATE = QSerialPort::Baud115200; const uint DEFAULT_DEVICE_NUMBER = 8; const uint DEFAULT_RESET_PIN = 7; const uint DEFAULT_CLOCK_PIN = 4; @@ -134,7 +134,7 @@ const QString PROGRAM_VERSION_HISTORY = qApp->tr( MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent) , ui(new Ui::MainWindow) - , m_port(QextSerialPort::EventDriven, this) + , m_port(this) , m_isConnected(false) , m_iface() , m_isInitialized(false) @@ -149,15 +149,15 @@ MainWindow::MainWindow(QWidget* parent) : loggerInstance().addTransport(this); // Set up the port basic parameters, these won't change...promise. - m_port.setDataBits(DATA_8); - m_port.setParity(PAR_NONE); - m_port.setFlowControl(FLOW_OFF); - m_port.setStopBits(STOP_1); + m_port.setDataBits(QSerialPort::Data8); + m_port.setParity(QSerialPort::NoParity); + m_port.setFlowControl(QSerialPort::NoFlowControl); + m_port.setStopBits(QSerialPort::OneStop); enumerateComPorts(); readSettings(); - m_port.setBaudRate(static_cast(m_appSettings.baudRate)); + m_port.setBaudRate(static_cast(m_appSettings.baudRate)); usePortByFriendlyName(m_appSettings.portName); m_port.open(QIODevice::ReadWrite); @@ -267,22 +267,18 @@ void MainWindow::onCbmMachineSelected(QAction* pAction) void MainWindow::enumerateComPorts() { - m_ports = QextSerialEnumerator::getPorts(); + m_ports = QSerialPortInfo::availablePorts(); // Manually add the ports that the enumerator can't know about. #if defined(__arm__) // just for the Raspberry PI. - static QextPortInfo piPort = { "/dev/ttyAMA0", "ttyAMA0", "Arduino AMA0", "", 0, 0 }; - m_ports.insert(0, piPort); - // m_port.setBaudRate(BAUD57600/*BAUD1152000*/); -#elif defined(Q_OS_LINUX) - static QextPortInfo unixPort = { "/dev/ttyACM0", "ttyACM0", "Arduino ACM0", "", 0, 0 }; - m_ports.insert(0, unixPort); +// static QSerialPortInfo piPort("ttyAMA0");/* = { "/dev/ttyAMA0", "ttyAMA0", "Arduino AMA0", "", 0, 0 };*/ +// m_ports.insert(0, piPort); #elif defined(Q_OS_MAC) - QDir dev("/dev","tty.usbmodem*", QDir::Name,QDir::Files bitor QDir::Readable bitor QDir::Writable bitor QDir::System); + QDir dev("/dev", "tty.usbmodem*", QDir::Name,QDir::Files bitor QDir::Readable bitor QDir::Writable bitor QDir::System); foreach(const QFileInfo entry, dev.entryInfoList()) { - static QextPortInfo unixPort = { entry.absoluteFilePath(), entry.fileName(), entry.fileName(), "", 0, 0 }; - m_ports.insert(0, unixPort); + static QSerialPortInfo macPort(entry.fileName); /* = { entry.absoluteFilePath(), entry.fileName(), entry.fileName(), "", 0, 0 };*/ + m_ports.insert(0, macPort); } #endif } // enumerateComPorts @@ -290,10 +286,10 @@ void MainWindow::enumerateComPorts() void MainWindow::usePortByFriendlyName(const QString& friendlyName) { - foreach(QextPortInfo port, m_ports) { - if(port.friendName == friendlyName) { + foreach(QSerialPortInfo port, m_ports) { + if(port.portName() == friendlyName) { // found it, set it and be done. - m_port.setPortName(port.portName); + m_port.setPort(port); break; } } @@ -339,7 +335,7 @@ void MainWindow::on_actionSettings_triggered() updateImageList(); } if(m_appSettings.baudRate not_eq oldSettings.baudRate) - m_port.setBaudRate(static_cast(m_appSettings.baudRate)); + m_port.setBaudRate(static_cast(m_appSettings.baudRate)); // Was port changed? if(m_appSettings.portName not_eq oldSettings.portName) { @@ -392,7 +388,7 @@ void MainWindow::readSettings() m_appSettings.lastSpecificMounted = sets.value("singleImageName").toString(); QDir::setCurrent(m_appSettings.imageDirectory); ui->imageFilter->setText(sets.value("imageFilter", QString()).toString()); - m_appSettings.portName = sets.value("portName", m_ports.isEmpty() ? "COM1" : m_ports.first().friendName).toString(); + m_appSettings.portName = sets.value("portName", m_ports.isEmpty() ? "COM1" : m_ports.first().portName()).toString(); m_appSettings.baudRate = sets.value("baudRate", QString::number(DEFAULT_BAUDRATE)).toUInt(); m_appSettings.deviceNumber = sets.value("deviceNumber", QString::number(DEFAULT_DEVICE_NUMBER)).toUInt(); m_appSettings.atnPin = sets.value("atnPin", QString::number(DEFAULT_ATN_PIN)).toUInt(); diff --git a/mainwindow.hpp b/mainwindow.hpp index d381445..beeb04a 100755 --- a/mainwindow.hpp +++ b/mainwindow.hpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include "interface.hpp" #include "logger.hpp" @@ -111,12 +111,12 @@ private slots: void cbmCursorVisible(bool visible = true); Ui::MainWindow *ui; - QextSerialPort m_port; + QSerialPort m_port; QByteArray m_pendingBuffer; bool m_isConnected; FacilityMap m_clientFacilities; Interface m_iface; - QextPortInfoList m_ports; + QList m_ports; QStandardItemModel* m_dirListItemModel; QFileInfoList m_filteredInfoList; QFileInfoList m_infoList; diff --git a/mountspecificfile.cpp b/mountspecificfile.cpp index 2205af8..b1cdc9e 100755 --- a/mountspecificfile.cpp +++ b/mountspecificfile.cpp @@ -1,4 +1,5 @@ #include +#include #include "mountspecificfile.h" #include "ui_mountspecificfile.h" diff --git a/notes.txt b/notes.txt index b0e3812..25d9f05 100755 --- a/notes.txt +++ b/notes.txt @@ -42,17 +42,6 @@ REBOOT! test that this works with minicom: minicom -b 9600 -o -D /dev/ttyAMA0 - --------------------------------------------------- -qt support for serial port: --------------------------------------------------- - -qextserialport is found here: -git clone https://code.google.com/p/qextserialport/ - -(simply build with qmake) -TODO: QT5 has specific class for serial port support. Future versions may preferably use this instead! - ------------------------------------------------------ How to test the ATN, CLOCK, DATA lines from CBM basic: ------------------------------------------------------ @@ -128,7 +117,7 @@ If 'l' is returned, there was no more data CBM syntax: -------------------------------------------------- LOAD"<<",8 Reset interface and communication state. Do this if there is problem with PC to arduino sync. - Read < as the petscii back-arrow. + Read < as the petscii back-arrow. LOAD "!!",8 Retreive information about the current used file system / image. @@ -137,7 +126,7 @@ In Nativs FS mode: (the default mode) LOAD "*",8 Load the first file from the current disk image or the native fs. LOAD"$",8 Gets directory listing, equivalent to LOAD".",8 - Loads the current directory, either inside an image or the native fs. + Loads the current directory, either inside an image or the native fs. LOAD"gamesdir",8 Enter the "gamesdir" directory, and get listing. LOAD"..",8 Up one directory and get directory listing. LOAD"tetris.prg",8 Loads the "tetris.prg" program file. @@ -147,15 +136,15 @@ LOAD"tape.t64",8 Loads the tape.t64 tape image and enters T64 mode. LOAD "FILE.M2I",8 Move into a M2I "image" and load the list of contained native fs files. In D64 mode: - Load "$", "*" wildcards, filenames works (almost) as espected on a 1541. - LOAD"<",8 (back-arrow). Escape D64 mode, and back to FAT mode. - SAVE"abc",8 Fools the CBM, but has no effect. Saves in D64 are - not implemented + Load "$", "*" wildcards, filenames works (almost) as espected on a 1541. + LOAD"<",8 (back-arrow). Escape D64 mode, and back to FAT mode. + SAVE"abc",8 Fools the CBM, but has no effect. Saves in D64 are + not implemented In T64 mode: - Load "$", "*" wildcards, filenames works as if it was a D64. - LOAD"<",8 (back-arrow). Escape T64 mode, and back to FAT mode. - SAVE"abc",8 Fools the CBM, but has no effect. + Load "$", "*" wildcards, filenames works as if it was a D64. + LOAD"<",8 (back-arrow). Escape T64 mode, and back to FAT mode. + SAVE"abc",8 Fools the CBM, but has no effect. NOTE: @@ -167,37 +156,37 @@ Try a LOAD"<<",8 to try going into initial state. 1541 original commands implemented / to implement (X means implemented and working). ------------------------------------------------------------------------------------ - UI- / UI+: Switch to VIC20 / VIC64 speed - NEW:name,id (abbreviated N:name,id) If id is left out directory is just cleared. - COPY:newfile=oldfile (abbreviated C:newfile=oldfile) If oldfile is several comma separated names they are concatenated. - RENAME:newfile=oldfile (abbreviated R:newfile=oldfile) - SCRATCH:filename (abbreviated S:filename) If oldfile is several comma separated names they are concatenated. - INITIALIZE (abbreviated I) Initialize drive (reset states) - VALIDATE (abbreviated V) Reorganize drive, like defragment - PRINT#file#, "BLOCK-READ:" channel; drive; track; block (abbreviated PRINT#file#, "B-R:" channel; drive; track; block - PRINT#file#, "BLOCK-WRITE:" channel; drive; track; block (abbreviated PRINT#file, "B-W:" channel; drive; track; block) - PRINT#file#, "BLOCK-ALLOCATE:" drive; track; block - PRINT#file#, "BLOCK-FREE:" drive; track; block (abbreviated PRINT#file#, "B-F:" drive; track; block - PRINT#file#, "B-P:" channel; position To set buffer pointer - PRINT#file#, "P" CHR$(channel#) CHR$(rec#lo) CHR$(rec#hi)CHR$(position) Set position in REL files - PRINT#file#, "U1:" channel; drive; track; block (abbreviated PRINT#file#, "UA:" channel; drive; track; block) USER1 command - PRINT#file#, "U2:" channel; drive; track; block (abbreviated PRINT#file#, "UB:" channel; drive; track; block USER2 command - PRINT#file#, "M-R" CHR$(low byte of address) CHR$(high byte) memory read - PRINT#file#, "M-W" CHR$(low address byte) CHR$(high address byte)CHR$(#-of-characters) byte data memory write - PRINT#file#, "M-E" CHR$(low address byte) CHR$(high byte) memory execute - PRINT#file#,"M-W:" CHR$(119) CHR$(0) CHR$(2) CHR$(address+32)CHR$(address+64) change device number + UI- / UI+: Switch to VIC20 / VIC64 speed + NEW:name,id (abbreviated N:name,id) If id is left out directory is just cleared. + COPY:newfile=oldfile (abbreviated C:newfile=oldfile) If oldfile is several comma separated names they are concatenated. + RENAME:newfile=oldfile (abbreviated R:newfile=oldfile) + SCRATCH:filename (abbreviated S:filename) If oldfile is several comma separated names they are concatenated. + INITIALIZE (abbreviated I) Initialize drive (reset states) + VALIDATE (abbreviated V) Reorganize drive, like defragment + PRINT#file#, "BLOCK-READ:" channel; drive; track; block (abbreviated PRINT#file#, "B-R:" channel; drive; track; block + PRINT#file#, "BLOCK-WRITE:" channel; drive; track; block (abbreviated PRINT#file, "B-W:" channel; drive; track; block) + PRINT#file#, "BLOCK-ALLOCATE:" drive; track; block + PRINT#file#, "BLOCK-FREE:" drive; track; block (abbreviated PRINT#file#, "B-F:" drive; track; block + PRINT#file#, "B-P:" channel; position To set buffer pointer + PRINT#file#, "P" CHR$(channel#) CHR$(rec#lo) CHR$(rec#hi)CHR$(position) Set position in REL files + PRINT#file#, "U1:" channel; drive; track; block (abbreviated PRINT#file#, "UA:" channel; drive; track; block) USER1 command + PRINT#file#, "U2:" channel; drive; track; block (abbreviated PRINT#file#, "UB:" channel; drive; track; block USER2 command + PRINT#file#, "M-R" CHR$(low byte of address) CHR$(high byte) memory read + PRINT#file#, "M-W" CHR$(low address byte) CHR$(high address byte)CHR$(#-of-characters) byte data memory write + PRINT#file#, "M-E" CHR$(low address byte) CHR$(high byte) memory execute + PRINT#file#,"M-W:" CHR$(119) CHR$(0) CHR$(2) CHR$(address+32)CHR$(address+64) change device number X LOAD PROGRAM WILDCARD support working? - SAVE PROGRAM Must handle save with replace, @0:filename + SAVE PROGRAM Must handle save with replace, @0:filename sdi2ec support: --------------------------------------------- Changing directories (CMD syntax): - OPEN1,8,15,"CD/SOMEDIR/":CLOSE1 - change to SOMEDIR (relative, in uno2iec relative to current directory) - OPEN1,8,15,"CD//":CLOSE1 - change to root directory (In Uno2iec this root means: base path) - OPEN1,8,15,"CD//SOMEDIR/":CLOSE1 - change to SOMEDIR (in root) - OPEN1,8,15,"CD:←":CLOSE1 - go to parent directory + OPEN1,8,15,"CD/SOMEDIR/":CLOSE1 - change to SOMEDIR (relative, in uno2iec relative to current directory) + OPEN1,8,15,"CD//":CLOSE1 - change to root directory (In Uno2iec this root means: base path) + OPEN1,8,15,"CD//SOMEDIR/":CLOSE1 - change to SOMEDIR (in root) + OPEN1,8,15,"CD:←":CLOSE1 - go to parent directory Using M2Is or D64s: @@ -207,13 +196,13 @@ OPEN1,8,15,"CD:←":CLOSE1 - leave M2I/D64 Loading files: - LOAD"//SOMEDIR/:SOMEFILE" - load SOMEFILE in SOMEDIR (filename gets separated from path using colon) - Change device address + LOAD"//SOMEDIR/:SOMEFILE" - load SOMEFILE in SOMEDIR (filename gets separated from path using colon) + Change device address Change device address: - OPEN1,current address,15,"U0>"+CHR$(new address):CLOSE1 - change sd2iec device number to new address - OPEN1,device address,15,"XW":close1 - this will save settings to eeprom (required if you want to set new device address as default) + OPEN1,current address,15,"U0>"+CHR$(new address):CLOSE1 - change sd2iec device number to new address + OPEN1,device address,15,"XW":close1 - this will save settings to eeprom (required if you want to set new device address as default) files of interest in sd2iec: @@ -234,13 +223,13 @@ parser.c / .h fastloader.c / .h avr/ - crc.h - crc7asm.h - fastloader-ii.S - arch-config.h - arch-timer.c / .h - atomic.h - avrcompat.h + crc.h + crc7asm.h + fastloader-ii.S + arch-config.h + arch-timer.c / .h + atomic.h + avrcompat.h files of little interest in sd2ec: diff --git a/qcmdtextedit.cpp b/qcmdtextedit.cpp index 62652d9..5cdb452 100644 --- a/qcmdtextedit.cpp +++ b/qcmdtextedit.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "qcmdtextedit.h" #include "logger.hpp" @@ -32,54 +33,54 @@ void QCmdTextEdit::keyPressEvent(QKeyEvent* e) switch(e->key()) { - case Qt::Key_Enter: - case Qt::Key_Return: - // grab the line where the cursor is. This will be our command. - command = c.block().text().trimmed().replace(0xe01f, Qt::Key_Underscore).replace(0xe01e, Qt::Key_AsciiCircum).toLatin1().toUpper(); + case Qt::Key_Enter: + case Qt::Key_Return: + // grab the line where the cursor is. This will be our command. + command = c.block().text().trimmed().replace(0xe01f, Qt::Key_Underscore).replace(0xe01e, Qt::Key_AsciiCircum).toLatin1().toUpper(); - if(not c.atEnd()) { - // Don't insert the newline character if we're not at the end of text buffer, just move to beginning of next line and issue the command. - c.movePosition(QTextCursor::Down); - c.movePosition(QTextCursor::StartOfLine); - setTextCursor(c); - processKey = false; - } - // Logging::Log("test", Logging::info, QString("current line: %1").arg(c.blockNumber() + 1)); - // If we're at the end check whether the newline that will be generated will get us outside of the CBM screen. If so remove the top line so that - // everything will scroll up one line. - else if(currentLineNumber() >= CBM::MAX_CBM_SCREEN_ROWS) { + if(not c.atEnd()) { + // Don't insert the newline character if we're not at the end of text buffer, just move to beginning of next line and issue the command. + c.movePosition(QTextCursor::Down); + c.movePosition(QTextCursor::StartOfLine); + setTextCursor(c); + processKey = false; + } + // Logging::Log("test", Logging::info, QString("current line: %1").arg(c.blockNumber() + 1)); + // If we're at the end check whether the newline that will be generated will get us outside of the CBM screen. If so remove the top line so that + // everything will scroll up one line. + else if(currentLineNumber() >= CBM::MAX_CBM_SCREEN_ROWS) { + c.movePosition(QTextCursor::Start); + c.movePosition(QTextCursor::Down, QTextCursor::KeepAnchor, currentLineNumber() - CBM::MAX_CBM_SCREEN_ROWS + 1); + c.removeSelectedText(); + c.movePosition(QTextCursor::End); + setTextCursor(c); + } + break; + + case Qt::Key_Down: + // Moving down should cause cursor to actually increase the document number of lines. But it should go only so + // far that it reaches the terminal bottom, then start to scroll upwards by removing top lines. + if(c.atEnd()) { + // Logging::Log("test", Logging::info, QString("current line: %1").arg(currentLineNumber())); + c.insertText("\n"); + c.movePosition(QTextCursor::End); + setTextCursor(c); + if(currentLineNumber() >= CBM::MAX_CBM_SCREEN_ROWS) { c.movePosition(QTextCursor::Start); - c.movePosition(QTextCursor::Down, QTextCursor::KeepAnchor, currentLineNumber() - CBM::MAX_CBM_SCREEN_ROWS + 1); + c.movePosition(QTextCursor::Down, QTextCursor::KeepAnchor, currentLineNumber() - CBM::MAX_CBM_SCREEN_ROWS); c.removeSelectedText(); c.movePosition(QTextCursor::End); - setTextCursor(c); - } - break; - - case Qt::Key_Down: - // Moving down should cause cursor to actually increase the document number of lines. But it should go only so - // far that it reaches the terminal bottom, then start to scroll upwards by removing top lines. - if(c.atEnd()) { - // Logging::Log("test", Logging::info, QString("current line: %1").arg(currentLineNumber())); - c.insertText("\n"); - c.movePosition(QTextCursor::End); - setTextCursor(c); - if(currentLineNumber() >= CBM::MAX_CBM_SCREEN_ROWS) { - c.movePosition(QTextCursor::Start); - c.movePosition(QTextCursor::Down, QTextCursor::KeepAnchor, currentLineNumber() - CBM::MAX_CBM_SCREEN_ROWS); - c.removeSelectedText(); - c.movePosition(QTextCursor::End); - } - setTextCursor(c); - processKey = false; } - break; - - case Qt::Key_AsciiCircum: - case Qt::Key_Underscore: - c.insertText(QChar(0xe000 + e->key() - 0x40)); + setTextCursor(c); processKey = false; - break; + } + break; + + case Qt::Key_AsciiCircum: + case Qt::Key_Underscore: + c.insertText(QChar(0xe000 + e->key() - 0x40)); + processKey = false; + break; } // do normal processing, if supposed to. diff --git a/rpi2iec.pro b/rpi2iec.pro index 8d866ff..3239f74 100755 --- a/rpi2iec.pro +++ b/rpi2iec.pro @@ -4,7 +4,7 @@ # #------------------------------------------------- -QT += core gui +QT += core gui serialport greaterThan(QT_MAJOR_VERSION, 4): QT += widgets @@ -13,117 +13,114 @@ TEMPLATE = app DEFINES += CONSOLE_DEBUG -#CONFIG += extserialport -#LIBS += -L../debug/qextserialport -lqextserialport1 -#LIBS += -L../qextserialport/release -lQt5ExtSerialPort1 -INCLUDEPATH += ../qextserialport/src -#QMAKE_LIBDIR += ../qextserialport/src/build -include(../qextserialport/src/qextserialport.pri) - -QMAKE_CXXFLAGS += -std=gnu++0x - # QMAKE_CXXFLAGS +=-std=c++0x win32 { - # version resource and appicon. - RC_FILE = rpi2iec.rc - OBJPRE = win - # Add this for static linking of mingw libs. Note: Needs static Qt version. - # QMAKE_LFLAGS += -static-libgcc -static-libstdc++ -static + # Multiple build processes. + QMAKE_CXXFLAGS += /MP + # version resource and appicon. + RC_FILE = rpi2iec.rc + OBJPRE = win + # Add this for static linking of mingw libs. Note: Needs static Qt version. + # QMAKE_LFLAGS += -static-libgcc -static-libstdc++ -static +} + +!win32 { + QMAKE_CXXFLAGS += -std=gnu++0x } unix { - OBJPRE = nix + OBJPRE = nix } # To compile for Raspberry PI, run qmake with the flags: CONFIG+=raspberry raspberry { - # So wiringPi include files can be found during compile - INCLUDEPATH += /usr/local/include - # To link the wiringPi library when making the executable - LIBS += -L/usr/local/lib -lwiringPi - # To conditionally compile wiringPi so that it still builds on other platforms. - DEFINES += "HAS_WIRINGPI=" - - OBJPRE = pi + # So wiringPi include files can be found during compile + INCLUDEPATH += /usr/local/include + # To link the wiringPi library when making the executable + LIBS += -L/usr/local/lib -lwiringPi + # To conditionally compile wiringPi so that it still builds on other platforms. + DEFINES += "HAS_WIRINGPI=" + + OBJPRE = pi } #raspberry mac { - OBJPRE = mac + OBJPRE = mac } SOURCES += main.cpp\ - mainwindow.cpp \ - t64driver.cpp \ - m2idriver.cpp \ - d64driver.cpp \ - filedriverbase.cpp \ - interface.cpp \ - nativefs.cpp \ - logger.cpp \ - x00fs.cpp \ - aboutdialog.cpp \ - settingsdialog.cpp \ - doscommands.cpp \ - x64driver.cpp \ - logfiltersetup.cpp \ - qcmdtextedit.cpp \ - mountspecificfile.cpp + mainwindow.cpp \ + t64driver.cpp \ + m2idriver.cpp \ + d64driver.cpp \ + filedriverbase.cpp \ + interface.cpp \ + nativefs.cpp \ + logger.cpp \ + x00fs.cpp \ + aboutdialog.cpp \ + settingsdialog.cpp \ + doscommands.cpp \ + x64driver.cpp \ + logfiltersetup.cpp \ + qcmdtextedit.cpp \ + mountspecificfile.cpp HEADERS += mainwindow.hpp \ - t64driver.hpp \ - m2idriver.hpp \ - d64driver.hpp \ - filedriverbase.hpp \ - interface.hpp \ - nativefs.hpp \ - logger.hpp \ - x00fs.hpp \ - version.h \ - aboutdialog.hpp \ - settingsdialog.hpp \ - dirlistthemingconsts.hpp \ - doscommands.hpp \ - uno2iec/cbmdefines.h \ - x64driver.hpp \ - logfiltersetup.hpp \ - qcmdtextedit.h \ - mountspecificfile.h \ - utils.hpp + t64driver.hpp \ + m2idriver.hpp \ + d64driver.hpp \ + filedriverbase.hpp \ + interface.hpp \ + nativefs.hpp \ + logger.hpp \ + x00fs.hpp \ + version.h \ + aboutdialog.hpp \ + settingsdialog.hpp \ + dirlistthemingconsts.hpp \ + doscommands.hpp \ + uno2iec/cbmdefines.h \ + x64driver.hpp \ + logfiltersetup.hpp \ + qcmdtextedit.h \ + mountspecificfile.h \ + utils.hpp FORMS += mainwindow.ui \ - aboutdialog.ui \ - settingsdialog.ui \ - logfiltersetup.ui \ - mountspecificfile.ui + aboutdialog.ui \ + settingsdialog.ui \ + logfiltersetup.ui \ + mountspecificfile.ui OTHER_FILES += \ - changes.txt \ - notes.txt \ - README.TXT \ - rpi2iec.rc \ - icons/ok.png \ - icons/arrow_refresh.png \ - icons/browse.png \ - icons/cancel.png \ - icons/clear.png \ - icons/exit.png \ - icons/filter.png \ - icons/floppy_mount.png \ - icons/floppy_unmount.png \ - icons/html.png \ - icons/pause.png \ - icons/restart.png \ - icons/save.png \ - icons/settings.png \ - icons/theme.png \ - icons/1541.ico \ - other/dos1541 \ - fonts/PetMe2X.ttf \ - fonts/PetMe64.ttf \ - fonts/PetMe1282Y.ttf + changes.txt \ + notes.txt \ + README.TXT \ + rpi2iec.rc \ + icons/ok.png \ + icons/arrow_refresh.png \ + icons/browse.png \ + icons/cancel.png \ + icons/clear.png \ + icons/exit.png \ + icons/filter.png \ + icons/floppy_mount.png \ + icons/floppy_unmount.png \ + icons/html.png \ + icons/pause.png \ + icons/restart.png \ + icons/save.png \ + icons/settings.png \ + icons/theme.png \ + icons/1541.ico \ + other/dos1541 \ + fonts/PetMe2X.ttf \ + fonts/PetMe64.ttf \ + fonts/PetMe1282Y.ttf RESOURCES += \ - resources.qrc + resources.qrc @@ -131,9 +128,9 @@ RESOURCES += \ # Reason is not getting compile errors when switching from building under one platform to another. # Object file formats are different. We don't want to mix release and debug either. CONFIG(debug, debug|release) { - REL = debug + REL = debug } else { - REL = release + REL = release } OBJECTS_DIR = $$quote($${REL}/.obj$${OBJPRE}) diff --git a/settingsdialog.cpp b/settingsdialog.cpp index ecebe1b..a08d489 100755 --- a/settingsdialog.cpp +++ b/settingsdialog.cpp @@ -1,15 +1,16 @@ #include +#include #include "settingsdialog.hpp" #include "ui_settingsdialog.h" -SettingsDialog::SettingsDialog(QextPortInfoList& ports, AppSettings& settings, QWidget *parent) : +SettingsDialog::SettingsDialog(QPortInfoList& ports, AppSettings& settings, QWidget *parent) : QDialog(parent), ui(new Ui::SettingsDialog), m_settings(settings), m_borderValidator(0, 100, this) { ui->setupUi(this); - foreach(QextPortInfo info, ports) - ui->comPort->addItem(info.friendName); + foreach(QSerialPortInfo info, ports) + ui->comPort->addItem(info.portName()); ui->comPort->setCurrentIndex(ui->comPort->findText(m_settings.portName)); ui->baudRate->setCurrentIndex(ui->baudRate->findText(QString::number(m_settings.baudRate))); diff --git a/settingsdialog.hpp b/settingsdialog.hpp index e09e46e..7246eef 100755 --- a/settingsdialog.hpp +++ b/settingsdialog.hpp @@ -5,9 +5,9 @@ #include #include -#include "qextserialenumerator.h" +#include -typedef QList QextPortInfoList; +typedef QList QPortInfoList; namespace Ui { class SettingsDialog; @@ -39,7 +39,7 @@ class SettingsDialog : public QDialog Q_OBJECT public: - explicit SettingsDialog(QextPortInfoList& ports, AppSettings& settings, QWidget *parent = 0); + explicit SettingsDialog(QPortInfoList& ports, AppSettings& settings, QWidget *parent = 0); ~SettingsDialog(); private slots: