Commit 6424a64a authored by Philipp Hörist's avatar Philipp Hörist

Preferences: Show debug option on all platforms

parent 298adcf0
......@@ -357,7 +357,7 @@ class GajimApplication(Gtk.Application):
configpaths.init()
if app.get_win_debug_mode():
if app.get_debug_mode():
# Redirect has to happen before logging init
self._redirect_output()
logging_helpers.init()
......
......@@ -680,7 +680,7 @@ def load_css_config():
from gajim.gtk.css_config import CSSConfig
css_config = CSSConfig()
def set_win_debug_mode(enable: bool) -> None:
def set_debug_mode(enable: bool) -> None:
debug_folder = Path(configpaths.get('DEBUG'))
debug_enabled = debug_folder / 'debug-enabled'
if enable:
......@@ -689,9 +689,7 @@ def set_win_debug_mode(enable: bool) -> None:
if debug_enabled.exists():
debug_enabled.unlink()
def get_win_debug_mode() -> bool:
if sys.platform != 'win32':
return False
def get_debug_mode() -> bool:
debug_folder = Path(configpaths.get('DEBUG'))
debug_enabled = debug_folder / 'debug-enabled'
return debug_enabled.exists()
......
......@@ -13,7 +13,6 @@
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
import os
import sys
from gi.repository import Gtk
from gi.repository import Gdk
......@@ -410,10 +409,8 @@ class Preferences(Gtk.ApplicationWindow):
st = app.config.get('log_contact_status_changes')
self._ui.log_show_changes_checkbutton.set_active(st)
# Enable debug logging
if sys.platform == 'win32':
self._ui.enable_logging.set_active(app.get_win_debug_mode())
self._ui.enable_logging.show()
self._ui.enable_logging.set_active(app.get_debug_mode())
self._ui.enable_logging.show()
self._ui.connect_signals(self)
self.connect('key-press-event', self._on_key_press)
......@@ -1000,7 +997,7 @@ class Preferences(Gtk.ApplicationWindow):
# Enable debug logging
def on_enable_logging_toggled(self, widget):
app.set_win_debug_mode(widget.get_active())
app.set_debug_mode(widget.get_active())
# Advanced Config Editor (ACE)
def on_open_advanced_editor_button_clicked(self, _widget):
......
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