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
SDK
Dolphin Plugins
Commits
ddea63aa
Commit
ddea63aa
authored
Oct 16, 2022
by
Laurent Montel
Browse files
Adapt to new api (scripted)
parent
188be73f
Pipeline
#248868
passed with stage
in 3 minutes and 14 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
hg/fileviewhgplugin.cpp
View file @
ddea63aa
...
...
@@ -24,7 +24,6 @@
#include
"servedialog.h"
#include
"backoutdialog.h"
#include
<QTextCodec>
#include
<QDir>
#include
<QAction>
...
...
@@ -41,6 +40,7 @@
#include
<KLocalizedString>
#include
<KPluginFactory>
#include
<kwidgetsaddons_version.h>
#include
<QRegularExpression>
K_PLUGIN_CLASS_WITH_JSON
(
FileViewHgPlugin
,
"fileviewhgplugin.json"
)
...
...
@@ -502,10 +502,19 @@ void FileViewHgPlugin::removeFiles()
{
Q_ASSERT
(
!
m_contextItems
.
isEmpty
());
int
answer
=
KMessageBox
::
questionYesNo
(
nullptr
,
xi18nc
(
"@message:yesorno"
,
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
int
answer
=
KMessageBox
::
questionTwoActions
(
nullptr
,
#else
int
answer
=
KMessageBox
::
questionYesNo
(
nullptr
,
#endif
xi18nc
(
"@message:yesorno"
,
"Would you like to remove selected files "
"from the repository?"
));
"from the repository?"
),
i18n
(
"Remove Files"
),
KStandardGuiItem
::
remove
(),
KStandardGuiItem
::
cancel
());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if
(
answer
==
KMessageBox
::
ButtonCode
::
SecondaryAction
)
{
#else
if
(
answer
==
KMessageBox
::
No
)
{
#endif
return
;
}
...
...
@@ -687,10 +696,19 @@ void FileViewHgPlugin::exportChangesets()
void
FileViewHgPlugin
::
revert
()
{
clearMessages
();
int
answer
=
KMessageBox
::
questionYesNo
(
nullptr
,
xi18nc
(
"@message:yesorno"
,
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
int
answer
=
KMessageBox
::
questionTwoActions
(
nullptr
,
#else
int
answer
=
KMessageBox
::
questionYesNo
(
nullptr
,
#endif
xi18nc
(
"@message:yesorno"
,
"Would you like to revert changes "
"made to selected files?"
));
"made to selected files?"
),
i18n
(
"Revert"
),
KGuiItem
(
i18n
(
"Revert"
)),
KStandardGuiItem
::
cancel
());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if
(
answer
==
KMessageBox
::
ButtonCode
::
SecondaryAction
)
{
#else
if
(
answer
==
KMessageBox
::
No
)
{
#endif
return
;
}
...
...
@@ -707,10 +725,19 @@ void FileViewHgPlugin::revert()
void
FileViewHgPlugin
::
revertAll
()
{
int
answer
=
KMessageBox
::
questionYesNo
(
nullptr
,
xi18nc
(
"@message:yesorno"
,
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
int
answer
=
KMessageBox
::
questionTwoActions
(
nullptr
,
#else
int
answer
=
KMessageBox
::
questionYesNo
(
nullptr
,
#endif
xi18nc
(
"@message:yesorno"
,
"Would you like to revert all changes "
"made to current working directory?"
));
"made to current working directory?"
),
i18n
(
"Revert All"
),
KGuiItem
(
i18n
(
"Revert"
)),
KStandardGuiItem
::
cancel
());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if
(
answer
==
KMessageBox
::
ButtonCode
::
SecondaryAction
)
{
#else
if
(
answer
==
KMessageBox
::
No
)
{
#endif
return
;
}
...
...
@@ -785,10 +812,19 @@ void FileViewHgPlugin::rollback()
lastTransaction
=
lastTransaction
.
mid
(
cutOfFrom
);
// ask
int
answer
=
KMessageBox
::
questionYesNo
(
nullptr
,
xi18nc
(
"@message:yesorno"
,
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
int
answer
=
KMessageBox
::
questionTwoActions
(
nullptr
,
#else
int
answer
=
KMessageBox
::
questionYesNo
(
nullptr
,
#endif
xi18nc
(
"@message:yesorno"
,
"Would you like to rollback last transaction?"
)
+
"
\n
revision: "
+
lastTransaction
);
+
"
\n
revision: "
+
lastTransaction
,
i18n
(
"Rollback"
),
KGuiItem
(
i18n
(
"Rollback"
)),
KStandardGuiItem
::
cancel
());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if
(
answer
==
KMessageBox
::
ButtonCode
::
SecondaryAction
)
{
#else
if
(
answer
==
KMessageBox
::
No
)
{
#endif
return
;
}
...
...
@@ -846,4 +882,3 @@ QString FileViewHgPlugin::visualDiffExecPath()
}
#include
"fileviewhgplugin.moc"
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