/[projects]/queensgui/src/queensmain.cpp
ViewVC logotype

Diff of /queensgui/src/queensmain.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 12 by torben, Fri Jul 20 17:03:41 2007 UTC revision 13 by torben, Sun Jul 22 20:19:43 2007 UTC
# Line 40  Line 40 
40  #include "containerlist.h"  #include "containerlist.h"
41  #include "containerhash.h"  #include "containerhash.h"
42  #include "containermnvector.h"  #include "containermnvector.h"
43    #include "containerminimalvector.h"
44    
45  #include "config.h"  #include "config.h"
46    
# Line 167  void QueensMain::start() Line 168  void QueensMain::start()
168              case SortMNVector:              case SortMNVector:
169                      m_solutions = new ContainerMNVector(this);                      m_solutions = new ContainerMNVector(this);
170                      break;                      break;
171                    case SortMinimalVector:
172                            m_solutions = new ContainerMinimalVector(this);
173                            break;
174      }      }
175                    
176          if (m_sol != NULL)          if (m_sol != NULL)
# Line 293  void QueensMain::contextMenuEvent( QCont Line 297  void QueensMain::contextMenuEvent( QCont
297          contextMenu->insertItem("Vector", this, SLOT( sortVector() ), 0, 2);          contextMenu->insertItem("Vector", this, SLOT( sortVector() ), 0, 2);
298          contextMenu->insertItem("Hash", this, SLOT( sortHash() ), 0, 3);          contextMenu->insertItem("Hash", this, SLOT( sortHash() ), 0, 3);
299          contextMenu->insertItem("M*N Vector", this, SLOT(sortMNVector()), 0, 4);          contextMenu->insertItem("M*N Vector", this, SLOT(sortMNVector()), 0, 4);
300            contextMenu->insertItem("Minimal Vector", this, SLOT(sortMinimalVector()), 0, 5);
301                    
302          QLabel *storageCaption = new QLabel("<b><i>Solution class</i></b>", this);          QLabel *storageCaption = new QLabel("<b><i>Solution class</i></b>", this);
303          storageCaption->setAlignment( Qt::AlignCenter );          storageCaption->setAlignment( Qt::AlignCenter );
304          contextMenu->insertItem( storageCaption );          contextMenu->insertItem( storageCaption );
305          contextMenu->insertItem("Matrix Solution", this, SLOT( storageMatrix() ), 0, 5);          contextMenu->insertItem("Matrix Solution", this, SLOT( storageMatrix() ), 0, 6);
306          contextMenu->insertItem("Int Solution", this, SLOT( storageInt() ), 0, 6);          contextMenu->insertItem("Int Solution", this, SLOT( storageInt() ), 0, 7);
307    
308    
309          switch (m_sortalgo) {          switch (m_sortalgo) {
# Line 314  void QueensMain::contextMenuEvent( QCont Line 319  void QueensMain::contextMenuEvent( QCont
319                  case SortMNVector:                  case SortMNVector:
320                          contextMenu->setItemChecked( 4, true);                          contextMenu->setItemChecked( 4, true);
321                          break;                          break;
322                    case SortMinimalVector:
323                            contextMenu->setItemChecked( 5, true);
324                            break;
325          }                }      
326                    
327          switch (m_storage) {          switch (m_storage) {
328                  case StorageMatrix:                  case StorageMatrix:
329                          contextMenu->setItemChecked(5, true);                          contextMenu->setItemChecked(6, true);
330                          break;                          break;
331                  case StorageInt:                  case StorageInt:
332                          contextMenu->setItemChecked(6, true);                          contextMenu->setItemChecked(7, true);
333                          break;                          break;
334          }          }
335    
# Line 362  void QueensMain::sortMNVector() Line 370  void QueensMain::sortMNVector()
370          m_sortalgo = SortMNVector;          m_sortalgo = SortMNVector;
371  }  }
372    
373    void QueensMain::sortMinimalVector()
374    {
375            m_sortalgo = SortMinimalVector;
376    }
377    
378    
379  void QueensMain::storageInt()  void QueensMain::storageInt()
380  {  {
381          m_storage = StorageInt;          m_storage = StorageInt;
# Line 373  void QueensMain::storageMatrix() Line 387  void QueensMain::storageMatrix()
387  }  }
388    
389    
390    

Legend:
Removed from v.12  
changed lines
  Added in v.13

  ViewVC Help
Powered by ViewVC 1.1.20