[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [konversation] src: Set tooltips directly
From: Pino Toscano <pino () kde ! org>
Date: 2016-12-03 17:36:34
Message-ID: E1cDEEk-0004qP-L3 () code ! kde ! org
[Download RAW message or body]
Git commit 1141848244e9980c1383540355ddd434e38732f9 by Pino Toscano.
Committed on 03/12/2016 at 17:19.
Pushed by pino into branch 'master'.
Set tooltips directly
Do not create KGuiItem from scratch for OK & Cancel buttons in few
dialogs, otherwise the text & icon is duplicated (and retranslated).
Since the default texts & icons are correct, all it is needed is setting
the custom tooltips, so do that directly.
M +2 -2 src/identitydialog.cpp
M +2 -3 src/irc/servergroupdialog.cpp
M +2 -3 src/viewer/editnotifydialog.cpp
https://commits.kde.org/konversation/1141848244e9980c1383540355ddd434e38732f9
diff --git a/src/identitydialog.cpp b/src/identitydialog.cpp
index c8b169b..a422d6a 100644
--- a/src/identitydialog.cpp
+++ b/src/identitydialog.cpp
@@ -105,8 +105,8 @@ namespace Konversation
// Set up signals / slots for identity page
//connect(m_identityCBox, SIGNAL(activated(int)), this, \
SLOT(updateIdentity(int)));
- KGuiItem::assign(okButton, KGuiItem(i18n("&OK"), \
QStringLiteral("dialog-ok"), i18n("Change identity information")));
- KGuiItem::assign(buttonBox->button(QDialogButtonBox::Cancel), \
KGuiItem(i18n("&Cancel"),QStringLiteral("dialog-cancel"), i18n("Discards all changes \
made"))); + okButton->setToolTip(i18n("Change identity information"));
+ buttonBox->button(QDialogButtonBox::Cancel)->setToolTip(i18n("Discards all \
changes made"));
AwayManager* awayManager = Application::instance()->getAwayManager();
connect(m_identityCBox, static_cast<void \
(KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, \
&IdentityDialog::updateIdentity);
diff --git a/src/irc/servergroupdialog.cpp b/src/irc/servergroupdialog.cpp
index fcc6262..e0d3196 100644
--- a/src/irc/servergroupdialog.cpp
+++ b/src/irc/servergroupdialog.cpp
@@ -28,7 +28,6 @@
#include <QPushButton>
#include <KConfigGroup>
#include <QDialogButtonBox>
-#include <KGuiItem>
#include <QVBoxLayout>
@@ -91,8 +90,8 @@ namespace Konversation
connect(m_mainWidget->m_upChannelBtn, &QToolButton::clicked, this, \
&ServerGroupDialog::moveChannelUp);
connect(m_mainWidget->m_downChannelBtn, &QToolButton::clicked, this, \
&ServerGroupDialog::moveChannelDown);
- KGuiItem::assign(okButton, KGuiItem(i18n("&OK"), "dialog-ok", i18n("Change \
network information")));
- KGuiItem::assign(buttonBox->button(QDialogButtonBox::Cancel), \
KGuiItem(i18n("&Cancel"), "dialog-cancel", i18n("Discards all changes made"))); + \
okButton->setToolTip(i18n("Change network information")); + \
buttonBox->button(QDialogButtonBox::Cancel)->setToolTip(i18n("Discards all changes \
made"));
m_mainWidget->m_nameEdit->setFocus();
diff --git a/src/viewer/editnotifydialog.cpp b/src/viewer/editnotifydialog.cpp
index a74aa5b..f7680f8 100644
--- a/src/viewer/editnotifydialog.cpp
+++ b/src/viewer/editnotifydialog.cpp
@@ -23,7 +23,6 @@
#include <KConfigGroup>
#include <QDialogButtonBox>
#include <QPushButton>
-#include <KGuiItem>
#include <QVBoxLayout>
@@ -86,8 +85,8 @@ const QString& nickname):
layout->addWidget(m_nicknameInput, 1, 1);
- KGuiItem::assign(okButton, KGuiItem(i18n("&OK"),"dialog-ok",i18n("Change notify \
information")));
- KGuiItem::assign(buttonBox->button(QDialogButtonBox::Cancel), \
KGuiItem(i18n("&Cancel"),"dialog-cancel",i18n("Discards all changes made"))); + \
okButton->setToolTip(i18n("Change notify information")); + \
buttonBox->button(QDialogButtonBox::Cancel)->setToolTip(i18n("Discards all changes \
made"));
m_nicknameInput->setFocus();
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic