Skip to content

Commit

Permalink
add more code to handle folder name change/delete + say no rom when t…
Browse files Browse the repository at this point in the history
…rying to import from empty folder
  • Loading branch information
duchuule committed Jul 29, 2015
1 parent 1ff3670 commit ed6c911
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 9 deletions.
10 changes: 10 additions & 0 deletions Database/ROMDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,16 @@ task<void> ROMDatabase::LoadSnapshotImage()
//load bitmap image for snapshot
entry->Snapshot = ref new BitmapImage();
return entry->Snapshot->SetSourceAsync(stream);
}).then([tasks](task<void> t)
{
try
{
t.get();
}
catch (Exception^ e)
{
// We'll handle the specific errors below.
}
}));
}

Expand Down
4 changes: 2 additions & 2 deletions ExportPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
Margin="0,8,0,0"
/>
<TextBlock TextWrapping="Wrap"
Text="If for any reason you cannot access the rom folder or the rom is copied to the app's private storage, use this option to export save files to OneDrive."
Text="If for any reason you cannot access the rom folder, e.g., the rom is stored in the app's private storage, use this option to export save files to OneDrive."
Margin=" 0, 4, 0, 4" />

<TextBlock TextWrapping="Wrap"
Text="This option is only useful on Windows 10 Mobile, which is not released yet, so it will be added later."
Text="This feature will be added in a future release."
Margin=" 0, 4, 0, 4" />

</StackPanel>
Expand Down
6 changes: 3 additions & 3 deletions ImportPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
Margin="0,8,0,0"
/>
<TextBlock TextWrapping="Wrap"
Text="Use this option to import a file already present on your phone or PC. Note: due to a bug in Windows 10, you won't be able to see the content of the folder you are browsing."
Text="Use this option to import a file already present on your phone or PC. Note: due to a bug in Windows 10, you won't be able to see the content of the folder you are browsing. Just select the folder containing the rom and will be presented with a list of rom to import."
Margin=" 0, 4, 0, 4" />

<StackPanel Orientation="Horizontal">
Expand All @@ -63,11 +63,11 @@
Margin="0,8,0,0"
/>
<TextBlock TextWrapping="Wrap"
Text="Use this option to import rom through the OneDrive app. The rom will be copied to the app's private storage."
Text="Use this option to import rom through OneDrive. The rom will be copied to the app's private storage."
Margin=" 0, 4, 0, 4" />

<TextBlock TextWrapping="Wrap"
Text="This function is really only useful on Windows 10 Mobile, which is not released yet, so it will be added later."
Text="This function will be added in a future release. In the mean time, please store roms on your phone's SD Card or documents folder and use the Local Storage option."
Margin=" 0, 4, 0, 4" />

</StackPanel>
Expand Down
2 changes: 1 addition & 1 deletion ImportPage.xaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void ImportPage::chooseFolderbtn_Click(Platform::Object^ sender, Windows::UI::Xa
auto transform = ((UIElement^)titleBar)->TransformToVisual(nullptr);

Windows::Foundation::Point point = transform->TransformPoint(Windows::Foundation::Point());
statePopup->HorizontalOffset = point.X; //+ selectStateBtn->ActualWidth / 2.0f - pane->Width / 2.0f;
statePopup->HorizontalOffset = point.X + 1; //+ selectStateBtn->ActualWidth / 2.0f - pane->Width / 2.0f;
statePopup->VerticalOffset = point.Y + titleBar->ActualHeight;

statePopup->IsOpen = true;
Expand Down
5 changes: 5 additions & 0 deletions SelectFilePane.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
/>
</StackPanel>

<TextBlock x:Name="txtNoFile" Grid.Row="1"
Text="No supported file found!"
Foreground="Red"
Margin="8,8,0,8"/>

<ListBox Name="fileList"
Background="Transparent"
SelectionChanged="fileList_SelectionChanged"
Expand Down
13 changes: 12 additions & 1 deletion SelectFilePane.xaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,23 @@ SelectFilePane::SelectFilePane(IVectorView<StorageFile^>^ list):initdone(false)
InitializeComponent();
this->fileVector = ref new Vector<StorageFile^>();


for (int i = 0; i < list->Size; i++)
this->fileVector->Append(list->GetAt(i));

this->FileListvs->Source = this->fileVector;
this->fileList->SelectedItem = nullptr;

if (list->Size > 0)
{
this->fileList->Visibility = Windows::UI::Xaml::Visibility::Visible;
this->txtNoFile->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
}
else
{
this->fileList->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
this->txtNoFile->Visibility = Windows::UI::Xaml::Visibility::Visible;
}
initdone = true;
}

Expand Down
2 changes: 1 addition & 1 deletion SelectROMPane.xaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ void SelectROMPane::selectStateBtn_Click(Platform::Object^ sender, Windows::UI::
auto transform = ((UIElement^)topbar)->TransformToVisual(nullptr);

Windows::Foundation::Point point = transform->TransformPoint(Windows::Foundation::Point());
statePopup->HorizontalOffset = point.X; //+ selectStateBtn->ActualWidth / 2.0f - pane->Width / 2.0f;
statePopup->HorizontalOffset = point.X + 1; //+ selectStateBtn->ActualWidth / 2.0f - pane->Width / 2.0f;
statePopup->VerticalOffset = point.Y + selectStateBtn->ActualHeight;

//statePopup->Measure(Windows::Foundation::Size(Window::Current->Bounds.Width, Window::Current->Bounds.Height));
Expand Down
1 change: 0 additions & 1 deletion SelectStatePane.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Border BorderThickness="2,2,2,2" BorderBrush="{ThemeResource ListBoxBorderThemeBrush}">
<ListBox Name="savestateList"
Background="Transparent"
SelectionChanged="savestateList_SelectionChanged"
>
<ListBox.ItemTemplate>
Expand Down

0 comments on commit ed6c911

Please sign in to comment.