Skip to content

Commit

Permalink
[GUI] Proper tab name to results. Fixes simulationcraft#3621
Browse files Browse the repository at this point in the history
  • Loading branch information
navv1234 committed Jul 12, 2017
1 parent a8340e5 commit 553663c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
7 changes: 4 additions & 3 deletions qt/sc_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,6 @@ void SC_MainWindow::startSim()
}
optionsTab -> encodeOptions();
importTab -> automationTab -> encodeSettings();
QString tab_name = simulateTab -> tabText(simulateTab -> currentIndex());

// Clear log text on success so users don't get confused if there is
// an error from previous attempts
Expand All @@ -794,9 +793,11 @@ void SC_MainWindow::startSim()
simProgress = 0;
sim = initSim();

QString options = simulationQueue.dequeue();
auto value = simulationQueue.dequeue();

QString tab_name = std::get<0>( value );
QByteArray utf8_profile = std::get<1>( value ).toUtf8();

QByteArray utf8_profile = options.toUtf8();
QFile file( AppDataDir + QDir::separator() + "simc_gui.simc" );
if ( file.open( QIODevice::WriteOnly | QIODevice::Text ) )
{
Expand Down
9 changes: 6 additions & 3 deletions qt/simulationcraftqt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,17 +279,20 @@ class SC_QueueItemModel : public QStandardItemModel

appendRow( item );
}
QString dequeue()
std::tuple<QString, QString> dequeue()
{
QModelIndex indx = index( 0, 0 );
QString retval;
std::tuple<QString, QString> retval;

if ( indx.isValid() )
{
retval = indx.data( Qt::UserRole + 1 ).toString();
retval = std::make_tuple( indx.data( Qt::DisplayRole ).toString(),
indx.data( Qt::UserRole + 1 ).toString() );
removeRow( 0 );
}
return retval;
}

bool isEmpty() const
{
return rowCount() <= 0;
Expand Down

0 comments on commit 553663c

Please sign in to comment.