// // 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 "JobMenu.h" #include "ImageManager.h" #include "P4Process.h" #include "ServerThread.h" #include "todo.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// JobMenu::JobMenu( 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( "Filter", this, SLOT(slotFilter()) ); insertItem( "Clear Filter", this, SLOT(slotClearFilter()), CTRL+Key_J ); insertSeparator(); insertItem( "Set job list Column", this, SLOT(slotSetJobListColumn()) ); insertItem( "View Jobs", this, SLOT(slotViewJobs()) ); } JobMenu::~JobMenu() { } void JobMenu::setListView( JobTable* t ) { ASSERT( t != NULL ); _joblistTable = t; } void JobMenu::slotNew() { TODO(); } void JobMenu::slotEditSpec() { TODO(); } void JobMenu::slotDescribe() { TODO(); } void JobMenu::slotDelete() { TODO(); } void JobMenu::slotFilter() { TODO(); } void JobMenu::slotClearFilter() { TODO(); } void JobMenu::slotSetJobListColumn() { TODO(); } void JobMenu::slotViewJobs() { ServerThread< JobMenu, JobMenuFuncPtr >* t = new ServerThread< JobMenu, JobMenuFuncPtr >( this, &JobMenu::_viewJobs ); } void JobMenu::_viewJobs() { ASSERT( _joblistTable != NULL ); _joblistTable->clear(); Perforce::Job* j; Perforce::JobList jobs = Perforce::Job::getJobs(); for (j = jobs.first(); j != NULL; j = jobs.next()) { _joblistTable->addJob( j ); } emit showJobs( JOBS_TABLE ); } JobTable::JobTable( QWidget* parent, const char* name ) : QListView( parent, name ) { setSelectionMode( Single ); setAllColumnsShowFocus( true ); setSorting( 0, false ); addColumn( "Job" ); addColumn( "Status" ); addColumn( "Reported By" ); addColumn( "Reported Date" ); addColumn( "Description" ); } void JobTable::addJob( const Perforce::Job* j ) { ASSERT( j != NULL ); QListViewItem* item = new QListViewItem( this, j->getName(), j->getStatus(), j->getReportedBy(), j->getReportDate().toString(), j->getDescription() ); item->setPixmap( 0, ImageManager::getInstance()->getPixmap("job.png") ); }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#5 | 2152 | Jacob Gladish | Added a couple more images, and non-blocking server communication | ||
#4 | 2118 | Jacob Gladish | changed server interface to use perforce c++ api instead of p4 command. | ||
#3 | 2103 | Jacob Gladish | Added Job table | ||
#2 | 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. |
||
#1 | 2092 | Jacob Gladish | Importing initial code |