From 037d05babfb342fe336db32ed892d4f9df09456b Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 17 Jul 2019 19:29:39 +1000 Subject: [PATCH] Move the error perspective to the main window No need to have a separate file for a few lines of code --- po/POTFILES | 1 - tuhigui/errorperspective.py | 28 ---------------------------- tuhigui/window.py | 18 ++++++++++++++++-- 3 files changed, 16 insertions(+), 31 deletions(-) delete mode 100644 tuhigui/errorperspective.py diff --git a/po/POTFILES b/po/POTFILES index cb6db2e..f6f6bb7 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -12,7 +12,6 @@ tuhigui/application.py tuhigui/config.py tuhigui/drawing.py tuhigui/drawingperspective.py -tuhigui/errorperspective.py tuhigui/setupdialog.py tuhigui/svg.py tuhigui/tuhi.py diff --git a/tuhigui/errorperspective.py b/tuhigui/errorperspective.py deleted file mode 100644 index 1c02879..0000000 --- a/tuhigui/errorperspective.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python3 -# -# 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 2 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. -# -from gi.repository import GObject, Gtk - -import gi -gi.require_version("Gtk", "3.0") - - -@Gtk.Template(resource_path="/org/freedesktop/TuhiGui/ui/ErrorPerspective.ui") -class ErrorPerspective(Gtk.Box): - __gtype_name__ = "ErrorPerspective" - - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - - @GObject.Property - def name(self): - return "error_perspective" diff --git a/tuhigui/window.py b/tuhigui/window.py index f27b61a..4a73d1d 100644 --- a/tuhigui/window.py +++ b/tuhigui/window.py @@ -11,11 +11,10 @@ # GNU General Public License for more details. # -from gi.repository import Gtk, Gio, GLib +from gi.repository import Gtk, Gio, GLib, GObject from .setupdialog import SetupDialog from .drawingperspective import DrawingPerspective -from .errorperspective import ErrorPerspective from .tuhi import TuhiKeteManager from .config import Config @@ -57,6 +56,21 @@ MENU_XML = """ """ +@Gtk.Template(resource_path="/org/freedesktop/TuhiGui/ui/ErrorPerspective.ui") +class ErrorPerspective(Gtk.Box): + ''' + The page loaded when we cannot connect to the Tuhi DBus server. + ''' + __gtype_name__ = "ErrorPerspective" + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + @GObject.Property + def name(self): + return "error_perspective" + + @Gtk.Template(resource_path='/org/freedesktop/TuhiGui/ui/MainWindow.ui') class MainWindow(Gtk.ApplicationWindow): __gtype_name__ = 'MainWindow'