mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-09-14 19:32:10 +02:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
b58c8f65fe
|
|||
2c69289785
|
|||
dc0fc06673
|
|||
3114b489b6
|
|||
8e5934bd84
|
|||
a2129b957e
|
|||
61cd632df6
|
14
README.md
14
README.md
@@ -168,7 +168,13 @@ These are F# projects with automated tests.
|
||||
|
||||
# Development (Windows)
|
||||
|
||||
When developing with [Rider](https://www.jetbrains.com/rider/), it must be configured to use MSBuild from Visual Studio. You can set it in **File | Settings | Build, Execution, Deployment | Toolset and Build** with the `Use MSBuild version` drop-down.
|
||||
When developing with [Rider](https://www.jetbrains.com/rider/), it must be configured to use MSBuild from Visual Studio, and the `DevEnvDir` property must be set to the full path to the `Common7\IDE` folder which is inside Visual Studio's installation folder. You can set both in **File | Settings | Build, Execution, Deployment | Toolset and Build**:
|
||||
|
||||
1. Click the `MSBuild version` drop-down, and select the path that includes the Visual Studio installation folder.
|
||||
2. Click the Edit button next to `MSBuild global properties`.
|
||||
3. Add a new property named `DevEnvDir`, and set its value to the full path to `Common7\IDE`. For example:
|
||||
- `VS 2019 Community` - `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE`
|
||||
- `VS 2022 Community` - `C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE`
|
||||
|
||||
## Building
|
||||
|
||||
@@ -215,11 +221,11 @@ If you plan to distribute your own installers, you can change the variables in t
|
||||
|
||||
> Running `GEN INSTALLERS.bat` uses about 400 MB of RAM due to high compression. You can lower this to about 140 MB by opening `gen_full.iss` and `gen_port.iss`, and changing `LZMADictionarySize=15360` to `LZMADictionarySize=4096`.
|
||||
|
||||
## Development (Linux)
|
||||
# Development (Linux)
|
||||
|
||||
Unfortunately the development experience on Linux is terrible, likely due to mixed C# and native code. The .NET debugger seems to crash the moment it enters native code, so the only way to run the app is without the debugger attached. If any C# code throws an exception, it will crash the whole application with no usable stack trace or error message. Please let me know if you find a way to make this better.
|
||||
|
||||
### Building
|
||||
## Building
|
||||
|
||||
The `linux/TweetDuck/TweetDuck.csproj` project file has several tasks (targets) that run after a build:
|
||||
|
||||
@@ -227,7 +233,7 @@ The `linux/TweetDuck/TweetDuck.csproj` project file has several tasks (targets)
|
||||
* `FinalizeDebug` copies a debug plugin (`Resources/Plugins/.debug`) into the build folder (Debug only)
|
||||
* `FinalizeRelease` prepares the build folder for publishing (Release only)
|
||||
|
||||
### Release
|
||||
## Release
|
||||
|
||||
To change the application version before a release, search for the `<Version>` tag in every `.csproj` file in the `linux/` folder and modify it.
|
||||
|
||||
|
@@ -6,6 +6,6 @@ using TweetDuck;
|
||||
|
||||
namespace TweetDuck {
|
||||
internal static class Version {
|
||||
public const string Tag = "1.22";
|
||||
public const string Tag = "1.22.1";
|
||||
}
|
||||
}
|
||||
|
@@ -10,8 +10,6 @@ namespace TweetLib.Browser.CEF.Logic {
|
||||
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public sealed class ByteArrayResourceHandlerLogic<TResponse> : ByteArrayResourceHandlerLogic {
|
||||
public int RemainingBytes => resource.Length - position;
|
||||
|
||||
private readonly ByteArrayResource resource;
|
||||
private readonly IResponseAdapter<TResponse> responseAdapter;
|
||||
|
||||
@@ -46,20 +44,21 @@ namespace TweetLib.Browser.CEF.Logic {
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Read<T>(WriteToOut<T> write, T dataOut, int bytesToRead, out int bytesRead, IDisposable callback) {
|
||||
public bool Read<T>(WriteToOut<T> write, T dataOut, long maxBytesToRead, out int bytesRead, IDisposable callback) {
|
||||
callback.Dispose();
|
||||
|
||||
if (bytesToRead > 0) {
|
||||
if (maxBytesToRead == 0) {
|
||||
bytesRead = 0;
|
||||
}
|
||||
else {
|
||||
int bytesToRead = (int) Math.Min(maxBytesToRead, resource.Length - position);
|
||||
|
||||
write(dataOut, resource.Contents, position, bytesToRead);
|
||||
position += bytesToRead;
|
||||
bytesRead = bytesToRead;
|
||||
}
|
||||
|
||||
bytesRead = bytesToRead;
|
||||
return bytesRead > 0;
|
||||
}
|
||||
|
||||
public bool Read<T>(WriteToOut<T> write, T dataOut, out int bytesRead, IDisposable callback) {
|
||||
return Read(write, dataOut, RemainingBytes, out bytesRead, callback);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -38,7 +38,7 @@ namespace TweetImpl.CefGlue.Handlers.Resource {
|
||||
}
|
||||
|
||||
protected override bool Read(IntPtr dataOut, int bytesToRead, out int bytesRead, CefResourceReadCallback callback) {
|
||||
return logic!.Read(WriteToOut, dataOut, Math.Min(bytesToRead, logic.RemainingBytes), out bytesRead, callback);
|
||||
return logic!.Read(WriteToOut, dataOut, bytesToRead, out bytesRead, callback);
|
||||
}
|
||||
|
||||
protected override void Cancel() {}
|
||||
|
@@ -24,6 +24,7 @@ import configure_first_day_of_week from "./tweetdeck/configure_first_day_of_week
|
||||
import configure_language_for_translations from "./tweetdeck/configure_language_for_translations.js";
|
||||
import disable_clipboard_formatting from "./tweetdeck/disable_clipboard_formatting.js";
|
||||
import disable_td_metrics from "./tweetdeck/disable_td_metrics.js";
|
||||
import disable_tweetdeck_preview from "./tweetdeck/disable_tweetdeck_preview.js";
|
||||
import drag_links_onto_columns from "./tweetdeck/drag_links_onto_columns.js";
|
||||
import expand_links_or_show_tooltip from "./tweetdeck/expand_links_or_show_tooltip.js";
|
||||
import fix_dm_input_box_focus from "./tweetdeck/fix_dm_input_box_focus.js";
|
||||
|
@@ -8,6 +8,7 @@ if (!("TD" in window)) {
|
||||
*
|
||||
* @property {TD_Clients} clients
|
||||
* @property {TD_Components} components
|
||||
* @property {TD_Config} config
|
||||
* @property {TD_Controller} controller
|
||||
* @property {TD_Languages} languages
|
||||
* @property {TD_Metrics} metrics
|
||||
@@ -64,6 +65,13 @@ if (!("TD" in window)) {
|
||||
* @property {Class<MediaGallery>} MediaGallery
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef TD_Config
|
||||
* @type {Object}
|
||||
*
|
||||
* @property {Object} config_overlay
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef TD_Controller
|
||||
* @type {Object}
|
||||
|
7
resources/Content/tweetdeck/disable_tweetdeck_preview.js
Normal file
7
resources/Content/tweetdeck/disable_tweetdeck_preview.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import { TD } from "../api/td.js";
|
||||
|
||||
export default function() {
|
||||
const overlay = TD.config.config_overlay || (TD.config.config_overlay = {});
|
||||
overlay["tweetdeck_gryphon_beta_enabled"] = { value: false };
|
||||
overlay["tweetdeck_gryphon_beta_bypass_enabled"] = { value: false };
|
||||
}
|
@@ -4,7 +4,7 @@ import { TD } from "../api/td.js";
|
||||
import { ensurePropertyExists } from "../api/utils.js";
|
||||
|
||||
function focusDmInput() {
|
||||
document.querySelector(".js-reply-tweetbox").focus();
|
||||
document.querySelector(".js-reply-tweetbox")?.focus();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -39,7 +39,7 @@ namespace TweetImpl.CefSharp.Handlers {
|
||||
}
|
||||
|
||||
bool IResourceHandler.Read(Stream dataOut, out int bytesRead, IResourceReadCallback callback) {
|
||||
return logic.Read(WriteToOut, dataOut, out bytesRead, callback);
|
||||
return logic.Read(WriteToOut, dataOut, dataOut.Length, out bytesRead, callback);
|
||||
}
|
||||
|
||||
bool IResourceHandler.ProcessRequest(IRequest request, ICallback callback) {
|
||||
|
Reference in New Issue
Block a user