Skip to content

Commit f83ad71

Browse files
committed
[GUI] enabled/disabled editable status added.
1 parent f4ce128 commit f83ad71

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/qt/intro.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,12 @@ void Intro::setDataDirectory(const QString& dataDir)
155155
ui->dataDirDefault->setChecked(true);
156156
ui->dataDirectory->setEnabled(false);
157157
ui->ellipsisButton->setEnabled(false);
158+
updateDataDirStatus(false);
158159
} else {
159160
ui->dataDirCustom->setChecked(true);
160161
ui->dataDirectory->setEnabled(true);
161162
ui->ellipsisButton->setEnabled(true);
163+
updateDataDirStatus(true);
162164
}
163165
}
164166

@@ -180,7 +182,7 @@ bool Intro::pickDataDirectory()
180182
/* 2) Allow QSettings to override default dir */
181183
dataDir = settings.value("strDataDir", dataDir).toString();
182184

183-
185+
184186
if (!fs::exists(GUIUtil::qstringToBoostPath(dataDir)) || GetBoolArg("-choosedatadir", false)) {
185187
// If current default data directory does not exist, let the user choose one
186188
Intro intro;
@@ -245,6 +247,15 @@ void Intro::setStatus(int status, const QString& message, quint64 bytesAvailable
245247
ui->pushButtonOk->setEnabled(status != FreespaceChecker::ST_ERROR);
246248
}
247249

250+
void Intro::updateDataDirStatus(bool enabled){
251+
if(enabled){
252+
setCssProperty(ui->dataDirectory, "edit-primary-welcome", true);
253+
} else {
254+
setCssProperty(ui->dataDirectory, "edit-primary-welcome-disabled", true);
255+
256+
}
257+
}
258+
248259
void Intro::on_dataDirectory_textChanged(const QString& dataDirStr)
249260
{
250261
/* Disable OK button until check result comes in */
@@ -262,12 +273,14 @@ void Intro::on_ellipsisButton_clicked()
262273
void Intro::on_dataDirDefault_clicked()
263274
{
264275
setDataDirectory(getDefaultDataDirectory());
276+
updateDataDirStatus(false);
265277
}
266278

267279
void Intro::on_dataDirCustom_clicked()
268280
{
269281
ui->dataDirectory->setEnabled(true);
270282
ui->ellipsisButton->setEnabled(true);
283+
updateDataDirStatus(true);
271284
}
272285

273286
void Intro::startThread()

src/qt/intro.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ private slots:
7373
void startThread();
7474
void checkPath(const QString& dataDir);
7575
QString getPathToCheck();
76+
void updateDataDirStatus(bool enabled);
7677

7778
friend class FreespaceChecker;
7879
};

0 commit comments

Comments
 (0)