File tree Expand file tree Collapse file tree 2 files changed +25
-13
lines changed
Expand file tree Collapse file tree 2 files changed +25
-13
lines changed Original file line number Diff line number Diff line change @@ -393,23 +393,35 @@ void mbCoreUi::menuSlotDeviceExport()
393393
394394void ::mbCoreUi::menuSlotDataViewItemNew ()
395395{
396- mbCoreDataView *wl = m_dataViewManager-> activeDataViewCore ( );
397- if (wl )
396+ MBSETTINGS p = dialogsCore ()-> getDataViewItem ( MBSETTINGS (), " New Item(s) " );
397+ if (p. count () )
398398 {
399- MBSETTINGS p = dialogsCore ()->getDataViewItem (MBSETTINGS (), " New Item(s)" );
400- if (p.count ())
399+ const mbCoreDataViewItem::Strings &sItem = mbCoreDataViewItem::Strings::instance ();
400+ int count = p.value (mbCoreDialogDataViewItem::Strings::instance ().count ).toInt ();
401+ if (count > 0 )
401402 {
402- const mbCoreDataViewItem::Strings &sItem = mbCoreDataViewItem::Strings::instance ();
403- int count = p.value (mbCoreDialogDataViewItem::Strings::instance ().count ).toInt ();
404- if (count > 0 )
403+ mbCoreDataView *wl = m_dataViewManager->activeDataViewCore ();
404+ if (!wl)
405405 {
406- for (int i = 0 ; i < count; i++)
406+ QList<mbCoreDataViewUi*> ls = m_dataViewManager->dataViewUisCore ();
407+ if (ls.count ())
408+ wl = ls.first ()->dataViewCore ();
409+ else
407410 {
408- mbCoreDataViewItem *item = builderCore ()->newDataViewItem ();
409- item->setSettings (p);
410- wl->itemAdd (item);
411- p[sItem .address ] = item->addressInt () + item->length ();
411+ mbCoreProject *project = baseCore ()->projectCore ();
412+ if (!project)
413+ return ;
414+ wl = m_builder->newDataView ();
415+ project->dataViewAdd (wl);
412416 }
417+
418+ }
419+ for (int i = 0 ; i < count; i++)
420+ {
421+ mbCoreDataViewItem *item = builderCore ()->newDataViewItem ();
422+ item->setSettings (p);
423+ wl->itemAdd (item);
424+ p[sItem .address ] = item->addressInt () + item->length ();
413425 }
414426 }
415427 }
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ protected Q_SLOTS:
138138 virtual void menuSlotDeviceImport ();
139139 virtual void menuSlotDeviceExport ();
140140 // ----------------------------
141- // ---------WATCH LIST- --------
141+ // --------- DATA VIEW --------
142142 // ----------------------------
143143 virtual void menuSlotDataViewItemNew ();
144144 virtual void menuSlotDataViewItemEdit ();
You can’t perform that action at this time.
0 commit comments