Select the root node in the Tree view when opening a project
Commit Dialog now displays the first line previous commit messages only FossilOrigin-Name: 6f0dadf863a147669f09e5661541e2ae6043e2a5
This commit is contained in:
@ -8,11 +8,26 @@ CommitDialog::CommitDialog(QWidget *parent, const QStringList &commitMsgHistory,
|
||||
ui(new Ui::CommitDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->comboBox->clear();
|
||||
ui->comboBox->insertItems(0, commitMsgHistory);
|
||||
ui->plainTextEdit->clear();
|
||||
ui->listView->setModel(&itemModel);
|
||||
|
||||
// Generate the history combo
|
||||
foreach(const QString msg, commitMsgHistory)
|
||||
{
|
||||
QString trimmed = msg.trimmed();
|
||||
if(trimmed.isEmpty())
|
||||
continue;
|
||||
|
||||
commitMessages.append(trimmed);
|
||||
QStringList lines = trimmed.split('\n');
|
||||
QString first_line;
|
||||
if(!lines.empty())
|
||||
first_line = lines[0] + "...";
|
||||
|
||||
ui->comboBox->addItem(first_line);
|
||||
}
|
||||
|
||||
// Populate file list
|
||||
for(QStringList::const_iterator it=files.begin(); it!=files.end(); ++it)
|
||||
{
|
||||
QStandardItem *si = new QStandardItem(*it);
|
||||
@ -20,7 +35,6 @@ CommitDialog::CommitDialog(QWidget *parent, const QStringList &commitMsgHistory,
|
||||
si->setCheckState(Qt::Checked);
|
||||
itemModel.appendRow(si);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@ -52,12 +66,12 @@ bool CommitDialog::run(QWidget *parent, QString &commitMsg, const QStringList &c
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void CommitDialog::on_comboBox_activated(const QString &arg1)
|
||||
void CommitDialog::on_comboBox_activated(int index)
|
||||
{
|
||||
ui->plainTextEdit->setPlainText(arg1);
|
||||
Q_ASSERT(index < commitMessages.length());
|
||||
ui->plainTextEdit->setPlainText(commitMessages[index]);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void CommitDialog::on_listView_doubleClicked(const QModelIndex &index)
|
||||
{
|
||||
|
Reference in New Issue
Block a user