File tree 5 files changed +14
-6
lines changed
5 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 28
28
29
29
class Application (Gtk .Application ):
30
30
"""Authenticator application object."""
31
+ instance = None
31
32
32
33
def __init__ (self ):
33
34
Gtk .Application .__init__ (self ,
@@ -38,6 +39,12 @@ def __init__(self):
38
39
self .alive = True
39
40
self .menu = Gio .Menu ()
40
41
42
+ @staticmethod
43
+ def get_default ():
44
+ if Application .instance is None :
45
+ Application .instance = Application ()
46
+ return Application .instance
47
+
41
48
def setup_css (self ):
42
49
"""Setup the CSS and load it."""
43
50
if Gtk .get_major_version () >= 3 and Gtk .get_minor_version () >= 20 :
Original file line number Diff line number Diff line change @@ -146,9 +146,11 @@ def _build_widgets(self):
146
146
self .pack_end (right_box )
147
147
148
148
def generate_popover (self , box ):
149
+ from ..application import Application
150
+ menu = Application .get_default ().menu
149
151
self .settings_btn .connect ("clicked" , self .toggle_popover )
150
152
self .popover = Gtk .Popover .new_from_model (self .settings_btn ,
151
- self . app . menu )
153
+ menu )
152
154
self .popover .props .width_request = 200
153
155
box .add (self .settings_btn )
154
156
Original file line number Diff line number Diff line change 1
- [ ![ Translation status] ( https://hosted.weblate.org/widgets/authenticator/-/svg-badge.svg )] ( https://hosted.weblate.org/engage/authenticator/?utm_source=widget ) ![ Status] ( https://img.shields.io/badge/status-stable-green.svg ) [ ![ Version] ( https://img.shields.io/badge/version-0.1.1-green.svg )] ( https://github.com/bilelmoussaoui/Authenticator/releases ) ![ Python
2
- version] ( https://img.shields.io/badge/python-3.3%2B-blue.svg )
1
+ [ ![ Translation status] ( https://hosted.weblate.org/widgets/authenticator/-/svg-badge.svg )] ( https://hosted.weblate.org/engage/authenticator/?utm_source=widget ) [ ![ Version] ( https://img.shields.io/badge/version-0.2.1-green.svg )] ( https://github.com/bilelmoussaoui/Authenticator/releases )
3
2
4
3
# Authenticator
5
4
<img src =" https://raw.githubusercontent.com/bilelmoussaoui/Authenticator/master/data/icons/hicolor/256x256/apps/com.github.bilelmoussaoui.Authenticator.png " width =" 128 " height =" 128 " />
@@ -18,7 +17,7 @@ version](https://img.shields.io/badge/python-3.3%2B-blue.svg)
18
17
## Installation
19
18
20
19
### Flatpak
21
- You can install the flatpak package of the application from flathub using
20
+ You can install the flatpak package of the application from flathub using
22
21
```
23
22
flatpak install flathub com.github.bilelmoussaoui.Authenticator
24
23
```
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ if __name__ == "__main__":
60
60
sys .exit ("Version : " + str (VERSION ))
61
61
else :
62
62
try :
63
- app = Application ()
63
+ app = Application . get_default ()
64
64
exit_status = app .run (None )
65
65
sys .exit (exit_status )
66
66
except KeyboardInterrupt :
Original file line number Diff line number Diff line change 1
1
project (' com.github.bilelmoussaoui.Authenticator' ,
2
- version : ' 0.2' ,
2
+ version : ' 0.2.1 ' ,
3
3
meson_version : ' >= 0.40' ,
4
4
license : ' GPL+-3.0' ,
5
5
default_options : [' prefix=/usr' ]
You can’t perform that action at this time.
0 commit comments