Skip to content
This repository has been archived by the owner on Mar 22, 2018. It is now read-only.

Commit

Permalink
added a 'home' button to get back to the initial splash screen.
Browse files Browse the repository at this point in the history
relates to #228.
  • Loading branch information
mfrasca committed Dec 20, 2015
1 parent 5fc181e commit 2094b32
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 84 deletions.
178 changes: 99 additions & 79 deletions bauble/bauble.glade
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,26 @@
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkButton" id="home_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<child>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-home</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="query_button">
<property name="visible">True</property>
Expand All @@ -52,7 +72,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
<property name="position">1</property>
</packing>
</child>
<child>
Expand All @@ -78,7 +98,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">2</property>
</packing>
</child>
<child>
Expand All @@ -99,7 +119,7 @@
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">5</property>
<property name="position">2</property>
<property name="position">3</property>
</packing>
</child>
</object>
Expand Down Expand Up @@ -182,6 +202,82 @@
<column type="gchararray"/>
</columns>
</object>
<object class="GtkWindow" id="notes_window">
<property name="can_focus">False</property>
<child>
<object class="GtkScrolledWindow" id="notes_scrolledwindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property>
<child>
<object class="GtkTreeView" id="notes_treeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="model">notes_liststore</property>
<property name="headers_clickable">False</property>
<property name="reorderable">True</property>
<child>
<object class="GtkTreeViewColumn" id="date_column">
<property name="title">Date</property>
<child>
<object class="GtkCellRendererText" id="date_cell">
<property name="xalign">0</property>
<property name="yalign">0</property>
</object>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="name_column">
<property name="title">Name</property>
<child>
<object class="GtkCellRendererText" id="name_cell">
<property name="xalign">0</property>
<property name="yalign">0</property>
</object>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="category_column">
<property name="title">Category</property>
<child>
<object class="GtkCellRendererText" id="category_cell">
<property name="xalign">0</property>
<property name="yalign">0</property>
</object>
<attributes>
<attribute name="text">2</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="note_column">
<property name="title">Note</property>
<child>
<object class="GtkCellRendererText" id="note_cell">
<property name="xalign">0</property>
<property name="yalign">0</property>
</object>
<attributes>
<attribute name="text">3</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
<object class="GtkWindow" id="search_window">
<property name="can_focus">True</property>
<child>
Expand Down Expand Up @@ -265,80 +361,4 @@
</object>
</child>
</object>
<object class="GtkWindow" id="notes_window">
<property name="can_focus">False</property>
<child>
<object class="GtkScrolledWindow" id="notes_scrolledwindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property>
<child>
<object class="GtkTreeView" id="notes_treeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="model">notes_liststore</property>
<property name="headers_clickable">False</property>
<property name="reorderable">True</property>
<child>
<object class="GtkTreeViewColumn" id="date_column">
<property name="title">Date</property>
<child>
<object class="GtkCellRendererText" id="date_cell">
<property name="xalign">0</property>
<property name="yalign">0</property>
</object>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="name_column">
<property name="title">Name</property>
<child>
<object class="GtkCellRendererText" id="name_cell">
<property name="xalign">0</property>
<property name="yalign">0</property>
</object>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="category_column">
<property name="title">Category</property>
<child>
<object class="GtkCellRendererText" id="category_cell">
<property name="xalign">0</property>
<property name="yalign">0</property>
</object>
<attributes>
<attribute name="text">2</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="note_column">
<property name="title">Note</property>
<child>
<object class="GtkCellRendererText" id="note_cell">
<property name="xalign">0</property>
<property name="yalign">0</property>
</object>
<attributes>
<attribute name="text">3</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>
19 changes: 14 additions & 5 deletions bauble/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,14 @@ def __init__(self):
gtk.gdk.CONTROL_MASK, gtk.ACCEL_VISIBLE)
self.window.add_accel_group(accel_group)

go_button = self.widgets.go_button
go_button.connect('clicked', self.on_go_button_clicked)
self.widgets.home_button.connect(
'clicked', self.on_home_button_clicked)

query_button = self.widgets.query_button
query_button.connect('clicked', self.on_query_button_clicked)
self.widgets.go_button.connect(
'clicked', self.on_go_button_clicked)

self.widgets.query_button.connect(
'clicked', self.on_query_button_clicked)

self.set_default_view()

Expand Down Expand Up @@ -250,6 +253,11 @@ def send_command(self, command):
def on_main_entry_activate(self, widget, data=None):
self.widgets.go_button.emit("clicked")

def on_home_button_clicked(self, widget):
'''
'''
bauble.command_handler('home', None)

def on_go_button_clicked(self, widget):
'''
'''
Expand Down Expand Up @@ -444,7 +452,8 @@ def create_main_menu(self):
self.clear_menu('/ui/MenuBar/insert_menu')
self.clear_menu('/ui/MenuBar/tools_menu')

self.insert_menu = self.ui_manager.get_widget('/ui/MenuBar/insert_menu')
self.insert_menu = self.ui_manager.get_widget(
'/ui/MenuBar/insert_menu')
return self.menubar

def clear_menu(self, path):
Expand Down

0 comments on commit 2094b32

Please sign in to comment.