} else
w->show();
- w->setFocus();
+ if (wantInitialFocus())
+ w->setFocus();
+ else
+ lyxview_->setFocus();
}
/// Create the dialog if necessary, update it and display it.
void showView();
+ /// Decide wether the dialog should grab thekeyboard focus when shown.
+ /// This method defaults to true, override if a different behaviour
+ /// is wanted.
+ virtual bool wantInitialFocus() const { return true; }
+
/// Update the display of the dialog whilst it is still visible.
virtual void updateView() = 0;
bool initialiseParams(std::string const & data);
void updateView();
void enableView(bool enable);
+ bool wantInitialFocus() const { return false; }
public:
/// clean-up on hide.
void enableView(bool enable);
void saveSession() const;
void restoreSession();
+ bool wantInitialFocus() const { return false; }
///@}
/// The title displayed by the dialog reflects source type.