equal
deleted
inserted
replaced
397 } |
397 } |
398 |
398 |
399 void HWMapContainer::askForGeneratedPreview() |
399 void HWMapContainer::askForGeneratedPreview() |
400 { |
400 { |
401 pMap = new HWMap(this); |
401 pMap = new HWMap(this); |
402 connect(pMap, SIGNAL(ImageReceived(QPixmap)), this, SLOT(setImage(QPixmap))); |
402 connect(pMap, SIGNAL(ImageReceived(QPixmap)), this, SLOT(setImage(const QPixmap))); |
403 connect(pMap, SIGNAL(HHLimitReceived(int)), this, SLOT(setHHLimit(int))); |
403 connect(pMap, SIGNAL(HHLimitReceived(int)), this, SLOT(setHHLimit(int))); |
404 connect(pMap, SIGNAL(destroyed(QObject *)), this, SLOT(onPreviewMapDestroyed(QObject *))); |
404 connect(pMap, SIGNAL(destroyed(QObject *)), this, SLOT(onPreviewMapDestroyed(QObject *))); |
405 pMap->getImage(m_seed, |
405 pMap->getImage(m_seed, |
406 getTemplateFilter(), |
406 getTemplateFilter(), |
407 get_mapgen(), |
407 get_mapgen(), |
561 m_missingMap = true; |
561 m_missingMap = true; |
562 setMapNameLabel(map); |
562 setMapNameLabel(map); |
563 if (m_mapInfo.type != MapModel::StaticMap && m_mapInfo.type != MapModel::MissionMap) |
563 if (m_mapInfo.type != MapModel::StaticMap && m_mapInfo.type != MapModel::MissionMap) |
564 { |
564 { |
565 m_mapInfo.type = MapModel::StaticMap; |
565 m_mapInfo.type = MapModel::StaticMap; |
566 changeMapType(MapModel::StaticMap, QModelIndex()); |
566 changeMapType(m_mapInfo.type, QModelIndex()); |
567 } |
567 } |
568 updatePreview(); |
568 updatePreview(); |
569 } |
569 } |
570 } |
570 } |
571 |
571 |
1110 // Type: 0 = static, 1 = mission |
1110 // Type: 0 = static, 1 = mission |
1111 void HWMapContainer::mapChanged(const QModelIndex & map, int type, const QModelIndex & old) |
1111 void HWMapContainer::mapChanged(const QModelIndex & map, int type, const QModelIndex & old) |
1112 { |
1112 { |
1113 QListView * mapList; |
1113 QListView * mapList; |
1114 |
1114 |
1115 if (type == 0) mapList = staticMapList; |
1115 if (type == 0) |
1116 else if (type == 1) mapList = missionMapList; |
1116 { |
1117 else return; |
1117 mapList = staticMapList; |
|
1118 m_mapInfo.type = MapModel::StaticMap; |
|
1119 } |
|
1120 else if (type == 1) |
|
1121 { |
|
1122 mapList = missionMapList; |
|
1123 m_mapInfo.type = MapModel::MissionMap; |
|
1124 } |
|
1125 else |
|
1126 return; |
1118 |
1127 |
1119 // Make sure it is a valid index |
1128 // Make sure it is a valid index |
1120 if (!map.isValid()) |
1129 if (!map.isValid()) |
1121 { |
1130 { |
1122 // Make sure there's always a valid selection in the map list |
1131 // Make sure there's always a valid selection in the map list |