Skip to content

Commit

Permalink
Removed group list setting for M17 channels.
Browse files Browse the repository at this point in the history
  • Loading branch information
hmatuschek committed Sep 19, 2022
1 parent bbe95ed commit 482f981
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 74 deletions.
38 changes: 2 additions & 36 deletions lib/channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -890,22 +890,20 @@ DMRChannel::serialize(const Context &context, const ErrorStack &err) {
* ********************************************************************************************* */
M17Channel::M17Channel(QObject *parent)
: DigitalChannel(parent), _mode(Mode::Voice), _accessNumber(0), _txContact(),
_rxGroup(), _gpsEnabled(false), _encryptionMode(EncryptionMode::None)
_gpsEnabled(false), _encryptionMode(EncryptionMode::None)
{
// Connect signals of references
connect(&_rxGroup, SIGNAL(modified()), this, SLOT(onReferenceModified()));
connect(&_txContact, SIGNAL(modified()), this, SLOT(onReferenceModified()));
}

M17Channel::M17Channel(const M17Channel &other, QObject *parent)
: DigitalChannel(other, parent), _mode(Mode::Voice), _accessNumber(0),
_txContact(), _rxGroup(), _gpsEnabled(false),
_txContact(), _gpsEnabled(false),
_encryptionMode(EncryptionMode::None)
{
copy(other);

// Connect signals of references
connect(&_rxGroup, SIGNAL(modified()), this, SLOT(onReferenceModified()));
connect(&_txContact, SIGNAL(modified()), this, SLOT(onReferenceModified()));
}

Expand All @@ -915,7 +913,6 @@ M17Channel::clear() {
setMode(Mode::Voice);
setAccessNumber(0);
setContact(nullptr);
setGroupList(nullptr);
enableGPS(false);
setEncryptionMode(EncryptionMode::None);
}
Expand Down Expand Up @@ -957,37 +954,6 @@ M17Channel::setAccessNumber(unsigned int can) {
emit modified(this);
}

const GroupListReference *
M17Channel::groupListRef() const {
return &_rxGroup;
}

GroupListReference *
M17Channel::groupListRef() {
return &_rxGroup;
}

void
M17Channel::setGroupListRef(GroupListReference *ref) {
if (nullptr == ref)
_rxGroup.clear();
else
_rxGroup.copy(ref);
}

RXGroupList *
M17Channel::groupList() const {
return _rxGroup.as<RXGroupList>();
}

bool
M17Channel::setGroupList(RXGroupList *g) {
if(! _rxGroup.set(g))
return false;
emit modified(this);
return true;
}

const M17ContactReference *
M17Channel::contactRef() const {
return &_txContact;
Expand Down
15 changes: 0 additions & 15 deletions lib/channel.hh
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,6 @@ class M17Channel: public DigitalChannel
Q_PROPERTY(unsigned accessNumber READ accessNumber WRITE setAccessNumber)
/** The transmit contact. */
Q_PROPERTY(M17ContactReference* contact READ contactRef WRITE setContactRef)
/** The rx group list. */
Q_PROPERTY(GroupListReference* groupList READ groupListRef WRITE setGroupListRef)
/** The channel mode. */
Q_PROPERTY(Mode mode READ mode WRITE setMode)
/** The encryption mode. */
Expand Down Expand Up @@ -527,17 +525,6 @@ public:
/** Sets the channel access number (0-15). */
void setAccessNumber(unsigned int can);

/** Returns a reference to the group list. */
const GroupListReference *groupListRef() const;
/** Returns a reference to the group list. */
GroupListReference *groupListRef();
/** Sets the reference to the group list. */
void setGroupListRef(GroupListReference *ref);
/** Returns the RX group list for the channel. */
RXGroupList *groupList() const;
/** (Re-)Sets the RX group list for the channel. */
bool setGroupList(RXGroupList *rxg);

/** Returns a reference to the transmit contact. */
const M17ContactReference *contactRef() const;
/** Returns a reference to the transmit contact. */
Expand Down Expand Up @@ -569,8 +556,6 @@ protected:
unsigned int _accessNumber;
/** The default TX contact. */
M17ContactReference _txContact;
/** The RX group list for this channel. */
GroupListReference _rxGroup;
/** If @c true, positioning information is send alonside voice and data. */
bool _gpsEnabled;
/** Holds the encryption mode for the channel. */
Expand Down
8 changes: 1 addition & 7 deletions src/configitemwrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,7 @@ ChannelListWrapper::data(const QModelIndex &index, int role) const {
} else {
return tr("-");
}
} else if (M17Channel *m17 = channel->as<M17Channel>()) {
if (m17->groupList()) {
return m17->groupList()->name();
} else {
return tr("-");
}
} else if (channel->is<FMChannel>()) {
} else if (channel->is<FMChannel>() || channel->is<M17Channel>()) {
return tr("[None]");
}
break;
Expand Down
3 changes: 0 additions & 3 deletions src/m17channeldialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ M17ChannelDialog::construct() {
if (_channel && (_myChannel->scanList() == _config->scanlists()->scanlist(i)) )
ui->scanList->setCurrentIndex(i+1);
}
populateRXGroupListBox(ui->rxGroupList, _config->rxGroupLists(),
(_channel ? _myChannel->groupList() : nullptr));
ui->txContact->addItem(tr("[None]"), QVariant::fromValue(nullptr));
if (_channel && (nullptr == _myChannel->contact()))
ui->txContact->setCurrentIndex(0);
Expand Down Expand Up @@ -128,7 +126,6 @@ M17ChannelDialog::channel() {
_myChannel->setScanList(ui->scanList->currentData().value<ScanList *>());
_myChannel->setMode(ui->channelMode->currentData().value<M17Channel::Mode>());
_myChannel->setAccessNumber(ui->accessNumber->value());
_myChannel->setGroupList(ui->rxGroupList->currentData().value<RXGroupList *>());
_myChannel->setContact(ui->txContact->currentData().value<M17Contact *>());
_myChannel->enableGPS(ui->sendGPS->isChecked());

Expand Down
16 changes: 3 additions & 13 deletions src/m17channeldialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -246,33 +246,23 @@
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="rxGroupListLabel">
<property name="text">
<string>Rx Group List</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="rxGroupList"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="txContactLabel">
<property name="text">
<string>Tx Contact</string>
</property>
</widget>
</item>
<item row="3" column="1">
<item row="2" column="1">
<widget class="QComboBox" name="txContact"/>
</item>
<item row="4" column="0">
<item row="3" column="0">
<widget class="QLabel" name="posSysLabel">
<property name="text">
<string>Send position</string>
</property>
</widget>
</item>
<item row="4" column="1">
<item row="3" column="1">
<widget class="QCheckBox" name="sendGPS">
<property name="text">
<string/>
Expand Down

0 comments on commit 482f981

Please sign in to comment.