Skip to content

Commit

Permalink
Fix the bug mentioned in #11
Browse files Browse the repository at this point in the history
  • Loading branch information
mrquantumoff committed Sep 30, 2023
1 parent bd1714b commit 01be7ff
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 66 deletions.
62 changes: 31 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,34 +74,34 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
GNULinuxBuild.tar.gz
release-macos:
strategy:
fail-fast: false
matrix:
platform: [macos-latest]
runs-on: ${{matrix.platform}}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Generate locales
run: flutter gen-l10n
- name: Build on macOS
if: matrix.platform == 'macos-latest'
run: |
flutter pub get
flutter build macos --release --split-debug-info --obfuscate --dart-define QUADRANT_QNT_API_KEY='${{secrets.QUADRANT_QNT_API_KEY}}' --dart-define ETERNAL_API_KEY='${{ secrets.ETERNAL_API_KEY }}'
tar -czvf macOSBuild.tar.gz build/macos/Build/Products/Release/Quadrant.app
# For future use
# pkgbuild --install-location /Applications --component "./build/macos/Build/Products/Release/Minecraft Modpack Manager Reborn.app" ./mcmodpackmanagerMacOS.pkg --identifier dev.mrquantumoff.mcmodpackmanager
- name: Upload the macOS build
if: matrix.platform == 'macos-latest'
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
macOSBuild.tar.gz
LICENSE
# release-macos:
# strategy:
# fail-fast: false
# matrix:
# platform: [macos-latest]
# runs-on: ${{matrix.platform}}
# steps:
# - name: Checkout repository
# uses: actions/checkout@v2
# - name: Install flutter
# uses: subosito/flutter-action@v2
# with:
# channel: "stable"
# - name: Generate locales
# run: flutter gen-l10n
# # - name: Build on macOS
# # if: matrix.platform == 'macos-latest'
# # run: |
# # flutter pub get
# # flutter build macos --release --split-debug-info --obfuscate --dart-define QUADRANT_QNT_API_KEY='${{secrets.QUADRANT_QNT_API_KEY}}' --dart-define ETERNAL_API_KEY='${{ secrets.ETERNAL_API_KEY }}'
# # tar -czvf macOSBuild.tar.gz build/macos/Build/Products/Release/Quadrant.app
# # # For future use
# # # pkgbuild --install-location /Applications --component "./build/macos/Build/Products/Release/Minecraft Modpack Manager Reborn.app" ./mcmodpackmanagerMacOS.pkg --identifier dev.mrquantumoff.mcmodpackmanager
# # - name: Upload the macOS build
# # if: matrix.platform == 'macos-latest'
# # uses: softprops/action-gh-release@v1
# # with:
# # token: ${{ secrets.GITHUB_TOKEN }}
# # files: |
# # macOSBuild.tar.gz
# # LICENSE
7 changes: 7 additions & 0 deletions dev.mrquantumoff.mcmodpackmanager.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@
</keywords>
<releases>

<release date="2023-09-30" version="23.10.0">
<description>
<p>Bug fixes</p>
<p>Dependency updates</p>
</description>
</release>

<release date="2023-09-16" version="23.09.0">
<description>
<p>Starting with the 23.09 release of Quadrant, the project now uses a new versioning system, YY.MM.REVISION</p>
Expand Down
48 changes: 33 additions & 15 deletions lib/pages/modpack_creator/modpack_creator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,10 @@ class _ModpackCreatorState extends State<ModpackCreator> {
});
}

List<DropdownMenuEntry> versionItems = [];
List<String> versions = [];

bool hasGetVersionsBeenRun = false;

void getVersions() async {
if (hasGetVersionsBeenRun) return;
Future<List<DropdownMenuEntry>> getVersions() async {
List<DropdownMenuEntry> items = [];
Uri uri = Uri.parse(
'https://api.modrinth.com/v2/tag/game_version',
);
Expand All @@ -61,18 +58,19 @@ class _ModpackCreatorState extends State<ModpackCreator> {
},
))
.body);
List<String> versions = [];
for (var v in vrs) {
if (v["version_type"] == "release") {
versions.add(v["version"].toString());
}
}

for (var version in versions) {
versionItems.add(
items.add(
DropdownMenuEntry(label: version.toString(), value: version),
);
}
hasGetVersionsBeenRun = true;
return items;
}

@override
Expand Down Expand Up @@ -106,14 +104,34 @@ class _ModpackCreatorState extends State<ModpackCreator> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
margin: const EdgeInsets.symmetric(vertical: 12),
child: DropdownMenu(
dropdownMenuEntries: versionItems,
controller: versionFieldController,
label: Text(AppLocalizations.of(context)!.chooseVersion),
width: 640,
),
),
margin: const EdgeInsets.symmetric(vertical: 12),
child: FutureBuilder(
future: getVersions(),
builder: ((BuildContext context, snapshot) {
if (snapshot.hasError) {
return DropdownMenu(
dropdownMenuEntries: const [],
enabled: false,
errorText: AppLocalizations.of(context)!.downloadFail,
label:
Text(AppLocalizations.of(context)!.downloadFail),
width: 640,
);
} else if (!snapshot.hasData) {
return const SizedBox(
width: 640,
child: LinearProgressIndicator(),
);
}
return DropdownMenu(
dropdownMenuEntries: snapshot.data!,
controller: versionFieldController,
label:
Text(AppLocalizations.of(context)!.chooseVersion),
width: 640,
menuHeight: 240,
);
}))),
Container(
margin: const EdgeInsets.symmetric(vertical: 12),
child: DropdownMenu(
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/web/generate_user_agent.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import 'package:package_info_plus/package_info_plus.dart';

Future<String> generateUserAgent() async {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
return "mrquantumoff/mcmodpackmanager_reborn/v${packageInfo.version} (mrquantumoff.dev)";
return "mrquantumoff/quadrant/v${packageInfo.version} (mrquantumoff.dev)";
}
2 changes: 1 addition & 1 deletion linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(runner LANGUAGES CXX)

# The name of the executable created for the application. Change this to change
# the on-disk name of your application.
set(BINARY_NAME "mcmodpackmanager_reborn")
set(BINARY_NAME "quadrant")
# The unique GTK application identifier for this application. See:
# https://wiki.gnome.org/HowDoI/ChooseApplicationID
set(APPLICATION_ID "dev.mcmodpackmanager.mcmodpackmanager_reborn")
Expand Down
2 changes: 1 addition & 1 deletion macos/Runner/Configs/AppInfo.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// 'flutter create' template.

// The application's name. By default this is also the title of the Flutter window.
PRODUCT_NAME = Quadrant
PRODUCT_NAME = quadrant

// The application's bundle identifier
PRODUCT_BUNDLE_IDENTIFIER = dev.mrquantumoff.mcmodpackmanager_reborn
Expand Down
20 changes: 10 additions & 10 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ packages:
dependency: "direct main"
description:
name: archive
sha256: e0902a06f0e00414e4e3438a084580161279f137aeb862274710f29ec10cf01e
sha256: d4dc11707abb32ef756ab95678c0d6df54003d98277f7c9aeda14c48e7a38c2f
url: "https://pub.dev"
source: hosted
version: "3.3.9"
version: "3.4.3"
args:
dependency: transitive
description:
Expand Down Expand Up @@ -298,10 +298,10 @@ packages:
dependency: transitive
description:
name: image
sha256: a72242c9a0ffb65d03de1b7113bc4e189686fc07c7147b8b41811d0dd0e0d9bf
sha256: "028f61960d56f26414eb616b48b04eb37d700cbe477b7fb09bf1d7ce57fd9271"
url: "https://pub.dev"
source: hosted
version: "4.0.17"
version: "4.1.3"
intl:
dependency: "direct main"
description:
Expand Down Expand Up @@ -362,10 +362,10 @@ packages:
dependency: "direct dev"
description:
name: msix
sha256: "114d2f280b2b985f0cc11db982cdc648a1311a80340908a1a1130f42411088cd"
sha256: "6e76e2491d5c809d784ce2b68e6c3426097fb5c68e61fe121c8c3341ab89bf46"
url: "https://pub.dev"
source: hosted
version: "3.16.2"
version: "3.16.4"
package_config:
dependency: transitive
description:
Expand Down Expand Up @@ -687,18 +687,18 @@ packages:
dependency: "direct overridden"
description:
name: win32
sha256: "9e82a402b7f3d518fb9c02d0e9ae45952df31b9bf34d77baf19da2de03fc2aaa"
sha256: "350a11abd2d1d97e0cc7a28a81b781c08002aa2864d9e3f192ca0ffa18b06ed3"
url: "https://pub.dev"
source: hosted
version: "5.0.7"
version: "5.0.9"
win32_registry:
dependency: transitive
description:
name: win32_registry
sha256: e4506d60b7244251bc59df15656a3093501c37fb5af02105a944d73eb95be4c9
sha256: "41fd8a189940d8696b1b810efb9abcf60827b6cbfab90b0c43e8439e3a39d85a"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
version: "1.1.2"
window_manager:
dependency: "direct main"
description:
Expand Down
8 changes: 4 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: quadrant
description: Manage your modpacks with ease!
publish_to: 'none'

version: 23.09.0+0
version: 23.10.0+0

environment:
sdk: '>=3.0.0 <4.0.0'
Expand All @@ -28,7 +28,7 @@ dependencies:
file_picker: ^5.5.0
http: ^1.1.0
path_provider: ^2.1.1
archive: ^3.3.9
archive: ^3.4.3
flutter_platform_alert: ^0.4.0
url_launcher: ^6.1.14
flutter_svg: ^2.0.7
Expand All @@ -44,7 +44,7 @@ dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.3
msix: ^3.16.1
msix: ^3.16.4
flutter_launcher_icons: ^0.13.1
flutter:
generate: true
Expand All @@ -69,7 +69,7 @@ msix_config:
publisher_display_name: MrQuantumOFF (Demir Yerli)
publisher: CN=010914FC-8843-4963-A3FE-E3E06E6D9F53
identity_name: 58734MrQuantumOFFDemirYer.MinecraftModpackManagerR
msix_version: 23.9.0.0
msix_version: 23.10.0.0
logo_path: .\assets\icons\logo.ico
store: true
protocol-activation: curseforge, mcmodpackmanager
Expand Down
4 changes: 2 additions & 2 deletions windows/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Project-level configuration.
cmake_minimum_required(VERSION 3.14)
project(mcmodpackmanager_reborn LANGUAGES CXX)
project(quadrant LANGUAGES CXX)

# The name of the executable created for the application. Change this to change
# the on-disk name of your application.
set(BINARY_NAME "mcmodpackmanager_reborn")
set(BINARY_NAME "quadrant")

# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake.
Expand Down
2 changes: 1 addition & 1 deletion windows/runner/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
FlutterWindow window(project);
Win32Window::Point origin(10, 10);
Win32Window::Size size(1280, 720);
if (!window.Create(L"Quadrant", origin, size))
if (!window.Create(L"quadrant", origin, size))
{
return EXIT_FAILURE;
}
Expand Down

0 comments on commit 01be7ff

Please sign in to comment.