33 , mRelayMessages( relayMessages )
38 mAuthNotifyLayout =
new QVBoxLayout;
39 this->setLayout( mAuthNotifyLayout );
41 mAuthNotifyLayout->addWidget( mAuthNotify );
46 connect( btnAddConfig, &QToolButton::clicked,
this, &QgsAuthConfigEditor::btnAddConfig_clicked );
47 connect( btnEditConfig, &QToolButton::clicked,
this, &QgsAuthConfigEditor::btnEditConfig_clicked );
48 connect( btnRemoveConfig, &QToolButton::clicked,
this, &QgsAuthConfigEditor::btnRemoveConfig_clicked );
59 mConfigModel =
new QSqlTableModel(
this, connection );
60 btnAddConfig->setEnabled(
false );
61 btnEditConfig->setEnabled(
false );
62 btnRemoveConfig->setEnabled(
false );
63 tableViewConfigs->setEditTriggers( QAbstractItemView::EditTrigger::NoEditTriggers );
67 mConfigModel =
new QSqlTableModel(
this, connection );
71 mConfigModel->select();
73 mConfigModel->setHeaderData( 0, Qt::Horizontal, tr(
"ID" ) );
74 mConfigModel->setHeaderData( 1, Qt::Horizontal, tr(
"Name" ) );
75 mConfigModel->setHeaderData( 2, Qt::Horizontal, tr(
"URI" ) );
76 mConfigModel->setHeaderData( 3, Qt::Horizontal, tr(
"Type" ) );
77 mConfigModel->setHeaderData( 4, Qt::Horizontal, tr(
"Version" ) );
78 mConfigModel->setHeaderData( 5, Qt::Horizontal, tr(
"Config" ) );
80 tableViewConfigs->setModel( mConfigModel );
81 tableViewConfigs->resizeColumnsToContents();
86 tableViewConfigs->hideColumn( 4 );
87 tableViewConfigs->hideColumn( 5 );
90 tableViewConfigs->sortByColumn( 1, Qt::AscendingOrder );
91 tableViewConfigs->setSortingEnabled(
true );
93 connect( tableViewConfigs->selectionModel(), &QItemSelectionModel::selectionChanged,
94 this, &QgsAuthConfigEditor::selectionChanged );
99 this, &QgsAuthConfigEditor::authMessageLog );
103 this, &QgsAuthConfigEditor::refreshTableView );
108 mActionImportAuthenticationConfigs =
new QAction( tr(
"Import Authentication Configurations from File…" ),
this );
109 mActionExportSelectedAuthenticationConfigs =
new QAction( tr(
"Export Selected Authentication Configurations to File…" ),
this );
110 mActionSetMasterPassword =
new QAction( QStringLiteral(
"Input Master Password…" ),
this );
111 mActionClearCachedMasterPassword =
new QAction( QStringLiteral(
"Clear Cached Master Password" ),
this );
112 mActionResetMasterPassword =
new QAction( QStringLiteral(
"Reset Master Password…" ),
this );
113 mActionClearCachedAuthConfigs =
new QAction( QStringLiteral(
"Clear Cached Authentication Configurations" ),
this );
114 mActionRemoveAuthConfigs =
new QAction( QStringLiteral(
"Remove all Authentication Configurations…" ),
this );
115 mActionEraseAuthDatabase =
new QAction( QStringLiteral(
"Erase Authentication Database…" ),
this );
117 connect( mActionExportSelectedAuthenticationConfigs, &QAction::triggered,
this, &QgsAuthConfigEditor::exportSelectedAuthenticationConfigs );
118 connect( mActionSetMasterPassword, &QAction::triggered,
this, &QgsAuthConfigEditor::setMasterPassword );
119 connect( mActionClearCachedMasterPassword, &QAction::triggered,
this, &QgsAuthConfigEditor::clearCachedMasterPassword );
120 connect( mActionClearCachedAuthConfigs, &QAction::triggered,
this, &QgsAuthConfigEditor::clearCachedAuthenticationConfigs );
124 connect( tableViewConfigs, &QAbstractItemView::doubleClicked,
this, &QgsAuthConfigEditor::btnEditConfig_clicked );
126 connect( mActionImportAuthenticationConfigs, &QAction::triggered,
this, &QgsAuthConfigEditor::importAuthenticationConfigs );
127 connect( mActionResetMasterPassword, &QAction::triggered,
this, &QgsAuthConfigEditor::resetMasterPassword );
128 connect( mActionRemoveAuthConfigs, &QAction::triggered,
this, &QgsAuthConfigEditor::removeAuthenticationConfigs );
129 connect( mActionEraseAuthDatabase, &QAction::triggered,
this, &QgsAuthConfigEditor::eraseAuthenticationDatabase );
133 mActionImportAuthenticationConfigs->setEnabled(
false );
134 mActionSetMasterPassword->setEnabled(
false );
135 mActionClearCachedMasterPassword->setEnabled(
false );
136 mActionResetMasterPassword->setEnabled(
false );
137 mActionClearCachedAuthConfigs->setEnabled(
false );
138 mActionRemoveAuthConfigs->setEnabled(
false );
139 mActionEraseAuthDatabase->setEnabled(
false );
142 mAuthUtilitiesMenu =
new QMenu(
this );
146 mAuthUtilitiesMenu->addAction( mActionSetMasterPassword );
147 mAuthUtilitiesMenu->addAction( mActionClearCachedMasterPassword );
148 mAuthUtilitiesMenu->addAction( mActionResetMasterPassword );
149 mAuthUtilitiesMenu->addSeparator();
152 mAuthUtilitiesMenu->addAction( mActionClearCachedAuthConfigs );
155 mAuthUtilitiesMenu->addAction( mActionRemoveAuthConfigs );
157 mAuthUtilitiesMenu->addSeparator();
160 mAuthUtilitiesMenu->addAction( mActionImportAuthenticationConfigs );
162 mAuthUtilitiesMenu->addAction( mActionExportSelectedAuthenticationConfigs );
163 mAuthUtilitiesMenu->addSeparator();
166 mAuthUtilitiesMenu->addAction( mActionEraseAuthDatabase );
168 btnAuthUtilities->setMenu( mAuthUtilitiesMenu );
169 lblAuthConfigDb->setVisible(
false );