CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkXnatLoginDialog.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  Library: XNAT/Widgets
4 
5  Copyright (c) University College London,
6  Centre for Medical Image Computing
7 
8  Licensed under the Apache License, Version 2.0 (the "License");
9  you may not use this file except in compliance with the License.
10  You may obtain a copy of the License at
11 
12  http://www.apache.org/licenses/LICENSE-2.0
13 
14  Unless required by applicable law or agreed to in writing, software
15  distributed under the License is distributed on an "AS IS" BASIS,
16  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  See the License for the specific language governing permissions and
18  limitations under the License.
19 
20 =============================================================================*/
21 
22 #ifndef ctkXnatLoginDialog_h
23 #define ctkXnatLoginDialog_h
24 
25 #include <QDialog>
26 
27 #include "ctkXNATWidgetsExport.h"
28 
29 #include "ui_ctkXnatLoginDialog.h"
30 
31 #include "ctkXnatLoginProfile.h"
32 
33 class ctkXnatSession;
34 class ctkXnatLoginDialogPrivate;
35 class ctkXnatSettings;
36 
40 class CTK_XNAT_WIDGETS_EXPORT ctkXnatLoginDialog : public QDialog
41 {
42  Q_OBJECT
43 
44 public:
45  explicit ctkXnatLoginDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0);
47 
49  void setSettings(ctkXnatSettings* settings);
50 
52 
53  virtual void accept();
54 
55 private slots:
56 
57  void on_btnSave_clicked();
58  void on_btnDelete_clicked();
59  void on_edtProfileName_textChanged(const QString& text);
60  void onFieldChanged();
61  void onCurrentProfileChanged(const QModelIndex& current);
62  void resetLstProfilesCurrentIndex();
63 
64 private:
65  void createConnections();
66  void blockSignalsOfFields(bool value);
67 
68  void saveProfile(const QString& profileName);
69  bool askToSaveProfile(const QString& profileName);
70  void loadProfile(const ctkXnatLoginProfile& profile = ctkXnatLoginProfile());
71  void storeProfile(ctkXnatLoginProfile& profile);
72 
74  Ui::ctkXnatLoginDialog* ui;
75 
77  QScopedPointer<ctkXnatLoginDialogPrivate> d_ptr;
78 
79  Q_DECLARE_PRIVATE(ctkXnatLoginDialog)
80  Q_DISABLE_COPY(ctkXnatLoginDialog)
81 };
82 
83 #endif
void setSettings(ctkXnatSettings *settings)
virtual void accept()
ctkXnatSession * session() const
ctkXnatLoginDialog(QWidget *parent=0, Qt::WindowFlags flags=0)
ctkXnatSettings * settings() const
virtual ~ctkXnatLoginDialog()
A login profile for XNAT sessions.
The ctkXnatSession class reprents a session object associated with a specific XNAT connection.