Skip to content
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

bug fixes + improvements in whiteboard application #96

Merged
merged 2 commits into from
Nov 4, 2016

Conversation

ppodhajski
Copy link
Contributor

Improvements to the Whiteboard application:

  • Added freezing of the canvas/touch-area when save panel visible
  • Bug fixed on canvas extending
  • Bug fixed when multiple touch points present
  • Changed behaviour of color/brush size selector

infoBox.z = 2
infoText.text = "Are you sure? File already exists"
textInput.focus = false
butOk.visible = true
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please avoid custom, ambiguous abbreviations for variables names:
butOK -> buttonOK
butCancel -> buttonCancel

}
}
}
function saveCanvas(t) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also here, what does t stand for? Give this variable a self-explanatory name

id: areaAux
anchors.fill: parent
enabled: false
z: 0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think z = 0 by default so no need to specify that, right? (multiple occurences)

textInput.focus = true
infoBox.z = 0
area.enabled = false
areaAux.enabled = true
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all these changes should be applied by a State change, or as property bindings, whichever makes more sense



MultiPointTouchArea {
id: areaAux
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

areaAux is not a very clear name, what does it really do? Is it the savePanelBackround?

checkFileExists()
if (textInput.text == "")
Qt.inputMethod.show()

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra line here

validator: RegExpValidator {
regExp: /[\w.]*/
}
onAccepted: {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something is not correctly indented here

anchors.fill: parent
anchors.margins: 10
z: parent.z
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm expecting that this is the default behaviour

ContentFactory::getWebbrowserContent( uri ) :
ContentFactory::getPixelStreamContent( uri );

ContentPtr content;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, creating the appropriate type of Content should be the responsibility of the ContentFactory. There was already an exception with the getWebbrowserContent(), but this is becoming too many exceptions. I think we should move the StreamType to ContentType, and pass this as the second parameter to ContentFactory::getPixelStreamContent and remove getWebbrowserContent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess re-using ContentType::CONTENT_TYPE would be ok?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite... We could add a ContentType::Whiteboard, along with a matching WhiteboardContent class. But there are two use cases where we want a StreamType as a parameter, not an arbitrary ContentType: PixelStreamWindowManager::openWindow() and the new ContentFactory::getPixelStreamContent().

@@ -56,7 +56,7 @@ class PixelStreamContent : public Content
* @param uri The unique stream identifier.
* @param keyboard Show the keyboard action.
*/
explicit PixelStreamContent( const QString& uri, bool keyboard = true );
explicit PixelStreamContent( const QString& uri, bool keyboard = false );
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing corresponding changes in PixelStreamContent.cpp?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forget this comment, I read too quickly :-)

Copy link

@rdumusc rdumusc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FileInfoHelper.h has been deleted, not moved to the master lib

@@ -53,9 +53,17 @@ enum CONTENT_TYPE
CONTENT_TYPE_TEXTURE,
CONTENT_TYPE_PDF,
CONTENT_TYPE_WEBBROWSER,
CONTENT_TYPE_WHITEBOARD,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused and incomplete, remove!

#endif
if ( stream == WEBBROWSER )
{
#if TIDE_USE_QT5WEBKITWIDGETS || TIDE_USE_QT5WEBENGINE
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Leave #if macros indented to the left.
  • The idea of passing the StreamType here was also to remove the keyboard bool parameter and decide here to hide it for the whiteboards, which in turns makes the code cleaner in PixelStreamWindowManager.cpp


/** Create a Webbrowser Content (special type of PixelStream). */
static ContentPtr getWebbrowserContent( const QString& uri );
static ContentPtr getPixelStreamContent( const QString& uri, const StreamType stream = STANDARD, const bool keyboard = true );
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't specify const for pass-by-value parameters in header files

CONTENT_TYPE_IMAGE_PYRAMID
};

enum StreamType
{
STANDARD,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't forget to rebase your branch on master, this enum was modified:
https://github.com/BlueBrain/Tide/pull/97/files#diff-c5d7e3f8e70fc822ebefde7ca74b268fR57

@rdumusc rdumusc merged commit dcfae34 into BlueBrain:master Nov 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants