-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added QML whiteboard application #93
Conversation
|
||
common_application(whiteboard) | ||
if(TARGET VirtualKeyboard) | ||
add_dependencies(tideLauncher VirtualKeyboard) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you using the virtualkeyboard? I didn't see it the in the demo this morning
|
||
# Copyright (c) 2016, EPFL/Blue Brain Project | ||
# Ahmet Bilgili <ahmet.bilgili@epfl.ch> | ||
# Raphael Dumusc <raphael.dumusc@epfl.ch> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know you were called Ahmet and Raphael :-)
/*********************************************************************/ | ||
/* Copyright (c) 2016, EPFL/Blue Brain Project */ | ||
/* Raphael Dumusc <raphael.dumusc@epfl.ch> */ | ||
/* Ahmet Bilgili <ahmet.bilgili@epfl.ch> */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
/*********************************************************************/ | ||
/* Copyright (c) 2016, EPFL/Blue Brain Project */ | ||
/* Raphael Dumusc <raphael.dumusc@epfl.ch> */ | ||
/* Ahmet Bilgili <ahmet.bilgili@epfl.ch> */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dito
|
||
|
||
/** | ||
* Separate application which streams the white board using deflect::Qt API. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"the white board" -> "a whiteboard" (I think it is used as a single word in other places)
@@ -100,7 +100,7 @@ class PixelStreamWindowManager : public QObject | |||
* @param webbrowser create a webbrowser window. | |||
*/ | |||
void openWindow( const QString& uri, const QPointF& pos, const QSize& size, | |||
bool webbrowser = false ); | |||
bool webbrowser = false, bool whiteboard = false ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is starting to make too many booleans with impossible combinations (it can't be a webbrowser AND a whiteboard at the same time). Replace with an enum and also adjust the function documentation.
@@ -50,6 +50,7 @@ namespace | |||
const int DEFAULT_WEBSERVICE_PORT = 8888; | |||
const QRegExp TRIM_REGEX( "[\\n\\t\\r]" ); | |||
const QString DEFAULT_URL( "http://www.google.com" ); | |||
const QString DEFAULT_WHITEBOARD_SAVE_URL( "/tmp/whiteboard_" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why a trailing _ ?
* @return The URL defined in the configuration file, or a default value if | ||
* none is found. | ||
*/ | ||
const QString& getWhiteboardDefaultSaveURL() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getWhiteboardDefaultSaveURL() -> getWhiteboardSaveFolder ?
Please add unit tests for this new functionality in tests/cpp/core/ConfigurationTests.cpp.
@@ -108,6 +108,13 @@ class MasterConfiguration : public Configuration | |||
const QString& getWebBrowserDefaultURL() const; | |||
|
|||
/** | |||
* Get the URL used for saving whiteboard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get the folder used for saving whiteboard images
|
||
set(WHITEBOARD_LINK_LIBRARIES DeflectQt TideMaster) | ||
|
||
common_application(whiteboard) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to name it tideWhiteboard
cec34c2
to
81758a5
Compare
@@ -96,7 +96,7 @@ void PixelStreamWindowManager::showWindow( const QString& uri ) | |||
void PixelStreamWindowManager::openWindow( const QString& uri, | |||
const QPointF& pos, | |||
const QSize& size, | |||
const bool webbrowser ) | |||
StreamType stream) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const StreamType stream )
ContentFactory::getWebbrowserContent( uri ) : | ||
ContentFactory::getPixelStreamContent( uri ); | ||
ContentPtr content; | ||
if (stream == PixelStreamWindowManager::WEBBROWSER){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is javascript code style, does not match c++ style, but just leave it as it was:
ContentPtr content = (stream == PixelStreamWindowManager::WEBBROWSER) ? ContentFactory::getWebbrowserContent( uri ) :
ContentFactory::getPixelStreamContent( uri );
@@ -97,10 +105,10 @@ class PixelStreamWindowManager : public QObject | |||
* @param pos the desired position for the center of the window in pixels. | |||
* If pos.isNull(), the window is centered on the DisplayGroup. | |||
* @param size the desired size of the window in pixels. | |||
* @param webbrowser create a webbrowser window. | |||
* @param StreamType enum controls the focus of a window upon opening. WEBBROWSER creates a webbrowser window. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reveals too much about the implementation, users should not rely on the internal behaviour. Could be put more simply:
@param stream the type of window to create
void openWindow( const QString& uri, const QPointF& pos, const QSize& size, | ||
bool webbrowser = false ); | ||
|
||
void openWindow(const QString& uri, const QPointF& pos, const QSize& size, StreamType = STANDARD); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing spaces inside (), missing variable name for reference in the docstring above:
StreamType stream= STANDARD
const QString url ) | ||
{ | ||
static int webbrowserCounter = 0; | ||
const QString& uri = QString( "WebBrowser_%1" ).arg( webbrowserCounter++ ); | ||
|
||
const QSize viewportSize = !size.isEmpty() ? size : WEBBROWSER_DEFAULT_SIZE; | ||
_windowManager.openWindow( uri, pos, viewportSize, true ); | ||
const qreal x = 0.5 * _config.getTotalWidth(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this code duplicated in openWhiteboard(). Make it to a function:
QPointF PixelStreamerLauncher::_getDefaultWindowPosition() const
{
return { 0.5 * _config.getTotalWidth(), 0.35 * _config.getTotalHeight() };
}
const QPointF centerPos( x, y ); | ||
const QSize viewportSize = WHITEBOARD_DEFAULT_SIZE; | ||
|
||
_windowManager.openWindow( uri, centerPos, viewportSize, PixelStreamWindowManager::WHITEBOARD ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
80 char line length limit exceeded
options.setConfiguration( _config.getFilename( )); | ||
|
||
_processes.insert( uri ); | ||
const QString command = _getWhiteboardBin() + QString( ' ' ) + options.getCommandLine(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
80 char line length limit exceeded
2394696
to
355b806
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting there, last changes hopefully
} | ||
|
||
const QString PixelStreamerLauncher::launcherUri = QString( "Launcher" ); | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is that space doing here?
_windowManager.openWindow( uri, pos, viewportSize, true ); | ||
|
||
if ( pos.isNull() ){ | ||
pos=_getDefaultWindowPosition(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arrgggh, coding style please:
if( pos.isNull( ))
pos = _getDefaultWindowPosition();
_windowManager.openWindow( uri, centerPos, viewportSize, | ||
PixelStreamWindowManager::WHITEBOARD ); | ||
CommandLineOptions options; | ||
options.setPixelStreamerType( PS_WEBKIT ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong, the whiteboard is not a webkit. This line can be deleted.
@@ -97,10 +105,11 @@ class PixelStreamWindowManager : public QObject | |||
* @param pos the desired position for the center of the window in pixels. | |||
* If pos.isNull(), the window is centered on the DisplayGroup. | |||
* @param size the desired size of the window in pixels. | |||
* @param webbrowser create a webbrowser window. | |||
* @param stream the type of a window to create |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
of a window -> of window
#include "tide/master/MasterConfiguration.h" | ||
|
||
#include <QHostInfo> | ||
#include <QQmlContext> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those two includes are not used, remove them
c263754
to
2431296
Compare
whiteboard application integrated with launcher