Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eta
gajim
Commits
1d2380b6
Commit
1d2380b6
authored
20 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
more user friendly Add contact window
parent
ad617891
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
plugins/gtkgui/dialogs.py
+61
-0
61 additions, 0 deletions
plugins/gtkgui/dialogs.py
plugins/gtkgui/gtkgui.glade
+123
-28
123 additions, 28 deletions
plugins/gtkgui/gtkgui.glade
with
184 additions
and
28 deletions
plugins/gtkgui/dialogs.py
+
61
−
0
View file @
1d2380b6
...
...
@@ -374,16 +374,77 @@ class addContact_Window:
self
.
plugin
.
roster
.
req_sub
(
self
,
who
,
txt
,
self
.
account
)
widget
.
get_toplevel
().
destroy
()
def
fill_who
(
self
):
cb
=
self
.
xml
.
get_widget
(
'
combobox_agent
'
)
model
=
cb
.
get_model
()
index
=
cb
.
get_active
()
str
=
self
.
xml
.
get_widget
(
'
entry_login
'
).
get_text
()
str
=
str
.
replace
(
"
@
"
,
"
%
"
)
agent
=
model
[
index
][
1
]
if
agent
:
str
+=
"
@
"
+
agent
self
.
xml
.
get_widget
(
'
entry_who
'
).
set_text
(
str
)
def
on_cb_changed
(
self
,
widget
):
self
.
fill_who
()
def
guess_agent
(
self
):
login
=
self
.
xml
.
get_widget
(
'
entry_login
'
).
get_text
()
cb
=
self
.
xml
.
get_widget
(
'
combobox_agent
'
)
model
=
cb
.
get_model
()
#If login contains only numbers, it's probably an ICQ number
try
:
string
.
atoi
(
login
)
except
:
pass
else
:
if
'
ICQ
'
in
self
.
agents
:
cb
.
set_active
(
self
.
agents
.
index
(
'
ICQ
'
))
return
cb
.
set_active
(
0
)
def
on_entry_login_changed
(
self
,
widget
):
self
.
guess_agent
()
#It changes the cb so automatically call fill_who()
def
__init__
(
self
,
plugin
,
account
,
jid
=
None
):
self
.
plugin
=
plugin
self
.
account
=
account
self
.
xml
=
gtk
.
glade
.
XML
(
GTKGUI_GLADE
,
'
Add
'
,
APP
)
self
.
window
=
self
.
xml
.
get_widget
(
'
Add
'
)
liststore
=
gtk
.
ListStore
(
gobject
.
TYPE_STRING
,
gobject
.
TYPE_STRING
)
liststore
.
append
([
'
Jabber
'
,
''
])
self
.
agents
=
[
'
Jabber
'
]
jid_agents
=
[]
for
j
in
self
.
plugin
.
roster
.
contacts
[
account
]:
user
=
self
.
plugin
.
roster
.
contacts
[
account
][
j
][
0
]
if
'
Agents
'
in
user
.
groups
:
jid_agents
.
append
(
j
)
for
a
in
jid_agents
:
if
a
.
find
(
"
aim
"
)
>
-
1
:
name
=
"
AIM
"
elif
a
.
find
(
"
icq
"
)
>
-
1
:
name
=
"
ICQ
"
elif
a
.
find
(
"
msn
"
)
>
-
1
:
name
=
"
MSN
"
elif
a
.
find
(
"
yahoo
"
)
>
-
1
:
name
=
"
Yahoo!
"
else
:
name
=
a
iter
=
liststore
.
append
([
name
,
a
])
self
.
agents
.
append
(
name
)
cb
=
self
.
xml
.
get_widget
(
'
combobox_agent
'
)
cb
.
set_model
(
liststore
)
cb
.
set_active
(
0
)
self
.
fill_who
()
if
jid
:
self
.
xml
.
get_widget
(
'
entry_who
'
).
set_text
(
jid
)
self
.
xml
.
signal_connect
(
'
gtk_widget_destroy
'
,
self
.
delete_event
)
self
.
xml
.
signal_connect
(
'
on_button_sub_clicked
'
,
self
.
on_subscribe
)
self
.
xml
.
signal_connect
(
'
on_cancel_clicked
'
,
self
.
on_cancel
)
self
.
xml
.
signal_connect
(
'
on_cb_changed
'
,
self
.
on_cb_changed
)
self
.
xml
.
signal_connect
(
'
on_entry_login_changed
'
,
\
self
.
on_entry_login_changed
)
class
warning_Window
:
"""
Class for warning window : print a warning message
"""
...
...
This diff is collapsed.
Click to expand it.
plugins/gtkgui/gtkgui.glade
+
123
−
28
View file @
1d2380b6
...
...
@@ -2170,15 +2170,61 @@ on the server.</property>
<property
name=
"spacing"
>
0
</property>
<child>
<widget
class=
"Gtk
HBox
"
id=
"
hbox1
1"
>
<widget
class=
"Gtk
Table
"
id=
"
table2
1"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"n_rows"
>
3
</property>
<property
name=
"n_columns"
>
3
</property>
<property
name=
"homogeneous"
>
False
</property>
<property
name=
"spacing"
>
0
</property>
<property
name=
"row_spacing"
>
5
</property>
<property
name=
"column_spacing"
>
5
</property>
<child>
<widget
class=
"GtkEntry"
id=
"entry_login"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"editable"
>
True
</property>
<property
name=
"visibility"
>
True
</property>
<property
name=
"max_length"
>
0
</property>
<property
name=
"text"
translatable=
"yes"
></property>
<property
name=
"has_frame"
>
True
</property>
<property
name=
"invisible_char"
>
*
</property>
<property
name=
"activates_default"
>
False
</property>
<signal
name=
"changed"
handler=
"on_entry_login_changed"
last_modification_time=
"Wed, 02 Feb 2005 22:34:32 GMT"
/>
</widget>
<packing>
<property
name=
"left_attach"
>
2
</property>
<property
name=
"right_attach"
>
3
</property>
<property
name=
"top_attach"
>
0
</property>
<property
name=
"bottom_attach"
>
1
</property>
<property
name=
"y_options"
></property>
</packing>
</child>
<child>
<widget
class=
"Gtk
Image
"
id=
"
image127
"
>
<widget
class=
"Gtk
Entry
"
id=
"
entry_who
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"stock"
>
gtk-redo
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"editable"
>
False
</property>
<property
name=
"visibility"
>
True
</property>
<property
name=
"max_length"
>
0
</property>
<property
name=
"text"
translatable=
"yes"
></property>
<property
name=
"has_frame"
>
True
</property>
<property
name=
"invisible_char"
>
*
</property>
<property
name=
"activates_default"
>
False
</property>
</widget>
<packing>
<property
name=
"left_attach"
>
2
</property>
<property
name=
"right_attach"
>
3
</property>
<property
name=
"top_attach"
>
2
</property>
<property
name=
"bottom_attach"
>
3
</property>
<property
name=
"y_options"
></property>
</packing>
</child>
<child>
<widget
class=
"GtkImage"
id=
"image184"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"stock"
>
gtk-add
</property>
<property
name=
"icon_size"
>
4
</property>
<property
name=
"xalign"
>
0.5
</property>
<property
name=
"yalign"
>
0.5
</property>
...
...
@@ -2186,51 +2232,100 @@ on the server.</property>
<property
name=
"ypad"
>
0
</property>
</widget>
<packing>
<property
name=
"padding"
>
0
</property>
<property
name=
"expand"
>
True
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"left_attach"
>
0
</property>
<property
name=
"right_attach"
>
1
</property>
<property
name=
"top_attach"
>
0
</property>
<property
name=
"bottom_attach"
>
3
</property>
<property
name=
"x_options"
>
fill
</property>
<property
name=
"y_options"
>
fill
</property>
</packing>
</child>
<child>
<widget
class=
"GtkLabel"
id=
"label17"
>
<property
name=
"width_request"
>
145
</property>
<property
name=
"height_request"
>
8
</property>
<widget
class=
"GtkLabel"
id=
"label185"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"label"
translatable=
"yes"
>
Send subscription to
:
</property>
<property
name=
"label"
translatable=
"yes"
>
Login
:
</property>
<property
name=
"use_underline"
>
False
</property>
<property
name=
"use_markup"
>
False
</property>
<property
name=
"justify"
>
GTK_JUSTIFY_
RIGH
T
</property>
<property
name=
"justify"
>
GTK_JUSTIFY_
LEF
T
</property>
<property
name=
"wrap"
>
False
</property>
<property
name=
"selectable"
>
False
</property>
<property
name=
"xalign"
>
0
.5
</property>
<property
name=
"xalign"
>
0
</property>
<property
name=
"yalign"
>
0.5
</property>
<property
name=
"xpad"
>
0
</property>
<property
name=
"ypad"
>
0
</property>
</widget>
<packing>
<property
name=
"padding"
>
0
</property>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"right_attach"
>
2
</property>
<property
name=
"top_attach"
>
0
</property>
<property
name=
"bottom_attach"
>
1
</property>
<property
name=
"x_options"
>
fill
</property>
<property
name=
"y_options"
></property>
</packing>
</child>
<child>
<widget
class=
"Gtk
Entry
"
id=
"
entry_who
"
>
<widget
class=
"Gtk
Label
"
id=
"
label186
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"editable"
>
True
</property>
<property
name=
"visibility"
>
True
</property>
<property
name=
"max_length"
>
0
</property>
<property
name=
"text"
translatable=
"yes"
></property>
<property
name=
"has_frame"
>
True
</property>
<property
name=
"invisible_char"
>
*
</property>
<property
name=
"activates_default"
>
False
</property>
<property
name=
"label"
translatable=
"yes"
>
Agent :
</property>
<property
name=
"use_underline"
>
False
</property>
<property
name=
"use_markup"
>
False
</property>
<property
name=
"justify"
>
GTK_JUSTIFY_LEFT
</property>
<property
name=
"wrap"
>
False
</property>
<property
name=
"selectable"
>
False
</property>
<property
name=
"xalign"
>
0
</property>
<property
name=
"yalign"
>
0.5
</property>
<property
name=
"xpad"
>
0
</property>
<property
name=
"ypad"
>
0
</property>
</widget>
<packing>
<property
name=
"padding"
>
0
</property>
<property
name=
"expand"
>
True
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"right_attach"
>
2
</property>
<property
name=
"top_attach"
>
1
</property>
<property
name=
"bottom_attach"
>
2
</property>
<property
name=
"x_options"
>
fill
</property>
<property
name=
"y_options"
></property>
</packing>
</child>
<child>
<widget
class=
"GtkLabel"
id=
"label187"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"label"
translatable=
"yes"
>
Jabber ID :
</property>
<property
name=
"use_underline"
>
False
</property>
<property
name=
"use_markup"
>
False
</property>
<property
name=
"justify"
>
GTK_JUSTIFY_LEFT
</property>
<property
name=
"wrap"
>
False
</property>
<property
name=
"selectable"
>
False
</property>
<property
name=
"xalign"
>
0
</property>
<property
name=
"yalign"
>
0.5
</property>
<property
name=
"xpad"
>
0
</property>
<property
name=
"ypad"
>
0
</property>
</widget>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"right_attach"
>
2
</property>
<property
name=
"top_attach"
>
2
</property>
<property
name=
"bottom_attach"
>
3
</property>
<property
name=
"x_options"
>
fill
</property>
<property
name=
"y_options"
></property>
</packing>
</child>
<child>
<widget
class=
"GtkComboBox"
id=
"combobox_agent"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"items"
translatable=
"yes"
></property>
<signal
name=
"changed"
handler=
"on_cb_changed"
last_modification_time=
"Wed, 02 Feb 2005 22:32:45 GMT"
/>
</widget>
<packing>
<property
name=
"left_attach"
>
2
</property>
<property
name=
"right_attach"
>
3
</property>
<property
name=
"top_attach"
>
1
</property>
<property
name=
"bottom_attach"
>
2
</property>
<property
name=
"x_options"
>
fill
</property>
<property
name=
"y_options"
>
fill
</property>
</packing>
</child>
</widget>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment