diff options
-rw-r--r-- | grc/gui/MainWindow.py | 4 | ||||
-rw-r--r-- | grc/gui/Notebook.py | 9 |
2 files changed, 13 insertions, 0 deletions
diff --git a/grc/gui/MainWindow.py b/grc/gui/MainWindow.py index 2d8de8cd08..3499a55050 100644 --- a/grc/gui/MainWindow.py +++ b/grc/gui/MainWindow.py @@ -361,6 +361,10 @@ class MainWindow(Gtk.ApplicationWindow): foreground='black' if page.saved else 'red', ro=' (ro)' if page.get_read_only() else '', title=Utils.encode(file_name or NEW_FLOGRAPH_TITLE), )) + fpath = page.file_path + if not fpath: + fpath = '(unsaved)' + page.set_tooltip(fpath) # show/hide notebook tabs self.notebook.set_show_tabs(len(self.get_pages()) > 1) diff --git a/grc/gui/Notebook.py b/grc/gui/Notebook.py index 77f85fd5f2..8698e9334b 100644 --- a/grc/gui/Notebook.py +++ b/grc/gui/Notebook.py @@ -162,6 +162,15 @@ class Page(Gtk.HBox): """ self.label.set_markup(markup) + def set_tooltip(self, text): + """ + Set the tooltip text in this label. + + Args: + text: the new tooltip text + """ + self.label.set_tooltip_text(text) + def get_read_only(self): """ Get the read-only state of the file. |