QTfrontend/hwform.cpp
changeset 7939 f951c4b5b335
parent 7933 223b3a195474
child 8048 e14daa2508fc
child 8049 133e22b5c410
equal deleted inserted replaced
7932:ebe1d112e439 7939:f951c4b5b335
    98 #include "DataManager.h"
    98 #include "DataManager.h"
    99 
    99 
   100 #ifdef __APPLE__
   100 #ifdef __APPLE__
   101 #include "M3Panel.h"
   101 #include "M3Panel.h"
   102 #ifdef SPARKLE_ENABLED
   102 #ifdef SPARKLE_ENABLED
   103 #define SPARKLE_APPCAST_URL "http://www.hedgewars.org/download/appcast.xml"
       
   104 #include "SparkleAutoUpdater.h"
   103 #include "SparkleAutoUpdater.h"
   105 #endif
   104 #endif
   106 #endif
   105 #endif
   107 
   106 
   108 
   107 
   150     panel = new M3Panel;
   149     panel = new M3Panel;
   151 
   150 
   152 #ifdef SPARKLE_ENABLED
   151 #ifdef SPARKLE_ENABLED
   153     AutoUpdater* updater;
   152     AutoUpdater* updater;
   154 
   153 
   155     updater = new SparkleAutoUpdater(SPARKLE_APPCAST_URL);
   154     updater = new SparkleAutoUpdater();
   156     if (updater && config->isAutoUpdateEnabled())
   155     if (updater && config->isAutoUpdateEnabled())
   157         updater->checkForUpdates();
   156         updater->checkForUpdates();
   158 #endif
   157 #endif
   159 
   158 
   160     QShortcut *hideFrontend = new QShortcut(QKeySequence("Ctrl+M"), this);
   159     QShortcut *hideFrontend = new QShortcut(QKeySequence("Ctrl+M"), this);
   188     pageSwitchMapper->setMapping(ui.pageMain->BtnSinglePlayer, ID_PAGE_SINGLEPLAYER);
   187     pageSwitchMapper->setMapping(ui.pageMain->BtnSinglePlayer, ID_PAGE_SINGLEPLAYER);
   189 
   188 
   190     connect(ui.pageMain->BtnSetup, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
   189     connect(ui.pageMain->BtnSetup, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
   191     pageSwitchMapper->setMapping(ui.pageMain->BtnSetup, ID_PAGE_SETUP);
   190     pageSwitchMapper->setMapping(ui.pageMain->BtnSetup, ID_PAGE_SETUP);
   192 
   191 
       
   192 #if 0
   193     connect(ui.pageMain->BtnFeedback, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
   193     connect(ui.pageMain->BtnFeedback, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
   194     pageSwitchMapper->setMapping(ui.pageMain->BtnFeedback, ID_PAGE_FEEDBACK);
   194     pageSwitchMapper->setMapping(ui.pageMain->BtnFeedback, ID_PAGE_FEEDBACK);
       
   195 #endif
   195 
   196 
   196     connect(ui.pageMain->BtnNet, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
   197     connect(ui.pageMain->BtnNet, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
   197     pageSwitchMapper->setMapping(ui.pageMain->BtnNet, ID_PAGE_NETTYPE);
   198     pageSwitchMapper->setMapping(ui.pageMain->BtnNet, ID_PAGE_NETTYPE);
   198 
   199 
   199     connect(ui.pageMain->BtnInfo, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
   200     connect(ui.pageMain->BtnInfo, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
  1066 
  1067 
  1067     hwnet = new HWNewNet();
  1068     hwnet = new HWNewNet();
  1068 
  1069 
  1069     GoToPage(ID_PAGE_CONNECTING);
  1070     GoToPage(ID_PAGE_CONNECTING);
  1070 
  1071 
  1071     connect(hwnet, SIGNAL(AskForRunGame()), this, SLOT(CreateNetGame()), Qt::QueuedConnection);
  1072     connect(hwnet, SIGNAL(AskForRunGame()), this, SLOT(CreateNetGame()));
  1072     connect(hwnet, SIGNAL(connected()), this, SLOT(NetConnected()), Qt::QueuedConnection);
  1073     connect(hwnet, SIGNAL(connected()), this, SLOT(NetConnected()), Qt::QueuedConnection);
  1073     connect(hwnet, SIGNAL(Error(const QString&)), this, SLOT(NetError(const QString&)), Qt::QueuedConnection);
  1074     connect(hwnet, SIGNAL(Error(const QString&)), this, SLOT(NetError(const QString&)), Qt::QueuedConnection);
  1074     connect(hwnet, SIGNAL(Warning(const QString&)), this, SLOT(NetWarning(const QString&)), Qt::QueuedConnection);
  1075     connect(hwnet, SIGNAL(Warning(const QString&)), this, SLOT(NetWarning(const QString&)), Qt::QueuedConnection);
  1075     connect(hwnet, SIGNAL(EnteredGame()), this, SLOT(NetGameEnter()), Qt::QueuedConnection);
  1076     connect(hwnet, SIGNAL(EnteredGame()), this, SLOT(NetGameEnter()), Qt::QueuedConnection);
  1076     connect(hwnet, SIGNAL(LeftRoom(const QString&)), this, SLOT(NetLeftRoom(const QString&)), Qt::QueuedConnection);
  1077     connect(hwnet, SIGNAL(LeftRoom(const QString&)), this, SLOT(NetLeftRoom(const QString&)), Qt::QueuedConnection);
  1469     CreateGame(ui.pageNetGame->pGameCFG, ui.pageNetGame->pNetTeamsWidget, ammo);
  1470     CreateGame(ui.pageNetGame->pGameCFG, ui.pageNetGame->pNetTeamsWidget, ammo);
  1470 
  1471 
  1471     connect(game, SIGNAL(SendNet(const QByteArray &)), hwnet, SLOT(SendNet(const QByteArray &)));
  1472     connect(game, SIGNAL(SendNet(const QByteArray &)), hwnet, SLOT(SendNet(const QByteArray &)));
  1472     connect(game, SIGNAL(SendChat(const QString &)), hwnet, SLOT(chatLineToNet(const QString &)));
  1473     connect(game, SIGNAL(SendChat(const QString &)), hwnet, SLOT(chatLineToNet(const QString &)));
  1473     connect(game, SIGNAL(SendTeamMessage(const QString &)), hwnet, SLOT(SendTeamMessage(const QString &)));
  1474     connect(game, SIGNAL(SendTeamMessage(const QString &)), hwnet, SLOT(SendTeamMessage(const QString &)));
  1474     connect(hwnet, SIGNAL(FromNet(const QByteArray &)), game, SLOT(FromNet(const QByteArray &)));
  1475     connect(hwnet, SIGNAL(FromNet(const QByteArray &)), game, SLOT(FromNet(const QByteArray &)), Qt::QueuedConnection);
  1475     connect(hwnet, SIGNAL(chatStringFromNet(const QString &)), game, SLOT(FromNetChat(const QString &)));
  1476     connect(hwnet, SIGNAL(chatStringFromNet(const QString &)), game, SLOT(FromNetChat(const QString &)), Qt::QueuedConnection);
  1476 
  1477 
  1477     game->StartNet();
  1478     game->StartNet();
  1478 }
  1479 }
  1479 
  1480 
  1480 void HWForm::closeEvent(QCloseEvent *event)
  1481 void HWForm::closeEvent(QCloseEvent *event)