diff --git a/go.mod b/go.mod index abfe5ff..58b8632 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,6 @@ require ( github.com/gen2brain/shm v0.1.0 // indirect github.com/go-viper/mapstructure/v2 v2.4.0 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect - github.com/gotk3/gotk3 v0.6.5-0.20251124190141-e7a9e823ca35 github.com/jezek/xgb v1.1.1 // indirect github.com/lxn/win v0.0.0-20210218163916-a377121e959e // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect diff --git a/go.sum b/go.sum index a03fcb7..5d866fb 100644 --- a/go.sum +++ b/go.sum @@ -12,10 +12,6 @@ github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/gotk3/gotk3 v0.6.4 h1:5ur/PRr86PwCG8eSj98D1eXvhrNNK6GILS2zq779dCg= -github.com/gotk3/gotk3 v0.6.4/go.mod h1:/hqFpkNa9T3JgNAE2fLvCdov7c5bw//FHNZrZ3Uv9/Q= -github.com/gotk3/gotk3 v0.6.5-0.20251124190141-e7a9e823ca35 h1:BelWQzAzJfSMA1qbuzoV9Tp57+NCvYouEA5cWVpYcSk= -github.com/gotk3/gotk3 v0.6.5-0.20251124190141-e7a9e823ca35/go.mod h1:/hqFpkNa9T3JgNAE2fLvCdov7c5bw//FHNZrZ3Uv9/Q= github.com/jezek/xgb v1.1.1 h1:bE/r8ZZtSv7l9gk6nU0mYx51aXrvnyb44892TwSaqS4= github.com/jezek/xgb v1.1.1/go.mod h1:nrhwO0FX/enq75I7Y7G8iN1ubpSGZEiA3v9e9GyRFlk= github.com/kbinani/screenshot v0.0.0-20250624051815-089614a94018 h1:NQYgMY188uWrS+E/7xMVpydsI48PMHcc7SfR4OxkDF4= diff --git a/internal/ui/builder.go b/internal/ui/builder.go deleted file mode 100644 index 47a1dbe..0000000 --- a/internal/ui/builder.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2025 Nikolai Papin -// -// This file is part of the Auto Attendance app that looks for -// self-attend QR-codes during lectures and opens their URLs in your -// browser. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -// the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -package ui - -import "github.com/gotk3/gotk3/gtk" - -func NewBuilder() (*gtk.Builder, error) { - - gtk.Init(nil) - - builder, err := gtk.BuilderNew() - if err != nil { - return nil, err - } - - return builder, nil -} diff --git a/internal/ui/mainwindow.go b/internal/ui/mainwindow.go deleted file mode 100644 index c10a021..0000000 --- a/internal/ui/mainwindow.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) 2025 Nikolai Papin -// -// This file is part of the Auto Attendance app that looks for -// self-attend QR-codes during lectures and opens their URLs in your -// browser. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -// the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -package ui - -import ( - "git.weirdcat.su/weirdcat/auto-attendance/internal/ui/resources" - "github.com/gotk3/gotk3/gtk" -) - -type MainWindow struct { - builder *gtk.Builder - window *gtk.Window -} - -func (m *MainWindow) Start() { - m.window.ShowAll() - go func() { gtk.Main() }() -} - -func NewMainWindow(builder *gtk.Builder) (*MainWindow, error) { - err := builder.AddFromString(string(resources.GladeMainWindow)) - if err != nil { - return nil, err - } - - windowObj, err := builder.GetObject("window_main") - if err != nil { - return nil, err - } - window := windowObj.(*gtk.Window) - window.Connect("destroy", func() { - gtk.MainQuit() - }) - - notebookObj, err := builder.GetObject("notebook_main") - if err != nil { - return nil, err - } - notebook := notebookObj.(*gtk.Notebook) - - mainPageObj, err := builder.GetObject("page_main") - if err != nil { - return nil, err - } - mainPage := mainPageObj.(*gtk.Grid) - - settingsPageObj, err := builder.GetObject("page_settings") - if err != nil { - return nil, err - } - settingsPage := settingsPageObj.(*gtk.Box) - - notebook.SetTabLabelText(mainPage, "Overview") - notebook.SetTabLabelText(settingsPage, "Settings") - - return &MainWindow{builder: builder, window: window}, nil -} diff --git a/internal/ui/resources/qrcode.png b/internal/ui/resources/qrcode.png deleted file mode 100644 index baeb4f1..0000000 Binary files a/internal/ui/resources/qrcode.png and /dev/null differ diff --git a/internal/ui/resources/resources.go b/internal/ui/resources/resources.go deleted file mode 100644 index 33d9fcb..0000000 --- a/internal/ui/resources/resources.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2025 Nikolai Papin -// -// This file is part of the Auto Attendance app that looks for -// self-attend QR-codes during lectures and opens their URLs in your -// browser. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -// the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -package resources - -import _ "embed" - -var ( - //go:embed window.glade - GladeMainWindow []byte - - //go:embed qrcode.png - QrCodePng []byte -) diff --git a/internal/ui/resources/window.glade b/internal/ui/resources/window.glade deleted file mode 100644 index e50eaf3..0000000 --- a/internal/ui/resources/window.glade +++ /dev/null @@ -1,367 +0,0 @@ - - - - - - 100 - 5000 - 500 - 100 - 500 - - - [ERROR] 2025-11-26 14:24:15 - Failed to fetch data from API: Timeout occurred after 30 seconds. -[ERROR] 2025-11-26 14:24:30 - Exception: NullReferenceException in ModuleX: Object reference not set to an instance of an object. - - - - window_main - False - 400 - 600 - zoom-best-fit - - - True - True - - - - App - True - False - True - True - - - True - True - bottom-left - in - - - True - True - 10 - 10 - 10 - 10 - False - word-char - console_output - terminal - True - - - - - 0 - 3 - - - - - - True - False - True - True - - - True - False - vertical - top - - - - - - True - False - vertical - - - - - - False - True - 1 - - - - - - - - 0 - 0 - - - - - 0 - 0 - 3 - - - - - True - False - - - - - Settings - True - False - 20 - 20 - 20 - 20 - vertical - 12 - - - True - False - 0 - none - - - True - False - 12 - 12 - 12 - 12 - vertical - 6 - - - Auto-scan for QR codes - True - True - False - True - True - - - False - True - 0 - - - - - Beep on successful scan - True - True - False - True - True - - - False - True - 1 - - - - - - - True - False - Scanning Options - - - - - - - - False - True - 0 - - - - - True - False - 0 - none - - - True - False - 12 - 12 - 12 - 12 - vertical - 6 - - - True - False - 6 - - - True - False - Scan interval (ms): - 0 - - - False - True - 0 - - - - - True - True - adjustment1 - 1 - True - True - 500 - - - False - True - 1 - - - - - False - True - 0 - - - - - True - False - 6 - - - True - False - Output format: - 0 - - - False - True - 0 - - - - - True - False - 0 - - Text - JSON - XML - URL - - - - False - True - 1 - - - - - False - True - 1 - - - - - - - True - False - Advanced Settings - - - - - - - - False - True - 1 - - - - - Save Settings - True - True - True - end - 12 - - - False - True - 2 - - - - - 1 - True - - - - - - - True - False - Qrminator - Offline - 1 - True - - - True - True - Toggle QR-searching - - - Toggle QR-handling - When enabled, program will search QR-codes on the screen and react to them according to user settings - - - - - - - True - False - True - - - 1 - - - - - -