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
gajim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
209
Issues
209
List
Boards
Labels
Service Desk
Milestones
Merge Requests
21
Merge Requests
21
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
Commits
6fd939de
Commit
6fd939de
authored
Feb 23, 2021
by
Daniel Brötzmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WorkspaceDialog: Improvements
parent
73b4ef66
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
66 deletions
+66
-66
gajim/data/gui/workspace_dialog.ui
gajim/data/gui/workspace_dialog.ui
+55
-63
gajim/gtk/workspace_dialog.py
gajim/gtk/workspace_dialog.py
+11
-3
No files found.
gajim/data/gui/workspace_dialog.ui
View file @
6fd939de
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.3
6.0
-->
<!-- Generated with glade 3.3
8.2
-->
<interface>
<requires
lib=
"gtk+"
version=
"3.24"
/>
<object
class=
"GtkBox"
id=
"box"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can
_
focus"
>
False
</property>
<property
name=
"can
-
focus"
>
False
</property>
<property
name=
"orientation"
>
vertical
</property>
<property
name=
"spacing"
>
12
</property>
<child>
<object
class=
"GtkImage"
id=
"preview"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can
_
focus"
>
False
</property>
<property
name=
"can
-
focus"
>
False
</property>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
...
...
@@ -21,8 +21,10 @@
<child>
<object
class=
"GtkEntry"
id=
"entry"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can
_
focus"
>
True
</property>
<property
name=
"can
-
focus"
>
True
</property>
<property
name=
"halign"
>
center
</property>
<property
name=
"activates-default"
>
True
</property>
<property
name=
"xalign"
>
0.5
</property>
<signal
name=
"notify::text"
handler=
"_on_text_changed"
swapped=
"no"
/>
</object>
<packing>
...
...
@@ -34,10 +36,10 @@
<child>
<object
class=
"GtkLabel"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can
_
focus"
>
False
</property>
<property
name=
"can
-
focus"
>
False
</property>
<property
name=
"label"
translatable=
"yes"
>
Choose a color or select an image
</property>
<property
name=
"wrap"
>
True
</property>
<property
name=
"max
_width_
chars"
>
40
</property>
<property
name=
"max
-width-
chars"
>
40
</property>
<style>
<class
name=
"dim-label"
/>
</style>
...
...
@@ -49,36 +51,60 @@
</packing>
</child>
<child>
<object
class=
"Gtk
StackSwitcher
"
>
<object
class=
"Gtk
Box
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can
_
focus"
>
False
</property>
<property
name=
"can
-
focus"
>
False
</property>
<property
name=
"halign"
>
center
</property>
<property
name=
"stack"
>
style_stack
</property>
<property
name=
"spacing"
>
6
</property>
<child>
<object
class=
"GtkSwitch"
id=
"image_switch"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can-focus"
>
True
</property>
<signal
name=
"notify::active"
handler=
"_on_image_switch_toggled"
swapped=
"no"
/>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
0
</property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can-focus"
>
False
</property>
<property
name=
"label"
translatable=
"yes"
>
Use Image
</property>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
4
</property>
<property
name=
"position"
>
3
</property>
</packing>
</child>
<child>
<object
class=
"GtkStack"
id=
"style_stack"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can
_
focus"
>
False
</property>
<property
name=
"transition
_
duration"
>
100
</property>
<property
name=
"transition
_
type"
>
slide-left-right
</property>
<property
name=
"can
-
focus"
>
False
</property>
<property
name=
"transition
-
duration"
>
100
</property>
<property
name=
"transition
-
type"
>
slide-left-right
</property>
<child>
<object
class=
"GtkBox"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can
_
focus"
>
False
</property>
<property
name=
"can
-
focus"
>
False
</property>
<property
name=
"halign"
>
center
</property>
<property
name=
"valign"
>
start
</property>
<property
name=
"margin
_
top"
>
6
</property>
<property
name=
"margin
-
top"
>
6
</property>
<property
name=
"spacing"
>
12
</property>
<child>
<object
class=
"GtkLabel"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can
_
focus"
>
False
</property>
<property
name=
"can
-
focus"
>
False
</property>
<property
name=
"valign"
>
center
</property>
<property
name=
"label"
translatable=
"yes"
>
Color
</property>
<style>
...
...
@@ -94,8 +120,8 @@
<child>
<object
class=
"GtkColorButton"
id=
"color_chooser"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can
_
focus"
>
True
</property>
<property
name=
"receives
_
default"
>
False
</property>
<property
name=
"can
-
focus"
>
True
</property>
<property
name=
"receives
-
default"
>
False
</property>
<property
name=
"valign"
>
center
</property>
<signal
name=
"color-set"
handler=
"_on_color_set"
swapped=
"no"
/>
</object>
...
...
@@ -114,45 +140,10 @@
<child>
<object
class=
"GtkBox"
id=
"image_box"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can
_
focus"
>
False
</property>
<property
name=
"can
-
focus"
>
False
</property>
<property
name=
"halign"
>
center
</property>
<property
name=
"orientation"
>
vertical
</property>
<property
name=
"spacing"
>
12
</property>
<child>
<object
class=
"GtkBox"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"spacing"
>
6
</property>
<child>
<object
class=
"GtkSwitch"
id=
"use_image"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
0
</property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"label"
translatable=
"yes"
>
Use Image instead of Color
</property>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
0
</property>
</packing>
</child>
<child>
<placeholder/>
</child>
...
...
@@ -173,14 +164,14 @@
<child>
<object
class=
"GtkBox"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can
_
focus"
>
False
</property>
<property
name=
"can
-
focus"
>
False
</property>
<child>
<object
class=
"GtkButton"
>
<property
name=
"label"
translatable=
"yes"
>
_Cancel
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can
_
focus"
>
True
</property>
<property
name=
"receives
_default"
>
Tru
e
</property>
<property
name=
"use
_
underline"
>
True
</property>
<property
name=
"can
-
focus"
>
True
</property>
<property
name=
"receives
-default"
>
Fals
e
</property>
<property
name=
"use
-
underline"
>
True
</property>
<signal
name=
"clicked"
handler=
"_on_cancel"
swapped=
"no"
/>
</object>
<packing>
...
...
@@ -193,9 +184,10 @@
<object
class=
"GtkButton"
id=
"save_button"
>
<property
name=
"label"
translatable=
"yes"
>
_Save
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"receives_default"
>
False
</property>
<property
name=
"use_underline"
>
True
</property>
<property
name=
"can-focus"
>
True
</property>
<property
name=
"can-default"
>
True
</property>
<property
name=
"receives-default"
>
True
</property>
<property
name=
"use-underline"
>
True
</property>
<signal
name=
"clicked"
handler=
"_on_save"
swapped=
"no"
/>
<style>
<class
name=
"suggested-action"
/>
...
...
@@ -204,7 +196,7 @@
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"pack
_
type"
>
end
</property>
<property
name=
"pack
-
type"
>
end
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
...
...
@@ -212,7 +204,7 @@
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"pack
_
type"
>
end
</property>
<property
name=
"pack
-
type"
>
end
</property>
<property
name=
"position"
>
7
</property>
</packing>
</child>
...
...
gajim/gtk/workspace_dialog.py
View file @
6fd939de
...
...
@@ -34,7 +34,7 @@ def __init__(self, workspace_id=None):
self
.
set_application
(
app
.
app
)
self
.
set_position
(
Gtk
.
WindowPosition
.
CENTER
)
self
.
set_show_menubar
(
False
)
self
.
set_title
(
_
(
'Workspace'
))
self
.
set_title
(
_
(
'Workspace
Settings
'
))
self
.
set_type_hint
(
Gdk
.
WindowTypeHint
.
DIALOG
)
self
.
set_size_request
(
350
,
-
1
)
...
...
@@ -62,6 +62,7 @@ def __init__(self, workspace_id=None):
self
.
_ui
.
entry
.
set_text
(
name
)
self
.
_ui
.
color_chooser
.
set_rgba
(
rgba
)
self
.
_update_avatar
()
self
.
_ui
.
save_button
.
grab_default
()
self
.
_ui
.
connect_signals
(
self
)
...
...
@@ -82,6 +83,12 @@ def _on_text_changed(self, entry, _param):
self
.
_ui
.
save_button
.
set_sensitive
(
bool
(
entry
.
get_text
()))
self
.
_update_avatar
()
def
_on_image_switch_toggled
(
self
,
switch
,
*
args
):
if
switch
.
get_active
():
self
.
_ui
.
style_stack
.
set_visible_child_name
(
'image'
)
else
:
self
.
_ui
.
style_stack
.
set_visible_child_name
(
'color'
)
def
_update_avatar
(
self
):
name
=
self
.
_ui
.
entry
.
get_text
()
rgba
=
self
.
_ui
.
color_chooser
.
get_rgba
()
...
...
@@ -106,8 +113,9 @@ def _get_avatar_data(self):
def
_on_save
(
self
,
_button
):
name
=
self
.
_ui
.
entry
.
get_text
()
rgba
=
self
.
_ui
.
color_chooser
.
get_rgba
()
# avatar = self._get_avatar_data()
# use_image = self._ui.use_image.get_active()
# use_image = self._ui.image_switch.get_active()
# if use_image:
# avatar = self._get_avatar_data()
if
self
.
_workspace_id
is
not
None
:
app
.
settings
.
set_workspace_setting
(
...
...
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