File indexing completed on 2025-04-20 12:58:57
0001 /*************************************************************************** 0002 The configuration page for the authentication settings of Smb4K 0003 ------------------- 0004 begin : Sa Nov 15 2003 0005 copyright : (C) 2003-2019 by Alexander Reinholdt 0006 email : alexander.reinholdt@kdemail.net 0007 ***************************************************************************/ 0008 0009 /*************************************************************************** 0010 * This program is free software; you can redistribute it and/or modify * 0011 * it under the terms of the GNU General Public License as published by * 0012 * the Free Software Foundation; either version 2 of the License, or * 0013 * (at your option) any later version. * 0014 * * 0015 * This program is distributed in the hope that it will be useful, but * 0016 * WITHOUT ANY WARRANTY; without even the implied warranty of * 0017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 0018 * General Public License for more details. * 0019 * * 0020 * You should have received a copy of the GNU General Public License * 0021 * along with this program; if not, write to the * 0022 * Free Software Foundation, Inc., 51 Franklin Street, Suite 500, Boston,* 0023 * MA 02110-1335, USA * 0024 ***************************************************************************/ 0025 0026 #ifndef SMB4KCONFIGPAGEAUTHENTICATION_H 0027 #define SMB4KCONFIGPAGEAUTHENTICATION_H 0028 0029 // Application specific includes 0030 #include "core/smb4kauthinfo.h" 0031 0032 // Qt includes 0033 #include <QList> 0034 #include <QListWidget> 0035 0036 /** 0037 * This is the configuration tab for the authentication settings 0038 * of Smb4K. 0039 * 0040 * @author Alexander Reinholdt <alexander.reinholdt@kdemail.net> 0041 */ 0042 0043 0044 class Smb4KConfigPageAuthentication : public QWidget 0045 { 0046 Q_OBJECT 0047 0048 public: 0049 /** 0050 * The constructor. 0051 * 0052 * @param parent The parent widget 0053 */ 0054 explicit Smb4KConfigPageAuthentication(QWidget *parent = 0); 0055 0056 /** 0057 * The destructor. 0058 */ 0059 virtual ~Smb4KConfigPageAuthentication(); 0060 0061 /** 0062 * Insert the list of authentication information entries into the internal 0063 * list of wallet entries. This function will not display the entries. You 0064 * need to call displayWalletEntries() for this. 0065 * 0066 * @param entries The list of entries 0067 */ 0068 void insertWalletEntries(const QList<Smb4KAuthInfo *> &entries); 0069 0070 /** 0071 * Get the - maybe modified - entries. 0072 * 0073 * @returns the list of entries. 0074 */ 0075 const QList<Smb4KAuthInfo *> &getWalletEntries() { return m_entriesList; } 0076 0077 /** 0078 * Returns TRUE if the wallet entries are displayed and FALSE otherwise. 0079 * 0080 * @returns TRUE if the wallet entries are displayed 0081 */ 0082 bool walletEntriesDisplayed() { return m_entries_displayed; } 0083 0084 /** 0085 * Returns TRUE in the case the wallet entries might have changed. You need 0086 * to check this outside this widget, whether a change indeed occurred. 0087 * 0088 * @returns TRUE if the wallet entries might have changed. 0089 */ 0090 bool walletEntriesMaybeChanged() { return m_maybe_changed; } 0091 0092 signals: 0093 /** 0094 * Emitted when the "Load" button is clicked. 0095 */ 0096 void loadWalletEntries(); 0097 0098 /** 0099 * Emitted when the "Save" button is clicked. 0100 */ 0101 void saveWalletEntries(); 0102 0103 /** 0104 * Emitted when the default login should be (re-)defined. 0105 */ 0106 void setDefaultLogin(); 0107 0108 /** 0109 * This signal is emitted every time the wallet entries potentially were 0110 * modified by the user. When this signal is emitted, it does not necessarily 0111 * mean that any wallet entry indeed changed. It only means that the user 0112 * edited one. 0113 */ 0114 void walletEntriesModified(); 0115 0116 protected: 0117 /** 0118 * Reimplemented. 0119 */ 0120 bool eventFilter(QObject *object, QEvent *event) override; 0121 0122 protected slots: 0123 /** 0124 * This slot is called when the "Use wallet" check box is toggled. 0125 * 0126 * @param checked TRUE if the check box is checked and otherwise 0127 * FALSE. 0128 */ 0129 void slotKWalletButtonToggled(bool checked); 0130 0131 /** 0132 * This slot is invoked when the "Default login" check box is toggled. 0133 * 0134 * @param checked TRUE if the check box is checked and otherwise 0135 * FALSE. 0136 */ 0137 void slotDefaultLoginToggled(bool checked); 0138 0139 /** 0140 * This slot is connected to the KListWidget::itemSelectionChanged() signal. 0141 * It unmarks and enables/disables the "Show details" checkbox and clears the 0142 * the details widget. 0143 */ 0144 void slotItemSelectionChanged(); 0145 0146 /** 0147 * This slot is connected to the QTableWidget::cellChanged() signal and commits 0148 * changes the user applied to the entries to the internal list and enables the 0149 * "Undo" action. 0150 * 0151 * @param row The row of the cell that was changed 0152 * 0153 * @param column The column of the cell that was changed 0154 */ 0155 void slotDetailsChanged(int row, int column); 0156 0157 /** 0158 * This slot is called when the edit action is clicked. 0159 */ 0160 void slotEditClicked(); 0161 0162 /** 0163 * This slot is connected to the "Remove" button 0164 */ 0165 void slotRemoveClicked(); 0166 0167 /** 0168 * This slot is connected to the "Clear" button 0169 */ 0170 void slotClearClicked(); 0171 0172 /** 0173 * This slot is connected to the "Save" button and resets all actions. 0174 * 0175 * @param checked TRUE if the action is checked 0176 */ 0177 void slotSaveClicked(bool checked); 0178 0179 private: 0180 void loadDetails(Smb4KAuthInfo *authInfo); 0181 void clearDetails(); 0182 QList<Smb4KAuthInfo *> m_entriesList; 0183 bool m_entries_displayed; 0184 bool m_maybe_changed; 0185 }; 0186 0187 #endif