mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-20 19:00:22 +08:00
update: small updates
This commit is contained in:
parent
3dc2f4bfbd
commit
edb95af317
@ -1 +1 @@
|
|||||||
5607
|
5608
|
||||||
|
@ -185,13 +185,9 @@ void ConnectionItemWidget::on_doRenameBtn_clicked()
|
|||||||
if (renameTxt->text().isEmpty())
|
if (renameTxt->text().isEmpty())
|
||||||
return;
|
return;
|
||||||
if (connectionId == NullConnectionId)
|
if (connectionId == NullConnectionId)
|
||||||
{
|
|
||||||
ConnectionManager->RenameGroup(groupId, renameTxt->text());
|
ConnectionManager->RenameGroup(groupId, renameTxt->text());
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
ConnectionManager->RenameConnection(connectionId, renameTxt->text());
|
ConnectionManager->RenameConnection(connectionId, renameTxt->text());
|
||||||
}
|
|
||||||
stackedWidget->setCurrentIndex(0);
|
stackedWidget->setCurrentIndex(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,7 +197,10 @@ void ConnectionItemWidget::OnConnectionItemRenamed(const ConnectionId &id, const
|
|||||||
{
|
{
|
||||||
connNameLabel->setText((ConnectionManager->IsConnected({ connectionId, groupId }) ? "• " : "") + newName);
|
connNameLabel->setText((ConnectionManager->IsConnected({ connectionId, groupId }) ? "• " : "") + newName);
|
||||||
originalItemName = newName;
|
originalItemName = newName;
|
||||||
this->setToolTip(newName);
|
const auto conn = ConnectionManager->GetConnectionMetaObject(connectionId);
|
||||||
|
this->setToolTip(newName + //
|
||||||
|
NEWLINE + tr("Last Connected: ") + timeToString(conn.lastConnected) + //
|
||||||
|
NEWLINE + tr("Last Updated: ") + timeToString(conn.lastUpdatedDate));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,6 +210,9 @@ void ConnectionItemWidget::OnGroupItemRenamed(const GroupId &id, const QString &
|
|||||||
{
|
{
|
||||||
originalItemName = newName;
|
originalItemName = newName;
|
||||||
connNameLabel->setText(newName);
|
connNameLabel->setText(newName);
|
||||||
this->setToolTip(newName);
|
const auto grp = ConnectionManager->GetGroupMetaObject(id);
|
||||||
|
this->setToolTip(newName + NEWLINE + //
|
||||||
|
(grp.isSubscription ? (tr("Subscription") + NEWLINE) : "") + //
|
||||||
|
tr("Last Updated: ") + timeToString(grp.lastUpdatedDate));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -281,6 +281,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
|
|||||||
connectionListRCM_Menu->addAction(action_RCM_Rename);
|
connectionListRCM_Menu->addAction(action_RCM_Rename);
|
||||||
connectionListRCM_Menu->addAction(action_RCM_Duplicate);
|
connectionListRCM_Menu->addAction(action_RCM_Duplicate);
|
||||||
connectionListRCM_Menu->addAction(action_RCM_ClearUsage);
|
connectionListRCM_Menu->addAction(action_RCM_ClearUsage);
|
||||||
|
connectionListRCM_Menu->addAction(action_RCM_UpdateSubscription);
|
||||||
connectionListRCM_Menu->addSeparator();
|
connectionListRCM_Menu->addSeparator();
|
||||||
connectionListRCM_Menu->addAction(action_RCM_Delete);
|
connectionListRCM_Menu->addAction(action_RCM_Delete);
|
||||||
connect(action_RCM_Start, &QAction::triggered, this, &MainWindow::on_action_StartThis_triggered);
|
connect(action_RCM_Start, &QAction::triggered, this, &MainWindow::on_action_StartThis_triggered);
|
||||||
@ -550,6 +551,7 @@ void MainWindow::on_connectionListWidget_customContextMenuRequested(const QPoint
|
|||||||
action_RCM_EditComplex->setEnabled(isConnection);
|
action_RCM_EditComplex->setEnabled(isConnection);
|
||||||
action_RCM_Rename->setEnabled(isConnection);
|
action_RCM_Rename->setEnabled(isConnection);
|
||||||
action_RCM_Duplicate->setEnabled(isConnection);
|
action_RCM_Duplicate->setEnabled(isConnection);
|
||||||
|
action_RCM_UpdateSubscription->setEnabled(!isConnection);
|
||||||
connectionListRCM_Menu->popup(_pos);
|
connectionListRCM_Menu->popup(_pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1016,6 +1018,25 @@ void MainWindow::on_action_RCM_ClearUsage_triggered()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_action_RCM_UpdateSubscription_triggered()
|
||||||
|
{
|
||||||
|
auto current = connectionListWidget->currentItem();
|
||||||
|
if (current != nullptr)
|
||||||
|
{
|
||||||
|
auto widget = GetItemWidget(current);
|
||||||
|
if (widget)
|
||||||
|
{
|
||||||
|
if (widget->IsConnection())
|
||||||
|
return;
|
||||||
|
const auto gid = widget->Identifier().groupId;
|
||||||
|
if (ConnectionManager->GetGroupMetaObject(gid).isSubscription)
|
||||||
|
ConnectionManager->UpdateSubscriptionAsync(gid);
|
||||||
|
else
|
||||||
|
QvMessageBoxInfo(this, tr("Update Subscription"), tr("Selected group is not a subscription"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::on_action_RCM_LatencyTest_triggered()
|
void MainWindow::on_action_RCM_LatencyTest_triggered()
|
||||||
{
|
{
|
||||||
auto current = connectionListWidget->currentItem();
|
auto current = connectionListWidget->currentItem();
|
||||||
|
@ -59,13 +59,14 @@ class MainWindow
|
|||||||
|
|
||||||
void on_pluginsBtn_clicked();
|
void on_pluginsBtn_clicked();
|
||||||
|
|
||||||
private:
|
private slots:
|
||||||
void on_actionExit_triggered();
|
void on_actionExit_triggered();
|
||||||
void on_action_StartThis_triggered();
|
void on_action_StartThis_triggered();
|
||||||
void on_action_RCM_SetAutoConnection_triggered();
|
void on_action_RCM_SetAutoConnection_triggered();
|
||||||
void on_action_RCM_EditThis_triggered();
|
void on_action_RCM_EditThis_triggered();
|
||||||
void on_action_RCM_EditAsJson_triggered();
|
void on_action_RCM_EditAsJson_triggered();
|
||||||
void on_action_RCM_EditAsComplex_triggered();
|
void on_action_RCM_EditAsComplex_triggered();
|
||||||
|
void on_action_RCM_UpdateSubscription_triggered();
|
||||||
void on_action_RCM_LatencyTest_triggered();
|
void on_action_RCM_LatencyTest_triggered();
|
||||||
void on_action_RCM_RenameThis_triggered();
|
void on_action_RCM_RenameThis_triggered();
|
||||||
void on_action_RCM_DeleteThese_triggered();
|
void on_action_RCM_DeleteThese_triggered();
|
||||||
@ -77,6 +78,7 @@ class MainWindow
|
|||||||
//
|
//
|
||||||
void OnConnectionWidgetFocusRequested(const ConnectionItemWidget *widget);
|
void OnConnectionWidgetFocusRequested(const ConnectionItemWidget *widget);
|
||||||
//
|
//
|
||||||
|
private:
|
||||||
void ToggleVisibility();
|
void ToggleVisibility();
|
||||||
void OnEditRequested(const ConnectionId &id);
|
void OnEditRequested(const ConnectionId &id);
|
||||||
void OnEditJsonRequested(const ConnectionId &id);
|
void OnEditJsonRequested(const ConnectionId &id);
|
||||||
@ -131,6 +133,7 @@ class MainWindow
|
|||||||
QMenu *connectionListRCM_Menu = new QMenu(this);
|
QMenu *connectionListRCM_Menu = new QMenu(this);
|
||||||
QAction *action_RCM_Start = new QAction(tr("Connect to this"), this);
|
QAction *action_RCM_Start = new QAction(tr("Connect to this"), this);
|
||||||
QAction *action_RCM_SetAutoConnection = new QAction(tr("Set as automatically connected"), this);
|
QAction *action_RCM_SetAutoConnection = new QAction(tr("Set as automatically connected"), this);
|
||||||
|
QAction *action_RCM_UpdateSubscription = new QAction(tr("Update Subscription"), this);
|
||||||
QAction *action_RCM_Edit = new QAction(tr("Edit"), this);
|
QAction *action_RCM_Edit = new QAction(tr("Edit"), this);
|
||||||
QAction *action_RCM_EditJson = new QAction(tr("Edit as JSON"), this);
|
QAction *action_RCM_EditJson = new QAction(tr("Edit as JSON"), this);
|
||||||
QAction *action_RCM_EditComplex = new QAction(tr("Edit as Complex Config"), this);
|
QAction *action_RCM_EditComplex = new QAction(tr("Edit as Complex Config"), this);
|
||||||
|
Loading…
Reference in New Issue
Block a user