logic: improvements for IDE communication
* fixed Sublime Text plugin to correctly send messages * activate and focus Coati window when receiving a message * extended lookup range for activate token message from plugin
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
QtMainView::QtMainView()
|
||||
: m_setTitleFunctor(std::bind(&QtMainView::doSetTitle, this, std::placeholders::_1))
|
||||
, m_activateWindowFunctor(std::bind(&QtMainView::doActivateWindow, this))
|
||||
{
|
||||
m_window = std::make_shared<QtMainWindow>();
|
||||
m_window->show();
|
||||
@@ -74,7 +75,20 @@ void QtMainView::setTitle(const std::string& title)
|
||||
m_setTitleFunctor(title);
|
||||
}
|
||||
|
||||
void QtMainView::activateWindow()
|
||||
{
|
||||
m_activateWindowFunctor();
|
||||
}
|
||||
|
||||
void QtMainView::doSetTitle(const std::string& title)
|
||||
{
|
||||
m_window->setWindowTitle(QString::fromStdString(title));
|
||||
}
|
||||
|
||||
void QtMainView::doActivateWindow()
|
||||
{
|
||||
// It's platform dependent which of these commands does the right thing, for now we just use them all at once.
|
||||
m_window->activateWindow();
|
||||
m_window->raise();
|
||||
m_window->setFocus(Qt::ActiveWindowFocusReason);
|
||||
}
|
||||
|
||||
@@ -35,14 +35,17 @@ public:
|
||||
// MainView implementation
|
||||
virtual void hideStartScreen();
|
||||
virtual void setTitle(const std::string& title);
|
||||
virtual void activateWindow();
|
||||
|
||||
private:
|
||||
void doSetTitle(const std::string& title);
|
||||
void doActivateWindow();
|
||||
|
||||
std::shared_ptr<QtMainWindow> m_window;
|
||||
std::vector<View*> m_views;
|
||||
|
||||
QtThreadedFunctor<const std::string&> m_setTitleFunctor;
|
||||
QtThreadedFunctor<> m_activateWindowFunctor;
|
||||
};
|
||||
|
||||
#endif // QT_MAIN_VIEW_H
|
||||
|
||||
Reference in New Issue
Block a user