Subversion Repositories spk

Rev

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

Rev 224 Rev 226
Line 77... Line 77...
77
		}
77
		}
78
	}
78
	}
79
 
79
 
80
	void MainGui::AboutDialog()
80
	void MainGui::AboutDialog()
81
	{
81
	{
82
		CBaseFile *pm = m_pPackages->findScriptByAuthor("PluginManager");
82
		CBaseFile *pm = m_pPackages->findScriptByAuthor(L"PluginManager");
83
		System::String ^scriptVer = "None";
83
		System::String ^scriptVer = "None";
84
		if (pm)
84
		if (pm)
85
		{
85
		{
86
			scriptVer = _US(pm->version());
86
			scriptVer = _US(pm->version());
87
			if (!pm->creationDate().empty())
87
			if (!pm->creationDate().empty())
Line 168... Line 168...
168
						found = true;
168
						found = true;
169
				}
169
				}
170
 
170
 
171
				if ( found ) {
171
				if ( found ) {
172
					if ( !m_pPackages->IsSupressProtectedWarning() ) {
172
					if ( !m_pPackages->IsSupressProtectedWarning() ) {
173
						if ( MessageBox::Show(this, "WARNING: The game directory:\n" + _US(dir) + "\n\nIs in a protected directory (" + _US(CFileIO(dir).dir().tokens(L"/", 1, 2).findReplace("/", "\\")) + ")\n\nThis might cause problems with installing anything, its better to move to game elsewhere, or you may need to run the Plugin Manager with admin access rights\n\nWould you like to surpress this warning in the future?", "Protected Directory", MessageBoxButtons::YesNo, MessageBoxIcon::Warning) == Windows::Forms::DialogResult::Yes ) {
173
						if ( MessageBox::Show(this, "WARNING: The game directory:\n" + _US(dir) + "\n\nIs in a protected directory (" + _US(CFileIO(dir).dir().tokens(L"/", 1, 2).findReplace(L"/", L"\\")) + ")\n\nThis might cause problems with installing anything, its better to move to game elsewhere, or you may need to run the Plugin Manager with admin access rights\n\nWould you like to surpress this warning in the future?", "Protected Directory", MessageBoxButtons::YesNo, MessageBoxIcon::Warning) == Windows::Forms::DialogResult::Yes ) {
174
							m_pPackages->SurpressProtectedWarning();
174
							m_pPackages->SurpressProtectedWarning();
175
						}
175
						}
176
					}
176
					}
177
				}
177
				}
178
			}
178
			}
Line 192... Line 192...
192
			for(auto itr = m_pDirList->begin(); itr != m_pDirList->end(); itr++)
192
			for(auto itr = m_pDirList->begin(); itr != m_pDirList->end(); itr++)
193
			{
193
			{
194
				if (CDirIO((*itr)->str).exists())
194
				if (CDirIO((*itr)->str).exists())
195
				{
195
				{
196
					System::String ^str;
196
					System::String ^str;
197
					if ((*itr)->data.isin("|"))
197
					if ((*itr)->data.contains(L"|"))
198
						str = _US((*itr)->str + L" [" + (*itr)->data.tokens(L"|", 2) + L"] (Language: " + CPackages::ConvertLanguage((*itr)->data.token(L"|", 1).toInt())  + L")");
198
						str = _US((*itr)->str + L" [" + (*itr)->data.tokens(L"|", 2) + L"] (Language: " + CPackages::ConvertLanguage((*itr)->data.token(L"|", 1).toInt())  + L")");
199
					else
199
					else
200
						str = _US((*itr)->str + L" [" + (*itr)->data + L"]");
200
						str = _US((*itr)->str + L" [" + (*itr)->data + L"]");
201
					ComboDir->Items->Add(str);
201
					ComboDir->Items->Add(str);
202
 
202
 
Line 266... Line 266...
266
	{
266
	{
267
		CLinkList<CBaseFile> packageList;
267
		CLinkList<CBaseFile> packageList;
268
 
268
 
269
		for ( CBaseFile *p = m_pPackages->FirstPackage(); p; p = m_pPackages->NextPackage() )
269
		for ( CBaseFile *p = m_pPackages->FirstPackage(); p; p = m_pPackages->NextPackage() )
270
		{
270
		{
271
			if ( p->author().Compare("PluginManager") )
271
			if ( p->author().Compare(L"PluginManager") )
272
				continue;
272
				continue;
273
			// if thier parent is a library dont add unless top level
273
			// if thier parent is a library dont add unless top level
274
			if ( currentParent && p->GetParent() && p->GetParent()->GetType() == TYPE_SPK && ((CSpkFile *)p->GetParent())->IsLibrary() )
274
			if ( currentParent && p->GetParent() && p->GetParent()->GetType() == TYPE_SPK && ((CSpkFile *)p->GetParent())->IsLibrary() )
275
				continue;
275
				continue;
276
			else if ( p->GetParent() == currentParent )
276
			else if ( p->GetParent() == currentParent )
Line 837... Line 837...
837
						CBaseFile *p = node->Data();
837
						CBaseFile *p = node->Data();
838
						Utils::WString packageName = p->getFullPackageName(m_pPackages->GetLanguage());
838
						Utils::WString packageName = p->getFullPackageName(m_pPackages->GetLanguage());
839
						Utils::WString afterText = m_pPackages->getInstallAfterText(p);
839
						Utils::WString afterText = m_pPackages->getInstallAfterText(p);
840
 
840
 
841
						if (afterText.empty())
841
						if (afterText.empty())
842
							afterText = "Installed";
842
							afterText = L"Installed";
843
						m_pPi->AddPackage(_US(packageName), _US(p->author()), _US(p->version()), _US(afterText));
843
						m_pPi->AddPackage(_US(packageName), _US(p->author()), _US(p->version()), _US(afterText));
844
					}
844
					}
845
					for ( CListNode<CBaseFile> *node = erroredPackages.Front(); node; node = node->next() )
845
					for ( CListNode<CBaseFile> *node = erroredPackages.Front(); node; node = node->next() )
846
					{
846
					{
847
						CBaseFile *p = node->Data();
847
						CBaseFile *p = node->Data();
Line 1260... Line 1260...
1260
				{
1260
				{
1261
					if ( p->IsEnabled() )
1261
					if ( p->IsEnabled() )
1262
						ButDisable->Text = "Disable";
1262
						ButDisable->Text = "Disable";
1263
					else
1263
					else
1264
						ButDisable->Text = "Enable";
1264
						ButDisable->Text = "Enable";
1265
					if ( !p->description().empty() )	TextDesc->Text = _US(p->description().findReplace("<br>", "\n").stripHtml());
1265
					if ( !p->description().empty() )	TextDesc->Text = _US(p->description().findReplace(L"<br>", L"\n").stripHtml());
1266
 
1266
 
1267
					this->PictureDisplay->Show();
1267
					this->PictureDisplay->Show();
1268
					bool addedIcon = false;
1268
					bool addedIcon = false;
1269
					C_File *picFile = p->GetFirstFile(FILETYPE_ADVERT);
1269
					C_File *picFile = p->GetFirstFile(FILETYPE_ADVERT);
1270
					if ( picFile )
1270
					if ( picFile )
Line 2058... Line 2058...
2058
 
2058
 
2059
						if ( downloadFile.empty() )
2059
						if ( downloadFile.empty() )
2060
							downloadFile = d;
2060
							downloadFile = d;
2061
						else
2061
						else
2062
						{
2062
						{
2063
							downloadFile += "|";
2063
							downloadFile += L"|";
2064
							downloadFile += d;
2064
							downloadFile += d;
2065
						}
2065
						}
2066
					}
2066
					}
2067
 
2067
 
2068
					if ( !downloadFile.empty() )
2068
					if ( !downloadFile.empty() )
Line 2113... Line 2113...
2113
						l = l.remove('\r');
2113
						l = l.remove('\r');
2114
						Utils::WString first = l.token(L":", 1);
2114
						Utils::WString first = l.token(L":", 1);
2115
						Utils::WString rest = l.tokens(L":", 2);
2115
						Utils::WString rest = l.tokens(L":", 2);
2116
						rest.removeFirstSpace();
2116
						rest.removeFirstSpace();
2117
 
2117
 
2118
						if ( first.Compare("File") )
2118
						if ( first.Compare(L"File") )
2119
						{
2119
						{
2120
							if ( m_bDirLocked ) {
2120
							if ( m_bDirLocked ) {
2121
								this->DisplayLocked(false);
2121
								this->DisplayLocked(false);
2122
								return;
2122
								return;
2123
							}
2123
							}
Line 2329... Line 2329...
2329
				if (p->countFiles(FILETYPE_EXTRA))
2329
				if (p->countFiles(FILETYPE_EXTRA))
2330
				{
2330
				{
2331
					showSep = true;
2331
					showSep = true;
2332
					for ( C_File *f = p->GetFirstFile(FILETYPE_EXTRA); f; f = p->GetNextFile(f) )
2332
					for ( C_File *f = p->GetFirstFile(FILETYPE_EXTRA); f; f = p->GetNextFile(f) )
2333
					{
2333
					{
2334
						if ( !f->dir().left(6).Compare("extras") )
2334
						if ( !f->dir().left(6).Compare(L"extras") )
2335
							continue;
2335
							continue;
2336
 
2336
 
2337
						Windows::Forms::ToolStripMenuItem ^item = gcnew Windows::Forms::ToolStripMenuItem();
2337
						Windows::Forms::ToolStripMenuItem ^item = gcnew Windows::Forms::ToolStripMenuItem();
2338
						item->Text = _US(f->filename());
2338
						item->Text = _US(f->filename());
2339
						if ( this->imageList2->Images->IndexOfKey(_US(f->fileExt().lower())) > -1 )
2339
						if ( this->imageList2->Images->IndexOfKey(_US(f->fileExt().lower())) > -1 )
Line 2379... Line 2379...
2379
					Utils::WString web = p->forumLink();
2379
					Utils::WString web = p->forumLink();
2380
					if ( web.isNumber() )
2380
					if ( web.isNumber() )
2381
						web = Utils::WString(L"http://forum.egosoft.com/viewtopic.php?t=") + web; 
2381
						web = Utils::WString(L"http://forum.egosoft.com/viewtopic.php?t=") + web; 
2382
 
2382
 
2383
					this->visitForumPageToolStripMenuItem->Visible = true;
2383
					this->visitForumPageToolStripMenuItem->Visible = true;
2384
					if ( !web.isin("http://") )
2384
					if ( !web.isin(L"http://") )
2385
						this->visitForumPageToolStripMenuItem->Tag = "http://" + _US(web);
2385
						this->visitForumPageToolStripMenuItem->Tag = "http://" + _US(web);
2386
					else
2386
					else
2387
						this->visitForumPageToolStripMenuItem->Tag = _US(web);
2387
						this->visitForumPageToolStripMenuItem->Tag = _US(web);
2388
					showSep2 = true;
2388
					showSep2 = true;
2389
				}
2389
				}
2390
				if ( !p->email().empty() )
2390
				if ( !p->email().empty() )
2391
				{
2391
				{
2392
					this->emailAuthorToolStripMenuItem->Visible = true;
2392
					this->emailAuthorToolStripMenuItem->Visible = true;
2393
					this->emailAuthorToolStripMenuItem->Tag = "mailto://" + _US(p->email()) + "?subject=Re: " + _US(p->name().findReplace(" ", "%20"));
2393
					this->emailAuthorToolStripMenuItem->Tag = "mailto://" + _US(p->email()) + "?subject=Re: " + _US(p->name().findReplace(L" ", L"%20"));
2394
					showSep2 = true;
2394
					showSep2 = true;
2395
				}
2395
				}
2396
				if ( !p->webSite().empty() ) {
2396
				if ( !p->webSite().empty() ) {
2397
					this->visitWebSiteToolStripMenuItem->Visible = true;
2397
					this->visitWebSiteToolStripMenuItem->Visible = true;
2398
					if ( !p->webSite().isin("http://") ) 
2398
					if ( !p->webSite().isin(L"http://") ) 
2399
						this->visitWebSiteToolStripMenuItem->Tag = "http://" + _US(p->webSite());
2399
						this->visitWebSiteToolStripMenuItem->Tag = "http://" + _US(p->webSite());
2400
					else	
2400
					else	
2401
						this->visitWebSiteToolStripMenuItem->Tag = _US(p->webSite());
2401
						this->visitWebSiteToolStripMenuItem->Tag = _US(p->webSite());
2402
					showSep2 = true;
2402
					showSep2 = true;
2403
				}
2403
				}