Add misc screen

pull/6/head
axtloss 2 years ago
parent 6bc23e9137
commit 66b5725a14

@ -7,5 +7,6 @@ jade_gui_sources = [
'timezone_screen.py',
'user_screen.py',
'desktop_screen.py',
'misc_screen.py',
]
install_data(jade_gui_sources, install_dir: functionsdir)

@ -0,0 +1,36 @@
# misc_screen.py
#
# Copyright 2022 user
#
# 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 <http://www.gnu.org/licenses/>.
from gi.repository import Gtk, Adw
from gettext import gettext as _
@Gtk.Template(resource_path='/al/getcryst/jadegui/pages/misc_screen.ui')
class MiscScreen(Adw.Bin):
__gtype_name__ = "MiscScreen"
hostname_entry = Gtk.Template().Child()
ipv_switch = Gtk.Template().Child()
timeshift_switch = Gtk.Template().Child()
theme_switch = Gtk.Template().Child()
def __init__(self, window, main_carousel, next_page, application, **kwargs):
super().__init__(**kwargs)
self.window = window
self.carousel = main_carousel
self.next_page = next_page

@ -10,6 +10,7 @@
<file>pages/timezone_screen.ui</file>
<file>pages/user_screen.ui</file>
<file>pages/desktop_screen.ui</file>
<file>pages/misc_screen.ui</file>
<file>gtk/help-overlay.ui</file>
<file>crystal-logo-minimal.png</file>
</gresource>

@ -14,6 +14,7 @@ blueprints = custom_target('blueprints',
'pages/timezone_screen.blp',
'pages/user_screen.blp',
'pages/desktop_screen.blp',
'pages/misc_screen.blp',
),
output: '.',
command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'],

@ -0,0 +1,63 @@
using Gtk 4.0;
using Adw 1;
template MiscScreen : Adw.Bin {
hexpand: true;
vexpand: true;
Gtk.Box {
vexpand: true;
hexpand: true;
Adw.StatusPage {
hexpand: true;
vexpand: true;
title: "Miscellaneous";
description: "";
Adw.PreferencesPage {
Adw.PreferencesGroup {
Adw.EntryRow hostname_entry {
title: "enter the hostname";
}
Gtk.ListBox {
margin-top: 7;
styles [ "boxed-list" ]
Adw.ActionRow {
title: "Enable ipv6";
Gtk.Switch ipv_switch {
valign: center;
state: false;
}
}
Adw.ActionRow {
title: "Enable timeshift";
Gtk.Switch timeshift_switch {
valign: center;
state: true;
}
}
Adw.ActionRow {
title: "Enable crystal theming";
Gtk.Switch theme_switch {
valign: center;
state: false;
}
}
}
}
}
}
Gtk.Overlay {
[overlay]
Gtk.Button next_page_button {
margin-end: 20;
margin-bottom: 20;
label: "Next";
halign: end;
valign: end;
tooltip-text: "Move to next page";
styles ["suggested-action"]
}
}
}
}

@ -27,6 +27,7 @@ from .functions.keyboard_screen import KeyboardScreen
from .functions.timezone_screen import TimezoneScreen
from .functions.user_screen import UserScreen
from .functions.desktop_screen import DesktopScreen
from .functions.misc_screen import MiscScreen
@Gtk.Template(resource_path='/al/getcryst/jadegui/window.ui')
class JadeGuiWindow(Gtk.ApplicationWindow):
@ -44,7 +45,8 @@ class JadeGuiWindow(Gtk.ApplicationWindow):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.desktop_screen = DesktopScreen(window=self, main_carousel=self.carousel, next_page=None, **kwargs)
self.misc_screen = MiscScreen(window=self, main_carousel=self.carousel, next_page=None, **kwargs)
self.desktop_screen = DesktopScreen(window=self, main_carousel=self.carousel, next_page=self.misc_screen, **kwargs)
self.user_screen = UserScreen(window=self, main_carousel=self.carousel, next_page=self.desktop_screen, **kwargs)
self.keyboard_screen = KeyboardScreen(window=self, main_carousel=self.carousel, next_page=self.user_screen, **kwargs)
self.timezone_screen = TimezoneScreen(window=self, main_carousel=self.carousel, next_page=self.keyboard_screen, **kwargs)
@ -52,6 +54,7 @@ class JadeGuiWindow(Gtk.ApplicationWindow):
self.carousel.append(self.keyboard_screen)
self.carousel.append(self.user_screen)
self.carousel.append(self.desktop_screen)
self.carousel.append(self.misc_screen)
### Widgets for first page (welcome screen)
#self.quit_button.connect("clicked", self.confirmQuit)
self.next_button.connect("clicked", self.nextPage)

Loading…
Cancel
Save