//
// 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 "FileMenu.h"
#include "ConfigOptions.h"
#include "todo.h"
#ifdef WIN32
#include <process.h>
#endif
#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()
{
delete _sync;
delete _integrate;
delete _resolve;
}
void FileMenu::slotAddToSourceControl()
{
TODO();
}
void FileMenu::slotCommandPrompt()
{
// TODO();
#if 0
#ifdef WIN32
system ("start /b cmd");
#endif
#endif
}
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();
}