Jordan Petridis
2a6e0b0e07
Merge branch 'master' into state-machines-experiements
2018-02-22 12:14:55 +00:00
Jordan Petridis
c856b88008
EpisodeWidget: Add a Date state machine.
2018-02-19 18:14:34 +00:00
Jordan Petridis
ae25dd65bf
Cargo clippy and fmt.
2018-02-19 09:58:47 +00:00
Jordan Petridis
a88a1c5f1f
MediaMachine: Expose an interface to update the ProgressBar and local_size.
2018-02-17 19:49:43 +02:00
Jordan Petridis
0cd678cc1d
MediaMachine: Expose an interface to update total_size label.
2018-02-16 17:18:02 +02:00
Jordan Petridis
c9bf58af66
EpisodeWidget: Expose cancel button from the state machine.
2018-02-16 16:05:48 +02:00
Jordan Petridis
ed87a00225
EpisodeWidget: Cleanup parts of the state machine.
2018-02-16 14:43:16 +02:00
Jordan Petridis
bcc3608c04
EpisodeWidget: Split ButtonState enum from the MediaMachine.
...
Add a ButtonState Machine which represents the state of total_size
label, play button, and download button. Also implemented the
update/determine_state function for ButtonState.
Also implemented required generic functions for MediaMachine<X,Y,Z>
that convert it to the desired state.
2018-02-16 13:32:13 +02:00
Jordan Petridis
973d47ee05
EpisodeWidget: Expose the connect_clicked callbacks from the statemachine enum.
2018-02-15 18:07:21 +02:00
Jordan Petridis
f50c990d93
Yay, finally something that works.
2018-02-15 11:33:56 +02:00
Jordan Petridis
72eef6f104
Running in circles.
2018-02-15 11:08:21 +02:00
Jordan Petridis
4b8fceaa7d
Nothing makes sense.
2018-02-15 05:15:25 +02:00
Jordan Petridis
138cfdb68c
EpisodeWidget: use debug! instead of error! to avoid spamming stderr with *not actuall* errors.
2018-02-10 05:45:50 +02:00
Jordan Petridis
fc48ce9c47
EpisodeWidget: Migrate Duration Machine to use take mut too, and revert the api to require just &mut self.
2018-02-10 03:33:39 +02:00
Jordan Petridis
3a9a2f4033
EpisdoeWidget: Use take_mut crate to allow for a better api.
...
Currently it's required that you take mut self in order to manipulate
the internal state machines. This would not allow passing an Arc/Rc to
a callback since A/Rc<T> only derefs to &T and not T.
The take_mut crate allows the retrieval of ownership if you have a &mut refference
and as long you return T again. So Arc<Mutex<Machine> could work with
callbacks and embed Nested state machies without copying.
2018-02-10 03:15:12 +02:00
Jordan Petridis
f0ce0eb653
EpisodeWidget: Implement a state machine for duration label.
2018-02-09 10:12:37 +02:00
Jordan Petridis
23979b8f22
EpisodeWidget: Move state machine implementations into a separate module.
2018-02-09 09:13:41 +02:00
Jordan Petridis
e22a78fac6
EpisodeWidget: Re-enable on_play_bttn_clicked callback.
...
Before we were avoiding reloading the widget in view by
directly dimming the title label. Now instead we reload
the whole widget since I can't figure out a way to have
multiple Owneded refferences of the same state machine.
2018-02-09 08:59:50 +02:00
Jordan Petridis
7690cb1356
Remove code duplication using generics.
2018-02-09 08:43:47 +02:00
Jordan Petridis
a96f4c57c9
Probably the worst state machine implementation that was ever written.
2018-02-09 08:43:43 +02:00
Jordan Petridis
1135d77147
EpisodeWidget: Remove unwrap on that could occur if an invalid path was passed.
2018-02-08 21:10:36 +02:00
Jordan Petridis
9dfb18a487
EpisodeWidget: Minor refactor of set_total_size method.
2018-02-08 21:02:16 +02:00
Jordan Petridis
fbfa0de17e
EpisodeWidget: Fix minutes label parsing.
...
Before if a feed had reported a number between 1 and 60, a label 0 min
would be set.
This fixes that, while also using chrono::Duration for parsing minutes.
2018-02-08 20:39:37 +02:00
Jordan Petridis
4ba82c1515
EpisodeWidget: Set title alignment from glade.
2018-02-08 05:29:47 +02:00
Jordan Petridis
b172aa7aa3
Remove forgotten unwrap().
2018-02-08 04:39:51 +02:00
Jordan Petridis
e2a1762af4
EpisodeWidget: Use refference counting intead of unnecessary clones.
...
Pass owenership of EpisodeWidgetQuery and use Atomic Ref counting
to pass to the callbacks. This should avoid extra allocations.
2018-02-07 18:40:22 +02:00
Jordan Petridis
1c84f0d721
hammond-gtk::manager: Switch the add function to return a Result<(), Error>.
2018-02-06 22:03:17 +02:00
Jordan Petridis
0dc16dab9a
EpisodeWidget: Refactor to return Result<T, Error> wherever possible.
2018-02-06 02:31:53 +02:00
Jordan Petridis
de43cae015
Switch rest stuff of data/downloader to Failure Crate.
2018-02-04 17:36:27 +02:00
Jordan Petridis
2f062afb07
Clippy suggestions
2018-01-29 19:09:53 +02:00
Jordan Petridis
a7e3b1b99e
GtkApplication: Headbar and Content constructors now return Self instead of Arc<Self>.
2018-01-26 19:05:19 +02:00
Jordan Petridis
574cfae5c6
rustfmt: enable reorder imports.
2018-01-17 08:57:02 +02:00
Jordan Petridis
8e367b7e86
Dont ask me how this is working.
2018-01-12 08:50:16 +02:00
Jordan Petridis
8a90de3c0e
Implement download cancel action. #24
2018-01-10 09:43:38 +02:00
Jordan Petridis
955845110b
Merge branch 'master' into 33-downloader-re-work
2018-01-09 12:06:38 +02:00
Jordan Petridis
0ba5e14d7f
EpisodeWidget: Only update if it's visible.
2018-01-09 10:10:54 +02:00
Jordan Petridis
ea70addbc6
Removed some unwrap()s.
2018-01-09 09:21:07 +02:00
Jordan Petridis
87a259e1a4
Minor cleanup.
2018-01-09 07:21:38 +02:00
Jordan Petridis
68d7c621d3
EpisodeWidget: Update the local_size label.
2018-01-09 06:15:41 +02:00
Jordan Petridis
c54f29e82a
EpisodeWidget: Modulate callbacks.
2018-01-09 04:20:38 +02:00
Jordan Petridis
9dafb0ae9e
EpisodeWidget: Add local_size label that shows the amount of bytes downloaded.
2018-01-09 03:58:13 +02:00
Jordan Petridis
193117f579
Downloader: Update the progress index of downloads.
2018-01-08 12:29:47 +02:00
Jordan Petridis
eef83fc98c
EpisodeWidget: Implement API to update the progress bar.
2018-01-08 05:11:37 +02:00
Jordan Petridis
81b1ec810c
Apply clippy suggestions.
2018-01-07 08:36:02 +02:00
Jordan Petridis
074284d286
Move unsub show logic and get_download_folder func to hammond-data::utils.
2018-01-07 08:26:38 +02:00
Jordan Petridis
6bd391d89e
I hate global mutable state..
2018-01-07 05:51:29 +02:00
Jordan Petridis
e961d5f8b0
Use lazystatic to cache the current chrono date. This will backfire on every new year's eve.
2018-01-06 03:49:26 +02:00
Jordan Petridis
5fed283ff4
EpisodeWidget: Hide duration label if its equal to 0.
2018-01-06 03:18:28 +02:00
Jordan Petridis
da459707be
Wire up the callbacks to the client.
2018-01-05 23:57:48 +02:00
Jordan Petridis
13ba2762ad
Move the download manager to the gtk crate.
2018-01-05 22:02:06 +02:00
Jordan Petridis
e9dd297bf3
Merge branch 'master' into 33-downloader-re-work
2018-01-05 21:43:41 +02:00
Jordan Petridis
d8d4b08252
EpisodeWidget: Trim date label to avoid date/title miss alignment on single digit dates.
2018-01-05 18:46:22 +02:00
Jordan Petridis
750abb519b
GtkApplication: Change the action channel polling interval.
2018-01-04 16:42:17 +02:00
Jordan Petridis
c33b493dcd
Migrate Headerbar transitions into Channel actions.
2018-01-03 08:02:06 +02:00
Jordan Petridis
33cd6e69ff
EpisodeWidget: Migrate to use a Channel Action instead of simple Action.
2018-01-03 06:53:19 +02:00
Jordan Petridis
f54ae2f1d5
EpisodeWidget: Code cleanup and splitting.
2018-01-03 03:02:46 +02:00
Jordan Petridis
c67c6e463e
EpisodeWidget: Its still a mess, but a bit cleaner.
2018-01-02 08:19:24 +02:00
Jordan Petridis
c61d322569
EpisodeWidget: Implement shared download state.
2018-01-02 08:00:38 +02:00
Jordan Petridis
37e9b6fbf0
'How hard could it be'
2018-01-02 07:23:53 +02:00
Jordan Petridis
1d78ab7c42
Cargo upgrade.
2017-12-28 23:19:36 +02:00
Jordan Petridis
ada73a616f
EpisodeWidget: Make cancel button insensitive.
2017-12-27 15:13:09 +02:00
Jordan Petridis
0a7825dfff
EpisodeWidget: Remove delete button and hide cancel button till refactor.
2017-12-26 21:36:18 +02:00
Jordan Petridis
2d6f02c407
EpisodeWidget: Do not display size if it's 0 bytes.
2017-12-23 15:44:28 +02:00
Julian Sparber
95c290df50
[ui] add custom style and [fix] draw List separators with css
2017-12-22 21:54:28 +01:00
Jordan Petridis
0129efb02e
EpisodeWidget: Display episode's duration. Closes #21 .
2017-12-22 17:49:15 +02:00
Jordan Petridis
b7e160f735
EpisodeWidget: Change date representation based on it's year. Closes #19 .
2017-12-21 21:50:50 +02:00
Jordan Petridis
4a033e6d89
EpisodeWidget: Remove the decimal places in the size label.
2017-12-21 21:37:51 +02:00
Jordan Petridis
378b8609aa
EpisodeWidget: Change the byte unit based on the size. Closes #18 .
2017-12-21 21:31:25 +02:00
Jordan Petridis
db59bed69d
hammond-data::utils: Modified EpisodeCleaner Diesel model to also be used with played_cleaner.
2017-12-20 19:18:20 +02:00
Jordan Petridis
bda09c032a
EpisodeWidget: Update the progrress bar only when download clicked.
2017-12-20 13:18:29 +02:00
Jordan Petridis
61bd7893c7
EpisodeWidget: Remove Podcast depndancy from new() method.
2017-12-18 19:10:50 +02:00
Jordan Petridis
32cd24fc7b
EpisodesView: Added glade files and initial yak shaving.
2017-12-18 18:20:40 +02:00
Jordan Petridis
945600b20d
Merge branch 'master' into 'master'
...
Set dim-label for secondary labels of EpisodeWidget in Glade.
See merge request alatiera/Hammond!7
2017-12-17 14:30:10 +00:00
Constantin Nickel
681b91d368
Set dim-label for secondary labels of EpisodeWidget in Glade.
2017-12-17 13:17:04 +01:00
Jordan Petridis
75fe0f8ff5
Use Default trait for creating Widget's that don't need arguments.
2017-12-17 13:08:51 +02:00
Jordan Petridis
f7af05a650
EpisodeWidget: Dim/Grey out widget if episode is played.
2017-12-16 20:30:25 +02:00
Jordan Petridis
dbe08f7deb
EpisodeListBox: Improve the separator workaround.
2017-12-16 14:17:27 +02:00
Jordan Petridis
4375c7f4ce
EpisodeWidget: Added a separator in each widget.
...
This is a work around since list_box_set_header_func is not yet
available in the gtk-rs bindings.
2017-12-15 21:06:57 +02:00
Jordan Petridis
4b0a6ea0f7
Add Show title in the Headerbar when switching to ShowWidget.
2017-12-15 13:45:08 +02:00
Jordan Petridis
0c1e759a45
Dim out secondary label of EpisodeWidget.
2017-12-15 12:27:30 +02:00
Jordan Petridis
0ac78fcff1
Added date label into EpisodeWidget.
2017-12-14 18:03:37 +02:00
Jordan Petridis
e3b540170a
Add file size indication based on rss item length.
2017-12-14 15:32:21 +02:00
Jordan Petridis
afdb79b712
Set the progress bar into activity mode.
2017-12-14 13:38:18 +02:00
Jordan Petridis
8fe6b526a5
Add a new Diesel Model for the EpisodeWidget.
2017-12-14 12:01:35 +02:00
Jordan Petridis
ebbebf7735
Initial implementation of the new EpisodeWidget.
2017-12-14 10:57:29 +02:00
Jordan Petridis
5defb5867a
Move and rename stuff.
2017-12-13 11:35:17 +02:00
Jordan Petridis
bc57c33491
Change episode table schema.
2017-12-09 17:38:46 +02:00
Jordan Petridis
b528c48e3b
Run rustfmt.
2017-12-09 05:57:16 +02:00
Jordan Petridis
48e61c6377
Added small a utility that eats extra whitespace.
2017-12-07 18:31:45 +02:00
Jordan Petridis
c07d240532
Sanitize html during feed parsing.
2017-12-07 06:38:31 +02:00
Jordan Petridis
0359e9dd35
Convert EpisodeWidget into a Composed struct.
2017-12-01 07:13:41 +02:00
Jordan Petridis
4a195eb1b7
Moved set_played_now into a method of the Episode model.
2017-11-24 19:48:20 +02:00
Jordan Petridis
9bc6df2cba
Made Disel NewModels private.
2017-11-22 05:50:25 +02:00
Jordan Petridis
e07683c046
partially-fixed the tests and benchmarks.
2017-11-20 01:08:34 +02:00
Jordan Petridis
5ad52fa4b2
Refactored to remove from Database refferences.
2017-11-19 23:32:37 +02:00
Jordan Petridis
5c84b77434
Converted iter_mut into into_iter wherever possible.
2017-11-18 19:23:25 +02:00
Jordan Petridis
494761beaf
Removed id function from diesel models.
...
It's automaticly declared upon derive identifiable,
And there's no need to overwrite it.
2017-11-18 15:23:40 +02:00
Jordan Petridis
1ec4370c7b
Moved Database type-alias into hammond-data/src/lib.rs.
2017-11-17 21:37:55 +02:00
Jordan Petridis
3c6176b1c0
Renamed hammond-data/src/dbcheckup.rs into utils.rs
2017-11-16 23:32:40 +02:00
Jordan Petridis
8b4701f1a1
Renamed Gresource path in order to be less confusing.
2017-11-15 14:55:26 +02:00