started modifying ui
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
TARGET = "HIDBootloader"
|
||||
TARGET = "pic_fw_flash_tool"
|
||||
TEMPLATE = app
|
||||
QT += sql
|
||||
QT += widgets
|
||||
|
||||
@@ -99,18 +99,11 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
||||
ui->setupUi(this);
|
||||
setWindowTitle(APPLICATION + QString(" v") + VERSION);
|
||||
|
||||
ui->menuBar->setVisible(false);
|
||||
ui->mainToolBar->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
|
||||
|
||||
QSettings settings;
|
||||
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();
|
||||
|
||||
@@ -377,7 +370,7 @@ void MainWindow::setBootloadEnabled(bool enable)
|
||||
ui->actionWrite_Device->setEnabled(enable && hexOpen);
|
||||
ui->actionExit->setEnabled(enable);
|
||||
ui->action_Verify_Device->setEnabled(enable && hexOpen);
|
||||
ui->actionOpen->setEnabled(enable);
|
||||
//ui->actionOpen->setEnabled(enable);
|
||||
ui->actionBlank_Check->setEnabled(enable && !writeConfig);
|
||||
ui->actionReset_Device->setEnabled(enable);
|
||||
}
|
||||
@@ -400,17 +393,12 @@ void MainWindow::setBootloadBusy(bool busy)
|
||||
ui->actionWrite_Device->setEnabled(!busy && hexOpen);
|
||||
ui->actionExit->setEnabled(!busy);
|
||||
ui->action_Verify_Device->setEnabled(!busy && hexOpen);
|
||||
ui->actionOpen->setEnabled(!busy);
|
||||
ui->btnFwBrowse->setEnabled(!busy);
|
||||
ui->action_Settings->setEnabled(!busy);
|
||||
ui->actionBlank_Check->setEnabled(!busy && !writeConfig);
|
||||
ui->actionReset_Device->setEnabled(!busy);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionExit_triggered()
|
||||
{
|
||||
QApplication::exit();
|
||||
}
|
||||
|
||||
void MainWindow::IoWithDeviceStart(QString 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.
|
||||
void MainWindow::on_actionOpen_triggered()
|
||||
void MainWindow::on_btnFwBrowse_clicked()
|
||||
{
|
||||
QString msg, newFileName;
|
||||
QTextStream stream(&msg);
|
||||
@@ -1354,6 +1342,7 @@ void MainWindow::GetQuery()
|
||||
case Device::PIC16:
|
||||
device->bytesPerWordFLASH = 2;
|
||||
device->bytesPerAddressFLASH = 2;
|
||||
break;
|
||||
default:
|
||||
device->bytesPerWordFLASH = 2;
|
||||
device->bytesPerAddressFLASH = 1;
|
||||
|
||||
@@ -122,9 +122,8 @@ private slots:
|
||||
void on_action_Verify_Device_triggered();
|
||||
void on_action_About_triggered();
|
||||
void on_actionWrite_Device_triggered();
|
||||
void on_actionOpen_triggered();
|
||||
void on_btnFwBrowse_clicked();
|
||||
void on_actionErase_Device_triggered();
|
||||
void on_actionExit_triggered();
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>439</width>
|
||||
<height>403</height>
|
||||
<height>653</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -24,25 +24,181 @@
|
||||
<normaloff>:/MainWindow/img/Microchip_logo.Ico</normaloff>:/MainWindow/img/Microchip_logo.Ico</iconset>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralWidget">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QProgressBar" name="progressBar">
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="textVisible">
|
||||
<bool>false</bool>
|
||||
<property name="text">
|
||||
<string>Select Firmware File</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<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>
|
||||
</widget>
|
||||
</item>
|
||||
<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">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
@@ -55,6 +211,90 @@
|
||||
</property>
|
||||
</widget>
|
||||
</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>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menuBar">
|
||||
@@ -63,18 +303,13 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>439</width>
|
||||
<height>19</height>
|
||||
<height>26</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
<property name="title">
|
||||
<string>&File</string>
|
||||
</property>
|
||||
<addaction name="actionOpen"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionExit"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuProgrammer">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>&Program</string>
|
||||
</property>
|
||||
@@ -93,7 +328,6 @@
|
||||
</property>
|
||||
<addaction name="action_About"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuProgrammer"/>
|
||||
<addaction name="menu_Help"/>
|
||||
</widget>
|
||||
@@ -114,7 +348,6 @@
|
||||
<attribute name="toolBarBreak">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<addaction name="actionOpen"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionWrite_Device"/>
|
||||
<addaction name="action_Verify_Device"/>
|
||||
@@ -122,32 +355,6 @@
|
||||
<addaction name="actionBlank_Check"/>
|
||||
<addaction name="actionReset_Device"/>
|
||||
</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>&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&xit</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+Q</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionWrite_Device">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
QCoreApplication::setOrganizationName("Microchip");
|
||||
QCoreApplication::setOrganizationDomain("microchip.com");
|
||||
QCoreApplication::setApplicationName("USB HID Bootloader");
|
||||
QCoreApplication::setOrganizationName("JOJCorp");
|
||||
QCoreApplication::setOrganizationDomain("source.jojcorp.com");
|
||||
QCoreApplication::setApplicationName("Dancepad Interface FW Flash Tool");
|
||||
|
||||
MainWindow w;
|
||||
w.show();
|
||||
|
||||
Reference in New Issue
Block a user