Revert "Try out C++11 strongly typed enums."

This reverts commit 4e74c7af2b.
This commit is contained in:
John Maguire 2012-12-05 09:36:22 +00:00
parent 4e74c7af2b
commit b41a2b5308
15 changed files with 59 additions and 59 deletions

View File

@ -500,7 +500,7 @@ void GlobalSearchView::FocusOnFilter(QKeyEvent* event) {
}
void GlobalSearchView::OpenSettingsDialog() {
app_->OpenSettingsDialogAtPage(SettingsDialog::Page::GlobalSearch);
app_->OpenSettingsDialogAtPage(SettingsDialog::Page_GlobalSearch);
}
void GlobalSearchView::GroupByClicked(QAction* action) {

View File

@ -86,7 +86,7 @@ bool SearchProviderStatusWidget::eventFilter(QObject* object, QEvent* event) {
if (!provider_->IsLoggedIn()) {
provider_->ShowConfig();
} else {
engine_->application()->OpenSettingsDialogAtPage(SettingsDialog::Page::GlobalSearch);
engine_->application()->OpenSettingsDialogAtPage(SettingsDialog::Page_GlobalSearch);
}
}
break;

View File

@ -207,7 +207,7 @@ void DigitallyImportedServiceBase::LoadPlaylistFinished(QNetworkReply* reply) {
}
void DigitallyImportedServiceBase::ShowSettingsDialog() {
app_->OpenSettingsDialogAtPage(SettingsDialog::Page::DigitallyImported);
app_->OpenSettingsDialogAtPage(SettingsDialog::Page_DigitallyImported);
}
DigitallyImportedClient::ChannelList DigitallyImportedServiceBase::Channels() {

View File

@ -35,7 +35,7 @@ DropboxService::DropboxService(Application* app, InternetModel* parent)
app, parent,
kServiceName, kServiceId,
QIcon(":/providers/dropbox.png"),
SettingsDialog::Page::Dropbox),
SettingsDialog::Page_Dropbox),
network_(new NetworkAccessManager(this)) {
QSettings settings;
settings.beginGroup(kSettingsGroup);

View File

@ -40,7 +40,7 @@ GoogleDriveService::GoogleDriveService(Application* app, InternetModel* parent)
app, parent,
kServiceName, kServiceId,
QIcon(":/providers/googledrive.png"),
SettingsDialog::Page::GoogleDrive),
SettingsDialog::Page_GoogleDrive),
client_(new google_drive::Client(this)),
task_manager_(app->task_manager()) {
app->player()->RegisterUrlHandler(new GoogleDriveUrlHandler(this, this));

View File

@ -162,7 +162,7 @@ void GroovesharkService::LazyPopulate(QStandardItem* item) {
}
void GroovesharkService::ShowConfig() {
app_->OpenSettingsDialogAtPage(SettingsDialog::Page::Grooveshark);
app_->OpenSettingsDialogAtPage(SettingsDialog::Page_Grooveshark);
}
QWidget* GroovesharkService::HeaderWidget() const {

View File

@ -160,7 +160,7 @@ void LastFMService::ReloadSettings() {
}
void LastFMService::ShowConfig() {
app_->OpenSettingsDialogAtPage(SettingsDialog::Page::Lastfm);
app_->OpenSettingsDialogAtPage(SettingsDialog::Page_Lastfm);
}
bool LastFMService::IsAuthenticated() const {

View File

@ -334,7 +334,7 @@ QUrl MagnatuneService::ModifyUrl(const QUrl& url) const {
}
void MagnatuneService::ShowConfig() {
app_->OpenSettingsDialogAtPage(SettingsDialog::Page::Magnatune);
app_->OpenSettingsDialogAtPage(SettingsDialog::Page_Magnatune);
}
void MagnatuneService::Download() {

View File

@ -713,7 +713,7 @@ void SpotifyService::SyncPlaylistProgress(
}
void SpotifyService::ShowConfig() {
app_->OpenSettingsDialogAtPage(SettingsDialog::Page::Spotify);
app_->OpenSettingsDialogAtPage(SettingsDialog::Page_Spotify);
}
void SpotifyService::Logout() {

View File

@ -41,7 +41,7 @@ UbuntuOneService::UbuntuOneService(Application* app, InternetModel* parent)
app, parent,
kServiceName, kServiceId,
QIcon(":/providers/ubuntuone.png"),
SettingsDialog::Page::UbuntuOne) {
SettingsDialog::Page_UbuntuOne) {
app_->player()->RegisterUrlHandler(new UbuntuOneUrlHandler(this, this));
QSettings s;

View File

@ -222,7 +222,7 @@ void AddPodcastDialog::RemovePodcast() {
}
void AddPodcastDialog::OpenSettingsPage() {
app_->OpenSettingsDialogAtPage(SettingsDialog::Page::Podcasts);
app_->OpenSettingsDialogAtPage(SettingsDialog::Page_Podcasts);
}
void AddPodcastDialog::OpenOPMLFile() {

View File

@ -499,7 +499,7 @@ void PodcastService::DownloadProgressChanged(const PodcastEpisode& episode,
}
void PodcastService::ShowConfig() {
app_->OpenSettingsDialogAtPage(SettingsDialog::Page::Podcasts);
app_->OpenSettingsDialogAtPage(SettingsDialog::Page_Podcasts);
}
void PodcastService::CurrentSongChanged(const Song& metadata) {

View File

@ -1731,7 +1731,7 @@ void MainWindow::PlaylistUndoRedoChanged(QAction *undo, QAction *redo) {
void MainWindow::ShowLibraryConfig() {
EnsureSettingsDialogCreated();
settings_dialog_->OpenAtPage(SettingsDialog::Page::Library);
settings_dialog_->OpenAtPage(SettingsDialog::Page_Library);
}
void MainWindow::TaskCountChanged(int count) {
@ -2058,7 +2058,7 @@ void MainWindow::AddSongInfoGenerator(smart_playlists::GeneratorPtr gen) {
}
void MainWindow::ShowSongInfoConfig() {
OpenSettingsDialogAtPage(SettingsDialog::Page::SongInformation);
OpenSettingsDialogAtPage(SettingsDialog::Page_SongInformation);
}
void MainWindow::PlaylistViewSelectionModelChanged() {

View File

@ -125,58 +125,58 @@ SettingsDialog::SettingsDialog(Application* app, BackgroundStreams* streams, QWi
QTreeWidgetItem* general = AddCategory(tr("General"));
AddPage(Page::Playback, new PlaybackSettingsPage(this), general);
AddPage(Page::Behaviour, new BehaviourSettingsPage(this), general);
AddPage(Page::Library, new LibrarySettingsPage(this), general);
AddPage(Page::Proxy, new NetworkProxySettingsPage(this), general);
AddPage(Page::Transcoding, new TranscoderSettingsPage(this), general);
AddPage(Page_Playback, new PlaybackSettingsPage(this), general);
AddPage(Page_Behaviour, new BehaviourSettingsPage(this), general);
AddPage(Page_Library, new LibrarySettingsPage(this), general);
AddPage(Page_Proxy, new NetworkProxySettingsPage(this), general);
AddPage(Page_Transcoding, new TranscoderSettingsPage(this), general);
#ifdef HAVE_WIIMOTEDEV
AddPage(Page::Wiimotedev, new WiimoteSettingsPage(this), general);
AddPage(Page_Wiimotedev, new WiimoteSettingsPage(this), general);
#endif
// User interface
QTreeWidgetItem* iface = AddCategory(tr("User interface"));
AddPage(Page::GlobalShortcuts, new GlobalShortcutsSettingsPage(this), iface);
AddPage(Page::GlobalSearch, new GlobalSearchSettingsPage(this), iface);
AddPage(Page::Appearance, new AppearanceSettingsPage(this), iface);
AddPage(Page::SongInformation, new SongInfoSettingsPage(this), iface);
AddPage(Page::Notifications, new NotificationsSettingsPage(this), iface);
AddPage(Page_GlobalShortcuts, new GlobalShortcutsSettingsPage(this), iface);
AddPage(Page_GlobalSearch, new GlobalSearchSettingsPage(this), iface);
AddPage(Page_Appearance, new AppearanceSettingsPage(this), iface);
AddPage(Page_SongInformation, new SongInfoSettingsPage(this), iface);
AddPage(Page_Notifications, new NotificationsSettingsPage(this), iface);
// Internet providers
QTreeWidgetItem* providers = AddCategory(tr("Internet providers"));
#ifdef HAVE_LIBLASTFM
AddPage(Page::Lastfm, new LastFMSettingsPage(this), providers);
AddPage(Page_Lastfm, new LastFMSettingsPage(this), providers);
#endif
AddPage(Page::Grooveshark, new GroovesharkSettingsPage(this), providers);
AddPage(Page_Grooveshark, new GroovesharkSettingsPage(this), providers);
#ifdef HAVE_GOOGLE_DRIVE
AddPage(Page::GoogleDrive, new GoogleDriveSettingsPage(this), providers);
AddPage(Page_GoogleDrive, new GoogleDriveSettingsPage(this), providers);
#endif
#ifdef HAVE_UBUNTU_ONE
AddPage(Page::UbuntuOne, new UbuntuOneSettingsPage(this), providers);
AddPage(Page_UbuntuOne, new UbuntuOneSettingsPage(this), providers);
#endif
#ifdef HAVE_DROPBOX
AddPage(Page::Dropbox, new DropboxSettingsPage(this), providers);
AddPage(Page_Dropbox, new DropboxSettingsPage(this), providers);
#endif
#ifdef HAVE_SPOTIFY
AddPage(Page::Spotify, new SpotifySettingsPage(this), providers);
AddPage(Page_Spotify, new SpotifySettingsPage(this), providers);
#endif
AddPage(Page::Magnatune, new MagnatuneSettingsPage(this), providers);
AddPage(Page::DigitallyImported, new DigitallyImportedSettingsPage(this), providers);
AddPage(Page::BackgroundStreams, new BackgroundStreamsSettingsPage(this), providers);
AddPage(Page::Podcasts, new PodcastSettingsPage(this), providers);
AddPage(Page_Magnatune, new MagnatuneSettingsPage(this), providers);
AddPage(Page_DigitallyImported, new DigitallyImportedSettingsPage(this), providers);
AddPage(Page_BackgroundStreams, new BackgroundStreamsSettingsPage(this), providers);
AddPage(Page_Podcasts, new PodcastSettingsPage(this), providers);
// List box
connect(ui_->list, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),
SLOT(CurrentItemChanged(QTreeWidgetItem*)));
ui_->list->setCurrentItem(pages_[Page::Playback].item_);
ui_->list->setCurrentItem(pages_[Page_Playback].item_);
// Make sure the list is big enough to show all the items
ui_->list->setMinimumWidth(static_cast<QAbstractItemView*>(ui_->list)->sizeHintForColumn(0));

View File

@ -56,29 +56,29 @@ public:
SettingsDialog(Application* app, BackgroundStreams* streams, QWidget* parent = 0);
~SettingsDialog();
enum class Page {
Playback,
Behaviour,
SongInformation,
GlobalShortcuts,
GlobalSearch,
Appearance,
Notifications,
Library,
Lastfm,
Grooveshark,
Spotify,
Magnatune,
DigitallyImported,
BackgroundStreams,
Proxy,
Transcoding,
Remote,
Wiimotedev,
Podcasts,
GoogleDrive,
UbuntuOne,
Dropbox,
enum Page {
Page_Playback,
Page_Behaviour,
Page_SongInformation,
Page_GlobalShortcuts,
Page_GlobalSearch,
Page_Appearance,
Page_Notifications,
Page_Library,
Page_Lastfm,
Page_Grooveshark,
Page_Spotify,
Page_Magnatune,
Page_DigitallyImported,
Page_BackgroundStreams,
Page_Proxy,
Page_Transcoding,
Page_Remote,
Page_Wiimotedev,
Page_Podcasts,
Page_GoogleDrive,
Page_UbuntuOne,
Page_Dropbox,
};
enum Role {