]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Squeeze the filename shown in the rename dialog when it is too long
authorDawit Alemayehu <adawit@kde.org>
Wed, 22 Jun 2011 03:00:28 +0000 (23:00 -0400)
committerDawit Alemayehu <adawit@kde.org>
Sun, 3 Jul 2011 20:17:06 +0000 (16:17 -0400)
and show the full name in a tool tip instead.

src/views/renamedialog.cpp

index c0c6ad58c1153daed7c15b3f7be661fb39bffb4d..830884dc2c800c1311959e413ce614e17fc2dbb1 100644 (file)
@@ -65,9 +65,12 @@ RenameDialog::RenameDialog(QWidget *parent, const KFileItemList& items) :
 
     QLabel* editLabel = 0;
     if (m_renameOneItem) {
-        m_newName = items.first().name();
-        editLabel = new QLabel(i18nc("@label:textbox", "Rename the item <filename>%1</filename> to:", m_newName),
-                               page);
+        m_newName =  items.first().name();
+        editLabel = new QLabel(i18nc("@label:textbox", "Rename the item <filename>%1</filename> to:",
+                                     KStringHandler::csqueeze(m_newName)), page);
+        if (m_newName.size() > 40) {
+            editLabel->setToolTip(m_newName); // Set the filename as a the tool tip...
+        }
     } else {
         m_newName = i18nc("@info:status", "New name #");
         editLabel = new QLabel(i18ncp("@label:textbox",