-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added displaying the list of servers [#3]
- Loading branch information
Showing
6 changed files
with
127 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
<Application | ||
x:Class="prestige.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:prestige"> | ||
<Application x:Class="prestige.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:prestige"> | ||
|
||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,47 @@ | ||
<Page | ||
x:Class="prestige.MainPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:prestige" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
<Page x:Class="prestige.MainPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:prestige" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
|
||
<Grid> | ||
|
||
<ListView ItemsSource="{x:Bind ServerEntries}" | ||
HorizontalAlignment="Stretch" | ||
VerticalAlignment="Stretch"> | ||
<ListView.ItemTemplate> | ||
<DataTemplate x:DataType="local:OPDSServerEntry"> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="*" /> | ||
<RowDefinition Height="*" /> | ||
<RowDefinition Height="*" /> | ||
<RowDefinition Height="*" /> | ||
</Grid.RowDefinitions> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*" /> | ||
</Grid.ColumnDefinitions> | ||
<TextBlock Grid.Column="0" | ||
Grid.Row="0" | ||
Text="{x:Bind Name}" | ||
Style="{ThemeResource SubtitleTextBlockStyle}" /> | ||
<TextBlock Grid.Column="0" | ||
Grid.Row="1" | ||
Text="{x:Bind Url}" | ||
Style="{ThemeResource BodyTextBlockStyle}" /> | ||
<TextBlock Grid.Column="0" | ||
Grid.Row="2" | ||
Text="{x:Bind Username}" | ||
Style="{ThemeResource BodyTextBlockStyle}" /> | ||
<TextBlock Grid.Column="0" | ||
Grid.Row="3" | ||
Text="{x:Bind DisplayableLastAccessedOn}" | ||
Style="{ThemeResource BodyTextBlockStyle}" /> | ||
</Grid> | ||
</DataTemplate> | ||
</ListView.ItemTemplate> | ||
</ListView> | ||
</Grid> | ||
</Page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Prestige - A digital comic book reader application. | ||
* Copyright (C) 2023, The ComiXed Project | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses> | ||
*/ | ||
|
||
using System; | ||
using System.Globalization; | ||
|
||
namespace prestige | ||
{ | ||
public class OPDSServerEntry | ||
{ | ||
public OPDSServerEntry(string name, string url, string username, string password) | ||
{ | ||
this.Name = name; | ||
this.Url = url; | ||
this.Username = username; | ||
this.Password = password; | ||
this.LastAccessedOn = DateTime.Now; | ||
} | ||
|
||
public string Name { get; set; } | ||
|
||
public string Url { get; set; } | ||
|
||
public string Username { get; set; } | ||
|
||
public string Password { get; set; } | ||
|
||
public DateTime CreatedOn { get; set; } | ||
|
||
public Nullable<DateTime> LastAccessedOn { get; set; } | ||
|
||
public string DisplayableLastAccessedOn | ||
{ | ||
get | ||
{ | ||
if (this.LastAccessedOn.HasValue) | ||
{ | ||
return this.LastAccessedOn.Value.ToString("G", CultureInfo.CurrentCulture.DateTimeFormat); | ||
} | ||
else | ||
{ | ||
return "Never"; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters