Merge lp:~alasdair-macleod/jokosher/store-window-size into lp:jokosher

Proposed by alasdair.macleod
Status: Merged
Merged at revision: not available
Proposed branch: lp:~alasdair-macleod/jokosher/store-window-size
Merge into: lp:jokosher
Diff against target: None lines
To merge this branch: bzr merge lp:~alasdair-macleod/jokosher/store-window-size
Reviewer Review Type Date Requested Status
Jokosher Code Pending
Review via email: mp+5196@code.launchpad.net
To post a comment you must log in.
Revision history for this message
alasdair.macleod (alasdair-macleod) wrote :

Added the storing of the window size for add instrument

Revision history for this message
Laszlo Pandy (laszlok) wrote :

What is the purpose of the OnDestroy function and the following comment:
"the current project can't be properly closed. This stops signal propagation."

Can you explain this more?

1081. By alasdair.macleod

Made changes requested from code review. Added the saving of window size after resize
to the Instrument Effects dialog.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Jokosher/AddInstrumentDialog.py'
--- Jokosher/AddInstrumentDialog.py 2008-12-18 19:07:15 +0000
+++ Jokosher/AddInstrumentDialog.py 2009-04-03 13:31:25 +0000
@@ -44,6 +44,7 @@
44 "on_OK_clicked" : self.OnOK,44 "on_OK_clicked" : self.OnOK,
45 "on_Cancel_clicked" : self.OnCancel,45 "on_Cancel_clicked" : self.OnCancel,
46 "on_instrument_search_changed" : self.OnSearchChange,46 "on_instrument_search_changed" : self.OnSearchChange,
47 "on_AddInstrument_configure_event" : self.OnResize,
47 }48 }
48 49
49 self.res.signal_autoconnect(self.signals)50 self.res.signal_autoconnect(self.signals)
@@ -87,8 +88,11 @@
87 88
88 self.tree.set_item_width(90)89 self.tree.set_item_width(90)
89 self.tree.set_size_request(72, -1)90 self.tree.set_size_request(72, -1)
90 self.dlg.resize(350, 300)91
91 92 self.width = int(Globals.settings.general["addinstrumentwindowwidth"])
93 self.height = int(Globals.settings.general["addinstrumentwindowheight"])
94 self.dlg.resize(self.width, self.height)
95
92 self.dlg.set_icon(self.parent.icon)96 self.dlg.set_icon(self.parent.icon)
93 self.dlg.set_transient_for(self.parent.window)97 self.dlg.set_transient_for(self.parent.window)
94 self.dlg.show()98 self.dlg.show()
@@ -130,6 +134,10 @@
130 instrItem = [x for x in Globals.getCachedInstruments() if x[1] == item[1]][0]134 instrItem = [x for x in Globals.getCachedInstruments() if x[1] == item[1]][0]
131 self.instr.ChangeType(instrItem[1], instrItem[0])135 self.instr.ChangeType(instrItem[1], instrItem[0])
132136
137 Globals.settings.general["addinstrumentwindowwidth"] = self.width
138 Globals.settings.general["addinstrumentwindowheight"] = self.height
139 Globals.settings.write()
140
133 self.dlg.destroy()141 self.dlg.destroy()
134 142
135 #_____________________________________________________________________143 #_____________________________________________________________________
@@ -141,6 +149,7 @@
141 Parameters:149 Parameters:
142 button -- reserved for GTK callbacks, dont't use it explicity.150 button -- reserved for GTK callbacks, dont't use it explicity.
143 """151 """
152
144 self.dlg.destroy()153 self.dlg.destroy()
145 154
146 #_____________________________________________________________________155 #_____________________________________________________________________
@@ -181,4 +190,45 @@
181 190
182 #_____________________________________________________________________191 #_____________________________________________________________________
183192
193
194 def OnResize(self, widget, event):
195 """
196 This method is called when the add instrument window is resized
197
198 Parameters:
199 widget -- GTK callback parameter.
200 event -- GTK callback parameter.
201
202 Returns:
203 False -- continue GTK signal propagation.
204 """
205
206 (self.width, self.height) = widget.get_size()
207
208 Globals.settings.general["addinstrumentwindowwidth"] = self.width
209 Globals.settings.general["addinstrumentwindowheight"] = self.height
210 Globals.settings.write()
211
212 return False
213
214
215 def OnDestroy(self, widget=None, event=None):
216 """
217 Called when the add instrument window is called
218
219 Parameters:
220 widget -- reserved for GTK callbacks, don't use it explicitly.
221 event -- reserved for GTK callbacks, don't use it explicitly.
222
223 Returns:
224 True -- the current project can't be properly closed.
225 This stops signal propagation.
226 """
227
228
229
230 return True
231
232
233
184#=========================================================================234#=========================================================================
185235
=== modified file 'Jokosher/Globals.py'
--- Jokosher/Globals.py 2009-03-19 23:39:14 +0000
+++ Jokosher/Globals.py 2009-04-03 13:31:25 +0000
@@ -37,6 +37,8 @@
37 "projectfolder" : "",37 "projectfolder" : "",
38 "windowheight" : 550,38 "windowheight" : 550,
39 "windowwidth" : 900,39 "windowwidth" : 900,
40 "addinstrumentwindowheight" : 350,
41 "addinstrumentwindowwidth" : 300,
40 }42 }
4143
42 recording = {44 recording = {
4345
=== modified file 'Jokosher/Jokosher.glade'
--- Jokosher/Jokosher.glade 2009-03-17 02:09:31 +0000
+++ Jokosher/Jokosher.glade 2009-04-03 13:31:25 +0000
@@ -1329,6 +1329,8 @@
1329 <property name="gravity">GDK_GRAVITY_CENTER</property>1329 <property name="gravity">GDK_GRAVITY_CENTER</property>
1330 <property name="focus_on_map">True</property>1330 <property name="focus_on_map">True</property>
1331 <property name="urgency_hint">False</property>1331 <property name="urgency_hint">False</property>
1332 <signal name="configure_event" handler="on_AddInstrument_configure_event" />
1333
13321334
1333 <child>1335 <child>
1334 <widget class="GtkVBox" id="vbox2">1336 <widget class="GtkVBox" id="vbox2">

Subscribers

People subscribed via source and target branches