Exemplo n.º 1
0
void LibrarySettingsPage::Load() {
  if (!initialised_model_) {
    if (ui_->list->selectionModel()) {
      disconnect(ui_->list->selectionModel(),
                 SIGNAL(currentRowChanged(QModelIndex, QModelIndex)),
                 this, SLOT(CurrentRowChanged(QModelIndex)));
    }

    ui_->list->setModel(dialog()->library_directory_model());
    initialised_model_ = true;

    connect(ui_->list->selectionModel(),
            SIGNAL(currentRowChanged(QModelIndex, QModelIndex)),
            SLOT(CurrentRowChanged(QModelIndex)));
  }

  QSettings s;
  s.beginGroup(LibraryView::kSettingsGroup);
  ui_->auto_open->setChecked(s.value("auto_open", true).toBool());
  ui_->pretty_covers->setChecked(s.value("pretty_covers", true).toBool());
  ui_->show_dividers->setChecked(s.value("show_dividers", true).toBool());
  s.endGroup();

  s.beginGroup(LibraryWatcher::kSettingsGroup);
  ui_->startup_scan->setChecked(s.value("startup_scan", true).toBool());
  ui_->monitor->setChecked(s.value("monitor", true).toBool());
  
  QStringList filters = s.value("cover_art_patterns",
      QStringList() << "front" << "cover").toStringList();
  ui_->cover_art_patterns->setText(filters.join(","));
  
  s.endGroup();
}
Exemplo n.º 2
0
void FileListView::currentChanged(const QModelIndex &current, const QModelIndex &previous)
{
    emit CurrentRowChanged(current.data(FileListModel::IndexRowRole).toInt());

    for (int i = 0; i < model()->columnCount(); i++)
        update( model()->index(previous.row(), i) );
    for (int i = 0; i < model()->columnCount(); i++)
        update( model()->index(current.row(), i) );

    QAbstractItemView::currentChanged(current, previous);
}