Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
5ad035e5
Commit
5ad035e5
authored
Oct 03, 2012
by
Aurélien Gâteau
Browse files
Merge branch 'mod-dialog-buttons'
REVIEW: 106705 BUG: 307762
parents
164e2f2b
402a009e
Changes
3
Hide whitespace changes
Inline
Side-by-side
kate/app/katemwmodonhddialog.cpp
View file @
5ad035e5
...
...
@@ -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
);
...
...
part/dialogs/katedialogs.cpp
View file @
5ad035e5
...
...
@@ -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"
)
);
setButton
WhatsThis
(
Ok
,
whatisok
);
setButton
WhatsThis
(
Apply
,
i18n
(
"Ignore the changes. You will not be prompted again."
)
);
setButton
WhatsThis
(
Cancel
,
i18n
(
"Do nothing. Next time you focus the file, "
setButton
ToolTip
(
Ok
,
okToolTip
);
setButton
ToolTip
(
Apply
,
i18n
(
"Ignore the changes. You will not be prompted again."
)
);
setButton
ToolTip
(
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
)
{
setButton
Text
(
User1
,
i18n
(
"O
verwrite
"
)
);
setButton
WhatsThis
(
User1
,
i18n
(
"Overwrite the disk file with the editor content."
)
);
setButton
GuiItem
(
User1
,
KStandardGuiItem
::
o
verwrite
(
)
);
setButton
ToolTip
(
User1
,
i18n
(
"Overwrite the disk file with the editor content."
)
);
connect
(
ui
->
btnDiff
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
slotDiff
())
);
}
else
...
...
part/document/katedocument.cpp
View file @
5ad035e5
...
...
@@ -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
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment