2 * Copyright 2017 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
8 #ifndef REPOSITORIES_VIEW_H
9 #define REPOSITORIES_VIEW_H
12 #include <ColumnListView.h>
13 #include <GroupView.h>
15 #include <StringView.h>
18 #include "RepositoriesSettings.h"
20 #include "TaskLooper.h"
23 class RepositoriesListView
: public BColumnListView
{
25 RepositoriesListView(const char* name
);
26 virtual void KeyDown(const char* bytes
, int32 numBytes
);
30 class RepositoriesView
: public BGroupView
{
34 virtual void AllAttached();
35 virtual void AttachedToWindow();
36 virtual void MessageReceived(BMessage
*);
37 void AddManualRepository(BString url
);
38 bool IsTaskRunning() { return fRunningTaskCount
> 0; }
42 void _AddSelectedRowsToQueue();
43 void _TaskStarted(RepoRow
* rowItem
, int16 count
);
44 void _TaskCompleted(RepoRow
* rowItem
, int16 count
,
46 void _TaskCanceled(RepoRow
* rowItem
, int16 count
);
47 void _ShowCompletedStatusIfDone();
48 void _UpdateFromRepoConfig(RepoRow
* rowItem
);
51 status_t
_EmptyList();
54 void _UpdateListFromRoster();
56 RepoRow
* _AddRepo(BString name
, BString url
, bool enabled
);
58 void _UpdateButtons();
59 void _UpdateStatusView();
61 RepositoriesSettings fSettings
;
62 RepositoriesListView
* fListView
;
63 BView
* fStatusContainerView
;
64 BStringView
* fListStatusView
;
65 TaskLooper
* fTaskLooper
;
66 bool fShowCompletedStatus
;
67 int fRunningTaskCount
, fLastCompletedTimerId
;
69 BButton
* fRemoveButton
;
70 BButton
* fEnableButton
;
71 BButton
* fDisableButton
;