src/config.cpp

Wed, 17 Jul 2013 18:46:47 +0300

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Wed, 17 Jul 2013 18:46:47 +0300
changeset 6
67b6ef6917ba
parent 5
3c04e05ab24f
child 8
e8f645d9f28f
permissions
-rw-r--r--

Now capable of actually launching demos

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() );
3
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
77 }
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
78
4
3c23aa03190d SEPARATORS
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
79 // =============================================================================
3c23aa03190d SEPARATORS
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
80 // -----------------------------------------------------------------------------
3
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
81 void ConfigBox::addPath() {
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
82 addPath( ui->wad_pathEntry->text() );
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
83 ui->wad_pathEntry->clear();
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
84 }
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
85
4
3c23aa03190d SEPARATORS
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
86 // =============================================================================
3c23aa03190d SEPARATORS
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
87 // -----------------------------------------------------------------------------
3
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
88 void ConfigBox::addPath( str path ) {
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
89 ui->wad_pathsList->addItem( path );
5
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
90 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
91 item->setFlags( item->flags() | Qt::ItemIsEditable );
3
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
92 }
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
93
4
3c23aa03190d SEPARATORS
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
94 // =============================================================================
3c23aa03190d SEPARATORS
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
95 // -----------------------------------------------------------------------------
3
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
96 void ConfigBox::findPath() {
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
97 str path = QFileDialog::getExistingDirectory( this );
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
98 if( path.isEmpty() )
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
99 return;
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
100
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
101 ui->wad_pathEntry->setText( path );
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
4
3c23aa03190d SEPARATORS
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
104 // =============================================================================
3c23aa03190d SEPARATORS
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
105 // -----------------------------------------------------------------------------
3
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
106 void ConfigBox::delPath() {
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
107 delete ui->wad_pathsList->currentItem();
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
108 }
5
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
109
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
110 // =============================================================================
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 void ConfigBox::findZanBinary() {
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
113 FindPathButton* btn = dynamic_cast<FindPathButton*>( sender() );
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
114 str path;
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
115
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
116 if( !btn )
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
117 return;
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
118
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
119 str filter;
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
120 #ifdef _WIN32
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
121 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
122 #else
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
123 filter = "Zandronum Binaries (zandronum)(zandronum);;All files (*.*)(*.*)";
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
124 #endif
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
125
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
126 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
127 return;
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
128
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
129 btn->editWidget()->setText( path );
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
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 void ConfigBox::okPressed() {
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
135 QSettings cfg;
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
136 list<var> wadPathList;
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
137
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
138 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
139 wadPathList << ui->wad_pathsList->item( i )->text();
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
140
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
141 cfg.setValue( "wads/paths", wadPathList );
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 int i = 0;
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
144 for( str ver : g_zanVersions )
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
145 cfg.setValue( binaryConfigName( ver ), m_zanBinaries[i++]->text() );
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
146
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
147 accept();
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
148 }
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 // =============================================================================
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 void ConfigBox::cancelPressed() {
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
153 reject();
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 4
diff changeset
154 }

mercurial