Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/hamster-cli
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ class HamsterClient(object):
glib.set_prgname(unicode(_("Time Tracker")).encode("utf-8"))

from hamster import today
app = today.DailyView()
if args:
hidden = args[0]
else:
hidden = False
app = today.DailyView(hidden)
gtk.main()

def _launch_window(self, window_name):
Expand Down Expand Up @@ -164,6 +168,8 @@ class HamsterClient(object):
formats = [f for f in formats if not chosen or f.startswith(chosen)]
print "\n".join(formats)

def hidden(self):
self.today(True)

def toggle(self):
self.storage.toggle()
Expand Down
6 changes: 5 additions & 1 deletion src/hamster/today.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def on_quit(self, data):


class DailyView(object):
def __init__(self):
def __init__(self, start_hidden=False):
# initialize the window. explicitly set it to None first, so that the
# creator knows it doesn't yet exist.
self.window = None
Expand Down Expand Up @@ -134,6 +134,10 @@ def __init__(self):

self.reposition_hamster_window()
self.show_hamster_window()

if start_hidden is True:
self.close_window()

self.show_in_tray()

def create_hamster_window(self):
Expand Down