editCopy in connection manager
Allows to edit an existing connection as a new one.
This commit is contained in:
parent
f21a59e030
commit
a3ba4d7c98
5 changed files with 37 additions and 9 deletions
|
|
@ -95,6 +95,16 @@ void ConnectionController::editConnection(QModelIndex index)
|
|||
}
|
||||
}
|
||||
|
||||
void ConnectionController::editCopy(QModelIndex index)
|
||||
{
|
||||
auto config = ConnectionTreeModel::getConfigFromModelIndex(index);
|
||||
if (config) {
|
||||
auto cc = *config;
|
||||
cc.setUuid(QUuid::createUuid());
|
||||
ConnectionConfigurationWidget::editExistingInWindow(this, cc);
|
||||
}
|
||||
}
|
||||
|
||||
void ConnectionController::addGroup()
|
||||
{
|
||||
auto result = QInputDialog::getText(nullptr, tr("Add new connection group"),
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ public:
|
|||
/// Starts the form for editing a conncetion.
|
||||
/// This function returns immidiatly!
|
||||
void editConnection(QModelIndex index);
|
||||
void editCopy(QModelIndex index);
|
||||
void addGroup();
|
||||
void removeGroup(QModelIndex index);
|
||||
|
||||
|
|
|
|||
|
|
@ -102,3 +102,9 @@ void ConnectionManagerWindow::on_actionRemove_group_triggered()
|
|||
auto ci = ui->treeView->selectionModel()->currentIndex();
|
||||
m_connectionController->removeGroup(ci);
|
||||
}
|
||||
|
||||
void ConnectionManagerWindow::on_actionConfigureCopy_triggered()
|
||||
{
|
||||
auto ci = ui->treeView->selectionModel()->currentIndex();
|
||||
m_connectionController->editCopy(ci);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ private slots:
|
|||
|
||||
void on_actionRemove_group_triggered();
|
||||
|
||||
void on_actionConfigureCopy_triggered();
|
||||
|
||||
private:
|
||||
Ui::ConnectionManagerWindow *ui;
|
||||
MasterController *m_masterController;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>413</width>
|
||||
<height>20</height>
|
||||
<height>30</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
|
|
@ -74,12 +74,13 @@ QToolButton {
|
|||
<addaction name="actionRemove_group"/>
|
||||
<addaction name="actionAdd_Connection"/>
|
||||
<addaction name="actionConfigure_connection"/>
|
||||
<addaction name="actionConfigureCopy"/>
|
||||
<addaction name="actionDelete_connection"/>
|
||||
<addaction name="separator"/>
|
||||
</widget>
|
||||
<action name="actionAdd_Connection">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/icons/add_connection.png</normaloff>:/icons/add_connection.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
|
|
@ -88,7 +89,7 @@ QToolButton {
|
|||
</action>
|
||||
<action name="actionDelete_connection">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/icons/delete_connection.png</normaloff>
|
||||
<normalon>:/icons/delete_connection.png</normalon>:/icons/delete_connection.png</iconset>
|
||||
</property>
|
||||
|
|
@ -116,7 +117,7 @@ QToolButton {
|
|||
</action>
|
||||
<action name="actionBackup_database">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/icons/backup_database.png</normaloff>
|
||||
<normalon>:/icons/backups.png</normalon>:/icons/backup_database.png</iconset>
|
||||
</property>
|
||||
|
|
@ -164,9 +165,17 @@ QToolButton {
|
|||
<string>Remove group</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionConfigureCopy">
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/icons/server_configuration.png</normalon>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Configure copy</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="resources.qrc"/>
|
||||
</resources>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue