PlaylistListContainer::PlaylistListContainer(QWidget* parent)
    : QWidget(parent),
      app_(nullptr),
      ui_(new Ui_PlaylistListContainer),
      menu_(nullptr),
      action_new_folder_(new QAction(this)),
      action_remove_(new QAction(this)),
      action_save_playlist_(new QAction(this)),
      model_(new PlaylistListModel(this)),
      proxy_(new PlaylistListSortFilterModel(this)),
      loaded_icons_(false),
      active_playlist_id_(-1) {
  ui_->setupUi(this);
  ui_->tree->setAttribute(Qt::WA_MacShowFocusRect, false);

  action_new_folder_->setText(tr("New folder"));
  action_remove_->setText(tr("Delete"));
  action_save_playlist_->setText(
      tr("Save playlist", "Save playlist menu action."));

  ui_->new_folder->setDefaultAction(action_new_folder_);
  ui_->remove->setDefaultAction(action_remove_);
  ui_->save_playlist->setDefaultAction(action_save_playlist_);

  connect(action_new_folder_, SIGNAL(triggered()), SLOT(NewFolderClicked()));
  connect(action_remove_, SIGNAL(triggered()), SLOT(DeleteClicked()));
  connect(action_save_playlist_, SIGNAL(triggered()), SLOT(SavePlaylist()));
  connect(model_, SIGNAL(PlaylistPathChanged(int, QString)),
          SLOT(PlaylistPathChanged(int, QString)));

  proxy_->setSourceModel(model_);
  proxy_->setDynamicSortFilter(true);
  proxy_->sort(0);
  ui_->tree->setModel(proxy_);

  connect(ui_->tree, SIGNAL(doubleClicked(QModelIndex)),
          SLOT(ItemDoubleClicked(QModelIndex)));

  model_->invisibleRootItem()->setData(PlaylistListModel::Type_Folder,
                                       PlaylistListModel::Role_Type);
}
示例#2
0
void
PlaneListWidget::OnAction(int id)
{
  switch ((Buttons)id) {
  case NEW:
    NewClicked();
    break;

  case EDIT:
    EditClicked();
    break;

  case DELETE:
    DeleteClicked();
    break;

  case LOAD:
    LoadClicked();
    break;
  }
}
示例#3
0
void
ProfileListWidget::OnAction(int id)
{
  switch ((Buttons)id) {
  case NEW:
    NewClicked();
    break;

  case PASSWORD:
    PasswordClicked();
    break;

  case COPY:
    CopyClicked();
    break;

  case DELETE:
    DeleteClicked();
    break;
  }
}
示例#4
0
BOOL GuidesPropertiesTab::HandleMsg(DialogMsg* Msg)
{
TRACEUSER( "Neville", _T("GuidesPropertiesTab::HandleMsg\n"));
	ERROR2IF(Msg == NULL,FALSE,"GuidesPropertiesTab::Message null message received");
	ERROR2IF(pPropertiesDlg == NULL,FALSE,"GuidesPropertiesTab::HandleMsg called with no dialog pointer");

	BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
	if (!ok)
		return TRUE;		// no page present = handled message
	
	switch(Msg->DlgMsg)
	{
		case DIM_CREATE:	// Initialise controls
			GreyStatus = FALSE;	// we are ungreyed by default
			ok = InitSection();
			if (!ok)
				InformError();
			break;
		case DIM_LFT_BN_CLICKED:
			//LayerPropertyTabs::SetApplyNowState(TRUE);
			if (FALSE) {}
			else if (Msg->GadgetID == _R(IDC_GUIDETAB_HORZ))
			{
				if (GuideType != GUIDELINE_HORZ)
				{
					GuideType = GUIDELINE_HORZ;
					ShowDetails();
				}
			}
			else if (Msg->GadgetID == _R(IDC_GUIDETAB_VERT))
			{
				if (GuideType != GUIDELINE_VERT)
				{
					GuideType = GUIDELINE_VERT;
					ShowDetails();
				}
			}
			else if (Msg->GadgetID == _R(IDC_GUIDETAB_PROPERTIES))
			{
				PropertiesClicked();
				ShowDetails();
			}
			else if (Msg->GadgetID == _R(IDC_GUIDETAB_NEW))
			{
				NewClicked();
				ShowDetails();
			}
			else if (Msg->GadgetID == _R(IDC_GUIDETAB_DELETE))
			{	
				DeleteClicked();
				ShowDetails();
			}
			break;

		case DIM_SELECTION_CHANGED:
		case DIM_TEXT_CHANGED:
			//LayerPropertyTabs::SetApplyNowState(TRUE);
			if (FALSE) {}
			else if (Msg->GadgetID == _R(IDC_GUIDETAB_GUIDELINELIST))
			{
				ChangeControlStatus(!GreyStatus);
			}
			else if (Msg->GadgetID == _R(IDC_GUIDETAB_COLOURLIST))
			{
				ColourChanged(pPropertiesDlg->GetSelectedValueIndex(Msg->GadgetID));
				ShowDetails();
			}
			break;
		default:
			break;
	}
	return TRUE;
}  
示例#5
0
void MainFrame::DeleteKeyDown(wxListEvent& event) {
	if (event.GetKeyCode() == WXK_DELETE)
		DeleteClicked(event);
}