SettingsDialog::SettingsDialog(BackgroundStreams* streams, QWidget* parent)
  : QDialog(parent),
    model_(NULL),
    gst_engine_(NULL),
    song_info_view_(NULL),
    streams_(streams),
    ui_(new Ui_SettingsDialog),
    loading_settings_(false)
{
  ui_->setupUi(this);

  AddPage(Page_Playback, new PlaybackSettingsPage(this));
  AddPage(Page_Behaviour, new BehaviourSettingsPage(this));
  AddPage(Page_SongInformation, new SongInfoSettingsPage(this));
  AddPage(Page_GlobalShortcuts, new GlobalShortcutsSettingsPage(this));
  AddPage(Page_Notifications, new NotificationsSettingsPage(this));
  AddPage(Page_Library, new LibrarySettingsPage(this));

#ifdef HAVE_LIBLASTFM
  AddPage(Page_Lastfm, new LastFMSettingsPage(this));
#endif

#ifdef HAVE_SPOTIFY
  AddPage(Page_Spotify, new SpotifySettingsPage(this));
#endif

  AddPage(Page_Magnatune, new MagnatuneSettingsPage(this));
  AddPage(Page_DigitallyImported, new DigitallyImportedSettingsPage(this));
  AddPage(Page_BackgroundStreams, new BackgroundStreamsSettingsPage(this));
  AddPage(Page_Proxy, new NetworkProxySettingsPage(this));
  AddPage(Page_Transcoding, new TranscoderSettingsPage(this));

#ifdef HAVE_REMOTE
  AddPage(Page_Remote, new RemoteSettingsPage(this));
#endif

#ifdef HAVE_WIIMOTEDEV
  AddPage(Page_Wiimotedev, new WiimoteSettingsPage(this));
#endif

  // List box
  connect(ui_->list, SIGNAL(currentTextChanged(QString)), SLOT(CurrentTextChanged(QString)));
  ui_->list->setCurrentRow(Page_Playback);

  // Make sure the list is big enough to show all the items
  ui_->list->setMinimumWidth(ui_->list->sizeHintForColumn(0));

  ui_->buttonBox->button(QDialogButtonBox::Cancel)->setShortcut(QKeySequence::Close);
}
示例#2
0
SettingsDialog::SettingsDialog(QWidget* parent)
  : QDialog(parent),
    ui_(new Ui_SettingsDialog),
    loading_settings_(false)
{
  ui_->setupUi(this);

  AddPage(Page_Browsing, new BrowsingSettingsPage(this));
  AddPage(Page_Login, new RedditLoginSettingsPage(this));
  AddPage(Page_Subreddits, new SubredditSettingsPage(this));

  // List box
  connect(ui_->list, SIGNAL(currentTextChanged(QString)), SLOT(CurrentTextChanged(QString)));
  ui_->list->setCurrentRow(Page_Browsing);

  // Make sure the list is big enough to show all the items
  ui_->list->setMinimumWidth(ui_->list->sizeHintForColumn(0));

  ui_->buttonBox->button(QDialogButtonBox::Cancel)->setShortcut(QKeySequence::Close);
}