gui

package
v0.0.0-...-c68073a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2026 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ActionIconMapping = map[string]string{
	"install":     "icons/install.png",
	"uninstall":   "icons/uninstall.png",
	"update":      "icons/update.png",
	"refresh":     "icons/refresh.png",
	"update-file": "icons/update.png",
	"daemon":      "icons/none-24.png",
}

ActionIconMapping maps actions to icon paths

View Source
var StatusIconMapping = map[string]string{
	"waiting":         "icons/wait.png",
	"in-progress":     "icons/prompt.png",
	"success":         "icons/success.png",
	"failure":         "icons/failure.png",
	"diagnosed":       "icons/failure.png",
	"daemon-complete": "icons/success.png",
}

StatusIconMapping maps status to icon paths

Functions

func CreateAppListTreeView

func CreateAppListTreeView() (*gtk.TreeView, *gtk.ListStore, error)

CreateAppListTreeView creates a GTK TreeView configured for displaying app lists

func DisplayUnsupportedSystemWarning

func DisplayUnsupportedSystemWarning(message string, useGUI bool)

DisplayUnsupportedSystemWarning shows a formatted warning message for unsupported systems

func GetSelectedAppPath

func GetSelectedAppPath(treeView *gtk.TreeView) (string, error)

GetSelectedAppPath gets the path of the currently selected item

func PopulateGTKTreeView

func PopulateGTKTreeView(treeView *gtk.TreeView, list *PreloadedList) error

PopulateGTKTreeView populates a GTK TreeView with the preloaded app list

func ProgressMonitor

func ProgressMonitor(queue []QueueItem) error

ProgressMonitor shows a dialog with the current progress of operations

func ProgressMonitorDaemon

func ProgressMonitorDaemon(queue []QueueItem) error

ProgressMonitorDaemon shows a progress dialog that doesn't auto-close (for daemon mode)

func ProgressMonitorWithOptions

func ProgressMonitorWithOptions(queue []QueueItem, daemonMode bool) error

ProgressMonitorWithOptions shows a dialog with the current progress of operations

func ShowBrokenPackagesDialog

func ShowBrokenPackagesDialog() (string, error)

ShowBrokenPackagesDialog shows a dialog to enter sudo password for repairing broken package repositories

func ShowErrorDialogWithRetry

func ShowErrorDialogWithRetry(appName, action, message string) bool

ShowErrorDialogWithRetry shows an error dialog with retry option Returns true if user chose to retry, false if they chose to skip

func ShowMessageDialog

func ShowMessageDialog(title, message string, dialogType int)

ShowMessageDialog shows a simple message dialog

func ShowSummaryDialog

func ShowSummaryDialog(completedQueue []QueueItem) error

ShowSummaryDialog shows a summary of completed actions with donation reminders

func ShowUpdateConfirmDialog

func ShowUpdateConfirmDialog(appName, scriptName string) bool

test only

Types

type AppListConfig

type AppListConfig struct {
	Directory string
	Prefix    string
	Format    string // "gtk" (GTK3 native instead of yad/xlunch)
}

AppListConfig holds configuration for app list generation

type AppListItem

type AppListItem struct {
	Type        string // "app", "category", "back"
	Name        string
	Path        string // For navigation (category paths)
	Description string
	IconPath    string
	Status      string // "installed", "uninstalled", "corrupted", "disabled", ""
	IsUpdates   bool   // Special Updates category
}

AppListItem represents a single item in the app list

type DirectoryInfo

type DirectoryInfo struct {
	Path       string
	ModTime    int64
	LatestFile string
}

DirectoryInfo holds information about directories to check for changes

type GUI

type GUI struct {
	// contains filtered or unexported fields
}

GUI represents the main Pi-Apps GUI application

func NewGUI

func NewGUI(config GUIConfig) (*GUI, error)

NewGUI creates a new GUI instance

func (*GUI) Cleanup

func (g *GUI) Cleanup()

Cleanup performs cleanup operations

func (*GUI) GetMessageOfTheDay

func (g *GUI) GetMessageOfTheDay() string

GetMessageOfTheDay gets the current message of the day

func (*GUI) Initialize

func (g *GUI) Initialize() error

Initialize sets up the GUI environment and dependencies

func (*GUI) Run

func (g *GUI) Run() error

Run starts the main GUI application

func (*GUI) ShowAppDetailsForDialog

func (g *GUI) ShowAppDetailsForDialog(appName string)

ShowAppDetailsForDialog shows app details dialog for separate process (used by --show-app-details)

type GUIConfig

type GUIConfig struct {
	Directory string
	GuiMode   string
}

GUIConfig holds configuration for the GUI

type ImGuiConfig

type ImGuiConfig struct {
	Width  int
	Height int
	Theme  string
}

func DefaultImGuiConfig

func DefaultImGuiConfig() ImGuiConfig

type ImGuiGUI

type ImGuiGUI struct {
	// contains filtered or unexported fields
}

func NewImGuiGUI

func NewImGuiGUI(directory string, config ImGuiConfig) *ImGuiGUI

func (*ImGuiGUI) Cleanup

func (gui *ImGuiGUI) Cleanup()

func (*ImGuiGUI) Close

func (gui *ImGuiGUI) Close()

func (*ImGuiGUI) Initialize

func (gui *ImGuiGUI) Initialize() error

func (*ImGuiGUI) Run

func (gui *ImGuiGUI) Run() error

type PreloadedList

type PreloadedList struct {
	Items     []AppListItem
	Prefix    string
	Generated time.Time
}

PreloadedList contains the preloaded app list data

func PreloadAppList

func PreloadAppList(directory, prefix string) (*PreloadedList, error)

PreloadAppList generates or loads a cached app list

type QueueItem

type QueueItem struct {
	Action         string // install, uninstall, update, refresh
	AppName        string
	Status         string // waiting, in-progress, success, failure
	IconPath       string
	ErrorMessage   string // Error message if the operation failed
	ForceReinstall bool
}

QueueItem represents an item in the installation/uninstallation queue

func ValidateAppsGUI

func ValidateAppsGUI(queue []QueueItem) ([]QueueItem, error)

ValidateAppsGUI validates a list of apps and shows appropriate dialogs for invalid apps or asks for confirmation for certain operations. Returns the validated queue of operations.

type TimeStampChecker

type TimeStampChecker struct {
	Directory   string
	CheckedDirs []DirectoryInfo
}

TimeStampChecker manages timestamp checking for change detection

func NewTimeStampChecker

func NewTimeStampChecker(directory string) *TimeStampChecker

NewTimeStampChecker creates a new timestamp checker

func (*TimeStampChecker) GetTimestamps

func (tc *TimeStampChecker) GetTimestamps() string

GetTimestamps generates timestamp information for all monitored directories

func (*TimeStampChecker) HasChanged

func (tc *TimeStampChecker) HasChanged(prefix string) (bool, error)

HasChanged checks if any monitored directory has changed since the last check

func (*TimeStampChecker) SaveTimestamps

func (tc *TimeStampChecker) SaveTimestamps(prefix string) error

SaveTimestamps saves current timestamps to file

type WindowGeometry

type WindowGeometry struct {
	Width   int
	Height  int
	XOffset int
	YOffset int
}

WindowGeometry holds window position and size information

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL