Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gajim-plugins
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
56
Issues
56
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gajim
gajim-plugins
Commits
69ea341d
Commit
69ea341d
authored
Jul 30, 2013
by
Dicson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QuickRepliesPlugin.available in py3
parent
657b820f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
22 deletions
+24
-22
quick_replies/__init__.py
quick_replies/__init__.py
+1
-1
quick_replies/manifest.ini
quick_replies/manifest.ini
+1
-1
quick_replies/plugin.py
quick_replies/plugin.py
+22
-20
No files found.
quick_replies/__init__.py
View file @
69ea341d
from
plugin
import
QuickRepliesPlugin
from
.
plugin
import
QuickRepliesPlugin
quick_replies/manifest.ini
View file @
69ea341d
...
...
@@ -5,4 +5,4 @@ version: 0.0.2
description:
Plugin
for
quick
insert
template
message
and
add
your
own
template
messages
authors
=
Evgeniy Popov <evgeniypopov@gmail.com>
homepage
=
http://trac-plugins.gajim.org/wiki/QuickRepliesPlugin
m
ax_gajim_version:
0.15.9
m
ix_gajim_version:
0.16.10
quick_replies/plugin.py
View file @
69ea341d
import
gtk
from
gi.repository
import
Gtk
from
gi.repository
import
GdkPixbuf
import
gtkgui_helpers
from
common
import
gajim
...
...
@@ -63,30 +65,29 @@ class Base(object):
self
.
plugin
=
plugin
self
.
chat_control
=
chat_control
self
.
create_menu
()
self
.
create_button
()
self
.
create_menu
()
def
create_button
(
self
):
actions_hbox
=
self
.
chat_control
.
xml
.
get_object
(
'actions_hbox'
)
self
.
button
=
g
tk
.
Button
(
label
=
None
,
stock
=
None
,
use_underline
=
True
)
self
.
button
.
set_property
(
'relief'
,
gtk
.
RELIEF_
NONE
)
self
.
button
=
G
tk
.
Button
(
label
=
None
,
stock
=
None
,
use_underline
=
True
)
self
.
button
.
set_property
(
'relief'
,
Gtk
.
ReliefStyle
.
NONE
)
self
.
button
.
set_property
(
'can-focus'
,
False
)
img
=
g
tk
.
Image
()
img
=
G
tk
.
Image
()
img_path
=
self
.
plugin
.
local_file_path
(
'quick_replies.png'
)
pixbuf
=
gtk
.
gdk
.
pixbuf_
new_from_file
(
img_path
)
iconset
=
g
tk
.
IconSet
(
pixbuf
=
pixbuf
)
factory
=
g
tk
.
IconFactory
()
pixbuf
=
GdkPixbuf
.
Pixbuf
.
new_from_file
(
img_path
)
iconset
=
G
tk
.
IconSet
(
pixbuf
=
pixbuf
)
factory
=
G
tk
.
IconFactory
()
factory
.
add
(
'quickreplies'
,
iconset
)
factory
.
add_default
()
img
.
set_from_stock
(
'quickreplies'
,
gtk
.
ICON_SIZE_
MENU
)
img
.
set_from_stock
(
'quickreplies'
,
Gtk
.
IconSize
.
MENU
)
self
.
button
.
set_image
(
img
)
self
.
button
.
set_tooltip_text
(
_
(
'Quick replies'
))
send_button
=
self
.
chat_control
.
xml
.
get_object
(
'send_button'
)
send_button_pos
=
actions_hbox
.
child_get_property
(
send_button
,
'position'
)
actions_hbox
.
add_with_properties
(
self
.
button
,
'position'
,
send_button_pos
-
1
,
'expand'
,
False
)
actions_hbox
.
pack_start
(
self
.
button
,
False
,
False
,
0
)
actions_hbox
.
reorder_child
(
self
.
button
,
len
(
actions_hbox
.
get_children
())
-
3
)
id_
=
self
.
button
.
connect
(
'clicked'
,
self
.
on_button_cliecked
)
self
.
chat_control
.
handlers
[
id_
]
=
self
.
button
self
.
button
.
show
()
...
...
@@ -105,16 +106,17 @@ class Base(object):
def
create_menu
(
self
):
self
.
menu
=
g
tk
.
Menu
()
self
.
menu
=
G
tk
.
Menu
()
for
count
in
x
range
(
1
,
11
):
for
count
in
range
(
1
,
11
):
text
=
self
.
plugin
.
config
[
'entry'
+
str
(
count
)]
if
not
text
:
continue
item
=
g
tk
.
MenuItem
(
text
)
item
=
G
tk
.
MenuItem
(
text
)
item
.
connect
(
'activate'
,
self
.
on_insert
,
text
)
self
.
menu
.
append
(
item
)
self
.
menu
.
show_all
()
self
.
menu
.
attach_to_widget
(
self
.
button
,
None
)
def
disconnect_from_chat_control
(
self
):
actions_hbox
=
self
.
chat_control
.
xml
.
get_object
(
'actions_hbox'
)
...
...
@@ -127,22 +129,22 @@ class QuickRepliesPluginConfigDialog(GajimPluginConfigDialog):
self
.
GTK_BUILDER_FILE_PATH
=
self
.
plugin
.
local_file_path
(
'config_dialog.ui'
)
self
.
xml
=
g
tk
.
Builder
()
self
.
xml
=
G
tk
.
Builder
()
self
.
xml
.
set_translation_domain
(
'gajim_plugins'
)
self
.
xml
.
add_objects_from_file
(
self
.
GTK_BUILDER_FILE_PATH
,
[
'table1'
])
hbox
=
self
.
xml
.
get_object
(
'table1'
)
self
.
child
.
pack_start
(
hbox
)
self
.
get_child
().
pack_start
(
hbox
,
True
,
True
,
0
)
self
.
xml
.
connect_signals
(
self
)
def
on_run
(
self
):
for
count
in
x
range
(
1
,
11
):
for
count
in
range
(
1
,
11
):
self
.
xml
.
get_object
(
'entry'
+
str
(
count
)).
set_text
(
self
.
plugin
.
config
[
'entry'
+
str
(
count
)])
def
entry_changed
(
self
,
widget
):
name
=
g
tk
.
Buildable
.
get_name
(
widget
)
name
=
G
tk
.
Buildable
.
get_name
(
widget
)
self
.
plugin
.
config
[
name
]
=
widget
.
get_text
()
for
control
in
self
.
plugin
.
controls
:
control
.
create_menu
()
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