started modifying ui

This commit is contained in:
2019-08-17 12:33:27 -04:00
parent ac48fd350d
commit ca96a8ecb6
5 changed files with 266 additions and 71 deletions

View File

@@ -1,4 +1,4 @@
TARGET = "HIDBootloader" TARGET = "pic_fw_flash_tool"
TEMPLATE = app TEMPLATE = app
QT += sql QT += sql
QT += widgets QT += widgets

View File

@@ -99,18 +99,11 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
ui->setupUi(this); ui->setupUi(this);
setWindowTitle(APPLICATION + QString(" v") + VERSION); setWindowTitle(APPLICATION + QString(" v") + VERSION);
ui->menuBar->setVisible(false);
ui->mainToolBar->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
QSettings settings; QSettings settings;
settings.beginGroup("MainWindow"); settings.beginGroup("MainWindow");
fileName = settings.value("fileName").toString();
for(i = 0; i < MAX_RECENT_FILES; i++)
{
recentFiles[i] = new QAction(this);
connect(recentFiles[i], SIGNAL(triggered()), this, SLOT(openRecentFile()));
recentFiles[i]->setVisible(false);
ui->menuFile->insertAction(ui->actionExit, recentFiles[i]);
}
ui->menuFile->insertSeparator(ui->actionExit);
settings.endGroup(); settings.endGroup();
@@ -377,7 +370,7 @@ void MainWindow::setBootloadEnabled(bool enable)
ui->actionWrite_Device->setEnabled(enable && hexOpen); ui->actionWrite_Device->setEnabled(enable && hexOpen);
ui->actionExit->setEnabled(enable); ui->actionExit->setEnabled(enable);
ui->action_Verify_Device->setEnabled(enable && hexOpen); ui->action_Verify_Device->setEnabled(enable && hexOpen);
ui->actionOpen->setEnabled(enable); //ui->actionOpen->setEnabled(enable);
ui->actionBlank_Check->setEnabled(enable && !writeConfig); ui->actionBlank_Check->setEnabled(enable && !writeConfig);
ui->actionReset_Device->setEnabled(enable); ui->actionReset_Device->setEnabled(enable);
} }
@@ -400,17 +393,12 @@ void MainWindow::setBootloadBusy(bool busy)
ui->actionWrite_Device->setEnabled(!busy && hexOpen); ui->actionWrite_Device->setEnabled(!busy && hexOpen);
ui->actionExit->setEnabled(!busy); ui->actionExit->setEnabled(!busy);
ui->action_Verify_Device->setEnabled(!busy && hexOpen); ui->action_Verify_Device->setEnabled(!busy && hexOpen);
ui->actionOpen->setEnabled(!busy); ui->btnFwBrowse->setEnabled(!busy);
ui->action_Settings->setEnabled(!busy); ui->action_Settings->setEnabled(!busy);
ui->actionBlank_Check->setEnabled(!busy && !writeConfig); ui->actionBlank_Check->setEnabled(!busy && !writeConfig);
ui->actionReset_Device->setEnabled(!busy); ui->actionReset_Device->setEnabled(!busy);
} }
void MainWindow::on_actionExit_triggered()
{
QApplication::exit();
}
void MainWindow::IoWithDeviceStart(QString msg) void MainWindow::IoWithDeviceStart(QString msg)
{ {
ui->plainTextEdit->appendPlainText(msg); ui->plainTextEdit->appendPlainText(msg);
@@ -1044,7 +1032,7 @@ void MainWindow::EraseDevice(void)
} }
//Executes when the user clicks the open hex file button on the main form. //Executes when the user clicks the open hex file button on the main form.
void MainWindow::on_actionOpen_triggered() void MainWindow::on_btnFwBrowse_clicked()
{ {
QString msg, newFileName; QString msg, newFileName;
QTextStream stream(&msg); QTextStream stream(&msg);
@@ -1354,6 +1342,7 @@ void MainWindow::GetQuery()
case Device::PIC16: case Device::PIC16:
device->bytesPerWordFLASH = 2; device->bytesPerWordFLASH = 2;
device->bytesPerAddressFLASH = 2; device->bytesPerAddressFLASH = 2;
break;
default: default:
device->bytesPerWordFLASH = 2; device->bytesPerWordFLASH = 2;
device->bytesPerAddressFLASH = 1; device->bytesPerAddressFLASH = 1;

View File

@@ -122,9 +122,8 @@ private slots:
void on_action_Verify_Device_triggered(); void on_action_Verify_Device_triggered();
void on_action_About_triggered(); void on_action_About_triggered();
void on_actionWrite_Device_triggered(); void on_actionWrite_Device_triggered();
void on_actionOpen_triggered(); void on_btnFwBrowse_clicked();
void on_actionErase_Device_triggered(); void on_actionErase_Device_triggered();
void on_actionExit_triggered();
}; };
#endif // MAINWINDOW_H #endif // MAINWINDOW_H

View File

