Skip to content

Commit

Permalink
update file wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
visualfc committed Mar 2, 2017
1 parent ddda3ac commit 2a5c78a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 deletions liteidex/src/liteapp/filemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,9 @@ void FileManager::execFileWizard(const QString &projPath, const QString &filePat
m_newFileDialog->setFileLocation(filePath);
m_newFileDialog->setProjectLocation(projPath);
m_newFileDialog->updateLocation();
if (pathList.isEmpty() && gopath.isEmpty()) {
m_newFileDialog->setGopath(projPath);
}

if (m_newFileDialog->exec() == QDialog::Accepted) {
//emit fileWizardFinished(m_newFileDialog->openPath(),m_newFileDialog->f)
Expand Down
8 changes: 5 additions & 3 deletions liteidex/src/liteapp/newfiledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void NewFileDialog::setPathList(const QStringList &pathList)
m_pathModel->setStringList(pathList);
if (m_gopath.isEmpty() && !pathList.isEmpty()) {
m_gopath = pathList.first();
}
}
}

void NewFileDialog::setGopath(const QString &path)
Expand Down Expand Up @@ -295,7 +295,7 @@ void NewFileDialog::activeTemplate(QModelIndex index)
bool b = true;
if (m_cur.type == "gopath") {
location = QFileInfo(m_gopath,"src").filePath();
b = false;
//b = false;
} else if (m_cur.type == "project") {
location = m_projectLocation;
} else {
Expand All @@ -304,7 +304,9 @@ void NewFileDialog::activeTemplate(QModelIndex index)
ui->locationLineEdit->setEnabled(b);
ui->locationBrowseButton->setEnabled(b);
ui->locationLineEdit->setText(QDir::toNativeSeparators(location));
ui->nameLineEdit->clear();

//update
nameLineChanged(ui->nameLineEdit->text());
}

bool NewFileDialog::processFile(const QString &infile, const QString &outfile)
Expand Down
8 changes: 7 additions & 1 deletion liteidex/src/plugins/golangpackage/gotool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ GoTool::~GoTool()

QStringList GoTool::liteGopath() const
{
return m_liteApp->settings()->value("liteide/gopath").toStringList();
QStringList pathList;
QStringList list = m_liteApp->settings()->value("liteide/gopath").toStringList();
foreach(QString path, list) {
pathList.append(QDir::toNativeSeparators(path));
}
pathList.removeDuplicates();
return pathList;
}

void GoTool::setLiteGopath(const QStringList &pathList)
Expand Down

0 comments on commit 2a5c78a

Please sign in to comment.