Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gajim-plugins
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
Evert Mouw
gajim-plugins
Commits
6423e6c9
Commit
6423e6c9
authored
8 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
[httpupload] Remove Image Button
parent
7ab0ff77
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
httpupload/httpupload.py
+1
-35
1 addition, 35 deletions
httpupload/httpupload.py
with
1 addition
and
35 deletions
httpupload/httpupload.py
+
1
−
35
View file @
6423e6c9
...
...
@@ -178,14 +178,10 @@ class HttpuploadPlugin(GajimPlugin):
log
.
info
(
"
Account %s: httpupload is_supported: %s
"
%
(
str
(
chat_control
.
account
),
str
(
is_supported
)))
if
not
is_supported
:
text
=
_
(
'
Your server does not support http uploads
'
)
image_text
=
text
else
:
text
=
_
(
'
Send file via http upload
'
)
image_text
=
_
(
'
Send image via http upload
'
)
base
.
button
.
set_sensitive
(
is_supported
)
base
.
button
.
set_tooltip_text
(
text
)
base
.
image_button
.
set_sensitive
(
is_supported
)
base
.
image_button
.
set_tooltip_text
(
image_text
)
class
Base
(
object
):
...
...
@@ -204,34 +200,20 @@ class Base(object):
self
.
button
.
set_image
(
img
)
self
.
button
.
set_tooltip_text
(
_
(
'
Your server does not support http uploads
'
))
self
.
button
.
set_relief
(
Gtk
.
ReliefStyle
.
NONE
)
self
.
image_button
=
Gtk
.
Button
(
label
=
None
,
stock
=
None
,
use_underline
=
True
)
self
.
image_button
.
set_property
(
'
can-focus
'
,
False
)
self
.
image_button
.
set_relief
(
Gtk
.
ReliefStyle
.
NONE
)
self
.
image_button
.
set_sensitive
(
False
)
img
=
Gtk
.
Image
()
img
.
set_from_file
(
self
.
plugin
.
local_file_path
(
'
image.png
'
))
self
.
image_button
.
set_image
(
img
)
self
.
image_button
.
set_tooltip_text
(
_
(
'
Your server does not support http uploads
'
))
send_button
=
chat_control
.
xml
.
get_object
(
'
send_button
'
)
actions_hbox
.
add
(
self
.
button
)
actions_hbox
.
add
(
self
.
image_button
)
send_button_pos
=
actions_hbox
.
child_get_property
(
send_button
,
'
position
'
)
actions_hbox
.
child_set_property
(
self
.
image_button
,
'
position
'
,
send_button_pos
-
1
)
actions_hbox
.
child_set_property
(
self
.
button
,
'
position
'
,
send_button_pos
-
1
)
file_id
=
self
.
button
.
connect
(
'
clicked
'
,
self
.
on_file_button_clicked
)
image_id
=
self
.
image_button
.
connect
(
'
clicked
'
,
self
.
on_image_button_clicked
)
chat_control
.
handlers
[
file_id
]
=
self
.
button
chat_control
.
handlers
[
image_id
]
=
self
.
image_button
self
.
button
.
show
()
self
.
image_button
.
show
()
def
disconnect_from_chat_control
(
self
):
actions_hbox
=
self
.
chat_control
.
xml
.
get_object
(
'
actions_hbox
'
)
actions_hbox
.
remove
(
self
.
button
)
actions_hbox
.
remove
(
self
.
image_button
)
def
encryption_activated
(
self
):
if
not
encryption_available
:
...
...
@@ -345,17 +327,6 @@ class Base(object):
log
.
info
(
"
Upload completed successfully
"
)
xhtml
=
None
is_image
=
mime_type
.
split
(
'
/
'
,
1
)[
0
]
==
'
image
'
if
((
not
isinstance
(
self
.
chat_control
,
chat_control
.
ChatControl
)
or
not
self
.
chat_control
.
gpg_is_active
)
and
self
.
dialog_type
==
'
image
'
and
is_image
and
not
self
.
encrypted_upload
):
progress_messages
.
put
(
_
(
'
Calculating (possible) image thumbnail...
'
))
thumb
=
thumbnail
(
path_to_file
)
if
thumb
:
xhtml
=
'
<body><br/><a href=
"
%s
"
><img alt=
"
%s
"
src=
"
data:image/jpeg;base64,%s
"
/></a></body>
'
%
\
(
get
.
getData
(),
get
.
getData
(),
thumb
)
progress_window
.
close_dialog
()
id_
=
gajim
.
get_an_id
()
def
add_oob_tag
():
...
...
@@ -457,11 +428,6 @@ class Base(object):
default_response
=
Gtk
.
ResponseType
.
OK
,)
self
.
dlg
.
set_transient_for
(
self
.
chat_control
.
parent_win
.
window
)
def
on_image_button_clicked
(
self
,
widget
):
self
.
dialog_type
=
'
image
'
self
.
dlg
=
ImageChooserDialog
(
on_response_ok
=
self
.
on_file_dialog_ok
,
on_response_cancel
=
None
)
self
.
dlg
.
set_transient_for
(
self
.
chat_control
.
parent_win
.
window
)
class
StreamFileWithProgress
:
def
__init__
(
self
,
path
,
mode
,
callback
=
None
,
...
...
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