// // 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 // // TODO: find legit copyright. // #include "ChangeListMenu.h" #include "ImageManager.h" #include "P4Process.h" #include "SubmittedChangeList.h" #include "todo.h" #include "WidgetId.h" #define ADD_BUTTON_TO_GROUP( B, G, POPUP )\ G->insert(B);\ POPUP->insertItem(B); ChangeListMenu::ChangeListMenu( 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( "Describe Changelist...", this, SLOT(slotDescribeChangeList()) ); insertItem( "Delete", this, SLOT(slotDelete()) ); insertItem( "Submit...", this, SLOT(slotSubmit()) ); insertSeparator(); insertItem( "Add Job Fix...", this, SLOT(slotAddJobFix()) ); insertItem( "Describe Job Fix...", this, SLOT(slotDescribeJobFix()) ); insertItem( "Remove Job Fix", this, SLOT(slotRemoveJobFix()) ); insertItem( "Revert Unchanged Files", this, SLOT(slotRevertUnchangedFiles()) ); insertItem( "Sync to Changelist...", this, SLOT(slotSyncToChangeList()) ); // TODO: make sub-men insertItem( "Integrate", this, SLOT(slotIntegrate()) ); insertSeparator(); insertItem( "Sort Files in Pending Changelists by Extension", this, SLOT(slotSortFilesInPendingChangelistsByExtension()) ); insertItem( "Sort Changes by User", this, SLOT(slotSortChangesByUser()) ); insertSeparator(); //====================================================================== // filter checkboxes // _unfilteredSubmittedChangelistsId = insertItem( "Unfiltered Submitted Changelists" ); _ids[0] = _unfilteredSubmittedChangelistsId; setItemChecked( _ids[0], true ); _fscForSelectedFilesId = insertItem( "Filtered Submitted Changelists for Selected Files" ); _ids[1] = _fscForSelectedFilesId; _fscForSelectedFilesIncludingIntegrationsId = insertItem( "Filtered Submitted Changelists for Selected Files, including Integrations" ); _ids[2] = _fscForSelectedFilesIncludingIntegrationsId; _fscByClientId = insertItem( "Filtered Submitted Changelists by Client..." ); _ids[3] = _fscByClientId; _fscByUserId = insertItem( "Filtered Submitted Changelists by User..." ); _ids[4] = _fscByUserId; QObject::connect( this, SIGNAL(activated(int)), this, SLOT(slotActivated(int)) ); //====================================================================== insertSeparator(); insertItem( "View Pending Changelists", this, SLOT(slotViewPendingChangelists()) ); insertItem( ImageManager::getInstance()->getPixmap("delta.png"), "View Submitted Changelists", this, SLOT(slotViewSubmittedChangelists()) ); } ChangeListMenu::~ChangeListMenu() { } void ChangeListMenu::slotNew() { TODO(); } void ChangeListMenu::slotEditSpec() { TODO(); } void ChangeListMenu::slotDescribe() { TODO(); } void ChangeListMenu::slotDescribeChangeList() { TODO(); } void ChangeListMenu::slotDelete() { TODO(); } void ChangeListMenu::slotSubmit() { TODO(); } void ChangeListMenu::slotAddJobFix() { TODO(); } void ChangeListMenu::slotDescribeJobFix() { TODO(); } void ChangeListMenu::slotRemoveJobFix() { TODO(); } void ChangeListMenu::slotRevertUnchangedFiles() { TODO(); } void ChangeListMenu::slotSyncToChangeList() { TODO(); } void ChangeListMenu::slotIntegrate() { TODO(); } void ChangeListMenu::slotSortFilesInPendingChangelistsByExtension() { TODO(); } void ChangeListMenu::slotSortChangesByUser() { TODO(); } void ChangeListMenu::slotActivated( int id ) { bool b = false; for (int i = 0; i < 5; ++i) { if (_ids[i] == id) { b = true; } } if (b) { for (int i = 0; i < 5; ++i) { setItemChecked( _ids[i], (_ids[i] == id) ); } } } void ChangeListMenu::slotViewPendingChangelists() { TODO(); } void ChangeListMenu::slotViewSubmittedChangelists() { ASSERT( _submittedChangeListsTable != NULL ); _submittedChangeListsTable->clear(); Perforce::SubmittedChangeList* c; Perforce::SubmittedChangeListList changes = Perforce::SubmittedChangeList::getSubmittedChangeLists(); for (c = changes.first(); c != NULL; c = changes.next()) { _submittedChangeListsTable->addSubmittedChangeList( c ); } emit showSubmittedChangeLists( SUBMITTED_CHANGELISTS_TABLE ); } void ChangeListMenu::setSubmittedChangeListsView( SubmittedChangeListsTable* t ) { ASSERT( t != NULL ); this->_submittedChangeListsTable = t; } SubmittedChangeListsTable::SubmittedChangeListsTable( QWidget* parent, const char* name ) : QListView( parent, name ) { setSelectionMode( Single ); setAllColumnsShowFocus ( true ); setSorting( 0, false ); addColumn( "Changelist" ); addColumn( "Date" ); addColumn( "User" ); addColumn( "Description" ); } void SubmittedChangeListsTable::addSubmittedChangeList( const Perforce::SubmittedChangeList* scl ) { ASSERT( scl != NULL ); // qDebug( "Adding user to view: %s", u->getUserName().latin1() ); QString listNumber; listNumber.setNum( scl->getChangeListNumber() ); QListViewItem* item = new QListViewItem( this, listNumber, scl->getDate().toString(), scl->getUser(), scl->getDescription() ); item->setPixmap( 0, ImageManager::getInstance()->getPixmap("delta.png") ); }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#10 | 2190 | Jacob Gladish | Added more functionality to the DepotView tree | ||
#9 | 2152 | Jacob Gladish | Added a couple more images, and non-blocking server communication | ||
#8 | 2147 | Jacob Gladish | Added more functionality to the pending changes list, and added asynchronous access to the server. | ||
#7 | 2145 | Jacob Gladish | Added PendingChanges listview | ||
#6 | 2128 | Jacob Gladish | Renamed changelist to change | ||
#5 | 2118 | Jacob Gladish | changed server interface to use perforce c++ api instead of p4 command. | ||
#4 | 2100 | Jacob Gladish | Adding more menu's, tables, and a few icons. | ||
#3 | 2098 | Jacob Gladish |
changed the IUpdateable abstract class to be a template. The template parameter is the structure that backs the storage for the class. |
||
#2 | 2095 | Jacob Gladish | Added ability to view submitted changelists. | ||
#1 | 2094 | Jacob Gladish | Added the Changelist menu |