Hi, on Sunday 29 January 2012 12:11:46 Marko Käning wrote:
> Hi Thomas, > > > I don't think we need to change the build environment, since the same > > version of KMyMoney can run under 4.7 as well as 4.8. So the name of the > > icon must be > > how right you are. > > > determined at runtime based on the underlying KDE version. > > Yes, that's the better approach, I agree. > > > Can you post the > > output of 'git diff' here, so that we don't have to search all spots you > > already have identified again? TIA. > > My diff is attached, yet still without the determination of the KDE > version, of course. :-) > > > Who can support testing in case we/I can come up with something during > > the next couple of days? The 4.6.2 release is around the corner and 4.8 > > already hit the streets. > > Yes, it would be nicer to have it in that release! I'd go for it! :-) Can you test the attached patch and report back please? It should work against master. > > Greets, > Marko -- Regards Thomas Baumgart GPG-FP: E55E D592 F45F 116B 8429 4F99 9C59 DB40 B75D D3BA ------------------------------------------------------------- If Windows is the answer I want my problem back! -------------------------------------------------------------
diff --git a/kmymoney/dialogs/kenterscheduledlg.cpp b/kmymoney/dialogs/kenterscheduledlg.cpp index 6673138..9f4432f 100644 --- a/kmymoney/dialogs/kenterscheduledlg.cpp +++ b/kmymoney/dialogs/kenterscheduledlg.cpp @@ -49,6 +49,7 @@ #include <kmymoneyaccountselector.h> #include <kmymoneydateinput.h> #include <ktoolinvocation.h> +#include <kmymoneyglobalsettings.h> #include "kmymoney.h" @@ -71,7 +72,7 @@ KEnterScheduleDlg::KEnterScheduleDlg(QWidget *parent, const MyMoneySchedule& sch { d->m_schedule = schedule; d->m_extendedReturnCode = KMyMoneyUtils::Enter; - buttonOk->setIcon(KIcon("go-jump-locationbar")); + buttonOk->setIcon(KIcon(KMyMoneyGlobalSettings::enterScheduleIcon())); buttonSkip->setIcon(KIcon("media-seek-forward")); buttonCancel->setGuiItem(KStandardGuiItem::cancel()); buttonHelp->setGuiItem(KStandardGuiItem::help()); diff --git a/kmymoney/kmymoney.cpp b/kmymoney/kmymoney.cpp index 064b8dd..deb8303 100644 --- a/kmymoney/kmymoney.cpp +++ b/kmymoney/kmymoney.cpp @@ -922,7 +922,7 @@ void KMyMoneyApp::initActions(void) KAction *schedule_enter = actionCollection()->addAction("schedule_enter"); schedule_enter->setText(i18n("Enter next transaction...")); - schedule_enter->setIcon(KIcon("go-jump-locationbar")); + schedule_enter->setIcon(KIcon(KMyMoneyGlobalSettings::enterScheduleIcon())); connect(schedule_enter, SIGNAL(triggered()), this, SLOT(slotScheduleEnter())); KAction *schedule_skip = actionCollection()->addAction("schedule_skip"); diff --git a/kmymoney/kmymoneyglobalsettings.cpp b/kmymoney/kmymoneyglobalsettings.cpp index d7ba7f8..a6742fa 100644 --- a/kmymoney/kmymoneyglobalsettings.cpp +++ b/kmymoney/kmymoneyglobalsettings.cpp @@ -26,6 +26,7 @@ #include <KGlobalSettings> #include <KColorScheme> +#include <kdeversion.h> // ---------------------------------------------------------------------------- // Project Includes @@ -139,3 +140,12 @@ MyMoneyForecast KMyMoneyGlobalSettings::forecast(void) return forecast; } + +QString KMyMoneyGlobalSettings::enterScheduleIcon(void) +{ + if (KDE::version() >= 0x040800) { + return QLatin1String("key-enter"); + } + + return QLatin1String("go-jump-locationbar"); +} diff --git a/kmymoney/kmymoneyglobalsettings.h b/kmymoney/kmymoneyglobalsettings.h index f8a0ecf..f3519b1 100644 --- a/kmymoney/kmymoneyglobalsettings.h +++ b/kmymoney/kmymoneyglobalsettings.h @@ -70,5 +70,11 @@ public: * their KMyMoneyMVCCombo::setSubstringSearch() method */ static void setSubstringSearch(QWidget* w); + + /** + * Returns the name of the icon to be used for the 'enter schedule' + * action depending on the underlying KDE version + */ + static QString enterScheduleIcon(void); }; #endif diff --git a/kmymoney/views/khomeview.cpp b/kmymoney/views/khomeview.cpp index 04557bc..ac1ae7a 100644 --- a/kmymoney/views/khomeview.cpp +++ b/kmymoney/views/khomeview.cpp @@ -611,7 +611,7 @@ void KHomeView::showPaymentEntry(const MyMoneySchedule& sched, int cnt) MyMoneySplit sp = t.splitByAccount(acc.id(), true); QString pathEnter, pathSkip; - KIconLoader::global()->loadIcon(QString("go-jump-locationbar"), KIconLoader::Small, KIconLoader::SizeSmall, KIconLoader::DefaultState, QStringList(), &pathEnter, false); + KIconLoader::global()->loadIcon(KMyMoneyGlobalSettings::enterScheduleIcon(), KIconLoader::Small, KIconLoader::SizeSmall, KIconLoader::DefaultState, QStringList(), &pathEnter, false); KIconLoader::global()->loadIcon(QString("media-seek-forward"), KIconLoader::Small, KIconLoader::SizeSmall, KIconLoader::DefaultState, QStringList(), &pathSkip); //show payment date diff --git a/kmymoney/widgets/kmymoneybriefschedule.cpp b/kmymoney/widgets/kmymoneybriefschedule.cpp index 5e2af29..8e0c96b 100644 --- a/kmymoney/widgets/kmymoneybriefschedule.cpp +++ b/kmymoney/widgets/kmymoneybriefschedule.cpp @@ -36,6 +36,7 @@ #include <klocale.h> #include <kiconloader.h> #include <kpushbutton.h> +#include <kdeversion.h> // ---------------------------------------------------------------------------- // Project Includes @@ -61,8 +62,14 @@ KMyMoneyBriefSchedule::KMyMoneyBriefSchedule(QWidget *parent) i18n("Use this button to skip this transaction")); m_skipButton->setGuiItem(skipGuiItem); + // as of KDE 4.8 the icon we use here move to a different location + QString iconName("go-jump-locationbar");; + if (KDE::version() >= 0x040800) { + iconName = QLatin1String("key-enter"); + } + KGuiItem enterGuiItem(i18n("&Enter"), - KIcon("go-jump-locationbar"), + KIcon(iconName), i18n("Record this transaction into the register"), i18n("Use this button to record this transaction")); m_buttonEnter->setGuiItem(enterGuiItem);
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ KMyMoney-devel mailing list KMyMoney-devel@kde.org https://mail.kde.org/mailman/listinfo/kmymoney-devel