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
PIM
Grantlee Editor
Commits
e0a1e602
Commit
e0a1e602
authored
Oct 15, 2022
by
Laurent Montel
Browse files
Adapt to new api (scripted)
parent
ab2aaf06
Pipeline
#248529
passed with stage
in 3 minutes and 5 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
contactprintthemeeditor/themeeditorpage.cpp
View file @
e0a1e602
...
...
@@ -24,6 +24,7 @@
#include
<QFileDialog>
#include
<QHBoxLayout>
#include
<QPointer>
#include
<kwidgetsaddons_version.h>
ThemeEditorPage
::
ThemeEditorPage
(
const
QString
&
projectDir
,
const
QString
&
themeName
,
QWidget
*
parent
)
:
QWidget
(
parent
)
...
...
@@ -130,12 +131,20 @@ void ThemeEditorPage::installTheme(const QString &themePath)
QDir
dir
(
themePath
);
QDir
themeDir
(
themePath
+
QLatin1Char
(
'/'
)
+
mDesktopPage
->
themeName
());
if
(
themeDir
.
exists
())
{
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
const
int
answer
=
KMessageBox
::
questionTwoActions
(
this
,
#else
const
int
answer
=
KMessageBox
::
questionYesNo
(
this
,
i18n
(
"Theme already exists. Do you want to overwrite it?"
),
i18n
(
"Theme already exists"
),
KStandardGuiItem
::
overwrite
(),
KStandardGuiItem
::
cancel
());
#endif
i18n
(
"Theme already exists. Do you want to overwrite it?"
),
i18n
(
"Theme already exists"
),
KStandardGuiItem
::
overwrite
(),
KStandardGuiItem
::
cancel
());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if
(
answer
==
KMessageBox
::
ButtonCode
::
SecondaryAction
)
{
#else
if
(
answer
==
KMessageBox
::
No
)
{
#endif
return
;
}
}
else
{
...
...
@@ -252,12 +261,20 @@ bool ThemeEditorPage::saveTheme(bool withConfirmation)
{
if
(
themeWasChanged
())
{
if
(
withConfirmation
)
{
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
const
int
result
=
KMessageBox
::
questionTwoActionsCancel
(
this
,
#else
const
int
result
=
KMessageBox
::
questionYesNoCancel
(
this
,
i18n
(
"Do you want to save current project?"
),
i18n
(
"Save current project"
),
KStandardGuiItem
::
save
(),
KStandardGuiItem
::
discard
());
#endif
i18n
(
"Do you want to save current project?"
),
i18n
(
"Save current project"
),
KStandardGuiItem
::
save
(),
KStandardGuiItem
::
discard
());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if
(
result
==
KMessageBox
::
ButtonCode
::
PrimaryAction
)
{
#else
if
(
result
==
KMessageBox
::
Yes
)
{
#endif
storeTheme
();
}
else
if
(
result
==
KMessageBox
::
Cancel
)
{
return
false
;
...
...
contactthemeeditor/contacteditorpage.cpp
View file @
e0a1e602
...
...
@@ -24,6 +24,7 @@
#include
<QFileDialog>
#include
<QHBoxLayout>
#include
<QPointer>
#include
<kwidgetsaddons_version.h>
ContactEditorPage
::
ContactEditorPage
(
const
QString
&
projectDir
,
const
QString
&
themeName
,
QWidget
*
parent
)
:
QWidget
(
parent
)
...
...
@@ -119,12 +120,20 @@ void ContactEditorPage::installTheme(const QString &themePath)
QDir
dir
(
themePath
);
QDir
themeDir
(
themePath
+
QLatin1Char
(
'/'
)
+
mDesktopPage
->
themeName
());
if
(
themeDir
.
exists
())
{
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
const
int
answer
=
KMessageBox
::
questionTwoActions
(
this
,
#else
const
int
answer
=
KMessageBox
::
questionYesNo
(
this
,
i18n
(
"Theme already exists. Do you want to overwrite it?"
),
i18n
(
"Theme already exists"
),
KStandardGuiItem
::
overwrite
(),
KStandardGuiItem
::
cancel
());
#endif
i18n
(
"Theme already exists. Do you want to overwrite it?"
),
i18n
(
"Theme already exists"
),
KStandardGuiItem
::
overwrite
(),
KStandardGuiItem
::
cancel
());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if
(
answer
==
KMessageBox
::
ButtonCode
::
SecondaryAction
)
{
#else
if
(
answer
==
KMessageBox
::
No
)
{
#endif
return
;
}
}
else
{
...
...
@@ -268,12 +277,20 @@ bool ContactEditorPage::saveTheme(bool withConfirmation)
{
if
(
themeWasChanged
())
{
if
(
withConfirmation
)
{
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
const
int
result
=
KMessageBox
::
questionTwoActionsCancel
(
this
,
#else
const
int
result
=
KMessageBox
::
questionYesNoCancel
(
this
,
i18n
(
"Do you want to save current project?"
),
i18n
(
"Save current project"
),
KStandardGuiItem
::
save
(),
KStandardGuiItem
::
discard
());
#endif
i18n
(
"Do you want to save current project?"
),
i18n
(
"Save current project"
),
KStandardGuiItem
::
save
(),
KStandardGuiItem
::
discard
());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if
(
result
==
KMessageBox
::
ButtonCode
::
PrimaryAction
)
{
#else
if
(
result
==
KMessageBox
::
Yes
)
{
#endif
storeTheme
();
}
else
if
(
result
==
KMessageBox
::
Cancel
)
{
return
false
;
...
...
grantleethemeeditor/managethemes.cpp
View file @
e0a1e602
...
...
@@ -18,6 +18,7 @@
#include
<QListWidget>
#include
<QStandardPaths>
#include
<QVBoxLayout>
#include
<kwidgetsaddons_version.h>
using
namespace
GrantleeThemeEditor
;
class
GrantleeThemeEditor
::
ManageThemesPrivate
...
...
@@ -97,8 +98,16 @@ void ManageThemes::slotDeleteTheme()
}
else
{
msg
=
i18n
(
"Do you want to remove %1 selected themes?"
,
selectedThemeCount
);
}
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
const
int
answer
=
KMessageBox
::
questionTwoActions
(
this
,
msg
,
i18n
(
"Remove theme"
),
KStandardGuiItem
::
remove
(),
KStandardGuiItem
::
cancel
());
#else
const
int
answer
=
KMessageBox
::
questionYesNo
(
this
,
msg
,
i18n
(
"Remove theme"
),
KStandardGuiItem
::
remove
(),
KStandardGuiItem
::
cancel
());
#endif
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if
(
answer
==
KMessageBox
::
ButtonCode
::
PrimaryAction
)
{
#else
if
(
answer
==
KMessageBox
::
Yes
)
{
#endif
for
(
QListWidgetItem
*
item
:
selectItems
)
{
if
(
QDir
((
d
->
mLocalDirectory
+
QLatin1Char
(
'/'
)
+
item
->
text
())).
removeRecursively
())
{
delete
item
;
...
...
headerthemeeditor/themeeditorpage.cpp
View file @
e0a1e602
...
...
@@ -23,6 +23,7 @@
#include
<QFileDialog>
#include
<QHBoxLayout>
#include
<QPointer>
#include
<kwidgetsaddons_version.h>
ThemeEditorPage
::
ThemeEditorPage
(
const
QString
&
projectDir
,
const
QString
&
themeName
,
QWidget
*
parent
)
:
QWidget
(
parent
)
...
...
@@ -154,12 +155,20 @@ void ThemeEditorPage::installTheme(const QString &themePath)
QDir
dir
(
themePath
);
QDir
themeDir
(
themePath
+
QLatin1Char
(
'/'
)
+
mDesktopPage
->
themeName
());
if
(
themeDir
.
exists
())
{
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
const
int
answer
=
KMessageBox
::
questionTwoActions
(
this
,
#else
const
int
answer
=
KMessageBox
::
questionYesNo
(
this
,
i18n
(
"Theme already exists. Do you want to overwrite it?"
),
i18n
(
"Theme already exists"
),
KStandardGuiItem
::
overwrite
(),
KStandardGuiItem
::
cancel
());
#endif
i18n
(
"Theme already exists. Do you want to overwrite it?"
),
i18n
(
"Theme already exists"
),
KStandardGuiItem
::
overwrite
(),
KStandardGuiItem
::
cancel
());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if
(
answer
==
KMessageBox
::
ButtonCode
::
SecondaryAction
)
{
#else
if
(
answer
==
KMessageBox
::
No
)
{
#endif
return
;
}
}
else
{
...
...
@@ -279,12 +288,20 @@ bool ThemeEditorPage::saveTheme(bool withConfirmation)
{
if
(
themeWasChanged
())
{
if
(
withConfirmation
)
{
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
const
int
result
=
KMessageBox
::
questionTwoActionsCancel
(
this
,
#else
const
int
result
=
KMessageBox
::
questionYesNoCancel
(
this
,
i18n
(
"Do you want to save current project?"
),
i18n
(
"Save current project"
),
KStandardGuiItem
::
save
(),
KStandardGuiItem
::
discard
());
#endif
i18n
(
"Do you want to save current project?"
),
i18n
(
"Save current project"
),
KStandardGuiItem
::
save
(),
KStandardGuiItem
::
discard
());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if
(
result
==
KMessageBox
::
ButtonCode
::
PrimaryAction
)
{
#else
if
(
result
==
KMessageBox
::
Yes
)
{
#endif
storeTheme
();
}
else
if
(
result
==
KMessageBox
::
Cancel
)
{
return
false
;
...
...
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