Skip to content
This repository has been archived by the owner on Aug 25, 2020. It is now read-only.

Commit

Permalink
GUI: upgrade to QT5 ( still optional ).
Browse files Browse the repository at this point in the history
  • Loading branch information
scamille committed May 14, 2013
1 parent 817977b commit c083e89
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 13 deletions.
2 changes: 1 addition & 1 deletion engine/sc_report_html_player.cpp
Expand Up @@ -1987,7 +1987,7 @@ static void print_html_player_buffs( FILE* file, player_t* p )
if ( uptime > 0 )
{
fprintf( file,
"\t\t\t\t\t\t\t\t\t\t<li><span class=\"label\">%s_%zd:</span>%.1f%%</li>\n",
"\t\t\t\t\t\t\t\t\t\t<li><span class=\"label\">%s_%d:</span>%.1f%%</li>\n",
b -> name(), j,
uptime * 100.0 );
}
Expand Down
6 changes: 5 additions & 1 deletion qt/main.cpp
@@ -1,6 +1,10 @@
#include <QLocale>
#include <QtGui/QApplication>
#include <locale>
#ifdef QT_VERSION_5
#include <QtGui/QGuiApplication>
#else
#include <QtGui/QApplication>
#endif
#include "simulationcraftqt.hpp"
#ifndef SIMC_NO_AUTOUPDATE
#include "sc_autoupdate.h"
Expand Down
22 changes: 11 additions & 11 deletions qt/sc_window.cpp
Expand Up @@ -490,7 +490,6 @@ void SimulationCraftWindow::createCmdLine()
cmdLineLayout->addWidget( mainButton = new QPushButton( "Simulate!" ) );
backButton->setMaximumWidth( 30 );
forwardButton->setMaximumWidth( 30 );
progressBar->setStyle( new QPlastiqueStyle() );
progressBar->setMaximum( 100 );
progressBar->setMaximumWidth( 200 );
progressBar->setMinimumWidth( 150 );
Expand Down Expand Up @@ -865,12 +864,12 @@ void SimulationCraftWindow::createCustomTab()
customGlyphsTab = new QWidget();
customGlyphsTab->setObjectName( QString::fromUtf8( "customGlyphsTab" ) );
createCustomProfileDock->addTab( customGlyphsTab, QString() );
createCustomProfileDock->setTabText( createCustomProfileDock->indexOf( customGearTab ), QApplication::translate( "createCustomTab", "Gear", 0, QApplication::UnicodeUTF8 ) );
createCustomProfileDock->setTabToolTip( createCustomProfileDock->indexOf( customGearTab ), QApplication::translate( "createCustomTab", "Customise Gear Setup", 0, QApplication::UnicodeUTF8 ) );
createCustomProfileDock->setTabText( createCustomProfileDock->indexOf( customTalentsTab ), QApplication::translate( "createCustomTab", "Talents", 0, QApplication::UnicodeUTF8 ) );
createCustomProfileDock->setTabToolTip( createCustomProfileDock->indexOf( customTalentsTab ), QApplication::translate( "createCustomTab", "Customise Talents", 0, QApplication::UnicodeUTF8 ) );
createCustomProfileDock->setTabText( createCustomProfileDock->indexOf( customGlyphsTab ), QApplication::translate( "createCustomTab", "Glyphs", 0, QApplication::UnicodeUTF8 ) );
createCustomProfileDock->setTabToolTip( createCustomProfileDock->indexOf( customGlyphsTab ), QApplication::translate( "createCustomTab", "Customise Glyphs", 0, QApplication::UnicodeUTF8 ) );
createCustomProfileDock -> setTabText( createCustomProfileDock -> indexOf( customGearTab ), tr( "Gear", "createCustomTab" ) );
createCustomProfileDock -> setTabToolTip( createCustomProfileDock -> indexOf( customGearTab ), tr( "Customise Gear Setup", "createCustomTab" ) );
createCustomProfileDock -> setTabText( createCustomProfileDock -> indexOf( customTalentsTab ), tr( "Talents", "createCustomTab" ) );
createCustomProfileDock -> setTabToolTip( createCustomProfileDock -> indexOf( customTalentsTab ), tr( "Customise Talents", "createCustomTab" ) );
createCustomProfileDock -> setTabText( createCustomProfileDock -> indexOf( customGlyphsTab ), tr( "Glyphs", "createCustomTab" ) );
createCustomProfileDock -> setTabToolTip( createCustomProfileDock -> indexOf( customGlyphsTab ), tr( "Customise Glyphs", "createCustomTab" ) );
}

void SimulationCraftWindow::createSimulateTab()
Expand Down Expand Up @@ -1211,10 +1210,11 @@ void SimulationCraftWindow::importFinished()

void SimulateThread::run()
{
QByteArray utf8_profile = options.toUtf8();
QFile file( "simc_gui.simc" );
if ( file.open( QIODevice::WriteOnly ) )
{
file.write( options.toAscii() );
file.write( utf8_profile );
file.close();
}

Expand Down Expand Up @@ -1479,7 +1479,7 @@ void SimulationCraftWindow::saveLog()

if ( file.open( QIODevice::WriteOnly ) )
{
file.write( logText->toPlainText().toAscii() );
file.write( logText->toPlainText().toUtf8() );
file.close();
}

Expand All @@ -1499,7 +1499,7 @@ void SimulationCraftWindow::saveResults()

if ( file.open( QIODevice::WriteOnly ) )
{
file.write( visibleWebView->property("resultHTML").toString().toAscii() );
file.write( visibleWebView->property("resultHTML").toString().toUtf8() );
file.close();
}

Expand Down Expand Up @@ -1711,7 +1711,7 @@ void SimulationCraftWindow::historyDoubleClicked( QListWidgetItem* item )

if ( mrRobotBuilderView )
{
mrRobotBuilderView->setUrl( QUrl::fromEncoded( url.toAscii() ) );
mrRobotBuilderView->setUrl( QUrl::fromEncoded( url.toUtf8() ) );
importTab->setCurrentIndex( TAB_MR_ROBOT );
}
}
Expand Down
4 changes: 4 additions & 0 deletions qt/simulationcraftqt.hpp
Expand Up @@ -9,6 +9,10 @@
#include "simulationcraft.hpp"
#include <QtGui/QtGui>
#include <QtWebKit>
#ifdef QT_VERSION_5
#include <QtWidgets/QtWidgets>
#include <QtWebKitWidgets/QtWebKitWidgets>
#endif

enum master_tabs {
TAB_WELCOME,
Expand Down
5 changes: 5 additions & 0 deletions simcqt.pro
Expand Up @@ -8,6 +8,11 @@ exists( build.conf ) {
include( build.conf )
}

contains ( QT_MAJOR_VERSION , 5 ) {
QT += widgets webkitwidgets
DEFINES += QT_VERSION_5
}

QMAKE_CXXFLAGS += $$OPTS

QMAKE_CXXFLAGS_RELEASE += -DNDEBUG
Expand Down

0 comments on commit c083e89

Please sign in to comment.