summaryrefslogtreecommitdiffstats
path: root/abs/core/mythinstall/MythVantage-app/mythinstall/installationtype.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/mythinstall/MythVantage-app/mythinstall/installationtype.cpp')
-rwxr-xr-xabs/core/mythinstall/MythVantage-app/mythinstall/installationtype.cpp236
1 files changed, 117 insertions, 119 deletions
diff --git a/abs/core/mythinstall/MythVantage-app/mythinstall/installationtype.cpp b/abs/core/mythinstall/MythVantage-app/mythinstall/installationtype.cpp
index cb2e918..93d45ae 100755
--- a/abs/core/mythinstall/MythVantage-app/mythinstall/installationtype.cpp
+++ b/abs/core/mythinstall/MythVantage-app/mythinstall/installationtype.cpp
@@ -31,8 +31,18 @@ int mythinstalltype (QString tmp_install_drive)
setting.Load();
setting.Save();
- if ( setting.exec() == QDialog::Accepted )
- {
+ MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
+ StandardSettingDialog *ssd =
+ new StandardSettingDialog(mainStack, "mythinstalltypesettings",
+ new Mythinstalltype());
+
+ if (ssd->Create())
+ mainStack->AddScreen(ssd);
+ else
+ delete ssd;
+
+ //if ( setting.exec() == QDialog::Accepted )
+ //{
//get users sizes
rootsize = gCoreContext->GetSetting("HOSTOSsize");
homesize = gCoreContext->GetSetting("HOSTHOMEsize");
@@ -74,7 +84,7 @@ int mythinstalltype (QString tmp_install_drive)
file.close();
//convert to MB and match calulation in installdialog.cpp
disksizeMB = qRound(disksize.toFloat() * 1024 / 1000000);
-
+/* FIXME change to mythui
if (neededsize > disksizeMB)
{
DialogCode val = MythPopupBox::Show2ButtonPopup(
@@ -96,79 +106,65 @@ int mythinstalltype (QString tmp_install_drive)
{
retc = 0;
}
- }
- else
- {
- retc = 0;
- }
+*/
}
return retc;
-
};
-static HostComboBox *HOSTinstallationtype()
+static HostComboBoxSetting *HOSTinstallationtype()
{
- HostComboBox *gc = new HostComboBox("HOSTinstallationtype");
+ HostComboBoxSetting *gc = new HostComboBoxSetting("HOSTinstallationtype");
gc->setLabel(QObject::tr("Installation Type"));
gc->addSelection("Full/Auto") ;
-
gc->addSelection("Upgrade");
-
//gc->setValue("Full/Auto");
gc->setHelpText(QObject::tr("Full install will erase the entire drive and repartition. Upgrade will format only the first parition of the drive. Only LinHES R8.0 or newer can use Upgrade."));
-
return gc;
}
-static HostSpinBox *HOSTOSsize()
+static HostSpinBoxSetting *HOSTOSsize()
{
#ifdef __MVAPP__
- HostSpinBox *gc = new HostSpinBox("HOSTOSsize", 2, 15, 1, true);
+ HostSpinBoxSetting *gc = new HostSpinBoxSetting("HOSTOSsize", 2, 15, 1, true);
#else
- HostSpinBox *gc = new HostSpinBox("HOSTOSsize", 3, 25, 1, true);
+ HostSpinBoxSetting *gc = new HostSpinBoxSetting("HOSTOSsize", 3, 25, 1, true);
#endif
- gc->setLabel(QObject::tr("OS size (GB)"));
+ gc->setLabel(QObject::tr("OS Size (GB)"));
gc->setValue(2);
- gc->setHelpText(QObject::tr("Amount of space allocated for the root OS." ));
-
+ gc->setHelpText(QObject::tr("Amount of space allocated for the root OS partition."));
return gc;
}
-static HostSpinBox *HOSTDATAsize()
+static HostSpinBoxSetting *HOSTDATAsize()
{
- HostSpinBox *gc = new HostSpinBox("HOSTDATAsize", 2, 1500, 1, true);
- gc->setLabel(QObject::tr("Data size (GB)"));
+ HostSpinBoxSetting *gc = new HostSpinBoxSetting("HOSTDATAsize", 2, 1500, 1, true);
+ gc->setLabel(QObject::tr("Data Size (GB)"));
gc->setValue(3);
- gc->setHelpText(QObject::tr("" ));
-
+ gc->setHelpText(QObject::tr("Amount of space allocated for the data partiton."));
return gc;
}
-static HostSpinBox *HOSTHOMEsize()
+static HostSpinBoxSetting *HOSTHOMEsize()
{
- HostSpinBox *gc = new HostSpinBox("HOSTHOMEsize", 1, 1500, 1, true);
- gc->setLabel(QObject::tr("Home dir size (GB)"));
+ HostSpinBoxSetting *gc = new HostSpinBoxSetting("HOSTHOMEsize", 1, 1500, 1, true);
+ gc->setLabel(QObject::tr("Home Size (GB)"));
gc->setValue(3);
gc->setHelpText(QObject::tr("Amount of space allocated for the home directories partition. Three to five GB will be sufficient for most people. The home partition will be the same filesystem as the root OS." ));
-
return gc;
}
-static HostSpinBox *HOSTDatabasesize()
+static HostSpinBoxSetting *HOSTDatabasesize()
{
- HostSpinBox *gc = new HostSpinBox("HOSTDatabasesize", 1, 20, 1, true);
- gc->setLabel(QObject::tr("Database partition size (GB)"));
+ HostSpinBoxSetting *gc = new HostSpinBoxSetting("HOSTDatabasesize", 1, 20, 1, true);
+ gc->setLabel(QObject::tr("Database Size (GB)"));
gc->setValue(4);
- gc->setHelpText(QObject::tr("Amount of space allocated for the database partition. Two GB is more then enough for most people. The database partition space will be formatted with the ext3 filesystem." ));
-
+ gc->setHelpText(QObject::tr("Amount of space allocated for the database partition. Two GB is more then enough for most people. The database partition space will be formatted with the ext3 filesystem."));
return gc;
}
-
-
-static HostSpinBox *HOSTSWAPsize()
+static HostSpinBoxSetting *HOSTSWAPsize()
{
QString currentitem;
QString line;
@@ -193,26 +189,25 @@ static HostSpinBox *HOSTSWAPsize()
if ( ! ok )
mem = 257 ;
//QTextStream(stdout) << mem << endl;
- HostSpinBox *gc = new HostSpinBox("HOSTSWAPsize", 256, 256000, 256, true);
- gc->setLabel(QObject::tr("Swapspace size (MB)"));
+ HostSpinBoxSetting *gc = new HostSpinBoxSetting("HOSTSWAPsize", 256, 256000, 256, true);
+ gc->setLabel(QObject::tr("Swap Size (MB)"));
gc->setValue(mem);
gc->setHelpText(QObject::tr("Amount of space allocated for the swap partition." ));
-
return gc;
}
-static HostCheckBox *HostUseSWAP()
+static HostCheckBoxSetting *HostUseSWAP()
{
- HostCheckBox *gc = new HostCheckBox("HostUseSWAP");
- gc->setLabel(QObject::tr("Use swap partition"));
+ HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostUseSWAP");
+ gc->setLabel(QObject::tr("Use Swap"));
gc->setValue(true);
gc->setHelpText(QObject::tr("Enable or disable the swap partition."));
return gc;
};
-static HostCheckBox *HostUseALLdata()
+static HostCheckBoxSetting *HostUseALLdata()
{
- HostCheckBox *gc = new HostCheckBox("HostUseALLdata");
+ HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostUseALLdata");
gc->setLabel(QObject::tr("Use all remaining space for data"));
gc->setValue(true);
gc->setHelpText(QObject::tr("If checked the remaining space on the drive will be used for storage. Otherwise you can set the size of the partition."));
@@ -220,26 +215,24 @@ static HostCheckBox *HostUseALLdata()
};
-static HostComboBox *HOSTdatafstype()
+static HostComboBoxSetting *HOSTdatafstype()
{
- HostComboBox *gc = new HostComboBox("HOSTdatafstype");
- gc->setLabel(QObject::tr("Data filesystem"));
+ HostComboBoxSetting *gc = new HostComboBoxSetting("HOSTdatafstype");
+ gc->setLabel(QObject::tr("Data File System"));
gc->addSelection("ext3") ;
gc->addSelection("ext4") ;
// gc->addSelection("reiserfs");
gc->addSelection("jfs");
gc->addSelection("xfs");
//gc->addSelection("btrfs");
-
- gc->setHelpText(QObject::tr("Filesystem type for data storage."));
-
+ gc->setHelpText(QObject::tr("File system type for data storage."));
return gc;
}
-static HostComboBox *HOSTuprootfstype()
+static HostComboBoxSetting *HOSTuprootfstype()
{
- HostComboBox *gc = new HostComboBox("HOSTuprootfstype");
- gc->setLabel(QObject::tr("OS file system"));
+ HostComboBoxSetting *gc = new HostComboBoxSetting("HOSTuprootfstype");
+ gc->setLabel(QObject::tr("OS File System"));
gc->addSelection("ext3") ;
gc->addSelection("ext4") ;
gc->addSelection("reiserfs");
@@ -247,101 +240,109 @@ static HostComboBox *HOSTuprootfstype()
//gc->addSelection("xfs");
//gc->addSelection("btrfs");
gc->addSelection("Do_not_format");
-
- gc->setHelpText(QObject::tr("Filesystem type for OS. "));
-
+ gc->setHelpText(QObject::tr("File system type for OS. "));
return gc;
}
-static HostComboBox *HOSTrootfstype()
+static HostComboBoxSetting *HOSTrootfstype()
{
- HostComboBox *gc = new HostComboBox("HOSTrootfstype");
- gc->setLabel(QObject::tr("Root filesystem format"));
+ HostComboBoxSetting *gc = new HostComboBoxSetting("HOSTrootfstype");
+ gc->setLabel(QObject::tr("Root File System"));
gc->addSelection("ext3") ;
gc->addSelection("ext4") ;
gc->addSelection("reiserfs");
gc->addSelection("jfs");
//gc->addSelection("btrfs");
//gc->addSelection("xfs");
-
- gc->setHelpText(QObject::tr("Filesystem type for root OS."));
-
+ gc->setHelpText(QObject::tr("File system type for root OS."));
return gc;
}
-class USESwap:
- public TriggeredConfigurationGroup {
-public:
- USESwap():
- TriggeredConfigurationGroup(true,false,true,true,false,false,false,true) {
- SetVertical(false);
- Setting* useswap = HostUseSWAP();
+class USESwap : public GroupSetting
+{
+ public:
+ USESwap()
+ {
+// TriggeredConfigurationGroup(true,false,true,true,false,false,false,true) {
+// SetVertical(false);
+ HostCheckBoxSetting* useswap = HostUseSWAP();
addChild(useswap);
- setTrigger(useswap);
-
+// setTrigger(useswap);
- ConfigurationGroup* swapyes = new VerticalConfigurationGroup(false);
- swapyes->addChild(HOSTSWAPsize());
- addTarget("1", swapyes );
- addTarget("0", new VerticalConfigurationGroup(true));
- };
+// ConfigurationGroup* swapyes = new VerticalConfigurationGroup(false);
+// swapyes->addChild(HOSTSWAPsize());
+// addTarget("1", swapyes );
+// addTarget("0", new VerticalConfigurationGroup(true));
+ useswap->addTargetedChild("1", HOSTSWAPsize());
+ }
};
-class DATAsize:
- public TriggeredConfigurationGroup {
-public:
- DATAsize():
- TriggeredConfigurationGroup(true,false,true,true,false,false,false,true) {
- SetVertical(false);
- Setting* datasize = HostUseALLdata();
+class DATAsize : public GroupSetting
+{
+ public:
+ DATAsize()
+ {
+// TriggeredConfigurationGroup(true,false,true,true,false,false,false,true) {
+// SetVertical(false);
+// Setting* datasize = HostUseALLdata();
+ HostCheckBoxSetting* datasize = HostUseALLdata();
addChild(datasize);
- setTrigger(datasize);
+// setTrigger(datasize);
- ConfigurationGroup* alldatano = new VerticalConfigurationGroup(false);
- alldatano->addChild(HOSTDATAsize());
- alldatano->addChild(HOSTdatafstype());
+// ConfigurationGroup* alldatano = new VerticalConfigurationGroup(false);
+// alldatano->addChild(HOSTDATAsize());
+// alldatano->addChild(HOSTdatafstype());
+ datasize->addTargetedChild("1", HOSTDATAsize());
+ datasize->addTargetedChild("1", HOSTdatafstype());
+ datasize->addTargetedChild("0", HOSTdatafstype());
+// ConfigurationGroup* alldatayes = new VerticalConfigurationGroup(false);
+// alldatayes->addChild(HOSTdatafstype());
- ConfigurationGroup* alldatayes = new VerticalConfigurationGroup(false);
- alldatayes->addChild(HOSTdatafstype());
-
- addTarget("1", alldatayes);
- addTarget("0", alldatano);
- };
+// addTarget("1", alldatayes);
+// addTarget("0", alldatano);
+ }
};
-
-class Installationtype:
- public TriggeredConfigurationGroup {
-public:
- Installationtype():
- TriggeredConfigurationGroup(true,false,true,true,false,false,false,true) {
+class Installationtype : public GroupSetting
+{
+ public:
+ Installationtype()
+ {
+// TriggeredConfigurationGroup(true,false,true,true,false,false,false,true) {
setLabel(QObject::tr("LinHES Install"));
- Setting *Mtemplate = HOSTinstallationtype();
+// Setting *Mtemplate = HOSTinstallationtype();
+ HostComboBoxSetting *Mtemplate = HOSTinstallationtype();
addChild(Mtemplate);
- setTrigger(Mtemplate);
+// setTrigger(Mtemplate);
- ConfigurationGroup *ospartition = new GridConfigurationGroup(2,false);
- ospartition->addChild(HOSTOSsize());
- ospartition->addChild(HOSTrootfstype());
- ospartition->addChild(HOSTHOMEsize());
- ospartition->addChild(HOSTDatabasesize());
+// ConfigurationGroup *ospartition = new GridConfigurationGroup(2,false);
+// ospartition->addChild(HOSTOSsize());
+// ospartition->addChild(HOSTrootfstype());
+// ospartition->addChild(HOSTHOMEsize());
+// ospartition->addChild(HOSTDatabasesize());
+ Mtemplate->addTargetedChild("1", HOSTOSsize());
+ Mtemplate->addTargetedChild("1", HOSTrootfstype());
+ Mtemplate->addTargetedChild("1", HOSTHOMEsize());
+ Mtemplate->addTargetedChild("1", HOSTDatabasesize());
+ Mtemplate->addTargetedChild("0", HOSTuprootfstype());
- ConfigurationGroup *tupgrade = new VerticalConfigurationGroup(false);
- tupgrade->addChild(HOSTuprootfstype());
- ConfigurationGroup *tfull = new VerticalConfigurationGroup(false);
+// ConfigurationGroup *tupgrade = new VerticalConfigurationGroup(false);
+// tupgrade->addChild(HOSTuprootfstype());
+
+// ConfigurationGroup *tfull = new VerticalConfigurationGroup(false);
// tfull->addChild(HOSTOSsize());
// tfull->addChild(HOSTrootfstype());
- tfull->addChild(ospartition);
- tfull->addChild(new USESwap);
- tfull->addChild(new DATAsize);
+// tfull->addChild(ospartition);
+// tfull->addChild(new USESwap);
+// tfull->addChild(new DATAsize);
- addTarget("Upgrade",tupgrade );
- addTarget("Full/Auto", tfull);
- };
+// addTarget("Upgrade",tupgrade );
+// addTarget("Full/Auto", tfull);
+ }
};
Mythinstalltype::Mythinstalltype()
@@ -352,6 +353,3 @@ Mythinstalltype::Mythinstalltype()
Installationtype *installationtype = new Installationtype();
addChild(installationtype);
};
-
-
-