2 * Copyright 2017 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
12 #include <ColumnTypes.h>
14 #include "constants.h"
17 RepoRow::RepoRow(const char* repo_name
, const char* repo_url
, bool enabled
)
23 fTaskState(STATE_NOT_IN_QUEUE
)
25 SetField(new BStringField(""), kEnabledColumn
);
26 SetField(new BStringField(fName
.String()), kNameColumn
);
27 SetField(new BStringField(fUrl
.String()), kUrlColumn
);
34 RepoRow::SetName(const char* name
)
36 BStringField
* field
= (BStringField
*)GetField(kNameColumn
);
37 field
->SetString(name
);
44 RepoRow::SetEnabled(bool enabled
)
47 RefreshEnabledField();
52 RepoRow::RefreshEnabledField()
54 BStringField
* field
= (BStringField
*)GetField(kEnabledColumn
);
55 if (fTaskState
== STATE_NOT_IN_QUEUE
)
56 field
->SetString(fEnabled
? B_TRANSLATE("Enabled") : "");
58 field
->SetString(B_UTF8_ELLIPSIS
);
64 RepoRow::SetTaskState(uint32 state
)
67 RefreshEnabledField();