summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/ChatList/QtChatListWindow.cpp15
-rw-r--r--Swift/QtUI/QtChatWindow.cpp4
2 files changed, 16 insertions, 3 deletions
diff --git a/Swift/QtUI/ChatList/QtChatListWindow.cpp b/Swift/QtUI/ChatList/QtChatListWindow.cpp
index 9beb9dc..e5c63f6 100644
--- a/Swift/QtUI/ChatList/QtChatListWindow.cpp
+++ b/Swift/QtUI/ChatList/QtChatListWindow.cpp
@@ -117,26 +117,35 @@ void QtChatListWindow::handleAddBookmark() {
void QtChatListWindow::handleEditBookmark() {
ChatListMUCItem* mucItem = dynamic_cast<ChatListMUCItem*>(contextMenuItem_);
if (!mucItem) return;
QtEditBookmarkWindow* window = new QtEditBookmarkWindow(eventStream_, mucItem->getBookmark());
window->show();
}
void QtChatListWindow::contextMenuEvent(QContextMenuEvent* event) {
- if (!bookmarksEnabled_) {
- return;
- }
QModelIndex index = indexAt(event->pos());
ChatListItem* baseItem = index.isValid() ? static_cast<ChatListItem*>(index.internalPointer()) : NULL;
contextMenuItem_ = baseItem;
if (!baseItem) {
emptyMenu_->exec(QCursor::pos());
return;
}
ChatListMUCItem* mucItem = dynamic_cast<ChatListMUCItem*>(baseItem);
if (mucItem) {
+ if (!bookmarksEnabled_) {
+ return;
+ }
mucMenu_->exec(QCursor::pos());
}
+ else {
+ QMenu menu;
+ QAction* clearRecents = menu.addAction(tr("Clear recents"));
+ menu.addAction(clearRecents);
+ QAction* result = menu.exec(event->globalPos());
+ if (result == clearRecents) {
+ onClearRecentsRequested();
+ }
+ }
}
}
diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp
index e188e6a..2e3a225 100644
--- a/Swift/QtUI/QtChatWindow.cpp
+++ b/Swift/QtUI/QtChatWindow.cpp
@@ -688,20 +688,24 @@ void QtChatWindow::setAvailableOccupantActions(const std::vector<OccupantAction>
void QtChatWindow::setSubject(const std::string& subject) {
//subject_->setVisible(!subject.empty());
subject_->setText(P2QSTRING(subject));
}
void QtChatWindow::handleActionButtonClicked() {
QMenu contextMenu;
QAction* changeSubject = contextMenu.addAction(tr("Change subject"));
+ //QAction* configure = contextMenu.addAction(tr("Configure room"));
QAction* result = contextMenu.exec(QCursor::pos());
if (result == changeSubject) {
bool ok;
QString subject = QInputDialog::getText(this, tr("Change room subject"), tr("New subject:"), QLineEdit::Normal, subject_->text(), &ok);
if (ok) {
onChangeSubjectRequest(Q2PSTRING(subject));
}
}
+ //else if (result == configure) {
+ // onConfigureRequest();
+ //}
}
}