Commit 5ad035e5 authored by Aurélien Gâteau's avatar Aurélien Gâteau
Browse files

Merge branch 'mod-dialog-buttons'

REVIEW: 106705
BUG: 307762
parents 164e2f2b 402a009e
......@@ -64,7 +64,7 @@ KateMwModOnHdDialog::KateMwModOnHdDialog( DocVector docs, QWidget *parent, const
{
setCaption( i18n("Documents Modified on Disk") );
setButtons( User1 | User2 | User3 );
setButtonGuiItem( User1, KGuiItem (i18n("&Ignore"), "window-close") );
setButtonGuiItem( User1, KGuiItem (i18n("&Ignore Changes"), "dialog-warning") );
setButtonGuiItem( User2, KStandardGuiItem::overwrite() );
setButtonGuiItem( User3, KGuiItem (i18n("&Reload"), "view-refresh") );
......@@ -72,15 +72,12 @@ KateMwModOnHdDialog::KateMwModOnHdDialog( DocVector docs, QWidget *parent, const
setModal( true );
setDefaultButton( KDialog::User3 );
setButtonWhatsThis( User1, i18n(
"Removes the modified flag from the selected documents and closes the "
"dialog if there are no more unhandled documents.") );
setButtonWhatsThis( User2, i18n(
"Overwrite selected documents, discarding the disk changes and closes the "
"dialog if there are no more unhandled documents.") );
setButtonWhatsThis( User3, i18n(
"Reloads the selected documents from disk and closes the dialog if there "
"are no more unhandled documents.") );
setButtonToolTip( User1, i18n(
"Remove modified flag from selected documents") );
setButtonToolTip( User2, i18n(
"Overwrite selected documents, discarding disk changes") );
setButtonToolTip( User3, i18n(
"Reload selected documents from disk") );
KVBox *w = new KVBox( this );
setMainWidget( w );
......
......@@ -1419,25 +1419,29 @@ KateModOnHdPrompt::KateModOnHdPrompt( KateDocument *doc,
{
setButtons( Ok | Apply | Cancel | User1 );
QString title, btnOK, whatisok;
QString title, okText, okIcon, okToolTip;
if ( modtype == KTextEditor::ModificationInterface::OnDiskDeleted )
{
title = i18n("File Was Deleted on Disk");
btnOK = i18n("&Save File As...");
whatisok = i18n("Lets you select a location and save the file again.");
okText = i18n("&Save File As...");
okIcon = "document-save-as";
okToolTip = i18n("Lets you select a location and save the file again.");
} else {
title = i18n("File Changed on Disk");
btnOK = i18n("&Reload File");
whatisok = i18n("Reload the file from disk. If you have unsaved changes, "
okText = i18n("&Reload File");
okIcon = "view-refresh";
okToolTip = i18n("Reload the file from disk. If you have unsaved changes, "
"they will be lost.");
}
setButtonText( Ok, btnOK );
setButtonText( Apply, i18n("&Ignore") );
setButtonText( Ok, okText );
setButtonIcon( Ok, KIcon( okIcon ) );
setButtonText( Apply, i18n("&Ignore Changes") );
setButtonIcon( Apply, KIcon( "dialog-warning" ) );
setButtonWhatsThis( Ok, whatisok );
setButtonWhatsThis( Apply, i18n("Ignore the changes. You will not be prompted again.") );
setButtonWhatsThis( Cancel, i18n("Do nothing. Next time you focus the file, "
setButtonToolTip( Ok, okToolTip );
setButtonToolTip( Apply, i18n("Ignore the changes. You will not be prompted again.") );
setButtonToolTip( Cancel, i18n("Do nothing. Next time you focus the file, "
"or try to save it or close it, you will be prompted again.") );
setCaption( title );
......@@ -1453,8 +1457,8 @@ KateModOnHdPrompt::KateModOnHdPrompt( KateDocument *doc,
// If the file isn't deleted, present a diff button, and a overwrite action.
if ( modtype != KTextEditor::ModificationInterface::OnDiskDeleted )
{
setButtonText( User1, i18n("Overwrite") );
setButtonWhatsThis( User1, i18n("Overwrite the disk file with the editor content.") );
setButtonGuiItem( User1, KStandardGuiItem::overwrite() );
setButtonToolTip( User1, i18n("Overwrite the disk file with the editor content.") );
connect( ui->btnDiff, SIGNAL(clicked()), this, SLOT(slotDiff()) );
}
else
......
......@@ -3917,7 +3917,9 @@ bool KateDocument::documentReload()
int i = KMessageBox::warningYesNoCancel
(parentWidget, reasonedMOHString() + "\n\n" + i18n("What do you want to do?"),
i18n("File Was Changed on Disk"), KGuiItem(i18n("&Reload File")), KGuiItem(i18n("&Ignore Changes")));
i18n("File Was Changed on Disk"),
KGuiItem(i18n("&Reload File"), "view-refresh"),
KGuiItem(i18n("&Ignore Changes"), "dialog-warning"));
if ( i != KMessageBox::Yes)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment