Commit Graph
100 Commits
Author SHA1 Message Date
Stephan Aßmus 6f6ad9153b HaikuDepot: Improve featured package items
Show the summary instead of the version. The layout still sucks, but I will
have to implement some kind of row/flow BLayout to get what I initially had
in mind. Another TODO is to highlight the clicked item somehow.
2014-11-02 01:38:34 +01:00
Stephan Aßmus dfbf4d3885 HaikuDepot: Fix click detection in featured packages
Take window activation and parent bounds (a featured package scrolled outside
the visible region within the parent) into account.
2014-11-02 01:38:33 +01:00
Stephan Aßmus 1f3c1ef1c5 HaikuDepot: Select clicked featured packages 2014-11-02 01:38:32 +01:00
Stephan Aßmus a3056e412a HaikuDepot: Move selection message constant to MainWindow.h 2014-11-02 01:38:30 +01:00
Stephan Aßmus 419dc642f5 HaikuDepot: Feature packages with prominence <= 200 2014-11-02 01:38:29 +01:00
Stephan Aßmus da6511046d HaikuDepot: Properly add featured packages.
* Rework existing package listener mechanism to report any interesting
   changes. Listen for prominence changes in addition to package state.
 * Add featured packages to the FeaturedPackagesView when their prominence
   is retrived, and also in _AdoptModel().
 * In _AdoptModel(), show the featured packages view when no search filters
   are active and installed packages are not shown either. Otherwise show
   the list of all packages matching the current filtering.
2014-11-02 01:38:28 +01:00
Stephan Aßmus 64458d227c HaikuDepot: Only list featured packages once. 2014-11-02 01:38:27 +01:00
Stephan Aßmus 0c169ace2e HaikuDepot: Add some getters to Model.
For category, depot and search terms filter.
2014-11-02 01:38:25 +01:00
Stephan Aßmus 3d869af5e4 HaikuDepot: Separate MessagePackageListener...
...into MessagePackageListener and OnePackageMessagePackageListener.
The first one doesn't know which package(s) it's listening to. But it
can filter the change notifications now and only react to certain changes.
The second one knows which package it's listening to.
2014-11-02 01:38:24 +01:00
Stephan Aßmus 9f40cd4121 HaikuDepot: Retrieve prominence values from web app 2014-11-02 01:38:23 +01:00
Stephan Aßmus 6072a7e417 HaikuDepot: Added "prominence" member to PackageInfo 2014-11-02 01:38:21 +01:00
Stephan Aßmus 4b930cca9c HaikuDepot: Work in progress on featured packages
Not yet visible. But the package list area in the main window has a card
layout now and a second (hidden) page for featured packages. Which packages
are visible there will depend on the prominence value from the web-app
and other parameters later (suggestions based on packages already installed
and user-ratings). At the moment, there is no mechanism for updating the
package list when package info is retrieved asynchronously, even from the
cache. Also, the view should switch to the list when searching and perhaps
in other situations as well, like selecting a category or when no packages
would be featured. And clicking featured packages does not yet select them in
the info area...
2014-10-26 23:37:18 +01:00
Stephan Aßmus f545fe6acc HaikuDepot: Extracted MarkupTextView into its own files 2014-10-26 23:37:17 +01:00
Stephan Aßmus 7631f91496 HaikuDepot: Beginnings of "featured packages" view
Currently a vertically scrollable container for views which are similar
to the title area in the package info view (and share most code, but it
will diverge later on). Untested and not yet used.
2014-10-26 23:37:15 +01:00
Stephan Aßmus 73a3f44915 HaikuDepot: Extracted MessagePackageListener...
... from PackageInfoView into its own files.
2014-10-26 23:37:14 +01:00
Stephan Aßmus 7d0ce97b27 HaikuDepot: Extraced LinkView and ScrollableGroupView...
... from PackageInfoView.cpp into their own files in ui_generic.
2014-10-26 23:37:13 +01:00
Stephan Aßmus cb9a077fde HaikuDepot: Implemented "opening" installed packages
Package contents are scanned to find deskbar links. If a package has less
than four links, they will be offered in separate "Open <link name>" buttons
in the package info area. Usually, this results in one button to open the
main application from the package. If the heuristic proves to be not good
enough, this could be improved of course.
2014-10-26 23:37:12 +01:00
Stephan Aßmus 2d2824bfff HaikuDepot: Store package file name in PackageInfo
Also removed misplaced WIP functionality to find deskbar links
2014-10-26 23:37:10 +01:00
Stephan Aßmus ad5bc044c5 HaikuDepot: Make sure to pick up changed package action labels 2014-10-26 23:37:09 +01:00
Stephan Aßmus a88f2beb0f Make HaikuDepot the preferred app for .hpkg files.
Note that double clicking a .hpkg in one of the packages folders will
not yet have a sensible result. I think it should open the regular
HaikuDepot with the full packages list, default to show installed packages
only and pre-select the package that was double clicked. It would be tricky
however if more than one installed package file is opened at once.
2014-10-26 00:25:19 +02:00
Stephan Aßmus 5f52e82c00 HaikuDepot: Some work in progress to prepare "opening" packages
The idea is to parse packages for Deskbar links and offer to "open" them
once they are installed. The added functionality is not yet complete and
will eventually figure out the file system location of a package and parse
the contents. I am mainly pushing this since my git-foo is limited and
I want to push the fix for the discovered deadlock.
2014-10-26 00:13:48 +02:00
Stephan Aßmus 6b147523f1 HaikuDepot: Fixed potential dead-lock in package list refresh.
When the package list was refreshed while package info was still being
pulled from the web app, calling Model::Clear() with the model lock already
held could lead to a dead-lock: The package populator could block on the
model lock to update information, while StopPopulatingAllPackages() waited
for the thread to exit, but held the lock that the thread was blocking on.
So call StopPopulatingAllPackages() before grabbing the lock and calling
Clear() in MainWindow::_RefreshPackageList().
2014-10-26 00:13:47 +02:00
Stephan Aßmus fdec4227f5 HaikuDepot: Resurrect Options menu...
And move the (new) checkmarks into the Options menu. This makes them less
easy to discover, but cleans up the UI, especially since the options to show
development and source code packages are not very important for most users.
2014-10-25 17:30:54 +02:00
Stephan Aßmus e0a26dce59 HaikuDepot: Centralized user account features in the UI
There is now a right-aligned second menu bar for the account management.
The menu label is what was previously shown underneath the search terms field.
The menu items have moved from the Tools menu into the new user menu. This
means the login/logout functionality is directly available where the login
info is shown in the UI when you click it.
2014-10-25 17:16:37 +02:00
Stephan Aßmus 9303787b1a HaikuDepot: Show ratings in other languages with empty comments 2014-10-25 16:33:02 +02:00
Stephan Aßmus 7102f0d09b HaikuDepot: Disable package action button...
... after scheduling the respective package action.
2014-10-25 16:33:00 +02:00
Stephan Aßmus 87d1eac74e HaikuDepot: Implement ProgressPackageDownloadStarted()...
... by calling ProgressPackageDownloadActive() with a 0.0f progress
percentage.
2014-10-25 11:12:29 +02:00
Stephan Aßmus 24e3b35816 HaikuDepot: Support installing local package files
* Give the PackageManager either the package name, or the path to a local
   .hpkg package to Install().
 * Implement Warn() to at least print something to the command line. Change
   the TODO to show the warning to the user instead.
2014-10-25 11:12:27 +02:00
Stephan Aßmus 9002c94345 Package Kit: Always allocate local repository
Consequently always register it with the solver in Init(). This solves the
problem that it made a difference at which time Init() is called. Init() is
called at the beginning of Install() and Uninstall(), but HaikuDepot was
calling it before that for other reasons. A second call to Init() will exit
early. If local package files were added to the PackageManager instance,
the local repository was created lazily, but because Init() did not run a
second time, the local repository was not registered with the solver. Now
it already is, since it is no longer created on demand, but always.
2014-10-25 11:12:26 +02:00
Stephan Aßmus 448f707cea HaikuDepot: Never refresh repositories or package lists...
... when in single package mode.
2014-10-25 11:12:25 +02:00
Stephan Aßmus 89fbeddf2a HaikuDepot: Store local package path in PackageInfo...
... when launched with a path to a .hpkg file.
2014-10-25 11:12:24 +02:00
Stephan Aßmus 08f2b2b232 HaikuDepot: Restrict max width of links in package view 2014-10-18 22:52:00 +02:00
Stephan Aßmus 96ebc1d602 HaikuDepot: React to B_SELECT_ALL in custom text view 2014-10-12 23:41:27 +02:00
Stephan Aßmus 639756547d HaikuDepot: Move worker thread init into method
... and call it from the second version of the MainWindow constructor.
2014-10-12 23:21:54 +02:00
Stephan Aßmus 027e51ae7d HaikuDepot: Log more errors to stderr.
These errors do not necessarily need to be reported to the user via alerts.
They are more of an indication that HaikuDepot needs to be smarter when
figuring out what package actions to present at all.
2014-10-12 23:21:52 +02:00
Stephan Aßmus 1783f96af9 HaikuDepot: Show alert when scheduling package action failed 2014-10-12 23:21:49 +02:00
Stephan Aßmus 2fb1b897bc HaikuDepot: Revert change regarding publisher name
It is now again the first string from the copyrights list, unless there is
no copyrights list, in which case the vendor string is used.
2014-10-10 22:51:19 +02:00
Stephan Aßmus 6d519fd175 HaikuDepot: WIP to open .hpkg files.
* When opening .hpkg files, shows just the PackageInfoView in a smaller
   window.
 * PackageInfo constructor with BPackageInfo argument
 * Default pkg icon has a single instance only. Before, there would be another
   instance for each repository refresh.

TODO:
 * Install button on single package view is non functional
 * Probably needs to do someting different when opening .hpkg from an
   installed packages folder (show the regular list and focus that package?).
 * The filter view and list view are still constructed for the single package
   mode.
 * ...
2014-10-10 22:42:07 +02:00
Stephan Aßmus a3dfc57d04 HaikuDepot: Enable caching of info retrieved from web-app 2014-10-07 22:32:42 +02:00
Stephan Aßmus cdb2290fe9 HaikuDepot: Logic reversal with marking username field
Fixed flipping the boolean passed to MarkAsInvalid() for the user name field,
which only recently became apparent.
2014-10-07 21:35:09 +02:00
Stephan Aßmus 6f9eb8d1bb HaikuDepot: Validate input before creating account
Provide error or info alert when fields are invalid, suggest
providing an email, but allow to ignore the warning.
2014-10-04 13:31:58 +02:00
Stephan Aßmus fa09af9a8f HaikuDepot/RatePackageWindow: Output in error code paths 2014-10-04 12:32:59 +02:00
Stephan Aßmus 602db4afd3 HaikuDepot: Removed misleading default comment text 2014-10-03 12:59:45 +02:00
Stephan Aßmus 5ba7054c6b HaikuDepot: Don't try to send "unspecified" stability
Set to empty string and cause the JSON to have null. Fixes sending/editing
comments without specifying a stability rating.
2014-10-03 12:59:44 +02:00
Stephan Aßmus b5b717785e HaikuDepot: Specific error for untracked packages
The web service currently only synchronizes with HaikuPorts. Packages
from 3rd party repositories which were added by the user cannot be rated.

Also, use a warning alert for errors in the UserLoginWindow and
RatePackageWindow.
2014-10-02 22:57:51 +02:00
Stephan Aßmus f532d965bf HaikuDepot: Escape strings in the JSON builder
Fixes uploading comments which use any char that needs to be escaped.
Such as line-breaks, " or \.
2014-10-02 22:57:49 +02:00
Stephan Aßmus b7b31be400 HaikuDepot: Filter ratings by preferred languages
Show only those user ratings which are in one of the
languages configured in the Locale preflet's preferred
languages list.
2014-10-02 21:42:19 +02:00
Stephan Aßmus 1bbda92dc7 HaikuDepot: Request to login before rating a package
* There is now a flow of logging in or creating an account before being
   able to rate a package and the user is not yet logged in. The
   UserLoginWindow stores an "on success" BMessenger and BMessage which are
   send after the alert which confirms successful login or account creation.
   This is used to make the RatePackageWindow show once logged in successfully.
2014-09-30 22:35:46 +02:00
Stephan Aßmus fb303f1987 HaikuDepot: Be more verbose about how to update ratings 2014-09-30 22:35:44 +02:00
Stephan Aßmus bf62b1f845 HaikuDepot: Changed alert message for updating a rating 2014-09-30 22:35:41 +02:00
Stephan Aßmus 504501a9cb HaikuDepot: Fixed creating/updating ratings.
* The HTTP Basic authentication never worked. BHttpRequest.SetUserName()
   and SetPassword() have no effect at all, unless there is a
   BHttpAuthentication set for the given URL on the BUrlContext. This part
   of the services API isn't very intuitive, yet.
 * UpdateUserRating() forgot to append the "filter" array which specifies
   to the web app which fields of the rating are updated by the request.
2014-09-30 22:35:39 +02:00
Stephan Aßmus 6e80c1ca11 HaikuDepot: Implemented creating/updating ratings...
... from the RatePackageWindow. It does not work yet, the errors
are reported. To be investigated...
2014-09-29 23:19:55 +02:00
Stephan Aßmus e824035985 HaikuDepot: Fixed missing space in error alert. 2014-09-29 23:19:25 +02:00
Stephan Aßmus fca4717406 HaikuDepot: Implemented creating and updating ratings...
... in WebAppInterface. Both types of requests fail at the moment.
Creating a rating failes due to invalid authentication (I thought I am doing
it correctly), updating fails with a NullPointerException on the server.
2014-09-29 23:05:43 +02:00
Stephan Aßmus 24cde1e4ef HaikuDepot: Added WebAppInterface getter to Model 2014-09-29 23:05:11 +02:00
Stephan Aßmus 965707a9bb HaikuDepot: Rating and login window have no system names. 2014-09-29 22:30:59 +02:00
Stephan Aßmus 8ecb43af28 HaikuDepot: Display check box to deactivate rating
... if a rating already exists for the given package and version.
2014-09-29 22:23:15 +02:00
Stephan Aßmus 0ba9258d0f HaikuDepot: Use B_USE_WINDOW_INSETS in login window 2014-09-29 22:22:30 +02:00
Stephan Aßmus cec1192ea0 HaikuDepot: Use getUserRatingByUserAndPkgVersion...
... instead of searching for a rating from the given user. This API will
also return deactivated ratings, so the user could re-activate it.
2014-09-29 22:05:00 +02:00
Stephan Aßmus 46bcb34d05 HaikuDepot: Store BPackageVersion in PackageInfo...
...instead of the string representation. This makes it easier to
get the major, minor, micro, prerelease and revision parts later on.
2014-09-29 22:04:59 +02:00
Stephan Aßmus 9ddea57b38 HaikuDepot: Better order of stability ratings 2014-09-29 13:31:12 +02:00
Stephan Aßmus 9586185a7c HaikuDepot: Aligned stability rating names with web app. 2014-09-29 13:31:11 +02:00
Stephan Aßmus 046dc04e83 HaikuDepot: Now retrives existing rating for a package...
... if there is one and fills the RatePackageWindow UI accordingly.
This will allow a user to edit her earlier rating for a given package.
The button labels will need to be adjusted. Uploading a rating still not
implemented.
2014-09-28 14:53:10 +02:00
Stephan Aßmus 3cc6e28126 HaikuDepot: Remember PackageInfoRef in PackageInfoView
* Added getter
2014-09-28 14:53:09 +02:00
Stephan Aßmus 8f331d41fa HaikuDepot: Removed invalid TODO from UserLoginWindow 2014-09-28 14:53:08 +02:00
Stephan Aßmus 054139a2d4 HaikuDepot: Get existing rating from a user for a package 2014-09-28 14:53:06 +02:00
Stephan Aßmus 8f03a0f9f2 HaikuDepot: Restore logged in user across sessions.
* Store the username in the app settings. The password was already stored
   in the keyring. Restore the username upon next launch.
 * Display the logged in user in the main window.
 * Added "Log out" menu entry.
 * When the password could not be retrieved from the keyring (also because
   the user rejects the keyring dialog), unset the username.
 * Allow unsetting the username by passing an empty name.
2014-09-28 00:33:20 +02:00
Stephan Aßmus 3e3d0effdc HaikuDepot: Limit language selection for account creation
For the time being, there is a limited amount of supported languages
when creating accounts, reflect this in the UI and use a BMenuField.
Creating accounts with other languages fails, the error reporting was
not ideal and could be improved. The server responded with "object not found",
which was reported in the alert, but the response actually contains the
object which was not found (NaturalLanguageCode).
2014-09-28 00:29:50 +02:00
Stephan Aßmus 83f46c7198 HaikuDepot: Handle BMessage for rating comment language 2014-09-27 23:11:41 +02:00
Stephan Aßmus da504dbcce HaikuDepot: Allow to set the rating comment's language. 2014-09-27 23:09:45 +02:00
Stephan Aßmus 4ff3d17ae8 HaikuDepot: Put supported languages into a StringList
* Added TODO to retrieve the list from the web-app, there is already an
  API for it. For now, the hard-coded list matches the web-app's and the
  next change in this regard will be to support any known language.
* Make the list accessible.
2014-09-27 23:07:39 +02:00
Stephan Aßmus 6bede507a9 HaikuDepot: Define StringList type for convenience. 2014-09-27 23:07:05 +02:00
Stephan Aßmus c28b83041e HaikuDepot: Add actual rating to RatePackageWindow.
Implemented SetRatingView based on RatingView. It previews the rating
when hovering and makes it permanent when clicked.
2014-09-27 22:46:33 +02:00
Stephan Aßmus 63269a60e4 HaikuDepot: Allow RatingView to be wider than MinSize(). 2014-09-27 22:45:58 +02:00
Stephan Aßmus 823d2b88e9 HaikuDepot: Split generic and specific UI classes
* Also fixed placement of PackageManager which I must have
  dropped into the wrong folder by accident.
2014-09-27 22:03:10 +02:00
Stephan Aßmus 04c9d578d8 HaikuDepot: Organized source into sub-folders 2014-09-27 21:37:38 +02:00
Stephan Aßmus 2e19e8fc63 HaikuDepot: Extracted SharedBitmap into its own files 2014-09-27 21:28:54 +02:00
Stephan Aßmus 11d170047e HaikuDepot: Exract RatingView into its own source and header 2014-09-27 21:12:26 +02:00
Stephan Aßmus 91778eaa81 HaikuDepot: Added Cancel button to rating window.
Also, no need to have the Send button as a class member.
2014-09-26 21:47:28 +02:00
Stephan Aßmus 5c4c4e2ec6 HaikuDepot: UI for selecting a stability rating...
... in the rating window. Not functional.
2014-09-26 21:47:26 +02:00
Stephan Aßmus 967a281831 HaikuDepot: Definition for stability rating 2014-09-26 21:47:23 +02:00
Stephan Aßmus 12f29d4441 HaikuDepot: Force preferred language to be supported
At the moment, the web-app has a defined, limited set of supported languages
for translations. JSON requests fail when asking for an unsupported language
code. For the time being, force the language code to be in the supported set.
2014-09-24 21:26:48 +02:00
Stephan Aßmus 89ec84a4cb HaikuDepot: Some usage of the BKeyStore API
... completely untested and premature. The idea is that after a successful
login with the web-app, the password used is stored in the keyring. Then
HaikuDepot will restore just last the used username on next launch and retrieve
the password from the keyring. One could also register multiple accounts in
HaikuDepot and switch between them.
2014-09-24 21:26:46 +02:00
Stephan Aßmus 36171a48e7 HaikuDepot: Only authorize requests where needed.
No requests are implemented yet which need to identify a user (such as rating
a package).
2014-09-21 00:17:25 +02:00
Stephan Aßmus 28075ee427 HaikuDepot: Implemented logging into haiku-depot-server
UserLoginWindow:
 * Focus nickname text field on tab switches
 * Implement testing the login info, the web-app replies with a token, if
   valid. It could be used for Token Bearer authorization of requests, but
   this is not used yet. Instead the username and password are set on the
   Model. Also after creating a new account successfully.
