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
35e60fa6
Commit
35e60fa6
authored
Jun 29, 2010
by
Luci Stanescu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Synchronized display name field with current default account
parent
916e542f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
account.py
blink/configuration/account.py
+3
-0
mainwindow.py
blink/mainwindow.py
+23
-0
No files found.
blink/configuration/account.py
View file @
35e60fa6
...
@@ -7,6 +7,7 @@ __all__ = ['AccountExtension', 'BonjourAccountExtension']
...
@@ -7,6 +7,7 @@ __all__ = ['AccountExtension', 'BonjourAccountExtension']
from
sipsimple.account
import
PSTNSettings
from
sipsimple.account
import
PSTNSettings
from
sipsimple.configuration
import
Setting
,
SettingsGroup
,
SettingsObjectExtension
from
sipsimple.configuration
import
Setting
,
SettingsGroup
,
SettingsObjectExtension
from
sipsimple.util
import
user_info
from
blink.configuration.datatypes
import
CustomSoundFile
,
DefaultPath
from
blink.configuration.datatypes
import
CustomSoundFile
,
DefaultPath
...
@@ -23,6 +24,8 @@ class AccountExtension(SettingsObjectExtension):
...
@@ -23,6 +24,8 @@ class AccountExtension(SettingsObjectExtension):
pstn
=
PSTNSettingsExtension
pstn
=
PSTNSettingsExtension
sounds
=
SoundSettings
sounds
=
SoundSettings
display_name
=
Setting
(
type
=
str
,
default
=
user_info
.
fullname
,
nillable
=
True
)
class
BonjourAccountExtension
(
SettingsObjectExtension
):
class
BonjourAccountExtension
(
SettingsObjectExtension
):
sounds
=
SoundSettings
sounds
=
SoundSettings
...
...
blink/mainwindow.py
View file @
35e60fa6
...
@@ -83,6 +83,9 @@ class MainWindow(base_class, ui_class):
...
@@ -83,6 +83,9 @@ class MainWindow(base_class, ui_class):
self
.
add_search_contact_button
.
clicked
.
connect
(
self
.
_SH_AddContactButtonClicked
)
self
.
add_search_contact_button
.
clicked
.
connect
(
self
.
_SH_AddContactButtonClicked
)
self
.
identity
.
activated
[
int
]
.
connect
(
self
.
_SH_IdentityChanged
)
self
.
identity
.
activated
[
int
]
.
connect
(
self
.
_SH_IdentityChanged
)
self
.
identity
.
currentIndexChanged
[
int
]
.
connect
(
self
.
_SH_IdentityCurrentIndexChanged
)
self
.
display_name
.
editingFinished
.
connect
(
self
.
_SH_DisplayNameEditingFinished
)
self
.
silent_button
.
clicked
.
connect
(
self
.
_SH_SilentButtonClicked
)
self
.
silent_button
.
clicked
.
connect
(
self
.
_SH_SilentButtonClicked
)
...
@@ -200,6 +203,15 @@ class MainWindow(base_class, ui_class):
...
@@ -200,6 +203,15 @@ class MainWindow(base_class, ui_class):
active_widget
=
self
.
search_list_panel
if
self
.
contact_search_model
.
rowCount
()
else
self
.
not_found_panel
active_widget
=
self
.
search_list_panel
if
self
.
contact_search_model
.
rowCount
()
else
self
.
not_found_panel
self
.
search_view
.
setCurrentWidget
(
active_widget
)
self
.
search_view
.
setCurrentWidget
(
active_widget
)
def
_SH_DisplayNameEditingFinished
(
self
):
self
.
display_name
.
clearFocus
()
index
=
self
.
identity
.
currentIndex
()
if
index
!=
-
1
:
name
=
unicode
(
self
.
display_name
.
text
())
account
=
self
.
identity
.
itemData
(
index
)
.
toPyObject
()
.
account
account
.
display_name
=
name
if
name
else
None
account
.
save
()
def
_SH_HangupAllButtonClicked
(
self
):
def
_SH_HangupAllButtonClicked
(
self
):
for
session
in
self
.
session_model
.
sessions
:
for
session
in
self
.
session_model
.
sessions
:
session
.
end
()
session
.
end
()
...
@@ -208,6 +220,15 @@ class MainWindow(base_class, ui_class):
...
@@ -208,6 +220,15 @@ class MainWindow(base_class, ui_class):
account_manager
=
AccountManager
()
account_manager
=
AccountManager
()
account_manager
.
default_account
=
self
.
identity
.
itemData
(
index
)
.
toPyObject
()
.
account
account_manager
.
default_account
=
self
.
identity
.
itemData
(
index
)
.
toPyObject
()
.
account
def
_SH_IdentityCurrentIndexChanged
(
self
,
index
):
if
index
!=
-
1
:
account
=
self
.
identity
.
itemData
(
index
)
.
toPyObject
()
.
account
self
.
display_name
.
setText
(
account
.
display_name
)
self
.
display_name
.
setEnabled
(
True
)
else
:
self
.
display_name
.
clear
()
self
.
display_name
.
setEnabled
(
False
)
def
_SH_MakeConference
(
self
):
def
_SH_MakeConference
(
self
):
self
.
session_model
.
conferenceSessions
([
session
for
session
in
self
.
session_model
.
sessions
if
session
.
conference
is
None
and
not
session
.
pending_removal
])
self
.
session_model
.
conferenceSessions
([
session
for
session
in
self
.
session_model
.
sessions
if
session
.
conference
is
None
and
not
session
.
pending_removal
])
...
@@ -286,6 +307,8 @@ class MainWindow(base_class, ui_class):
...
@@ -286,6 +307,8 @@ class MainWindow(base_class, ui_class):
notification_center
.
add_observer
(
self
,
sender
=
settings
,
name
=
'CFGSettingsObjectDidChange'
)
notification_center
.
add_observer
(
self
,
sender
=
settings
,
name
=
'CFGSettingsObjectDidChange'
)
notification_center
.
add_observer
(
self
,
sender
=
account_manager
,
name
=
'SIPAccountManagerDidChangeDefaultAccount'
)
notification_center
.
add_observer
(
self
,
sender
=
account_manager
,
name
=
'SIPAccountManagerDidChangeDefaultAccount'
)
self
.
silent_button
.
setChecked
(
settings
.
audio
.
silent
)
self
.
silent_button
.
setChecked
(
settings
.
audio
.
silent
)
if
all
(
not
account
.
enabled
for
account
in
account_manager
.
iter_accounts
()):
self
.
display_name
.
setEnabled
(
False
)
def
_NH_CFGSettingsObjectDidChange
(
self
,
notification
):
def
_NH_CFGSettingsObjectDidChange
(
self
,
notification
):
if
'audio.silent'
in
notification
.
data
.
modified
:
if
'audio.silent'
in
notification
.
data
.
modified
:
...
...
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