Commit cd91c8aa authored by Calvin Buckley's avatar Calvin Buckley 🤔 Committed by Albert Astals Cid
Browse files

Open folder browser on adding first source annotation item

User testing shown that this wasn't obvious. When the user adds the
first item (usually for all objects), open the dialog to make it
obvious, otherwise they tend to stumble around looking for more
options. For more items, it won't do this because it's assumed
that it's for different objects. (My testing with users didn't involve
programs with object files though.)

Can be replicated with KCG.
parent c2809a2c
......@@ -128,11 +128,18 @@ void SourceSettings::update()
void SourceSettings::addClicked()
{
int prevItemCount = ui.dirList->topLevelItemCount();
QTreeWidgetItem* i = new QTreeWidgetItem();
i->setText(0, ui.objectBox->currentText());
i->setText(1, tr("<insert valid directory>"));
ui.dirList->addTopLevelItem(i);
ui.dirList->setCurrentItem(i);
if (prevItemCount == 0 && ui.objectBox->currentText() == _always) {
// it's not obvious that you have to click browse after adding an item,
// but handle the case where we have no items and are looking for the
// default. give users an oppurtunity to select for multiple ELF objects
browseClicked();
}
}
void SourceSettings::deleteClicked()
......@@ -153,7 +160,8 @@ void SourceSettings::browseClicked()
{
QString d;
d = QFileDialog::getExistingDirectory(this,
tr("Choose Source Directory"));
tr("Choose Source Directory"),
ui.dirEdit->text());
if (!d.isEmpty())
ui.dirEdit->setText(d);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment