120 gbTLayout->setContentsMargins(0, 0, 0 ,0); |
120 gbTLayout->setContentsMargins(0, 0, 0 ,0); |
121 gbTLayout->setSpacing(0); |
121 gbTLayout->setSpacing(0); |
122 lvThemes = new QListView(mapWidget); |
122 lvThemes = new QListView(mapWidget); |
123 lvThemes->setMinimumHeight(30); |
123 lvThemes->setMinimumHeight(30); |
124 lvThemes->setFixedWidth(140); |
124 lvThemes->setFixedWidth(140); |
125 lvThemes->setModel(themesModel); |
125 m_themeModel = DataManager::instance().themeModel(); |
|
126 lvThemes->setModel(m_themeModel); |
126 lvThemes->setIconSize(QSize(16, 16)); |
127 lvThemes->setIconSize(QSize(16, 16)); |
127 lvThemes->setEditTriggers(QListView::NoEditTriggers); |
128 lvThemes->setEditTriggers(QListView::NoEditTriggers); |
128 |
129 |
129 connect(lvThemes->selectionModel(), SIGNAL(currentRowChanged( const QModelIndex &, const QModelIndex &)), this, SLOT(themeSelected( const QModelIndex &, const QModelIndex &))); |
130 connect(lvThemes->selectionModel(), SIGNAL(currentRowChanged( const QModelIndex &, const QModelIndex &)), this, SLOT(themeSelected( const QModelIndex &, const QModelIndex &))); |
130 |
131 |
450 updatePreview(); |
451 updatePreview(); |
451 } |
452 } |
452 |
453 |
453 void HWMapContainer::setRandomTheme() |
454 void HWMapContainer::setRandomTheme() |
454 { |
455 { |
455 if(!themesModel->rowCount()) return; |
456 if(!m_themeModel->rowCount()) return; |
456 quint32 themeNum = rand() % themesModel->rowCount(); |
457 quint32 themeNum = rand() % m_themeModel->rowCount(); |
457 lvThemes->setCurrentIndex(themesModel->index(themeNum)); |
458 lvThemes->setCurrentIndex(m_themeModel->index(themeNum)); |
458 } |
459 } |
459 |
460 |
460 void HWMapContainer::intSetTemplateFilter(int filter) |
461 void HWMapContainer::intSetTemplateFilter(int filter) |
461 { |
462 { |
462 cbTemplateFilter->setCurrentIndex(filter); |
463 cbTemplateFilter->setCurrentIndex(filter); |