3
3
from backend import Note, NoteSet
4
4
from gui import StickyNote
5
5
from gi.repository import Gtk, Gdk
6
from gi.repository import AppIndicator3 as appindicator
8
class IndicatorStickyNotes:
11
self.nset = NoteSet(StickyNote)
14
# Create App Indicator
15
self.ind = appindicator.Indicator.new(
16
"Sticky Notes", "accessories-text-editor",
17
appindicator.IndicatorCategory.APPLICATION_STATUS)
18
self.ind.set_status(appindicator.IndicatorStatus.ACTIVE)
19
self.ind.set_title("Sticky Notes")
20
#self.ind.set_attention_icon("pynagram")
22
self.menu = Gtk.Menu()
23
self.mNewNote = Gtk.MenuItem("New Note")
24
self.menu.append(self.mNewNote)
25
self.mNewNote.connect("activate", self.new_note, None)
28
s = Gtk.SeparatorMenuItem.new()
32
self.mShowAll = Gtk.MenuItem("Show All")
33
self.menu.append(self.mShowAll)
34
self.mShowAll.connect("activate", self.showall, None)
37
self.mHideAll = Gtk.MenuItem("Hide All")
38
self.menu.append(self.mHideAll)
39
self.mHideAll.connect("activate", self.hideall, None)
42
s = Gtk.SeparatorMenuItem.new()
46
self.mQuit = Gtk.MenuItem("Quit")
47
self.menu.append(self.mQuit)
48
self.mQuit.connect("activate", Gtk.main_quit, None)
50
# Connect Indicator to menu
51
self.ind.set_menu(self.menu)
53
def new_note(self, *args):
56
def showall(self, *args):
58
self.nset.showall(*args)
60
def hideall(self, *args):
8
nset = NoteSet(StickyNote)
68
indicator = IndicatorStickyNotes()
14
72
if __name__ == "__main__":