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
9d48e59f
Commit
9d48e59f
authored
Jun 18, 2013
by
Dan Pascu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set contact URI type to SIP by default for new entries
parent
d050dd7f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
contacts.py
blink/contacts.py
+7
-5
No files found.
blink/contacts.py
View file @
9d48e59f
...
...
@@ -3579,6 +3579,8 @@ class ContactURIModel(QAbstractTableModel):
TypeColumn
=
1
DefaultColumn
=
2
default_uri_type
=
'SIP'
def
__init__
(
self
,
parent
=
None
):
super
(
ContactURIModel
,
self
)
.
__init__
(
parent
)
self
.
table_view
=
parent
.
addresses_table
...
...
@@ -3629,7 +3631,7 @@ class ContactURIModel(QAbstractTableModel):
item
.
uri
=
value
if
item
.
ghost
and
value
:
item
.
ghost
=
False
self
.
_add_item
(
ContactURIItem
(
None
,
None
,
Non
e
,
False
,
ghost
=
True
))
self
.
_add_item
(
ContactURIItem
(
None
,
None
,
self
.
default_uri_typ
e
,
False
,
ghost
=
True
))
elif
column
==
ContactURIModel
.
TypeColumn
:
self
.
items
[
row
]
.
type
=
value
or
None
elif
column
==
ContactURIModel
.
DefaultColumn
:
...
...
@@ -3648,8 +3650,8 @@ class ContactURIModel(QAbstractTableModel):
return
super
(
ContactURIModel
,
self
)
.
headerData
(
section
,
orientation
,
role
)
def
init_with_address
(
self
,
address
=
None
):
items
=
[
ContactURIItem
(
None
,
address
,
Non
e
,
False
)]
if
address
else
[]
items
.
append
(
ContactURIItem
(
None
,
None
,
Non
e
,
False
,
ghost
=
True
))
items
=
[
ContactURIItem
(
None
,
address
,
self
.
default_uri_typ
e
,
False
)]
if
address
else
[]
items
.
append
(
ContactURIItem
(
None
,
None
,
self
.
default_uri_typ
e
,
False
,
ghost
=
True
))
self
.
beginResetModel
()
self
.
items
=
items
self
.
uri_types
=
[]
...
...
@@ -3662,7 +3664,7 @@ class ContactURIModel(QAbstractTableModel):
def
init_with_contact
(
self
,
contact
):
items
=
[
ContactURIItem
(
uri
.
id
,
uri
.
uri
,
uri
.
type
,
default
=
uri
is
contact
.
uris
.
default
)
for
uri
in
contact
.
uris
]
items
.
append
(
ContactURIItem
(
None
,
None
,
Non
e
,
False
,
ghost
=
True
))
items
.
append
(
ContactURIItem
(
None
,
None
,
self
.
default_uri_typ
e
,
False
,
ghost
=
True
))
self
.
beginResetModel
()
self
.
items
=
items
self
.
uri_types
=
[
uri
.
type
for
uri
in
contact
.
uris
]
...
...
@@ -3684,7 +3686,7 @@ class ContactURIModel(QAbstractTableModel):
default_item
=
None
# only care for the default URI if it was a newly added one, else use the one from the contact
items
=
[
ContactURIItem
(
uri
.
id
,
uri
.
uri
,
uri
.
type
,
default
=
default_item
is
None
and
uri
is
contact
.
uris
.
default
)
for
uri
in
contact
.
uris
]
items
.
extend
(
added_items
)
items
.
append
(
ContactURIItem
(
None
,
None
,
Non
e
,
False
,
ghost
=
True
))
items
.
append
(
ContactURIItem
(
None
,
None
,
self
.
default_uri_typ
e
,
False
,
ghost
=
True
))
self
.
beginResetModel
()
self
.
items
=
items
self
.
uri_types
=
[
item
.
type
for
item
in
items
]
...
...
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