#include "forms/piradjustform.h"
#include "forms/pirairconditionerform.h"
#include "forms/piraudiodeviceform.h"
+#include "forms/pircameraform.h"
#include "forms/pirroombaform.h"
+#include "forms/piruserform.h"
+#include "forms/pirmacroform.h"
+#include "forms/pirpowersearchform.h"
+#include "forms/piradvancedform.h"
#include "mainwindow.h"
// Debugging:
//#include <QMaemo5InformationBox>
-//#include <iostream>
+#include <iostream>
PIRPanelManager::PIRPanelManager(
MainWindow *mw):
adjustForm(0),
acForm(0),
audioDeviceForm(0),
+ cameraForm(0),
roombaForm(0),
+ userForm(0),
+ macroForm(0),
+ powerSearchForm(0),
+ advancedForm(0),
altMainPanelFlag(false),
currentTabsName(Universal_Tabs),
mainWindow(mw)
QSettings settings("pietrzak.org", "Pierogi");
if (settings.contains("currentTabsName"))
{
- currentTabsName = PIRTabBarName(settings.value("currentTabsName").toInt());
+ int tabVal = settings.value("currentTabsName").toInt();
+
+ if (tabVal >= Last_Tabs_Marker)
+ {
+ currentTabsName = Universal_Tabs;
+ }
+ else
+ {
+ currentTabsName = PIRTabBarName(tabVal);
+ }
}
// Set up the panel names:
shortPanelNames[Audio_Panel] = "Audio";
longPanelNames[Audio_Panel] =
"Audio Device Panel - various audio related buttons";
+ shortPanelNames[Camera_Panel] = "Camera";
+ longPanelNames[Camera_Panel] =
+ "Camera Panel - simple shutter controls";
shortPanelNames[Roomba_Panel] = "Roomba";
longPanelNames[Roomba_Panel] =
"Roomba Panel - robotic vacuum cleaner controls";
+ shortPanelNames[User_Panel] = "User";
+ longPanelNames[User_Panel] =
+ "User Panel - macro control buttons";
+ shortPanelNames[Macro_Panel] = "Edit Macro Contents";
+ longPanelNames[Macro_Panel] =
+ "Edit Macros Panel - create, delete, edit, and manage macros";
+ shortPanelNames[PowerSearch_Panel] = "Keyset Search";
+ longPanelNames[PowerSearch_Panel] =
+ "Keyset Search Panel - execute power button in each keyset";
+ shortPanelNames[Advanced_Panel] = "Advanced Settings";
+ longPanelNames[Advanced_Panel] =
+ "Advanced Settings - allows adjustment of protocol settings";
mainForm = new PIRMainForm(mainWindow);
panels[Main_Panel] = mainForm;
audioDeviceForm = new PIRAudioDeviceForm(mainWindow);
panels[Audio_Panel] = audioDeviceForm;
+ cameraForm = new PIRCameraForm(mainWindow);
+ panels[Camera_Panel] = cameraForm;
+
roombaForm = new PIRRoombaForm(mainWindow);
panels[Roomba_Panel] = roombaForm;
+ userForm = new PIRUserForm(mainWindow);
+ panels[User_Panel] = userForm;
+
+ macroForm = new PIRMacroForm(mainWindow);
+ panels[Macro_Panel] = macroForm;
+
+ powerSearchForm = new PIRPowerSearchForm(mainWindow);
+ panels[PowerSearch_Panel] = powerSearchForm;
+
+ advancedForm = new PIRAdvancedForm();
+ panels[Advanced_Panel] = advancedForm;
+
// Set up the panel collections:
PIRPanelNameList pset;
pset.push_back(Keypad_Panel);
pset.push_back(Menu_Panel);
pset.push_back(Media_Panel);
+ pset.push_back(User_Panel);
// pset.push_back(Input_Panel);
tabLists[Universal_Tabs] = pset;
pset.push_back(Keypad_Panel);
pset.push_back(Menu_Panel);
pset.push_back(TV_Panel);
- pset.push_back(Adjust_Panel);
+ pset.push_back(Input_Panel);
tabLists[TV_Tabs] = pset;
// The video media collection:
pset.push_back(Media_Panel);
pset.push_back(Media2_Panel);
pset.push_back(Input_Panel);
+ pset.push_back(Adjust_Panel);
tabLists[VideoMedia_Tabs] = pset;
// Audio panel collection:
pset.push_back(Keypad_Panel);
tabLists[Record_Tabs] = pset;
+ // The camera control collection:
+ pset.clear();
+ pset.push_back(Camera_Panel);
+ tabLists[Camera_Tabs] = pset;
+
// The Roomba collection:
pset.clear();
pset.push_back(Roomba_Panel);
tabLists[Roomba_Tabs] = pset;
+
+ // The Macro Management collection:
+ pset.clear();
+ pset.push_back(Macro_Panel);
+ tabLists[Macro_Tabs] = pset;
+
+ // The Power Search collection:
+ pset.clear();
+ pset.push_back(PowerSearch_Panel);
+ tabLists[PowerSearch_Tabs] = pset;
+
+ // The Advanced Settings collection:
+ pset.clear();
+ pset.push_back(Advanced_Panel);
+ tabLists[Advanced_Tabs] = pset;
}
void PIRPanelManager::enableButtons(
- const PIRKeysetManager *keyset,
+ PIRKeysetManager *keyset,
unsigned int id)
{
mainForm->enableButtons(keyset, id);
void PIRPanelManager::enableButtons(
- const PIRKeysetManager *keyset,
+ PIRKeysetManager *keyset,
unsigned int currentID,
unsigned int defaultID)
{
void PIRPanelManager::commonEnableButtons(
- const PIRKeysetManager *keyset,
+ PIRKeysetManager *keyset,
unsigned int id)
{
utilityForm->enableButtons(keyset, id);
adjustForm->enableButtons(keyset, id);
acForm->enableButtons(keyset, id);
audioDeviceForm->enableButtons(keyset, id);
+ cameraForm->enableButtons(keyset, id);
roombaForm->enableButtons(keyset, id);
+
+ // Also, set the label in the power search form:
+ powerSearchForm->setKeysetName(mainWindow->getCurrentFullName());
+
+ // Set up the advanced parameters:
+ advancedForm->setupForm(keyset, id);
+}
+
+
+void PIRPanelManager::updateUserButtons()
+{
+ userForm->setupButtons();
}
currentTabsName = name;
updateTabSet();
}
+
+
+void PIRPanelManager::gotoPreviousTabs()
+{
+ PIRTabsCollection::const_iterator i = tabLists.find(currentTabsName);
+
+ if (i == tabLists.end())
+ {
+ // Couldn't find currentTabsName! Throw an error here?
+ return;
+ }
+
+ if (i == tabLists.begin())
+ {
+ // Already at first collection, nothing to do:
+ return;
+ }
+
+ --i;
+ currentTabsName = i->first;
+ updateTabSet();
+}
+
+
+void PIRPanelManager::gotoNextTabs()
+{
+ PIRTabsCollection::const_iterator i = tabLists.find(currentTabsName);
+
+ if (i == tabLists.end())
+ {
+ // Couldn't find currentTabsName! Throw an error?
+ return;
+ }
+
+ ++i;
+
+ if (i == tabLists.end())
+ {
+ // We're already at the last collection, nothing to do:
+ return;
+ }
+
+ currentTabsName = i->first;
+ updateTabSet();
+}
+
+
+QComboBox *PIRPanelManager::getKeysetComboBox()
+{
+ return macroForm->getKeysetComboBox();
+}