-
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
bug fixes + improvements in whiteboard application #96
Conversation
ad2f0cd
to
1917508
Compare
infoBox.z = 2 | ||
infoText.text = "Are you sure? File already exists" | ||
textInput.focus = false | ||
butOk.visible = true |
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.
please avoid custom, ambiguous abbreviations for variables names:
butOK -> buttonOK
butCancel -> buttonCancel
} | ||
} | ||
} | ||
function saveCanvas(t) { |
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.
also here, what does t stand for? Give this variable a self-explanatory name
id: areaAux | ||
anchors.fill: parent | ||
enabled: false | ||
z: 0 |
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 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 |
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 all these changes should be applied by a State change, or as property bindings, whichever makes more sense
|
||
|
||
MultiPointTouchArea { | ||
id: areaAux |
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.
areaAux is not a very clear name, what does it really do? Is it the savePanelBackround?
checkFileExists() | ||
if (textInput.text == "") | ||
Qt.inputMethod.show() | ||
|
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.
extra line here
validator: RegExpValidator { | ||
regExp: /[\w.]*/ | ||
} | ||
onAccepted: { |
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.
something is not correctly indented here
anchors.fill: parent | ||
anchors.margins: 10 | ||
z: parent.z |
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'm expecting that this is the default behaviour
ContentFactory::getWebbrowserContent( uri ) : | ||
ContentFactory::getPixelStreamContent( uri ); | ||
|
||
ContentPtr content; |
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.
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.
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 guess re-using ContentType::CONTENT_TYPE would be ok?
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.
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 ); |
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 corresponding changes in PixelStreamContent.cpp?
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.
forget this comment, I read too quickly :-)
ac1be94
to
6480b7e
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.
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, |
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.
Unused and incomplete, remove!
#endif | ||
if ( stream == WEBBROWSER ) | ||
{ | ||
#if TIDE_USE_QT5WEBKITWIDGETS || TIDE_USE_QT5WEBENGINE |
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.
- 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 ); |
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.
don't specify const for pass-by-value parameters in header files
CONTENT_TYPE_IMAGE_PYRAMID | ||
}; | ||
|
||
enum 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.
don't forget to rebase your branch on master, this enum was modified:
https://github.com/BlueBrain/Tide/pull/97/files#diff-c5d7e3f8e70fc822ebefde7ca74b268fR57
210eb18
to
bfa062c
Compare
d1d77c1
to
490a321
Compare
Improvements to the Whiteboard application: