From 63e092a53039140d2a5e04192b83fcd83384cfda Mon Sep 17 00:00:00 2001 From: Indy970 Date: Sun, 10 Feb 2019 20:23:04 +0200 Subject: [PATCH] General Update --- hp_infodialog.ui | 12 ++++++++++++ hptreeitem.cpp | 22 ++++++++++++---------- hpusb.cpp | 15 +-------------- treemodel.cpp | 3 +++ 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/hp_infodialog.ui b/hp_infodialog.ui index b61ef1b..0ada13f 100644 --- a/hp_infodialog.ui +++ b/hp_infodialog.ui @@ -13,6 +13,12 @@ 126 + + + 0 + 0 + + HP Prime Data @@ -20,6 +26,12 @@ :/icons/about_32x32.png:/icons/about_32x32.png + + QFrame::WinPanel + + + QFrame::Sunken + diff --git a/hptreeitem.cpp b/hptreeitem.cpp index 64d31f1..3b5d777 100644 --- a/hptreeitem.cpp +++ b/hptreeitem.cpp @@ -108,12 +108,18 @@ void hpTreeItem::clickAction(QMdiArea * mdiwin) { // test=data(Qt::DisplayRole).toString(); switch (getType()) { - case HP_APP: - hpCalcData * dataStore; - dataStore = getDataStore(); - hpinfo=dataStore->getInfo(); - hpinfodlg = new hp_infoDialog(hpinfo,0); - hpinfodlg->show(); + case HP_MAIN: { + hpCalcData * dataStore; + dataStore = getDataStore(); + hpinfo=dataStore->getInfo(); + hpinfodlg = new hp_infoDialog(hpinfo,0); + hpinfodlg->move(700,400); + hpinfodlg->show(); + } + break; + case HP_APP: { + + } break; case HP_CAS: if (hpvaredit==nullptr) @@ -208,15 +214,11 @@ void hpTreeItem::dataChange(hp_Change hpchange) { hpCalcData * ptr=nullptr; QString name; - qDebug()<<"In data Change"; switch (hpchange.dataChange) { case HP_MAIN: - qDebug()<<"test"; ptr=getDataStore(); - qDebug()<<"past test"; if (ptr) { name=ptr->getName(); - qDebug()<<"get name"; setData(name,Qt::DisplayRole); } break; diff --git a/hpusb.cpp b/hpusb.cpp index bcc27d1..bfdb8fc 100644 --- a/hpusb.cpp +++ b/hpusb.cpp @@ -174,11 +174,10 @@ int hpusb::submit_sync_transfer(hp_Handle * handle, hp_pkt_in * pktin, hp_pkt_ou &trans,10000); log(QString().sprintf("Write Error: %s\n", libusb_error_name(ret))); - log(QString().sprintf("Write bytes: %d\n", trans)); //read - log("Recieve..."); + log("Recieve..."); ret = libusb_interrupt_transfer(devh,0x81,pktout->buffer,pktout->size-8,&trans,10000); log(QString().sprintf("read: %d\n", trans)); @@ -401,25 +400,16 @@ int hpusb::load_info(hp_Handle * handle, hp_Information * hpinfo) { log("unpacking data"); int ind=0; - qDebug()<<"start"; QTextCodec * codec = QTextCodec::codecForName("UTF-8"); QByteArray rd= QByteArray(reinterpret_cast(pktout.buffer), pktout.size); //find name ind=rd.indexOf(QChar(0x6c),0)+1; QByteArray str1 =rd.mid(ind,64); - qDebug()<toUnicode(str1); hpinfo->name=name; - qDebug()<toUnicode(str1); hpinfo->serialnum=serial; - qDebug()<toUnicode(str1); //hpinfo->appver=app; - qDebug()<setType(HP_MAIN); + hpCalc->setIcon(QIcon(":/icons/monitor_32x32.png")); + hpCalc->setToolTip(QString("Calculator contents")); QObject::connect(hpData, SIGNAL(dataChanged(hp_Change)),hpCalc, SLOT(dataChange(hp_Change))); setHpCalcData(name,hpData,hpCalc); rootNode->appendRow(hpCalc);