Index: sys-userwidget.cpp =================================================================== --- sys-userwidget.cpp (revision 9216) +++ sys-userwidget.cpp (working copy) @@ -1,134 +1,168 @@ #include "sysinstaller.h" +#include "usersetupscreen.h" +#include "ui_usersetupscreen.h" +UserSetupScreen::UserSetupScreen(QWidget *parent) : + QWidget(parent), + ui(new Ui::UserSetupScreen) +{ + ui->setupUi(this); + + connectUserSlots(); +} + +UserSetupScreen::~UserSetupScreen() +{ + delete ui; +} + // Function which connects all the user management slots -void SysInstaller::connectUserSlots() +void UserSetupScreen::connectUserSlots() { - // Connect the various username objects and slots to the check function - connect( linePassword, SIGNAL( textChanged(const QString &) ), this, SLOT(slotPasswordTextChanged() ) ); - connect( linePassword2, SIGNAL( textChanged(const QString &) ), this, SLOT(slotPasswordTextChanged() ) ); - connect( linePassword2, SIGNAL(lostFocus()), this, SLOT(slotRootPasswordLineEditLostFocus())); + // Connect the various username objects and slots to the check function + connect( ui->linePassword, SIGNAL( textChanged(const QString &) ), this, SLOT(slotPasswordTextChanged() ) ); + connect( ui->linePassword2, SIGNAL( textChanged(const QString &) ), this, SLOT(slotPasswordTextChanged() ) ); + connect( ui->linePassword2, SIGNAL(lostFocus()), this, SLOT(slotRootPasswordLineEditLostFocus())); - // Connect the username fields to the enable / disable function for the pushbuttons - connect( lineUserName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotCheckUserLinesChanged() ) ); - connect( lineFullName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotCheckUserLinesChanged() ) ); - connect( lineUserPassword, SIGNAL( textChanged(const QString &) ), this, SLOT(slotCheckUserLinesChanged() ) ); - connect( lineUserPassword2, SIGNAL( textChanged(const QString &) ), this, SLOT(slotCheckUserLinesChanged() ) ); - connect( lineUserPassword2, SIGNAL(lostFocus()), this, SLOT(slotUserPasswordLineEditLostFocus())); - connect( listWidgetUsers, SIGNAL( clicked(const QModelIndex &) ), this, SLOT(slotListWidgetUsersChanged() ) ); + // Connect the username fields to the enable / disable function for the pushbuttons + connect( ui->lineUserName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotCheckUserLinesChanged() ) ); + connect( ui->lineFullName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotCheckUserLinesChanged() ) ); + connect( ui->lineUserPassword, SIGNAL( textChanged(const QString &) ), this, SLOT(slotCheckUserLinesChanged() ) ); + connect( ui->lineUserPassword2, SIGNAL( textChanged(const QString &) ), this, SLOT(slotCheckUserLinesChanged() ) ); + connect( ui->lineUserPassword2, SIGNAL(lostFocus()), this, SLOT(slotUserPasswordLineEditLostFocus())); + connect( ui->listWidgetUsers, SIGNAL( clicked(const QModelIndex &) ), this, SLOT(slotListWidgetUsersChanged() ) ); - // Connect the buttons for user management - connect( pushAddUser, SIGNAL( clicked() ), this, SLOT( slotAddUserButton() ) ); - connect( pushRemoveUser, SIGNAL( clicked() ), this, SLOT( slotRemoveUserButton() ) ); - connect( pushApplyUser, SIGNAL( clicked() ), this, SLOT( slotApplyUserButton() ) ); + // Connect the buttons for user management + connect( ui->pushAddUser, SIGNAL( clicked() ), this, SLOT( slotAddUserButton() ) ); + connect( ui->pushRemoveUser, SIGNAL( clicked() ), this, SLOT( slotRemoveUserButton() ) ); + connect( ui->pushApplyUser, SIGNAL( clicked() ), this, SLOT( slotApplyUserButton() ) ); - // Populate our shell selection - comboShell->clear(); - comboShell->addItem("/bin/csh"); - comboShell->addItem("/bin/tcsh"); - comboShell->addItem("/bin/sh"); - comboShell->addItem("/usr/local/bin/bash"); - comboShell->addItem("/usr/local/bin/zsh"); + // Populate our shell selection + ui->comboShell->clear(); + ui->comboShell->addItem("/bin/csh"); + ui->comboShell->addItem("/bin/tcsh"); + ui->comboShell->addItem("/bin/sh"); + ui->comboShell->addItem("/usr/local/bin/bash"); + ui->comboShell->addItem("/usr/local/bin/zsh"); - //Setup any regular expressions we will need - passwordRegExp.setPattern("([a-z]*[A-Z]*[0-9]*[!\"\xef\xbf\xbd$%^&*()_+=\xef\xbf\xbd#'`@~:?<>|{}\\-.]*)+"); + //Setup any regular expressions we will need + passwordRegExp.setPattern("([a-z]*[A-Z]*[0-9]*[!\"\xef\xbf\xbd$%^&*()_+=\xef\xbf\xbd#'`@~:?<>|{}\\-.]*)+"); - // Disable add / apply buttons - pushAddUser->setEnabled(false); - pushApplyUser->setEnabled(false); + // Disable add / apply buttons + ui->pushAddUser->setEnabled(false); + ui->pushApplyUser->setEnabled(false); } -void SysInstaller::slotPasswordTextChanged() +void UserSetupScreen::slotOSChanged(QString newOS) { - slotCheckUserLinesChanged(); + if (newOS.startsWith("freebsd")) { + // Populate our shell selection + ui->comboShell->clear(); + ui->comboShell->addItem("/bin/csh"); + ui->comboShell->addItem("/bin/tcsh"); + ui->comboShell->addItem("/bin/sh"); + } else { + // Populate our shell selection + ui->comboShell->clear(); + ui->comboShell->addItem("/bin/csh"); + ui->comboShell->addItem("/bin/tcsh"); + ui->comboShell->addItem("/bin/sh"); + ui->comboShell->addItem("/usr/local/bin/bash"); + } } -void SysInstaller::slotRootPasswordLineEditLostFocus() +void UserSetupScreen::slotPasswordTextChanged() { - slotCheckUserLinesChanged(); + slotCheckUserLinesChanged(); } -void SysInstaller::slotCheckUserLinesChanged() +void UserSetupScreen::slotRootPasswordLineEditLostFocus() { - bool ok = TRUE; - textAcctNotify->setText(""); + slotCheckUserLinesChanged(); +} - // Check if we are missing some values - if ( lineUserName->text().isEmpty() ) { - textAcctNotify->setText(""); - ok = FALSE; - } - if ( lineFullName->text().isEmpty() ) { - textAcctNotify->setText(""); - ok = FALSE; - } - if ( lineUserPassword->text().isEmpty() ) { - textAcctNotify->setText(""); - ok = FALSE; - } +void UserSetupScreen::slotCheckUserLinesChanged() +{ + bool ok = TRUE; + ui->textAcctNotify->setText(""); - //Check if passwords match - if (linePassword->text() != linePassword2->text() \ - && ! linePassword->text().isEmpty() && ! linePassword2->text().isEmpty() ) - textAcctNotify->setText(tr("Root passwords do not match!")); + // Check if we are missing some values + if ( ui->lineUserName->text().isEmpty() ) { + ui->textAcctNotify->setText(""); + ok = FALSE; + } + if ( ui->lineFullName->text().isEmpty() ) { + ui->textAcctNotify->setText(""); + ok = FALSE; + } + if ( ui->lineUserPassword->text().isEmpty() ) { + ui->textAcctNotify->setText(""); + ok = FALSE; + } - // Make sure root password length is long enough - if (linePassword->text().length() < 4 \ - && ! linePassword->text().isEmpty() && ! linePassword2->text().isEmpty() ) { - textAcctNotify->setText(tr("Root password must be at least 4 characters.")); - ok = FALSE; - } + //Check if passwords match + if (ui->linePassword->text() != ui->linePassword2->text() && + ! ui->linePassword->text().isEmpty() && ! ui->linePassword2->text().isEmpty() ) + ui->textAcctNotify->setText(tr("Root passwords do not match!")); - // Make sure user password length is long enough - if (lineUserPassword->text().length() < 4 \ - && ! lineUserPassword->text().isEmpty() && ! lineUserPassword2->text().isEmpty() ) -{ - textAcctNotify->setText(tr("User password must be at least 4 characters.")); - ok = FALSE; - } + // Make sure root password length is long enough + if (ui->linePassword->text().length() < 4 && + ! ui->linePassword->text().isEmpty() && ! ui->linePassword2->text().isEmpty() ) { + ui->textAcctNotify->setText(tr("Root password must be at least 4 characters.")); + ok = FALSE; + } - //Check if passwords match - if (lineUserPassword->text() != lineUserPassword2->text() \ - && ! lineUserPassword->text().isEmpty() && ! lineUserPassword2->text().isEmpty() ) - textAcctNotify->setText(tr("Error: User passwords do not match!")); + // Make sure user password length is long enough + if (ui->lineUserPassword->text().length() < 4 && + ! ui->lineUserPassword->text().isEmpty() && ! ui->lineUserPassword2->text().isEmpty() ) + { + ui->textAcctNotify->setText(tr("User password must be at least 4 characters.")); + ok = FALSE; + } - //Check username contains only letters and numbers - if ((! passwordRegExp.exactMatch(lineUserName->text())) && (lineUserName->text() != "")) { - textAcctNotify->setText(tr("Username may contain only letters and numbers!")); - ok = FALSE; - } + //Check if passwords match + if (ui->lineUserPassword->text() != ui->lineUserPassword2->text() && + ! ui->lineUserPassword->text().isEmpty() && ! ui->lineUserPassword2->text().isEmpty() ) + ui->textAcctNotify->setText(tr("Error: User passwords do not match!")); + //Check username contains only letters and numbers + if ((! passwordRegExp.exactMatch(ui->lineUserName->text())) && (ui->lineUserName->text() != "")) { + ui->textAcctNotify->setText(tr("Username may contain only letters and numbers!")); + ok = FALSE; + } - if ( (lineUserPassword->text() != lineUserPassword2->text()) || lineUserPassword->text().isEmpty()) - ok = FALSE; - QString Username = lineUserName->text(); + if ( (ui->lineUserPassword->text() != ui->lineUserPassword2->text()) || ui->lineUserPassword->text().isEmpty()) + ok = FALSE; - if ( Username == "root" \ - || Username == "toor" \ - || Username == "daemon" \ - || Username == "operator" \ - || Username == "bin" \ - || Username == "tty" \ - || Username == "kmenu" \ - || Username == "games" \ - || Username == "news" \ - || Username == "man" \ - || Username == "sshd" \ - || Username == "smmsp" \ - || Username == "mailnull" \ - || Username == "bind" \ - || Username == "proxy" \ - || Username == "_pflog" \ - || Username == "_dhcp" \ - || Username == "pop" \ - || Username == "www" \ - || Username == "nobody" \ - || Username == "cyrus" \ - || Username == "cups") + QString Username = ui->lineUserName->text(); + + if ( Username == "root" + || Username == "toor" + || Username == "daemon" + || Username == "operator" + || Username == "bin" + || Username == "tty" + || Username == "kmenu" + || Username == "games" + || Username == "news" + || Username == "man" + || Username == "sshd" + || Username == "smmsp" + || Username == "mailnull" + || Username == "bind" + || Username == "proxy" + || Username == "_pflog" + || Username == "_dhcp" + || Username == "pop" + || Username == "www" + || Username == "nobody" + || Username == "cyrus" + || Username == "cups") { - ok = FALSE; - textAcctNotify->setText( tr("Error: The username") + " " + Username + " " + tr("is reserved.")); + ok = FALSE; + ui->textAcctNotify->setText( tr("Error: The username") + " " + Username + " " + tr("is reserved.")); } @@ -136,179 +170,184 @@ ok2 = true; for ( int i = 0; i < listUsers.count(); ++i) { - if(listUsers.at(i).at(0) == lineUserName->text() ) { + if (listUsers.at(i).at(0) == ui->lineUserName->text() ) { ok2 = FALSE; break; - } + } } - if ( ok) { - if (ok2) - { - pushAddUser->setEnabled(TRUE); - pushApplyUser->setEnabled(FALSE); - } else { - pushAddUser->setEnabled(FALSE); - pushApplyUser->setEnabled(TRUE); - } + if (ok) { + if (ok2) + { + ui->pushAddUser->setEnabled(TRUE); + ui->pushApplyUser->setEnabled(FALSE); + } else { + ui->pushAddUser->setEnabled(FALSE); + ui->pushApplyUser->setEnabled(TRUE); + } } else { - pushApplyUser->setEnabled(FALSE); - pushAddUser->setEnabled(FALSE); + ui->pushApplyUser->setEnabled(FALSE); + ui->pushAddUser->setEnabled(FALSE); } } -void SysInstaller::slotUserPasswordLineEditLostFocus() +void UserSetupScreen::slotUserPasswordLineEditLostFocus() { - slotCheckUserLinesChanged(); + slotCheckUserLinesChanged(); } -void SysInstaller::slotListWidgetUsersChanged() +void UserSetupScreen::slotListWidgetUsersChanged() { - int i; + int i; - if ( ! listWidgetUsers->currentRow() == -1) - return; + if ( ! ui->listWidgetUsers->currentRow() == -1) + return; - i = listWidgetUsers->currentRow(); - - lineUserName->setText(listUsers.at(i).at(0)); - lineFullName->setText(listUsers.at(i).at(1)); - lineUserPassword->setText(listUsers.at(i).at(2)); - lineUserPassword2->setText(listUsers.at(i).at(2)); + i = ui->listWidgetUsers->currentRow(); - if ( listUsers.at(i).at(3) == "/bin/csh") - comboShell->setCurrentIndex(0); - else if(listUsers.at(i).at(3) == "/bin/tcsh") - comboShell->setCurrentIndex(1); - else if(listUsers.at(i).at(3) == "/bin/sh") - comboShell->setCurrentIndex(2); - else if(listUsers.at(i).at(3) == "/usr/local/bin/bash") - comboShell->setCurrentIndex(3); + ui->lineUserName->setText(listUsers.at(i).at(0)); + ui->lineFullName->setText(listUsers.at(i).at(1)); + ui->lineUserPassword->setText(listUsers.at(i).at(2)); + ui->lineUserPassword2->setText(listUsers.at(i).at(2)); + + if ( listUsers.at(i).at(3) == "/bin/csh") + ui->comboShell->setCurrentIndex(0); + else if (listUsers.at(i).at(3) == "/bin/tcsh") + ui->comboShell->setCurrentIndex(1); + else if (listUsers.at(i).at(3) == "/bin/sh") + ui->comboShell->setCurrentIndex(2); + else if (listUsers.at(i).at(3) == "/usr/local/bin/bash") + ui->comboShell->setCurrentIndex(3); } -void SysInstaller::refreshUsers() +void UserSetupScreen::refreshUsers() { - listWidgetUsers->clear(); + ui->listWidgetUsers->clear(); for ( int i = 0; i < listUsers.count(); ++i) - listWidgetUsers->addItem(listUsers.at(i).at(0) + " (" + listUsers.at(i).at(1) + ")" ); - + ui->listWidgetUsers->addItem(listUsers.at(i).at(0) + " (" + listUsers.at(i).at(1) + ")" ); + } -void SysInstaller::slotAddUserButton() +void UserSetupScreen::slotAddUserButton() { QStringList newUserList; - newUserList << lineUserName->text() \ - << lineFullName->text() \ - << lineUserPassword->text() \ - << comboShell->currentText(); + newUserList << ui->lineUserName->text() + << ui->lineFullName->text() + << ui->lineUserPassword->text() + << ui->comboShell->currentText(); listUsers << newUserList; refreshUsers(); - lineUserName->setText(""); - lineFullName->setText(""); - lineUserPassword->setText(""); - lineUserPassword2->setText(""); + ui->lineUserName->setText(""); + ui->lineFullName->setText(""); + ui->lineUserPassword->setText(""); + ui->lineUserPassword2->setText(""); slotCheckUserLinesChanged(); } -void SysInstaller::slotRemoveUserButton() +void UserSetupScreen::slotRemoveUserButton() { - if ( listWidgetUsers->currentRow() == -1) - return; + if ( ui->listWidgetUsers->currentRow() == -1) + return; - listUsers.removeAt(listWidgetUsers->currentRow()); + listUsers.removeAt(ui->listWidgetUsers->currentRow()); refreshUsers(); slotCheckUserLinesChanged(); } -void SysInstaller::slotApplyUserButton() +void UserSetupScreen::slotApplyUserButton() { - QString Shell; - int i; + QString Shell; + int i; - if ( listWidgetUsers->currentRow() == -1) - return; + if ( ui->listWidgetUsers->currentRow() == -1) + return; - i = listWidgetUsers->currentRow(); - listUsers[i][0] = lineUserName->text(); - listUsers[i][1] = lineFullName->text(); - listUsers[i][2] = lineUserPassword->text(); - listUsers[i][3] = comboShell->currentText(); + i = ui->listWidgetUsers->currentRow(); + listUsers[i][0] = ui->lineUserName->text(); + listUsers[i][1] = ui->lineFullName->text(); + listUsers[i][2] = ui->lineUserPassword->text(); + listUsers[i][3] = ui->comboShell->currentText(); - refreshUsers(); - slotCheckUserLinesChanged(); + refreshUsers(); + slotCheckUserLinesChanged(); } -bool SysInstaller::checkUserAccountInfo() +bool UserSetupScreen::validateAndFinish() { - bool ok; - ok = true; + return checkUserAccountInfo(); +} - // Check if we have a username setup. - if ( listUsers.empty() ) - { - int ret = QMessageBox::warning(this, tr("PC-BSD Install"), - tr("No usernames have been specified. Are you sure you want to continue?"), - QMessageBox::Yes | QMessageBox::No, - QMessageBox::No); - switch (ret) { - case QMessageBox::Yes: - break; - case QMessageBox::No: - ok = false; - break; - default: - ok = false; - break; - } +bool UserSetupScreen::checkUserAccountInfo() +{ + bool ok; + ok = true; - } + // Check if we have a username setup. + if ( listUsers.empty() ) + { + int ret = QMessageBox::warning(this, tr("PC-BSD Install"), + tr("No usernames have been specified. Are you sure you want to continue?"), + QMessageBox::Yes | QMessageBox::No, + QMessageBox::No); + switch (ret) { + case QMessageBox::Yes: + break; + case QMessageBox::No: + ok = false; + break; + default: + ok = false; + break; + } - if ((linePassword->text() != linePassword2->text()) || linePassword->text().isEmpty()) - { - textAcctNotify->setText(tr("Error: Root password must be set to continue. ")); - ok = false; - } + } - if(ok) - textAcctNotify->setText(""); + if ((ui->linePassword->text() != ui->linePassword2->text()) || ui->linePassword->text().isEmpty()) + { + ui->textAcctNotify->setText(tr("Error: Root password must be set to continue. ")); + ok = false; + } - return ok; + if (ok) + ui->textAcctNotify->setText(""); + + return ok; } // Return list of users in cfg format -QStringList SysInstaller::getUsersCfgSettings(QStringList &summaryList) +QStringList UserSetupScreen::getUsersCfgSettings(QStringList &summaryList) { - QStringList userList; + QStringList userList; - userList << ""; - userList << "# Root Password"; - userList << "rootPass=" + linePassword->text(); - - userList << ""; - userList << "# Users"; + userList << ""; + userList << "# Root Password"; + userList << "rootPass=" + ui->linePassword->text(); - summaryList << ""; - summaryList << "" + tr("The following users will be created:") + ""; + userList << ""; + userList << "# Users"; - for ( int i = 0; i < listUsers.count(); ++i) { - userList << "userName=" + listUsers.at(i).at(0); - userList << "userComment=" + listUsers.at(i).at(1); - userList << "userPass=" + listUsers.at(i).at(2); - userList << "userShell=" + listUsers.at(i).at(3); - userList << "userHome=/home/" + listUsers.at(i).at(0); - userList << "userGroups=wheel,operator"; - userList << "commitUser"; - userList << ""; - summaryList << listUsers.at(i).at(1) + " (" + listUsers.at(i).at(0) + ")"; - } + summaryList << ""; + summaryList << "" + tr("The following users will be created:") + ""; + for ( int i = 0; i < listUsers.count(); ++i) { + userList << "userName=" + listUsers.at(i).at(0); + userList << "userComment=" + listUsers.at(i).at(1); + userList << "userPass=" + listUsers.at(i).at(2); + userList << "userShell=" + listUsers.at(i).at(3); + userList << "userHome=/home/" + listUsers.at(i).at(0); + userList << "userGroups=wheel,operator"; + userList << "commitUser"; + userList << ""; + summaryList << listUsers.at(i).at(1) + " (" + listUsers.at(i).at(0) + ")"; + } - return userList; + + return userList; } Index: installcompletescreen.cpp =================================================================== --- installcompletescreen.cpp (revision 0) +++ installcompletescreen.cpp (revision 0) @@ -0,0 +1,14 @@ +#include "installcompletescreen.h" +#include "ui_installcompletescreen.h" + +InstallCompleteScreen::InstallCompleteScreen(QWidget *parent) : + QWidget(parent), + ui(new Ui::InstallCompleteScreen) +{ + ui->setupUi(this); +} + +InstallCompleteScreen::~InstallCompleteScreen() +{ + delete ui; +} Index: welcomewidget.cpp =================================================================== --- welcomewidget.cpp (revision 0) +++ welcomewidget.cpp (revision 0) @@ -0,0 +1,101 @@ +#include +#include + +#include "backend.h" +#include "welcomewidget.h" +#include "ui_welcomewidget.h" + +WelcomeWidget::WelcomeWidget(QWidget *parent) : + QWidget(parent), + ui(new Ui::WelcomeWidget) +{ + ui->setupUi(this); + + // load languages + ui->comboLanguage->clear(); + languages = Scripts::Backend::languages(); + for (int i=0; i < languages.count(); ++i) { + QString languageStr = languages.at(i); + QString language = languageStr.split("-").at(0); + ui->comboLanguage->addItem(language.trimmed()); + } + connect(ui->comboLanguage, SIGNAL(currentIndexChanged(QString)), this, SLOT(slotChangeLanguage())); + + + // Load the timezones + ui->comboBoxTimezone->clear(); + ui->comboBoxTimezone->addItems(Scripts::Backend::timezones()); + // Set America/New_York to default + int index = ui->comboBoxTimezone->findText("America/New_York", Qt::MatchStartsWith); + if (index != -1) + ui->comboBoxTimezone->setCurrentIndex(index); + + connect(ui->checkHostname,SIGNAL(clicked()), this, SLOT(slotHostnameClicked())); + +} + +WelcomeWidget::~WelcomeWidget() +{ + delete ui; +} + +bool +WelcomeWidget::validateAndFinish() +{ + bool valid = true; + + if (ui->checkHostname->isChecked() && + (ui->lineHostname->text().isEmpty() || ui->lineHostname->text().length() < 2) ) + { + valid = false; + QMessageBox::critical(this, tr("Invalid Hostname"), + tr("You must specify a hostname between 2-250 characters!") ); + } + + return valid; +} + +// Enable / disable the hostname +void WelcomeWidget::slotHostnameClicked() +{ + ui->lineHostname->setEnabled(ui->checkHostname->isChecked()); +} + + +void WelcomeWidget::slotChangeLanguage() +{ + + if ( ui->comboLanguage->currentIndex() == -1 ) + return; + + // Figure out the language code + QString langCode = languages.at(ui->comboLanguage->currentIndex()); + + // Grab the language code + langCode.truncate(langCode.lastIndexOf(")")); + langCode.remove(0, langCode.lastIndexOf("(") + 1); + + // Now write out the lang code and close + QFile lfile( TMPLANGFILE ); + if ( lfile.open( QIODevice::WriteOnly ) ) { + QTextStream stream( &lfile ); + stream << langCode; + lfile.close(); + } + close(); + +} + +void WelcomeWidget::changeLang(QString code) +{ + // Change the language in the combobox with the current running one + ui->comboLanguage->disconnect(); + + for (int i=0; i < languages.count(); ++i) { + if ( languages.at(i).indexOf("(" + code + ")" ) != -1 ) { + ui->comboLanguage->setCurrentIndex(i); + } + } + + connect(ui->comboLanguage, SIGNAL(currentIndexChanged(QString)), this, SLOT(slotChangeLanguage())); +} Index: installtypescreen.ui =================================================================== --- installtypescreen.ui (revision 0) +++ installtypescreen.ui (revision 0) @@ -0,0 +1,4126 @@ + + + InstallTypeScreen + + + + 0 + 0 + 768 + 448 + + + + Form + + + + + 0 + 0 + 768 + 448 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + 0 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + + + + + + + + 14 + 14 + 14 + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + + + 14 + 14 + 14 + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + + + 14 + 14 + 14 + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + + + 11 + 75 + true + + + + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); + + + Please select the type of installation you wish to perform: + + + Qt::AlignCenter + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 9 + 75 + true + + + + Fresh Install + + + + :/modules/images/install.png:/modules/images/install.png + + + + 25 + 25 + + + + true + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 0 + 0 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 9 + 75 + true + + + + Upgrade + + + + :/modules/images/install.png:/modules/images/install.png + + + + 25 + 25 + + + + + + + + Qt::Horizontal + + + + 13 + 20 + + + + + + + + + 0 + 0 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 9 + 75 + true + + + + Restore from backup + + + + :/modules/images/install.png:/modules/images/install.png + + + + 25 + 25 + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + + Qt::Horizontal + + + + 183 + 245 + + + + + + + + + 0 + 0 + + + + + 100 + 0 + + + + + + + 0 + + + + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + Tip: PC-BSD is designed for the desktop, while FreeBSD makes a great choice for servers + + + true + + + + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + PC-BSD + + + + :/PCBSD/images/pbidiricon.png:/PCBSD/images/pbidiricon.png + + + + 30 + 30 + + + + true + + + + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + FreeBSD + + + + :/modules/images/freebsd.png:/modules/images/freebsd.png + + + + 30 + 30 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 20 + 40 + + + + + + + + + 0 + 0 + + + + + + + + + 14 + 14 + 14 + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + + + 14 + 14 + 14 + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + + + 14 + 14 + 14 + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + + + 75 + true + + + + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); + + + Select the system to install: + + + Qt::AlignCenter + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + Qt::Vertical + + + QSizePolicy::MinimumExpanding + + + + 258 + 17 + + + + + + + + + 75 + true + + + + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); + + + Select the system to upgrade: + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + + + + This option will try to import your existing desktop profile settings + + + Keep current users desktop configuration + + + + + + + + + + + + 75 + true + + + + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); + + + Enter your rsync backup settings: + + + Qt::AlignCenter + + + false + + + + + + + Hostname + + + + + + + + + + Username + + + + + + + + + + Port + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 99999 + + + 22 + + + + + + + Qt::Vertical + + + QSizePolicy::Preferred + + + + 328 + 46 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + Qt::Horizontal + + + + 182 + 245 + + + + + + + + + 0 + 0 + + + + 0 + + + + + + + + + + + + 14 + 14 + 14 + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + + + 14 + 14 + 14 + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + + + 14 + 14 + 14 + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + + + 217 + 230 + 235 + + + + + 255 + 255 + 255 + + + + + + + + + + + 75 + true + + + + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); + + + Select your Installation Source: + + + Qt::AlignCenter + + + + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + DVD / USB + + + + :/modules/images/cdrom_mount.png:/modules/images/cdrom_mount.png + + + true + + + + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + Network / Internet + + + + :/modules/images/install.png:/modules/images/install.png + + + + + + + 1 + + + + + + + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + Network Interface + + + + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + IP Address + + + + + + + 000.000.000.000; + + + Qt::AlignCenter + + + + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + Netmask + + + + + + + 000.000.000.000; + + + Qt::AlignCenter + + + + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + Nameserver (DNS) + + + + + + + 000.000.000.000; + + + Qt::AlignCenter + + + + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + Gateway + + + + + + + 000.000.000.000; + + + Qt::AlignCenter + + + + + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 183 + 164 + + + + + + + + Qt::Horizontal + + + + 182 + 164 + + + + + + + + + + + + + Index: componentselectionscreen.ui =================================================================== --- componentselectionscreen.ui (revision 0) +++ componentselectionscreen.ui (revision 0) @@ -0,0 +1,438 @@ + + + ComponentSelectionScreen + + + + 0 + 0 + 768 + 448 + + + + Form + + + + + 0 + 0 + 768 + 448 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + 0 + + + + + + + Qt::Horizontal + + + + 53 + 438 + + + + + + + + Qt::Vertical + + + + 638 + 120 + + + + + + + + Qt::Horizontal + + + + 52 + 488 + + + + + + + + + + + 0 + 0 + + + + + 0 + 26 + + + + + 9 + 75 + true + + + + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); + + + Available Components + + + 5 + + + + + + + QAbstractItemView::MultiSelection + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 0 + 0 + + + + + + + + :/PCBSD/images/next.png:/PCBSD/images/next.png + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 13 + + + + + + + + + 0 + 0 + + + + + + + + :/PCBSD/images/previous.png:/PCBSD/images/previous.png + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + 0 + 0 + + + + + 0 + 26 + + + + + 9 + 75 + true + + + + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); + + + Selected Components + + + 5 + + + + + + + QAbstractItemView::MultiSelection + + + + + + + + + + + + true + + + + + + + Qt::Vertical + + + + 628 + 120 + + + + + + + + + + + + + Index: dialogFileSystem.cpp =================================================================== --- dialogFileSystem.cpp (revision 9216) +++ dialogFileSystem.cpp (working copy) @@ -12,116 +12,116 @@ // Returns the disks MBR/GPT format scheme if known QString dialogFileSystem::getDiskScheme(QString disk) { - for (int z=0; z < sysDisks.count(); ++z) - if ( sysDisks.at(z).at(0) == "FORMAT" \ - && sysDisks.at(z).at(1) == disk ) - return sysDisks.at(z).at(2); + for (int z=0; z < sysDisks.count(); ++z) + if ( sysDisks.at(z).at(0) == "FORMAT" + && sysDisks.at(z).at(1) == disk ) + return sysDisks.at(z).at(2); - return QString(); + return QString(); } // Init our dialog with our disk / layout from the parent void dialogFileSystem::dialogInit(QList disks, QList disklayout) { - // Set that we aren't editing right now - isEditing = false; - editIndex = -1; + // Set that we aren't editing right now + isEditing = false; + editIndex = -1; - // Connnect our slots - connect(checkEncryption, SIGNAL(clicked()), this, SLOT(slotEncryptionChanged())); - connect(checkEncryptionZFS, SIGNAL(clicked()), this, SLOT(slotEncryptionChangedZFS())); - connect(pushCancel, SIGNAL(clicked()), this, SLOT(slotPushCancel())); - connect(pushSave, SIGNAL(clicked()), this, SLOT(slotPushSave())); - connect(pushAddZFS, SIGNAL(clicked()), this, SLOT(slotAddZFSMount())); - connect(pushRemoveZFS, SIGNAL(clicked()), this, SLOT(slotRemoveZFSMount())); - connect(comboDiskSelection, SIGNAL(currentIndexChanged(int)), this, SLOT(slotDiskChanged(int))); - connect(comboDiskType, SIGNAL(currentIndexChanged(int)), this, SLOT(slotTypeChanged(int))); - connect(horizontalSizeSlider, SIGNAL(sliderMoved(int)), this, SLOT(slotSliderChangedValue(int))); - connect(horizontalSizeSliderZFS, SIGNAL(sliderMoved(int)), this, SLOT(slotSliderChangedValue(int))); - connect(spinSize, SIGNAL(valueChanged(int)), this, SLOT(slotSpinBoxChanged(int))); - connect(spinSizeZFS, SIGNAL(valueChanged(int)), this, SLOT(slotSpinBoxChanged(int))); - connect(listZPoolDevices,SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(slotCheckSanity())); + // Connnect our slots + connect(checkEncryption, SIGNAL(clicked()), this, SLOT(slotEncryptionChanged())); + connect(checkEncryptionZFS, SIGNAL(clicked()), this, SLOT(slotEncryptionChangedZFS())); + connect(pushCancel, SIGNAL(clicked()), this, SLOT(slotPushCancel())); + connect(pushSave, SIGNAL(clicked()), this, SLOT(slotPushSave())); + connect(pushAddZFS, SIGNAL(clicked()), this, SLOT(slotAddZFSMount())); + connect(pushRemoveZFS, SIGNAL(clicked()), this, SLOT(slotRemoveZFSMount())); + connect(comboDiskSelection, SIGNAL(currentIndexChanged(int)), this, SLOT(slotDiskChanged(int))); + connect(comboDiskType, SIGNAL(currentIndexChanged(int)), this, SLOT(slotTypeChanged(int))); + connect(horizontalSizeSlider, SIGNAL(sliderMoved(int)), this, SLOT(slotSliderChangedValue(int))); + connect(horizontalSizeSliderZFS, SIGNAL(sliderMoved(int)), this, SLOT(slotSliderChangedValue(int))); + connect(spinSize, SIGNAL(valueChanged(int)), this, SLOT(slotSpinBoxChanged(int))); + connect(spinSizeZFS, SIGNAL(valueChanged(int)), this, SLOT(slotSpinBoxChanged(int))); + connect(listZPoolDevices,SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(slotCheckSanity())); - // Add the filesystem types - comboDiskType->addItem("UFS"); - comboDiskType->addItem("UFS+S"); - comboDiskType->addItem("UFS+SUJ"); - comboDiskType->addItem("UFS+J"); - comboDiskType->addItem("ZFS"); - comboDiskType->addItem("SWAP"); - comboDiskType->addItem("MIRROR"); + // Add the filesystem types + comboDiskType->addItem("UFS"); + comboDiskType->addItem("UFS+S"); + comboDiskType->addItem("UFS+SUJ"); + comboDiskType->addItem("UFS+J"); + comboDiskType->addItem("ZFS"); + comboDiskType->addItem("SWAP"); + comboDiskType->addItem("MIRROR"); - comboMirrorTypes->addItem("load"); - comboMirrorTypes->addItem("prefer"); - comboMirrorTypes->addItem("round-robin"); - comboMirrorTypes->addItem("split"); + comboMirrorTypes->addItem("load"); + comboMirrorTypes->addItem("prefer"); + comboMirrorTypes->addItem("round-robin"); + comboMirrorTypes->addItem("split"); - sysDisks = disks; - sysFinalDiskLayout = disklayout; + sysDisks = disks; + sysFinalDiskLayout = disklayout; - // Add the disks to the combobox - addDisksSane(); + // Add the disks to the combobox + addDisksSane(); - // Add the available zpool items - populateZpoolList(); + // Add the available zpool items + populateZpoolList(); - listZFSFileSystems->setSortingEnabled(true); + listZFSFileSystems->setSortingEnabled(true); - // Check if we should enable the save slot - slotCheckSanity(); + // Check if we should enable the save slot + slotCheckSanity(); - // Connect all the sanity checking slots - connect(spinSize, SIGNAL(valueChanged(int)), this, SLOT(slotCheckSanity())); - connect(comboDiskSelection, SIGNAL(currentIndexChanged(int)), this, SLOT(slotCheckSanity())); - connect(comboDiskType, SIGNAL(currentIndexChanged(int)), this, SLOT(slotCheckSanity())); - connect(comboMirrorDisk, SIGNAL(currentIndexChanged(int)), this, SLOT(slotCheckSanity())); - connect(lineEditMount, SIGNAL(textChanged ( const QString &)), this, SLOT(slotCheckSanity())); + // Connect all the sanity checking slots + connect(spinSize, SIGNAL(valueChanged(int)), this, SLOT(slotCheckSanity())); + connect(comboDiskSelection, SIGNAL(currentIndexChanged(int)), this, SLOT(slotCheckSanity())); + connect(comboDiskType, SIGNAL(currentIndexChanged(int)), this, SLOT(slotCheckSanity())); + connect(comboMirrorDisk, SIGNAL(currentIndexChanged(int)), this, SLOT(slotCheckSanity())); + connect(lineEditMount, SIGNAL(textChanged ( const QString &)), this, SLOT(slotCheckSanity())); } // Function which toggles encryption enable / disable for regular UFS bool dialogFileSystem::getEncPhrase() -{ - bool ok; - QString pass, confirm; - pass = QInputDialog::getText(this, tr("Enter Passphrase"), - tr("Enter the Passphrase for this encrypted disk"), QLineEdit::Password, - QString(), &ok); - if( ok && ! pass.isEmpty() ) - confirm = QInputDialog::getText(this, tr("Enter Passphrase (Confirm)"), +{ + bool ok; + QString pass, confirm; + pass = QInputDialog::getText(this, tr("Enter Passphrase"), + tr("Enter the Passphrase for this encrypted disk"), QLineEdit::Password, + QString(), &ok); + if ( ok && ! pass.isEmpty() ) + confirm = QInputDialog::getText(this, tr("Enter Passphrase (Confirm)"), tr("Confirm the Passphrase for this encrypted disk"), QLineEdit::Password, QString(), &ok); - if ( pass != confirm ) - QMessageBox::critical(this, tr("Passphrase mismatch"), tr("The entered passphrases do not match!")); + if ( pass != confirm ) + QMessageBox::critical(this, tr("Passphrase mismatch"), tr("The entered passphrases do not match!")); - if ( ok && pass == confirm ) { - encPhrase = pass; - return true; - } else - return false; + if ( ok && pass == confirm ) { + encPhrase = pass; + return true; + } else + return false; } // Function which toggles encryption enable / disable for regular UFS void dialogFileSystem::slotEncryptionChanged() { - if(checkEncryption->isChecked() && comboDiskType->currentText() != "SWAP" ) { - checkEncryptionZFS->setChecked(getEncPhrase()); - } else { - encPhrase=""; - checkEncryptionZFS->setChecked(FALSE); - } + if (checkEncryption->isChecked() && comboDiskType->currentText() != "SWAP" ) { + checkEncryptionZFS->setChecked(getEncPhrase()); + } else { + encPhrase=""; + checkEncryptionZFS->setChecked(FALSE); + } } // Function which toggles encryption enable / disable for ZFS void dialogFileSystem::slotEncryptionChangedZFS() { - if(checkEncryptionZFS->isChecked() ) { - checkEncryption->setChecked(getEncPhrase()); - } else { - encPhrase=""; - checkEncryption->setChecked(FALSE); - } + if (checkEncryptionZFS->isChecked() ) { + checkEncryption->setChecked(getEncPhrase()); + } else { + encPhrase=""; + checkEncryption->setChecked(FALSE); + } } // Function which checks that we don't have any partitions selected for this disk when using a partition @@ -132,632 +132,632 @@ QString Slice = Device; Slice = Slice.remove(0, Slice.size() -2); - // Loop through the disk layouts, and check if we have any partitions on this device - for (int i=0; i < sysFinalDiskLayout.count(); ++i) { - // Check if this drive already has some partitions created for it - if ( sysFinalDiskLayout.at(i).at(0) == Disk && \ - sysFinalDiskLayout.at(i).at(1) == "ALL" ) - return false; - } - return true; + // Loop through the disk layouts, and check if we have any partitions on this device + for (int i=0; i < sysFinalDiskLayout.count(); ++i) { + // Check if this drive already has some partitions created for it + if ( sysFinalDiskLayout.at(i).at(0) == Disk && + sysFinalDiskLayout.at(i).at(1) == "ALL" ) + return false; + } + return true; } // Disk no mirror setup bool dialogFileSystem::diskNoZFSMirrorSet(QString Device) { - // Loop through the disk layouts and look for any "XtraOptions" - for (int i=0; i < sysFinalDiskLayout.count(); ++i) { - QStringList XtraOpts = sysFinalDiskLayout.at(i).at(5).split(" "); - for (int z = 0; z < XtraOpts.size(); ++z) - if ( XtraOpts.at(z) == Device ) - return false; - } + // Loop through the disk layouts and look for any "XtraOptions" + for (int i=0; i < sysFinalDiskLayout.count(); ++i) { + QStringList XtraOpts = sysFinalDiskLayout.at(i).at(5).split(" "); + for (int z = 0; z < XtraOpts.size(); ++z) + if ( XtraOpts.at(z) == Device ) + return false; + } - return true; + return true; } // Function which checks that we don't have any partitions on this disk already specified bool dialogFileSystem::diskNoExistingPartition(QString Device) { - // Loop through the disk layouts, and check if we have any partitions on this device - for (int i=0; i < sysFinalDiskLayout.count(); ++i) { - // Check if this drive already has some partitions created for it - if ( ( sysFinalDiskLayout.at(i).at(0) == Device && sysFinalDiskLayout.at(i).at(1) != "ALL") \ - || (sysFinalDiskLayout.at(i).at(0) == Device && sysFinalDiskLayout.at(i).at(2).indexOf("MIRROR") != -1 ) ) - return false; - } - return true; + // Loop through the disk layouts, and check if we have any partitions on this device + for (int i=0; i < sysFinalDiskLayout.count(); ++i) { + // Check if this drive already has some partitions created for it + if ( ( sysFinalDiskLayout.at(i).at(0) == Device && sysFinalDiskLayout.at(i).at(1) != "ALL") + || (sysFinalDiskLayout.at(i).at(0) == Device && sysFinalDiskLayout.at(i).at(2).indexOf("MIRROR") != -1 ) ) + return false; + } + return true; } // Function which adds our disks / slices to the combo boxes in a sane manner void dialogFileSystem::addDisksSane() { - QString availSize, desc; + QString availSize, desc; - comboDiskSelection->clear(); + comboDiskSelection->clear(); - // Start adding / listing our disks / partitions available - for (int i=0; i < sysDisks.count(); ++i) { - // Make sure to only add the drives to the comboDiskList - if ( sysDisks.at(i).at(0) == "DRIVE" && diskNoExistingPartition(sysDisks.at(i).at(1)) ) { - availSize.setNum(calculateFreeSpace(i)); - desc = sysDisks.at(i).at(3); - desc = desc.remove(0, 1); - desc.truncate(desc.size() -1); - desc.truncate(20); - comboDiskSelection->addItem(sysDisks.at(i).at(1) + " - " + sysDisks.at(i).at(2) + "MB (" + availSize + " Avail) " + desc); - comboMirrorDisk->addItem(sysDisks.at(i).at(1) + " - " + sysDisks.at(i).at(2) + "MB " + sysDisks.at(i).at(3)); - } else if ( sysDisks.at(i).at(0) == "SLICE" \ - && getDiskScheme(sysDisks.at(i).at(1)) == "MBR" \ - && sliceNoExistingDiskPartition(sysDisks.at(i).at(2) ) ) { - availSize.setNum(calculateFreeSpace(i)); - desc = sysDisks.at(i).at(4); - if ( desc != "Unused Space") { - desc = desc.remove(0, 1); - desc.truncate(desc.size() -1); - desc.truncate(20); - } - comboDiskSelection->addItem(sysDisks.at(i).at(2) + " - " + sysDisks.at(i).at(3) + "MB (" + availSize + " Avail) " + desc); + // Start adding / listing our disks / partitions available + for (int i=0; i < sysDisks.count(); ++i) { + // Make sure to only add the drives to the comboDiskList + if ( sysDisks.at(i).at(0) == "DRIVE" && diskNoExistingPartition(sysDisks.at(i).at(1)) ) { + availSize.setNum(calculateFreeSpace(i)); + desc = sysDisks.at(i).at(3); + desc = desc.remove(0, 1); + desc.truncate(desc.size() -1); + desc.truncate(20); + comboDiskSelection->addItem(sysDisks.at(i).at(1) + " - " + sysDisks.at(i).at(2) + "MB (" + availSize + " Avail) " + desc); + comboMirrorDisk->addItem(sysDisks.at(i).at(1) + " - " + sysDisks.at(i).at(2) + "MB " + sysDisks.at(i).at(3)); + } else if ( sysDisks.at(i).at(0) == "SLICE" + && getDiskScheme(sysDisks.at(i).at(1)) == "MBR" + && sliceNoExistingDiskPartition(sysDisks.at(i).at(2) ) ) { + availSize.setNum(calculateFreeSpace(i)); + desc = sysDisks.at(i).at(4); + if ( desc != "Unused Space") { + desc = desc.remove(0, 1); + desc.truncate(desc.size() -1); + desc.truncate(20); + } + comboDiskSelection->addItem(sysDisks.at(i).at(2) + " - " + sysDisks.at(i).at(3) + "MB (" + availSize + " Avail) " + desc); + } } - } } // Check the sanity of the zpool -bool dialogFileSystem::checkZpoolSanity() +bool dialogFileSystem::checkZpoolSanity() { QStringList zUsed; QString tmp; // Check for any zpool conflicts for ( int z=0; zcount(); ++z) { - tmp = listZPoolDevices->item(z)->text(); - tmp.truncate(tmp.indexOf(" ")); + tmp = listZPoolDevices->item(z)->text(); + tmp.truncate(tmp.indexOf(" ")); - // Test if this device is checked and we need to add it to the used pile - if ( listZPoolDevices->item(z)->checkState() == Qt::Checked ) - zUsed << tmp; + // Test if this device is checked and we need to add it to the used pile + if ( listZPoolDevices->item(z)->checkState() == Qt::Checked ) + zUsed << tmp; } // Now check if this device cannot be included with already checked ones for (int i=0; i < zUsed.count(); ++i) - for ( int z=0; z < zUsed.count(); ++z) - if ( zUsed.at(i).indexOf(zUsed.at(z)) != -1 && zUsed.at(i) != zUsed.at(z) ) - return false; + for ( int z=0; z < zUsed.count(); ++z) + if ( zUsed.at(i).indexOf(zUsed.at(z)) != -1 && zUsed.at(i) != zUsed.at(z) ) + return false; - return true; + return true; } // Function to display the list of available drivces / partitions which can be added to this zpool void dialogFileSystem::populateZpoolList() { - QString availSize, desc; + QString availSize, desc; - // Figure out the current device - QString curDevice, curSlice; + // Figure out the current device + QString curDevice, curSlice; // Get the index - int sysIndex = getSysIndexFromCombo(comboDiskSelection->currentIndex()); + int sysIndex = getSysIndexFromCombo(comboDiskSelection->currentIndex()); - if ( sysIndex == -1 ) - return; + if ( sysIndex == -1 ) + return; - // Set our vars with Disk / Slice info, size, etc - curDevice = sysDisks.at(sysIndex).at(1); - if ( sysDisks.at(sysIndex).at(0) == "SLICE") - curSlice = sysDisks.at(sysIndex).at(1) + sysDisks.at(sysIndex).at(2); + // Set our vars with Disk / Slice info, size, etc + curDevice = sysDisks.at(sysIndex).at(1); + if ( sysDisks.at(sysIndex).at(0) == "SLICE") + curSlice = sysDisks.at(sysIndex).at(1) + sysDisks.at(sysIndex).at(2); - listZPoolDevices->clear(); + listZPoolDevices->clear(); - // Start adding / listing our disks - for (int i=0; i < sysDisks.count(); ++i) { - // Make sure to only add the drives to the comboDiskList - if ( sysDisks.at(i).at(0) == "DRIVE" \ - && diskNoExistingPartition(sysDisks.at(i).at(1)) \ - && curDevice != sysDisks.at(i).at(1) \ - ) { - availSize.setNum(calculateFreeSpace(i)); - desc = sysDisks.at(i).at(3); - desc = desc.remove(0, 1); - desc.truncate(desc.size() -1); - desc.truncate(25); - - QListWidgetItem *zpoolDev = new QListWidgetItem(sysDisks.at(i).at(1) + " - " + sysDisks.at(i).at(2) + "MB " + desc, listZPoolDevices); - zpoolDev->setCheckState(Qt::Unchecked); + // Start adding / listing our disks + for (int i=0; i < sysDisks.count(); ++i) { + // Make sure to only add the drives to the comboDiskList + if ( sysDisks.at(i).at(0) == "DRIVE" + && diskNoExistingPartition(sysDisks.at(i).at(1)) + && curDevice != sysDisks.at(i).at(1) + ) { + availSize.setNum(calculateFreeSpace(i)); + desc = sysDisks.at(i).at(3); + desc = desc.remove(0, 1); + desc.truncate(desc.size() -1); + desc.truncate(25); - if ( calculateFreeSpace(i) <= 0 ) - zpoolDev->setHidden(TRUE); + QListWidgetItem *zpoolDev = new QListWidgetItem(sysDisks.at(i).at(1) + " - " + sysDisks.at(i).at(2) + "MB " + desc, listZPoolDevices); + zpoolDev->setCheckState(Qt::Unchecked); - } - } + if ( calculateFreeSpace(i) <= 0 ) + zpoolDev->setHidden(TRUE); - // Start adding our available slices - for (int i=0; i < sysDisks.count(); ++i) { - // Make sure to only add the drives to the comboDiskList - if ( sysDisks.at(i).at(0) == "SLICE" \ - && curSlice != sysDisks.at(i).at(1) + sysDisks.at(i).at(2) \ - && curDevice != sysDisks.at(i).at(1) \ - ) { - availSize.setNum(calculateFreeSpace(i)); - desc = sysDisks.at(i).at(4); - desc.truncate(30); - - QListWidgetItem *zpoolDev = new QListWidgetItem(sysDisks.at(i).at(2) + " - " + sysDisks.at(i).at(3) + "MB " + desc, listZPoolDevices); - zpoolDev->setCheckState(Qt::Unchecked); + } + } - if ( calculateFreeSpace(i) <= 0 ) - zpoolDev->setHidden(TRUE); - } - } + // Start adding our available slices + for (int i=0; i < sysDisks.count(); ++i) { + // Make sure to only add the drives to the comboDiskList + if ( sysDisks.at(i).at(0) == "SLICE" + && curSlice != sysDisks.at(i).at(1) + sysDisks.at(i).at(2) + && curDevice != sysDisks.at(i).at(1) + ) { + availSize.setNum(calculateFreeSpace(i)); + desc = sysDisks.at(i).at(4); + desc.truncate(30); + QListWidgetItem *zpoolDev = new QListWidgetItem(sysDisks.at(i).at(2) + " - " + sysDisks.at(i).at(3) + "MB " + desc, listZPoolDevices); + zpoolDev->setCheckState(Qt::Unchecked); + if ( calculateFreeSpace(i) <= 0 ) + zpoolDev->setHidden(TRUE); + } + } + + } // Public slot which lets us set if we are editing a partition, or creating a new one void dialogFileSystem::setEditing( int id ) { - QString searchDev, cText, tmp, FsType, XtraOpts; - int size; - bool ok; + QString searchDev, cText, tmp, FsType, XtraOpts; + int size; + bool ok; - isEditing = true; - editIndex = id; + isEditing = true; + editIndex = id; - FsType = sysFinalDiskLayout.at(id).at(3); - XtraOpts = sysFinalDiskLayout.at(id).at(5); + FsType = sysFinalDiskLayout.at(id).at(3); + XtraOpts = sysFinalDiskLayout.at(id).at(5); - // Lets figure out which slice / disk to show in our combo box before disabling it - if ( sysFinalDiskLayout.at(id).at(1) == "ALL" ) - searchDev = sysFinalDiskLayout.at(id).at(0); - else - searchDev = sysFinalDiskLayout.at(id).at(0) + sysFinalDiskLayout.at(id).at(1); + // Lets figure out which slice / disk to show in our combo box before disabling it + if ( sysFinalDiskLayout.at(id).at(1) == "ALL" ) + searchDev = sysFinalDiskLayout.at(id).at(0); + else + searchDev = sysFinalDiskLayout.at(id).at(0) + sysFinalDiskLayout.at(id).at(1); - //qDebug() << "Edit Dev:" << searchDev; + //qDebug() << "Edit Dev:" << searchDev; - for ( int i = 0; i <= comboDiskSelection->count(); i++ ) - { - cText = comboDiskSelection->itemText(i); - cText.truncate(cText.indexOf(" -")); - if ( cText == searchDev) { - comboDiskSelection->setCurrentIndex(i); - break; + for ( int i = 0; i <= comboDiskSelection->count(); i++ ) + { + cText = comboDiskSelection->itemText(i); + cText.truncate(cText.indexOf(" -")); + if ( cText == searchDev) { + comboDiskSelection->setCurrentIndex(i); + break; + } } - } - comboDiskSelection->setEnabled(false); + comboDiskSelection->setEnabled(false); - // Figure out the filesystem - tmp = sysFinalDiskLayout.at(id).at(3); - if ( tmp == "load" || tmp == "prefer" || tmp == "round-robin" || tmp == "split" ) - { - // We are editing a mirror - for ( int i = 0; i <= comboMirrorTypes->count(); i++ ) + // Figure out the filesystem + tmp = sysFinalDiskLayout.at(id).at(3); + if ( tmp == "load" || tmp == "prefer" || tmp == "round-robin" || tmp == "split" ) { - if ( comboMirrorTypes->itemText(i) == tmp) { - comboMirrorTypes->setCurrentIndex(i); - break; - } + // We are editing a mirror + for ( int i = 0; i <= comboMirrorTypes->count(); i++ ) + { + if ( comboMirrorTypes->itemText(i) == tmp) { + comboMirrorTypes->setCurrentIndex(i); + break; + } + } + for ( int i = 0; i <= comboDiskType->count(); i++ ) + { + if ( comboDiskType->itemText(i) == "MIRROR") { + comboDiskType->setCurrentIndex(i); + break; + } + } + } else { + // Check for encryption + if ( tmp.indexOf(".eli") != -1 ) + { + checkEncryption->setChecked(true); + checkEncryptionZFS->setChecked(true); + tmp.truncate(tmp.indexOf(".eli")); + } + for ( int i = 0; i <= comboDiskType->count(); i++ ) + { + if ( comboDiskType->itemText(i) == tmp) { + comboDiskType->setCurrentIndex(i); + break; + } + } } - for ( int i = 0; i <= comboDiskType->count(); i++ ) + + // Now figure out the size + // We already have the available size in our slider, add the editing size + tmp = sysFinalDiskLayout.at(id).at(4); + size = tmp.toInt(&ok); + if ( ok ) { - if ( comboDiskType->itemText(i) == "MIRROR") { - comboDiskType->setCurrentIndex(i); - break; - } + int maxsize = calculateFreeSpace(getSysIndexFromCombo(comboDiskSelection->currentIndex() ) ) + size; + horizontalSizeSlider->setMinimum(0); + horizontalSizeSlider->setMaximum(maxsize); + horizontalSizeSlider->setValue(size); + horizontalSizeSliderZFS->setMinimum(0); + horizontalSizeSliderZFS->setMaximum(maxsize); + horizontalSizeSliderZFS->setValue(size); + spinSize->setRange(0, maxsize); + spinSize->setValue(size); + spinSizeZFS->setRange(0, maxsize); + spinSizeZFS->setValue(size); } - } else { - // Check for encryption - if ( tmp.indexOf(".eli") != -1 ) - { - checkEncryption->setChecked(true); - checkEncryptionZFS->setChecked(true); - tmp.truncate(tmp.indexOf(".eli")); - } - for ( int i = 0; i <= comboDiskType->count(); i++ ) - { - if ( comboDiskType->itemText(i) == tmp) { - comboDiskType->setCurrentIndex(i); - break; - } - } - } - // Now figure out the size - // We already have the available size in our slider, add the editing size - tmp = sysFinalDiskLayout.at(id).at(4); - size = tmp.toInt(&ok); - if ( ok ) - { - int maxsize = calculateFreeSpace(getSysIndexFromCombo(comboDiskSelection->currentIndex() ) ) + size; - horizontalSizeSlider->setMinimum(0); - horizontalSizeSlider->setMaximum(maxsize); - horizontalSizeSlider->setValue(size); - horizontalSizeSliderZFS->setMinimum(0); - horizontalSizeSliderZFS->setMaximum(maxsize); - horizontalSizeSliderZFS->setValue(size); - spinSize->setRange(0, maxsize); - spinSize->setValue(size); - spinSizeZFS->setRange(0, maxsize); - spinSizeZFS->setValue(size); - } - - // Figure out the mnt - tmp = sysFinalDiskLayout.at(id).at(2); - if ( tmp.indexOf("MIRROR") != -1 ) - { - stackedWidgetOptions->setCurrentIndex(1); - tmp = tmp.remove(0, tmp.indexOf("(") + 1); - tmp.truncate(tmp.indexOf(")")); - // Set the right mirror name - for ( int i = 0; i <= comboMirrorDisk->count(); i++ ) + // Figure out the mnt + tmp = sysFinalDiskLayout.at(id).at(2); + if ( tmp.indexOf("MIRROR") != -1 ) { - if ( comboMirrorDisk->itemText(i).indexOf(tmp + " -") != -1 ) { - comboMirrorDisk->setCurrentIndex(i); - break; - } - } - } else { - // If this is a ZFS filesystem - if ( FsType.indexOf("ZFS") != -1 ) { - stackedWidgetOptions->setCurrentIndex(2); - - // Add the ZFS mounts - QStringList ZMounts = tmp.split(","); - for (int i = 0; i < ZMounts.size(); ++i) - listZFSFileSystems->addItem(ZMounts.at(i)); - - // Check for any XtraOpts for ZFS - if ( XtraOpts.indexOf("mirror:") != -1 ) { - comboPoolType->setCurrentIndex(1) ; - XtraOpts = XtraOpts.remove(0, XtraOpts.indexOf(":") + 1); - } - if ( XtraOpts.indexOf("raidz:") != -1 ) { - comboPoolType->setCurrentIndex(2); - XtraOpts = XtraOpts.remove(0, XtraOpts.indexOf(":") + 1); - } - XtraOpts = XtraOpts.simplified(); - // Check any other devices included in the zpool - QStringList PoolDevs = XtraOpts.split(" "); - for (int i = 0; i < PoolDevs.size(); ++i) - for ( int z=0; zcount(); ++z) - if ( listZPoolDevices->item(z)->text().indexOf(PoolDevs.at(i) + " ") == 0 ) { - listZPoolDevices->item(z)->setCheckState(Qt::Checked); - listZPoolDevices->item(z)->setHidden(false); - } + stackedWidgetOptions->setCurrentIndex(1); + tmp = tmp.remove(0, tmp.indexOf("(") + 1); + tmp.truncate(tmp.indexOf(")")); + // Set the right mirror name + for ( int i = 0; i <= comboMirrorDisk->count(); i++ ) + { + if ( comboMirrorDisk->itemText(i).indexOf(tmp + " -") != -1 ) { + comboMirrorDisk->setCurrentIndex(i); + break; + } + } + } else { + // If this is a ZFS filesystem + if ( FsType.indexOf("ZFS") != -1 ) { + stackedWidgetOptions->setCurrentIndex(2); - } else { - if ( tmp == "none" ) - tmp = ""; - // Not ZFS, regular UFS - lineEditMount->setText(tmp); + // Add the ZFS mounts + QStringList ZMounts = tmp.split(","); + for (int i = 0; i < ZMounts.size(); ++i) + listZFSFileSystems->addItem(ZMounts.at(i)); + + // Check for any XtraOpts for ZFS + if ( XtraOpts.indexOf("mirror:") != -1 ) { + comboPoolType->setCurrentIndex(1) ; + XtraOpts = XtraOpts.remove(0, XtraOpts.indexOf(":") + 1); + } + if ( XtraOpts.indexOf("raidz:") != -1 ) { + comboPoolType->setCurrentIndex(2); + XtraOpts = XtraOpts.remove(0, XtraOpts.indexOf(":") + 1); + } + XtraOpts = XtraOpts.simplified(); + // Check any other devices included in the zpool + QStringList PoolDevs = XtraOpts.split(" "); + for (int i = 0; i < PoolDevs.size(); ++i) + for ( int z=0; zcount(); ++z) + if ( listZPoolDevices->item(z)->text().indexOf(PoolDevs.at(i) + " ") == 0 ) { + listZPoolDevices->item(z)->setCheckState(Qt::Checked); + listZPoolDevices->item(z)->setHidden(false); + } + + } else { + if ( tmp == "none" ) + tmp = ""; + // Not ZFS, regular UFS + lineEditMount->setText(tmp); + } } - } - // Go ahead and enable the save button assuming things are OK - slotCheckSanity(); - + // Go ahead and enable the save button assuming things are OK + slotCheckSanity(); + } // Slot for checking the current type void dialogFileSystem::slotTypeChanged(int index) { - if ( comboDiskType->itemText(index) == "MIRROR" ) - stackedWidgetOptions->setCurrentIndex(1); - else if (comboDiskType->itemText(index) == "ZFS" ) - stackedWidgetOptions->setCurrentIndex(2); - else if (comboDiskType->itemText(index) == "SWAP" ) { - stackedWidgetOptions->setCurrentIndex(0); - lineEditMount->setEnabled(false); - lineEditMount->setVisible(false); - } else { - stackedWidgetOptions->setCurrentIndex(0); - lineEditMount->setVisible(true); - lineEditMount->setEnabled(true); - } + if ( comboDiskType->itemText(index) == "MIRROR" ) + stackedWidgetOptions->setCurrentIndex(1); + else if (comboDiskType->itemText(index) == "ZFS" ) + stackedWidgetOptions->setCurrentIndex(2); + else if (comboDiskType->itemText(index) == "SWAP" ) { + stackedWidgetOptions->setCurrentIndex(0); + lineEditMount->setEnabled(false); + lineEditMount->setVisible(false); + } else { + stackedWidgetOptions->setCurrentIndex(0); + lineEditMount->setVisible(true); + lineEditMount->setEnabled(true); + } - slotCheckSanity(); + slotCheckSanity(); } // Slot to add a new ZFS mount to our list void dialogFileSystem::slotAddZFSMount() { - dialogZFSMount *dialogZFS = new dialogZFSMount(); - dialogZFS->dialogInit(); - connect(dialogZFS, SIGNAL(saved(QString)), this, SLOT(slotSaveNewZFSMount(QString))); - dialogZFS->show(); - + dialogZFSMount *dialogZFS = new dialogZFSMount(); + dialogZFS->dialogInit(); + connect(dialogZFS, SIGNAL(saved(QString)), this, SLOT(slotSaveNewZFSMount(QString))); + dialogZFS->show(); + } // Slot to add the new ZFS mount to our array void dialogFileSystem::slotSaveNewZFSMount(QString newMount) { - // Make sure we don't have a duplicate mount - for ( int i = 0; i< listZFSFileSystems->count(); i++) - if ( listZFSFileSystems->item(i)->text() == newMount) - return; + // Make sure we don't have a duplicate mount + for ( int i = 0; i< listZFSFileSystems->count(); i++) + if ( listZFSFileSystems->item(i)->text() == newMount) + return; - listZFSFileSystems->addItem(newMount); + listZFSFileSystems->addItem(newMount); - slotCheckSanity(); + slotCheckSanity(); } // Slot to remove a ZFS mount to our list void dialogFileSystem::slotRemoveZFSMount() { - if ( listZFSFileSystems->currentRow() == -1 ) - return; + if ( listZFSFileSystems->currentRow() == -1 ) + return; - delete listZFSFileSystems->takeItem(listZFSFileSystems->currentRow()); - - slotCheckSanity(); + delete listZFSFileSystems->takeItem(listZFSFileSystems->currentRow()); + + slotCheckSanity(); } // Slot for checking the current selected disk / partition void dialogFileSystem::slotDiskChanged(int index) { - int count, typeIndex; + int count, typeIndex; - // Save where we are on the type - typeIndex = comboDiskType->currentIndex(); + // Save where we are on the type + typeIndex = comboDiskType->currentIndex(); - count = comboDiskType->count(); - for ( int i = 0; i < count ; i++) - { - if ( comboDiskType->itemText(i) == "MIRROR" ) - comboDiskType->removeItem(i); - } + count = comboDiskType->count(); + for ( int i = 0; i < count ; i++) + { + if ( comboDiskType->itemText(i) == "MIRROR" ) + comboDiskType->removeItem(i); + } - int sysIndex = getSysIndexFromCombo(index); + int sysIndex = getSysIndexFromCombo(index); - if ( sysDisks.at(sysIndex).at(0) == "DRIVE" ) - { - // Check if we have any available disks to mirror with - comboMirrorDisk->clear(); - bool found; - found = false; - QString availSize, desc; - // Update the mirror list - for (int i=0; i < sysDisks.count(); ++i) { - if ( sysDisks.at(i).at(0) == "DRIVE" && i != sysIndex) { - availSize.setNum(calculateFreeSpace(i)); - desc = sysDisks.at(i).at(3); - desc = desc.remove(0, 1); - desc.truncate(desc.size() -1); - desc.truncate(20); - comboMirrorDisk->addItem(sysDisks.at(i).at(1) + " - " + sysDisks.at(i).at(2) + "MB " + sysDisks.at(i).at(3)); - found = true; - } + if ( sysDisks.at(sysIndex).at(0) == "DRIVE" ) + { + // Check if we have any available disks to mirror with + comboMirrorDisk->clear(); + bool found; + found = false; + QString availSize, desc; + // Update the mirror list + for (int i=0; i < sysDisks.count(); ++i) { + if ( sysDisks.at(i).at(0) == "DRIVE" && i != sysIndex) { + availSize.setNum(calculateFreeSpace(i)); + desc = sysDisks.at(i).at(3); + desc = desc.remove(0, 1); + desc.truncate(desc.size() -1); + desc.truncate(20); + comboMirrorDisk->addItem(sysDisks.at(i).at(1) + " - " + sysDisks.at(i).at(2) + "MB " + sysDisks.at(i).at(3)); + found = true; + } + } + + if (found) + comboDiskType->addItem("MIRROR"); } - if (found) - comboDiskType->addItem("MIRROR"); - } + if ( typeIndex <= comboDiskType->count() ) + comboDiskType->setCurrentIndex(typeIndex); + else + comboDiskType->setCurrentIndex(0); - if ( typeIndex <= comboDiskType->count() ) - comboDiskType->setCurrentIndex(typeIndex); - else - comboDiskType->setCurrentIndex(0); + // Now figure out how much disk space to show + int maxsize = calculateFreeSpace(getSysIndexFromCombo(index)); + horizontalSizeSlider->setMinimum(0); + horizontalSizeSlider->setMaximum(maxsize); + horizontalSizeSlider->setValue(maxsize); + horizontalSizeSliderZFS->setMinimum(0); + horizontalSizeSliderZFS->setMaximum(maxsize); + horizontalSizeSliderZFS->setValue(maxsize); + spinSize->setRange(0, maxsize); + spinSize->setValue(maxsize); + spinSizeZFS->setRange(0, maxsize); + spinSizeZFS->setValue(maxsize); - // Now figure out how much disk space to show - int maxsize = calculateFreeSpace(getSysIndexFromCombo(index)); - horizontalSizeSlider->setMinimum(0); - horizontalSizeSlider->setMaximum(maxsize); - horizontalSizeSlider->setValue(maxsize); - horizontalSizeSliderZFS->setMinimum(0); - horizontalSizeSliderZFS->setMaximum(maxsize); - horizontalSizeSliderZFS->setValue(maxsize); - spinSize->setRange(0, maxsize); - spinSize->setValue(maxsize); - spinSizeZFS->setRange(0, maxsize); - spinSizeZFS->setValue(maxsize); - - // Relist the zpools - populateZpoolList(); + // Relist the zpools + populateZpoolList(); } // function which updates the spinbox when the user drags the slider void dialogFileSystem::slotSliderChangedValue(int newVal) { - spinSize->setValue(newVal); - spinSizeZFS->setValue(newVal); + spinSize->setValue(newVal); + spinSizeZFS->setValue(newVal); } // function which updates the spinbox when the user drags the slider void dialogFileSystem::slotSpinBoxChanged(int newVal) { - horizontalSizeSlider->setValue(newVal); - horizontalSizeSliderZFS->setValue(newVal); + horizontalSizeSlider->setValue(newVal); + horizontalSizeSliderZFS->setValue(newVal); } // Function which takes a combo index, and returns the associated sysDisk index int dialogFileSystem::getSysIndexFromCombo(int cIndex) { - QString cText = comboDiskSelection->itemText(cIndex); + QString cText = comboDiskSelection->itemText(cIndex); - cText.truncate(cText.indexOf(" -")); + cText.truncate(cText.indexOf(" -")); - for (int i=0; i < sysDisks.count(); ++i) { - if ( sysDisks.at(i).at(1) == cText || sysDisks.at(i).at(2) == cText ) - return i; - } + for (int i=0; i < sysDisks.count(); ++i) { + if ( sysDisks.at(i).at(1) == cText || sysDisks.at(i).at(2) == cText ) + return i; + } - return -1; + return -1; } // function which calculates the free space available for a disk / partition that we can show the user int dialogFileSystem::calculateFreeSpace(int diskIndex) { - QString Disk, Slice, tmp; - int fullSize, workingSize, availSize, sysIndex; - bool ok; - - availSize = 0; + QString Disk, Slice, tmp; + int fullSize, workingSize, availSize, sysIndex; + bool ok; - sysIndex = diskIndex; + availSize = 0; - if ( sysDisks.at(sysIndex).at(0) == "DRIVE") { - Disk = sysDisks.at(sysIndex).at(1); - Slice = "ALL"; - tmp = sysDisks.at(sysIndex).at(2); - fullSize = tmp.toInt(&ok); - } else { - Disk = sysDisks.at(sysIndex).at(1); - Slice = sysDisks.at(sysIndex).at(2); - Slice = Slice.remove(0, Slice.size() -2); - tmp = sysDisks.at(sysIndex).at(3); - fullSize = tmp.toInt(&ok); - } + sysIndex = diskIndex; - // Make sure we don't have invalid fullSize data - if (!ok) - return 0; + if ( sysDisks.at(sysIndex).at(0) == "DRIVE") { + Disk = sysDisks.at(sysIndex).at(1); + Slice = "ALL"; + tmp = sysDisks.at(sysIndex).at(2); + fullSize = tmp.toInt(&ok); + } else { + Disk = sysDisks.at(sysIndex).at(1); + Slice = sysDisks.at(sysIndex).at(2); + Slice = Slice.remove(0, Slice.size() -2); + tmp = sysDisks.at(sysIndex).at(3); + fullSize = tmp.toInt(&ok); + } - // Check if this disk / slice is used in a raid already - if ( ! diskNoZFSMirrorSet(sysDisks.at(sysIndex).at(1)) ) - return 0; - if ( Slice != "ALL" ) - if ( ! diskNoZFSMirrorSet(sysDisks.at(sysIndex).at(1) + sysDisks.at(sysIndex).at(2)) ) - return 0; + // Make sure we don't have invalid fullSize data + if (!ok) + return 0; + // Check if this disk / slice is used in a raid already + if ( ! diskNoZFSMirrorSet(sysDisks.at(sysIndex).at(1)) ) + return 0; + if ( Slice != "ALL" ) + if ( ! diskNoZFSMirrorSet(sysDisks.at(sysIndex).at(1) + sysDisks.at(sysIndex).at(2)) ) + return 0; - // Set the available size to the entire thing, and start decrementing - availSize = fullSize - 5; - for (int i=0; i < sysFinalDiskLayout.count(); ++i) { - // Check if this mount is on the target partition / drive - if ( sysFinalDiskLayout.at(i).at(0) == Disk && sysFinalDiskLayout.at(i).at(1) == Slice ) { - tmp = sysFinalDiskLayout.at(i).at(4); - workingSize = tmp.toInt(&ok); - if(!ok) - return 0; - availSize = availSize - workingSize; + // Set the available size to the entire thing, and start decrementing + availSize = fullSize - 5; + + for (int i=0; i < sysFinalDiskLayout.count(); ++i) { + // Check if this mount is on the target partition / drive + if ( sysFinalDiskLayout.at(i).at(0) == Disk && sysFinalDiskLayout.at(i).at(1) == Slice ) { + tmp = sysFinalDiskLayout.at(i).at(4); + workingSize = tmp.toInt(&ok); + if (!ok) + return 0; + availSize = availSize - workingSize; + } } - } - //qDebug() << "Disk:" << Disk << "Slice:" << Slice << "Avail Size:" << availSize; - return availSize; + //qDebug() << "Disk:" << Disk << "Slice:" << Slice << "Avail Size:" << availSize; + return availSize; } // Slot which does basic sanity checking before enabling the save button void dialogFileSystem::slotCheckSanity() { - bool ready; - ready = true; - labelStatus->setText(""); - QString Disk, Slice; - - // Get the index - int sysIndex = getSysIndexFromCombo(comboDiskSelection->currentIndex()); - - if ( sysIndex == -1 ) - return; + bool ready; + ready = true; + labelStatus->setText(""); + QString Disk, Slice; - // Set our vars with Disk / Slice info, size, etc - if ( sysDisks.at(sysIndex).at(0) == "DRIVE") { - Disk = sysDisks.at(sysIndex).at(1); - Slice = "ALL"; - } else { - Disk = sysDisks.at(sysIndex).at(1); - Slice = sysDisks.at(sysIndex).at(2); - Slice = Slice.remove(0, Slice.size() -2); - } + // Get the index + int sysIndex = getSysIndexFromCombo(comboDiskSelection->currentIndex()); + if ( sysIndex == -1 ) + return; - // If we are on a non-mirror type - if ( comboDiskType->currentText() != "MIRROR" \ - && comboDiskType->currentText() != "ZFS" ) { + // Set our vars with Disk / Slice info, size, etc + if ( sysDisks.at(sysIndex).at(0) == "DRIVE") { + Disk = sysDisks.at(sysIndex).at(1); + Slice = "ALL"; + } else { + Disk = sysDisks.at(sysIndex).at(1); + Slice = sysDisks.at(sysIndex).at(2); + Slice = Slice.remove(0, Slice.size() -2); + } - if ( spinSize->value() <= 0) - ready = false; - if ( lineEditMount->text().isEmpty() && comboDiskType->currentText() != "SWAP" ) - ready = false; + // If we are on a non-mirror type + if ( comboDiskType->currentText() != "MIRROR" + && comboDiskType->currentText() != "ZFS" ) { - if ( ! lineEditMount->text().isEmpty() \ - && lineEditMount->text().indexOf("/") != 0 \ - && comboDiskType->currentText() != "SWAP" ) { - labelStatus->setText(tr("Error: Invalid Mount Point.")); - ready = false; - } + if ( spinSize->value() <= 0) + ready = false; - // Check if we already have one of these mounts - if ( ! checkExistingMount() ) { - labelStatus->setText(tr("Error: A partition with this mount point already exists!")); - ready = false; - } + if ( lineEditMount->text().isEmpty() && comboDiskType->currentText() != "SWAP" ) + ready = false; - int totalPart = 0; - for (int i=0; i < sysFinalDiskLayout.count(); ++i) { + if ( ! lineEditMount->text().isEmpty() + && lineEditMount->text().indexOf("/") != 0 + && comboDiskType->currentText() != "SWAP" ) { + labelStatus->setText(tr("Error: Invalid Mount Point.")); + ready = false; + } - // Check if we already have a swap for this partition - if ( sysFinalDiskLayout.at(i).at(0) == Disk \ - && sysFinalDiskLayout.at(i).at(1) == Slice \ - && sysFinalDiskLayout.at(i).at(2) == "SWAP" \ - && comboDiskType->currentText() == "SWAP" \ - && ! isEditing ) { - ready = false; - labelStatus->setText(tr("Error: This partition already has a valid swap.")); - } - - // Check the number of partitions for this disk already - if ( ( sysFinalDiskLayout.at(i).at(0) == Disk \ - && sysFinalDiskLayout.at(i).at(1) == Slice ) \ - && ( sysFinalDiskLayout.at(i).at(2) != "SWAP" \ - && sysFinalDiskLayout.at(i).at(2) != "/" ) \ - && ! isEditing ) { - totalPart++; - } - } + // Check if we already have one of these mounts + if ( ! checkExistingMount() ) { + labelStatus->setText(tr("Error: A partition with this mount point already exists!")); + ready = false; + } - // Check if we ended up with more partitions than we can support - if ( totalPart > 4 ) - { - ready = false; - labelStatus->setText(tr("Error: No more available partitions for this disk/slice.")); - } + int totalPart = 0; + for (int i=0; i < sysFinalDiskLayout.count(); ++i) { - } else if ( comboDiskType->currentText() == "ZFS" ) { - // ZFS Sanity Checks - if ( spinSize->value() <= 0) - ready = false; + // Check if we already have a swap for this partition + if ( sysFinalDiskLayout.at(i).at(0) == Disk + && sysFinalDiskLayout.at(i).at(1) == Slice + && sysFinalDiskLayout.at(i).at(2) == "SWAP" + && comboDiskType->currentText() == "SWAP" + && ! isEditing ) { + ready = false; + labelStatus->setText(tr("Error: This partition already has a valid swap.")); + } - if ( listZFSFileSystems->count() <= 0 ) { - labelStatus->setText(tr("Error: Need a at least one ZFS filesystem mount point.")); - ready = false; - } + // Check the number of partitions for this disk already + if ( ( sysFinalDiskLayout.at(i).at(0) == Disk + && sysFinalDiskLayout.at(i).at(1) == Slice ) + && ( sysFinalDiskLayout.at(i).at(2) != "SWAP" + && sysFinalDiskLayout.at(i).at(2) != "/" ) + && ! isEditing ) { + totalPart++; + } + } - // Check if we already have one of these mounts - if ( ! checkExistingMount() ) { - labelStatus->setText(tr("Error: This mount point already exists!")); - ready = false; - } + // Check if we ended up with more partitions than we can support + if ( totalPart > 4 ) + { + ready = false; + labelStatus->setText(tr("Error: No more available partitions for this disk/slice.")); + } - // Check Zpool Details - ready = checkZpoolSanity(); + } else if ( comboDiskType->currentText() == "ZFS" ) { + // ZFS Sanity Checks + if ( spinSize->value() <= 0) + ready = false; - } else { - // Mirror sanity checks - QString selDev = comboDiskSelection->currentText(); - QString mirrorDev = comboMirrorDisk->currentText(); - selDev.truncate(selDev.indexOf(" -") ); - mirrorDev.truncate(mirrorDev.indexOf(" -") ); - // Using a mirror, make sure we don't have the same disk selected as target as source - if ( selDev == mirrorDev ) { - labelStatus->setText(tr("Error: Drive cannot mirror itself.")); - ready = false; + if ( listZFSFileSystems->count() <= 0 ) { + labelStatus->setText(tr("Error: Need a at least one ZFS filesystem mount point.")); + ready = false; + } + + // Check if we already have one of these mounts + if ( ! checkExistingMount() ) { + labelStatus->setText(tr("Error: This mount point already exists!")); + ready = false; + } + + // Check Zpool Details + ready = checkZpoolSanity(); + + } else { + // Mirror sanity checks + QString selDev = comboDiskSelection->currentText(); + QString mirrorDev = comboMirrorDisk->currentText(); + selDev.truncate(selDev.indexOf(" -") ); + mirrorDev.truncate(mirrorDev.indexOf(" -") ); + // Using a mirror, make sure we don't have the same disk selected as target as source + if ( selDev == mirrorDev ) { + labelStatus->setText(tr("Error: Drive cannot mirror itself.")); + ready = false; + } } - } - pushSave->setEnabled(ready); + pushSave->setEnabled(ready); } @@ -765,133 +765,133 @@ bool dialogFileSystem::checkExistingMount() { - // Check ZFS Types - if ( comboDiskType->currentText() == "ZFS" ) { - for ( int z=0; z < listZFSFileSystems->count(); ++z) - for (int i=0; i < sysFinalDiskLayout.count(); ++i) { - QStringList ZMounts = sysFinalDiskLayout.at(i).at(2).split(","); - for (int j = 0; j < ZMounts.size(); ++j) - if ( ZMounts.at(j) == listZFSFileSystems->item(z)->text() && ! isEditing ) - return false; - } - } else { - for (int i=0; i < sysFinalDiskLayout.count(); ++i) { - QStringList ZMounts = sysFinalDiskLayout.at(i).at(2).split(","); - for (int j = 0; j < ZMounts.size(); ++j) - if ( ZMounts.at(j) == lineEditMount->text() && ! isEditing ) - return false; + // Check ZFS Types + if ( comboDiskType->currentText() == "ZFS" ) { + for ( int z=0; z < listZFSFileSystems->count(); ++z) + for (int i=0; i < sysFinalDiskLayout.count(); ++i) { + QStringList ZMounts = sysFinalDiskLayout.at(i).at(2).split(","); + for (int j = 0; j < ZMounts.size(); ++j) + if ( ZMounts.at(j) == listZFSFileSystems->item(z)->text() && ! isEditing ) + return false; + } + } else { + for (int i=0; i < sysFinalDiskLayout.count(); ++i) { + QStringList ZMounts = sysFinalDiskLayout.at(i).at(2).split(","); + for (int j = 0; j < ZMounts.size(); ++j) + if ( ZMounts.at(j) == lineEditMount->text() && ! isEditing ) + return false; + } } - } - return true; + return true; } // add the new FS to our list, and emit it back to the parent void dialogFileSystem::addEmit() { - QStringList fileSystem; - QString Disk, Slice, Size, Mount, fsType, tmp, XtraOpts; + QStringList fileSystem; + QString Disk, Slice, Size, Mount, fsType, tmp, XtraOpts; - // Get the index - int sysIndex = getSysIndexFromCombo(comboDiskSelection->currentIndex()); + // Get the index + int sysIndex = getSysIndexFromCombo(comboDiskSelection->currentIndex()); - // Set our vars with Disk / Slice info, size, etc - if ( sysDisks.at(sysIndex).at(0) == "DRIVE") { - Disk = sysDisks.at(sysIndex).at(1); - Slice = "ALL"; - } else { - Disk = sysDisks.at(sysIndex).at(1); - Slice = sysDisks.at(sysIndex).at(2); - Slice = Slice.remove(0, Slice.size() -2); - } + // Set our vars with Disk / Slice info, size, etc + if ( sysDisks.at(sysIndex).at(0) == "DRIVE") { + Disk = sysDisks.at(sysIndex).at(1); + Slice = "ALL"; + } else { + Disk = sysDisks.at(sysIndex).at(1); + Slice = sysDisks.at(sysIndex).at(2); + Slice = Slice.remove(0, Slice.size() -2); + } - if ( comboDiskType->currentText() == "MIRROR" ) { - Size = "0"; - tmp = comboMirrorDisk->currentText(); - tmp.truncate(tmp.indexOf(" -")); - Mount = "MIRROR(" + tmp + ")"; - fsType = comboMirrorTypes->currentText(); - } else if ( comboDiskType->currentText() == "SWAP" ) { - Size = tmp.setNum(spinSize->value()); - Mount = "none"; - fsType = comboDiskType->currentText(); - if ( checkEncryption->isChecked() ) - fsType = fsType + ".eli"; - } else if ( comboDiskType->currentText() == "ZFS" ) { - // ZFS, Set our filesystem mounts with a "," delimiter - - for ( int z=0; zcount(); ++z) { - if ( Mount.isEmpty() ) - Mount = listZFSFileSystems->item(z)->text(); - else - Mount = Mount + "," + listZFSFileSystems->item(z)->text(); + if ( comboDiskType->currentText() == "MIRROR" ) { + Size = "0"; + tmp = comboMirrorDisk->currentText(); + tmp.truncate(tmp.indexOf(" -")); + Mount = "MIRROR(" + tmp + ")"; + fsType = comboMirrorTypes->currentText(); + } else if ( comboDiskType->currentText() == "SWAP" ) { + Size = tmp.setNum(spinSize->value()); + Mount = "none"; + fsType = comboDiskType->currentText(); + if ( checkEncryption->isChecked() ) + fsType = fsType + ".eli"; + } else if ( comboDiskType->currentText() == "ZFS" ) { + // ZFS, Set our filesystem mounts with a "," delimiter - // Save the XtraOpts for ZFS - XtraOpts = comboPoolType->currentText(); - if ( XtraOpts == "basic" ) - XtraOpts = ""; - else - XtraOpts = XtraOpts + ":"; + for ( int z=0; zcount(); ++z) { + if ( Mount.isEmpty() ) + Mount = listZFSFileSystems->item(z)->text(); + else + Mount = Mount + "," + listZFSFileSystems->item(z)->text(); - for ( int z=0; zcount(); ++z) - if ( listZPoolDevices->item(z)->checkState() == Qt::Checked ) { - tmp = listZPoolDevices->item(z)->text(); - tmp.truncate(tmp.indexOf(" ")); - XtraOpts = XtraOpts + " " + tmp; - XtraOpts = XtraOpts.simplified(); - } + // Save the XtraOpts for ZFS + XtraOpts = comboPoolType->currentText(); + if ( XtraOpts == "basic" ) + XtraOpts = ""; + else + XtraOpts = XtraOpts + ":"; + + for ( int z=0; zcount(); ++z) + if ( listZPoolDevices->item(z)->checkState() == Qt::Checked ) { + tmp = listZPoolDevices->item(z)->text(); + tmp.truncate(tmp.indexOf(" ")); + XtraOpts = XtraOpts + " " + tmp; + XtraOpts = XtraOpts.simplified(); + } + } + + + Size = tmp.setNum(spinSizeZFS->value()); + fsType = comboDiskType->currentText(); + if ( checkEncryptionZFS->isChecked() ) + fsType = fsType + ".eli"; + else + encPhrase=""; + // End of ZFS Setup + } else { + Size = tmp.setNum(spinSize->value()); + Mount = lineEditMount->text(); + fsType = comboDiskType->currentText(); + if ( checkEncryption->isChecked() ) + fsType = fsType + ".eli"; + else + encPhrase=""; } - Size = tmp.setNum(spinSizeZFS->value()); - fsType = comboDiskType->currentText(); - if ( checkEncryptionZFS->isChecked() ) - fsType = fsType + ".eli"; - else - encPhrase=""; - // End of ZFS Setup - } else { - Size = tmp.setNum(spinSize->value()); - Mount = lineEditMount->text(); - fsType = comboDiskType->currentText(); - if ( checkEncryption->isChecked() ) - fsType = fsType + ".eli"; - else - encPhrase=""; - } - + // If we are editing an existing device, update it + if ( isEditing ) + { + sysFinalDiskLayout[editIndex][0] = Disk; + sysFinalDiskLayout[editIndex][1] = Slice; + sysFinalDiskLayout[editIndex][2] = Mount; + sysFinalDiskLayout[editIndex][3] = fsType; + sysFinalDiskLayout[editIndex][4] = Size; + sysFinalDiskLayout[editIndex][5] = XtraOpts; + sysFinalDiskLayout[editIndex][6] = encPhrase; + } else { + // Add a new Device + fileSystem << Disk << Slice << Mount << fsType << Size << XtraOpts << encPhrase; + sysFinalDiskLayout << fileSystem; + } - // If we are editing an existing device, update it - if ( isEditing ) - { - sysFinalDiskLayout[editIndex][0] = Disk; - sysFinalDiskLayout[editIndex][1] = Slice; - sysFinalDiskLayout[editIndex][2] = Mount; - sysFinalDiskLayout[editIndex][3] = fsType; - sysFinalDiskLayout[editIndex][4] = Size; - sysFinalDiskLayout[editIndex][5] = XtraOpts; - sysFinalDiskLayout[editIndex][6] = encPhrase; - } else { - // Add a new Device - fileSystem << Disk << Slice << Mount << fsType << Size << XtraOpts << encPhrase; - sysFinalDiskLayout << fileSystem; - } - - emit updated(sysFinalDiskLayout); + emit updated(sysFinalDiskLayout); } // Slot for closing the dialog void dialogFileSystem::slotPushCancel() { - close(); + close(); } // Slot for saving the dialog void dialogFileSystem::slotPushSave() { - addEmit(); - close(); + addEmit(); + close(); } Index: keyboardscreen.h =================================================================== --- keyboardscreen.h (revision 0) +++ keyboardscreen.h (revision 0) @@ -0,0 +1,34 @@ +#ifndef KEYBOARDSCREEN_H +#define KEYBOARDSCREEN_H + +#include + +namespace Ui { +class KeyboardScreen; +} + +class KeyboardScreen : public QWidget +{ + Q_OBJECT + +public: + explicit KeyboardScreen(QWidget *parent = 0); + ~KeyboardScreen(); + +private slots: + void slotCurrentKbLayoutChanged(int row); + void slotUpdateKbOnSys(); + void slotCurrentKbVariantChanged(int row); + void slotSelectedKbItemChanged(); + +private: + Ui::KeyboardScreen *ui; + + void connectKeyboardSlots(); + void setKbVariants(const QString &kbLayout); + void setKbDefaults(); + + QStringList savedKeyVariants; // Temp variable to keep key variants in memory +}; + +#endif // KEYBOARDSCREEN_H Index: dialogSelectNet.cpp =================================================================== --- dialogSelectNet.cpp (revision 9216) +++ dialogSelectNet.cpp (working copy) @@ -19,121 +19,121 @@ void dialogSelectNetServer::dialogInit(QString tmpNic, QString tmpIP, QString tmpNetmask, QString tmpDNS, QString tmpGate) { - // Save our passed values - Nic = tmpNic; - IP = tmpIP; - Netmask = tmpNetmask; - DNS = tmpDNS; - Gate = tmpGate; + // Save our passed values + Nic = tmpNic; + IP = tmpIP; + Netmask = tmpNetmask; + DNS = tmpDNS; + Gate = tmpGate; - // Make sure we have enabled / disabled the right objects based on radio selection - radioChangedSlot(); + // Make sure we have enabled / disabled the right objects based on radio selection + radioChangedSlot(); - // Connect the radio buttons - connect(radioInternet, SIGNAL( clicked() ), this, SLOT( radioChangedSlot() ) ); - connect(radioManual, SIGNAL( clicked() ), this, SLOT( radioChangedSlot() ) ); + // Connect the radio buttons + connect(radioInternet, SIGNAL( clicked() ), this, SLOT( radioChangedSlot() ) ); + connect(radioManual, SIGNAL( clicked() ), this, SLOT( radioChangedSlot() ) ); - connect(pushSelect, SIGNAL( clicked() ), this, SLOT( saveSlot() ) ); - connect(pushCancel, SIGNAL( clicked() ), this, SLOT( cancelSlot() ) ); + connect(pushSelect, SIGNAL( clicked() ), this, SLOT( saveSlot() ) ); + connect(pushCancel, SIGNAL( clicked() ), this, SLOT( cancelSlot() ) ); - // Connect the fields to ensure they have data - connect(lineServer, SIGNAL( textChanged(const QString &) ), this, SLOT(fieldTextChanged( const QString &) ) ); - connect(lineDirectory, SIGNAL( textChanged(const QString &) ), this, SLOT(fieldTextChanged( const QString &) ) ); + // Connect the fields to ensure they have data + connect(lineServer, SIGNAL( textChanged(const QString &) ), this, SLOT(fieldTextChanged( const QString &) ) ); + connect(lineDirectory, SIGNAL( textChanged(const QString &) ), this, SLOT(fieldTextChanged( const QString &) ) ); - // Start our timer to enable the NIC - labelStatus->setText(tr("Enabling Networking... Please Wait...")); - radioInternet->setEnabled(false); - comboMirror->setEnabled(false); - radioManual->setEnabled(false); - groupNetwork->setEnabled(false); - pushSelect->setEnabled(false); - pushCancel->setEnabled(false); - QTimer::singleShot(500, this, SLOT(slotEnableNic())); + // Start our timer to enable the NIC + labelStatus->setText(tr("Enabling Networking... Please Wait...")); + radioInternet->setEnabled(false); + comboMirror->setEnabled(false); + radioManual->setEnabled(false); + groupNetwork->setEnabled(false); + pushSelect->setEnabled(false); + pushCancel->setEnabled(false); + QTimer::singleShot(500, this, SLOT(slotEnableNic())); } // Set that we are running rsync not ftp void dialogSelectNetServer::setUsingRsync(QString rsyncHost, QString rsyncUser, QString rsyncPort) { - Host = rsyncHost; - User = rsyncUser; - Port = rsyncPort; - usingRsync = true; + Host = rsyncHost; + User = rsyncUser; + Port = rsyncPort; + usingRsync = true; - radioInternet->setText(tr("Selected backup:")); - groupNetwork->setHidden(true); - radioManual->setHidden(true); + radioInternet->setText(tr("Selected backup:")); + groupNetwork->setHidden(true); + radioManual->setHidden(true); } -// Start the nic enabling +// Start the nic enabling void dialogSelectNetServer::slotEnableNic() { - if ( usingRsync) { - // Lets enable the NIC, and fetch our backup listing - labelStatus->setText(tr("Enabling NIC...")); - Scripts::Backend::enableNic(Nic, IP, Netmask, DNS, Gate, false); - Scripts::Backend::setupSSHKeys(Host, User, Port); - comboMirror->clear(); - labelStatus->setText(tr("Fetching backup list, this may take a while...")); - comboMirror->addItems(Scripts::Backend::listRsyncBackups(Host, User, Port)); - comboMirror->setEnabled(TRUE); - pushCancel->setEnabled(TRUE); - if (! comboMirror->currentText().isEmpty()) - pushSelect->setEnabled(TRUE); - else - pushSelect->setEnabled(FALSE); - - } else { - // Enable the NIC, and fetch mirror listing - labelStatus->setText(tr("Enabling NIC...")); - Scripts::Backend::enableNic(Nic, IP, Netmask, DNS, Gate, true); + if ( usingRsync) { + // Lets enable the NIC, and fetch our backup listing + labelStatus->setText(tr("Enabling NIC...")); + Scripts::Backend::enableNic(Nic, IP, Netmask, DNS, Gate, false); + Scripts::Backend::setupSSHKeys(Host, User, Port); + comboMirror->clear(); + labelStatus->setText(tr("Fetching backup list, this may take a while...")); + comboMirror->addItems(Scripts::Backend::listRsyncBackups(Host, User, Port)); + comboMirror->setEnabled(TRUE); + pushCancel->setEnabled(TRUE); + if (! comboMirror->currentText().isEmpty()) + pushSelect->setEnabled(TRUE); + else + pushSelect->setEnabled(FALSE); - radioInternet->setEnabled(true); - comboMirror->setEnabled(false); - radioManual->setEnabled(true); - groupNetwork->setEnabled(false); - pushSelect->setEnabled(true); - pushCancel->setEnabled(true); - radioChangedSlot(); + } else { + // Enable the NIC, and fetch mirror listing + labelStatus->setText(tr("Enabling NIC...")); + Scripts::Backend::enableNic(Nic, IP, Netmask, DNS, Gate, true); - QString tmp; - // Populate our combo box with the public mirror listing - QFile file( "/tmp/mirrors-list.txt" ); - if ( file.open( QIODevice::ReadOnly | QIODevice::Text ) ) { - comboMirror->clear(); - while ( !file.atEnd() ) { - tmp = file.readLine(); // line of text excluding '\n' - if ( tmp.indexOf("\n") != -1 ) - tmp.truncate(tmp.size() -1 ); - comboMirror->addItem(tmp); - } - file.close(); - } else { - // No mirrors-list.txt file, so lets disable internet install - radioManual->setChecked(true); - radioInternet->setEnabled(false); - comboMirror->setEnabled(false); - radioChangedSlot(); - } + radioInternet->setEnabled(true); + comboMirror->setEnabled(false); + radioManual->setEnabled(true); + groupNetwork->setEnabled(false); + pushSelect->setEnabled(true); + pushCancel->setEnabled(true); + radioChangedSlot(); - } + QString tmp; + // Populate our combo box with the public mirror listing + QFile file( "/tmp/mirrors-list.txt" ); + if ( file.open( QIODevice::ReadOnly | QIODevice::Text ) ) { + comboMirror->clear(); + while ( !file.atEnd() ) { + tmp = file.readLine(); // line of text excluding '\n' + if ( tmp.indexOf("\n") != -1 ) + tmp.truncate(tmp.size() -1 ); + comboMirror->addItem(tmp); + } + file.close(); + } else { + // No mirrors-list.txt file, so lets disable internet install + radioManual->setChecked(true); + radioInternet->setEnabled(false); + comboMirror->setEnabled(false); + radioChangedSlot(); + } - labelStatus->setText(""); + } + + labelStatus->setText(""); } // Check if the radio has changed void dialogSelectNetServer::radioChangedSlot() { - if ( radioInternet->isChecked() ) - { - comboMirror->setEnabled(true); - groupNetwork->setEnabled(false); - } else { - comboMirror->setEnabled(false); - groupNetwork->setEnabled(true); - } - - checkValues(); + if ( radioInternet->isChecked() ) + { + comboMirror->setEnabled(true); + groupNetwork->setEnabled(false); + } else { + comboMirror->setEnabled(false); + groupNetwork->setEnabled(true); + } + + checkValues(); } void dialogSelectNetServer::fieldTextChanged( const QString &text ) @@ -169,40 +169,40 @@ // Emit our signal void dialogSelectNetServer::saveSlot() { - QString tmp, server, directory, prefix; + QString tmp, server, directory, prefix; - if ( radioInternet->isChecked() ) - { - tmp = comboMirror->currentText(); - if ( ! usingRsync) - tmp.remove(0, tmp.indexOf("=") + 1); - emit saved(tmp); + if ( radioInternet->isChecked() ) + { + tmp = comboMirror->currentText(); + if ( ! usingRsync) + tmp.remove(0, tmp.indexOf("=") + 1); + emit saved(tmp); - } else { + } else { - if ( comboProto->currentText() == "FTP" ) - prefix="ftp://"; + if ( comboProto->currentText() == "FTP" ) + prefix="ftp://"; - if ( comboProto->currentText() == "HTTP" ) - prefix="http://"; + if ( comboProto->currentText() == "HTTP" ) + prefix="http://"; - server = lineServer->text(); - directory = lineDirectory->text(); - tmp = server + "/" + directory; - tmp.replace(QRegExp("//"), "/"); + server = lineServer->text(); + directory = lineDirectory->text(); + tmp = server + "/" + directory; + tmp.replace(QRegExp("//"), "/"); - - tmp = prefix + tmp; - emit saved(tmp); - } + tmp = prefix + tmp; - close(); + emit saved(tmp); + } + + close(); } // Close the dialog void dialogSelectNetServer::cancelSlot() { - close(); + close(); } Index: diskeditor.h =================================================================== --- diskeditor.h (revision 0) +++ diskeditor.h (revision 0) @@ -0,0 +1,60 @@ +#ifndef DISKEDITOR_H +#define DISKEDITOR_H + +#include + +#include "dialogFileSystem.h" + +namespace Ui { +class DiskEditor; +} + +class DiskEditor : public QWidget +{ + Q_OBJECT + +public: + explicit DiskEditor(QWidget *parent = 0); + ~DiskEditor(); + + + void warnEncryption(); + + bool checkDiskRequirements(); + + bool autoGenPartitionLayout(QString target, bool isDisk); + QString getDiskScheme(QString disk); + void connectDiskSlots(); + QStringList getDiskCfgSettings(QStringList &summaryList); + bool validateAndFinish(); + +private slots: + void slotAddMBRPartition(); + void slotDeleteMBRPartition(); + void slotChangeRadioCustomDisk(); + void slotPushAutoMountClicked(); + void slotAddNewFileSystem(); + void slotUpdateFileSystemLayout(QList newFileSystemLayout); + void slotEditFileSystem(); + void slotRemoveFileSystem(); + void slotRefreshCustomPartitionWidget(); + void slotEnableDiskAutoEnc(); + void slotUseEntireDiskClicked(); + void slotLoadDiskInfo(); + void slotChangedDisk(); + +private: + Ui::DiskEditor *ui; + + // Encryption bits + QString autoEncPass; + + QList sysDisks; // Our lists which contains disk info + QList sysPartitions; // Our lists which contains partition info + QList sysFinalDiskLayout; // Our lists which contains the final disk layout + + int systemMemory; // Ammount of system RAM we have in MB + dialogFileSystem *dfs; +}; + +#endif // DISKEDITOR_H Index: postInstall.ui =================================================================== --- postInstall.ui (revision 0) +++ postInstall.ui (revision 0) @@ -0,0 +1,31 @@ + + + Form + + + + 0 + 0 + 768 + 448 + + + + Form + + + + + 0 + 0 + 768 + 448 + + + + + + + + + Index: sys-diskwidget.cpp =================================================================== --- sys-diskwidget.cpp (revision 9216) +++ sys-diskwidget.cpp (working copy) @@ -1,830 +1,890 @@ #include "sysinstaller.h" +#include "diskeditor.h" +#include "ui_diskeditor.h" +DiskEditor::DiskEditor(QWidget *parent) : + QWidget(parent), + ui(new Ui::DiskEditor) +{ + ui->setupUi(this); + // Load the disks + slotLoadDiskInfo(); + + // Connect the disk slots + connectDiskSlots(); + + systemMemory = Scripts::Backend::systemMemory(); +} + +DiskEditor::~DiskEditor() +{ + delete ui; +} + + // Connect all the disk-related slots -void SysInstaller::connectDiskSlots() +void DiskEditor::connectDiskSlots() { - connect(comboDiskList,SIGNAL(currentIndexChanged(int)), this, SLOT(slotChangedDisk())); - connect(checkUseEntireDisk,SIGNAL(clicked()), this, SLOT(slotUseEntireDiskClicked())); - connect(radioCustomDisk,SIGNAL(toggled(bool)), this, SLOT(slotChangeRadioCustomDisk())); - connect(radioAutoPartition,SIGNAL(toggled(bool)), this, SLOT(slotChangeRadioCustomDisk())); - connect(pushAutoMount,SIGNAL(clicked()), this, SLOT(slotPushAutoMountClicked())); - connect(pushAddMount,SIGNAL(clicked()), this, SLOT(slotAddNewFileSystem())); - connect(pushEditMount,SIGNAL(clicked()), this, SLOT(slotEditFileSystem())); - connect(pushRemoveMount,SIGNAL(clicked()), this, SLOT(slotRemoveFileSystem())); - connect(pushAddPartition,SIGNAL(clicked()), this, SLOT(slotAddMBRPartition())); - connect(pushDeletePartition,SIGNAL(clicked()), this, SLOT(slotDeleteMBRPartition())); - connect(pushDiskRescan,SIGNAL(clicked()), this, SLOT(slotLoadDiskInfo())); - connect(treeWidgetCustomPartition,SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, SLOT(slotEditFileSystem())); - connect(checkBoxEncUserData,SIGNAL(clicked()), this, SLOT(slotEnableDiskAutoEnc())); + connect(ui->comboDiskList,SIGNAL(currentIndexChanged(int)), this, SLOT(slotChangedDisk())); + connect(ui->checkUseEntireDisk,SIGNAL(clicked()), this, SLOT(slotUseEntireDiskClicked())); + connect(ui->radioCustomDisk,SIGNAL(toggled(bool)), this, SLOT(slotChangeRadioCustomDisk())); + connect(ui->radioAutoPartition,SIGNAL(toggled(bool)), this, SLOT(slotChangeRadioCustomDisk())); + connect(ui->pushAutoMount,SIGNAL(clicked()), this, SLOT(slotPushAutoMountClicked())); + connect(ui->pushAddMount,SIGNAL(clicked()), this, SLOT(slotAddNewFileSystem())); + connect(ui->pushEditMount,SIGNAL(clicked()), this, SLOT(slotEditFileSystem())); + connect(ui->pushRemoveMount,SIGNAL(clicked()), this, SLOT(slotRemoveFileSystem())); + connect(ui->pushAddPartition,SIGNAL(clicked()), this, SLOT(slotAddMBRPartition())); + connect(ui->pushDeletePartition,SIGNAL(clicked()), this, SLOT(slotDeleteMBRPartition())); + connect(ui->pushDiskRescan,SIGNAL(clicked()), this, SLOT(slotLoadDiskInfo())); + connect(ui->treeWidgetCustomPartition,SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, SLOT(slotEditFileSystem())); + connect(ui->checkBoxEncUserData,SIGNAL(clicked()), this, SLOT(slotEnableDiskAutoEnc())); - // Hide the ID part of our custom treeWidget - treeWidgetCustomPartition->setColumnHidden(0, true); + // Hide the ID part of our custom treeWidget + ui->treeWidgetCustomPartition->setColumnHidden(0, true); } -void SysInstaller::warnEncryption() +void DiskEditor::warnEncryption() { - QMessageBox::warning(this, tr("PC-BSD Installer"), - tr("Encryption is enabled! In addition to using passphrase, key files are randomly generated and will be stored in /boot/keys/ on the system. After installing and rebooting, you should immediately make a backup copy of these keys, or else data loss could occur should they be lost or corrupted."), - QMessageBox::Ok); + QMessageBox::warning(this, tr("PC-BSD Installer"), + tr("Encryption is enabled! In addition to using passphrase, key files are randomly generated and will be stored in /boot/keys/ on the system. After installing and rebooting, you should immediately make a backup copy of these keys, or else data loss could occur should they be lost or corrupted."), + QMessageBox::Ok); } -void SysInstaller::slotEnableDiskAutoEnc() + +void DiskEditor::slotEnableDiskAutoEnc() { - if ( ! checkBoxEncUserData->isChecked() ) - return; + if ( ! ui->checkBoxEncUserData->isChecked() ) + return; - bool ok; - QString pass, confirm; + bool ok; + QString pass, confirm; - int ret = QMessageBox::question(this, tr("Disk Encryption"), - tr("Do you want to use a passphrase to access the encrypted volume?"), - QMessageBox::Yes | QMessageBox::No, - QMessageBox::Yes); + int ret = QMessageBox::question(this, tr("Disk Encryption"), + tr("Do you want to use a passphrase to access the encrypted volume?"), + QMessageBox::Yes | QMessageBox::No, + QMessageBox::Yes); - if ( ret == QMessageBox::No ) { - autoEncPass=""; - return; - } + if ( ret == QMessageBox::No ) { + autoEncPass=""; + return; + } - // Get the passphrase - pass = QInputDialog::getText(this, tr("Enter Passphrase"), - tr("Enter the Passphrase for this encrypted disk. (6 Characters Minimum)"), QLineEdit::Password, - QString(), &ok); + // Get the passphrase + pass = QInputDialog::getText(this, tr("Enter Passphrase"), + tr("Enter the Passphrase for this encrypted disk. (6 Characters Minimum)"), QLineEdit::Password, + QString(), &ok); - if ( pass.isEmpty() || pass.length() < 6) { - QMessageBox::critical(this, tr("Invalid Password"), tr("The password must be at least 6 characters.")); - checkBoxEncUserData->setChecked(false); - return; - } + if ( pass.isEmpty() || pass.length() < 6) { + QMessageBox::critical(this, tr("Invalid Password"), tr("The password must be at least 6 characters.")); + ui->checkBoxEncUserData->setChecked(false); + return; + } - // Confirm the passphrase - if ( ok && ! pass.isEmpty() ) - confirm = QInputDialog::getText(this, tr("Enter Passphrase (Confirm)"), - tr("Confirm the Passphrase for this encrypted disk"), QLineEdit::Password, - QString(), &ok); + // Confirm the passphrase + if ( ok && ! pass.isEmpty() ) + confirm = QInputDialog::getText(this, tr("Enter Passphrase (Confirm)"), + tr("Confirm the Passphrase for this encrypted disk"), QLineEdit::Password, + QString(), &ok); - if ( pass != confirm ) { - QMessageBox::critical(this, tr("Passphrase mismatch"), tr("The entered passphrases do not match!")); - checkBoxEncUserData->setChecked(false); - return; - } + if ( pass != confirm ) { + QMessageBox::critical(this, tr("Passphrase mismatch"), tr("The entered passphrases do not match!")); + ui->checkBoxEncUserData->setChecked(false); + return; + } - // Save the passphrase - warnEncryption(); - autoEncPass=pass; + // Save the passphrase + warnEncryption(); + autoEncPass=pass; } // Returns the disks MBR/GPT format scheme if known -QString SysInstaller::getDiskScheme(QString disk) +QString DiskEditor::getDiskScheme(QString disk) { - for (int z=0; z < sysDisks.count(); ++z) - if ( sysDisks.at(z).at(0) == "FORMAT" \ - && sysDisks.at(z).at(1) == disk ) - return sysDisks.at(z).at(2); + for (int z=0; z < sysDisks.count(); ++z) + if ( sysDisks.at(z).at(0) == "FORMAT" + && sysDisks.at(z).at(1) == disk ) + return sysDisks.at(z).at(2); - return QString(); + return QString(); } -void SysInstaller::slotAddMBRPartition() +void DiskEditor::slotAddMBRPartition() { - QString Output, Disk; - int maxFree = 0; - int curDiskItem = comboDiskList->currentIndex(); - bool ok = false; + QString Output, Disk; + int maxFree = 0; + int curDiskItem = ui->comboDiskList->currentIndex(); + bool ok = false; - // Determine the disk we are working on - Disk = comboDiskList->currentText(); - Disk.truncate(Disk.indexOf(" -")); + // Determine the disk we are working on + Disk = ui->comboDiskList->currentText(); + Disk.truncate(Disk.indexOf(" -")); - // Check for free space on this disk - for (int z=0; z < sysDisks.count(); ++z) - if ( sysDisks.at(z).at(0) == "SLICE" \ - && sysDisks.at(z).at(1) == Disk \ - && sysDisks.at(z).at(4) == "Unused Space" ) - maxFree = sysDisks.at(z).at(3).toInt(&ok); + // Check for free space on this disk + for (int z=0; z < sysDisks.count(); ++z) + if ( sysDisks.at(z).at(0) == "SLICE" + && sysDisks.at(z).at(1) == Disk + && sysDisks.at(z).at(4) == "Unused Space" ) + maxFree = sysDisks.at(z).at(3).toInt(&ok); - // Shrink maxFree a tad to account for rounding errors - if ( ok ) - maxFree = maxFree - 5; + // Shrink maxFree a tad to account for rounding errors + if ( ok ) + maxFree = maxFree - 5; - // If we have free space, and its greater than 49MB - if ( ok && ( maxFree > 49 ) ) { + // If we have free space, and its greater than 49MB + if ( ok && ( maxFree > 49 ) ) { - // Get the size for this new partition - int size = QInputDialog::getInt(this, tr("PC-BSD Install"), - tr("Enter the size for this new slice in Megabytes."), 50, 50, maxFree, 1, &ok); + // Get the size for this new partition + int size = QInputDialog::getInt(this, tr("PC-BSD Install"), + tr("Enter the size for this new slice in Megabytes."), 50, 50, maxFree, 1, &ok); - if (ok) { - if ( Scripts::Backend::addMBRPart(Disk, size, Output) != 0) - QMessageBox::critical(this, tr("Add Failed"), - tr("The slice creation failed with the following message:") + "\n" \ - + Output); - slotLoadDiskInfo(); - if ( comboDiskList->count() >= curDiskItem) - comboDiskList->setCurrentIndex(curDiskItem); + if (ok) { + if ( Scripts::Backend::addMBRPart(Disk, size, Output) != 0) + QMessageBox::critical(this, tr("Add Failed"), + tr("The slice creation failed with the following message:") + "\n" + + Output); + slotLoadDiskInfo(); + if ( ui->comboDiskList->count() >= curDiskItem) + ui->comboDiskList->setCurrentIndex(curDiskItem); + } + } else { + QMessageBox::critical(this, tr("Add Failed"), tr("Not enough free space to create a new slice!")); } - } else { - QMessageBox::critical(this, tr("Add Failed"), tr("Not enough free space to create a new slice!")); - } } -void SysInstaller::slotDeleteMBRPartition() +void DiskEditor::slotDeleteMBRPartition() { - QString Output; - int curDiskItem = comboDiskList->currentIndex(); + QString Output; + int curDiskItem = ui->comboDiskList->currentIndex(); - if ( listDiskSlices->currentItem() ) { - QString slice = listDiskSlices->currentItem()->text(); - slice.truncate(slice.indexOf(":")); - // Confirm we want to delete this slice - int ret = QMessageBox::warning(this, tr("PC-BSD Install"), - tr("Are you sure you want to delete:") + " " + slice, - QMessageBox::Yes | QMessageBox::No, - QMessageBox::No); - switch (ret) { - case QMessageBox::Yes: - // Lets start the deletion - if ( Scripts::Backend::deleteMBRPart(slice, Output) != 0) - QMessageBox::critical(this, tr("Delete Failed"), - tr("The slice deletion failed with the following message:") + "\n" \ - + Output); - slotLoadDiskInfo(); - if ( comboDiskList->count() >= curDiskItem) - comboDiskList->setCurrentIndex(curDiskItem); - break; - case QMessageBox::No: - break; - default: - break; - } - } + if ( ui->listDiskSlices->currentItem() ) { + QString slice = ui->listDiskSlices->currentItem()->text(); + slice.truncate(slice.indexOf(":")); + // Confirm we want to delete this slice + int ret = QMessageBox::warning(this, tr("PC-BSD Install"), + tr("Are you sure you want to delete:") + " " + slice, + QMessageBox::Yes | QMessageBox::No, + QMessageBox::No); + switch (ret) { + case QMessageBox::Yes: + // Lets start the deletion + if ( Scripts::Backend::deleteMBRPart(slice, Output) != 0) + QMessageBox::critical(this, tr("Delete Failed"), + tr("The slice deletion failed with the following message:") + "\n" + + Output); + slotLoadDiskInfo(); + if ( ui->comboDiskList->count() >= curDiskItem) + ui->comboDiskList->setCurrentIndex(curDiskItem); + break; + case QMessageBox::No: + break; + default: + break; + } + } } +bool DiskEditor::validateAndFinish() +{ + if (!checkDiskRequirements()) + return false; + + // Check if we are on the disk page, and using auto-partitioning, and set it up if so + if (ui->radioAutoPartition->isChecked()) + { + if ( ui->checkUseEntireDisk->isChecked() ) { + QString disk = ui->comboDiskList->currentText(); + disk.truncate(disk.indexOf(" -")); + if ( !autoGenPartitionLayout(disk, true) ) + return false; + } else { + QString slice = ui->listDiskSlices->currentItem()->text(); + slice.truncate(slice.indexOf(":")); + if ( !autoGenPartitionLayout(slice, false) ) + return false; + } + } + + return true; +} + // Slot which switches between basic / advanced disk setup -void SysInstaller::slotChangeRadioCustomDisk() +void DiskEditor::slotChangeRadioCustomDisk() { - if ( radioAutoPartition->isChecked()) - stackedWidgetDiskSetup->setCurrentIndex(0); - else - stackedWidgetDiskSetup->setCurrentIndex(1); + if ( ui->radioAutoPartition->isChecked()) + ui->stackedWidgetDiskSetup->setCurrentIndex(0); + else + ui->stackedWidgetDiskSetup->setCurrentIndex(1); } // Slot which checks any disk requirements before procceding to the next page -bool SysInstaller::checkDiskRequirements() +bool DiskEditor::checkDiskRequirements() { - int minsize, mysize; - bool ok, goodsize; - QString tmp, disk; + int minsize, mysize; + bool ok, goodsize; + QString tmp, disk; - goodsize = true; + goodsize = true; +#if 0 + if ( ui->radioInstallPCBSD->isChecked() ) + minsize = PCBSD_MINSIZE; + else + minsize = FBSD_MINSIZE; +#endif + minsize = PCBSD_MINSIZE; // TODO fix this - if ( radioInstallPCBSD->isChecked() ) - minsize = PCBSD_MINSIZE; - else - minsize = FBSD_MINSIZE; + // Do our checks if we are on a auto-partition config + if ( ui->radioAutoPartition->isChecked() ) { + if ( ui->checkUseEntireDisk->isChecked() ) { + // Check if we have enough space on the entire disk + QString disk = ui->comboDiskList->currentText(); + disk.truncate(disk.indexOf(" -")); + for (int i=0; i < sysDisks.count(); ++i) { + // Make sure to only add the drives to the comboDiskList + if ( sysDisks.at(i).at(0) == "DRIVE" && sysDisks.at(i).at(1) == disk ) { + qDebug() << "Selected Disk Size: " + sysDisks.at(i).at(2); + mysize = sysDisks.at(i).at(2).toInt(&ok); + if ( !ok || mysize < minsize) + goodsize=false; + } + } + } else if ( ui->listDiskSlices->currentItem() ) { - // Do our checks if we are on a auto-partition config - if ( radioAutoPartition->isChecked() ) { - if ( checkUseEntireDisk->isChecked() ) { - // Check if we have enough space on the entire disk - QString disk = comboDiskList->currentText(); - disk.truncate(disk.indexOf(" -")); - for (int i=0; i < sysDisks.count(); ++i) { - // Make sure to only add the drives to the comboDiskList - if ( sysDisks.at(i).at(0) == "DRIVE" && sysDisks.at(i).at(1) == disk ) { - qDebug() << "Selected Disk Size: " + sysDisks.at(i).at(2); - mysize = sysDisks.at(i).at(2).toInt(&ok); - if( !ok || mysize < minsize) - goodsize=false; - } - } - } else if ( listDiskSlices->currentItem() ){ + // Using a specific partition, check that size + QString slice = ui->listDiskSlices->currentItem()->text(); + slice.truncate(slice.indexOf(":")); - // Using a specific partition, check that size - QString slice = listDiskSlices->currentItem()->text(); - slice.truncate(slice.indexOf(":")); + // Make sure this isn't Unused Space we are trying to install to + for (int i=0; i < sysDisks.count(); ++i) { + if ( sysDisks.at(i).at(0) == "SLICE" && slice == sysDisks.at(i).at(2) + && sysDisks.at(i).at(4) == "Unused Space") { + QMessageBox::critical(this, tr("PC-BSD Installer Error"), + tr("Please create a partition using the 'Add Partition' button below, to install using free space."), + QMessageBox::Ok); + return false; + } + } - // Make sure this isn't Unused Space we are trying to install to - for (int i=0; i < sysDisks.count(); ++i) { - if ( sysDisks.at(i).at(0) == "SLICE" && slice == sysDisks.at(i).at(2) \ - && sysDisks.at(i).at(4) == "Unused Space") { - QMessageBox::critical(this, tr("PC-BSD Installer Error"), - tr("Please create a partition using the 'Add Partition' button below, to install using free space."), - QMessageBox::Ok); - return false; - } - } + // Get the Disk + for (int i=0; i < sysDisks.count(); ++i) + if ( sysDisks.at(i).at(0) == "SLICE" && slice == sysDisks.at(i).at(2)) + disk = sysDisks.at(i).at(1); - // Get the Disk - for (int i=0; i < sysDisks.count(); ++i) - if ( sysDisks.at(i).at(0) == "SLICE" && slice == sysDisks.at(i).at(2)) - disk = sysDisks.at(i).at(1); + // Make sure this isn't a GPT slice / partition + if ( disk+"s1" != slice && disk+"s2" != slice && disk+"s3" != slice && disk+"s4" != slice ) { + QMessageBox::critical(this, tr("PC-BSD Installer Error"), + tr("Can only install directly to a MBR partition!\nPlease use 'entire disk' or delete all partitions and create a new one."), + QMessageBox::Ok); + return false; + } - // Make sure this isn't a GPT slice / partition - if ( disk+"s1" != slice && disk+"s2" != slice && disk+"s3" != slice && disk+"s4" != slice ) { - QMessageBox::critical(this, tr("PC-BSD Installer Error"), - tr("Can only install directly to a MBR partition!\nPlease use 'entire disk' or delete all partitions and create a new one."), - QMessageBox::Ok); - return false; - } + for (int i=0; i < sysDisks.count(); ++i) { + // Make sure to only add the slices to the listDiskSlices + if ( sysDisks.at(i).at(0) == "SLICE" && slice == sysDisks.at(i).at(2)) { + qDebug() << "Selected Slice Size: " + sysDisks.at(i).at(3); + mysize = sysDisks.at(i).at(3).toInt(&ok); + if ( !ok || mysize < minsize) + goodsize=false; + } + } + } else { + goodsize = false; + } - for (int i=0; i < sysDisks.count(); ++i) { - // Make sure to only add the slices to the listDiskSlices - if ( sysDisks.at(i).at(0) == "SLICE" && slice == sysDisks.at(i).at(2)) { - qDebug() << "Selected Slice Size: " + sysDisks.at(i).at(3); - mysize = sysDisks.at(i).at(3).toInt(&ok); - if( !ok || mysize < minsize) - goodsize=false; + if (!goodsize) + { + QMessageBox::critical(this, tr("PC-BSD Installer Error"), + tr("This install requires a disk/slice with at least") + + " " + tmp.setNum(minsize) + "MB " + tr("of disk space."), + QMessageBox::Ok); + return goodsize; } - } - } else { - goodsize = false; - } - if (!goodsize) - { - QMessageBox::critical(this, tr("PC-BSD Installer Error"), - tr("This install requires a disk/slice with at least") \ - + " " + tmp.setNum(minsize) + "MB " + tr("of disk space."), - QMessageBox::Ok); - return goodsize; - } + // End of auto-partition checks + } else { + // Check if if the disk layout is good when using custom partitioning + bool haveRoot, haveUsr, haveVar, haveSwap, haveEncryption; + int minRoot, minUsr, minVar; + haveRoot = false; + haveUsr = false; + haveVar = false; + haveSwap = false; + haveEncryption = false; - // End of auto-partition checks - } else { - // Check if if the disk layout is good when using custom partitioning - bool haveRoot, haveUsr, haveVar, haveSwap, haveEncryption; - int minRoot, minUsr, minVar; - haveRoot = false; - haveUsr = false; - haveVar = false; - haveSwap = false; - haveEncryption = false; +#if 0 + if ( ui->radioInstallPCBSD->isChecked() ) { + minRoot = PCBSD_MINROOT; + minUsr = PCBSD_MINUSR; + minVar = PCBSD_MINVAR; + } else { + minRoot = FBSD_MINROOT; + minUsr = FBSD_MINUSR; + minVar = FBSD_MINVAR; + } +#endif + // TODO fix this + minRoot = FBSD_MINROOT; + minUsr = FBSD_MINUSR; + minVar = FBSD_MINVAR; - if ( radioInstallPCBSD->isChecked() ) { - minRoot = PCBSD_MINROOT; - minUsr = PCBSD_MINUSR; - minVar = PCBSD_MINVAR; - } else { - minRoot = FBSD_MINROOT; - minUsr = FBSD_MINUSR; - minVar = FBSD_MINVAR; - } + // Start by checking for some important mounts + for (int i=0; i < sysFinalDiskLayout.count(); ++i) { + QStringList mounts = sysFinalDiskLayout.at(i).at(2).split(","); + for (int z = 0; z < mounts.size(); ++z) { + if ( mounts.at(z) == "/" ) + haveRoot = true; + if ( mounts.at(z) == "/usr" ) + haveUsr = true; + if ( mounts.at(z) == "/var" ) + haveVar = true; + } + if ( sysFinalDiskLayout.at(i).at(3) == "SWAP" + || sysFinalDiskLayout.at(i).at(3) == "SWAP.eli" ) + haveSwap = true; + if ( sysFinalDiskLayout.at(i).at(3).indexOf(".eli") != -1 + && sysFinalDiskLayout.at(i).at(3).indexOf("SWAP") == -1 ) + haveEncryption = true; + } - // Start by checking for some important mounts - for (int i=0; i < sysFinalDiskLayout.count(); ++i) { - QStringList mounts = sysFinalDiskLayout.at(i).at(2).split(","); - for (int z = 0; z < mounts.size(); ++z) { - if ( mounts.at(z) == "/" ) - haveRoot = true; - if ( mounts.at(z) == "/usr" ) - haveUsr = true; - if ( mounts.at(z) == "/var" ) - haveVar = true; - } - if ( sysFinalDiskLayout.at(i).at(3) == "SWAP" \ - || sysFinalDiskLayout.at(i).at(3) == "SWAP.eli" ) - haveSwap = true; - if ( sysFinalDiskLayout.at(i).at(3).indexOf(".eli") != -1 - && sysFinalDiskLayout.at(i).at(3).indexOf("SWAP") == -1 ) - haveEncryption = true; - } - - if (!haveRoot) { - QMessageBox::critical(this, tr("PC-BSD Installer Error"), - tr("Missing '/' filesystem, please add a filesystem for mount-point '/' to continue."), - QMessageBox::Ok); - return false; - } - if (!haveSwap) { - int ret = QMessageBox::warning(this, tr("PC-BSD Install"), - tr("No SWAP space has been setup, are you sure you want to continue?"), - QMessageBox::Yes | QMessageBox::No, - QMessageBox::No); - switch (ret) { - case QMessageBox::Yes: - break; - case QMessageBox::No: + if (!haveRoot) { + QMessageBox::critical(this, tr("PC-BSD Installer Error"), + tr("Missing '/' filesystem, please add a filesystem for mount-point '/' to continue."), + QMessageBox::Ok); + return false; + } + if (!haveSwap) { + int ret = QMessageBox::warning(this, tr("PC-BSD Install"), + tr("No SWAP space has been setup, are you sure you want to continue?"), + QMessageBox::Yes | QMessageBox::No, + QMessageBox::No); + switch (ret) { + case QMessageBox::Yes: + break; + case QMessageBox::No: return false; - break; - default: + break; + default: return false; - break; - } + break; + } - } + } - if (haveEncryption) - warnEncryption(); + if (haveEncryption) + warnEncryption(); - // Check if we have mounts for usr / var, and if not, add their requirements to / - if (!haveVar) - minRoot = minRoot + minVar; - if (!haveUsr) - minRoot = minRoot + minUsr; + // Check if we have mounts for usr / var, and if not, add their requirements to / + if (!haveVar) + minRoot = minRoot + minVar; + if (!haveUsr) + minRoot = minRoot + minUsr; - // If we get this far, now check if we have any filesystems that are below the minimum size - for (int i=0; i < sysFinalDiskLayout.count(); ++i) { - mysize = sysFinalDiskLayout.at(i).at(4).toInt(&ok); - if(ok) { - if ( sysFinalDiskLayout.at(i).at(2) == "/" && mysize < minRoot ) { - QMessageBox::critical(this, tr("PC-BSD Installer Error"), - "'/' " + tr("filesystem is below the required minimum:") + " " + tmp.setNum(minRoot), - QMessageBox::Ok); - return false; - } - if ( sysFinalDiskLayout.at(i).at(2) == "/usr" && mysize < minUsr ) { - QMessageBox::critical(this, tr("PC-BSD Installer Error"), - "'/usr' " + tr("filesystem is below the required minimum:") + " " + tmp.setNum(minUsr), - QMessageBox::Ok); - return false; - } - if ( sysFinalDiskLayout.at(i).at(2) == "/var" && mysize < minVar ) { - QMessageBox::critical(this, tr("PC-BSD Installer Error"), - "'/var' " + tr("filesystem is below the required minimum:") + " " + tmp.setNum(minVar), - QMessageBox::Ok); - return false; - } - } - } + // If we get this far, now check if we have any filesystems that are below the minimum size + for (int i=0; i < sysFinalDiskLayout.count(); ++i) { + mysize = sysFinalDiskLayout.at(i).at(4).toInt(&ok); + if (ok) { + if ( sysFinalDiskLayout.at(i).at(2) == "/" && mysize < minRoot ) { + QMessageBox::critical(this, tr("PC-BSD Installer Error"), + "'/' " + tr("filesystem is below the required minimum:") + " " + tmp.setNum(minRoot), + QMessageBox::Ok); + return false; + } + if ( sysFinalDiskLayout.at(i).at(2) == "/usr" && mysize < minUsr ) { + QMessageBox::critical(this, tr("PC-BSD Installer Error"), + "'/usr' " + tr("filesystem is below the required minimum:") + " " + tmp.setNum(minUsr), + QMessageBox::Ok); + return false; + } + if ( sysFinalDiskLayout.at(i).at(2) == "/var" && mysize < minVar ) { + QMessageBox::critical(this, tr("PC-BSD Installer Error"), + "'/var' " + tr("filesystem is below the required minimum:") + " " + tmp.setNum(minVar), + QMessageBox::Ok); + return false; + } + } + } - } // End of check for custom filesystem validity + } // End of check for custom filesystem validity - return goodsize; + return goodsize; } // Check if use entire disk is checked -void SysInstaller::slotUseEntireDiskClicked() +void DiskEditor::slotUseEntireDiskClicked() { - if ( checkUseEntireDisk->isChecked() ) - listDiskSlices->setEnabled(false); - else - listDiskSlices->setEnabled(true); + printf("ui = %p, ui->checkUseEntireDisk = %p\n", ui, ui->checkUseEntireDisk); + if ( ui->checkUseEntireDisk->isChecked() ) + ui->listDiskSlices->setEnabled(false); + else + ui->listDiskSlices->setEnabled(true); } // Load the Disk string list -void SysInstaller::slotLoadDiskInfo() +void DiskEditor::slotLoadDiskInfo() { - // load drives - comboDiskList->clear(); - sysFinalDiskLayout.clear(); - treeWidgetCustomPartition->clear(); - sysDisks = Scripts::Backend::hardDrives(); - for (int i=0; i < sysDisks.count(); ++i) { - // Make sure to only add the drives to the comboDiskList - if ( sysDisks.at(i).at(0) == "DRIVE" ) - comboDiskList->addItem(sysDisks.at(i).at(1) + " - " + sysDisks.at(i).at(2) + "MB " + sysDisks.at(i).at(3)); - } + // load drives + ui->comboDiskList->clear(); + sysFinalDiskLayout.clear(); + ui->treeWidgetCustomPartition->clear(); + sysDisks = Scripts::Backend::hardDrives(); + for (int i=0; i < sysDisks.count(); ++i) { + // Make sure to only add the drives to the comboDiskList + if ( sysDisks.at(i).at(0) == "DRIVE" ) + ui->comboDiskList->addItem(sysDisks.at(i).at(1) + " - " + sysDisks.at(i).at(2) + "MB " + sysDisks.at(i).at(3)); + } - // Reload the slice list box - slotChangedDisk(); + // Reload the slice list box + slotChangedDisk(); } // The selected disk has changed, refresh our partition box -void SysInstaller::slotChangedDisk() +void DiskEditor::slotChangedDisk() { - if ( !comboDiskList->currentText().isEmpty()) - { - listDiskSlices->clear(); + if ( !ui->comboDiskList->currentText().isEmpty()) + { + ui->listDiskSlices->clear(); - QString disk = comboDiskList->currentText(); - disk.truncate(disk.indexOf(" -")); - for (int i=0; i < sysDisks.count(); ++i) { - // Make sure to only add the slices to the listDiskSlices - if ( sysDisks.at(i).at(0) == "SLICE" && disk == sysDisks.at(i).at(1)) - listDiskSlices->addItem(sysDisks.at(i).at(2) + ": " + sysDisks.at(i).at(3) + "MB " + sysDisks.at(i).at(4)); + QString disk = ui->comboDiskList->currentText(); + disk.truncate(disk.indexOf(" -")); + for (int i=0; i < sysDisks.count(); ++i) { + // Make sure to only add the slices to the listDiskSlices + if ( sysDisks.at(i).at(0) == "SLICE" && disk == sysDisks.at(i).at(1)) + ui->listDiskSlices->addItem(sysDisks.at(i).at(2) + ": " + sysDisks.at(i).at(3) + "MB " + sysDisks.at(i).at(4)); + } } - } } // Function which will auto-generate a partition layout based upon the target disk / slice -bool SysInstaller::autoGenPartitionLayout(QString target, bool isDisk) +bool DiskEditor::autoGenPartitionLayout(QString target, bool isDisk) { - QString targetType, tmp; - int targetLoc, totalSize = 0, mntsize; - QString targetDisk, targetSlice, tmpPass, fsType; - bool ok; - ok = false; + QString targetType, tmp; + int targetLoc, totalSize = 0, mntsize; + QString targetDisk, targetSlice, tmpPass, fsType; + bool ok; + ok = false; - // Clear out the original disk layout - sysFinalDiskLayout.clear(); - QStringList fileSystem; - qDebug() << "Generating disk layout"; + // Clear out the original disk layout + sysFinalDiskLayout.clear(); + QStringList fileSystem; + qDebug() << "Generating disk layout"; - if ( isDisk ) { - targetType = "DRIVE"; - targetSlice = "ALL"; - targetDisk = target; - targetLoc = 1; - } else { - targetType = "SLICE"; - targetDisk = target; - targetDisk.truncate(targetDisk.size() -2); - targetSlice = target; - targetSlice = targetSlice.remove(0, targetSlice.size() -2); - targetLoc = 2; - } - - // Lets get the size for this disk / partition - for (int i=0; i < sysDisks.count(); ++i) { - // Make sure to only add the slices to the listDiskSlices - if ( sysDisks.at(i).at(0) == targetType && target == sysDisks.at(i).at(targetLoc)) - totalSize = sysDisks.at(i).at(targetLoc + 1).toInt(&ok); - } + if ( isDisk ) { + targetType = "DRIVE"; + targetSlice = "ALL"; + targetDisk = target; + targetLoc = 1; + } else { + targetType = "SLICE"; + targetDisk = target; + targetDisk.truncate(targetDisk.size() -2); + targetSlice = target; + targetSlice = targetSlice.remove(0, targetSlice.size() -2); + targetLoc = 2; + } - // We got a valid size for this disk / slice, lets generate the layout now - if(ok) - { - // Give a little size cushion here - totalSize = totalSize - 5; + // Lets get the size for this disk / partition + for (int i=0; i < sysDisks.count(); ++i) { + // Make sure to only add the slices to the listDiskSlices + if ( sysDisks.at(i).at(0) == targetType && target == sysDisks.at(i).at(targetLoc)) + totalSize = sysDisks.at(i).at(targetLoc + 1).toInt(&ok); + } - // Figure out the default size for / if we are on FreeBSD / PC-BSD - if ( radioInstallPCBSD->isChecked() ) + // We got a valid size for this disk / slice, lets generate the layout now + if (ok) + { + // Give a little size cushion here + totalSize = totalSize - 5; +#if 0 + // Figure out the default size for / if we are on FreeBSD / PC-BSD + if ( ui->radioInstallPCBSD->isChecked() ) + mntsize = 2048; + else + mntsize = 1024; +#endif + + // TODO fix this mntsize = 2048; - else - mntsize = 1024; - if ( radioFileSysSUJ->isChecked() || radioFileSysSU->isChecked() ) { + if ( ui->radioFileSysSUJ->isChecked() || ui->radioFileSysSU->isChecked() ) { - if ( radioFileSysSUJ->isChecked() ) - fsType="UFS+SUJ"; - else - fsType="UFS+S"; + if ( ui->radioFileSysSUJ->isChecked() ) + fsType="UFS+SUJ"; + else + fsType="UFS+S"; - fileSystem << targetDisk << targetSlice << "/" << fsType << tmp.setNum(mntsize) << "" << ""; - totalSize = totalSize - mntsize; - //qDebug() << "Auto-Gen FS:" << fileSystem; - sysFinalDiskLayout << fileSystem; - fileSystem.clear(); - + fileSystem << targetDisk << targetSlice << "/" << fsType << tmp.setNum(mntsize) << "" << ""; + totalSize = totalSize - mntsize; + //qDebug() << "Auto-Gen FS:" << fileSystem; + sysFinalDiskLayout << fileSystem; + fileSystem.clear(); - // Figure out the swap size, try for 2xPhysMem first, fallback to 512 if not enough space - mntsize = systemMemory * 2; - if ( totalSize - mntsize < 3000 ) - mntsize = 512; - fileSystem << targetDisk << targetSlice << "SWAP" << "SWAP" << tmp.setNum(mntsize) << "" << ""; - totalSize = totalSize - mntsize; - //qDebug() << "Auto-Gen FS:" << fileSystem; - sysFinalDiskLayout << fileSystem; - fileSystem.clear(); + // Figure out the swap size, try for 2xPhysMem first, fallback to 512 if not enough space + mntsize = systemMemory * 2; + if ( totalSize - mntsize < 3000 ) + mntsize = 512; + fileSystem << targetDisk << targetSlice << "SWAP" << "SWAP" << tmp.setNum(mntsize) << "" << ""; + totalSize = totalSize - mntsize; + //qDebug() << "Auto-Gen FS:" << fileSystem; + sysFinalDiskLayout << fileSystem; + fileSystem.clear(); - // Figure out the default size for /var if we are on FreeBSD / PC-BSD - mntsize = 2048; - fileSystem << targetDisk << targetSlice << "/var" << fsType << tmp.setNum(mntsize) << "" << ""; - totalSize = totalSize - mntsize; - //qDebug() << "Auto-Gen FS:" << fileSystem; - sysFinalDiskLayout << fileSystem; - fileSystem.clear(); - // See if using encryption for this partition - if ( checkBoxEncUserData->isChecked() ) { - fsType+= ".eli"; - tmpPass=autoEncPass; - } + // Figure out the default size for /var if we are on FreeBSD / PC-BSD + mntsize = 2048; + fileSystem << targetDisk << targetSlice << "/var" << fsType << tmp.setNum(mntsize) << "" << ""; + totalSize = totalSize - mntsize; + //qDebug() << "Auto-Gen FS:" << fileSystem; + sysFinalDiskLayout << fileSystem; + fileSystem.clear(); - // Now use the rest of the disk / slice for /usr - fileSystem << targetDisk << targetSlice << "/usr" << fsType << tmp.setNum(totalSize) << "" << tmpPass; - //qDebug() << "Auto-Gen FS:" << fileSystem; - sysFinalDiskLayout << fileSystem; - fileSystem.clear(); + // See if using encryption for this partition + if ( ui->checkBoxEncUserData->isChecked() ) { + fsType+= ".eli"; + tmpPass=autoEncPass; + } - } else { - // Using ZFS + // Now use the rest of the disk / slice for /usr + fileSystem << targetDisk << targetSlice << "/usr" << fsType << tmp.setNum(totalSize) << "" << tmpPass; + //qDebug() << "Auto-Gen FS:" << fileSystem; + sysFinalDiskLayout << fileSystem; + fileSystem.clear(); - // Figure out the swap size, try for 2xPhysMem first, fallback to 512 if not enough space - int swapsize = systemMemory * 2; - if ( totalSize - swapsize < 3000 ) - swapsize = 512; - totalSize = totalSize - swapsize; + } else { + // Using ZFS - // Setup a UFS boot partition - totalSize = totalSize - 1024; - fileSystem << targetDisk << targetSlice << "/boot" << "UFS" << tmp.setNum(1024) << "" << ""; - sysFinalDiskLayout << fileSystem; - fileSystem.clear(); + // Figure out the swap size, try for 2xPhysMem first, fallback to 512 if not enough space + int swapsize = systemMemory * 2; + if ( totalSize - swapsize < 3000 ) + swapsize = 512; + totalSize = totalSize - swapsize; - // See if using encryption for this partition - if ( checkBoxEncUserData->isChecked() ) { - fsType= "ZFS.eli"; - tmpPass=autoEncPass; - } else { - fsType= "ZFS"; - } + // Setup a UFS boot partition + totalSize = totalSize - 1024; + fileSystem << targetDisk << targetSlice << "/boot" << "UFS" << tmp.setNum(1024) << "" << ""; + sysFinalDiskLayout << fileSystem; + fileSystem.clear(); - // Add the main zfs pool with standard partitions - fileSystem << targetDisk << targetSlice << "/,/var,/usr" << fsType << tmp.setNum(totalSize) << "" << tmpPass; - //qDebug() << "Auto-Gen FS:" << fileSystem; - sysFinalDiskLayout << fileSystem; - fileSystem.clear(); + // See if using encryption for this partition + if ( ui->checkBoxEncUserData->isChecked() ) { + fsType= "ZFS.eli"; + tmpPass=autoEncPass; + } else { + fsType= "ZFS"; + } - // Add the previously calculated swap size - fileSystem << targetDisk << targetSlice << "SWAP" << "SWAP" << tmp.setNum(swapsize) << "" << ""; - //qDebug() << "Auto-Gen FS:" << fileSystem; - sysFinalDiskLayout << fileSystem; - fileSystem.clear(); - } + // Add the main zfs pool with standard partitions + fileSystem << targetDisk << targetSlice << "/,/var,/usr" << fsType << tmp.setNum(totalSize) << "" << tmpPass; + //qDebug() << "Auto-Gen FS:" << fileSystem; + sysFinalDiskLayout << fileSystem; + fileSystem.clear(); - // Update the custom widget with this partition information - slotRefreshCustomPartitionWidget(); + // Add the previously calculated swap size + fileSystem << targetDisk << targetSlice << "SWAP" << "SWAP" << tmp.setNum(swapsize) << "" << ""; + //qDebug() << "Auto-Gen FS:" << fileSystem; + sysFinalDiskLayout << fileSystem; + fileSystem.clear(); + } - return true; - } - - return false; + // Update the custom widget with this partition information + slotRefreshCustomPartitionWidget(); + + return true; + } + + return false; } // Function which will start the generation of auto-fs layout based upon selected disk up top -void SysInstaller::slotPushAutoMountClicked() +void DiskEditor::slotPushAutoMountClicked() { - QString disk = comboDiskList->currentText(); - disk.truncate(disk.indexOf(" -")); - autoGenPartitionLayout(disk, true); + QString disk = ui->comboDiskList->currentText(); + disk.truncate(disk.indexOf(" -")); + autoGenPartitionLayout(disk, true); } // Function which will add a new filesystem in our custom dialog -void SysInstaller::slotAddNewFileSystem() +void DiskEditor::slotAddNewFileSystem() { - dfs = new dialogFileSystem(); - dfs->dialogInit(sysDisks, sysFinalDiskLayout); - connect(dfs, SIGNAL(updated(QList )), this, SLOT(slotUpdateFileSystemLayout(QList))); - dfs->show(); + dfs = new dialogFileSystem(); + dfs->dialogInit(sysDisks, sysFinalDiskLayout); + connect(dfs, SIGNAL(updated(QList )), this, SLOT(slotUpdateFileSystemLayout(QList))); + dfs->show(); } -void SysInstaller::slotUpdateFileSystemLayout(QList newFileSystemLayout) +void DiskEditor::slotUpdateFileSystemLayout(QList newFileSystemLayout) { - sysFinalDiskLayout = newFileSystemLayout; - slotRefreshCustomPartitionWidget(); + sysFinalDiskLayout = newFileSystemLayout; + slotRefreshCustomPartitionWidget(); } // Function which will edit a filesystem the user has selected -void SysInstaller::slotEditFileSystem() +void DiskEditor::slotEditFileSystem() { - QString tmp; - int editItem; - bool ok; + QString tmp; + int editItem; + bool ok; - if ( ! treeWidgetCustomPartition->currentItem() ) - return; + if ( ! ui->treeWidgetCustomPartition->currentItem() ) + return; - tmp = treeWidgetCustomPartition->currentItem()->text(0); - editItem = tmp.toInt(&ok); - if (!ok) - return; + tmp = ui->treeWidgetCustomPartition->currentItem()->text(0); + editItem = tmp.toInt(&ok); + if (!ok) + return; - dfs = new dialogFileSystem(); - dfs->dialogInit(sysDisks, sysFinalDiskLayout); - connect(dfs, SIGNAL(updated(QList )), this, SLOT(slotUpdateFileSystemLayout(QList))); - dfs->setEditing(editItem); - dfs->show(); + dfs = new dialogFileSystem(); + dfs->dialogInit(sysDisks, sysFinalDiskLayout); + connect(dfs, SIGNAL(updated(QList )), this, SLOT(slotUpdateFileSystemLayout(QList))); + dfs->setEditing(editItem); + dfs->show(); } // Function which will delete a filesystem -void SysInstaller::slotRemoveFileSystem() +void DiskEditor::slotRemoveFileSystem() { - QString tmp; - int rmItem; - bool ok; + QString tmp; + int rmItem; + bool ok; - if ( ! treeWidgetCustomPartition->currentItem() ) - return; + if ( ! ui->treeWidgetCustomPartition->currentItem() ) + return; - tmp = treeWidgetCustomPartition->currentItem()->text(0); - rmItem = tmp.toInt(&ok); - if (!ok) - return; + tmp = ui->treeWidgetCustomPartition->currentItem()->text(0); + rmItem = tmp.toInt(&ok); + if (!ok) + return; - sysFinalDiskLayout.removeAt(rmItem); + sysFinalDiskLayout.removeAt(rmItem); - // Refresh the display - slotRefreshCustomPartitionWidget(); + // Refresh the display + slotRefreshCustomPartitionWidget(); } // Function which will refresh the custom partition widget based upon our sysFileDiskLayout -void SysInstaller::slotRefreshCustomPartitionWidget() +void DiskEditor::slotRefreshCustomPartitionWidget() { - QStringList tmpList; - QString tmp; + QStringList tmpList; + QString tmp; - qDebug() << sysFinalDiskLayout; + qDebug() << sysFinalDiskLayout; - treeWidgetCustomPartition->clear(); - for (int i=0; i < sysFinalDiskLayout.count(); ++i) { - tmpList.clear(); + ui->treeWidgetCustomPartition->clear(); + for (int i=0; i < sysFinalDiskLayout.count(); ++i) { + tmpList.clear(); - // Start adding the disk items to our tree widget - if ( sysFinalDiskLayout.at(i).at(1) == "ALL" ) - tmpList << tmp.setNum(i) << sysFinalDiskLayout.at(i).at(0) \ - << sysFinalDiskLayout.at(i).at(2) << sysFinalDiskLayout.at(i).at(4) << sysFinalDiskLayout.at(i).at(3) ; - else - tmpList << tmp.setNum(i) << sysFinalDiskLayout.at(i).at(0) + sysFinalDiskLayout.at(i).at(1) \ - << sysFinalDiskLayout.at(i).at(2) << sysFinalDiskLayout.at(i).at(4) << sysFinalDiskLayout.at(i).at(3) ; + // Start adding the disk items to our tree widget + if ( sysFinalDiskLayout.at(i).at(1) == "ALL" ) + tmpList << tmp.setNum(i) << sysFinalDiskLayout.at(i).at(0) + << sysFinalDiskLayout.at(i).at(2) << sysFinalDiskLayout.at(i).at(4) << sysFinalDiskLayout.at(i).at(3) ; + else + tmpList << tmp.setNum(i) << sysFinalDiskLayout.at(i).at(0) + sysFinalDiskLayout.at(i).at(1) + << sysFinalDiskLayout.at(i).at(2) << sysFinalDiskLayout.at(i).at(4) << sysFinalDiskLayout.at(i).at(3) ; - new QTreeWidgetItem(treeWidgetCustomPartition, tmpList); - } - + new QTreeWidgetItem(ui->treeWidgetCustomPartition, tmpList); + } + } // Function which returns the pc-sysinstall cfg data -QStringList SysInstaller::getDiskCfgSettings(QStringList &summaryList) +QStringList DiskEditor::getDiskCfgSettings(QStringList &summaryList) { - QStringList tmpList; - QList copyList; - QString tmp, workingDisk, workingSlice, tmpSlice, XtraTmp, startPart, sliceSize; - int disk = 0; + QStringList tmpList; + QList copyList; + QString tmp, workingDisk, workingSlice, tmpSlice, XtraTmp, startPart, sliceSize; + int disk = 0; - // Copy over the list to a new variable we can mangle without modifying the original - copyList = sysFinalDiskLayout; + // Copy over the list to a new variable we can mangle without modifying the original + copyList = sysFinalDiskLayout; - // Start our summary - summaryList << ""; - summaryList << "" + tr("The disk will be setup with the following configuration:") + ""; + // Start our summary + summaryList << ""; + summaryList << "" + tr("The disk will be setup with the following configuration:") + ""; - while ( ! copyList.empty() ) - { - workingDisk = copyList.at(0).at(0); - workingSlice = copyList.at(0).at(1); - tmpSlice = workingSlice; - tmpList << "# Disk Setup for " + workingDisk ; + while ( ! copyList.empty() ) + { + workingDisk = copyList.at(0).at(0); + workingSlice = copyList.at(0).at(1); + tmpSlice = workingSlice; + tmpList << "# Disk Setup for " + workingDisk; - // Check if this is an install to "Unused Space" - for (int z=0; z < sysDisks.count(); ++z) - if ( sysDisks.at(z).at(0) == "SLICE" \ - && sysDisks.at(z).at(2) == workingDisk + workingSlice \ - && sysDisks.at(z).at(4) == "Unused Space" ) - tmpSlice = "free"; + // Check if this is an install to "Unused Space" + for (int z=0; z < sysDisks.count(); ++z) + if ( sysDisks.at(z).at(0) == "SLICE" + && sysDisks.at(z).at(2) == workingDisk + workingSlice + && sysDisks.at(z).at(4) == "Unused Space" ) + tmpSlice = "free"; - tmpList << "disk" + tmp.setNum(disk) + "=" + workingDisk; - tmpList << "partition=" + tmpSlice; - if ( checkBootLoader->isChecked() ) - tmpList << "bootManager=bsd"; - else - tmpList << "bootManager=none"; + tmpList << "disk" + tmp.setNum(disk) + "=" + workingDisk; + tmpList << "partition=" + tmpSlice; + if ( ui->checkBootLoader->isChecked() ) + tmpList << "bootManager=bsd"; + else + tmpList << "bootManager=none"; - // If this is a dedicated disk, mark if using MBR/GPT - if ( tmpSlice == "ALL" ) { - if ( checkDiskGPT->isChecked() ) - tmpList << "partscheme=GPT"; - else - tmpList << "partscheme=MBR"; - } + // If this is a dedicated disk, mark if using MBR/GPT + if ( tmpSlice == "ALL" ) { + if ( ui->checkDiskGPT->isChecked() ) + tmpList << "partscheme=GPT"; + else + tmpList << "partscheme=MBR"; + } - // Check for any mirror for this device - for (int i=0; i < copyList.count(); ++i) { - if ( copyList.at(i).at(2).indexOf("MIRROR(" + workingDisk + ")") != -1 ) - { - tmpList << "mirror=" + copyList.at(i).at(0); - tmpList << "mirrorbal=" + copyList.at(i).at(3); - summaryList << tr("Disk:") + copyList.at(i).at(0) + " " + tr("Mirroring:") + workingDisk; - copyList.removeAt(i); - break; - } - } - tmpList << "commitDiskPart"; - tmpList << ""; + // Check for any mirror for this device + for (int i=0; i < copyList.count(); ++i) { + if ( copyList.at(i).at(2).indexOf("MIRROR(" + workingDisk + ")") != -1 ) + { + tmpList << "mirror=" + copyList.at(i).at(0); + tmpList << "mirrorbal=" + copyList.at(i).at(3); + summaryList << tr("Disk:") + copyList.at(i).at(0) + " " + tr("Mirroring:") + workingDisk; + copyList.removeAt(i); + break; + } + } + tmpList << "commitDiskPart"; + tmpList << ""; - // If after doing the mirror, our list is empty, break out - if ( copyList.empty() ) - break; - - // Now print the partition section for this slice - tmpList << "# Partition Setup for " + workingDisk + "(" + workingSlice + ")"; - tmpList << "# All sizes are expressed in MB"; - tmpList << "# Avail FS Types, UFS, UFS+S, UFS+SUJ, UFS+J, ZFS, SWAP"; - tmpList << "# UFS.eli, UFS+S.eli, UFS+SUJ, UFS+J.eli, ZFS.eli, SWAP.eli"; + // If after doing the mirror, our list is empty, break out + if ( copyList.empty() ) + break; - // If there is a dedicated /boot partition, need to list that first, see what is found - for (int i=0; i < copyList.count(); ++i) { - QStringList mounts = copyList.at(i).at(2).split(","); - for (int z = 0; z < mounts.size(); ++z) { - if ( copyList.at(i).at(0) == workingDisk \ - && copyList.at(i).at(1) == workingSlice \ - && mounts.at(z) == "/boot" ) - startPart="/boot"; - } - } + // Now print the partition section for this slice + tmpList << "# Partition Setup for " + workingDisk + "(" + workingSlice + ")"; + tmpList << "# All sizes are expressed in MB"; + tmpList << "# Avail FS Types, UFS, UFS+S, UFS+SUJ, UFS+J, ZFS, SWAP"; + tmpList << "# UFS.eli, UFS+S.eli, UFS+SUJ, UFS+J.eli, ZFS.eli, SWAP.eli"; - // If no dedicated /boot partition, then lets list "/" first - if(startPart.isEmpty()) - startPart="/"; + // If there is a dedicated /boot partition, need to list that first, see what is found + for (int i=0; i < copyList.count(); ++i) { + QStringList mounts = copyList.at(i).at(2).split(","); + for (int z = 0; z < mounts.size(); ++z) { + if ( copyList.at(i).at(0) == workingDisk + && copyList.at(i).at(1) == workingSlice + && mounts.at(z) == "/boot" ) + startPart="/boot"; + } + } - // Start by looking for the root partition - for (int i=0; i < copyList.count(); ++i) { - QStringList mounts = copyList.at(i).at(2).split(","); - for (int z = 0; z < mounts.size(); ++z) { - if ( copyList.at(i).at(0) == workingDisk \ - && copyList.at(i).at(1) == workingSlice \ - && mounts.at(z) == startPart ) { + // If no dedicated /boot partition, then lets list "/" first + if (startPart.isEmpty()) + startPart="/"; - // Check if we have any extra arguments to throw on the end - XtraTmp=""; - if ( ! copyList.at(i).at(5).isEmpty() ) - XtraTmp=" (" + copyList.at(i).at(5) + ")" ; + // Start by looking for the root partition + for (int i=0; i < copyList.count(); ++i) { + QStringList mounts = copyList.at(i).at(2).split(","); + for (int z = 0; z < mounts.size(); ++z) { + if ( copyList.at(i).at(0) == workingDisk + && copyList.at(i).at(1) == workingSlice + && mounts.at(z) == startPart ) { - // Write out the partition line - tmpList << "disk" + tmp.setNum(disk) + "-part=" \ - + copyList.at(i).at(3) + " " + copyList.at(i).at(4) \ - + " " + copyList.at(i).at(2) + XtraTmp; + // Check if we have any extra arguments to throw on the end + XtraTmp=""; + if ( ! copyList.at(i).at(5).isEmpty() ) + XtraTmp=" (" + copyList.at(i).at(5) + ")" ; - // Check if we have an encryption passphrase to use - if ( ! copyList.at(i).at(6).isEmpty() ) - tmpList << "encpass=" + copyList.at(i).at(6); + // Write out the partition line + tmpList << "disk" + tmp.setNum(disk) + "-part=" + + copyList.at(i).at(3) + " " + copyList.at(i).at(4) + + " " + copyList.at(i).at(2) + XtraTmp; - // Write the user summary - summaryList << ""; - summaryList << tr("Partition:") + " " + workingDisk + "(" + workingSlice + "):"; - summaryList << tr("FileSystem:") + " " + copyList.at(i).at(3); - summaryList << tr("Size:") + " " + copyList.at(i).at(4) + "MB "; - summaryList << tr("Mount:") + " " + copyList.at(i).at(2); + // Check if we have an encryption passphrase to use + if ( ! copyList.at(i).at(6).isEmpty() ) + tmpList << "encpass=" + copyList.at(i).at(6); - // Done with this item, remove it now - copyList.removeAt(i); - break; + // Write the user summary + summaryList << ""; + summaryList << tr("Partition:") + " " + workingDisk + "(" + workingSlice + "):"; + summaryList << tr("FileSystem:") + " " + copyList.at(i).at(3); + summaryList << tr("Size:") + " " + copyList.at(i).at(4) + "MB "; + summaryList << tr("Mount:") + " " + copyList.at(i).at(2); + + // Done with this item, remove it now + copyList.removeAt(i); + break; + } + } } - } - } - // Now look for SWAP - for (int i=0; i < copyList.count(); ++i) { - if ( copyList.at(i).at(0) == workingDisk \ - && copyList.at(i).at(1) == workingSlice \ - && copyList.at(i).at(2) == "SWAP" ) { + // Now look for SWAP + for (int i=0; i < copyList.count(); ++i) { + if ( copyList.at(i).at(0) == workingDisk + && copyList.at(i).at(1) == workingSlice + && copyList.at(i).at(2) == "SWAP" ) { - // Write the partition line - tmpList << "disk" + tmp.setNum(disk) + "-part=" \ - + copyList.at(i).at(3) + " " + copyList.at(i).at(4) \ - + " none"; + // Write the partition line + tmpList << "disk" + tmp.setNum(disk) + "-part=" + + copyList.at(i).at(3) + " " + copyList.at(i).at(4) + + " none"; - // Write the user summary - summaryList << ""; - summaryList << tr("Partition:") + " " + workingDisk + "(" + workingSlice + "):"; - summaryList << tr("FileSystem:") + " " + copyList.at(i).at(3); - summaryList << tr("Size:") + " " + copyList.at(i).at(4) + "MB "; + // Write the user summary + summaryList << ""; + summaryList << tr("Partition:") + " " + workingDisk + "(" + workingSlice + "):"; + summaryList << tr("FileSystem:") + " " + copyList.at(i).at(3); + summaryList << tr("Size:") + " " + copyList.at(i).at(4) + "MB "; - // Done with this item, remove it now - copyList.removeAt(i); - break; - } - } + // Done with this item, remove it now + copyList.removeAt(i); + break; + } + } - - // Now look for any other partitions - int count = copyList.count(); - for (int i=0; i < count; ++i) { - if ( copyList.at(i).at(0) == workingDisk \ - && copyList.at(i).at(1) == workingSlice ) { - // Check if we have any extra arguments to throw on the end - XtraTmp=""; - if ( ! copyList.at(i).at(5).isEmpty() ) - XtraTmp=" (" + copyList.at(i).at(5) + ")" ; + // Now look for any other partitions + int count = copyList.count(); + for (int i=0; i < count; ++i) { + if ( copyList.at(i).at(0) == workingDisk + && copyList.at(i).at(1) == workingSlice ) { - // If we are working on the last partition, set the size to 0 to use remaining disk - if ( i == count ) - sliceSize = "0"; - else - sliceSize=copyList.at(i).at(4); + // Check if we have any extra arguments to throw on the end + XtraTmp=""; + if ( ! copyList.at(i).at(5).isEmpty() ) + XtraTmp=" (" + copyList.at(i).at(5) + ")" ; - // Write the partition line - tmpList << "disk" + tmp.setNum(disk) + "-part=" \ - + copyList.at(i).at(3) + " " + sliceSize \ - + " " + copyList.at(i).at(2) + XtraTmp; + // If we are working on the last partition, set the size to 0 to use remaining disk + if ( i == count ) + sliceSize = "0"; + else + sliceSize=copyList.at(i).at(4); - // Check if we have an encryption passphrase to use - if ( ! copyList.at(i).at(6).isEmpty() ) - tmpList << "encpass=" + copyList.at(i).at(6); + // Write the partition line + tmpList << "disk" + tmp.setNum(disk) + "-part=" + + copyList.at(i).at(3) + " " + sliceSize + + " " + copyList.at(i).at(2) + XtraTmp; - // Write the user summary - summaryList << ""; - summaryList << tr("Partition:") + " " + workingDisk + "(" + workingSlice + "):"; - summaryList << tr("FileSystem:") + " " + copyList.at(i).at(3); - summaryList << tr("Size:") + " " + copyList.at(i).at(4) + "MB "; - summaryList << tr("Mount:") + " " + copyList.at(i).at(2); + // Check if we have an encryption passphrase to use + if ( ! copyList.at(i).at(6).isEmpty() ) + tmpList << "encpass=" + copyList.at(i).at(6); - // Done with this item, remove it now - copyList.removeAt(i); - i--; - count--; - } - } + // Write the user summary + summaryList << ""; + summaryList << tr("Partition:") + " " + workingDisk + "(" + workingSlice + "):"; + summaryList << tr("Filesystem:") + " " + copyList.at(i).at(3); + summaryList << tr("Size:") + " " + copyList.at(i).at(4) + "MB "; + summaryList << tr("Mount:") + " " + copyList.at(i).at(2); + // Done with this item, remove it now + copyList.removeAt(i); + i--; + count--; + } + } - // Close out this partition section - tmpList << "commitDiskLabel"; - tmpList << ""; - // Increment our disk counter - disk++; - } + // Close out this partition section + tmpList << "commitDiskLabel"; + tmpList << ""; - return tmpList; + // Increment our disk counter + disk++; + } + + return tmpList; } Index: dialogZFSMount.h =================================================================== --- dialogZFSMount.h (revision 9216) +++ dialogZFSMount.h (working copy) @@ -6,26 +6,26 @@ class dialogZFSMount : public QDialog, private Ui::dialogZFSMount { - Q_OBJECT + Q_OBJECT public: - dialogZFSMount() : QDialog() - { - setupUi(this); - } + dialogZFSMount() : QDialog() + { + setupUi(this); + } void dialogInit(); public slots: private slots: - void slotPushCancel(); - void slotPushAdd(); + void slotPushCancel(); + void slotPushAdd(); private: signals: - void saved(QString); + void saved(QString); } ; #endif // DIALOGZFSMOUNT_H Index: componentselectionscreen.h =================================================================== --- componentselectionscreen.h (revision 0) +++ componentselectionscreen.h (revision 0) @@ -0,0 +1,32 @@ +#ifndef COMPONENTSELECTIONSCREEN_H +#define COMPONENTSELECTIONSCREEN_H + +#include + +namespace Ui { +class ComponentSelectionScreen; +} + +class ComponentSelectionScreen : public QWidget +{ + Q_OBJECT + +public: + explicit ComponentSelectionScreen(QWidget *parent = 0); + ~ComponentSelectionScreen(); + +private slots: + void slotAddComponent(); + void slotRemoveComponent(); + void refreshComponents(); + +private: + Ui::ComponentSelectionScreen *ui; + + QStringList getComponentCfgSettings(QStringList &summaryList); + void connectComponentSlots(); + + QList listComponents; // QStringList for our available components +}; + +#endif // COMPONENTSELECTIONSCREEN_H Index: installtypescreen.h =================================================================== --- installtypescreen.h (revision 0) +++ installtypescreen.h (revision 0) @@ -0,0 +1,44 @@ +#ifndef INSTALLTYPESCREEN_H +#define INSTALLTYPESCREEN_H + +#include + +#include "dialogSelectNet.h" + +namespace Ui { +class InstallTypeScreen; +} + +class InstallTypeScreen : public QWidget +{ + Q_OBJECT + +public: + explicit InstallTypeScreen(QWidget *parent = 0); + ~InstallTypeScreen(); + + bool validateAndFinish(); + bool isRestoreType(); + bool isUpgradeType(); + bool isInstallingPcbsd(); + bool isNetworkInstallType(); + void setCanInstallFreeBSD(bool enabled); + void setCanInstallFromPhysicalMedia(bool enabled); + +signals: + void signalChangedOS(QString newOS); + +private slots: + void slotChangedInstallSource(); + void slotChangedNic(); + void slotChangedInstallType(); + void slotChangedOS(); + +private: + void loadNics(); + + dialogSelectNetServer *dsn; + Ui::InstallTypeScreen *ui; +}; + +#endif // INSTALLTYPESCREEN_H Index: dialogHelp.h =================================================================== --- dialogHelp.h (revision 9216) +++ dialogHelp.h (working copy) @@ -6,13 +6,13 @@ class dialogHelp : public QDialog, private Ui::dialogHelp { - Q_OBJECT + Q_OBJECT public: - dialogHelp() : QDialog() - { - setupUi(this); - } + dialogHelp() : QDialog() + { + setupUi(this); + } void dialogInit(QString helpText); Index: sys-pkgmgmt.cpp =================================================================== --- sys-pkgmgmt.cpp (revision 9216) +++ sys-pkgmgmt.cpp (working copy) @@ -1,236 +1,274 @@ #include "sysinstaller.h" +#include "packageselectionscreen.h" +#include "ui_packageselectionscreen.h" +PackageSelectionScreen::PackageSelectionScreen(QWidget *parent) : + QWidget(parent), + ui(new Ui::PackageSelectionScreen) +{ + ui->setupUi(this); +} +PackageSelectionScreen::~PackageSelectionScreen() +{ + delete ui; +} + // Connect all the disk-related slots -void SysInstaller::initDesktopPkgs() +void PackageSelectionScreen::initDesktopPkgs() { - // Start by reading our list of desktop pkgs, and populate the GUI + // Start by reading our list of desktop pkgs, and populate the GUI - // First look for "parent" apps - for (int z=0; z < listDeskPkgs.count(); ++z) - if ( listDeskPkgs.at(z).at(3).isEmpty() ) { + // First look for "parent" apps + for (int z=0; z < listDeskPkgs.count(); ++z) + if ( listDeskPkgs.at(z).at(3).isEmpty() ) { - // Skip the "base-system" package, since we are installing it anyway - if (listDeskPkgs.at(z).at(0) == "base-system" ) - continue; + // Skip the "base-system" package, since we are installing it anyway + if (listDeskPkgs.at(z).at(0) == "base-system" ) + continue; - QTreeWidgetItem *deskItem = new QTreeWidgetItem(treeWidgetDesktopPackages, \ - QStringList() << listDeskPkgs.at(z).at(0) ); - deskItem->setIcon(0, QIcon(listDeskPkgs.at(z).at(2))); - deskItem->setToolTip(0, listDeskPkgs.at(z).at(1)); - deskItem->setCheckState(0, Qt::Unchecked); + QTreeWidgetItem *deskItem = new QTreeWidgetItem(ui->treeWidgetDesktopPackages, + QStringList() << listDeskPkgs.at(z).at(0) ); + deskItem->setIcon(0, QIcon(listDeskPkgs.at(z).at(2))); + deskItem->setToolTip(0, listDeskPkgs.at(z).at(1)); + deskItem->setCheckState(0, Qt::Unchecked); - if ( listDeskPkgs.at(z).at(0) == "KDE4" ) - deskItem->setCheckState(0, Qt::Checked); - } + if ( listDeskPkgs.at(z).at(0) == "KDE4" ) + deskItem->setCheckState(0, Qt::Checked); + } - // First look for "parent" apps - for (int z=0; z < listDeskPkgs.count(); ++z) - if ( ! listDeskPkgs.at(z).at(3).isEmpty() ) { - QTreeWidgetItem *deskItem = new QTreeWidgetItem(QStringList() << listDeskPkgs.at(z).at(0) ); - deskItem->setIcon(0, QIcon(listDeskPkgs.at(z).at(2))); - deskItem->setToolTip(0, listDeskPkgs.at(z).at(1)); + // First look for "parent" apps + for (int z=0; z < listDeskPkgs.count(); ++z) + if ( ! listDeskPkgs.at(z).at(3).isEmpty() ) { + QTreeWidgetItem *deskItem = new QTreeWidgetItem(QStringList() << listDeskPkgs.at(z).at(0) ); + deskItem->setIcon(0, QIcon(listDeskPkgs.at(z).at(2))); + deskItem->setToolTip(0, listDeskPkgs.at(z).at(1)); - if ( listDeskPkgs.at(z).at(3) == "KDE4" ) - deskItem->setCheckState(0, Qt::Checked); - else - deskItem->setCheckState(0, Qt::Unchecked); + if ( listDeskPkgs.at(z).at(3) == "KDE4" ) + deskItem->setCheckState(0, Qt::Checked); + else + deskItem->setCheckState(0, Qt::Unchecked); - // Now locate the parent app - QTreeWidgetItemIterator it(treeWidgetDesktopPackages); - while (*it) { - if ((*it)->text(0) == listDeskPkgs.at(z).at(3)) { - (*it)->addChild(deskItem); - break; - } - ++it; + // Now locate the parent app + QTreeWidgetItemIterator it(ui->treeWidgetDesktopPackages); + while (*it) { + if ((*it)->text(0) == listDeskPkgs.at(z).at(3)) { + (*it)->addChild(deskItem); + break; + } + ++it; + } } - } - treeWidgetDesktopPackages->setMouseTracking(TRUE); - connect(treeWidgetDesktopPackages, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(slotDeskPkgsChanged(QTreeWidgetItem *, int))); - connect(treeWidgetDesktopPackages, SIGNAL(itemEntered(QTreeWidgetItem *, int)), this, SLOT(slotShowLabelDesc(QTreeWidgetItem *, int))); + ui->treeWidgetDesktopPackages->setMouseTracking(TRUE); + connect(ui->treeWidgetDesktopPackages, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(slotDeskPkgsChanged(QTreeWidgetItem *, int))); + connect(ui->treeWidgetDesktopPackages, SIGNAL(itemEntered(QTreeWidgetItem *, int)), this, SLOT(slotShowLabelDesc(QTreeWidgetItem *, int))); } +bool PackageSelectionScreen::validateAndFinish() +{ +#if 0 + if (!availPackageData || (!hasPkgsOnMedia && !ui->radioNetworkInstall->isChecked())) { + QString ss = ui->labels.at(4)->styleSheet(); + ui->labels.at(4)->setStyleSheet("color: rgb(255, 255, 255);"); + ui->labels.at(7)->setStyleSheet(ss); + startConfigGen(); + setCurrentIndex(7); + return false; + } +#endif + return true; +} + // Slot to show meta-pkg description on mouseover -void SysInstaller::slotShowLabelDesc(QTreeWidgetItem *aItem, int aCol) +void PackageSelectionScreen::slotShowLabelDesc(QTreeWidgetItem *aItem, int aCol) { - labelPkgDesc->setText(""); + ui->labelPkgDesc->setText(""); - if (!aItem) - return; + if (!aItem) + return; - for (int z=0; z < listDeskPkgs.count(); ++z) { - if ( aItem->text(0) == listDeskPkgs.at(z).at(0) ) { - labelPkgDesc->setText(listDeskPkgs.at(z).at(1)); - break; - } - } + for (int z=0; z < listDeskPkgs.count(); ++z) { + if ( aItem->text(0) == listDeskPkgs.at(z).at(0) ) { + ui->labelPkgDesc->setText(listDeskPkgs.at(z).at(1)); + break; + } + } } // The User changed the tree widget checked / unchecked stuff sanity check -void SysInstaller::slotDeskPkgsChanged(QTreeWidgetItem *aItem, int aCol) +void PackageSelectionScreen::slotDeskPkgsChanged(QTreeWidgetItem *aItem, int aCol) { - if (!aItem) - return; + if (!aItem) + return; - disconnect(treeWidgetDesktopPackages, SIGNAL(itemChanged(QTreeWidgetItem *, int)), 0, 0); + disconnect(ui->treeWidgetDesktopPackages, SIGNAL(itemChanged(QTreeWidgetItem *, int)), 0, 0); - if (aItem->childCount() == 0) { - if (aItem->checkState(0) == Qt::Checked && aItem->parent() ) - if ( allChildrenPkgsChecked(aItem->parent()->text(0))) - aItem->parent()->setCheckState(0, Qt::Checked); - else - aItem->parent()->setCheckState(0, Qt::PartiallyChecked); - if (aItem->checkState(0) == Qt::Unchecked && aItem->parent() ) - if ( ! allChildrenPkgsUnchecked(aItem->parent()->text(0))) - aItem->parent()->setCheckState(0, Qt::PartiallyChecked); + if (aItem->childCount() == 0) { + if (aItem->checkState(0) == Qt::Checked && aItem->parent() ) + if ( allChildrenPkgsChecked(aItem->parent()->text(0))) + aItem->parent()->setCheckState(0, Qt::Checked); + else + aItem->parent()->setCheckState(0, Qt::PartiallyChecked); + if (aItem->checkState(0) == Qt::Unchecked && aItem->parent() ) + if ( ! allChildrenPkgsUnchecked(aItem->parent()->text(0))) + aItem->parent()->setCheckState(0, Qt::PartiallyChecked); - } else { - if (aItem->checkState(0) == Qt::Checked ) - checkAllChildrenPkgs(aItem->text(0)); - else - uncheckAllChildrenPkgs(aItem->text(0)); - } - + } else { + if (aItem->checkState(0) == Qt::Checked ) + checkAllChildrenPkgs(aItem->text(0)); + else + uncheckAllChildrenPkgs(aItem->text(0)); + } - connect(treeWidgetDesktopPackages, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(slotDeskPkgsChanged(QTreeWidgetItem *, int))); + + connect(ui->treeWidgetDesktopPackages, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(slotDeskPkgsChanged(QTreeWidgetItem *, int))); } +void PackageSelectionScreen::initPackageList() +{ + // Load any package scheme data + listDeskPkgs = Scripts::Backend::getPackageData(availPackageData); + if (availPackageData) + initDesktopPkgs(); +} + // Check if we have any desktop packages selected -bool SysInstaller::haveMetaDesktopChecked() +bool PackageSelectionScreen::haveMetaDesktopChecked() { - QTreeWidgetItemIterator it(treeWidgetDesktopPackages); - while (*it) { - if ((*it)->checkState(0) == Qt::Checked || (*it)->checkState(0) == Qt::PartiallyChecked ) - for (int z=0; z < listDeskPkgs.count(); ++z) - if ( (*it)->text(0) == listDeskPkgs.at(z).at(0) && listDeskPkgs.at(z).at(4) == "YES" ) - return true; - ++it; - } + QTreeWidgetItemIterator it(ui->treeWidgetDesktopPackages); + while (*it) { + if ((*it)->checkState(0) == Qt::Checked || (*it)->checkState(0) == Qt::PartiallyChecked ) + for (int z=0; z < listDeskPkgs.count(); ++z) + if ( (*it)->text(0) == listDeskPkgs.at(z).at(0) && listDeskPkgs.at(z).at(4) == "YES" ) + return true; + ++it; + } - QMessageBox::warning(this, tr("No Desktop"), - tr("No desktops have been selected! Please choose at least one desktop to continue."), - QMessageBox::Ok, - QMessageBox::Ok); + QMessageBox::warning(this, tr("No Desktop"), + tr("No desktops have been selected! Please choose at least one desktop to continue."), + QMessageBox::Ok, + QMessageBox::Ok); - return false; + return false; } // Check the "parent" app to see if all its children are checked or not -bool SysInstaller::allChildrenPkgsChecked(QString parent) +bool PackageSelectionScreen::allChildrenPkgsChecked(QString parent) { - QTreeWidgetItemIterator it(treeWidgetDesktopPackages); - while (*it) { - if ((*it)->text(0) == parent ) - for ( int i = 0; i < (*it)->childCount() ; ++i) - if ((*it)->child(i)->checkState(0) != Qt::Checked ) - return false; - ++it; - } - return true; + QTreeWidgetItemIterator it(ui->treeWidgetDesktopPackages); + while (*it) { + if ((*it)->text(0) == parent ) + for ( int i = 0; i < (*it)->childCount() ; ++i) + if ((*it)->child(i)->checkState(0) != Qt::Checked ) + return false; + ++it; + } + return true; } // Check the "parent" app to see if all its children are checked or not -bool SysInstaller::allChildrenPkgsUnchecked(QString parent) +bool PackageSelectionScreen::allChildrenPkgsUnchecked(QString parent) { - QTreeWidgetItemIterator it(treeWidgetDesktopPackages); - while (*it) { - if ((*it)->text(0) == parent ) - for ( int i = 0; i < (*it)->childCount() ; ++i) - if ((*it)->child(i)->checkState(0) != Qt::Unchecked ) - return false; - ++it; - } - return true; + QTreeWidgetItemIterator it(ui->treeWidgetDesktopPackages); + while (*it) { + if ((*it)->text(0) == parent ) + for ( int i = 0; i < (*it)->childCount() ; ++i) + if ((*it)->child(i)->checkState(0) != Qt::Unchecked ) + return false; + ++it; + } + return true; } // Check all children of parent -void SysInstaller::checkAllChildrenPkgs(QString parent) +void PackageSelectionScreen::checkAllChildrenPkgs(QString parent) { - QTreeWidgetItemIterator it(treeWidgetDesktopPackages); - while (*it) { - if ((*it)->parent()) - if ((*it)->parent()->text(0) == parent) - (*it)->setCheckState(0, Qt::Checked); - ++it; - } + QTreeWidgetItemIterator it(ui->treeWidgetDesktopPackages); + while (*it) { + if ((*it)->parent()) + if ((*it)->parent()->text(0) == parent) + (*it)->setCheckState(0, Qt::Checked); + ++it; + } } // Check all children of parent -void SysInstaller::uncheckAllChildrenPkgs(QString parent) +void PackageSelectionScreen::uncheckAllChildrenPkgs(QString parent) { - QTreeWidgetItemIterator it(treeWidgetDesktopPackages); - while (*it) { - if ((*it)->parent()) - if ((*it)->parent()->text(0) == parent) - (*it)->setCheckState(0, Qt::Unchecked); - ++it; - } + QTreeWidgetItemIterator it(ui->treeWidgetDesktopPackages); + while (*it) { + if ((*it)->parent()) + if ((*it)->parent()->text(0) == parent) + (*it)->setCheckState(0, Qt::Unchecked); + ++it; + } } // Return the configuration for desktop packages -QStringList SysInstaller::getDeskPkgCfg(QStringList &summaryList) +QStringList PackageSelectionScreen::getDeskPkgCfg(QStringList &summaryList) { - QStringList cfgList; - QString cfgLine; - bool skipCat; + QStringList cfgList; + QString cfgLine; + bool skipCat; - summaryList << ""; - summaryList << "" + tr("The following packages will be installed:") + ""; - summaryList << "base-system"; + summaryList << ""; + summaryList << "" + tr("The following packages will be installed:") + ""; + summaryList << "base-system"; - cfgLine="runExtCommand=sh /root/insMetaPkgs.sh base-system"; + cfgLine="runExtCommand=sh /root/insMetaPkgs.sh base-system"; - // For neatness sake, get the parents first - QTreeWidgetItemIterator it(treeWidgetDesktopPackages); - while (*it) { - if ( !(*it)->parent() && ( (*it)->checkState(0) == Qt::Checked || (*it)->checkState(0) == Qt::PartiallyChecked ) ) { + // For neatness sake, get the parents first + QTreeWidgetItemIterator it(ui->treeWidgetDesktopPackages); + while (*it) { + if ( !(*it)->parent() && ( (*it)->checkState(0) == Qt::Checked || (*it)->checkState(0) == Qt::PartiallyChecked ) ) { + // Make sure this isn't just a placeholder category + skipCat = false; + for (int z=0; z < listDeskPkgs.count(); ++z) { + if ( (*it)->text(0) == listDeskPkgs.at(z).at(0) && + listDeskPkgs.at(z).at(5) == "CATEGORY" ) + skipCat=true; + } + if ( skipCat ) + continue; - // Make sure this isn't just a placeholder category - skipCat = false; - for (int z=0; z < listDeskPkgs.count(); ++z) - if ( (*it)->text(0) == listDeskPkgs.at(z).at(0) && \ - listDeskPkgs.at(z).at(5) == "CATEGORY" ) - skipCat=true; - if ( skipCat ) { - // Add it - cfgLine+="," + (*it)->text(0); - summaryList << (*it)->text(0); - } - } - ++it; - } + cfgLine+="," + (*it)->text(0); + summaryList << (*it)->text(0); + } + ++it; + } - // Now get the children - QTreeWidgetItemIterator itC(treeWidgetDesktopPackages); - while (*itC) { - if ((*itC)->parent() && ( (*itC)->checkState(0) == Qt::Checked || (*itC)->checkState(0) == Qt::PartiallyChecked ) ) { + // Now get the children + QTreeWidgetItemIterator itC(ui->treeWidgetDesktopPackages); + while (*itC) { + if ((*itC)->parent() && ( (*itC)->checkState(0) == Qt::Checked || (*itC)->checkState(0) == Qt::PartiallyChecked ) ) { + // Make sure this isn't just a placeholder category + skipCat = false; + for (int z=0; z < listDeskPkgs.count(); ++z) { + if ( (*it)->text(0) == listDeskPkgs.at(z).at(0) && + listDeskPkgs.at(z).at(5) == "CATEGORY" ) + skipCat = true; + } + if ( skipCat ) + continue; - // Make sure this isn't just a placeholder category - skipCat = false; - for (int z=0; z < listDeskPkgs.count(); ++z) - if ( (*it)->text(0) == listDeskPkgs.at(z).at(0) && \ - listDeskPkgs.at(z).at(5) == "CATEGORY" ) - skipCat=true; + cfgLine+="," + (*itC)->text(0); + summaryList << (*itC)->text(0); + } + ++itC; + } - if ( ! skipCat ) { - cfgLine+="," + (*itC)->text(0); - summaryList << (*itC)->text(0); - } - } - ++itC; - } - - if ( radioNetworkInstall->isChecked() ) - cfgLine += " " + netURL + "/packages/"; - else - cfgLine += " CD"; - - cfgList << cfgLine; - return cfgList; + // TODO fix this +#if 0 + if ( radioNetworkInstall->isChecked() ) + cfgLine += " " + netURL + "/packages/"; + else + cfgLine += " CD"; +#endif + cfgList << cfgLine; + return cfgList; } Index: main.cpp =================================================================== --- main.cpp (revision 9216) +++ main.cpp (working copy) @@ -14,71 +14,71 @@ QString changeLang; // Start a loop to watch for language changes - for ( ;; ) + while (true) { - QApplication a(argc, argv); + QApplication a(argc, argv); - // Check what directory our app is in - QString appDir; - if ( QFile::exists("/usr/local/bin/pc-sysinstaller") ) - { - appDir = "/usr/local/share/pcbsd"; - } else { - appDir = QCoreApplication::applicationDirPath(); - } + // Check what directory our app is in + QString appDir; + if ( QFile::exists("/usr/local/bin/pc-sysinstaller") ) + { + appDir = "/usr/local/share/pcbsd"; + } else { + appDir = QCoreApplication::applicationDirPath(); + } - QTranslator translator; - QLocale mylocale; - QString langCode = mylocale.name(); + QTranslator translator; + QLocale mylocale; + QString langCode = mylocale.name(); - if ( ! changeLang.isEmpty() ) - langCode = changeLang; + if ( ! changeLang.isEmpty() ) + langCode = changeLang; - if ( QFile::exists(appDir + "/i18n/SysInstaller_" + langCode + ".qm" ) ) { - translator.load( QString("SysInstaller_") + langCode, appDir + "/i18n/" ); - a.installTranslator(&translator); - qDebug() << "Loaded Translation:" << appDir + "/i18n/SysInstaller_" + langCode + ".qm"; - } else { - qDebug() << "Could not find: " << appDir + "/i18n/SysInstaller_" + langCode + ".qm"; - langCode = ""; - } + if ( QFile::exists(appDir + "/i18n/SysInstaller_" + langCode + ".qm" ) ) { + translator.load( QString("SysInstaller_") + langCode, appDir + "/i18n/" ); + a.installTranslator(&translator); + qDebug() << "Loaded Translation:" << appDir + "/i18n/SysInstaller_" + langCode + ".qm"; + } else { + qDebug() << "Could not find: " << appDir + "/i18n/SysInstaller_" + langCode + ".qm"; + langCode = ""; + } - // Show our splash screen, so the user doesn't freak that that it takes a few seconds to show up - QPixmap pixmap(":/PCBSD/images/pcbsdheader.png"); - QSplashScreen splash(pixmap); - splash.show(); + // Show our splash screen, so the user doesn't freak that that it takes a few seconds to show up + QPixmap pixmap(":/PCBSD/images/pcbsdheader.png"); + QSplashScreen splash(pixmap); + splash.show(); + SysInstaller w; - SysInstaller w; + // Check if we are using diff language + if ( ! langCode.isEmpty() ) + w.welcome->changeLang(langCode); - // Check if we are using diff language - if ( ! langCode.isEmpty() ) - w.changeLang(langCode); + // Center the installer + QRect dimensions = QApplication::desktop()->screenGeometry(); + int wid = dimensions.width(); // returns desktop width + int hig = dimensions.height(); // returns desktop height + w.setGeometry((wid/2) - (800/2), (hig/2) - (600/2), 800, 600); + w.adjustSize(); - // Center the installer - QRect dimensions = QApplication::desktop()->screenGeometry(); - int wid = dimensions.width(); // returns desktop width - int hig = dimensions.height(); // returns desktop height - w.setGeometry((wid/2) - (800/2), (hig/2) - (600/2), 800, 600); + w.show(); + splash.finish(&w); - w.show(); - splash.finish(&w); - - returnCode = a.exec(); + returnCode = a.exec(); - if ( QFile::exists(TMPLANGFILE) ) { - QFile lfile(TMPLANGFILE); - if (!lfile.open(QIODevice::ReadOnly | QIODevice::Text)) - return 150; - changeLang = lfile.readLine(); - lfile.close(); - qDebug() << "Language switch requested for:" << changeLang; - QFile::remove(TMPLANGFILE); - } else { - break; - } + if ( QFile::exists(TMPLANGFILE) ) { + QFile lfile(TMPLANGFILE); + if (!lfile.open(QIODevice::ReadOnly | QIODevice::Text)) + return 150; + changeLang = lfile.readLine(); + lfile.close(); + qDebug() << "Language switch requested for:" << changeLang; + QFile::remove(TMPLANGFILE); + } else { + break; + } } return returnCode; Index: sysinstaller.ui =================================================================== --- sysinstaller.ui (revision 9216) +++ sysinstaller.ui (working copy) @@ -275,6 +275,12 @@ + + + 0 + 0 + + @@ -460,6 +466,12 @@ + + + 0 + 0 + + @@ -636,9395 +648,8 @@ background-color: rgb(255, 255, 255); - 0 + -1 - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 0 - - - 0 - - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - 4 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 75 - true - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - Language Selection - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 310 - 20 - - - - - - - - - 0 - 0 - - - - - - - - - 79 - 79 - 79 - - - - - - - 250 - 250 - 250 - - - - - - - 79 - 79 - 79 - - - - - - - 79 - 79 - 79 - - - - - - - 250 - 250 - 250 - - - - - - - 250 - 250 - 250 - - - - - - - - - 79 - 79 - 79 - - - - - - - 250 - 250 - 250 - - - - - - - 79 - 79 - 79 - - - - - - - 79 - 79 - 79 - - - - - - - 250 - 250 - 250 - - - - - - - 250 - 250 - 250 - - - - - - - - - 79 - 79 - 79 - - - - - - - 250 - 250 - 250 - - - - - - - 79 - 79 - 79 - - - - - - - 79 - 79 - 79 - - - - - - - 250 - 250 - 250 - - - - - - - 250 - 250 - 250 - - - - - - - - - 75 - true - - - - background-color: rgb(250, 250, 250); -color: rgb(79, 79, 79); - - - - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 309 - 20 - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 668 - 40 - - - - - - - - - - Qt::Horizontal - - - - 88 - 20 - - - - - - - - - 10 - 50 - false - - - - - - - Qt::AlignCenter - - - - - - - 75 - true - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - Local TimeZone - - - Qt::AlignCenter - - - - - - - - - - - - - Automatic synchronization with Internet Time Servers (NTP) - - - true - - - - - - - Qt::Vertical - - - - 20 - 80 - - - - - - - - - - - Qt::Horizontal - - - - 68 - 20 - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 12 - 75 - true - - - - color: rgb(116, 160, 180); -background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - Welcome - - - Qt::AlignCenter - - - - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - QFrame::NoFrame - - - true - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Bitstream Vera Sans'; font-size:10pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Welcome to PC-BSD! You may get started above, or click the Help button for more information on each screen. </p></body></html> - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - 0 - 0 - - - - - 0 - 26 - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 9 - 75 - true - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - Keyboard Model - - - Qt::AlignCenter - - - 5 - - - - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - - - - - 0 - 0 - - - - - 0 - 26 - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 9 - 75 - true - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - Preferred Layout - - - 5 - - - - - - - - 2 - 16777215 - - - - Qt::Vertical - - - - - - - - 0 - 0 - - - - - 0 - 26 - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 9 - 75 - true - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - Preferred Variant - - - 5 - - - - - - - - 0 - 0 - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 0 - 0 - 0 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 86 - 130 - 150 - - - - - 199 - 199 - 199 - - - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 0 - 0 - 0 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 86 - 130 - 150 - - - - - 199 - 199 - 199 - - - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 0 - 0 - 0 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 86 - 130 - 150 - - - - - 199 - 199 - 199 - - - - - - - - - 255 - 255 - 255 - - - - - - - - - 9 - - - - selection-background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(86, 130, 150, 255), stop:1 rgba(199, 199, 199, 255)); -selection-color: rgb(255, 255, 255); -background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - QFrame::NoFrame - - - 2 - - - true - - - - - - - - 0 - 0 - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 0 - 0 - 0 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 86 - 130 - 150 - - - - - 199 - 199 - 199 - - - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 0 - 0 - 0 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 86 - 130 - 150 - - - - - 199 - 199 - 199 - - - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 0 - 0 - 0 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 86 - 130 - 150 - - - - - 199 - 199 - 199 - - - - - - - - - 255 - 255 - 255 - - - - - - - - - 9 - - - - selection-background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(86, 130, 150, 255), stop:1 rgba(199, 199, 199, 255)); -selection-color: rgb(255, 255, 255); -background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - QFrame::NoFrame - - - 2 - - - true - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - QFrame::StyledPanel - - - QFrame::Sunken - - - - 2 - - - 0 - - - - - - 0 - 25 - - - - - - - - - 116 - 160 - 180 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 116 - 160 - 180 - - - - - - - 116 - 160 - 180 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 116 - 160 - 180 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 116 - 160 - 180 - - - - - - - 116 - 160 - 180 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 116 - 160 - 180 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 116 - 160 - 180 - - - - - - - 116 - 160 - 180 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 7 - 75 - true - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); -color: rgb(116, 160, 180); - - - ( you may type into the space below to test your selected settings. ) - - - Qt::AlignCenter - - - 9 - - - - - - - - - - false - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 11 - 75 - true - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - Please select the type of installation you wish to perform: - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 9 - 75 - true - - - - Fresh Install - - - - :/modules/images/install.png:/modules/images/install.png - - - - 25 - 25 - - - - true - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 0 - 0 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 9 - 75 - true - - - - Upgrade - - - - :/modules/images/install.png:/modules/images/install.png - - - - 25 - 25 - - - - - - - - Qt::Horizontal - - - - 13 - 20 - - - - - - - - - 0 - 0 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 9 - 75 - true - - - - Restore from backup - - - - :/modules/images/install.png:/modules/images/install.png - - - - 25 - 25 - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - - Qt::Horizontal - - - - 183 - 245 - - - - - - - - - 0 - 0 - - - - - 100 - 0 - - - - - - - 0 - - - - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - Tip: PC-BSD is designed for the desktop, while FreeBSD makes a great choice for servers - - - true - - - - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - PC-BSD - - - - :/PCBSD/images/pbidiricon.png:/PCBSD/images/pbidiricon.png - - - - 30 - 30 - - - - true - - - - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - FreeBSD - - - - :/modules/images/freebsd.png:/modules/images/freebsd.png - - - - 30 - 30 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 20 - 40 - - - - - - - - - 0 - 0 - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 75 - true - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - Select the system to install: - - - Qt::AlignCenter - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - Qt::Vertical - - - QSizePolicy::MinimumExpanding - - - - 258 - 17 - - - - - - - - - 75 - true - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - Select the system to upgrade: - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - - - - This option will try to import your existing desktop profile settings - - - Keep current users desktop configuration - - - - - - - - - - - - 75 - true - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - Enter your rsync backup settings: - - - Qt::AlignCenter - - - false - - - - - - - Hostname - - - - - - - - - - Username - - - - - - - - - - Port - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - 99999 - - - 22 - - - - - - - Qt::Vertical - - - QSizePolicy::Preferred - - - - 328 - 46 - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - Qt::Horizontal - - - - 182 - 245 - - - - - - - - - 0 - 0 - - - - 0 - - - - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 217 - 230 - 235 - - - - - 255 - 255 - 255 - - - - - - - - - - - 75 - true - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - Select your Installation Source: - - - Qt::AlignCenter - - - - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - DVD / USB - - - - :/modules/images/cdrom_mount.png:/modules/images/cdrom_mount.png - - - true - - - - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - Network / Internet - - - - :/modules/images/install.png:/modules/images/install.png - - - - - - - 1 - - - - - - - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - Network Interface - - - - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - IP Address - - - - - - - 000.000.000.000; - - - Qt::AlignCenter - - - - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - Netmask - - - - - - - 000.000.000.000; - - - Qt::AlignCenter - - - - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - Nameserver (DNS) - - - - - - - 000.000.000.000; - - - Qt::AlignCenter - - - - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - Gateway - - - - - - - 000.000.000.000; - - - Qt::AlignCenter - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - - 183 - 164 - - - - - - - - Qt::Horizontal - - - - 182 - 164 - - - - - - - - - - - - Qt::Horizontal - - - - 43 - 435 - - - - - - - - Qt::Horizontal - - - - 56 - 28 - - - - - - - - Qt::Vertical - - - - 528 - 4 - - - - - - - - - - - 10 - 75 - true - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - Please select the disk drive you wish to use: - - - Qt::AlignCenter - - - - - - - - - - 75 - true - - - - background-color: rgb(250, 250, 250); - - - - /dev/ad0 -- 400GB | Seagate ST340015A 3.01 | ATA/ID Device - - - - - - - - - 0 - 0 - - - - Reload Disk Data - - - - - - - :/modules/images/view-refresh.png:/modules/images/view-refresh.png - - - - - - - - - - - Qt::Horizontal - - - - 56 - 20 - - - - - - - - Qt::Horizontal - - - - 43 - 435 - - - - - - - - Qt::Vertical - - - - 658 - 4 - - - - - - - - - - - - - - - 75 - true - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - Disk Layout - - - Qt::AlignCenter - - - - - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 0 - 26 - - - - - - - - 50 - - - 0 - - - 9 - - - 0 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Auto Partition - - - true - - - - - - - - 0 - 0 - - - - Qt::LeftToRight - - - Customize Disk Partitions (Advanced) - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - QFrame::StyledPanel - - - QFrame::Sunken - - - 0 - - - - - - - Select the slice you wish to install to, or check "Use Entire Disk" - - - - - - - - - - Use Entire Disk - - - - - - - selection-background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(86, 130, 150, 255), stop:1 rgba(199, 199, 199, 255)); -selection-color: rgb(255, 255, 255); - - - - - - - Filesystem for auto-partitioning. If unsure, please leave at the default. - - - - - - - - - UFS + SoftUpdates Journaling - - - true - - - - - - - UFS + SoftUpdates - - - - - - - ZFS - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - Encrypt the /usr partition or ZFS zpool. - - - Encrypt user data - - - - - - - Qt::Horizontal - - - - 418 - 20 - - - - - - - - Add - - - - :/PCBSD/images/edit_add.png:/PCBSD/images/edit_add.png - - - - - - - Delete - - - - :/PCBSD/images/edit_remove.png:/PCBSD/images/edit_remove.png - - - - - - - - - Qt::Vertical - - - - 528 - 20 - - - - - - - - - - 0 - - - - - The following partitions will be created during the installation: - - - - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - - 5 - - - 5 - - - - - background-color: rgb(250, 250, 250); - - - - :/PCBSD/images/edit_add.png:/PCBSD/images/edit_add.png - - - - 16 - 16 - - - - - - - - background-color: rgb(250, 250, 250); - - - - :/PCBSD/images/edit.png:/PCBSD/images/edit.png - - - - 16 - 16 - - - - - - - - background-color: rgb(250, 250, 250); - - - - :/PCBSD/images/edit_remove.png:/PCBSD/images/edit_remove.png - - - - 16 - 16 - - - - - - - - Qt::Vertical - - - - - - - background-color: rgb(250, 250, 250); - - - Auto Setup - - - - 16 - 16 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - selection-background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(86, 130, 150, 255), stop:1 rgba(199, 199, 199, 255)); -selection-color: rgb(255, 255, 255); - - - QFrame::NoFrame - - - true - - - - ID - - - - - Slice - - - - - Mount - - - - - Size - - - - - Type - - - - - - - - Qt::Horizontal - - - - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - color: rgb(190, 0, 0); - - - Install PC-BSD bootloader - - - - :/PCBSD/images/pbidiricon.png:/PCBSD/images/pbidiricon.png - - - - 30 - 30 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Check to use GPT/EFI partition scheme for dedicated disks. -Warning: May not work with older BIOS / Motherboards. - - - Partition with GPT for full disk install - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - Qt::Horizontal - - - - 113 - 472 - - - - - - - - - - - false - - - - - - - 75 - true - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - System Hostname - - - Qt::AlignCenter - - - - - - - Custom hostname - - - - - - - false - - - 250 - - - - - - - - - - Qt::Horizontal - - - - 112 - 497 - - - - - - - - - 50 - false - - - - - - - - - - Password: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - false - - - - - - - QLineEdit::Password - - - - - - - Verify password: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - false - - - - - - - QLineEdit::Password - - - - - - - - 75 - true - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - Administrator Password (root) - - - Qt::AlignCenter - - - - - - - - - - - 0 - 0 - - - - - - - - - - Username: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - false - - - - - - - 16 - - - - - - - Full name: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - false - - - - - - - 1024 - - - - - - - Password: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - false - - - - - - - QLineEdit::Password - - - - - - - Verify password: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - false - - - - - - - QLineEdit::Password - - - - - - - Shell: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - false - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 99 - 17 - - - - - - - - true - - - Apply - - - - :/PCBSD/images/edit.png:/PCBSD/images/edit.png - - - false - - - false - - - false - - - - - - - true - - - Add - - - - :/PCBSD/images/edit_add.png:/PCBSD/images/edit_add.png - - - - - - - - 0 - 0 - - - - - 75 - true - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - Add User - - - Qt::AlignCenter - - - - - - - - - - - 0 - 0 - - - - - 50 - false - - - - - - - - - - true - - - Remove - - - - :/PCBSD/images/edit_remove.png:/PCBSD/images/edit_remove.png - - - false - - - - - - - - 0 - 0 - - - - - - - - - 75 - true - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - User Accounts - - - Qt::AlignCenter - - - - - - - - - - color: rgb(167, 0, 0); - - - - - - Qt::AlignCenter - - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 728 - 25 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 50 - 208 - - - - - - - - - 0 - 0 - - - - - - - - - - - 0 - 0 - - - - - 42 - 42 - - - - - Available System Packages - - - - - - - - Please select the software you wish to have installed. At least one desktop must be selected, and changes may be made after installation. - - - true - - - - - - - - 75 - true - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - System Package Configuration - - - Qt::AlignCenter - - - - - - - QFrame::StyledPanel - - - QFrame::Plain - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 50 - 248 - - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 708 - 25 - - - - - - - - - - - - Qt::Horizontal - - - - 53 - 438 - - - - - - - - Qt::Vertical - - - - 638 - 120 - - - - - - - - Qt::Horizontal - - - - 52 - 488 - - - - - - - - - - - 0 - 0 - - - - - 0 - 26 - - - - - 9 - 75 - true - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - Available Components - - - 5 - - - - - - - QAbstractItemView::MultiSelection - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 0 - 0 - - - - - - - - :/PCBSD/images/next.png:/PCBSD/images/next.png - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 13 - - - - - - - - - 0 - 0 - - - - - - - - :/PCBSD/images/previous.png:/PCBSD/images/previous.png - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - 0 - 0 - - - - - 0 - 26 - - - - - 9 - 75 - true - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - Selected Components - - - 5 - - - - - - - QAbstractItemView::MultiSelection - - - - - - - - - - - - true - - - - - - - Qt::Vertical - - - - 628 - 120 - - - - - - - - - - - - Qt::Horizontal - - - - 100 - 468 - - - - - - - - Qt::Vertical - - - QSizePolicy::Preferred - - - - 348 - 50 - - - - - - - - Qt::Horizontal - - - - 100 - 458 - - - - - - - - - 0 - 0 - - - - - 0 - 26 - - - - - 9 - 75 - true - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - Installation Summary - - - Qt::AlignCenter - - - 5 - - - - - - - - 0 - 0 - - - - true - - - - - - - Qt::Vertical - - - QSizePolicy::Preferred - - - - 408 - 50 - - - - - - - - Please check the summary above, and click 'back' to make any corrections. - - - - - - - - - - - Qt::Horizontal - - - - 123 - 448 - - - - - - - - Qt::Vertical - - - - 478 - 147 - - - - - - - - Qt::Horizontal - - - - 122 - 448 - - - - - - - - - - - - - - QFrame::NoFrame - - - QFrame::Plain - - - Your system is now being installed! This process may take a while, depending upon the installation options chosen, and system speed. You will be notified when the installation is finished. - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - - 24 - - - - - - - - 75 - true - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - Installation Progress - - - Qt::AlignCenter - - - - - - - 24 - - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - Qt::Vertical - - - - 498 - 146 - - - - - - - - - - - - Qt::Horizontal - - - - 227 - 378 - - - - - - - - Qt::Vertical - - - - 288 - 196 - - - - - - - - Qt::Horizontal - - - - 227 - 388 - - - - - - - - - - - - - - The installation is now complete! You may now remove any boot media, and reboot the system to finish. - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - - - - - - 75 - true - - - - background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); - - - Installation Complete - - - Qt::AlignCenter - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - Qt::Vertical - - - - 288 - 196 - - - - - - - - - - - - - - 0 - - - 0 - - - - - - - - - @@ -10138,58 +763,9 @@ - linePassword - linePassword2 - lineUserName - lineFullName - lineUserPassword - lineUserPassword2 - comboShell - pushApplyUser - pushAddUser - listWidgetUsers - pushRemoveUser abortButton backButton nextButton - listUpgrades - lineRsyncHost - lineRsyncUser - spinRsyncPort - radioDVDUSBInstall - radioNetworkInstall - lineIP - lineNetmask - lineDNS - lineDefaultRouter - comboSelectNic - comboDiskList - radioAutoPartition - radioCustomDisk - checkUseEntireDisk - listDiskSlices - pushAddMount - pushEditMount - pushRemoveMount - pushAutoMount - treeWidgetCustomPartition - checkBootLoader - radioUpgrade - radioRestore - radioInstallPCBSD - radioInstallFreeBSD - comboBoxKeyboardModel - comboLanguage - textWelcome - listKbLayouts - listKbVariants - radioInstall - lineKbTest - listAvailComponents - pushComAdd - pushComDel - listSelComponents - textEditSummary Index: diskeditor.ui =================================================================== --- diskeditor.ui (revision 0) +++ diskeditor.ui (revision 0) @@ -0,0 +1,879 @@ + + + DiskEditor + + + + 0 + 0 + 768 + 448 + + + + Form + + + + + 0 + 0 + 768 + 448 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + + + Qt::Horizontal + + + + 43 + 435 + + + + + + + + Qt::Horizontal + + + + 56 + 28 + + + + + + + + Qt::Vertical + + + + 528 + 4 + + + + + + + + + + + 10 + 75 + true + + + + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); + + + Please select the disk drive you wish to use: + + + Qt::AlignCenter + + + + + + + + + + 75 + true + + + + background-color: rgb(250, 250, 250); + + + + /dev/ad0 -- 400GB | Seagate ST340015A 3.01 | ATA/ID Device + + + + + + + + + 0 + 0 + + + + Reload Disk Data + + + + + + + :/modules/images/view-refresh.png:/modules/images/view-refresh.png + + + + + + + + + + + Qt::Horizontal + + + + 56 + 20 + + + + + + + + Qt::Horizontal + + + + 43 + 435 + + + + + + + + Qt::Vertical + + + + 658 + 4 + + + + + + + + + + + + + + + 75 + true + + + + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); + + + Disk Layout + + + Qt::AlignCenter + + + + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 26 + + + + + + + + 50 + + + 0 + + + 9 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Auto Partition + + + true + + + + + + + + 0 + 0 + + + + Qt::LeftToRight + + + Customize Disk Partitions (Advanced) + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + 0 + + + + + + + Select the slice you wish to install to, or check "Use Entire Disk" + + + + + + + + + + Use Entire Disk + + + + + + + selection-background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(86, 130, 150, 255), stop:1 rgba(199, 199, 199, 255)); +selection-color: rgb(255, 255, 255); + + + + + + + Filesystem for auto-partitioning. If unsure, please leave at the default. + + + + + + + + + UFS + SoftUpdates Journaling + + + true + + + + + + + UFS + SoftUpdates + + + + + + + ZFS + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Encrypt the /usr partition or ZFS zpool. + + + Encrypt user data + + + + + + + Qt::Horizontal + + + + 418 + 20 + + + + + + + + Add + + + + :/PCBSD/images/edit_add.png:/PCBSD/images/edit_add.png + + + + + + + Delete + + + + :/PCBSD/images/edit_remove.png:/PCBSD/images/edit_remove.png + + + + + + + + + Qt::Vertical + + + + 528 + 20 + + + + + + + + + + 0 + + + + + The following partitions will be created during the installation: + + + + + + + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255)); + + + + 5 + + + 5 + + + + + background-color: rgb(250, 250, 250); + + + + :/PCBSD/images/edit_add.png:/PCBSD/images/edit_add.png + + + + 16 + 16 + + + + + + + + background-color: rgb(250, 250, 250); + + + + :/PCBSD/images/edit.png:/PCBSD/images/edit.png + + + + 16 + 16 + + + + + + + + background-color: rgb(250, 250, 250); + + + + :/PCBSD/images/edit_remove.png:/PCBSD/images/edit_remove.png + + + + 16 + 16 + + + + + + + + Qt::Vertical + + + + + + + background-color: rgb(250, 250, 250); + + + Auto Setup + + + + 16 + 16 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + selection-background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(86, 130, 150, 255), stop:1 rgba(199, 199, 199, 255)); +selection-color: rgb(255, 255, 255); + + + QFrame::NoFrame + + + true + + + + ID + + + + + Slice + + + + + Mount + + + + + Size + + + + + Type + + + + + + + + Qt::Horizontal + + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + color: rgb(190, 0, 0); + + + Install PC-BSD bootloader + + + + :/PCBSD/images/pbidiricon.png:/PCBSD/images/pbidiricon.png + + + + 30 + 30 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Check to use GPT/EFI partition scheme for dedicated disks. +Warning: May not work with older BIOS / Motherboards. + + + Partition with GPT for full disk install + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + Index: backend.h =================================================================== --- backend.h (revision 9216) +++ backend.h (working copy) @@ -17,7 +17,7 @@ // Set the minimum sizes for FBSD #define FBSD_MINSIZE 4000 -#define FBSD_MINROOT 512 +#define FBSD_MINROOT 1000 #define FBSD_MINVAR 1000 #define FBSD_MINUSR 2000 @@ -61,6 +61,11 @@ static QList getPackageData(bool &found); //static QList slices(); + static bool isLiveMode; + static bool hasInstallOnMedia; + static bool hasFreeBSDOnMedia; + static bool hasPkgsOnMedia; + }; Index: sysinstaller.h =================================================================== --- sysinstaller.h (revision 9216) +++ sysinstaller.h (working copy) @@ -2,6 +2,7 @@ #define SYSINSTALLER_H #include +#include #include #include #include @@ -11,6 +12,17 @@ #include "dialogHelp.h" #include "dialogSelectNet.h" +#include "welcomewidget.h" +#include "keyboardscreen.h" +#include "usersetupscreen.h" +#include "diskeditor.h" +#include "componentselectionscreen.h" +#include "packageselectionscreen.h" +#include "installationscreen.h" +#include "installtypescreen.h" +#include "summaryscreen.h" +#include "installcompletescreen.h" + #include "backend.h" @@ -45,85 +57,54 @@ append(pixmap); append(hint); } - QString title() const { return at(0); } - QString pixmap()const { return at(1); } - QString hint() const { return at(2); } + QString title() const { + return at(0); + } + QString pixmap()const { + return at(1); + } + QString hint() const { + return at(2); + } }; -class SysInstaller : public QWidget, private Ui::SysInstaller +class SysInstaller : public QWidget { Q_OBJECT public: SysInstaller(QWidget *parent = 0); ~SysInstaller(); - void changeLang(QString code); + WelcomeWidget *welcome; + KeyboardScreen *keyboard; + DiskEditor *disk; + UserSetupScreen *user; + PackageSelectionScreen *packages; + ComponentSelectionScreen *components; + SummaryScreen *summary; + InstallationScreen *installing; + InstallTypeScreen *installtype; + InstallCompleteScreen *installdone; + private slots: void slotAbort(); void slotBack(); void slotHelp(); void slotNext(); void slotFinished(); + void slotQuit(); - void slotChangeLanguage(); - // Keyboard slots - void slotCurrentKbLayoutChanged(int); - void slotCurrentKbVariantChanged(int); - void slotSelectedKbItemChanged(); - void slotUpdateKbOnSys(); - - // Networking slots - void slotGotNetworkUrl(QString url); - - // Component slots - void slotAddComponent(); - void slotRemoveComponent(); - - // Source slots - void slotChangedInstallType(); - void slotChangedOS(); - void slotChangedInstallSource(); - void slotChangedNic(); - - // Disk slots - void slotChangedDisk(); - void slotUseEntireDiskClicked(); - void slotChangeRadioCustomDisk(); - void slotRefreshCustomPartitionWidget(); // Slot which refreshes the custom partition view - void slotPushAutoMountClicked(); // Slot when user clicks to auto-create partitions in custom view - void slotAddNewFileSystem(); - void slotEditFileSystem(); - void slotRemoveFileSystem(); - void slotUpdateFileSystemLayout(QList newFileSystemLayout); - void slotAddMBRPartition(); - void slotDeleteMBRPartition(); - void slotLoadDiskInfo(); - void slotEnableDiskAutoEnc(); - - // User Management Slots - void slotPasswordTextChanged(); - void slotRootPasswordLineEditLostFocus(); - void slotCheckUserLinesChanged(); - void slotUserPasswordLineEditLostFocus(); - void slotListWidgetUsersChanged(); - void slotAddUserButton(); - void slotRemoveUserButton(); - void slotApplyUserButton(); - // Slots for the installation - void slotInstallProcFinished( int exitCode, QProcess::ExitStatus status); - void slotReadInstallerOutput(); + //void slotInstallProcFinished( int exitCode, QProcess::ExitStatus status); + // void slotReadInstallerOutput(); // Desktop Packages Slot - void slotDeskPkgsChanged(QTreeWidgetItem *aItem, int aCol); - void slotShowLabelDesc(QTreeWidgetItem *aItem, int aCol); +// void slotDeskPkgsChanged(QTreeWidgetItem *aItem, int aCol); +// void slotShowLabelDesc(QTreeWidgetItem *aItem, int aCol); - // Grab checked / unchecked status of hostname - void slotHostnameClicked(); - private: void initSteps(); void initAnteInstall(); @@ -132,83 +113,58 @@ void loadNics(); void setCurrentIndex(int); - void setKbVariants(const QString &); - void setKbDefaults(); - bool autoGenPartitionLayout(QString target, bool isDisk); - void refreshUsers(); - bool checkUserAccountInfo(); + void installFailed(); // Method which does post-install failure stuff - bool checkForwardUpgrade(); - - QRegExp passwordRegExp; - - QString getDiskScheme(QString disk); - void connectDiskSlots(); // Function to connect disk-related slots - void connectUserSlots(); // Function to connect user slots - void connectKeyboardSlots(); - void connectComponentSlots(); - - void startInstall(); // Function which begins the install process - void installFailed(); // Function which does post-install failure stuff - - void refreshComponents(); // Function which re-draws components list widgets - - // Functions which return parts of the config file + // Methods which return parts of the config file QStringList getGlobalCfgSettings(QStringList &summaryList); QStringList getDiskCfgSettings(QStringList &summaryList); - QStringList getComponentCfgSettings(QStringList &summaryList); QStringList getUsersCfgSettings(QStringList &summaryList); QStringList getDeskPkgCfg(QStringList &summaryList); - void startConfigGen(); // Function which takes pieces of cfg, and assembles + void startConfigGen(); // Method which takes pieces of cfg, and assembles void proceed(bool); bool isInstalled(); bool checkDiskRequirements(); - void initDesktopPkgs(); bool allChildrenPkgsChecked(QString parent); bool allChildrenPkgsUnchecked(QString parent); void checkAllChildrenPkgs(QString parent); void uncheckAllChildrenPkgs(QString parent); - bool haveMetaDesktopChecked(); - QStackedWidget *stackWidget; - dialogFileSystem *dfs; dialogSelectNetServer *dsn; - // Encryption bits - QString autoEncPass; - void warnEncryption(); - QList steps; QList