Commit Graph

430 Commits

Author SHA1 Message Date
Dima Krasner b2fac23783 fix failure when first chunk arrives last 2023-11-09 08:20:12 +01:00
Dima Krasner b84f4ba5dd coding style cleanup 2023-11-09 08:20:12 +01:00
Dima Krasner e18f9e4ecb coding style cleanup 2023-11-09 08:20:12 +01:00
Dima Krasner 1a45619461 add ugly guppy:// v0.4 support 2023-11-09 08:20:12 +01:00
Xavier Del Campo Romero 6d97b7f198 Replace QInputDialog with custom dialog for queries
Recent commits allowed multi-line input while reusing the QInputDialog
object already defined by Kristall. However, QInputDialog lacks a way to
access its QPlainTextEdit directly, and therefore set the wrap mode.

Since QInputDialog does no wrapping, it is inconvenient for writing a
long text (think of social media sites such as BBS or Station).
Therefore, a custom QDialog-derived class, namely QueryDialog, has been
provided.
2023-10-13 13:14:00 +02:00
Xavier Del Campo Romero 317bdbad5b settingsdialog.ui: Move "Generic" widgets to QScrollArea
This would allow smaller screens (think of mobile devices such as the
PinePhone or Librem 5) to be able to fit the settings dialog, and
therefore use it.
2023-09-29 14:23:09 +02:00
Xavier Del Campo Romero 505723e9df browsertab.cpp: Use multi-line input when required
Some Gemini sites such as Station or BBS allow multi-line posts.
2023-09-29 14:22:22 +02:00
Michael Steenbeek 3709c3d6bd Use startsWith() instead of left(4) 2023-08-30 08:43:16 +02:00
Michael Steenbeek 10a9c4ccfa Support URLs in Gophermaps
Paths in Gophermaps that start with “URL:” should be interpreted as direct
URLs, rather than references to files or directories on the Gopher server
itself.

An excerpt from the standard document:
```

Links to URLs from a gopher directory shall be defined as follows:

 Type -- the appropriate character corresponding to the type of the
 document on the remote end; h if HTML.

 Path -- the full URL, preceeded by "URL:".  For instance:
         URL:http://www.complete.org/

 Host, Port -- pointing back to the gopher server that provided
 the directory for compatibility reasons.

 Name -- as usual for a Gopher directory entry.

```
Source: gopher://quux.org/0/Archives/Mailing Lists/gopher/gopher.2002-02?/MBOX-MESSAGE/34

An example of this in the wild can be seen at gopher://gopher.floodgap.com ,
at the bottom of the page.

Note that above link carries a fallback for clients that do not support it,
as described by the Bucktooth server software:
```
[...]  most people will want to add web links to their
gophers anyway. In 0.1-pr4 and up, this is supported in a protocol independent
fashion; simply specify any URL and an 'h' item type, like so:

hYour Web Link<TAB>URL:http://www.floodgap.com/

Note that the URL must be preceded by a literal "URL:" and that the itemtype
is h. Smart clients will automatically take the URL portion and use it, but
even if they do not, Bucktooth will generate an HTML page with a Refresh:
header and forward them on automatically.
```

Other clients supporting this standard include the OverbiteWX extension.
(Most likely, there will be others, but I haven’t tested them all.)
2023-08-30 08:43:16 +02:00
Acidus 659a144814 Update settingsdialog.cpp 2023-07-08 10:12:12 +02:00
Acidus efdc99fe32 update with active search engines
adding Kennedy and TLGS as search engines
2023-07-08 10:12:12 +02:00
Tomas Åkesson c65edbc4dd Focus browsing area after page is loaded
This change allows the user to start scrolling with the keyboard instantly,
without having to focus the browsing area first, after a page has loaded.

This happens for example when opening a new tab, and when entering an
address manually.
2023-04-06 20:55:47 +02:00
Tomas Åkesson d47e3d3f54 Allow middle-click to open new tab when text is selected
If text is selected, middle-click will not be forwarded to the function
that opens the link in a new tab. So this change will deselect any
selected text before trying to open a new tab.

Fixes #253
2023-04-06 20:55:37 +02:00
Tomas Åkesson d937a0c32e Fix crash when encountering incomplete ANSI codes
Add bounds checking before increasing iterator pointer, to prevent
incomplete ANSI codes causing iterators going to far.
2023-04-02 18:15:30 +02:00
Tomas Åkesson eecc1d587c Fix crash when closing gopher tab during content loading 2023-04-01 19:50:05 +02:00
Tomas Åkesson 84c11ed766 Fix media player stuttering
Only call setPosition() on the QMediaPlayer object when the user has manually
dragged the slider position slider.

Otherwise the slider and player will call each other, probably causing a
feedback loop which causes stuttering.
2023-03-26 01:01:13 +01:00
Alexey Andreyev a63178f48f Improve Qt 6 support
Add missing mediaplayer widget logic

Contributes to:
https://github.com/MasterQ32/kristall/pull/266
2023-03-25 18:02:04 +01:00
Alexey Andreyev b833a5d261 Introduce Qt 6 support
With QT_VERSION_CHECK and core5compat module
2023-03-24 23:42:29 +01:00
Alexey Andreyev c15e14e9d1 AboutHandler: improve cache request generation
Specify Utf8 encoding for cache information header
2023-03-24 23:42:29 +01:00
Carlos Henrique Lima Melara d88dd7bfd1 fix missing kristall version when not building in git repo 2022-12-30 10:17:47 +01:00
Carlos Henrique Lima Melara e57a7ef663 src/about/help.gemini: fix typo (completly -> completely) 2022-12-25 10:41:48 +01:00
Carlos Henrique Lima Melara be009e4752 src/kristall.pro: append CPPFLAGS to CFLAGS and CXXFLAGS
qmake does not use QMAKE_CPPFLAGS, this is a hack to include it.
2022-01-30 16:55:41 +01:00
Felix "xq" Queißner 6b39f24484 Implements #245 2021-11-20 15:16:34 +01:00
Felix "xq" Queißner 9dd660d66e Improves caching api related to urls, implements fragment handling, fixes #237 2021-11-20 15:02:03 +01:00
quietok(david) bca592adf6 new location macos 11 homebrew qt 2021-09-13 11:00:34 +02:00
quietok(david) 8a7dfe0b1a Fix x86 for Haiku and maybe others 2021-09-13 10:33:29 +02:00
linear 0a8ecd6223 Fix building on macOS/arm64
Homebrew installs to a different directory on macOS/arm64.