@@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>439</width> <width>439</width>
<height>403</height> <height>653</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@@ -24,25 +24,181 @@
<normaloff>:/MainWindow/img/Microchip_logo.Ico</normaloff>:/MainWindow/img/Microchip_logo.Ico</iconset> <normaloff>:/MainWindow/img/Microchip_logo.Ico</normaloff>:/MainWindow/img/Microchip_logo.Ico</iconset>
</property> </property>
<widget class="QWidget" name="centralWidget"> <widget class="QWidget" name="centralWidget">
<layout class="QGridLayout" name="gridLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item row="0" column="0"> <item>
<widget class="QProgressBar" name="progressBar"> <widget class="QLabel" name="label">
<property name="value"> <property name="font">
<number>0</number> <font>
<pointsize>10</pointsize>
</font>
</property> </property>
<property name="textVisible"> <property name="text">
<bool>false</bool> <string>Select Firmware File</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="txtFirmwareFile">
<property name="styleSheet">
<string notr="true">background-color: rgb(200,200,200);
color: rgb(100,100,100);</string>
</property>
<property name="text">
<string>more bingbus XD</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnFwBrowse">
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Tool Status</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QFormLayout" name="formLayout">
<property name="horizontalSpacing">
<number>40</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Firmware</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="lblStatusFirmware">
<property name="styleSheet">
<string notr="true">background-color: rgb(255, 0, 0);</string>
</property>
<property name="text">
<string>NO FW FILE LOADED</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="margin">
<number>2</number>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Device</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="lblStatusDevice">
<property name="styleSheet">
<string notr="true">background-color: rgb(255, 0, 0);</string>
</property>
<property name="text">
<string>NOT DETECTED</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="margin">
<number>2</number>
</property>
<property name="indent">
<number>-1</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Tool Operation</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line"> <widget class="Line" name="line">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item>
<widget class="QPlainTextEdit" name="plainTextEdit"> <widget class="QPlainTextEdit" name="plainTextEdit">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
@@ -55,6 +211,90 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QProgressBar" name="progressBar">
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnFlashFirmware">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>60</height>
</size>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>FLASH FIRMWARE</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnResetDevice">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>Reset Device Normally</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnResetDeviceFWUpdateMode">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>Reset Device into FW Update Mode</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QMenuBar" name="menuBar"> <widget class="QMenuBar" name="menuBar">
@@ -63,18 +303,13 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>439</width> <width>439</width>
<height>19</height> <height>26</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuFile">
<property name="title">
<string>&amp;File</string>
</property>
<addaction name="actionOpen"/>
<addaction name="separator"/>
<addaction name="actionExit"/>
</widget>
<widget class="QMenu" name="menuProgrammer"> <widget class="QMenu" name="menuProgrammer">
<property name="enabled">
<bool>true</bool>
</property>
<property name="title"> <property name="title">
<string>&amp;Program</string> <string>&amp;Program</string>
</property> </property>
@@ -93,7 +328,6 @@
</property> </property>
<addaction name="action_About"/> <addaction name="action_About"/>
</widget> </widget>
<addaction name="menuFile"/>
<addaction name="menuProgrammer"/> <addaction name="menuProgrammer"/>
<addaction name="menu_Help"/> <addaction name="menu_Help"/>
</widget> </widget>
@@ -114,7 +348,6 @@
<attribute name="toolBarBreak"> <attribute name="toolBarBreak">
<bool>false</bool> <bool>false</bool>
</attribute> </attribute>
<addaction name="actionOpen"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionWrite_Device"/> <addaction name="actionWrite_Device"/>
<addaction name="action_Verify_Device"/> <addaction name="action_Verify_Device"/>
@@ -122,32 +355,6 @@
<addaction name="actionBlank_Check"/> <addaction name="actionBlank_Check"/>
<addaction name="actionReset_Device"/> <addaction name="actionReset_Device"/>
</widget> </widget>
<action name="actionOpen">
<property name="enabled">
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/MainWindow/img/open.png</normaloff>:/MainWindow/img/open.png</iconset>
</property>
<property name="text">
<string>&amp;Import Firmware Image</string>
</property>
<property name="toolTip">
<string>Import Firmware Image</string>
</property>
<property name="shortcut">
<string>Ctrl+O</string>
</property>
</action>
<action name="actionExit">
<property name="text">
<string>E&amp;xit</string>
</property>
<property name="shortcut">
<string>Ctrl+Q</string>
</property>
</action>
<action name="actionWrite_Device"> <action name="actionWrite_Device">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>

View File

@@ -34,9 +34,9 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QApplication a(argc, argv); QApplication a(argc, argv);
QCoreApplication::setOrganizationName("Microchip"); QCoreApplication::setOrganizationName("JOJCorp");
QCoreApplication::setOrganizationDomain("microchip.com"); QCoreApplication::setOrganizationDomain("source.jojcorp.com");
QCoreApplication::setApplicationName("USB HID Bootloader"); QCoreApplication::setApplicationName("Dancepad Interface FW Flash Tool");
MainWindow w; MainWindow w;
w.show(); w.show();