//
// 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
//
#ifndef __LABEL_MENU_H__
#define __LABEL_MENU_H__
#include "Label.h"
#include "WidgetID.h"
#include <qlistview.h>
#include <qpopupmenu.h>
class Label;
class LabelTable;
class QButtonGroup;
class QRadioButton;
class LabelMenu : public QPopupMenu
{
Q_OBJECT
public:
LabelMenu( QWidget* parent = 0, const char* name = 0 );
virtual ~LabelMenu();
void setListView( LabelTable* view );
typedef void (LabelMenu::*LabelMenuFuncPtr) ();
signals:
void showLabels( WidgetId id );
public slots:
void slotViewLabels();
void slotSetDefaultDNDAction( int );
void slotShowDragAndDropMenu();
void slotAddRepalceFilesListedInLabel();
void slotFilteredLabelsFromSelectedFiles();
void slotUnfilteredLabels();
void slotSyncSpecifiedFilesInLabelToClient();
void slotDeleteSomeFilesListedInLabel();
void slotAddReplaceFilesListedInLabel();
void slotListFilesAtLabel();
void slotCreateOrUpdateLabelFromTemplate();
void slotDelete();
void slotDescribe();
void slotEditSpec();
void slotNew();
private:
void addDNDDefaultButton( const QString name );
void _viewLabels();
private:
QPopupMenu* _defaultDNDAction;
QButtonGroup* _dndDefaultActions;
QRadioButton* _addReplace;
QRadioButton* _delete;
QRadioButton* _sync;
QRadioButton* _filter;
QRadioButton* _show;
LabelTable* _myView;
};
//========================================================================
// The Widget to display the users.
//
class LabelTable : public QListView
{
public:
LabelTable( QWidget* parent = 0, const char* name = 0 );
void addLabel( const Perforce::Label* l );
};
#endif