Getting dir list to the drop down field

This commit is contained in:
Maxim Stewart 2017-05-31 03:10:30 -05:00
parent 0372a4ad8c
commit bddc7ea852
2 changed files with 12 additions and 12 deletions

View File

@ -27,7 +27,7 @@ private:
FileInfoWindow* m_infoWindow;
QFileSystemModel* fmodel;
QStringList filters;
QStringList filters, dropDownDirList;
// functions
private:
@ -38,6 +38,7 @@ private:
void openFile();
void open(QString);
void takeScreenShot();
void setDirList();
void aboutTool();
protected:

View File

@ -51,10 +51,12 @@ MainWindow::MainWindow(QWidget *parent)
ui->dirDropDownList->addItem("BF1_ModTools", "C:/BF1_ModTools/Assets/Shipped Worlds/"); // temp here
ui->dirDropDownList->addItem("BF2_ModTools", "C:/BF2_ModTools/assets/Sides/"); // temp here
// get the list of dirs from settimgs or rather settings window
SettingsWindow obj;
QStringList tmpList = obj.getDirList().split(";");
for (int i = 0; i < tmpList.size(); i++)
ui->dirDropDownList->addItem(tmpList[i], tmpList[i]); // temp here
QString tmp = obj.getDirList();
dropDownDirList = tmp.split(";");
for (int i = 0; i < dropDownDirList.size(); i++)
ui->dirDropDownList->addItem(dropDownDirList[i], dropDownDirList[i]); // temp here
// add widgets to the window
setupWidgets();
@ -75,10 +77,8 @@ MainWindow::~MainWindow()
delete m_infoWindow;
}
/////////////////////////////////////////////////////////////////////////
// functions
void MainWindow::setupWidgets()
{
// Ogl Viewer
@ -219,7 +219,6 @@ void MainWindow::open(QString fileName)
emit loadFile(fileName);
}
void MainWindow::takeScreenShot()
{
QString destination = QFileDialog::getSaveFileName(this, "Save as...", "", "PNG (*.png);; BMP (*.bmp);;TIFF (*.tiff, *.tif);;JPEG (*.jpg *jpeg)");