summaryrefslogtreecommitdiffstats
path: root/abs/core/mythinstall
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/mythinstall')
-rwxr-xr-xabs/core/mythinstall/MythVantage-app/mythinstall/installationtype.cpp109
-rwxr-xr-xabs/core/mythinstall/MythVantage-app/mythinstall/installdialog.cpp51
-rw-r--r--abs/core/mythinstall/PKGBUILD4
3 files changed, 126 insertions, 38 deletions
diff --git a/abs/core/mythinstall/MythVantage-app/mythinstall/installationtype.cpp b/abs/core/mythinstall/MythVantage-app/mythinstall/installationtype.cpp
index 96866dc..cb2e918 100755
--- a/abs/core/mythinstall/MythVantage-app/mythinstall/installationtype.cpp
+++ b/abs/core/mythinstall/MythVantage-app/mythinstall/installationtype.cpp
@@ -1,23 +1,106 @@
+//#include <QObject>
#include <mythcontext.h>
#include <unistd.h>
-#include "installationtype.h"
#include <QTextStream>
-
#include <qdir.h>
+
#include "mv_common.h"
+#include "mythprogressdialog.h"
+#include "installationtype.h"
+#include "mythsystemlegacy.h"
int mythinstalltype (QString tmp_install_drive)
{
-
- Mythinstalltype setting;
- //FINDME this is needed to populate the default values and have the triggered config work
- setting.Load();
- setting.Save();
-
- int retc = 1 ;
- if ( setting.exec() == QDialog::Accepted )
+ QString line;
+ QString disksize;
+ QString rootsize;
+ QString homesize;
+ QString sqlsize;
+ QString useswap;
+ QString swapsize;
+ QString datasize;
+ QString usealldata;
+ int neededsize;
+ int disksizeMB;
+
+ int retc = 1;
+ while ( retc != 0 )
{
- retc = 0;
+ Mythinstalltype setting;
+ //FINDME this is needed to populate the default values and have the triggered config work
+ setting.Load();
+ setting.Save();
+
+ if ( setting.exec() == QDialog::Accepted )
+ {
+ //get users sizes
+ rootsize = gCoreContext->GetSetting("HOSTOSsize");
+ homesize = gCoreContext->GetSetting("HOSTHOMEsize");
+ sqlsize = gCoreContext->GetSetting("HOSTDatabasesize");
+ useswap = gCoreContext->GetSetting("HostUseSWAP");
+ swapsize = gCoreContext->GetSetting("HOSTSWAPsize");
+ usealldata = gCoreContext->GetSetting("HostUseALLdata");
+ datasize = gCoreContext->GetSetting("HOSTDATAsize");
+ //check if using swap
+ if ( useswap == "0" )
+ swapsize = "0";
+ //calculate size of all partitions;
+ neededsize = rootsize.toInt() * 1024 + homesize.toInt() *1024 +
+ sqlsize.toInt() * 1024 + swapsize.toInt();
+ //add 300 MB to neededsize if usealldata is enabled
+ if ( usealldata == "1" )
+ neededsize = neededsize + 300;
+ else
+ neededsize = neededsize + datasize.toInt() * 1024;
+ //get selected drive size
+ //using myth_system as QFile wouldn't read /proc/partitions directly
+ myth_system("cat /proc/partitions > /tmp/proc.partitions");
+ QFile file("/tmp/proc.partitions");
+ if (file.open(QIODevice::ReadOnly | QIODevice::Text))
+ {
+ QTextStream t( &file );
+ while (!t.atEnd())
+ {
+ line = t.readLine();
+ line = line.simplified();
+ if ( line.endsWith(tmp_install_drive) )
+ {
+ disksize = line.section( " ", 2, 2 );
+ //QTextStream(stdout) << "disksize:" + disksize << endl;
+ break;
+ }
+ }
+ }
+ file.close();
+ //convert to MB and match calulation in installdialog.cpp
+ disksizeMB = qRound(disksize.toFloat() * 1024 / 1000000);
+
+ if (neededsize > disksizeMB)
+ {
+ DialogCode val = MythPopupBox::Show2ButtonPopup(
+ GetMythMainWindow(),
+ "Error", "The total partition sizes (" + QString::number(neededsize) + " MB) are too large for the selected drive (" + QString::number(disksizeMB) + " MB). Continuing may result in a failed install.",
+ QObject::tr("Continue"),
+ QObject::tr("Try Again"),
+ kDialogCodeButton1);
+ if ( val == kDialogCodeButton0 )
+ {
+ retc = 0;
+ }
+ else
+ {
+ retc = 1;
+ }
+ }
+ else
+ {
+ retc = 0;
+ }
+ }
+ else
+ {
+ retc = 0;
+ }
}
return retc;
@@ -94,7 +177,7 @@ static HostSpinBox *HOSTSWAPsize()
{
QTextStream t( &file ); // use a text stream
line = t.readLine();
- if ( line.startsWith("MemTotal:"))
+ if ( line.startsWith("MemTotal:") )
{
currentitem = line.simplified();
currentitem = currentitem.section( " ", 1, 1 );
@@ -104,7 +187,7 @@ static HostSpinBox *HOSTSWAPsize()
bool ok;
int mem = currentitem.toInt( &ok, 10 ); // dec == 0, ok == FALSE
//QTextStream(stdout) << mem << endl;
- mem = mem/1024 ;
+ mem = mem / 1024 + 16;
//QTextStream(stdout) << mem << endl;
if ( ! ok )
diff --git a/abs/core/mythinstall/MythVantage-app/mythinstall/installdialog.cpp b/abs/core/mythinstall/MythVantage-app/mythinstall/installdialog.cpp
index 1724da7..6f4252f 100755
--- a/abs/core/mythinstall/MythVantage-app/mythinstall/installdialog.cpp
+++ b/abs/core/mythinstall/MythVantage-app/mythinstall/installdialog.cpp
@@ -230,7 +230,7 @@ void WelcomeDialog::updateScreen(void)
cmdtxt=MV_ROOT ;
cmdtxt.append("bin/install_proxy.sh " );
system(qPrintable(cmdtxt));
- recording_text=" ";
+ recording_text="Press MENU for Options";
mythvantage_text=" ";
error_text=" ";
scheduled_text=" ";
@@ -293,6 +293,7 @@ void WelcomeDialog::updateScreen(void)
// shows the busy box when configuring the system
if ( scheduled_text == "Configuring system")
{
+ m_recording_text->SetText(" ");
if ( ! I_AM_BUSY )
busy_box();
}
@@ -300,9 +301,9 @@ void WelcomeDialog::updateScreen(void)
void WelcomeDialog::busy_box(void)
{
- QString msgtext = "Please wait, " ;
+ QString msgtext = "Please wait, configuring LinHES on host " ;
msgtext.append(current_hostname);
- msgtext.append(" is preparing for life");
+ msgtext.append("...");
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythUIBusyDialog *busyPopup = new MythUIBusyDialog(msgtext, popupStack,"installbusy");
if (busyPopup->Create())
@@ -316,7 +317,7 @@ void WelcomeDialog::busy_box(void)
}
- while ( scheduled_text == "Configuring system" )
+ while ( scheduled_text == "Configuring system" )
{
qApp->processEvents ();
usleep(900);
@@ -334,7 +335,7 @@ void WelcomeDialog::busy_box(void)
void WelcomeDialog::busy_find_oldsettings(void)
{
- QString msgtext = "Importing old settings" ;
+ QString msgtext = "Importing Old Settings..." ;
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythUIBusyDialog *busyPopup = new MythUIBusyDialog(msgtext, popupStack,
"importsettingsbusy");
@@ -423,13 +424,13 @@ void WelcomeDialog::showPopup(void)
SLOT(runLIVECD()));
m_menuPopup->AddButton(tr("Exit"),
SLOT(closeDialog()));
- m_menuPopup->AddButton(tr("Close menu")) ;
+ m_menuPopup->AddButton(tr("Close Menu")) ;
}
else
{
m_menuPopup->AddButton(tr("Exit"),
SLOT(closeDialog()));
- m_menuPopup->AddButton(tr("Close menu"));
+ m_menuPopup->AddButton(tr("Close Menu"));
}
}
@@ -545,7 +546,7 @@ void WelcomeDialog::showPopup_2(void)
{
MythScreenStack *popupStack = GetMythMainWindow()->GetMainStack();
- m_menuPopup = new MythDialogBox("Select the drive to install to", popupStack, "actionmenu");
+ m_menuPopup = new MythDialogBox("Where do you want to install LinHES?", popupStack, "actionmenu");
if (m_menuPopup->Create())
popupStack->AddScreen(m_menuPopup);
@@ -561,7 +562,7 @@ void WelcomeDialog::showPopup_2(void)
QString NETBOOT = getenv("NETBOOT");
NETBOOT=NETBOOT.simplified();
if ( NETBOOT == "YES" )
- m_menuPopup->AddButton(("Diskless Frontend " ), SLOT(install_net() ) );
+ m_menuPopup->AddButton(("Diskless Frontend"), SLOT(install_net() ) );
QString INSTALLSOURCE = findinstallsouce();
ifstream partitions("/proc/partitions");
@@ -615,7 +616,7 @@ void WelcomeDialog::showPopup_2(void)
void WelcomeDialog::GO_popup(QString go_text)
{
DialogCode retval = MythPopupBox::Show2ButtonPopup(GetMythMainWindow(),
- "", go_text, tr("Start the process"),
+ "", go_text, tr("Start Installation"),
tr("Cancel"), kDialogCodeButton0);
if ( retval == kDialogCodeButton0 )
@@ -644,11 +645,12 @@ void WelcomeDialog::Reboot_popup(void)
prompt1.append("\n");
}
else
- prompt1 = QObject::tr("Ready to go!");
+ prompt1 = QObject::tr("Installation of LinHES is complete!");
+ prompt1.append("\n");
reboot_box = new DialogBox(GetMythMainWindow(), prompt1);
reboot_box->AddButton(QObject::tr("Reboot"));
- reboot_box->AddButton(QObject::tr("Power off"));
+ reboot_box->AddButton(QObject::tr("Power Off"));
int returncode = 0;
DialogCode dcode = reboot_box->exec();
@@ -832,9 +834,9 @@ void WelcomeDialog::install_generic(void)
installwarningtext="Warning!";
installwarningtext.append ("\n");
installwarningtext.append ("\n");
- installwarningtext.append ("Installation drive (");
+ installwarningtext.append ("The selected drive (");
installwarningtext.append (install_drive);
- installwarningtext.append (") is about to be erased.");
+ installwarningtext.append (") will be erased and LinHES will be installed.");
installwarningtext.append ("\n");
}
else if ( installtype == "NET")
@@ -856,8 +858,11 @@ void WelcomeDialog::install_generic(void)
installwarningtext.append ("OS partition (");
installwarningtext.append (install_drive);
installwarningtext.append ("1");
- installwarningtext.append (") will be erased.");
+ installwarningtext.append (") will be erased and LinHES will be installed.");
installwarningtext.append ("\n");
+ installwarningtext.append ("The other partitions on (");
+ installwarningtext.append (install_drive);
+ installwarningtext.append (") will not be erased.");
QString cmdtxt;
cmdtxt=MV_ROOT ;
@@ -947,7 +952,7 @@ void WelcomeDialog::install_generic(void)
void busy_network(void)
{
- QString msgtext = "Starting network" ;
+ QString msgtext = "Starting Network" ;
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythUIBusyDialog *busyPopup = new MythUIBusyDialog(msgtext, popupStack,"installbusy");
if (busyPopup->Create())
@@ -991,7 +996,7 @@ int WelcomeDialog::ask_validate_network(void)
else
{
MythProgressDialog *network_check = NULL;
- network_check = new MythProgressDialog(QObject::tr("Please wait while the network is checked."), 7);
+ network_check = new MythProgressDialog(QObject::tr("Please wait while the network is checked..."), 7);
QString cmdtxt;
cmdtxt=MV_ROOT ;
cmdtxt.append("bin/install_proxy.sh network_check_it setup_network &");
@@ -1006,7 +1011,7 @@ int WelcomeDialog::ask_validate_network(void)
if ( retval != 0 )
{
network_check->Close();
- pop_text="Could not find myself on the network";
+ pop_text="Could not find myself on the network.";
}
}
@@ -1019,7 +1024,7 @@ int WelcomeDialog::ask_validate_network(void)
if ( retval != 0 )
{
network_check->Close();
- pop_text="Could not locate gateway";
+ pop_text="Could not locate the gateway server.";
}
}
@@ -1032,7 +1037,7 @@ int WelcomeDialog::ask_validate_network(void)
if ( retval != 0 )
{
network_check->Close();
- pop_text="Could not locate nameserver";
+ pop_text="Could not locate nameserver.";
}
}
@@ -1045,7 +1050,7 @@ int WelcomeDialog::ask_validate_network(void)
if ( retval != 0 )
{
network_check->Close();
- pop_text="Could not lookup names";
+ pop_text="Could not lookup names.";
}
}
@@ -1058,7 +1063,7 @@ int WelcomeDialog::ask_validate_network(void)
if ( retval != 0 )
{
network_check->Close();
- pop_text="Hostname already on the network";
+ pop_text="This hostname is already on the network.";
}
}
@@ -1075,7 +1080,7 @@ int WelcomeDialog::ask_validate_network(void)
GetMythMainWindow(),
"", pop_text,
tr("Continue"),
- tr("Try again"),
+ tr("Try Again"),
kDialogCodeButton0);
if (kDialogCodeButton0 == val )
retval = 0;
diff --git a/abs/core/mythinstall/PKGBUILD b/abs/core/mythinstall/PKGBUILD
index 4c5b223..93a8f00 100644
--- a/abs/core/mythinstall/PKGBUILD
+++ b/abs/core/mythinstall/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Jams
pkgname=mythinstall
-pkgver=8.4
-pkgrel=5
+pkgver=8.4.3
+pkgrel=2
pkgdesc="LinHES installer/systemconfig GUI."
arch=('i686' 'x86_64')
depends=('mythtv>=0.28')