34 , mRelayMessages( relayMessages )
39 mAuthNotifyLayout =
new QVBoxLayout;
40 this->setLayout( mAuthNotifyLayout );
42 mAuthNotifyLayout->addWidget( mAuthNotify );
47 connect( btnAddConfig, &QToolButton::clicked,
this, &QgsAuthConfigEditor::btnAddConfig_clicked );
48 connect( btnEditConfig, &QToolButton::clicked,
this, &QgsAuthConfigEditor::btnEditConfig_clicked );
49 connect( btnRemoveConfig, &QToolButton::clicked,
this, &QgsAuthConfigEditor::btnRemoveConfig_clicked );
60 mConfigModel =
new QSqlTableModel(
this, connection );
61 btnAddConfig->setEnabled(
false );
62 btnEditConfig->setEnabled(
false );
63 btnRemoveConfig->setEnabled(
false );
64 tableViewConfigs->setEditTriggers( QAbstractItemView::EditTrigger::NoEditTriggers );
68 mConfigModel =
new QSqlTableModel(
this, connection );
72 mConfigModel->select();
74 mConfigModel->setHeaderData( 0, Qt::Horizontal, tr(
"ID" ) );
75 mConfigModel->setHeaderData( 1, Qt::Horizontal, tr(
"Name" ) );
76 mConfigModel->setHeaderData( 2, Qt::Horizontal, tr(
"URI" ) );
77 mConfigModel->setHeaderData( 3, Qt::Horizontal, tr(
"Type" ) );
78 mConfigModel->setHeaderData( 4, Qt::Horizontal, tr(
"Version" ) );
79 mConfigModel->setHeaderData( 5, Qt::Horizontal, tr(
"Config" ) );
81 tableViewConfigs->setModel( mConfigModel );
82 tableViewConfigs->resizeColumnsToContents();
87 tableViewConfigs->hideColumn( 4 );
88 tableViewConfigs->hideColumn( 5 );
91 tableViewConfigs->sortByColumn( 1, Qt::AscendingOrder );
92 tableViewConfigs->setSortingEnabled(
true );
94 connect( tableViewConfigs->selectionModel(), &QItemSelectionModel::selectionChanged,
this, &QgsAuthConfigEditor::selectionChanged );
106 mActionImportAuthenticationConfigs =
new QAction( tr(
"Import Authentication Configurations from File…" ),
this );
107 mActionExportSelectedAuthenticationConfigs =
new QAction( tr(
"Export Selected Authentication Configurations to File…" ),
this );
108 mActionSetMasterPassword =
new QAction( QStringLiteral(
"Input Master Password…" ),
this );
109 mActionClearCachedMasterPassword =
new QAction( QStringLiteral(
"Clear Cached Master Password" ),
this );
110 mActionResetMasterPassword =
new QAction( QStringLiteral(
"Reset Master Password…" ),
this );
111 mActionClearCachedAuthConfigs =
new QAction( QStringLiteral(
"Clear Cached Authentication Configurations" ),
this );
112 mActionRemoveAuthConfigs =
new QAction( QStringLiteral(
"Remove all Authentication Configurations…" ),
this );
113 mActionEraseAuthDatabase =
new QAction( QStringLiteral(
"Erase Authentication Database…" ),
this );
115 connect( mActionExportSelectedAuthenticationConfigs, &QAction::triggered,
this, &QgsAuthConfigEditor::exportSelectedAuthenticationConfigs );
116 connect( mActionSetMasterPassword, &QAction::triggered,
this, &QgsAuthConfigEditor::setMasterPassword );
117 connect( mActionClearCachedMasterPassword, &QAction::triggered,
this, &QgsAuthConfigEditor::clearCachedMasterPassword );
118 connect( mActionClearCachedAuthConfigs, &QAction::triggered,
this, &QgsAuthConfigEditor::clearCachedAuthenticationConfigs );
122 connect( tableViewConfigs, &QAbstractItemView::doubleClicked,
this, &QgsAuthConfigEditor::btnEditConfig_clicked );
124 connect( mActionImportAuthenticationConfigs, &QAction::triggered,
this, &QgsAuthConfigEditor::importAuthenticationConfigs );
125 connect( mActionResetMasterPassword, &QAction::triggered,
this, &QgsAuthConfigEditor::resetMasterPassword );
126 connect( mActionRemoveAuthConfigs, &QAction::triggered,
this, &QgsAuthConfigEditor::removeAuthenticationConfigs );
127 connect( mActionEraseAuthDatabase, &QAction::triggered,
this, &QgsAuthConfigEditor::eraseAuthenticationDatabase );
131 mActionImportAuthenticationConfigs->setEnabled(
false );
132 mActionSetMasterPassword->setEnabled(
false );
133 mActionClearCachedMasterPassword->setEnabled(
false );
134 mActionResetMasterPassword->setEnabled(
false );
135 mActionClearCachedAuthConfigs->setEnabled(
false );
136 mActionRemoveAuthConfigs->setEnabled(
false );
137 mActionEraseAuthDatabase->setEnabled(
false );
140 mAuthUtilitiesMenu =
new QMenu(
this );
144 mAuthUtilitiesMenu->addAction( mActionSetMasterPassword );
145 mAuthUtilitiesMenu->addAction( mActionClearCachedMasterPassword );
146 mAuthUtilitiesMenu->addAction( mActionResetMasterPassword );
147 mAuthUtilitiesMenu->addSeparator();
150 mAuthUtilitiesMenu->addAction( mActionClearCachedAuthConfigs );
153 mAuthUtilitiesMenu->addAction( mActionRemoveAuthConfigs );
155 mAuthUtilitiesMenu->addSeparator();
158 mAuthUtilitiesMenu->addAction( mActionImportAuthenticationConfigs );
160 mAuthUtilitiesMenu->addAction( mActionExportSelectedAuthenticationConfigs );
161 mAuthUtilitiesMenu->addSeparator();
164 mAuthUtilitiesMenu->addAction( mActionEraseAuthDatabase );
166 btnAuthUtilities->setMenu( mAuthUtilitiesMenu );
167 lblAuthConfigDb->setVisible(
false );