chatgui: RenameDialog — quick rename via context menu, separate mini dialog
This commit is contained in:
1 parent
85bdc00aaf
commit
df3fc04523
4 files changed
+126
No files matched your search
@@ -2,6 +2,7 @@
|
||||
#include "accountdelegate.h"
|
||||
#include "memberlistmodel.h"
|
||||
#include "memberpropsdialog.h"
|
||||
#include "renamedialog.h"
|
||||
#include "../db/db_manager.h"
|
||||
#include <QVBoxLayout>
|
||||
#include <QLabel>
|
||||
@@ -215,8 +216,16 @@ void AccountList::onMemberContextMenu(const QPoint& pos) {
|
||||
QString name = m_model->data(index, Qt::DisplayRole).toString();
|
||||
|
||||
QMenu menu(m_listView);
|
||||
QAction* renameAction = menu.addAction("Rename");
|
||||
if (nodeId == m_db->myNodeId()) renameAction->setEnabled(false);
|
||||
QAction* editAction = menu.addAction("Edit");
|
||||
QAction* chosen = menu.exec(m_listView->viewport()->mapToGlobal(pos));
|
||||
|
||||
if (chosen == renameAction) {
|
||||
RenameDialog dlg(m_db, m_channelId, nodeId, name, this);
|
||||
if (dlg.exec() == QDialog::Accepted) m_model->refresh();
|
||||
return;
|
||||
}
|
||||
if (chosen != editAction) return;
|
||||
|
||||
MemberPropsDialog dlg(m_db, m_channelId, nodeId, name, this);
|
||||
|
||||
Reference in new issue
Block a user