Commit 3af507de authored by Just van Rossum's avatar Just van Rossum

- made "Save options..." dialog more generic, so it's also usable from RoboFog

- mark file as dirty after changing the creator of the file so we can_save...
-- jvr
parent 6c487c4d
...@@ -268,6 +268,7 @@ class Editor(W.Window): ...@@ -268,6 +268,7 @@ class Editor(W.Window):
def domenu_options(self, *args): def domenu_options(self, *args):
rv = SaveOptions(self._creator) rv = SaveOptions(self._creator)
if rv: if rv:
self.editgroup.editor.selchanged = 1 # ouch...
self._creator = rv self._creator = rv
def clicklinefield(self): def clicklinefield(self):
...@@ -633,8 +634,8 @@ class _saveoptions: ...@@ -633,8 +634,8 @@ class _saveoptions:
self.w = w = W.ModalDialog((240, 140), 'Save options') self.w = w = W.ModalDialog((240, 140), 'Save options')
radiobuttons = [] radiobuttons = []
w.label = W.TextBox((8, 8, 80, 18), "File creator:") w.label = W.TextBox((8, 8, 80, 18), "File creator:")
w.ide_radio = W.RadioButton((8, 22, 80, 18), "IDE", radiobuttons, self.ide_hit) w.ide_radio = W.RadioButton((8, 22, 160, 18), "This application", radiobuttons, self.ide_hit)
w.interp_radio = W.RadioButton((8, 42, 80, 18), "Interpreter", radiobuttons, self.interp_hit) w.interp_radio = W.RadioButton((8, 42, 160, 18), "Python Interpreter", radiobuttons, self.interp_hit)
w.other_radio = W.RadioButton((8, 62, 50, 18), "Other:", radiobuttons) w.other_radio = W.RadioButton((8, 62, 50, 18), "Other:", radiobuttons)
w.other_creator = W.EditText((62, 62, 40, 20), creator, self.otherselect) w.other_creator = W.EditText((62, 62, 40, 20), creator, self.otherselect)
w.cancelbutton = W.Button((-180, -30, 80, 16), "Cancel", self.cancelbuttonhit) w.cancelbutton = W.Button((-180, -30, 80, 16), "Cancel", self.cancelbuttonhit)
...@@ -642,7 +643,7 @@ class _saveoptions: ...@@ -642,7 +643,7 @@ class _saveoptions:
w.setdefaultbutton(w.okbutton) w.setdefaultbutton(w.okbutton)
if creator == 'Pyth': if creator == 'Pyth':
w.interp_radio.set(1) w.interp_radio.set(1)
elif creator == 'Pide': elif creator == W._signature:
w.ide_radio.set(1) w.ide_radio.set(1)
else: else:
w.other_radio.set(1) w.other_radio.set(1)
...@@ -650,7 +651,7 @@ class _saveoptions: ...@@ -650,7 +651,7 @@ class _saveoptions:
w.open() w.open()
def ide_hit(self): def ide_hit(self):
self.w.other_creator.set("Pide") self.w.other_creator.set(W._signature)
def interp_hit(self): def interp_hit(self):
self.w.other_creator.set("Pyth") self.w.other_creator.set("Pyth")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment