Bug fixes, new panel
[pierogi] / pirselectkeysetform.cpp
index 37ff54c..67c9e61 100644 (file)
@@ -1,16 +1,15 @@
 #include "pirselectkeysetform.h"
 #include "ui_pirselectkeysetform.h"
 #include "pirkeysetwidgetitem.h"
+#include <QListWidget>
 
 extern PIRMakeMgr makeManager;
-extern PIRDeviceTypeMgr deviceManager;
 
 PIRSelectKeysetForm::PIRSelectKeysetForm(
   QWidget *parent)
   : QWidget(parent),
     ui(new Ui::PIRSelectKeysetForm),
-    currentMake(Any_Make),
-    currentDevice(Any_Device)
+    currentMake(Any_Make)
 {
   ui->setupUi(this);
 
@@ -19,7 +18,6 @@ PIRSelectKeysetForm::PIRSelectKeysetForm(
 
   // push the list of makers into the make combo box:
   makeManager.populateComboBox(ui->makeComboBox);
-  deviceManager.populateComboBox(ui->deviceComboBox);
 
   // Connection telling main window that keyset has been selected:
   connect(
@@ -36,13 +34,6 @@ PIRSelectKeysetForm::PIRSelectKeysetForm(
     this,
     SLOT(filterListByMake(int)),
     Qt::QueuedConnection);
-
-  connect(
-    ui->deviceComboBox,
-    SIGNAL(currentIndexChanged(int)),
-    this,
-    SLOT(filterListByDeviceType(int)),
-    Qt::QueuedConnection);
 }
 
 PIRSelectKeysetForm::~PIRSelectKeysetForm()
@@ -50,6 +41,7 @@ PIRSelectKeysetForm::~PIRSelectKeysetForm()
   delete ui;
 }
 
+/*
 void PIRSelectKeysetForm::addNameToList(
   QString name,
   unsigned int index,
@@ -57,6 +49,13 @@ void PIRSelectKeysetForm::addNameToList(
 {
   ui->keysetListWidget->addItem(new PIRKeysetWidgetItem(name, index, make));
 }
+*/
+
+void PIRSelectKeysetForm::addWidgetItem(
+  PIRKeysetWidgetItem *kwi)
+{
+  ui->keysetListWidget->addItem(kwi);
+}
 
 QListWidget *PIRSelectKeysetForm::getKeysetListWidget()
 {
@@ -70,13 +69,6 @@ void PIRSelectKeysetForm::filterListByMake(
   refilterList();
 }
 
-void PIRSelectKeysetForm::filterListByDeviceType(
-  int deviceType)
-{
-  currentDevice = (PIRDeviceTypeName) deviceType;
-  refilterList();
-}
-
 void PIRSelectKeysetForm::refilterList()
 {
   int index = 0;
@@ -90,17 +82,8 @@ void PIRSelectKeysetForm::refilterList()
     // Does the keylist have the required make?
     if ((currentMake == Any_Make) || (item->getMake() == currentMake))
     {
-      // And, does the keylist have the required device type?
-      if ((currentDevice == Any_Device)
-          || (item->supportsDeviceType(currentDevice)))
-      {
-        // Yes, we can show this keylist:
-        item->setHidden(false);
-      }
-      else
-      {
-        item->setHidden(true);
-      }
+      // Yes, we can show this keylist:
+      item->setHidden(false);
     }
     else
     {