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,
95 this, &QgsAuthConfigEditor::selectionChanged );
100 this, &QgsAuthConfigEditor::authMessageLog );
104 this, &QgsAuthConfigEditor::refreshTableView );
109 mActionImportAuthenticationConfigs =
new QAction( tr(
"Import Authentication Configurations from File…" ),
this );
110 mActionExportSelectedAuthenticationConfigs =
new QAction( tr(
"Export Selected Authentication Configurations to File…" ),
this );
111 mActionSetMasterPassword =
new QAction( QStringLiteral(
"Input Master Password…" ),
this );
112 mActionClearCachedMasterPassword =
new QAction( QStringLiteral(
"Clear Cached Master Password" ),
this );
113 mActionResetMasterPassword =
new QAction( QStringLiteral(
"Reset Master Password…" ),
this );
114 mActionClearCachedAuthConfigs =
new QAction( QStringLiteral(
"Clear Cached Authentication Configurations" ),
this );
115 mActionRemoveAuthConfigs =
new QAction( QStringLiteral(
"Remove all Authentication Configurations…" ),
this );
116 mActionEraseAuthDatabase =
new QAction( QStringLiteral(
"Erase Authentication Database…" ),
this );
118 connect( mActionExportSelectedAuthenticationConfigs, &QAction::triggered,
this, &QgsAuthConfigEditor::exportSelectedAuthenticationConfigs );
119 connect( mActionSetMasterPassword, &QAction::triggered,
this, &QgsAuthConfigEditor::setMasterPassword );
120 connect( mActionClearCachedMasterPassword, &QAction::triggered,
this, &QgsAuthConfigEditor::clearCachedMasterPassword );
121 connect( mActionClearCachedAuthConfigs, &QAction::triggered,
this, &QgsAuthConfigEditor::clearCachedAuthenticationConfigs );
125 connect( tableViewConfigs, &QAbstractItemView::doubleClicked,
this, &QgsAuthConfigEditor::btnEditConfig_clicked );
127 connect( mActionImportAuthenticationConfigs, &QAction::triggered,
this, &QgsAuthConfigEditor::importAuthenticationConfigs );
128 connect( mActionResetMasterPassword, &QAction::triggered,
this, &QgsAuthConfigEditor::resetMasterPassword );
129 connect( mActionRemoveAuthConfigs, &QAction::triggered,
this, &QgsAuthConfigEditor::removeAuthenticationConfigs );
130 connect( mActionEraseAuthDatabase, &QAction::triggered,
this, &QgsAuthConfigEditor::eraseAuthenticationDatabase );
134 mActionImportAuthenticationConfigs->setEnabled(
false );
135 mActionSetMasterPassword->setEnabled(
false );
136 mActionClearCachedMasterPassword->setEnabled(
false );
137 mActionResetMasterPassword->setEnabled(
false );
138 mActionClearCachedAuthConfigs->setEnabled(
false );
139 mActionRemoveAuthConfigs->setEnabled(
false );
140 mActionEraseAuthDatabase->setEnabled(
false );
143 mAuthUtilitiesMenu =
new QMenu(
this );
147 mAuthUtilitiesMenu->addAction( mActionSetMasterPassword );
148 mAuthUtilitiesMenu->addAction( mActionClearCachedMasterPassword );
149 mAuthUtilitiesMenu->addAction( mActionResetMasterPassword );
150 mAuthUtilitiesMenu->addSeparator();
153 mAuthUtilitiesMenu->addAction( mActionClearCachedAuthConfigs );
156 mAuthUtilitiesMenu->addAction( mActionRemoveAuthConfigs );
158 mAuthUtilitiesMenu->addSeparator();
161 mAuthUtilitiesMenu->addAction( mActionImportAuthenticationConfigs );
163 mAuthUtilitiesMenu->addAction( mActionExportSelectedAuthenticationConfigs );
164 mAuthUtilitiesMenu->addSeparator();
167 mAuthUtilitiesMenu->addAction( mActionEraseAuthDatabase );
169 btnAuthUtilities->setMenu( mAuthUtilitiesMenu );
170 lblAuthConfigDb->setVisible(
false );