mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-19 09:47:20 +01:00
see #2500 object tree should have keyboard focus when new file is opened or new blank project window is created
This commit is contained in:
parent
52fcfe3243
commit
cebdfc5111
@ -1483,7 +1483,7 @@ ObjectTreeView* ObjectManipulator::getCurrentObjectTree()
|
|||||||
|
|
||||||
void ObjectManipulator::openLib(FWObject *obj)
|
void ObjectManipulator::openLib(FWObject *obj)
|
||||||
{
|
{
|
||||||
openObjectInTree(obj->getLibrary(),false);
|
openObjectInTree(obj->getLibrary(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectManipulator::newObject()
|
void ObjectManipulator::newObject()
|
||||||
|
|||||||
@ -555,13 +555,17 @@ void ObjectManipulator::loadObjects()
|
|||||||
|
|
||||||
addLib( lib );
|
addLib( lib );
|
||||||
|
|
||||||
if (fwbdebug) qDebug("ObjectManipulator::loadObjects %p added lib %s",
|
if (fwbdebug)
|
||||||
this, lib->getName().c_str());
|
qDebug() << "ObjectManipulator::loadObjects"
|
||||||
|
<< this << "added lib" << lib->getName().c_str();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (firstUserLib==NULL) firstUserLib=ll.front();
|
if (firstUserLib==NULL) firstUserLib = ll.front();
|
||||||
openLib( firstUserLib );
|
openLib( firstUserLib );
|
||||||
if (fwbdebug) qDebug("ObjectManipulator::loadObjects %p done", this);
|
|
||||||
|
if (fwbdebug)
|
||||||
|
qDebug() << "ObjectManipulator::loadObjects done" << this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectManipulator::addLib(FWObject *lib)
|
void ObjectManipulator::addLib(FWObject *lib)
|
||||||
|
|||||||
@ -55,6 +55,7 @@
|
|||||||
#include "LibExportDialog.h"
|
#include "LibExportDialog.h"
|
||||||
#include "longTextDialog.h"
|
#include "longTextDialog.h"
|
||||||
#include "FWBTree.h"
|
#include "FWBTree.h"
|
||||||
|
#include "ObjectTreeView.h"
|
||||||
|
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
#include <QMdiSubWindow>
|
#include <QMdiSubWindow>
|
||||||
@ -972,6 +973,7 @@ void ProjectPanel::loadStandardObjects()
|
|||||||
setupAutoSave();
|
setupAutoSave();
|
||||||
|
|
||||||
time_t last_modified = objdb->getTimeLastModified();
|
time_t last_modified = objdb->getTimeLastModified();
|
||||||
|
|
||||||
if (fwbdebug)
|
if (fwbdebug)
|
||||||
qDebug("ProjectPanel::load(): done last_modified=%s dirty=%d",
|
qDebug("ProjectPanel::load(): done last_modified=%s dirty=%d",
|
||||||
ctime(&last_modified), objdb->isDirty());
|
ctime(&last_modified), objdb->isDirty());
|
||||||
|
|||||||
@ -33,6 +33,7 @@
|
|||||||
#include "FWBSettings.h"
|
#include "FWBSettings.h"
|
||||||
#include "RCS.h"
|
#include "RCS.h"
|
||||||
#include "RuleSetView.h"
|
#include "RuleSetView.h"
|
||||||
|
#include "ObjectTreeView.h"
|
||||||
|
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
#include <QMdiSubWindow>
|
#include <QMdiSubWindow>
|
||||||
@ -322,10 +323,13 @@ void ProjectPanel::loadLastOpenedLib()
|
|||||||
if (last_lib_id > 0 && last_lib_id != FWObjectDatabase::DELETED_OBJECTS_ID)
|
if (last_lib_id > 0 && last_lib_id != FWObjectDatabase::DELETED_OBJECTS_ID)
|
||||||
{
|
{
|
||||||
m_panel->om->libChangedById(last_lib_id);
|
m_panel->om->libChangedById(last_lib_id);
|
||||||
|
m_panel->om->getCurrentObjectTree()->setFocus(Qt::OtherFocusReason);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
loadFirstNonStandardLib();
|
loadFirstNonStandardLib();
|
||||||
|
|
||||||
|
m_panel->om->getCurrentObjectTree()->setFocus(Qt::OtherFocusReason);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectPanel::loadFirstNonStandardLib()
|
void ProjectPanel::loadFirstNonStandardLib()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user