~mateo-salta/nitroshare/nitroshare

« back to all changes in this revision

Viewing changes to src/dialogs/CFirstStartWizard.cpp

  • Committer: Nathan Osman
  • Date: 2012-07-03 18:54:45 UTC
  • Revision ID: admin@quickmediasolutions.com-20120703185445-39gkajlpzikj764i
Adjusted the wizard to make certain steps mandatory and added a nice animation to the broadcast discovery page.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
   You should have received a copy of the GNU General Public License
15
15
   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
16
16
 
17
 
#include <QCloseEvent>
18
 
#include <QMessageBox>
19
17
#include <QPixmap>
20
18
 
21
19
#include <dialogs/CFirstStartWizard.h>
22
20
#include <util/settings.h>
23
21
#include "ui_CFirstStartWizard.h"
24
22
 
 
23
void CWizardPage::AddRequiredField(QWidget * widget, const char * property, const char * signal)
 
24
{
 
25
    /* Generate a unique name for each field. */
 
26
    static int unique_id = 0;
 
27
    registerField(QString("%1*").arg(unique_id++), widget, property, signal);
 
28
}
 
29
 
25
30
CFirstStartWizard::CFirstStartWizard()
26
31
    : ui(new Ui::CFirstStartWizard)
27
32
{
28
33
    ui->setupUi(this);
29
34
    setPixmap(LogoPixmap, QPixmap(":/images/config.png"));
30
35
 
 
36
    /* Register each of the required fields. */
 
37
    ui->MachineNamePage->AddRequiredField(ui->MachineName);
 
38
    ui->BroadcastDiscoveryPage->AddRequiredField(ui->BroadcastDiscovery, "interface", SIGNAL(FoundInterface()));
 
39
 
31
40
    OnNotificationsChanged(StandardNotifications);
32
41
 
33
42
    /* Load the defaults. */