Beispiel #1
0
void SavedRadio::ShowContextMenu(const QPoint& global_pos) {
  if (!context_menu_) {
    context_menu_ = new QMenu;
    context_menu_->addActions(GetPlaylistActions());
    remove_action_ = context_menu_->addAction(
        IconLoader::Load("list-remove", IconLoader::Base), tr("Remove"), 
        this, SLOT(Remove()));
    edit_action_ = context_menu_->addAction(IconLoader::Load("edit-rename", 
                                            IconLoader::Base), tr("Edit..."), 
                                            this, SLOT(Edit()));
    context_menu_->addSeparator();
    context_menu_->addAction(IconLoader::Load("document-open-remote", 
                             IconLoader::Base), tr("Add another stream..."), 
                             this, SIGNAL(ShowAddStreamDialog()));
  }

  const bool is_root =
      model()->current_index().data(InternetModel::Role_Type).toInt() ==
      InternetModel::Type_Service;

  GetAppendToPlaylistAction()->setEnabled(!is_root);
  GetReplacePlaylistAction()->setEnabled(!is_root);
  GetOpenInNewPlaylistAction()->setEnabled(!is_root);
  remove_action_->setEnabled(!is_root);
  edit_action_->setEnabled(!is_root);

  context_menu_->popup(global_pos);
}
Beispiel #2
0
void SubsonicService::ShowContextMenu(const QPoint& global_pos) {
  const bool is_valid = model()->current_index().model() == library_sort_model_;

  GetAppendToPlaylistAction()->setEnabled(is_valid);
  GetReplacePlaylistAction()->setEnabled(is_valid);
  GetOpenInNewPlaylistAction()->setEnabled(is_valid);
  context_menu_->popup(global_pos);
}
Beispiel #3
0
void MagnatuneService::ShowContextMenu(const QPoint& global_pos) {
  EnsureMenuCreated();

  const bool is_valid = model()->current_index().model() == library_sort_model_;

  GetAppendToPlaylistAction()->setEnabled(is_valid);
  GetReplacePlaylistAction()->setEnabled(is_valid);
  GetOpenInNewPlaylistAction()->setEnabled(is_valid);
  download_->setEnabled(is_valid && membership_ == Membership_Download);
  context_menu_->popup(global_pos);
}