GroupchatConfig: Tidy up some rough edges
This commit is contained in:
parent
5d5d686408
commit
6e41699297
3 changed files with 18 additions and 12 deletions
|
@ -323,6 +323,7 @@
|
||||||
<property name="sort_column_id">1</property>
|
<property name="sort_column_id">1</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCellRendererText">
|
<object class="GtkCellRendererText">
|
||||||
|
<property name="placeholder_text">Name</property>
|
||||||
<signal name="edited" handler="_on_nick_edited" swapped="no"/>
|
<signal name="edited" handler="_on_nick_edited" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
<attributes>
|
<attributes>
|
||||||
|
@ -442,7 +443,7 @@
|
||||||
<property name="sort_column_id">1</property>
|
<property name="sort_column_id">1</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCellRendererText">
|
<object class="GtkCellRendererText">
|
||||||
<property name="placeholder_text">spam</property>
|
<property name="placeholder_text">Spam</property>
|
||||||
<signal name="edited" handler="_on_reason_edited" swapped="no"/>
|
<signal name="edited" handler="_on_reason_edited" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
<attributes>
|
<attributes>
|
||||||
|
|
|
@ -153,6 +153,7 @@ list.settings > row > box {
|
||||||
background-color:@theme_base_color;
|
background-color:@theme_base_color;
|
||||||
border-bottom: 1px solid;
|
border-bottom: 1px solid;
|
||||||
border-color: @borders;}
|
border-color: @borders;}
|
||||||
|
#GroupchatConfig treeview { padding: 5px; }
|
||||||
|
|
||||||
/* Popover Treeview */
|
/* Popover Treeview */
|
||||||
.popover_treeview { border-radius: 3px; background-color: @theme_bg_color; }
|
.popover_treeview { border-radius: 3px; background-color: @theme_bg_color; }
|
||||||
|
|
|
@ -75,6 +75,7 @@ class GroupchatConfig(Gtk.ApplicationWindow):
|
||||||
self._ui.stack.set_visible_child_name('affiliation')
|
self._ui.stack.set_visible_child_name('affiliation')
|
||||||
|
|
||||||
self._ui.connect_signals(self)
|
self._ui.connect_signals(self)
|
||||||
|
self.connect('delete-event', self._cancel)
|
||||||
self.show_all()
|
self.show_all()
|
||||||
self._ui.stack.notify('visible-child-name')
|
self._ui.stack.notify('visible-child-name')
|
||||||
|
|
||||||
|
@ -94,19 +95,19 @@ class GroupchatConfig(Gtk.ApplicationWindow):
|
||||||
affiliation = 'member'
|
affiliation = 'member'
|
||||||
|
|
||||||
treeview = self._get_current_treeview()
|
treeview = self._get_current_treeview()
|
||||||
treeview.get_model().append([None,
|
iter_ = treeview.get_model().append([None,
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
affiliation,
|
affiliation,
|
||||||
text,
|
text,
|
||||||
affiliation_edit,
|
affiliation_edit,
|
||||||
jid_edit])
|
jid_edit])
|
||||||
|
|
||||||
# Scroll to added row
|
# Scroll to added row
|
||||||
row = treeview.get_model()[-1]
|
path = treeview.get_model().get_path(iter_)
|
||||||
treeview.scroll_to_cell(row.path, None, False, 0, 0)
|
treeview.scroll_to_cell(path, None, False, 0, 0)
|
||||||
treeview.get_selection().unselect_all()
|
treeview.get_selection().unselect_all()
|
||||||
treeview.get_selection().select_path(row.path)
|
treeview.get_selection().select_path(path)
|
||||||
|
|
||||||
def _on_remove(self, *args):
|
def _on_remove(self, *args):
|
||||||
treeview = self._get_current_treeview()
|
treeview = self._get_current_treeview()
|
||||||
|
@ -286,10 +287,13 @@ class GroupchatConfig(Gtk.ApplicationWindow):
|
||||||
return add, remove, modified
|
return add, remove, modified
|
||||||
|
|
||||||
def _on_cancel(self, *args):
|
def _on_cancel(self, *args):
|
||||||
|
self._cancel()
|
||||||
|
self.destroy()
|
||||||
|
|
||||||
|
def _cancel(self, *args):
|
||||||
if self._form and self._own_affiliation == 'owner':
|
if self._form and self._own_affiliation == 'owner':
|
||||||
con = app.connections[self.account]
|
con = app.connections[self.account]
|
||||||
con.get_module('MUC').cancel_config(self.jid)
|
con.get_module('MUC').cancel_config(self.jid)
|
||||||
self.destroy()
|
|
||||||
|
|
||||||
def _set_affiliations(self):
|
def _set_affiliations(self):
|
||||||
add, remove, modified = self._get_diff()
|
add, remove, modified = self._get_diff()
|
||||||
|
|
Loading…
Add table
Reference in a new issue