Commit 55cded2e authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Remove unused code

Code was not working for years, seems nobody missed it
parent ff9bc4f9
...@@ -130,8 +130,6 @@ sleeper_state = {} # type: Dict[str, str] ...@@ -130,8 +130,6 @@ sleeper_state = {} # type: Dict[str, str]
status_before_autoaway = {} # type: Dict[str, str] status_before_autoaway = {} # type: Dict[str, str]
# Is Gnome configured to activate on single click ?
single_click = False
SHOW_LIST = ['offline', 'connecting', 'online', 'chat', 'away', 'xa', 'dnd', SHOW_LIST = ['offline', 'connecting', 'online', 'chat', 'away', 'xa', 'dnd',
'invisible', 'error'] 'invisible', 'error']
......
...@@ -141,7 +141,6 @@ ...@@ -141,7 +141,6 @@
<property name="headers_visible">False</property> <property name="headers_visible">False</property>
<property name="reorderable">True</property> <property name="reorderable">True</property>
<signal name="button-press-event" handler="on_roster_treeview_button_press_event" swapped="no"/> <signal name="button-press-event" handler="on_roster_treeview_button_press_event" swapped="no"/>
<signal name="button-release-event" handler="on_roster_treeview_button_release_event" swapped="no"/>
<signal name="key-press-event" handler="on_roster_treeview_key_press_event" swapped="no"/> <signal name="key-press-event" handler="on_roster_treeview_key_press_event" swapped="no"/>
<signal name="row-activated" handler="on_roster_treeview_row_activated" swapped="no"/> <signal name="row-activated" handler="on_roster_treeview_row_activated" swapped="no"/>
<signal name="row-collapsed" handler="on_roster_treeview_row_collapsed" swapped="no"/> <signal name="row-collapsed" handler="on_roster_treeview_row_collapsed" swapped="no"/>
......
...@@ -2076,17 +2076,7 @@ class Interface: ...@@ -2076,17 +2076,7 @@ class Interface:
if app.config.get_per('accounts', account, 'is_zeroconf'): if app.config.get_per('accounts', account, 'is_zeroconf'):
app.ZEROCONF_ACC_NAME = account app.ZEROCONF_ACC_NAME = account
break break
# Is gnome configured to activate row on single click ?
# try:
# gi.require_version('GConf', '2.0')
# from gi.repository import GConf
# client = GConf.Client.get_default()
# click_policy = client.get_string(
# '/apps/nautilus/preferences/click_policy')
# if click_policy == 'single':
# app.single_click = True
# except Exception:
# pass
# add default status messages if there is not in the config file # add default status messages if there is not in the config file
if not app.config.get_per('statusmsg'): if not app.config.get_per('statusmsg'):
default = app.config.statusmsg_default default = app.config.statusmsg_default
......
...@@ -3137,20 +3137,6 @@ class RosterWindow: ...@@ -3137,20 +3137,6 @@ class RosterWindow:
self.tree.expand_row(path, False) self.tree.expand_row(path, False)
return True return True
def on_roster_treeview_button_release_event(self, widget, event):
try:
path = self.tree.get_path_at_pos(int(event.x), int(event.y))[0]
except TypeError:
return False
if event.button == 1: # Left click
if app.single_click and not event.get_state() & Gdk.ModifierType.SHIFT_MASK and \
not event.get_state() & Gdk.ModifierType.CONTROL_MASK:
# Check if button has been pressed on the same row
if self.clicked_path == path:
self.on_row_activated(widget, path)
self.clicked_path = None
def accel_group_func(self, accel_group, acceleratable, keyval, modifier): def accel_group_func(self, accel_group, acceleratable, keyval, modifier):
# CTRL mask # CTRL mask
if modifier & Gdk.ModifierType.CONTROL_MASK: if modifier & Gdk.ModifierType.CONTROL_MASK:
...@@ -3235,23 +3221,6 @@ class RosterWindow: ...@@ -3235,23 +3221,6 @@ class RosterWindow:
x_min = AvatarSize.ROSTER x_min = AvatarSize.ROSTER
else: else:
x_min = 0 x_min = 0
if (app.single_click and
not event.get_state() & Gdk.ModifierType.SHIFT_MASK and
not event.get_state() & Gdk.ModifierType.CONTROL_MASK):
# Don't handle double click if we press icon of a metacontact
titer = model.get_iter(path)
if x_min < x < x_min + 27 and type_ == 'contact' and \
model.iter_has_child(titer):
if self.tree.row_expanded(path):
self.tree.collapse_row(path)
else:
self.tree.expand_row(path, False)
return
# We just save on which row we press button, and open chat
# window on button release to be able to do DND without opening
# chat window
self.clicked_path = path
return
if type_ == 'group' and x < 27: if type_ == 'group' and x < 27:
# first cell in 1st column (the arrow SINGLE clicked) # first cell in 1st column (the arrow SINGLE clicked)
...@@ -3680,8 +3649,7 @@ class RosterWindow: ...@@ -3680,8 +3649,7 @@ class RosterWindow:
""" """
When an iter is double clicked: open the first event window When an iter is double clicked: open the first event window
""" """
if not app.single_click: self.on_row_activated(widget, path)
self.on_row_activated(widget, path)
def on_roster_treeview_row_expanded(self, widget, titer, path): def on_roster_treeview_row_expanded(self, widget, titer, path):
""" """
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment