Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions data/com.github.tenderowl.frog.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
<summary>Autocopy text to clipboard</summary>
<description>Automatically copy the extracted text to the clipboard.</description>
</key>
<key name="autoscreen" type="b">
<default>false</default>
<summary>Automatically take Screenshot at start</summary>
<description>Automatically take Screenshot at application launch.</description>
</key>
<key name="autolinks" type="b">
<default>false</default>
<summary>Open QR-code links</summary>
Expand Down
5 changes: 5 additions & 0 deletions data/ui/preferences_general.blp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ template $PreferencesGeneralPage : Adw.PreferencesPage {
use-underline: true;
subtitle: _("Automatically open links from QR-codes");
}
Adw.SwitchRow autoscreen_switch {
title: _("_Take Screenshot at start");
use-underline: true;
subtitle: _("Automatically take Screenshot at start");
}
}

Adw.PreferencesGroup {
Expand Down
3 changes: 2 additions & 1 deletion frog/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ def __init__(self, version=None):

def do_startup(self, *args, **kwargs):
Adw.Application.do_startup(self)

# create command line option entries
shortcut_entry = GLib.OptionEntry()
shortcut_entry.long_name = 'extract_to_clipboard'
Expand Down Expand Up @@ -113,6 +112,8 @@ def do_startup(self, *args, **kwargs):
self.create_action('github_star', self.on_github_star)

self.settings.connect("changed", self.on_settings_changed)
if self.settings.get_boolean('autoscreen'):
self.backend.capture(self.settings.get_string("active-language"), True)

def do_activate(self):
win = self.props.active_window
Expand Down
2 changes: 2 additions & 0 deletions frog/widgets/preferences_general_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class PreferencesGeneralPage(Adw.PreferencesPage):
extra_language_combo: Adw.ComboRow = Gtk.Template.Child()
autocopy_switch: Adw.SwitchRow = Gtk.Template.Child()
autolinks_switch: Adw.SwitchRow = Gtk.Template.Child()
autoscreen_switch: Adw.SwitchRow = Gtk.Template.Child()
telemetry_switch: Adw.SwitchRow = Gtk.Template.Child()

def __init__(self):
Expand All @@ -50,6 +51,7 @@ def __init__(self):

self.settings.bind('autocopy', self.autocopy_switch, 'active', Gio.SettingsBindFlags.DEFAULT)
self.settings.bind('autolinks', self.autolinks_switch, 'active', Gio.SettingsBindFlags.DEFAULT)
self.settings.bind('autoscreen', self.autoscreen_switch, 'active', Gio.SettingsBindFlags.DEFAULT)
self.settings.bind('telemetry', self.telemetry_switch, 'active', Gio.SettingsBindFlags.DEFAULT)

downloaded_langs = language_manager.get_downloaded_languages()
Expand Down