Subversion Repositories spk

Rev

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

Rev 121 Rev 124
Line 54... Line 54...
54
		void UpdateFileList()
54
		void UpdateFileList()
55
		{
55
		{
56
			Windows::Forms::Cursor::Current = Windows::Forms::Cursors::WaitCursor;
56
			Windows::Forms::Cursor::Current = Windows::Forms::Cursors::WaitCursor;
57
			this->treeView1->BeginUpdate();
57
			this->treeView1->BeginUpdate();
58
			this->treeView1->Nodes->Clear();
58
			this->treeView1->Nodes->Clear();
-
 
59
			Utils::CStringList list;
59
			CyStringList *list = m_pPackages->GetMergedFiles(m_pFile1, m_pFile2);
60
			m_pPackages->getMergedFiles(list, m_pFile1, m_pFile2);
60
			if ( list )
61
			if (!list.empty())
61
			{
62
			{
62
				TreeNode ^merged = gcnew TreeNode("Files to Merge");
63
				TreeNode ^merged = gcnew TreeNode("Files to Merge");
63
				TreeNode ^conflict = gcnew TreeNode("Potential Conflicts");
64
				TreeNode ^conflict = gcnew TreeNode("Potential Conflicts");
64
				TreeNode ^both = gcnew TreeNode("Files in Both (using primarys)");
65
				TreeNode ^both = gcnew TreeNode("Files in Both (using primarys)");
65
				TreeNode ^node1 = gcnew TreeNode("From: " + this->textBox1->Text);
66
				TreeNode ^node1 = gcnew TreeNode("From: " + this->textBox1->Text);
Line 71... Line 72...
71
				this->treeView1->Nodes->Add(node2);
72
				this->treeView1->Nodes->Add(node2);
72
 
73
 
73
				merged->ForeColor = Color::Green;
74
				merged->ForeColor = Color::Green;
74
				conflict->ForeColor = Color::Red;
75
				conflict->ForeColor = Color::Red;
75
 
76
 
76
				for ( SStringList *str = list->Head(); str; str = str->;next )
77
				for(auto itr = list.begin(); itr != list.end(); itr++)
77
				{
78
				{
78
					TreeNode ^newNode = gcnew TreeNode(SystemStringFromCyString(str->str));
79
					TreeNode ^newNode = gcnew TreeNode(_US((*itr)->str));
79
 
80
 
80
					int status = str->data.ToInt();
81
					int status = (*itr)->data.toInt();
81
					if ( status == -1 ) // in both
82
					if ( status == -1 ) // in both
82
					{
83
					{
83
						if ( m_pPackages->CanWeMerge(str->str.ToString()) )
84
						if ( m_pPackages->CanWeMerge((*itr)->str) )
84
							merged->Nodes->Add(newNode);
85
							merged->Nodes->Add(newNode);
85
						else if ( m_pPackages->NeedToMerge(str->str) )
86
						else if ( m_pPackages->NeedToMerge((*itr)->str) )
86
							conflict->Nodes->Add(newNode);
87
							conflict->Nodes->Add(newNode);
87
						else
88
						else
88
							both->Nodes->Add(newNode);
89
							both->Nodes->Add(newNode);
89
					}
90
					}
90
					else if ( status == 1 )
91
					else if ( status == 1 )
Line 100... Line 101...
100
				conflict->Text = "[" + conflict->Nodes->Count + "] " + conflict->Text;
101
				conflict->Text = "[" + conflict->Nodes->Count + "] " + conflict->Text;
101
 
102
 
102
				this->treeView1->ExpandAll();
103
				this->treeView1->ExpandAll();
103
				this->button4->Enabled = true;
104
				this->button4->Enabled = true;
104
			}
105
			}
105
 
-
 
106
			delete list;
-
 
107
 
106
 
108
			Windows::Forms::Cursor::Current = Cursors::Default;
107
			Windows::Forms::Cursor::Current = Cursors::Default;
109
			this->treeView1->EndUpdate();
108
			this->treeView1->EndUpdate();
110
		}
109
		}
111
 
110