[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [cervisia/Applications/16.12] /: Use KStandardGuiItem::overwrite()
From:       Pino Toscano <pino () kde ! org>
Date:       2016-12-10 9:26:00
Message-ID: E1cFduq-0004ai-4B () code ! kde ! org
[Download RAW message or body]

Git commit 3238e3971bc1f561a5abf3b2fc0ffdb240c9f047 by Pino Toscano.
Committed on 10/12/2016 at 09:25.
Pushed by pino into branch 'Applications/16.12'.

Use KStandardGuiItem::overwrite()

... as base for the dialog button

M  +5    -1    misc.cpp

https://commits.kde.org/cervisia/3238e3971bc1f561a5abf3b2fc0ffdb240c9f047

diff --git a/misc.cpp b/misc.cpp
index bc6233a..0e60ac8 100644
--- a/misc.cpp
+++ b/misc.cpp
@@ -213,10 +213,14 @@ bool Cervisia::CheckOverwrite(const QString& fileName, QWidget* \
parent)  // does the file already exist?
     if( fi.exists() )
     {
+        KGuiItem overwriteItem = KStandardGuiItem::overwrite();
+        overwriteItem.setIconName("document-save");
+        overwriteItem.setToolTip(i18n("Overwrite the file"));
+
         result = (KMessageBox::warningContinueCancel(parent,
                   i18n("A file named \"%1\" already exists. Are you sure you want to \
overwrite it?", fileName),  i18n("Overwrite File?"),
-                  KGuiItem(i18n("&Overwrite"), "document-save", i18n("Overwrite the \
file"))) == KMessageBox::Continue); +                  overwriteItem) == \
KMessageBox::Continue);  }
 
     return result;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic