def test_autostart_enable_windows(tmpfile, monkeypatch): monkeypatch.setattr("sys.platform", "win32") monkeypatch.setattr("gridsync.desktop.Dispatch", Mock(), raising=False) monkeypatch.setattr("gridsync.desktop.autostart_file_path", tmpfile) autostart_enable() with open(tmpfile, "a"): os.utime(tmpfile, None) assert autostart_is_enabled()
def test_autostart_enable_windows(tmpfile, monkeypatch): monkeypatch.setattr('sys.platform', 'win32') monkeypatch.setattr('gridsync.desktop.Dispatch', Mock(), raising=False) monkeypatch.setattr('gridsync.desktop.autostart_file_path', tmpfile) autostart_enable() with open(tmpfile, 'a'): os.utime(tmpfile, None) assert autostart_is_enabled()
def load_preferences(self): if get_preference("startup", "minimize") == "true": self.checkbox_minimize.setCheckState(Qt.Checked) else: self.checkbox_minimize.setCheckState(Qt.Unchecked) if autostart_is_enabled(): self.checkbox_autostart.setCheckState(Qt.Checked) else: self.checkbox_autostart.setCheckState(Qt.Unchecked)
def load_preferences(self): if get_preference('startup', 'minimize') == 'true': self.checkbox_minimize.setCheckState(Qt.Checked) else: self.checkbox_minimize.setCheckState(Qt.Unchecked) if autostart_is_enabled(): self.checkbox_autostart.setCheckState(Qt.Checked) else: self.checkbox_autostart.setCheckState(Qt.Unchecked)
def load_preferences(self): if get_preference('notifications', 'connection') == 'false': self.checkbox_connection.setCheckState(Qt.Unchecked) else: self.checkbox_connection.setCheckState(Qt.Checked) if get_preference('notifications', 'folder') == 'false': self.checkbox_folder.setCheckState(Qt.Unchecked) else: self.checkbox_folder.setCheckState(Qt.Checked) if get_preference('notifications', 'invite') == 'false': self.checkbox_invite.setCheckState(Qt.Unchecked) else: self.checkbox_invite.setCheckState(Qt.Checked) if get_preference('startup', 'minimize') == 'true': self.checkbox_minimize.setCheckState(Qt.Checked) else: self.checkbox_minimize.setCheckState(Qt.Unchecked) if autostart_is_enabled(): self.checkbox_autostart.setCheckState(Qt.Checked) else: self.checkbox_autostart.setCheckState(Qt.Unchecked)
def test_autostart_disable(tmpfile, monkeypatch): monkeypatch.setattr('gridsync.desktop.autostart_file_path', tmpfile) with open(tmpfile, 'a'): os.utime(tmpfile, None) autostart_disable() assert not autostart_is_enabled()
def test_autostart_enable_mac(tmpfile, monkeypatch): monkeypatch.setattr('sys.platform', 'darwin') monkeypatch.setattr('gridsync.desktop.autostart_file_path', tmpfile) autostart_enable() assert autostart_is_enabled()
def test_autostart_enable_frozen(tmpfile, monkeypatch): monkeypatch.setattr("sys.frozen", True, raising=False) monkeypatch.setattr('gridsync.desktop.autostart_file_path', tmpfile) autostart_enable() assert autostart_is_enabled()
def test_autostart_enable(tmpfile, monkeypatch): monkeypatch.setattr('gridsync.desktop.autostart_file_path', tmpfile) autostart_enable() assert autostart_is_enabled()
def test_autostart_enable_mac(tmpfile, monkeypatch): monkeypatch.setattr("sys.platform", "darwin") monkeypatch.setattr("gridsync.desktop.autostart_file_path", tmpfile) autostart_enable() assert autostart_is_enabled()
def test_autostart_is_enabled_false(tmpfile, monkeypatch): monkeypatch.setattr("gridsync.desktop.autostart_file_path", tmpfile) assert not autostart_is_enabled()
def test_autostart_is_enabled_true(tmpfile, monkeypatch): with open(tmpfile, "a"): os.utime(tmpfile, None) monkeypatch.setattr("gridsync.desktop.autostart_file_path", tmpfile) assert autostart_is_enabled()