Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
countdown
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bruce Cowan
countdown
Commits
603a1e19
Verified
Commit
603a1e19
authored
2 years ago
by
Bruce Cowan
Browse files
Options
Downloads
Patches
Plain Diff
Only import modules, not classes from modules
parent
0264e1b6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
countdown/applicationwindow.py
+4
-6
4 additions, 6 deletions
countdown/applicationwindow.py
countdown/countdown.in
+3
-2
3 additions, 2 deletions
countdown/countdown.in
countdown/main.py
+5
-9
5 additions, 9 deletions
countdown/main.py
with
12 additions
and
17 deletions
countdown/applicationwindow.py
+
4
−
6
View file @
603a1e19
...
...
@@ -4,9 +4,7 @@
from
gi.repository
import
Adw
,
GObject
,
Gtk
from
.digitalclock
import
DigitalClock
from
.countdownlabel
import
CountdownLabel
from
.timepopover
import
TimePopover
from
countdown
import
countdownlabel
,
digitalclock
,
timepopover
@Gtk.Template
(
resource_path
=
"
/uk/me/bcowan/Countdown/ui/countdown.ui
"
)
...
...
@@ -19,12 +17,12 @@ class ApplicationWindow(Gtk.ApplicationWindow):
def
__init__
(
self
,
app
:
Gtk
.
Application
):
super
().
__init__
(
application
=
app
)
set_time_popover
=
TimePopover
()
set_time_popover
=
timepopover
.
TimePopover
()
self
.
_set_time_button
.
props
.
popover
=
set_time_popover
self
.
_clock
=
DigitalClock
()
self
.
_clock
=
digitalclock
.
DigitalClock
()
self
.
_main_box
.
append
(
self
.
_clock
)
self
.
_count
=
CountdownLabel
()
self
.
_count
=
countdownlabel
.
CountdownLabel
()
self
.
_main_box
.
append
(
self
.
_count
)
set_time_popover
.
bind_property
(
...
...
This diff is collapsed.
Click to expand it.
countdown/countdown.in
+
3
−
2
View file @
603a1e19
#!@PYTHON@
# SPDX-FileCopyrightText: 2018 Bruce Cowan <bruce@bcowan.me.uk>
# SPDX-FileCopyrightText: 2018-2022 Bruce Cowan <bruce@bcowan.me.uk>
#
# SPDX-License-Identifier: LGPL-3.0-or-later
import os
import sys
import signal
import gettext
pkgdatadir = "@pkgdatadir@"
sys.path.insert(1, pkgdatadir)
signal.signal(signal.SIGINT, signal.SIG_DFL)
if __name__ == "__main__":
import gi
...
...
This diff is collapsed.
Click to expand it.
countdown/main.py
+
5
−
9
View file @
603a1e19
...
...
@@ -7,26 +7,22 @@ from __future__ import annotations
import
sys
import
gi
gi
.
require_version
(
"
Adw
"
,
"
1
"
)
gi
.
require_version
(
"
Gdk
"
,
"
4.0
"
)
gi
.
require_version
(
"
Gtk
"
,
"
4.0
"
)
from
gi.repository
import
Adw
,
Gio
,
GLib
,
Gtk
from
.aboutdialog
import
AboutDialog
from
.applicationwindow
import
ApplicationWindow
Adw
.
init
()
from
countdown
import
aboutdialog
,
applicationwindow
class
Application
(
Adw
.
Application
):
def
__init__
(
self
):
def
__init__
(
self
)
->
None
:
super
().
__init__
(
application_id
=
"
uk.me.bcowan.Countdown
"
)
def
do_activate
(
self
)
->
None
:
win
=
self
.
props
.
active_window
if
not
win
:
win
=
ApplicationWindow
(
self
)
win
=
applicationwindow
.
ApplicationWindow
(
self
)
win
.
show
()
...
...
@@ -37,8 +33,8 @@ class Application(Adw.Application):
about_action
.
connect
(
"
activate
"
,
self
.
_on_about
)
self
.
add_action
(
about_action
)
def
_on_about
(
self
,
action
:
Gio
.
SimpleAction
,
param
:
GLib
.
Variant
|
None
):
dialogue
=
AboutDialog
()
def
_on_about
(
self
,
action
:
Gio
.
SimpleAction
,
param
:
GLib
.
Variant
|
None
)
->
None
:
dialogue
=
aboutdialog
.
AboutDialog
()
dialogue
.
props
.
transient_for
=
self
.
props
.
active_window
dialogue
.
show
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment