Commit Graph

716 Commits

Author SHA1 Message Date
Jordan Petridis
1b78d221b6 PlayerWidget: Wire the play and pause buttons and add style classes to the Info Labels.
This also includes the yak shaving of a ::new and ::inti methods.
2018-06-23 22:45:12 +00:00
Jordan Petridis
039c3182aa h-gtk: Remove unused .ui file. 2018-06-23 22:45:12 +00:00
Jordan Petridis
3baa69b43b cargo fmt 2018-06-23 22:45:11 +00:00
Jordan Petridis
5f92df97e6 PlayerWidget: Wire the widget to the GUI.
This commit also removes the majority of the playback widget,
though most of it's code will make it to the PlayerWidget once
it starts to get wired to the gtreamer_plaer::Player.
2018-06-23 22:45:11 +00:00
Jordan Petridis
47f297c495 PlayerWidget: Intial draft of the the PlayerExt trait. 2018-06-23 22:45:11 +00:00
Jordan Petridis
58f09ba150 h-gtk: Bind the new player widget to code. 2018-06-23 22:45:10 +00:00
Jordan Petridis
1142948945 Rework the player widget. 2018-06-23 22:45:10 +00:00
Zander Brown
9528160b03 Start hooking things up
Still doesn't accept input
2018-06-23 22:45:10 +00:00
Zander Brown
4afdc54914 Initial playback control area
(not plumbed in)
2018-06-23 22:45:10 +00:00
Zander Brown
09973a6a56 Initial playback
... and not a lot more. Hit play and the podcast will play, press play on something else and that will play instead
2018-06-23 22:45:09 +00:00
Jordan Petridis
c4c7bbf46b
Content: Change the user-facing string of the home stack. 2018-06-23 16:11:00 +03:00
Jordan Petridis
bbabc6f5e9
h-gtk: Add resources/ to the cargo check list. 2018-06-11 14:23:29 +03:00
Zander Brown
ee23df176d Our GActions don't need to be in the app namespace 2018-06-07 18:06:36 +01:00
Jordan Petridis
a9feed56fe
Replace html2pango with html2text. 2018-06-06 15:28:44 +03:00
Jordan Petridis
6d93ceb910
EpisodeWidget: Minor style change. 2018-06-05 14:33:18 +03:00
Jordan Petridis
9b0ac5b83d
EpisodeWidget: Do not lock the Proggress struck when running update callbacks.
Previously each time we wanted to inspect the `Progress` struct we
were blocking which was problematic since the downloader also wants
to block to update it.

Now we use try_lock() and if a lock can't be aquired we requeue another
callback. That way we can also be way more aggressive about the interval
in whihc it the callbacks will run.
2018-06-05 14:17:37 +03:00
Jordan Petridis
ced686e1cd
EpisodeWidget: Remove explicit type declarations. 2018-06-02 22:33:00 +03:00
Jordan Petridis
272aab2397
EpisodeWidget: Document determine_state method. 2018-06-02 22:00:30 +03:00
Jordan Petridis
a7f87f2ac8
ShowWidget: Fix markallplayed functionality.
cfe79a73d6 changed the structure
of the EpisodeWidget and broke this.
2018-06-02 21:34:19 +03:00
Jordan Petridis
f9e85155a8
Remove unused dependancy. 2018-06-02 21:13:30 +03:00
Jordan Petridis
d281c18951
EpisodeWidget: Pass EpisodeWidgetQuery by refference. 2018-06-02 21:03:07 +03:00
Jordan Petridis
04e7f4f8a7
EpisodeWidget: Wire the download_checker callback again.
If an episode is being downloaded we setup a callback that will
supervise the widget and update it's state once the download action is
completed and the episode rowid is removed from `manager::ACTIVEDOWNLOADS`.
2018-06-02 21:03:00 +03:00
Jordan Petridis
a090c11f4a
EpisodeWidget: Wire the progressbar again. 2018-06-02 19:42:19 +03:00
Jordan Petridis
c303c697a9
EpisodeWidget: Wire the total_size label again.
The size might be provided by the rss feed but not alwasy. Additionally it might be
missleading so when a download starts we replace the label with the
HTTP ContentLength header.
2018-06-02 19:25:25 +03:00
Jordan Petridis
9466c5ea10
EpisodeWidget: Wire the cancel button. 2018-06-01 21:30:56 +03:00
Jordan Petridis
1268fcf1cc
EpisodeWidget: Wire the download button. 2018-06-01 19:08:56 +03:00
Jordan Petridis
86d06fa879
EpisodeWidget: Wire the play button again. 2018-06-01 16:49:06 +03:00
Jordan Petridis
cfe79a73d6
EpisodeWidget: Initial refactor.
State machines were a fun experiement but a nightmare to deal with
after the fact. This is the first steps for a refactor in a tradition
style with the goal to ultimatly making it easy to and port to relm.
2018-06-01 16:19:33 +03:00
Zander Brown
2fe612d392 Avoid un-closable AboutDialog 2018-05-31 08:35:09 +00:00
Jordan Petridis
14d72b92cb
h-gtk: Move appnotif.rs into the widgets module. 2018-05-30 16:45:46 +03:00
Jordan Petridis
8c0055723c
cargo fmt 2018-05-30 16:25:15 +03:00
Zander Brown
2c203acbd2 Use a macro when setting up simple SimpleActions 2018-05-29 17:16:05 +00:00
Jordan Petridis
e626c6f286
app.rs: Factor out the GAction definitions. 2018-05-29 14:04:09 +03:00
Jordan Petridis
24058f9534
h-gtk: Write doc comment for aboutdialog. 2018-05-29 13:36:22 +03:00
Jordan Petridis
a8d47e9a72
app.rs: Remove unused variable. 2018-05-29 13:26:36 +03:00
Jordan Petridis
667deef5f2
Use a mpmc channel instead of the mspc from the std. 2018-05-28 20:49:12 +03:00
Zander Brown
ffbab0136f Bind F10 to open the menu
Because we aren't using app-menu accels aren't automatically binded
2018-05-27 15:48:27 +01:00
Zander Brown
b5f7399b2c RIP appmenu
F5 -> <primary>r for refresh
2018-05-27 14:34:58 +01:00
Zander Brown
f1892eeba2 Always show hamburger menu 2018-05-22 10:46:50 +01:00
Zander Brown
e7128a57db Resolve some comments 2018-05-22 10:28:13 +01:00
Zander Brown
793cafd294 Formatting updates 2018-05-22 09:55:00 +01:00
Zander Brown
079ae0e1f3 Fallback to hamburger when the environment doesn't like app menus 2018-05-21 13:01:06 +01:00
Zander Brown
e181a9837a Merge upstream master 2018-05-21 12:01:32 +01:00
Zander Brown
ca5c7022ef Fixed some shortcut display issues
Also give FileChooserNative arguments in the right order & add F5 to refresh
2018-05-21 11:49:35 +01:00
Zander Brown
75c50392cb Everything works (ish)
Also use FileChooserNative for flatpak nicities
2018-05-21 10:06:10 +01:00
Zander Brown
8c2ea052de Keyboard shortcut overview!
(shame everything else is broken...)
2018-05-20 13:59:00 +01:00
Zander Brown
095dd73c52 Move refresh 2018-05-19 22:11:44 +01:00
Zander Brown
ac6ac42860 Move import 2018-05-19 21:48:38 +01:00
Zander Brown
c6ce888cc7 Define an app-menu with About & Quit actions
Rename some paths for auto resource magic
2018-05-19 20:38:36 +01:00
Jordan Petridis
c4e6fcc451
Version bump. 2018-05-19 13:11:02 +03:00
Jordan Petridis
4d77281249
Update deps. 2018-05-19 12:17:55 +03:00
Jordan Petridis
41073615e9
Clippy: Derive Copy for appnotif::UndoState 2018-05-16 19:54:07 +03:00
Jordan Petridis
bd12b09cbc
ShowsView: Fix a bug where the last show would not be shown.
utils::lazy_load() now calls widget.show() for each widget it adds
to the parent container.
2018-05-16 19:44:58 +03:00
Jordan Petridis
7d598bb1d0
h-gtk: Smooth out some stack transitions. 2018-05-16 19:40:36 +03:00
Jordan Petridis
ccd3e3ab2c
h-gtk: Show error notifications when OPML import fails. 2018-05-16 17:54:32 +03:00
Jordan Petridis
118dac5a1a
app.rs: Add an action for showing error notification. 2018-05-16 17:30:43 +03:00
Jordan Petridis
7035fe05c4
InAppNotification: Extend the widget to allow showing notifications without an undo button. 2018-05-16 16:58:03 +03:00
Jordan Petridis
af7331c6c6
h-gtk: Rename EpisodeViewWidget to HomeEpisode. 2018-05-16 16:33:54 +03:00
Jordan Petridis
4d2b64e79d
h-gtk: Remember the vertical allingment of the ShowsView. 2018-05-13 22:47:56 +03:00
Jordan Petridis
d47bbd6131
Remove explicit and not needed inline calls.
This code is not performance critical and the compiler will already
inline whatever it thinks it might benefit it.
2018-05-13 22:08:25 +03:00
Jordan Petridis
54fafa07a2
h-gtk: Use clone! macro to replace some boilerplate. 2018-05-13 21:51:32 +03:00
Jordan Petridis
97eef9149c
import_dialog: Do not show hidden files in the FileChooser. 2018-05-13 00:22:54 +03:00
Jordan Petridis
b95e70a8c4
import_dialog: Only show xml files in the FileChooser. 2018-05-13 00:06:35 +03:00
Jordan Petridis
00e747eb5f
h-gtk: Wire the import_shows button on the hamburger menu to the the opml import. 2018-05-12 22:55:35 +03:00
Jordan Petridis
be1a8df3ef
Headerbar: simplify the naming scheme a bit.
The type of the widgets is already a Button so there's no need in
repeating that in the struct field.

Also remove some type annotations since the compiler can infer them
from the type of the struct fields.
2018-05-12 14:45:00 +03:00
Jordan Petridis
e8ca2faaa7
Headerbar: Add import and export items in the hamburger menu.
I strongly believe that these do not belong there and should be moved
elsewhere. But for the time being and prototyping they are "good enough".

People most of the time tend to import from an OPML file only on the first
use of the App. Then the functionality sits there and is never used again.
That's why I think import should be moved into a preferences dialogs and
have the empty view suggest the action.

Exporting OPML files is also not that common, I also believe this should be
moved into a preference dialog instead of the hamburger menu.
2018-05-12 14:17:40 +03:00
Jordan Petridis
f06dbd0562
Version bump. 2018-05-07 19:48:21 +03:00
Jordan Petridis
b5dbfb1a86
PopulatedStack: Allow for more control over the stack transitions.
When you just update/replace the widget there is no need for an animation
to occur. Thus why animations where broken before. This commit is not ideal
as it makes it the responsibility of the caller to declare valid(UX wise)
transitions.
2018-05-04 11:32:50 +03:00
Jordan Petridis
d86a17f76e
ShowWidget: Set max_width_charters in the Description.
If the window is fullscreen or given a big width description
expands and becomes harder to read. This sets the character limit
of the description to 70charaters. The exact size might differ
from machine-to-machine based on user settings. (Hi-dpi, chosen
font, etc.)
2018-05-02 19:29:55 +03:00
Jordan Petridis
f324407c9c
Deny all the warnings when building. 2018-04-30 14:21:34 +03:00
Jordan Petridis
c96b39d597
Fix all the clippy warnings! 2018-04-30 14:13:54 +03:00
Jordan Petridis
d4d89a56e9
Revert "Update deps."
This reverts commit f19ad133c6.

There was dependancy conflitct that was not caught locally due to caching.
2018-04-29 20:15:44 +03:00
Jordan Petridis
f19ad133c6
Update deps. 2018-04-29 19:57:32 +03:00
Jordan Petridis
00d9019f29
Do not pass some things by value when not needed. 2018-04-29 19:27:40 +03:00
Jordan Petridis
8951a6e237
h-gtk: Animate the adjustment of scrolled windows.
Many thanks to Julian Spaber for documenting this.
2018-04-29 19:07:12 +03:00
Jordan Petridis
b0ac037964
Fix the broken test. 2018-04-28 14:53:43 +03:00
Jordan Petridis
2c8ff2d2f2
Cargo fmt 2018-04-28 14:19:55 +03:00
Jordan Petridis
03bd951848
EpisodeWidget: Handle updating states, withotu having to reload the views.
This code is ugly and terrible but it works™. Previsously when a download
would finish it would refresh all the views. Now the if the widget get's
into the Donwloading state, it will setup a callback that will check
periodicly if it's still downloading and update the widget state when
the episode stops downloading.
2018-04-28 14:09:26 +03:00
Jordan Petridis
63e2ea987e
This was commited by accident. 2018-04-28 12:41:56 +03:00
Jordan Petridis
115df7f884
h-gtk: Re-work the minimum widget requests. 2018-04-27 12:08:07 +03:00
Jordan Petridis
ed94d34589
h-gtk: Rename the stasckswitcher field in the Headerbar. 2018-04-27 11:41:39 +03:00
Jordan Petridis
dc5ff9d809
h-gtk: Take into account the ignored_shows when detemening if podcast table is empty.
If you've had one show and pressed unsub, instead of going to
an empty view, it would stay to populated since it the db records
where still there.
2018-04-27 11:21:32 +03:00
Jordan Petridis
72a6832571
h-gtk: Rename HomeView and ShowView parent modules. 2018-04-25 20:57:05 +03:00
Jordan Petridis
3d160fc35c
h-gtk: Restructure the stacks structure.
This commit reimplements support for the empty view in the ShowStack.
The current structure is the following:
* A Content stack which holds the HomeStack and the ShowStack.
  It's what is used in the headerbar StackSwitcher.

* The HomeStack is composed of the HomeView and an EmptyView.

* The ShowStack is composed of the PopulatedStack and an EmptyView.

* The PopulatedStack is composed of the ShowsView and the ShowWidget
  currently. An AboutEpisode widget is planned to be added here also.
2018-04-25 19:23:02 +03:00
Jordan Petridis
734f85a517
Fix logic typo. 2018-04-24 15:34:52 +03:00
Jordan Petridis
a56a80db88
ShowWidget: Keep track of the podcast it was created from.
Since ShowStack now keeps a refference to ShowWidget we no
longer need to encode it in the widget name.
2018-04-24 15:25:34 +03:00
Jordan Petridis
c4ed90dd5a
ShowStack: Refactor to make stack restructure easier.
This removes the empty widget from the ShowStack. The plan is
to have a ShowsView which will be the parent of ShowStack and
an Empty Widget. Then make ShowStack have only valid populated
states of ShowsPopulate, ShowWidget and AboutEpisodeWidget later.
2018-04-24 13:12:27 +03:00
Jordan Petridis
f173b326a4
Contnet: Minor renaming following 75af3c7f2b 2018-04-24 12:28:29 +03:00
Jordan Petridis
5e302290de
HomeStack: Minor refactor to wrap gtk::Stack actions.
For now the methods are private and migth not be neccesarry,
but it will be much easier to manipulate the stack from outside
with this API if it's needed and the methods are made public.
2018-04-24 09:59:29 +03:00
Jordan Petridis
75af3c7f2b
h-gtk: Rename EpisodeStack to HomeStack. 2018-04-24 09:31:56 +03:00
Jordan Petridis
d7aec6fdfb
h-gtk: Move vies inside the widgets module.
EpisodeView was renamed to HomeView. More renaming will follow.
2018-04-23 15:57:46 +03:00
Jordan Petridis
063bcbd0e5
Remove unused pub field. 2018-04-22 06:34:02 +03:00
Jordan Petridis
a76e69e05d
ShowWidget: Center the description label. 2018-04-21 09:25:21 +03:00
Jordan Petridis
e560cce879
h-gtk: Further refactor of the ShowStack. 2018-04-21 08:01:34 +03:00
Jordan Petridis
6406c3af13
h-gtk: Refactor part of the ShowStack. 2018-04-21 07:40:42 +03:00
Jordan Petridis
173d2d3a3a
h-gtk: Refactor EpisodesStack. 2018-04-20 17:23:07 +03:00
Jordan Petridis
9a5cc1595d
ShowWidget: re-arrange the show's cover/desc/buttons widgets. 2018-04-20 10:20:09 +03:00
Jordan Petridis
af5b27d0fc
EpisodeWidget: Replace Arc<Mutex<Widget>> with Rc<RefCell<Widget>>.
Since gtk Widgets are not Send, and the callbacks all run in the gtk
main loop, it *should* not be possible that 2 things try to access the
same widget at the same time.
2018-04-20 07:26:56 +03:00
Ivan Augusto
2f1ea12cfa Update links to new repo 2018-04-19 17:23:46 -03:00
Jordan Petridis
736a993284
h-gtk: Move forgotten test from a68987f257 2018-04-19 08:26:45 +03:00