diff libgui/src/m-editor/file-editor.cc @ 15984:1eb3c67139f6

Add full-length-name tool tip to editor file tab when name is not full length. * file-editor-tab.cc (file_editor_tab::update_window_title): Add and construct tooltip variable then signal file_name_changed() with second input string. * file-editor-tab.h (file_editor_tab::file_name_changed): Add second input string to accommodate tool tip. * file-editor.cc, file-editor.h (file_editor::handle_file_name_changed): Add second input string and set tool tip via Qt setTabToolTip() member function.
author Daniel J Sebald <daniel.sebald@ieee.org>
date Sun, 27 Jan 2013 18:44:53 -0600
parents 131d40cd805b
children 41471c02d51c
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.cc	Mon Jan 28 18:57:36 2013 +0100
+++ b/libgui/src/m-editor/file-editor.cc	Sun Jan 27 18:44:53 2013 -0600
@@ -423,7 +423,7 @@
 }
 
 void
-file_editor::handle_file_name_changed (const QString& fileName)
+file_editor::handle_file_name_changed (const QString& fileName, const QString& toolTip)
 {
   QObject *fileEditorTab = sender();
   if (fileEditorTab)
@@ -433,6 +433,7 @@
           if (_tab_widget->widget (i) == fileEditorTab)
             {
               _tab_widget->setTabText (i, fileName);
+              _tab_widget->setTabToolTip (i, toolTip);
             }
         }
     }
@@ -766,8 +767,8 @@
   _tab_widget->addTab (f, fn);
 
   // Signals from the file editor_tab
-  connect (f, SIGNAL (file_name_changed (const QString&)),
-           this, SLOT (handle_file_name_changed (const QString&)));
+  connect (f, SIGNAL (file_name_changed (const QString&, const QString&)),
+           this, SLOT (handle_file_name_changed (const QString&, const QString&)));
   connect (f, SIGNAL (editor_state_changed (bool, const QString&)),
            this, SLOT (handle_editor_state_changed (bool, const QString&)));
   connect (f, SIGNAL (tab_remove_request ()),