Skip to content
Browse files

Removed the Note display in the program. Now double clicking on a not…

…e will open it up with your configured text editor. I will probably do a default to notepad or something in the next commit
  • Loading branch information...
1 parent 3bc8c30 commit 72e26c0815b2da8837338329e71c4c214c83c32c @Lugghawk committed Sep 23, 2011
Showing with 162 additions and 206 deletions.
  1. +147 −200 src/notes/main.glade
  2. +15 −6 src/notes/ui.py
View
347 src/notes/main.glade
@@ -15,309 +15,256 @@
<property name="border_width">6</property>
<property name="title" translatable="yes">Session Note</property>
<property name="window_position">center</property>
- <property name="default_width">900</property>
<property name="default_height">600</property>
<signal name="destroy" handler="on_mainWindow_destroy"/>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
+ <property name="border_width">10</property>
<property name="orientation">vertical</property>
<child>
- <object class="GtkHBox" id="hbox1">
+ <object class="GtkVBox" id="vbox2">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<child>
- <object class="GtkVBox" id="vbox2">
+ <object class="GtkHBox" id="hbox6">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
<child>
- <object class="GtkHBox" id="hbox6">
+ <object class="GtkEntry" id="searchField">
<property name="visible">True</property>
- <child>
- <object class="GtkEntry" id="searchField">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">&#x25CF;</property>
- <signal name="activate" handler="searchNotes"/>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="searchButton">
- <property name="label" translatable="yes">Search</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <signal name="clicked" handler="searchNotes"/>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
+ <signal name="activate" handler="searchNotes"/>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkScrolledWindow" id="scrolledwindow1">
+ <object class="GtkButton" id="searchButton">
+ <property name="label" translatable="yes">Search</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="hscrollbar_policy">never</property>
- <property name="vscrollbar_policy">automatic</property>
- <child>
- <object class="GtkTreeView" id="noteListView">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="border_width">5</property>
- <property name="model">noteList</property>
- <property name="headers_clickable">False</property>
- <property name="enable_tree_lines">True</property>
- <signal name="select_cursor_row" handler="show_highlighted_note"/>
- <signal name="row_activated" handler="show_highlighted_note"/>
- <child>
- <object class="GtkTreeViewColumn" id="treeviewcolumn1">
- <property name="title">Notes</property>
- <property name="clickable">True</property>
- <child>
- <object class="GtkCellRendererText" id="noteNameText"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkTreeViewColumn" id="treeviewcolumn2">
- <property name="title">Creator</property>
- <property name="clickable">True</property>
- <child>
- <object class="GtkCellRendererText" id="creatorNameText"/>
- <attributes>
- <attribute name="text">1</attribute>
- </attributes>
- </child>
- </object>
- </child>
- </object>
- </child>
+ <property name="receives_default">True</property>
+ <signal name="clicked" handler="searchNotes"/>
</object>
<packing>
- <property name="padding">10</property>
- <property name="position">2</property>
+ <property name="expand">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">1</property>
</packing>
</child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="vscrollbar_policy">automatic</property>
<child>
- <object class="GtkHButtonBox" id="hbuttonbox1">
+ <object class="GtkTreeView" id="noteListView">
<property name="visible">True</property>
- <property name="spacing">20</property>
- <property name="layout_style">center</property>
+ <property name="can_focus">True</property>
+ <property name="border_width">5</property>
+ <property name="model">noteList</property>
+ <property name="search_column">0</property>
+ <property name="enable_tree_lines">True</property>
+ <signal name="row_activated" handler="show_highlighted_note"/>
<child>
- <object class="GtkButton" id="refreshButton">
- <property name="label" translatable="yes">Refresh Notes</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn1">
+ <property name="resizable">True</property>
+ <property name="title">Notes</property>
+ <child>
+ <object class="GtkCellRendererText" id="noteNameText"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </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="newNoteButton">
- <property name="label" translatable="yes">New Note</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn2">
+ <property name="title">Creator</property>
+ <child>
+ <object class="GtkCellRendererText" id="creatorNameText"/>
+ <attributes>
+ <attribute name="text">1</attribute>
+ </attributes>
+ </child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">1</property>
- </packing>
</child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="position">0</property>
+ <property name="padding">10</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
- <object class="GtkVBox" id="vbox3">
+ <object class="GtkHBox" id="hbox3">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="spacing">20</property>
<child>
- <object class="GtkHBox" id="hbox3">
+ <object class="GtkVBox" id="vbox6">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<child>
- <object class="GtkVBox" id="vbox6">
+ <object class="GtkHBox" id="hbox2">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
<child>
- <object class="GtkHBox" id="hbox5">
+ <object class="GtkLabel" id="label1">
<property name="visible">True</property>
- <child>
- <object class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="extension_events">all</property>
- <property name="label" translatable="yes">E-mail: </property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="userEmailLabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Not Set!</property>
- </object>
- <packing>
- <property name="pack_type">end</property>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="label" translatable="yes">Name: </property>
</object>
<packing>
- <property name="pack_type">end</property>
- <property name="position">1</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox2">
+ <object class="GtkLabel" id="usernameLabel">
<property name="visible">True</property>
- <child>
- <object class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Name: </property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="usernameLabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Not Set!</property>
- </object>
- <packing>
- <property name="pack_type">end</property>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="label" translatable="yes">Not Set!</property>
</object>
<packing>
<property name="pack_type">end</property>
- <property name="position">0</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="vbox5">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkScrolledWindow" id="scrolledwindow2">
+ <object class="GtkHBox" id="hbox5">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">etched-in</property>
<child>
- <object class="GtkTextView" id="noteView">
+ <object class="GtkLabel" id="label3">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="border_width">5</property>
- <property name="editable">False</property>
- <property name="cursor_visible">False</property>
- <property name="buffer">noteBuffer</property>
+ <property name="extension_events">all</property>
+ <property name="label" translatable="yes">E-mail: </property>
</object>
- </child>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox4">
- <property name="visible">True</property>
- <child>
- <placeholder/>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
- <object class="GtkButton" id="configureButton">
- <property name="label" translatable="yes">Configure...</property>
- <property name="width_request">75</property>
- <property name="height_request">30</property>
+ <object class="GtkLabel" id="userEmailLabel">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <signal name="clicked" handler="showConfigDialog"/>
+ <property name="label" translatable="yes">Not Set!</property>
</object>
<packing>
- <property name="expand">False</property>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox4">
+ <property name="visible">True</property>
+ <property name="border_width">3</property>
+ <child>
+ <object class="GtkButton" id="button1">
+ <property name="label" translatable="yes">Configure</property>
+ <property name="width_request">90</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <signal name="clicked" handler="showConfigDialog"/>
+ </object>
+ <packing>
<property name="expand">False</property>
<property name="pack_type">end</property>
- <property name="position">1</property>
+ <property name="position">0</property>
</packing>
</child>
</object>
<packing>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHButtonBox" id="hbuttonbox1">
+ <property name="visible">True</property>
+ <property name="spacing">20</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="refreshButton">
+ <property name="label" translatable="yes">Refresh Notes</property>
+ <property name="width_request">90</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="newNoteButton">
+ <property name="label" translatable="yes">New Note</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
- <property name="padding">10</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
- <property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkStatusbar" id="statusbar1">
<property name="visible">True</property>
- <property name="spacing">2</property>
+ <property name="spacing">1</property>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">False</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
View
21 src/notes/ui.py
@@ -12,6 +12,7 @@
import mypygit
import pickle
import time
+import subprocess
try:
import pygtk
@@ -30,6 +31,13 @@ class UI:
def on_mainWindow_destroy (self, widget, data=None):
gtk.main_quit()
+ def openNoteWithEditor (self,noteName):
+
+ notePath = '"'+os.path.normcase(self.configuration.text_editor_location) + '" "' + os.path.normcase(noteName)+'"'
+ #print "Opening '"+notePath+"'"
+ #subprocess.call (notePath)
+ subprocess.Popen (notePath)
+
def get_note_name(self, treeView, path):
#Pretty dirty way to return the value of the first column in the selected row
#This function takes a treeView object, and path object given to this function by a gtk event handler.
@@ -40,9 +48,13 @@ def get_note_name(self, treeView, path):
def show_highlighted_note(self, treeview, path, view_column, userData=None):
#This will copy the text in the session note into noteBuffer and display it.
noteBuffer = self.builder.get_object("noteBuffer")
- note = open (self.configuration.getRepoLocation() + "\\" + str(self.get_note_name(treeview, path)))
+ notePath = self.configuration.getRepoLocation() + "\\" + str(self.get_note_name(treeview, path))
+
+
+ self.openNoteWithEditor(notePath)
+ #note = open (notePath)
+ #noteBuffer.set_text(note.read())
- noteBuffer.set_text(note.read())
def list_object_names(self):
objects = self.builder.get_objects()
@@ -77,9 +89,6 @@ def __init__(self):
self.doConfig()
-
-
-
def createWindows(self):
t1 = time.clock()
@@ -184,7 +193,7 @@ def saveConfigFromDialog(self, event, UserData=None):
self.configuration.session_note_repo_location = self.getFileChooserValue("repoLocationField")
- self.configuration.text_editor_location = self.getFileChooserValue("editorPathChooser")
+ self.configuration.text_editor_location = self.getFileChooserValue("editorPathChooser").replace("%20"," ")
self.configuration.user_note_template = self.getFileChooserValue("templateChooserButton")
self.setFieldValue("userEmailLabel", self.configuration.user_email)

0 comments on commit 72e26c0

Please sign in to comment.
Something went wrong with that request. Please try again.