Conversation
I haven't removed the pop up message ... just wanted to hear from you guys if this could be a way to notify the user |
@numeron5 that style of notification works IMO. But for a more general notification system it may not work as well since the space is limited and other UIs in Freeseer have different layouts. But leave it as is until we hear more feedback from others. |
@@ -91,6 +91,10 @@ def __init__(self, profile, config): | |||
self.timer = QtCore.QTimer(self) | |||
self.timer.timeout.connect(self.update_timer) | |||
|
|||
# Set variables for Warning message | |||
self.warning_message_off = 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.
This variable name can be improved IMO. It's a bit confusing because a "positive" value (True) is being assigned to a "negative" flag (off). Something such as display_warning_message = False
is easier to read. It's usually better to use the "positive" option for flags or conditionals, it's easier to read.
FYI, it may seem pedantic pointing out stuff like this, but good naming makes a codebase much easier to understand. Related: http://programmers.stackexchange.com/a/41850/14467
I like the mockup. Don't worry about adding a notification to the configuration tool or the talk editor. I don't think notifications make sense in those UIs. |
self.display_warning_message = False | ||
if not self.display_warning_message and ((self.remaining_disk_space[1] == 'GB' and \ | ||
float(self.remaining_disk_space[0]) < self.low_space_threshold) or \ | ||
(self.remaining_disk_space[1] == 'MB' or self.remaining_disk_space[1] == 'KB')): |
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.
Consider using intermediate variables to store the parts of the condition.
I think you have Disk Space and Error notification issues combined in this one pull request. To be honest I would prefer if you made them separate pull requests. If we can get the Notification issue resolved quickly and merged in you can then use it as a base for your Disk Space issue. How about we up the priority of this bug and try to get this resolved quickly since I think a few projects depend on this. What do you think? |
I agree, sorry about that. I removed the warning message code. I will commit to it's corresponding branch as soon as I merge. |
Can you rebase? You have files in code review that is not part of your project. This is likely because you merged rather than rebased. |
As it stands right now, your
This will also allow you to remove a lot of the notification logic from the GUI code. |
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
|
||
class NotificationList: |
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.
You might want to look at python queue implementation.
I believe I made a mistake ... sorry |
@@ -0,0 +1,30 @@ | |||
#!/usr/bin/python | |||
# -*- coding: utf-8 -*- |
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.
Where's the license header?
To be honest I was expecting the implementation to allow the display of multiple WARNING messages and ERROR messages as we've discussed numerous times. This was the whole reason I requested that you created a Notification Queue so that we could store multiple notifications at the same time. It's great that you were able to implement this queue but I think you completely missed the purpose of this queue which would enable you the ability to display multiple notifications at the same time. Personally for the UI component I would create a new QWidget, this would be a basic container which can hold multiple QLabels, each QLabel corresponding to a notification. With this you will be able to display multiple notifications at the same time. The QLabels will need to be created dynamically at runtime. At runtime you will likely store some sort of key:value pair kinda list (I'm not sure how so you'll have to research what the best option is) which allows you to link a notification from the Queue back to the UI component it represents. This list will allow you to delete notifications that are no longer valid. Hope this helps. |
|
||
# freeseer - vga/presentation capture software | ||
# | ||
# Copyright (C) 2011, 2014 Free and Open Source Software Learning Centre |
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 file is new, so the copyright should only be 2014, not 2011 to 2014.
…eseer starts recording below the threshold. - added notifications bar to record GUI in order to display warnings and errors to the user
…FreeseerApp, added call bacl functions
ok, at the moment I have a QWidget that stores all the notifications. The QWidget is not resizeable and the user is allowed to close it (this is not ideal but at the moment but, I just want a bit of feedback before polishing up the widget). It has two buttons, and up and down button which allows the user to traverse the notification queue. I've done the implementation so that, only the add_warning, add_error and delete_notification methods should be used on the front end side. I've only debugged the addition and deletion of warnings. I'll finish debugging the addition and deletion of errors tomorrow. |
So you went from having a somewhat modular frontend/backend to having all your code in a bloated frontend component? It would be better if the notification system and presentation were separate. |
self.update() | ||
|
||
def add_error(self, name, message): | ||
self.n_manager[name] = message |
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 happens if I re-use the name of an existing error or warning? Wouldn't it get overwritten?
What reasoning do you have for using an |
|
|
Thanks for the diagrams @numeron5. I'll take a better look at it tomorrow and leave some feedback. |
I've created a new pull request where the implementation of the notification system uses observer pattern. link to the new pull request: #530 |
adding notifications bar