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
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Contributor 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
mesonium
gajim
Commits
74ed71f5
Commit
74ed71f5
authored
6 years ago
by
Daniel Brötzmann
Committed by
Philipp Hörist
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Rework HTTPUpload dialog
parent
760b94f2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gajim/data/gui/httpupload_progress_dialog.ui
+61
-30
61 additions, 30 deletions
gajim/data/gui/httpupload_progress_dialog.ui
gajim/dialogs.py
+16
-13
16 additions, 13 deletions
gajim/dialogs.py
with
77 additions
and
43 deletions
gajim/data/gui/httpupload_progress_dialog.ui
+
61
−
30
View file @
74ed71f5
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.2
0
.1 -->
<!-- Generated with glade 3.2
2
.1 -->
<interface>
<requires
lib=
"gtk+"
version=
"3.
14
"
/>
<requires
lib=
"gtk+"
version=
"3.
20
"
/>
<object
class=
"GtkBox"
id=
"box"
>
<property
name=
"width_request"
>
300
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"border_width"
>
18
</property>
<property
name=
"orientation"
>
vertical
</property>
<property
name=
"spacing"
>
6
</property>
<child>
<object
class=
"Gtk
Alignment"
id=
"alignment1
"
>
<object
class=
"Gtk
Image
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"top_padding"
>
8
</property>
<property
name=
"bottom_padding"
>
4
</property>
<property
name=
"left_padding"
>
8
</property>
<property
name=
"right_padding"
>
8
</property>
<child>
<object
class=
"GtkLabel"
id=
"label"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<attributes>
<attribute
name=
"weight"
value=
"bold"
/>
<attribute
name=
"variant"
value=
"normal"
/>
</attributes>
</object>
</child>
<property
name=
"icon_name"
>
document-send-symbolic
</property>
<property
name=
"icon_size"
>
6
</property>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
...
...
@@ -32,21 +23,14 @@
</packing>
</child>
<child>
<object
class=
"Gtk
Alignment"
id=
"alignment2
"
>
<object
class=
"Gtk
Label"
id=
"label
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"top_padding"
>
4
</property>
<property
name=
"bottom_padding"
>
4
</property>
<property
name=
"left_padding"
>
8
</property>
<property
name=
"right_padding"
>
8
</property>
<child>
<object
class=
"GtkProgressBar"
id=
"progressbar"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"pulse_step"
>
0.10000000149
</property>
<property
name=
"show_text"
>
True
</property>
</object>
</child>
<property
name=
"margin_top"
>
6
</property>
<property
name=
"label"
>
<
placeholder
>
</property>
<style>
<class
name=
"bold"
/>
</style>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
...
...
@@ -54,5 +38,52 @@
<property
name=
"position"
>
1
</property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
id=
"progress_label"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"label"
>
<
progress
>
</property>
<style>
<class
name=
"dim-label"
/>
</style>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
2
</property>
</packing>
</child>
<child>
<object
class=
"GtkProgressBar"
id=
"progressbar"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"margin_top"
>
6
</property>
<property
name=
"pulse_step"
>
0.10000000149
</property>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
3
</property>
</packing>
</child>
<child>
<object
class=
"GtkButton"
id=
"cancel_upload_button"
>
<property
name=
"label"
translatable=
"yes"
>
Cancel Upload
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"receives_default"
>
True
</property>
<property
name=
"halign"
>
center
</property>
<property
name=
"margin_top"
>
6
</property>
<signal
name=
"clicked"
handler=
"on_cancel_upload_button_clicked"
swapped=
"no"
/>
<style>
<class
name=
"destructive-action"
/>
</style>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
4
</property>
</packing>
</child>
</object>
</interface>
This diff is collapsed.
Click to expand it.
gajim/dialogs.py
+
16
−
13
View file @
74ed71f5
...
...
@@ -1727,21 +1727,18 @@ def __init__(self, file):
self
.
set_position
(
Gtk
.
WindowPosition
.
CENTER
)
self
.
set_show_menubar
(
False
)
self
.
set_title
(
_
(
'
File Transfer
'
))
self
.
set_default_size
(
250
,
-
1
)
self
.
event
=
file
.
event
self
.
file
=
file
self
.
xml
=
get_builder
(
'
httpupload_progress_dialog.ui
'
)
self
.
_ui
=
get_builder
(
'
httpupload_progress_dialog.ui
'
)
self
.
label
=
self
.
xml
.
get_object
(
'
label
'
)
self
.
progressbar
=
self
.
xml
.
get_object
(
'
progressbar
'
)
self
.
add
(
self
.
xml
.
get_object
(
'
box
'
))
self
.
add
(
self
.
_ui
.
box
)
self
.
pulse
=
GLib
.
timeout_add
(
100
,
self
.
_pulse_progressbar
)
self
.
show_all
()
self
.
connect
(
'
destroy
'
,
self
.
_on_destroy
)
self
.
_ui
.
connect_signals
(
self
)
app
.
ged
.
register_event_handler
(
'
httpupload-progress
'
,
ged
.
CORE
,
self
.
_on_httpupload_progress
)
...
...
@@ -1749,20 +1746,23 @@ def _on_httpupload_progress(self, obj):
if
self
.
file
!=
obj
.
file
:
return
if
obj
.
status
==
'
request
'
:
self
.
label
.
set_text
(
_
(
'
Requesting HTTP Upload Slot…
'
))
self
.
_ui
.
label
.
set_text
(
_
(
'
Requesting HTTP Upload Slot…
'
))
elif
obj
.
status
==
'
close
'
:
self
.
destroy
()
elif
obj
.
status
==
'
upload
'
:
self
.
label
.
set_text
(
_
(
'
Uploading file via HTTP File Upload…
'
))
self
.
_ui
.
label
.
set_text
(
_
(
'
Uploading file via HTTP File Upload…
'
))
elif
obj
.
status
==
'
update
'
:
self
.
update_progress
(
obj
.
seen
,
obj
.
total
)
elif
obj
.
status
==
'
encrypt
'
:
self
.
label
.
set_text
(
_
(
'
Encrypting file…
'
))
self
.
_ui
.
label
.
set_text
(
_
(
'
Encrypting file…
'
))
def
_pulse_progressbar
(
self
):
self
.
progressbar
.
pulse
()
self
.
_ui
.
progressbar
.
pulse
()
return
True
def
on_cancel_upload_button_clicked
(
self
,
widget
):
self
.
destroy
()
def
_on_destroy
(
self
,
*
args
):
self
.
event
.
set
()
if
self
.
pulse
:
...
...
@@ -1776,6 +1776,9 @@ def update_progress(self, seen, total):
if
self
.
pulse
:
GLib
.
source_remove
(
self
.
pulse
)
self
.
pulse
=
None
pct
=
(
float
(
seen
)
/
total
)
*
100.0
self
.
progressbar
.
set_fraction
(
float
(
seen
)
/
total
)
self
.
progressbar
.
set_text
(
str
(
int
(
pct
))
+
"
%
"
)
self
.
_ui
.
progressbar
.
set_fraction
(
float
(
seen
)
/
total
)
size_total
=
round
(
total
/
(
1024
*
1024
),
1
)
size_progress
=
round
(
seen
/
(
1024
*
1024
),
1
)
self
.
_ui
.
progress_label
.
set_text
(
_
(
'
%(progress)s of %(total)s MiB sent
'
)
%
\
{
'
progress
'
:
str
(
size_progress
),
'
total
'
:
str
(
size_total
)})
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