diff options
Diffstat (limited to 'Swift/QtUI/Roster')
-rw-r--r-- | Swift/QtUI/Roster/QtTreeWidget.cpp | 6 | ||||
-rw-r--r-- | Swift/QtUI/Roster/QtTreeWidget.h | 6 | ||||
-rw-r--r-- | Swift/QtUI/Roster/QtTreeWidgetItem.h | 11 | ||||
-rw-r--r-- | Swift/QtUI/Roster/RosterModel.cpp | 3 |
4 files changed, 8 insertions, 18 deletions
diff --git a/Swift/QtUI/Roster/QtTreeWidget.cpp b/Swift/QtUI/Roster/QtTreeWidget.cpp index 90084c4..963ce72 100644 --- a/Swift/QtUI/Roster/QtTreeWidget.cpp +++ b/Swift/QtUI/Roster/QtTreeWidget.cpp @@ -83,18 +83,18 @@ void QtTreeWidget::contextMenuEvent(QContextMenuEvent* event) { RosterItem* item = static_cast<RosterItem*>(index.internalPointer()); QMenu contextMenu; if (ContactRosterItem* contact = dynamic_cast<ContactRosterItem*>(item)) { - QAction* editContact = contextMenu.addAction("Edit"); + QAction* editContact = contextMenu.addAction(tr("Edit")); QAction* result = contextMenu.exec(event->globalPos()); if (result == editContact) { eventStream_->send(boost::make_shared<RequestContactEditorUIEvent>(contact->getJID())); } } else if (GroupRosterItem* group = dynamic_cast<GroupRosterItem*>(item)) { - QAction* renameGroup = contextMenu.addAction("Rename"); + QAction* renameGroup = contextMenu.addAction(tr("Rename")); QAction* result = contextMenu.exec(event->globalPos()); if (result == renameGroup) { bool ok; - QString newName = QInputDialog::getText(NULL, "Rename group", "New name for " + P2QSTRING(group->getDisplayName()), QLineEdit::Normal, P2QSTRING(group->getDisplayName()), &ok); + QString newName = QInputDialog::getText(NULL, tr("Rename group"), tr("New name for %1").arg(P2QSTRING(group->getDisplayName())), QLineEdit::Normal, P2QSTRING(group->getDisplayName()), &ok); if (ok) { eventStream_->send(boost::make_shared<RenameGroupUIEvent>(group->getDisplayName(), Q2PSTRING(newName))); } diff --git a/Swift/QtUI/Roster/QtTreeWidget.h b/Swift/QtUI/Roster/QtTreeWidget.h index ff11567..3430f7e 100644 --- a/Swift/QtUI/Roster/QtTreeWidget.h +++ b/Swift/QtUI/Roster/QtTreeWidget.h @@ -4,12 +4,10 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#ifndef SWIFT_QtTreeWidget_H -#define SWIFT_QtTreeWidget_H +#pragma once #include <QTreeView> #include <QModelIndex> -#include "Swift/QtUI/Roster/QtTreeWidget.h" #include "Swift/QtUI/Roster/RosterModel.h" #include "Swift/QtUI/Roster/RosterDelegate.h" @@ -44,5 +42,3 @@ class QtTreeWidget : public QTreeView{ }; } -#endif - diff --git a/Swift/QtUI/Roster/QtTreeWidgetItem.h b/Swift/QtUI/Roster/QtTreeWidgetItem.h index a2d0cdd..6855989 100644 --- a/Swift/QtUI/Roster/QtTreeWidgetItem.h +++ b/Swift/QtUI/Roster/QtTreeWidgetItem.h @@ -4,22 +4,17 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#ifndef SWIFT_QtTreeWidgetItem_H -#define SWIFT_QtTreeWidgetItem_H +#pragma once #include <QColor> #include <QVariant> - #include <string> + #include "Swiften/Roster/TreeWidgetFactory.h" #include "Swiften/Roster/TreeWidget.h" #include "Swiften/Roster/TreeWidgetItem.h" -#include "Swift/QtUI/Roster/QtTreeWidgetItem.h" - - #include "Swift/QtUI/QtSwiftUtil.h" - namespace Swift { enum RosterRoles { StatusTextRole = Qt::UserRole, @@ -89,5 +84,3 @@ class QtTreeWidgetItem : public QObject, public TreeWidgetItem { bool itemLessThan(QtTreeWidgetItem* left, QtTreeWidgetItem* right); } -#endif - diff --git a/Swift/QtUI/Roster/RosterModel.cpp b/Swift/QtUI/Roster/RosterModel.cpp index 306b76f..2399a21 100644 --- a/Swift/QtUI/Roster/RosterModel.cpp +++ b/Swift/QtUI/Roster/RosterModel.cpp @@ -15,6 +15,7 @@ #include "Swiften/Elements/StatusShow.h" #include "Swift/Controllers/Roster/ContactRosterItem.h" #include "Swift/Controllers/Roster/GroupRosterItem.h" +#include <Swift/Controllers/StatusUtil.h> #include "QtSwiftUtil.h" #include "Swift/QtUI/Roster/QtTreeWidget.h" @@ -126,7 +127,7 @@ QString RosterModel::getToolTip(RosterItem* item) const { if (contact->getDisplayJID().isValid()) { tip += "\n" + P2QSTRING(contact->getDisplayJID().toBare().toString()); } - tip += "\n " + P2QSTRING(StatusShow::typeToFriendlyName(contact->getStatusShow())); + tip += "\n " + P2QSTRING(statusShowTypeToFriendlyName(contact->getStatusShow())); if (!getStatusText(item).isEmpty()) { tip += ": " + getStatusText(item); } |