focus main input widget when bringing up creator bar (Fixes #2514)

test
Marc Zinnschlag 10 years ago
parent 0bf28a6eab
commit d873c2c603

@ -40,6 +40,9 @@ namespace CSVWorld
/// Default implementation: Throw an exception if scope!=Scope_Content.
virtual void setScope (unsigned int scope);
/// Focus main input widget
virtual void focus() = 0;
signals:
void done();

@ -225,6 +225,11 @@ void CSVWorld::GenericCreator::toggleWidgets(bool active)
{
}
void CSVWorld::GenericCreator::focus()
{
mId->setFocus();
}
void CSVWorld::GenericCreator::setScope (unsigned int scope)
{
mScopes = scope;

@ -101,6 +101,9 @@ namespace CSVWorld
virtual void setScope (unsigned int scope);
/// Focus main input widget
virtual void focus();
private slots:
void textChanged (const QString& text);

@ -91,6 +91,11 @@ std::string CSVWorld::InfoCreator::getErrors() const
return errors;
}
void CSVWorld::InfoCreator::focus()
{
mTopic->setFocus();
}
void CSVWorld::InfoCreator::topicChanged()
{
update();

@ -35,7 +35,10 @@ namespace CSVWorld
virtual std::string getErrors() const;
///< Return formatted error descriptions for the current state of the creator. if an empty
/// string is returned, there is no error.
/// Focus main input widget
virtual void focus();
private slots:
void topicChanged();

@ -118,6 +118,11 @@ std::string CSVWorld::ReferenceCreator::getErrors() const
return errors;
}
void CSVWorld::ReferenceCreator::focus()
{
mCell->setFocus();
}
void CSVWorld::ReferenceCreator::cellChanged()
{
update();

@ -39,6 +39,9 @@ namespace CSVWorld
///< Return formatted error descriptions for the current state of the creator. if an empty
/// string is returned, there is no error.
/// Focus main input widget
virtual void focus();
private slots:
void cellChanged();

@ -157,6 +157,7 @@ void CSVWorld::TableBottomBox::createRequest()
mLayout->setCurrentWidget (mCreator);
setVisible (true);
mCreating = true;
mCreator->focus();
}
void CSVWorld::TableBottomBox::cloneRequest(const std::string& id,
@ -168,4 +169,5 @@ void CSVWorld::TableBottomBox::cloneRequest(const std::string& id,
mCreator->toggleWidgets(false);
setVisible (true);
mCreating = true;
mCreator->focus();
}

Loading…
Cancel
Save