~ubuntu-branches/ubuntu/utopic/smb4k/utopic-proposed

« back to all changes in this revision

Viewing changes to smb4k/dialogs/smb4kcustomoptionsdialog.h

  • Committer: Package Import Robot
  • Author(s): Fathi Boudra
  • Date: 2012-05-19 18:54:34 UTC
  • mfrom: (1.1.20)
  • Revision ID: package-import@ubuntu.com-20120519185434-duffny2n87214n1n
Tags: 1.0.1-1
* New upstream release.
* Update debian/compat: bump to 9.
* Update debian/control:
  - bump debhelper to 9.
  - bump kdelibs5-dev build dependency to 4:4.4.0.
  - bump Standards-Version to 3.9.3 (no changes needed).
  - Replace smbfs dependency by cifs-utils. (Closes: #638162)
* Update debian/copyright:
  - update upstream URL.
  - update upstream e-mail.
* Update debian/smb4k.lintian-overrides file.
* Update debian/watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
    smb4kcustomoptionsdialog  -  With this dialog the user can define
3
 
    custom Samba options for hosts or shares.
4
 
                             -------------------
5
 
    begin                : So Jun 25 2006
6
 
    copyright            : (C) 2006-2008 by Alexander Reinholdt
7
 
    email                : dustpuppy@users.berlios.de
8
 
 ***************************************************************************/
9
 
 
10
 
/***************************************************************************
11
 
 *   This program is free software; you can redistribute it and/or modify  *
12
 
 *   it under the terms of the GNU General Public License as published by  *
13
 
 *   the Free Software Foundation; either version 2 of the License, or     *
14
 
 *   (at your option) any later version.                                   *
15
 
 *                                                                         *
16
 
 *   This program is distributed in the hope that it will be useful, but   *
17
 
 *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
18
 
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
19
 
 *   General Public License for more details.                              *
20
 
 *                                                                         *
21
 
 *   You should have received a copy of the GNU General Public License     *
22
 
 *   along with this program; if not, write to the                         *
23
 
 *   Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,   *
24
 
 *   MA  02111-1307 USA                                                    *
25
 
 ***************************************************************************/
26
 
 
27
 
#ifndef SMB4KCUSTOMOPTIONSDIALOG_H
28
 
#define SMB4KCUSTOMOPTIONSDIALOG_H
29
 
 
30
 
#ifdef HAVE_CONFIG_H
31
 
#include <config.h>
32
 
#endif
33
 
 
34
 
// Qt includes
35
 
#include <QCheckBox>
36
 
 
37
 
// KDE includes
38
 
#include <kdialog.h>
39
 
#include <knuminput.h>
40
 
#include <kcombobox.h>
41
 
#include <klineedit.h>
42
 
#include <kdemacros.h>
43
 
 
44
 
// forward declarations
45
 
class Smb4KHost;
46
 
class Smb4KShare;
47
 
 
48
 
class KDE_EXPORT Smb4KCustomOptionsDialog : public KDialog
49
 
{
50
 
  Q_OBJECT
51
 
 
52
 
  public:
53
 
    /**
54
 
     * The constructor
55
 
     *
56
 
     * @param host            The host (server) for which the custom options should be defined.
57
 
     *
58
 
     * @param parent          The parent of this dialog
59
 
     */
60
 
    Smb4KCustomOptionsDialog( Smb4KHost *host, QWidget *parent = 0 );
61
 
 
62
 
    /**
63
 
     * Another constructor, similar to the one above.
64
 
     *
65
 
     * @param share           The share for which the custom options should be defined.
66
 
     *
67
 
     * @param parent          The parent of this dialog
68
 
     */
69
 
    Smb4KCustomOptionsDialog( Smb4KShare *share, QWidget *parent = 0 );
70
 
 
71
 
    /**
72
 
     * The destructor
73
 
     */
74
 
    ~Smb4KCustomOptionsDialog();
75
 
 
76
 
    /**
77
 
     * This function returns TRUE if the dialog has been initialized correctly
78
 
     * and may be shown now. It will always return TRUE if you want to set options
79
 
     * for a server or for a share, that is not a 'homes' share. Only in the case
80
 
     * of a homes share it may return FALSE, if you didn't choose a user name.
81
 
     *
82
 
     * @returns               TRUE if the dialog has been set up correctly.
83
 
     */
84
 
    bool isInitialized() { return m_initialized; }
85
 
 
86
 
  protected slots:
87
 
    /**
88
 
     * Is invoked when the port value changed
89
 
     *
90
 
     * @param int             The port number
91
 
     */
92
 
    void slotPortChanged( int value );
93
 
 
94
 
    /**
95
 
     * Is invoked when the protocol value changed
96
 
     *
97
 
     * @param t               The protocol
98
 
     */
99
 
    void slotProtocolChanged( const QString &p );
100
 
 
101
 
    /**
102
 
     * Is invoked when the user clicked the 'Use Kerberos'
103
 
     * check box.
104
 
     *
105
 
     * @param on              TRUE if the check box was
106
 
     *                        checked and FALSE otherwise
107
 
     */
108
 
    void slotKerberosToggled( bool on );
109
 
 
110
 
    /**
111
 
     * Commit the custom options provided for the selected
112
 
     * network item.
113
 
     */
114
 
    void slotOKButtonClicked();
115
 
 
116
 
    /**
117
 
     * Is invoked if the "Default" button has been pressed.
118
 
     */
119
 
    void slotDefaultButtonClicked();
120
 
 
121
 
    /**
122
 
     * This slot is invoked when the  "Write Access" value changed.
123
 
     *
124
 
     * @param rw              Either 'read-write' or 'read-only' (localized).
125
 
     */
126
 
    void slotWriteAccessChanged( const QString &rw );
127
 
 
128
 
    /**
129
 
     * This slot is invoked when the UID value changed.
130
 
     *
131
 
     * @param uid             The UID value
132
 
     */
133
 
    void slotUIDChanged( const QString &uid );
134
 
 
135
 
    /**
136
 
     * This slot is invoked when the GID value changed.
137
 
     *
138
 
     * @param gid             The UID value
139
 
     */
140
 
    void slotGIDChanged( const QString &gid );
141
 
 
142
 
  private:
143
 
    /**
144
 
     * Enumeration
145
 
     */
146
 
    enum ItemType{ Host, Share };
147
 
 
148
 
    /**
149
 
     * The item type
150
 
     */
151
 
    int m_type;
152
 
 
153
 
    /**
154
 
     * Sets up the dialog
155
 
     */
156
 
    void setupDialog();
157
 
 
158
 
    /**
159
 
     * The host item (is NULL if you process a share).
160
 
     */
161
 
    Smb4KHost *m_host;
162
 
 
163
 
    /**
164
 
     * The share item (is NULL if you process a host).
165
 
     */
166
 
    Smb4KShare *m_share;
167
 
 
168
 
    /**
169
 
     * Port input
170
 
     */
171
 
    KIntNumInput *m_port_input;
172
 
 
173
 
#ifndef __FreeBSD__
174
 
    /**
175
 
     * This combo box determines if the user wants to mount a share
176
 
     * readwrite or readonly.
177
 
     */
178
 
    KComboBox *m_rw_input;
179
 
#endif
180
 
 
181
 
    /**
182
 
     * The protocol
183
 
     */
184
 
    KComboBox *m_proto_input;
185
 
 
186
 
    /**
187
 
     * Boolean that is TRUE if the dialog has been initialized
188
 
     * correctly and my be shown now.
189
 
     */
190
 
    bool m_initialized;
191
 
 
192
 
    /**
193
 
     * This check box will determine if the user wants to try to
194
 
     * authenticate with Kerberos or not. This is needed for Active
195
 
     * Directory stuff.
196
 
     */
197
 
    QCheckBox *m_kerberos;
198
 
 
199
 
    /**
200
 
     * This combo box holds the values of the UID that the user can
201
 
     * chose from.
202
 
     */
203
 
    KComboBox *m_uid_input;
204
 
 
205
 
    /**
206
 
     * This combo box holds the values of the GID that the user can
207
 
     * chose from.
208
 
     */
209
 
    KComboBox *m_gid_input;
210
 
};
211
 
 
212
 
#endif