//
// 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
//
#include "FileMenu.h"
#include "ConfigOptions.h"
#include "error.h"
#include "todo.h"
#include <qApplication.h>
#include <qpixmap.h>
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
FileMenu::FileMenu( QWidget* parent, const char* name ) :
QPopupMenu( parent, name )
{
insertItem( "Add to Source Control...", this, SLOT(slotAddToSourceControl()) );
//===================================================================
// Sync-> submenu
//
_sync = new QPopupMenu();
CHECK_PTR( _sync );
_sync->insertItem( "Sync To Head Revision", this,
SLOT(slotSyncToHeadRevision()) );
_sync->insertItem( "Sync To Head Revision (Preview Only)", this,
SLOT(slotSyncToHeadRevisionPreviewOnly()) );
_sync->insertItem( "Sync To Revision, Label, Changelist Number or Date...",
this, SLOT(slotSyncTORevisionLabelChangeListNumberOrDate()) );
_sync->insertItem( "Redo Sync", this, SLOT(slotRedoSync()) );
insertItem( "Sync", _sync );
insertItem( "Open for Edit", this, SLOT(slotOpenForEdit()) );
insertItem( "Change Type...", this, SLOT(slotChangeType()) );
insertSeparator();
insertItem( "Open for Delete", this, SLOT(slotOpenForDelete()), CTRL+Key_D );
insertItem( "Remove from Client", this, SLOT(slotRemoveFromClient()) );
insertItem( "Recover Deleted File", this, SLOT(slotRecoverDeletedFile()) );
insertItem( "Revert", this, SLOT(slotRevert()), CTRL+Key_R );
insertSeparator();
insertItem( "Lock", this, SLOT(slotLock()), CTRL+Key_L );
insertItem( "Unlock", this, SLOT(slotUnlock()), CTRL+Key_U );
insertSeparator();
insertItem( "View File...", this, SLOT(slotViewFile()) );
insertItem( "Associated Editor", this, SLOT(slotAssociatedEditor()) );
insertSeparator();
insertItem( "Diff Client File vs Depot File", this,
SLOT(slotDiffClientFileVSDepotFile()) );
insertItem( "Add Files to Client View...", this,
SLOT(slotAddFilesToClientView()) );
insertItem( "Add Files to User Reviews...", this,
SLOT(slotAddFilesToUserReviews()) );
insertItem( "Check Consistency", this, SLOT(slotCheckConsistency()) );
insertItem( "Properties...", this, SLOT(slotProperties()) );
insertItem( "Revision History", this, SLOT(slotRevisionHistory()), CTRL+Key_H);
insertSeparator();
_integrate = new QPopupMenu();
CHECK_PTR( _integrate );
_integrate->insertItem( "Using Filespec...", this,
SLOT(slotIntegrateUsingFilespec()) );
_integrate->insertItem( "Using Branchspec...", this,
SLOT(slotIntegrateUsingBranchspec()) );
insertItem( "Integrate", _integrate );
_resolve = new QPopupMenu();
CHECK_PTR( _resolve );
_resolve->insertItem( "Interactively...", this,
SLOT(slotResolveInteractively()) );
_resolve->insertItem( "Auto-Resolve", this,
SLOT(slotResolveAutoResolve()) );
_resolve->insertItem( "Schedule File For Resolve", this,
SLOT(slotScheduleFileForResolve()) );
insertItem( "Resolve", _resolve );
insertSeparator();
insertItem( "Page Setup...", this, SLOT(slotPageSetup()) );
insertItem( "Explore...", this, SLOT(slotExplore()) );
QString f = ConfigOptions::getInstance()->getImageDir() + "/terminal.png";
insertItem( QPixmap(f), "Command Prompt...", this, SLOT(slotCommandPrompt()) );
insertItem( "Exit", this, SLOT(slotExit()) );
}
FileMenu::~FileMenu()
{
}
void FileMenu::slotAddToSourceControl()
{
TODO();
}
void FileMenu::slotCommandPrompt()
{
_runner.spawnConsole();
}
void FileMenu::slotExit()
{
// TODO();
QApplication::exit();
}
void FileMenu::slotOpenForEdit()
{
TODO();
}
void FileMenu::slotChangeType()
{
TODO();
}
void FileMenu::slotOpenForDelete()
{
TODO();
}
void FileMenu::slotRemoveFromClient()
{
TODO();
}
void FileMenu::slotRecoverDeletedFile()
{
TODO();
}
void FileMenu::slotRevert()
{
TODO();
}
void FileMenu::slotLock()
{
TODO();
}
void FileMenu::slotUnlock()
{
TODO();
}
void FileMenu::slotViewFile()
{
TODO();
}
void FileMenu::slotAssociatedEditor()
{
TODO();
}
void FileMenu::slotPageSetup()
{
TODO();
}
void FileMenu::slotExplore()
{
TODO();
}
void FileMenu::slotDiffClientFileVSDepotFile()
{
TODO();
}
void FileMenu::slotAddFilesToClientView()
{
TODO();
}
void FileMenu::slotAddFilesToUserReviews()
{
TODO();
}
void FileMenu::slotCheckConsistency()
{
TODO();
}
void FileMenu::slotProperties()
{
TODO();
}
void FileMenu::slotRevisionHistory()
{
TODO();
}
void FileMenu::slotIntegrateUsingFilespec()
{
TODO();
}
void FileMenu::slotIntegrateUsingBranchspec()
{
TODO();
}
void FileMenu::slotResolveInteractively()
{
TODO();
}
void FileMenu::slotResolveAutoResolve()
{
TODO();
}
void FileMenu::slotScheduleFileForResolve()
{
TODO();
}
void FileMenu::slotSyncToHeadRevision()
{
TODO();
}
void FileMenu::slotSyncToHeadRevisionPreviewOnly()
{
TODO();
}
void FileMenu::slotSyncTORevisionLabelChangeListNumberOrDate()
{
TODO();
}
void FileMenu::slotRedoSync()
{
TODO();
}
void FileMenu::Runner::spawnConsole()
{
Error err;
#ifdef WIN32
// RunCmd( "start", "cmd", "", "", "", "", &err );
qDebug( "Start console window." );
#endif
}