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:
Vadim Kurland
2011-06-20 17:18:26 -07:00
parent 52fcfe3243
commit cebdfc5111
4 changed files with 15 additions and 5 deletions
+1 -1
View File
@@ -1483,7 +1483,7 @@ ObjectTreeView* ObjectManipulator::getCurrentObjectTree()
void ObjectManipulator::openLib(FWObject *obj)
{
openObjectInTree(obj->getLibrary(),false);
openObjectInTree(obj->getLibrary(), false);
}
void ObjectManipulator::newObject()
+8 -4
View File
@@ -555,13 +555,17 @@ void ObjectManipulator::loadObjects()
addLib( lib );
if (fwbdebug) qDebug("ObjectManipulator::loadObjects %p added lib %s",
this, lib->getName().c_str());
if (fwbdebug)
qDebug() << "ObjectManipulator::loadObjects"
<< this << "added lib" << lib->getName().c_str();
}
if (firstUserLib==NULL) firstUserLib=ll.front();
if (firstUserLib==NULL) firstUserLib = ll.front();
openLib( firstUserLib );
if (fwbdebug) qDebug("ObjectManipulator::loadObjects %p done", this);
if (fwbdebug)
qDebug() << "ObjectManipulator::loadObjects done" << this;
}
void ObjectManipulator::addLib(FWObject *lib)
+2
View File
@@ -55,6 +55,7 @@
#include "LibExportDialog.h"
#include "longTextDialog.h"
#include "FWBTree.h"
#include "ObjectTreeView.h"
#include <QtDebug>
#include <QMdiSubWindow>
@@ -972,6 +973,7 @@ void ProjectPanel::loadStandardObjects()
setupAutoSave();
time_t last_modified = objdb->getTimeLastModified();
if (fwbdebug)
qDebug("ProjectPanel::load(): done last_modified=%s dirty=%d",
ctime(&last_modified), objdb->isDirty());
+4
View File
@@ -33,6 +33,7 @@
#include "FWBSettings.h"
#include "RCS.h"
#include "RuleSetView.h"
#include "ObjectTreeView.h"
#include <QtDebug>
#include <QMdiSubWindow>
@@ -322,10 +323,13 @@ void ProjectPanel::loadLastOpenedLib()
if (last_lib_id > 0 && last_lib_id != FWObjectDatabase::DELETED_OBJECTS_ID)
{
m_panel->om->libChangedById(last_lib_id);
m_panel->om->getCurrentObjectTree()->setFocus(Qt::OtherFocusReason);
return;
}
}
loadFirstNonStandardLib();
m_panel->om->getCurrentObjectTree()->setFocus(Qt::OtherFocusReason);
}
void ProjectPanel::loadFirstNonStandardLib()