mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-19 10:20:49 +08:00
add: basic group manager without subscription feature
This commit is contained in:
parent
a5d9c3d253
commit
2bd9cc1a87
@ -204,6 +204,8 @@ set(QV2RAY_SOURCES
|
|||||||
src/ui/widgets/QvAutoCompleteTextEdit.cpp
|
src/ui/widgets/QvAutoCompleteTextEdit.cpp
|
||||||
src/ui/widgets/StreamSettingsWidget.cpp
|
src/ui/widgets/StreamSettingsWidget.cpp
|
||||||
src/ui/widgets/RouteSettingsMatrix.cpp
|
src/ui/widgets/RouteSettingsMatrix.cpp
|
||||||
|
src/ui/widgets/InboundSettingsWidget.cpp
|
||||||
|
src/ui/widgets/ConnectionSettingsWidget.cpp
|
||||||
src/ui/w_ImportConfig.cpp
|
src/ui/w_ImportConfig.cpp
|
||||||
src/ui/w_MainWindow.cpp
|
src/ui/w_MainWindow.cpp
|
||||||
src/ui/w_MainWindow_extra.cpp
|
src/ui/w_MainWindow_extra.cpp
|
||||||
@ -222,6 +224,8 @@ set(QV2RAY_SOURCES
|
|||||||
src/ui/widgets/ConnectionInfoWidget.ui
|
src/ui/widgets/ConnectionInfoWidget.ui
|
||||||
src/ui/widgets/ConnectionItemWidget.ui
|
src/ui/widgets/ConnectionItemWidget.ui
|
||||||
src/ui/widgets/RouteSettingsMatrix.ui
|
src/ui/widgets/RouteSettingsMatrix.ui
|
||||||
|
src/ui/widgets/InboundSettingsWidget.ui
|
||||||
|
src/ui/widgets/ConnectionSettingsWidget.ui
|
||||||
src/ui/w_MainWindow.ui
|
src/ui/w_MainWindow.ui
|
||||||
src/ui/w_PreferencesWindow.ui
|
src/ui/w_PreferencesWindow.ui
|
||||||
src/ui/w_PluginManager.ui
|
src/ui/w_PluginManager.ui
|
||||||
@ -285,6 +289,8 @@ set(QV2RAY_SOURCES
|
|||||||
src/ui/widgets/QvAutoCompleteTextEdit.hpp
|
src/ui/widgets/QvAutoCompleteTextEdit.hpp
|
||||||
src/ui/widgets/StreamSettingsWidget.hpp
|
src/ui/widgets/StreamSettingsWidget.hpp
|
||||||
src/ui/widgets/RouteSettingsMatrix.hpp
|
src/ui/widgets/RouteSettingsMatrix.hpp
|
||||||
|
src/ui/widgets/InboundSettingsWidget.hpp
|
||||||
|
src/ui/widgets/ConnectionSettingsWidget.hpp
|
||||||
src/ui/w_ImportConfig.hpp
|
src/ui/w_ImportConfig.hpp
|
||||||
src/ui/w_MainWindow.hpp
|
src/ui/w_MainWindow.hpp
|
||||||
src/ui/w_PreferencesWindow.hpp
|
src/ui/w_PreferencesWindow.hpp
|
||||||
|
@ -1 +1 @@
|
|||||||
5343
|
5348
|
@ -4,106 +4,113 @@
|
|||||||
#include "core/handler/ConfigHandler.hpp"
|
#include "core/handler/ConfigHandler.hpp"
|
||||||
#include "core/settings/SettingsBackend.hpp"
|
#include "core/settings/SettingsBackend.hpp"
|
||||||
|
|
||||||
SubscriptionEditor::SubscriptionEditor(QWidget *parent) : QDialog(parent)
|
GroupManager::GroupManager(QWidget *parent) : QDialog(parent)
|
||||||
{
|
{
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
QvMessageBusConnect(SubscriptionEditor);
|
QvMessageBusConnect(GroupManager);
|
||||||
UpdateColorScheme();
|
UpdateColorScheme();
|
||||||
for (auto subs : ConnectionManager->Subscriptions())
|
connectionListRCMenu->addMenu(connectionListRCMenu_CopyToMenu);
|
||||||
|
connectionListRCMenu->addMenu(connectionListRCMenu_MoveToMenu);
|
||||||
|
for (auto group : ConnectionManager->AllGroups())
|
||||||
{
|
{
|
||||||
groupList->addTopLevelItem(new QTreeWidgetItem(QStringList{ GetDisplayName(subs), subs.toString() }));
|
auto item = new QListWidgetItem(GetDisplayName(group));
|
||||||
|
item->setData(Qt::UserRole, group.toString());
|
||||||
|
groupList->addItem(item);
|
||||||
}
|
}
|
||||||
if (groupList->topLevelItemCount() > 0)
|
if (groupList->count() > 0)
|
||||||
{
|
{
|
||||||
groupList->setCurrentItem(groupList->topLevelItem(0));
|
groupList->setCurrentItem(groupList->item(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubscriptionEditor::UpdateColorScheme()
|
void GroupManager::UpdateColorScheme()
|
||||||
{
|
{
|
||||||
addSubsButton->setIcon(QICON_R("add.png"));
|
addGroupButton->setIcon(QICON_R("add.png"));
|
||||||
removeSubsButton->setIcon(QICON_R("delete.png"));
|
removeGroupButton->setIcon(QICON_R("delete.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
QvMessageBusSlotImpl(SubscriptionEditor)
|
QvMessageBusSlotImpl(GroupManager)
|
||||||
{
|
{
|
||||||
switch (msg)
|
switch (msg)
|
||||||
{
|
{
|
||||||
MBShowDefaultImpl MBHideDefaultImpl MBRetranslateDefaultImpl MBUpdateColorSchemeDefaultImpl
|
MBShowDefaultImpl;
|
||||||
|
MBHideDefaultImpl;
|
||||||
|
MBRetranslateDefaultImpl;
|
||||||
|
MBUpdateColorSchemeDefaultImpl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tuple<QString, CONFIGROOT> SubscriptionEditor::GetSelectedConfig()
|
tuple<QString, CONFIGROOT> GroupManager::GetSelectedConfig()
|
||||||
{
|
{
|
||||||
return { GetDisplayName(currentConnectionId), ConnectionManager->GetConnectionRoot(currentConnectionId) };
|
return { GetDisplayName(currentConnectionId), ConnectionManager->GetConnectionRoot(currentConnectionId) };
|
||||||
}
|
}
|
||||||
|
|
||||||
SubscriptionEditor::~SubscriptionEditor()
|
GroupManager::~GroupManager()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubscriptionEditor::on_addSubsButton_clicked()
|
void GroupManager::on_addGroupButton_clicked()
|
||||||
{
|
{
|
||||||
auto const key = QSTRN(QTime::currentTime().msecsSinceStartOfDay());
|
auto const key = QSTRN(QTime::currentTime().msecsSinceStartOfDay());
|
||||||
auto id = ConnectionManager->CreateGroup(key, true);
|
auto id = ConnectionManager->CreateGroup(key, true);
|
||||||
//
|
//
|
||||||
groupList->addTopLevelItem(new QTreeWidgetItem(QStringList{ key, id.toString() }));
|
auto item = new QListWidgetItem(key);
|
||||||
|
item->setData(Qt::UserRole, id.toString());
|
||||||
|
groupList->addItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubscriptionEditor::on_updateButton_clicked()
|
void GroupManager::on_updateButton_clicked()
|
||||||
{
|
{
|
||||||
if (QvMessageBoxAsk(this, tr("Reload Subscription"), tr("Would you like to reload the subscription?")) == QMessageBox::Yes)
|
if (QvMessageBoxAsk(this, tr("Reload Subscription"), tr("Would you like to reload the subscription?")) == QMessageBox::Yes)
|
||||||
{
|
{
|
||||||
this->setEnabled(false);
|
this->setEnabled(false);
|
||||||
ConnectionManager->UpdateSubscription(currentSubId); //
|
ConnectionManager->UpdateSubscription(currentSubId); //
|
||||||
this->setEnabled(true);
|
this->setEnabled(true);
|
||||||
on_groupList_itemClicked(groupList->currentItem(), 0);
|
on_groupList_itemClicked(groupList->currentItem());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubscriptionEditor::on_removeSubsButton_clicked()
|
void GroupManager::on_removeGroupButton_clicked()
|
||||||
{
|
{
|
||||||
if (QvMessageBoxAsk(this, tr("Deleting a subscription"), tr("All connections will be moved to default group, do you want to continue?")) ==
|
if (QvMessageBoxAsk(this, tr("Deleting a subscription"), tr("All connections will be moved to default group, do you want to continue?")) ==
|
||||||
QMessageBox::Yes)
|
QMessageBox::Yes)
|
||||||
{
|
{
|
||||||
ConnectionManager->DeleteGroup(currentSubId); //
|
ConnectionManager->DeleteGroup(currentSubId); //
|
||||||
auto item = groupList->currentItem();
|
auto item = groupList->currentItem();
|
||||||
groupList->removeItemWidget(item, 0);
|
groupList->removeItemWidget(item);
|
||||||
delete item;
|
delete item;
|
||||||
if (groupList->topLevelItemCount() > 0)
|
if (groupList->count() > 0)
|
||||||
{
|
{
|
||||||
groupList->setCurrentItem(groupList->topLevelItem(0));
|
groupList->setCurrentItem(groupList->item(0));
|
||||||
on_groupList_itemClicked(groupList->topLevelItem(0), 0);
|
on_groupList_itemClicked(groupList->item(0));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
groupBox_2->setEnabled(false);
|
groupInfoGroupBox->setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubscriptionEditor::on_buttonBox_accepted()
|
void GroupManager::on_buttonBox_accepted()
|
||||||
{
|
{
|
||||||
// Nothing?
|
// Nothing?
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubscriptionEditor::on_groupList_itemSelectionChanged()
|
void GroupManager::on_groupList_itemSelectionChanged()
|
||||||
{
|
{
|
||||||
groupBox_2->setEnabled(groupList->selectedItems().count() > 0);
|
groupInfoGroupBox->setEnabled(groupList->selectedItems().count() > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubscriptionEditor::on_groupList_itemClicked(QTreeWidgetItem *item, int column)
|
void GroupManager::on_groupList_itemClicked(QListWidgetItem *item)
|
||||||
{
|
{
|
||||||
Q_UNUSED(column)
|
|
||||||
|
|
||||||
if (item == nullptr)
|
if (item == nullptr)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
groupInfoGroupBox->setEnabled(true);
|
||||||
groupBox_2->setEnabled(true);
|
currentSubId = GroupId(item->data(Qt::UserRole).toString());
|
||||||
currentSubId = GroupId(item->text(1));
|
|
||||||
//
|
//
|
||||||
groupNameTxt->setText(GetDisplayName(currentSubId));
|
groupNameTxt->setText(GetDisplayName(currentSubId));
|
||||||
auto const [addr, lastUpdated, updateInterval] = ConnectionManager->GetSubscriptionData(currentSubId);
|
auto const [addr, lastUpdated, updateInterval] = ConnectionManager->GetSubscriptionData(currentSubId);
|
||||||
@ -119,31 +126,31 @@ void SubscriptionEditor::on_groupList_itemClicked(QTreeWidgetItem *item, int col
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubscriptionEditor::on_groupList_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous)
|
void GroupManager::on_groupList_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous)
|
||||||
{
|
{
|
||||||
Q_UNUSED(previous)
|
Q_UNUSED(previous)
|
||||||
on_groupList_itemClicked(current, 0);
|
on_groupList_itemClicked(current);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubscriptionEditor::on_subNameTxt_textEdited(const QString &arg1)
|
void GroupManager::on_subNameTxt_textEdited(const QString &arg1)
|
||||||
{
|
{
|
||||||
groupList->selectedItems().first()->setText(0, arg1);
|
groupList->selectedItems().first()->setText(arg1);
|
||||||
ConnectionManager->RenameGroup(currentSubId, arg1.trimmed());
|
ConnectionManager->RenameGroup(currentSubId, arg1.trimmed());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubscriptionEditor::on_subAddrTxt_textEdited(const QString &arg1)
|
void GroupManager::on_subAddrTxt_textEdited(const QString &arg1)
|
||||||
{
|
{
|
||||||
auto newUpdateInterval = updateIntervalSB->value();
|
auto newUpdateInterval = updateIntervalSB->value();
|
||||||
ConnectionManager->SetSubscriptionData(currentSubId, arg1, newUpdateInterval);
|
ConnectionManager->SetSubscriptionData(currentSubId, arg1, newUpdateInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubscriptionEditor::on_updateIntervalSB_valueChanged(double arg1)
|
void GroupManager::on_updateIntervalSB_valueChanged(double arg1)
|
||||||
{
|
{
|
||||||
auto newAddress = subAddrTxt->text().trimmed();
|
auto newAddress = subAddrTxt->text().trimmed();
|
||||||
ConnectionManager->SetSubscriptionData(currentSubId, newAddress, arg1);
|
ConnectionManager->SetSubscriptionData(currentSubId, newAddress, arg1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubscriptionEditor::on_connectionsList_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous)
|
void GroupManager::on_connectionsList_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous)
|
||||||
{
|
{
|
||||||
Q_UNUSED(previous)
|
Q_UNUSED(previous)
|
||||||
if (current != nullptr)
|
if (current != nullptr)
|
||||||
@ -151,3 +158,9 @@ void SubscriptionEditor::on_connectionsList_currentItemChanged(QListWidgetItem *
|
|||||||
currentConnectionId = ConnectionManager->GetConnectionIdByDisplayName(current->text(), currentSubId);
|
currentConnectionId = ConnectionManager->GetConnectionIdByDisplayName(current->text(), currentSubId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GroupManager::on_connectionsList_customContextMenuRequested(const QPoint &pos)
|
||||||
|
{
|
||||||
|
Q_UNUSED(pos)
|
||||||
|
connectionListRCMenu->popup(QCursor::pos());
|
||||||
|
}
|
||||||
|
@ -6,35 +6,36 @@
|
|||||||
#include "ui_w_GroupManager.h"
|
#include "ui_w_GroupManager.h"
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
#include <QMenu>
|
||||||
|
|
||||||
class SubscriptionEditor
|
class GroupManager
|
||||||
: public QDialog
|
: public QDialog
|
||||||
, private Ui::w_GroupManager
|
, private Ui::w_GroupManager
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SubscriptionEditor(QWidget *parent = nullptr);
|
explicit GroupManager(QWidget *parent = nullptr);
|
||||||
~SubscriptionEditor();
|
~GroupManager();
|
||||||
tuple<QString, CONFIGROOT> GetSelectedConfig();
|
tuple<QString, CONFIGROOT> GetSelectedConfig();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QvMessageBusSlotDecl;
|
QvMessageBusSlotDecl;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_addSubsButton_clicked();
|
void on_addGroupButton_clicked();
|
||||||
|
|
||||||
void on_updateButton_clicked();
|
void on_updateButton_clicked();
|
||||||
|
|
||||||
void on_removeSubsButton_clicked();
|
void on_removeGroupButton_clicked();
|
||||||
|
|
||||||
void on_buttonBox_accepted();
|
void on_buttonBox_accepted();
|
||||||
|
|
||||||
void on_groupList_itemSelectionChanged();
|
void on_groupList_itemSelectionChanged();
|
||||||
|
|
||||||
void on_groupList_itemClicked(QTreeWidgetItem *item, int column);
|
void on_groupList_itemClicked(QListWidgetItem *item);
|
||||||
|
|
||||||
void on_groupList_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
|
void on_groupList_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);
|
||||||
|
|
||||||
void on_subNameTxt_textEdited(const QString &arg1);
|
void on_subNameTxt_textEdited(const QString &arg1);
|
||||||
|
|
||||||
@ -44,7 +45,12 @@ class SubscriptionEditor
|
|||||||
|
|
||||||
void on_connectionsList_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);
|
void on_connectionsList_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);
|
||||||
|
|
||||||
|
void on_connectionsList_customContextMenuRequested(const QPoint &pos);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QMenu *connectionListRCMenu = new QMenu(this);
|
||||||
|
QMenu *connectionListRCMenu_CopyToMenu = new QMenu(tr("Copy to..."));
|
||||||
|
QMenu *connectionListRCMenu_MoveToMenu = new QMenu(tr("Move to..."));
|
||||||
void UpdateColorScheme();
|
void UpdateColorScheme();
|
||||||
bool isUpdateInProgress = false;
|
bool isUpdateInProgress = false;
|
||||||
GroupId currentSubId = NullGroupId;
|
GroupId currentSubId = NullGroupId;
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout" columnstretch="2,5">
|
<layout class="QGridLayout" name="gridLayout" columnstretch="2,5">
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QGroupBox" name="groupBox_2">
|
<widget class="QGroupBox" name="groupInfoGroupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Group Info</string>
|
<string>Group Info</string>
|
||||||
</property>
|
</property>
|
||||||
@ -66,27 +66,13 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTreeWidget" name="groupList">
|
<widget class="QListWidget" name="groupList">
|
||||||
<property name="selectionMode">
|
<property name="selectionMode">
|
||||||
<enum>QAbstractItemView::SingleSelection</enum>
|
<enum>QAbstractItemView::SingleSelection</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="selectionBehavior">
|
<property name="selectionBehavior">
|
||||||
<enum>QAbstractItemView::SelectRows</enum>
|
<enum>QAbstractItemView::SelectRows</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="rootIsDecorated">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="uniformRowHeights">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="headerHidden">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">1</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@ -105,7 +91,7 @@
|
|||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="addSubsButton">
|
<widget class="QToolButton" name="addGroupButton">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@ -125,7 +111,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="removeSubsButton">
|
<widget class="QToolButton" name="removeGroupButton">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@ -198,9 +184,15 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="0" column="0" colspan="2">
|
<item row="0" column="0" colspan="2">
|
||||||
<widget class="QListWidget" name="connectionsList">
|
<widget class="QListWidget" name="connectionsList">
|
||||||
|
<property name="contextMenuPolicy">
|
||||||
|
<enum>Qt::CustomContextMenu</enum>
|
||||||
|
</property>
|
||||||
<property name="editTriggers">
|
<property name="editTriggers">
|
||||||
<set>QAbstractItemView::NoEditTriggers</set>
|
<set>QAbstractItemView::NoEditTriggers</set>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="selectionMode">
|
||||||
|
<enum>QAbstractItemView::MultiSelection</enum>
|
||||||
|
</property>
|
||||||
<property name="resizeMode">
|
<property name="resizeMode">
|
||||||
<enum>QListView::Adjust</enum>
|
<enum>QListView::Adjust</enum>
|
||||||
</property>
|
</property>
|
||||||
@ -210,41 +202,41 @@
|
|||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tab_2">
|
<widget class="QWidget" name="tab_2">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Subscription</string>
|
<string>Subscription Settings</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QFormLayout" name="formLayout">
|
<layout class="QFormLayout" name="formLayout">
|
||||||
<item row="0" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Subscription Address</string>
|
<string>Subscription Address</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QLineEdit" name="subAddrTxt"/>
|
<widget class="QLineEdit" name="subAddrTxt"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="label_3">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Update Interval</string>
|
<string>Update Interval</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QLabel" name="lastUpdatedLabel">
|
<widget class="QLabel" name="lastUpdatedLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="label_6">
|
<widget class="QLabel" name="label_6">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Last Updated</string>
|
<string>Last Updated</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="3" column="1">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QDoubleSpinBox" name="updateIntervalSB">
|
<widget class="QDoubleSpinBox" name="updateIntervalSB">
|
||||||
@ -281,14 +273,14 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0" colspan="2">
|
<item row="5" column="0" colspan="2">
|
||||||
<widget class="QPushButton" name="updateButton">
|
<widget class="QPushButton" name="updateButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Update Subscription Data</string>
|
<string>Update Subscription Data</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0" colspan="2">
|
<item row="4" column="0" colspan="2">
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
@ -301,36 +293,23 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="groupIsSubscriptionCB">
|
||||||
|
<property name="text">
|
||||||
|
<string>This group is a subscription</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tab_5">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>General Settings</string>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="tab_3">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>Inbound Settings</string>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="tab_6">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>Routing</string>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="tab_4">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>Connection Settings</string>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>groupList</tabstop>
|
<tabstop>groupList</tabstop>
|
||||||
<tabstop>addSubsButton</tabstop>
|
<tabstop>addGroupButton</tabstop>
|
||||||
<tabstop>removeSubsButton</tabstop>
|
<tabstop>removeGroupButton</tabstop>
|
||||||
<tabstop>subAddrTxt</tabstop>
|
<tabstop>subAddrTxt</tabstop>
|
||||||
<tabstop>updateIntervalSB</tabstop>
|
<tabstop>updateIntervalSB</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
|
@ -288,7 +288,7 @@ void ImportConfigWindow::on_cancelImportBtn_clicked()
|
|||||||
void ImportConfigWindow::on_subscriptionButton_clicked()
|
void ImportConfigWindow::on_subscriptionButton_clicked()
|
||||||
{
|
{
|
||||||
hide();
|
hide();
|
||||||
SubscriptionEditor w(this);
|
GroupManager w(this);
|
||||||
w.exec();
|
w.exec();
|
||||||
auto importToComplex = !keepImportedInboundCheckBox->isEnabled();
|
auto importToComplex = !keepImportedInboundCheckBox->isEnabled();
|
||||||
connections.clear();
|
connections.clear();
|
||||||
|
@ -604,7 +604,7 @@ void MainWindow::on_action_RCM_EditAsComplex_triggered()
|
|||||||
|
|
||||||
void MainWindow::on_subsButton_clicked()
|
void MainWindow::on_subsButton_clicked()
|
||||||
{
|
{
|
||||||
SubscriptionEditor().exec();
|
GroupManager().exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_connectionListWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
void MainWindow::on_connectionListWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tabWidgetPage1">
|
<widget class="QWidget" name="tabWidgetPage1">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
16
src/ui/widgets/ConnectionSettingsWidget.cpp
Normal file
16
src/ui/widgets/ConnectionSettingsWidget.cpp
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#include "ConnectionSettingsWidget.hpp"
|
||||||
|
|
||||||
|
ConnectionSettingsWidget::ConnectionSettingsWidget(QWidget *parent) : QWidget(parent)
|
||||||
|
{
|
||||||
|
setupUi(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConnectionSettingsWidget::changeEvent(QEvent *e)
|
||||||
|
{
|
||||||
|
QWidget::changeEvent(e);
|
||||||
|
switch (e->type())
|
||||||
|
{
|
||||||
|
case QEvent::LanguageChange: retranslateUi(this); break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
}
|
16
src/ui/widgets/ConnectionSettingsWidget.hpp
Normal file
16
src/ui/widgets/ConnectionSettingsWidget.hpp
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "ui_ConnectionSettingsWidget.h"
|
||||||
|
|
||||||
|
class ConnectionSettingsWidget
|
||||||
|
: public QWidget
|
||||||
|
, private Ui::ConnectionSettingsWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit ConnectionSettingsWidget(QWidget *parent = nullptr);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void changeEvent(QEvent *e);
|
||||||
|
};
|
21
src/ui/widgets/ConnectionSettingsWidget.ui
Normal file
21
src/ui/widgets/ConnectionSettingsWidget.ui
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<ui version="4.0">
|
||||||
|
<author/>
|
||||||
|
<comment/>
|
||||||
|
<exportmacro/>
|
||||||
|
<class>ConnectionSettingsWidget</class>
|
||||||
|
<widget class="QWidget" name="ConnectionSettingsWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<pixmapfunction/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
26
src/ui/widgets/InboundSettingsWidget.cpp
Normal file
26
src/ui/widgets/InboundSettingsWidget.cpp
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#include "InboundSettingsWidget.hpp"
|
||||||
|
InboundSettingsWidget::InboundSettingsWidget(QWidget *parent) : QWidget(parent)
|
||||||
|
{
|
||||||
|
setupUi(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
QvMessageBusSlotImpl(InboundSettingsWidget)
|
||||||
|
{
|
||||||
|
switch (msg)
|
||||||
|
{
|
||||||
|
MBRetranslateDefaultImpl;
|
||||||
|
case HIDE_WINDOWS:
|
||||||
|
case SHOW_WINDOWS: break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void InboundSettingsWidget::changeEvent(QEvent *e)
|
||||||
|
{
|
||||||
|
QWidget::changeEvent(e);
|
||||||
|
switch (e->type())
|
||||||
|
{
|
||||||
|
case QEvent::LanguageChange: retranslateUi(this); break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
}
|
18
src/ui/widgets/InboundSettingsWidget.hpp
Normal file
18
src/ui/widgets/InboundSettingsWidget.hpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "ui/messaging/QvMessageBus.hpp"
|
||||||
|
#include "ui_InboundSettingsWidget.h"
|
||||||
|
|
||||||
|
class InboundSettingsWidget
|
||||||
|
: public QWidget
|
||||||
|
, private Ui::InboundSettingsWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
QvMessageBusSlotDecl;
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit InboundSettingsWidget(QWidget *parent = nullptr);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void changeEvent(QEvent *e);
|
||||||
|
};
|
21
src/ui/widgets/InboundSettingsWidget.ui
Normal file
21
src/ui/widgets/InboundSettingsWidget.ui
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<ui version="4.0">
|
||||||
|
<author/>
|
||||||
|
<comment/>
|
||||||
|
<exportmacro/>
|
||||||
|
<class>InboundSettingsWidget</class>
|
||||||
|
<widget class="QWidget" name="InboundSettingsWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<pixmapfunction/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
Loading…
Reference in New Issue
Block a user