Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vmj-qt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
vmj-qt
Commits
dacb83d2
Commit
dacb83d2
authored
Jan 14, 2013
by
Dan Pascu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not unnecessarily instantiate the NotificationCenter
parent
163de5a7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
20 deletions
+11
-20
contacts.py
blink/contacts.py
+2
-4
mainwindow.py
blink/mainwindow.py
+2
-3
preferences.py
blink/preferences.py
+2
-3
sessions.py
blink/sessions.py
+5
-10
No files found.
blink/contacts.py
View file @
dacb83d2
...
...
@@ -332,8 +332,7 @@ class GoogleContactsManager(object):
def
_NH_SIPApplicationWillStart
(
self
,
notification
):
settings
=
SIPSimpleSettings
()
notification_center
=
NotificationCenter
()
notification_center
.
add_observer
(
self
,
name
=
'CFGSettingsObjectDidChange'
,
sender
=
settings
)
notification
.
center
.
add_observer
(
self
,
name
=
'CFGSettingsObjectDidChange'
,
sender
=
settings
)
authorization_token
=
settings
.
google_contacts
.
authorization_token
if
authorization_token
:
call_in_gui_thread
(
self
.
contact_model
.
addGroup
,
self
.
contact_model
.
google_contacts_group
)
...
...
@@ -342,8 +341,7 @@ class GoogleContactsManager(object):
self
.
remove_group
()
def
_NH_SIPApplicationWillEnd
(
self
,
notification
):
notification_center
=
NotificationCenter
()
notification_center
.
remove_observer
(
self
,
name
=
'CFGSettingsObjectDidChange'
,
sender
=
SIPSimpleSettings
())
notification
.
center
.
remove_observer
(
self
,
name
=
'CFGSettingsObjectDidChange'
,
sender
=
SIPSimpleSettings
())
if
self
.
greenlet
is
not
None
:
api
.
kill
(
self
.
greenlet
,
api
.
GreenletExit
())
...
...
blink/mainwindow.py
View file @
dacb83d2
...
...
@@ -542,9 +542,8 @@ class MainWindow(base_class, ui_class):
def
_NH_SIPApplicationDidStart
(
self
,
notification
):
self
.
load_audio_devices
()
notification_center
=
NotificationCenter
()
notification_center
.
add_observer
(
self
,
name
=
'CFGSettingsObjectDidChange'
)
notification_center
.
add_observer
(
self
,
name
=
'AudioDevicesDidChange'
)
notification
.
center
.
add_observer
(
self
,
name
=
'CFGSettingsObjectDidChange'
)
notification
.
center
.
add_observer
(
self
,
name
=
'AudioDevicesDidChange'
)
def
_NH_AudioDevicesDidChange
(
self
,
notification
):
for
action
in
self
.
output_device_menu
.
actions
():
...
...
blink/preferences.py
View file @
dacb83d2
...
...
@@ -1276,9 +1276,8 @@ class PreferencesWindow(base_class, ui_class):
def
_NH_SIPApplicationDidStart
(
self
,
notification
):
self
.
_sync_defaults
()
self
.
load_settings
()
notification_center
=
NotificationCenter
()
notification_center
.
add_observer
(
self
,
name
=
'AudioDevicesDidChange'
)
notification_center
.
add_observer
(
self
,
name
=
'CFGSettingsObjectDidChange'
)
notification
.
center
.
add_observer
(
self
,
name
=
'AudioDevicesDidChange'
)
notification
.
center
.
add_observer
(
self
,
name
=
'CFGSettingsObjectDidChange'
)
def
_NH_AudioDevicesDidChange
(
self
,
notification
):
self
.
load_audio_devices
()
...
...
blink/sessions.py
View file @
dacb83d2
...
...
@@ -427,8 +427,7 @@ class SessionItem(QObject):
digit_map
=
{
'*'
:
'star'
}
filename
=
'sounds/dtmf_
%
s_tone.wav'
%
digit_map
.
get
(
notification
.
data
.
digit
,
notification
.
data
.
digit
)
player
=
WavePlayer
(
SIPApplication
.
voice_audio_bridge
.
mixer
,
Resources
.
get
(
filename
))
notification_center
=
NotificationCenter
()
notification_center
.
add_observer
(
self
,
sender
=
player
)
notification
.
center
.
add_observer
(
self
,
sender
=
player
)
SIPApplication
.
voice_audio_bridge
.
add
(
player
)
player
.
start
()
...
...
@@ -440,8 +439,7 @@ class SessionItem(QObject):
def
_NH_DNSLookupDidSucceed
(
self
,
notification
):
settings
=
SIPSimpleSettings
()
notification_center
=
NotificationCenter
()
notification_center
.
remove_observer
(
self
,
sender
=
notification
.
sender
)
notification
.
center
.
remove_observer
(
self
,
sender
=
notification
.
sender
)
if
self
.
pending_removal
:
return
streams
=
[]
...
...
@@ -459,8 +457,7 @@ class SessionItem(QObject):
self
.
session
.
connect
(
ToHeader
(
self
.
uri
),
routes
,
streams
)
def
_NH_DNSLookupDidFail
(
self
,
notification
):
notification_center
=
NotificationCenter
()
notification_center
.
remove_observer
(
self
,
sender
=
notification
.
sender
)
notification
.
center
.
remove_observer
(
self
,
sender
=
notification
.
sender
)
if
self
.
pending_removal
:
return
self
.
audio_stream
=
None
...
...
@@ -632,12 +629,10 @@ class SessionItem(QObject):
self
.
_cleanup
()
def
_NH_WavePlayerDidFail
(
self
,
notification
):
notification_center
=
NotificationCenter
()
notification_center
.
remove_observer
(
self
,
sender
=
notification
.
sender
)
notification
.
center
.
remove_observer
(
self
,
sender
=
notification
.
sender
)
def
_NH_WavePlayerDidEnd
(
self
,
notification
):
notification_center
=
NotificationCenter
()
notification_center
.
remove_observer
(
self
,
sender
=
notification
.
sender
)
notification
.
center
.
remove_observer
(
self
,
sender
=
notification
.
sender
)
class
Conference
(
object
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment