Skip to content

Commit

Permalink
Merge branch 'orion_keyboard_1' into dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	lib/files/files_screen.dart
#	lib/home/home_screen.dart
#	lib/main.dart
#	lib/settings/debug_screen.dart
#	lib/settings/settings_screen.dart
#	macos/Podfile.lock
#	macos/Runner.xcodeproj/project.pbxproj
#	macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
#	pubspec.lock
#	pubspec.yaml
  • Loading branch information
shifubrams committed Apr 1, 2024
2 parents 3d195a0 + aa6ac7f commit c2324d7
Show file tree
Hide file tree
Showing 25 changed files with 1,458 additions and 213 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Build Orion

on:
push:
workflow_call:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: subosito/flutter-action@v2
with:
channel: 'stable' # or: 'beta', 'dev', 'master' (or 'main')
- run: sudo apt-get update && sudo apt-get install -y gtk+-3.0
- run: flutter pub global activate flutterpi_tool
- run: flutter build linux

- name: Get Version
id: get_version
uses: mikefarah/yq@master
with:
cmd: yq '.version' pubspec.yaml

- name: Build, Copy, and Compress armv7
run: |
flutterpi_tool build --release
mv build/flutter_assets orion_armv7
tar -czvf orion_armv7.tar.gz orion_armv7
- uses: actions/upload-artifact@v4.3.1
with:
name: orion_armv7
path: orion_armv7/*

- name: Build, Copy, and Compress aarch64
run: |
flutterpi_tool build --arch=arm64 --release
mv build/flutter_assets orion_aarch64
tar -czvf orion_aarch64.tar.gz orion_aarch64
- uses: actions/upload-artifact@v4.3.1
with:
name: orion_aarch64
path: orion_aarch64/*

- name: Build, Copy, and Compress x64
run: |
flutterpi_tool build --arch=x64 --release
mv build/flutter_assets orion_x64
tar -czvf orion_x64.tar.gz orion_x64
- uses: actions/upload-artifact@v4.3.1
with:
name: orion_x64
path: orion_x64/*

- uses: ncipollo/release-action@v1.14.0
if: github.ref == 'refs/heads/main'
with:
artifacts: orion*.tar.gz
tag: v${{ steps.get_version.outputs.result }}
skipIfReleaseExists: true
generateReleaseNotes: true
commit: ${{github.sha}}
- uses: ncipollo/release-action@v1.14.0
if: github.ref != 'refs/heads/main'
with:
artifacts: orion*.tar.gz
tag: BRANCH_${{github.ref_name}}
skipIfReleaseExists: false
allowUpdates: true
prerelease: true
generateReleaseNotes: true
commit: ${{github.sha}}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release
/android/key.properties

.VSCodeCounter
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"cmake.configureOnOpen": false
"cmake.configureOnOpen": false,
"editor.bracketPairColorization.independentColorPoolPerBracketType": false
}
21 changes: 16 additions & 5 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
Expand All @@ -44,20 +50,25 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.orion"
applicationId "com.contrapposto.orion"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
signingConfig signingConfigs.release
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions assets/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false
2 changes: 2 additions & 0 deletions devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
extensions:
- provider: true
1 change: 1 addition & 0 deletions lib/files/details_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ class _DetailScreenState extends State<DetailScreen> {
.width; // 200 placeholder, change to your image width.
setState(() {
leftPadding = (screenWidth - maxWidth - 200) / 3;
if (leftPadding < 0) leftPadding = 0;
rightPadding = leftPadding;
});
});
Expand Down
55 changes: 20 additions & 35 deletions lib/files/files_screen.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:async';
import 'dart:io';
import 'details_screen.dart';
import 'package:orion/files/search_file_screen.dart';
// ignore: depend_on_referenced_packages
import 'package:path/path.dart' as path;
import 'package:flutter/material.dart';
Expand All @@ -13,44 +14,14 @@ Directory getInitialDir(platform) {
case TargetPlatform.macOS:
return Directory('/Users/${Platform.environment['USER']}/Documents');
case TargetPlatform.linux:
return Directory('/home/${Platform.environment['USER']}/printableFiles<');
return Directory(
'/home/${Platform.environment['USER']}/printer_data/gcodes');
case TargetPlatform.windows:
return Directory(
'%userprofile%'); // WARN Not sure if that works for windows developers. To be tested
default:
return Directory('/');
}
}

void checkFullDiskAccess(BuildContext context) {
final documentsDir = getInitialDir(Theme.of(context).platform);
try {
documentsDir.listSync();
} catch (e) {
if (e is FileSystemException) {
final executablePath = Platform.resolvedExecutable;
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Full Disk Access Required'),
content: Text(
'This app requires full disk access. Please open System Preferences, '
'navigate to Security & Privacy > Privacy > Full Disk Access, '
'and check the box for this app. The app is located at: $executablePath',
),
actions: <Widget>[
TextButton(
child: const Text('OK'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
},
);
}
return Directory(
'/home/${Platform.environment['USER']}/printer_data/gcodes');
}
}

Expand All @@ -74,7 +45,6 @@ class _FilesScreenState extends State<FilesScreen> {
_files = [];
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
checkFullDiskAccess(context);
_getFiles();

Future.delayed(const Duration(seconds: 0), () {
Expand Down Expand Up @@ -202,6 +172,21 @@ class _FilesScreenState extends State<FilesScreen> {
: _directory.path,
),
actions: <Widget>[
Padding(
padding: const EdgeInsets.only(right: 5.0),
child: IconButton(
icon: const Icon(Icons.search),
iconSize: 30,
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SearchFileScreen(),
),
);
},
),
),
Padding(
padding: const EdgeInsets.only(right: 5.0),
child: IconButton(
Expand Down
Loading

0 comments on commit c2324d7

Please sign in to comment.