this adds checks in the Makefile and in kristall.pro, and sets
the correct paths to Homebrew depending on whether the build is
targeting arm64 or not.
2021-09-05 11:03:57 +02:00
Thomas Groman 7fc40c6bee Add support for XHTML This patch sends XHTML down the HTML renderer path instead of erroring out unsupported mime. It does not implement XHTML exactly to the spec. That could hopefully be looked at in the future.
Signed-off-by: Thomas Groman <tgroman@nuegia.net>
2021-05-08 10:51:34 +02:00
Felix (xq) Queißner 10684b6d82 Further improves localization (#191). Allows switching and setting the chosen localization properly. 2021-05-08 10:44:03 +02:00
Felix (xq) Queißner a2f36ec4d1 Inserts setting for current language. 2021-05-08 10:44:03 +02:00
Mike Skec b802f19599 Fix for #233 2021-05-02 10:17:17 +02:00
Karol Kosek 86959d55a0 BrowserTab: accept file drops 2021-04-21 22:07:17 +02:00
Karol Kosek 0e3d0b1a5e Push lazy-loaded links to the history
When lazy-loaded links were making a new tab, they wasn't calling
tab->navigateTo(url, BrowserTab::PushImmediate).  What's important is only
it can push urls to the history and making a new function just for that
seemed like it'd just complicate things.

So I've changed it to call tab->navigateTo() on every loading type.
Unfortunately, that fixed our issue partly.
Sure, links are now put into the history, but lazy-loaded tabs stopped
being lazy-loaded anymore.  Moreover, they were also reloading a page on first
tab switch.

So I've made also a check that stops requesting lazy-loaded urls,
which made lazy-loading work as intended again, and moved the unsetting
lazy-loaded boolean on reload instead of right after it to be able to request
the file, which finally...

Closes: #214
2021-04-18 21:06:18 +02:00
Karol Kosek 2f74b60d06 main.cpp: support sessions when multiple users have opened Kristall
Before this change, only the first user who had opened kristall had working ipc.

The easiest fix was to prepend an username to the socket
and that's exactly what it does on Windows.

On Linux and other UNIX systems, we could do that too, but I came up with a bit
different approach.  I didn't like the fact that Qt puts sockets in /tmp,
but luckily we can provide the full path for the socket (Windows uses pipes,
so that's why it has its own case).  I've changed it to put sockets in
the runtime directory, because it's designed for that type of files
and it's user-specific, so we don't even have to prepend the username to it.
2021-04-17 08:36:10 +02:00
Karol Kosek 9ecc88dda3 Unwarp tr() from QStrings
We don't need to wrap tr() with QString, because it returns QString anyway.
Although it doesn't change the binary size (mostly because compilers were
smart to remove that already), it helps to make the code a little bit cleaner.

It's a somewhat continuation of c740189bca,
but I thought back then it happened only there, so now I've removed it from
all places.
2021-04-16 10:27:47 +02:00
Karol Kosek 9c883b55d4 BrowserTab: reset image scaling for small images
When you viewed a small image after the bigger one in the same tab, then
the graphics_browser was still trying to scale them to the window size.
2021-04-11 21:18:27 +02:00
Karol Kosek c740189bca BrowserTab: drop QString 2021-04-11 21:18:11 +02:00
Karol Kosek 9b148c919f BrowserTab: simplify unsupported media type error 2021-04-11 21:18:11 +02:00
Karol Kosek d9d624d010 BrowserTab: call the view source action from menu directly 2021-04-11 21:18:11 +02:00
Karol Kosek 4e9bd82562 GeminiRenderer: remove empty GeminiDocument class and unused includes 2021-04-11 21:18:11 +02:00
Karol Kosek 9a55d32e2c Save settings on exit
0d1fd25709 changed kristall::saveSettings()
to settings.sync() which caused bookmarks not to be saved.
2021-04-11 18:46:06 +02:00
Karol Kosek f181d989d6 BrowserTab: render image loading errors in a document 2021-04-10 22:58:25 +02:00
Karol Kosek 726e965a33 BrowserTab: add scrollbars to image view 2021-04-10 22:58:25 +02:00
Karol Kosek bbc7308f4c BrowserTab: scale images only when they are bigger than the window
Closes: #213
2021-04-10 22:58:25 +02:00
Karol Kosek c6b7ef61af BrowserTab: simplify image loading 2021-04-10 22:58:25 +02:00
tastytea 7074170f69 Respect *FLAGS environment variables.
This initializes QMAKE_CFLAGS, QMAKE_CXXFLAGS and QMAKE_LFLAGS with the
corresponding environment variables on all OSs. The variables will be
expanded when qmake is run[1].

This is a generalization of #171.

[1] <https://doc.qt.io/archives/qt-4.8/qmake-advanced-usage.html#variables>
2021-04-10 10:03:03 +02:00
Karol Kosek 60d3e221c0 Show application version in the about dialog 2021-04-09 07:52:27 +02:00
Karol Kosek 55b0f37bad MarkdownRenderer: remove resetFormatting function from blockquotes
It caused some spacing issues with nested blockquotes.
2021-04-09 07:51:58 +02:00
Karol Kosek c8eae06657 MarkdownRenderer: suppress first block 2021-04-05 17:13:58 +02:00
Karol Kosek cda1243ae8 MarkdownRenderer: apply replacing quotes 2021-04-05 17:13:58 +02:00