//
// QPerforce is a gui interface to the perforce revision control
// system. It is based on the qt library, and should be easily portable
// across any platform that has this toolkit available.
//
// Copyright (C) 2002 Jacob Gladish
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
#include "LabelMenu.h"
#include "todo.h"
#include <qradiobutton.h>
#include <qbuttongroup.h>
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
#define ADD_BUTTON_TO_GROUP( B, G, POPUP )\
G->insert(B);\
POPUP->insertItem(B);
LabelMenu::LabelMenu( QWidget* parent, const char* name ) :
QPopupMenu( parent, name )
{
insertItem( "New...", this, SLOT(slotNew()) );
insertItem( "Edit Spec...", this, SLOT(slotEditSpec()) );
insertItem( "Describe...", this, SLOT(slotDescribe()) );
insertItem( "Delete", this, SLOT(slotDelete()) );
insertSeparator();
insertItem( "Create or Update Label from Template", this,
SLOT(slotCreateOrUpdateLabelFromTemplate()) );
insertSeparator();
insertItem( "List Files at Label", this, SLOT(slotListFilesAtLabel()) );
insertItem( "Add/Replace Files Listed in Label...", this,
SLOT(slotAddReplaceFilesListedInLabel()) );
insertItem( "Delete Some Files Listed in Label...", this,
SLOT(slotDeleteSomeFilesListedInLabel()) );
insertItem( "Sync Specified Files in Label to Client...", this,
SLOT(slotSyncSpecifiedFilesInLabelToClient()) );
insertSeparator();
// TODO make radio buttons
insertItem( "Unfiltered Labels", this, SLOT(slotUnfilteredLabels()) );
insertItem( "Filetered Labels for Selected Files", this,
SLOT(slotFilteredLabelsFromSelectedFiles()) );
insertSeparator();
//======================================================================
// Select the default action for DND. Radio Buttons...
//
_defaultDNDAction = new QPopupMenu();
_dndDefaultActions = new QButtonGroup( _defaultDNDAction );
QObject::connect( _dndDefaultActions, SIGNAL(clicked(int)),
this, SLOT(slotSetDefaultDNDAction(int)) );
_addReplace = new QRadioButton( "Add/Replace Files Listed in Label",
_dndDefaultActions );
ADD_BUTTON_TO_GROUP( _addReplace, _dndDefaultActions, _defaultDNDAction );
_delete = new QRadioButton( "Delete Some Files Listed in Label",
_dndDefaultActions );
ADD_BUTTON_TO_GROUP( _delete, _dndDefaultActions, _defaultDNDAction );
_sync = new QRadioButton( "Sycn Specified Files in Label to Client",
_dndDefaultActions );
ADD_BUTTON_TO_GROUP( _sync, _dndDefaultActions, _defaultDNDAction );
_filter = new QRadioButton( "Filter Labels For Selected Files",
_dndDefaultActions );
ADD_BUTTON_TO_GROUP( _filter, _dndDefaultActions, _defaultDNDAction );
_show = new QRadioButton( "Show Drag ang Drop Menu", _dndDefaultActions );
ADD_BUTTON_TO_GROUP( _show, _dndDefaultActions, _defaultDNDAction );
insertItem( "Default drag and drop action", _defaultDNDAction );
//======================================================================
insertItem( "View Labels", this, SLOT(slotViewLabels()) );
}
LabelMenu::~LabelMenu()
{
delete _defaultDNDAction;
_defaultDNDAction = NULL;
delete _dndDefaultActions;
_dndDefaultActions = NULL;
delete _addReplace;
_addReplace = NULL;
delete _delete;
_delete = NULL;
delete _sync;
_sync = NULL;
delete _filter;
_filter = NULL;
delete _show;
_show = NULL;
}
void LabelMenu::slotNew()
{
TODO();
}
void LabelMenu::slotEditSpec()
{
TODO();
}
void LabelMenu::slotDescribe()
{
TODO();
}
void LabelMenu::slotDelete()
{
TODO();
}
void LabelMenu::slotCreateOrUpdateLabelFromTemplate()
{
TODO();
}
void LabelMenu::slotListFilesAtLabel()
{
TODO();
}
void LabelMenu::slotAddReplaceFilesListedInLabel()
{
TODO();
}
void LabelMenu::slotDeleteSomeFilesListedInLabel()
{
TODO();
}
void LabelMenu::slotSyncSpecifiedFilesInLabelToClient()
{
TODO();
}
void LabelMenu::slotUnfilteredLabels()
{
TODO();
}
void LabelMenu::slotFilteredLabelsFromSelectedFiles()
{
TODO();
}
void LabelMenu::slotAddRepalceFilesListedInLabel()
{
TODO();
}
void LabelMenu::slotShowDragAndDropMenu()
{
TODO();
}
void LabelMenu::slotSetDefaultDNDAction( int n )
{
qDebug( "New Drag-N-Drop action selected: %d.", n );
TODO();
}
void LabelMenu::slotViewLabels()
{
TODO();
}