Model:
 * Use a member instance of WebAppInterface. Set the preferred language
   and the login-info only once.
2014-09-21 00:09:17 +02:00
Stephan Aßmus 9be707603f HaikuDepot: Implemented creating web-app user accounts
The accounts are created for real, but the information is not yet stored.
Nothing which would need it is currently implemented, like rating packages.
It is recommended to create accounts with a valid email address. Otherwise
the password cannot be reset, and it will need to be soon, since there
is a small change to the password storage in the pipe.

The error response from the service is parsed and presented
to the user, when the account could not be created. However, other checks
before contacting the server are not performed, like if the two passphrases
actually match.

The UserLoginWindow now has the concept of a running worker thread, and
while it runs, the UI controls (except Cancel) are disabled.
2014-09-20 01:35:45 +02:00
Stephan Aßmus dfee849828 HaikuDepot: Added WebAppInterface::CreateUser() 2014-09-20 01:35:42 +02:00
Stephan Aßmus a067756a29 HaikuDepot: Get captcha image in UserLoginWindow 2014-09-20 01:35:40 +02:00
Stephan Aßmus d07ca0696d HaikuDepot::Model: Set preferred language earlier
Added accessor for preferred language.
2014-09-20 01:35:38 +02:00
Stephan Aßmus fe6f67b410 HaikuDepot: Added captcha request to WebAppInterface
Also removed some disabled debug output.
2014-09-20 01:35:35 +02:00
Stephan Aßmus d6bd3409e5 HaikuDepot: Don't right-align publisher/copyright...
... in the available space in the package title area. Just looks too random.
2014-09-18 22:39:45 +02:00
Stephan Aßmus 81c000dd0d HaikuDepot: Add "Log in" menu item which shows new window 2014-09-18 22:39:43 +02:00
Stephan Aßmus 700a71bdb8 HaikuDepot: WIP interface for logging in...
... or creating a new account in the web application. Just the interface,
nothing is functional, yet.
2014-09-18 22:39:41 +02:00
Stephan Aßmus 4f4f859c1a HaikuDepot: Small code cleanups in PackageInfo. 2014-09-18 22:39:38 +02:00
Stephan Aßmus e0881f2139 HaikuDepot: Fixed reading bigger screenshots
* Increase the RAM limit to 128K per screenshot
 * Reduce retrieved size to 320 pixel wide
 * Don't expect to be able to read the stream in one call,
   read it in 4K chunks.
 * Print some errors in this code-path to stderr.
2014-09-13 23:03:58 +02:00
Stephan Aßmus ab172803ff HaikuDepot: Improve filter UI, fix pkg translations
* The categories and other filter options are orthogonal. Don't
   force the user to choose between real categories and for example
   "installed" or "available" in the same drop-down. I've removed
   (for now) the Options main menu. There are now four small check-marks
   below the filtering drop-downs: Available, Installed, Development and
   Source Code. These enable showing the respective packages in the list
   view. Only "Available" is checked by default. This changes the default
   behavior to show only not-yet-installed packages. This change puts
   the filtering options in one place, the showing of development or
   source code packages is not "hidden somewhere else" anymore. I am not
   so happy with the additional row, however, I am also thinking about
   using icons instead of the checkmarks.
 * Fixed finding the suitable package translation for summary and
   description. For example, WonderBrush now has a German translation.
2014-09-13 23:03:56 +02:00
Stephan Aßmus 36a9b55716 HaikuDepot: Rating related fixes.
* Fixed retrieving rating summary for the list view.
 * Rating and command are optional in the web app (or probably you need
   to specify at least one of them). Handle ratings with just the comment
   but no rating in average calculation.
2014-09-08 22:50:29 +02:00
Stephan Aßmus 7e7ec8f3a9 PackageInfo: Small coding-style cleanup. 2014-09-08 22:50:28 +02:00
Stephan Aßmus 7eb09bfa29 HaikuDepot: Make sure lists are cleared...
... in case the code runs multiple times for the same package-ref.
(Did not happen, but it's just better form.)
2014-09-05 23:23:27 +02:00
Stephan Aßmus 863f0b1979 HaikuDepot/List: added IsEmpty() method 2014-09-05 23:23:00 +02:00