diff options
author | Louie S <louie@example.com> | 2024-03-09 16:53:38 -0500 |
---|---|---|
committer | Louie S <louie@example.com> | 2024-03-09 16:53:38 -0500 |
commit | afcae23cbf63b31a7ce111ffcd76c027b332bdf9 (patch) | |
tree | e86001041d05e13cb778ada13c5a3addccf93a8d /src/group.cpp | |
parent | 312ea44966ca5ee65185fc837d15143e7dd59761 (diff) |
Break entry/group/rule into sub-classes
Diffstat (limited to 'src/group.cpp')
-rw-r--r-- | src/group.cpp | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/src/group.cpp b/src/group.cpp index 1757753..d1c257f 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -1,12 +1,4 @@ -#include <QLabel> -#include <QMenu> -#include <QString> - -#include <QDebug> - -#include "add_entry_form.h" #include "group.h" -#include "lib.h" Group::Group(int id, QString name, QString column, QString link, bool hidden) : id(id), @@ -15,52 +7,4 @@ Group::Group(int id, QString name, QString column, QString link, bool hidden) : link(link), hidden(hidden) { - this->setContentsMargins(0, 10, 0, 10); - - QLabel *name_label = new QLabel(this->name); - name_label->setTextInteractionFlags(Qt::TextSelectableByMouse); - name_label->setToolTip("Right-Click for actions"); - name_label->setContextMenuPolicy(Qt::CustomContextMenu); - //name_label->customContextMenuRequested(const QPoint &pos) - QObject::connect(name_label, - SIGNAL(customContextMenuRequested(const QPoint &)), - SLOT(showContextMenu())); - - QFont name_font = QFont("Arial", 13); - name_font.setUnderline(true); - name_label->setFont(name_font); - - this->addWidget(name_label); -} - -void Group::showContextMenu() { - QMenu menu; - - QAction *add_entry_act = new QAction("Add Entry"); - QObject::connect(add_entry_act, &QAction::triggered, this, &Group::addEntry); - menu.addAction(add_entry_act); - - QAction *edit_group_act = new QAction("Edit Group"); - QObject::connect(edit_group_act, &QAction::triggered, this, &Group::editGroup); - menu.addAction(edit_group_act); - - QAction *del_group_act = new QAction("Remove Group"); - QObject::connect(del_group_act, &QAction::triggered, this, &Group::removeGroup); - menu.addAction(del_group_act); - - menu.exec(QCursor::pos()); -} - -void Group::addEntry() { - AddEntryForm create_new_entry_dialog(this->id); - if(create_new_entry_dialog.exec() == QDialog::Accepted) - getMainWindow()->displayWidgets(); -} - -void Group::editGroup() { - qDebug() << "WIP"; -} - -void Group::removeGroup() { - qDebug() << "WIP"; } |