Subversion Repositories spk

Rev

Rev 164 | Rev 170 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 164 Rev 168
Line 925... Line 925...
925
 
925
 
926
 
926
 
927
	bool MainGui::StartInstalling(bool builtin, bool background, bool archive)
927
	bool MainGui::StartInstalling(bool builtin, bool background, bool archive)
928
	{
928
	{
929
		// no packages to install
929
		// no packages to install
930
		if ( !m_pPackages->GetNumPackagesInQueue() )
930
		if (!m_pPackages->GetNumPackagesInQueue())
-
 
931
		{
-
 
932
			this->Enabled = true;
-
 
933
			this->ProgressBar->Hide();
931
			return false;
934
			return false;
-
 
935
		}
932
 
936
 
933
		// clear selected
937
		// clear selected
934
		this->ClearSelectedItems();
938
		this->ClearSelectedItems();
935
 
939
 
936
		// lets install them now
940
		// lets install them now
Line 945... Line 949...
945
 
949
 
946
				if (m_pPackages->findAllNeededDependacies(package, *m_lAvailablePackages, installRequired, false, true))
950
				if (m_pPackages->findAllNeededDependacies(package, *m_lAvailablePackages, installRequired, false, true))
947
				{
951
				{
948
					bool added = false;
952
					bool added = false;
949
					for (auto itr = installRequired->Front(); itr; itr = itr->next())
953
					for (auto itr = installRequired->Front(); itr; itr = itr->next())
950
					{
954
					{
951
						if (itr->Data() == package || (itr->Data()->name().Compare(package->name()) && itr->Data()->author().Compare(package->author())))
955
						if (itr->Data() == package || (itr->Data()->name().Compare(package->name()) && itr->Data()->author().Compare(package->author())))
952
						{
956
						{
953
							added = true;
957
							added = true;
954
							break;
958
							break;
955
						}
959
						}
Line 979... Line 983...
979
						else
983
						else
980
							requires += name + " by " + author;
984
							requires += name + " by " + author;
981
						requires += "\n";
985
						requires += "\n";
982
					}
986
					}
983
 
987
 
-
 
988
					std::vector<const SAvailablePackage*> downloads;
-
 
989
					if (m_pPackages->getDownloadableDependacies(package, downloads) >= missingList.size())
-
 
990
					{
-
 
991
						if (this->DisplayMessageBox(false, "Installing", "Missing Package for " + SystemStringFromCyString(package->GetLanguageName(m_pPackages->GetLanguage())) + "\nRequires:\n" + _US(requires) + "\n\nDo you want to download them?", MessageBoxButtons::YesNo, MessageBoxIcon::Question) == System::Windows::Forms::DialogResult::Yes)
-
 
992
						{
-
 
993
							CheckUpdate^ update = gcnew CheckUpdate(m_pPackages, this->imageList1);
-
 
994
							update->SetDownloader();
-
 
995
							if (downloads.size() == 1)
-
 
996
								update->OnePackage(downloads.front());
-
 
997
							else
-
 
998
							{
-
 
999
								for (auto itr = downloads.begin(); itr != downloads.end(); itr++)
-
 
1000
									update->AddPackage(*itr);
-
 
1001
							}
-
 
1002
							if (update->ShowDialog(this) == Windows::Forms::DialogResult::OK)
-
 
1003
							{
-
 
1004
								FindPackages();
-
 
1005
								for (CListNode<CBaseFile>* pNode = lCheckPackages.Front(); pNode; pNode = pNode->next())
-
 
1006
									m_pPackages->PrepareInstallPackage(pNode->Data(), false, false, IC_ALL);
-
 
1007
								return StartInstalling(builtin, background);
-
 
1008
							}
-
 
1009
						}
-
 
1010
					}
-
 
1011
					else
984
					this->DisplayMessageBox(false, "Installing", "Missing Package for " + SystemStringFromCyString(package->GetLanguageName(m_pPackages->GetLanguage())) + "\nRequires:\n" + _US(requires), MessageBoxButtons::OK, MessageBoxIcon::Exclamation);
1012
						this->DisplayMessageBox(false, "Installing", "Missing Package for " + SystemStringFromCyString(package->GetLanguageName(m_pPackages->GetLanguage())) + "\nRequires:\n" + _US(requires), MessageBoxButtons::OK, MessageBoxIcon::Exclamation);
985
				}
1013
				}
986
			}
1014
			}
987
 
1015
 
988
			bool restart = false;
1016
			bool restart = false;
989
			if (installRequired->size())
1017
			if (installRequired->size())