[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 22/43: grc: close unsaved pages first (for
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 22/43: grc: close unsaved pages first (for cancel save option) |
Date: |
Thu, 2 Apr 2015 19:15:51 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit 10a434c2dacd64e28a5da7a0881d8fc957983ea7
Author: Sebastian Koslowski <address@hidden>
Date: Tue Mar 24 12:05:39 2015 +0100
grc: close unsaved pages first (for cancel save option)
---
grc/gui/MainWindow.py | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/grc/gui/MainWindow.py b/grc/gui/MainWindow.py
index 2d48504..07d0661 100644
--- a/grc/gui/MainWindow.py
+++ b/grc/gui/MainWindow.py
@@ -209,9 +209,11 @@ class MainWindow(gtk.Window):
open_files = filter(lambda file: file, self._get_files()) #filter
blank files
open_file = self.get_page().get_file_path()
#close each page
- for page in self.get_pages():
+ for page in sorted(self.get_pages(), key=lambda p: p.get_saved()):
self.page_to_be_closed = page
- self.close_page(False)
+ closed = self.close_page(False)
+ if not closed:
+ break
if self.notebook.get_n_pages(): return False
#save state before closing
Preferences.files_open(open_files)
@@ -242,16 +244,17 @@ class MainWindow(gtk.Window):
Actions.FLOW_GRAPH_SAVE() #try to save
if not self.page_to_be_closed.get_saved(): #still unsaved?
self.page_to_be_closed = None #set the page to be closed
back to None
- return
+ return False
elif response == gtk.RESPONSE_CANCEL:
self.page_to_be_closed = None
- return
+ return False
#stop the flow graph if executing
if self.page_to_be_closed.get_proc(): Actions.FLOW_GRAPH_KILL()
#remove the page
self.notebook.remove_page(self.notebook.page_num(self.page_to_be_closed))
if ensure and self.notebook.get_n_pages() == 0: self.new_page() #no
pages, make a new one
self.page_to_be_closed = None #set the page to be closed back to None
+ return True
############################################################
# Misc
- [Commit-gnuradio] [gnuradio] 11/43: fec: LDPC cleaning up comments, (continued)
- [Commit-gnuradio] [gnuradio] 11/43: fec: LDPC cleaning up comments, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 30/43: grc: clean-up 'gnuradio-companion', add mode 'run from source', git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 12/43: fec: re-shuffling LDPC make helper, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 31/43: grc: PropsDialog: apply button and hotkey (Ctrl+Enter), git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 40/43: fec: Move the definition of yp_kernel from the class into a temp variable in the main code. This variable is used just to find the actual Volk kernel, and its current use is not c++11 complaint. Moving it makes the code c++11 complaint on both GCC / libstdc++ and Clang / libc++., git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 35/43: Merge remote-tracking branch 'osh/ldpc_add', git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 20/43: grc: Reworked save confirmation dialog to allow cancel option, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 42/43: Merge remote-tracking branch 'michaelld/misc_fixes', git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 29/43: grc: move context def into Bars.py and add submenu, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 14/43: gnuradio-runtime: modified buffer length types to size_t, moved buffer length vectors into detail, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 22/43: grc: close unsaved pages first (for cancel save option),
git <=
- [Commit-gnuradio] [gnuradio] 13/43: fec: ldpc GRC compat cleanup, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 36/43: Merge remote-tracking branch 'fengzhe/chunks_to_symbols_update', git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 25/43: grc: set permissions for generated files, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 08/43: fec: adding ldpc encoder and decoder, initial compile working, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 23/43: grc: make use of GRC_HIER_PATH at runtime, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 33/43: Merge remote-tracking branch 'saikwolf/hier_buff_tweak', git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 24/43: grc: use 'import' for grc-generated hier_blocks (#763), git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 02/43: gnuradio-runtime: updated hier_block2 and hier_block_detail to allow for propagation of min/max output buffer to all blocks within the hier, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 21/43: grc: Default button in save dialog is now 'save' instead of 'close without saving', git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 37/43: Merge remote-tracking branch 'gnuradio-wg-grc/master_grcwg', git, 2015/04/02