src/config.cpp

Wed, 17 Jul 2013 19:45:19 +0300

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Wed, 17 Jul 2013 19:45:19 +0300
changeset 9
f9893eea978b
parent 8
e8f645d9f28f
child 10
bc1414343e19
permissions
-rw-r--r--

shrink a little

5
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
1 #include <QLabel>
3
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
2 #include <QFileDialog>
5
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
3 #include <QFormLayout>
2
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
4 #include "config.h"
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
5 #include "ui_configbox.h"
6
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents: 5
diff changeset
6 #include "misc.h"
2
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
7
4
3c23aa03190d SEPARATORS
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
8 // =============================================================================
3c23aa03190d SEPARATORS
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
9 // -----------------------------------------------------------------------------
5
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
10 class FindPathButton : public QPushButton {
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
11 public:
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
12 explicit FindPathButton( QWidget* parent = null ) : QPushButton( parent ) {
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
13 setText( "..." );
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
14 }
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
15
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
16 QLineEdit* editWidget() const { return m_editWidget; }
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
17 void setEditWidget( QLineEdit* edit ) { m_editWidget = edit; }
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
18
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
19 private:
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
20 QLineEdit* m_editWidget;
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
21 };
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
22
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
23 // =============================================================================
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
24 // -----------------------------------------------------------------------------
2
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
25 ConfigBox::ConfigBox( QWidget* parent, Qt::WindowFlags f ) : QDialog( parent, f ) {
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
26 ui = new Ui_ConfigBox;
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
27 ui->setupUi( this );
5
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
28 QFormLayout* layout = new QFormLayout( ui->zandronumVersions );
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
29
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
30 for( str ver : g_zanVersions ) {
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
31 QLabel* lb = new QLabel( ver + ":" );
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
32 QLineEdit* ledit = new QLineEdit;
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
33 FindPathButton* btn = new FindPathButton;
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
34 btn->setEditWidget( ledit );
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
35
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
36 QWidget* wdg = new QWidget;
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
37 QHBoxLayout* leditLayout = new QHBoxLayout( wdg );
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
38 leditLayout->addWidget( ledit );
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
39 leditLayout->addWidget( btn );
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
40
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
41 m_zanBinaries << ledit;
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
42 layout->addRow( lb, wdg );
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
43 connect( btn, SIGNAL( clicked() ), this, SLOT( findZanBinary() ));
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
44 }
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
45
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
46 initFromSettings();
3
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
47
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
48 connect( ui->wad_add, SIGNAL( clicked() ), this, SLOT( addPath() ));
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
49 connect( ui->wad_pathEntry, SIGNAL( returnPressed() ), this, SLOT( addPath() ));
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
50 connect( ui->wad_findPath, SIGNAL( clicked() ), this, SLOT( findPath() ));
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
51 connect( ui->wad_del, SIGNAL( clicked() ), this, SLOT( delPath() ));
5
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
52 connect( ui->buttonBox, SIGNAL( accepted() ), this, SLOT( okPressed() ));
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
53 connect( ui->buttonBox, SIGNAL( rejected() ), this, SLOT( cancelPressed() ));
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
54 setWindowTitle( fmt( APPNAME " %1", versionString()));
2
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
55 }
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
56
4
3c23aa03190d SEPARATORS
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
57 // =============================================================================
3c23aa03190d SEPARATORS
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
58 // -----------------------------------------------------------------------------
2
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
59 ConfigBox::~ConfigBox() {
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
60 delete ui;
3
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
61 }
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
62
4
3c23aa03190d SEPARATORS
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
63 // =============================================================================
3c23aa03190d SEPARATORS
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
64 // -----------------------------------------------------------------------------
3
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
65 void ConfigBox::initFromSettings() {
5
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
66 QSettings cfg;
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
67
3
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
68 ui->wad_pathsList->clear();
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
69
5
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
70 list<var> paths = cfg.value( "wads/paths", list<var>() ).toList();
3
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
71 for( const var& it : paths )
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
72 addPath( it.toString() );
5
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
73
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
74 int i = 0;
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
75 for( str ver : g_zanVersions )
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
76 m_zanBinaries[i++]->setText( cfg.value( binaryConfigName( ver ), "" ).toString() );
8
e8f645d9f28f Added a prompt for demo information
Teemu Piippo <crimsondusk64@gmail.com>
parents: 6
diff changeset
77
e8f645d9f28f Added a prompt for demo information
Teemu Piippo <crimsondusk64@gmail.com>
parents: 6
diff changeset
78 ui->noDemoPrompt->setChecked( cfg.value( "nodemoprompt", false ).toBool() );
3
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
79 }
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
80
4
3c23aa03190d SEPARATORS
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
81 // =============================================================================
3c23aa03190d SEPARATORS
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
82 // -----------------------------------------------------------------------------
3
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
83 void ConfigBox::addPath() {
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
84 addPath( ui->wad_pathEntry->text() );
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
85 ui->wad_pathEntry->clear();
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
86 }
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
87
4
3c23aa03190d SEPARATORS
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
88 // =============================================================================
3c23aa03190d SEPARATORS
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
89 // -----------------------------------------------------------------------------
3
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
90 void ConfigBox::addPath( str path ) {
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
91 ui->wad_pathsList->addItem( path );
5
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
92 QListWidgetItem* item = ui->wad_pathsList->item( ui->wad_pathsList->count() - 1 );
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
93 item->setFlags( item->flags() | Qt::ItemIsEditable );
3
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
94 }
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
95
4
3c23aa03190d SEPARATORS
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
96 // =============================================================================
3c23aa03190d SEPARATORS
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
97 // -----------------------------------------------------------------------------
3
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
98 void ConfigBox::findPath() {
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
99 str path = QFileDialog::getExistingDirectory( this );
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
100 if( path.isEmpty() )
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
101 return;
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
102
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
103 ui->wad_pathEntry->setText( path );
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
104 }
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
105
4
3c23aa03190d SEPARATORS
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
106 // =============================================================================
3c23aa03190d SEPARATORS
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
107 // -----------------------------------------------------------------------------
3
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
108 void ConfigBox::delPath() {
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
109 delete ui->wad_pathsList->currentItem();
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
110 }
5
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
111
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
112 // =============================================================================
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
113 // -----------------------------------------------------------------------------
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
114 void ConfigBox::findZanBinary() {
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
115 FindPathButton* btn = dynamic_cast<FindPathButton*>( sender() );
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
116 str path;
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
117
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
118 if( !btn )
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
119 return;
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
120
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
121 str filter;
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
122 #ifdef _WIN32
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
123 filter = "Zandronum Binaries (zandronum.exe)(zandronum.exe);;All files (*.*)(*.*)";
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
124 #else
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
125 filter = "Zandronum Binaries (zandronum)(zandronum);;All files (*.*)(*.*)";
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
126 #endif
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
127
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
128 if(( path = QFileDialog::getOpenFileName( this, QString(), QString(), filter )).isEmpty() )
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
129 return;
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
130
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
131 btn->editWidget()->setText( path );
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
132 }
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
133
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
134 // =============================================================================
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
135 // -----------------------------------------------------------------------------
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
136 void ConfigBox::okPressed() {
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
137 QSettings cfg;
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
138 list<var> wadPathList;
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
139
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
140 for( int i = 0; i < ui->wad_pathsList->count(); ++i )
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
141 wadPathList << ui->wad_pathsList->item( i )->text();
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
142
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
143 cfg.setValue( "wads/paths", wadPathList );
8
e8f645d9f28f Added a prompt for demo information
Teemu Piippo <crimsondusk64@gmail.com>
parents: 6
diff changeset
144 cfg.setValue( "nodemoprompt", ui->noDemoPrompt->isChecked() );
5
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
145
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
146 int i = 0;
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
147 for( str ver : g_zanVersions )
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
148 cfg.setValue( binaryConfigName( ver ), m_zanBinaries[i++]->text() );
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
149
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
150 accept();
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
151 }
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
152
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
153 // =============================================================================
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
154 // -----------------------------------------------------------------------------
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
155 void ConfigBox::cancelPressed() {
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
156 reject();
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
157 }

mercurial