2 * Copyright 2013, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
5 #ifndef PROBLEM_WINDOW_H
6 #define PROBLEM_WINDOW_H
15 namespace BPackageKit
{
19 class BSolverProblemSolution
;
20 class BSolverProblemSolutionElement
;
23 using BPackageKit::BSolver
;
24 using BPackageKit::BSolverPackage
;
25 using BPackageKit::BSolverProblem
;
26 using BPackageKit::BSolverProblemSolution
;
27 using BPackageKit::BSolverProblemSolutionElement
;
34 class ProblemWindow
: public BWindow
{
36 typedef std::set
<BSolverPackage
*> SolverPackageSet
;
40 virtual ~ProblemWindow();
42 bool Go(BSolver
* solver
,
43 const SolverPackageSet
& packagesAddedByUser
,
44 const SolverPackageSet
&
45 packagesRemovedByUser
);
47 virtual bool QuitRequested();
48 virtual void MessageReceived(BMessage
* message
);
53 typedef std::map
<BRadioButton
*, Solution
> SolutionMap
;
56 void _ClearProblemsGui();
57 void _AddProblemsGui(BSolver
* solver
);
58 void _AddProblem(BSolverProblem
* problem
,
59 const float backgroundTint
);
60 BString
_SolutionElementText(
61 const BSolverProblemSolutionElement
*
63 bool _AnySolutionSelected() const;
66 sem_id fDoneSemaphore
;
69 BGroupView
* fContainerView
;
70 BButton
* fCancelButton
;
71 BButton
* fRetryButton
;
72 SolutionMap fSolutions
;
73 const SolverPackageSet
* fPackagesAddedByUser
;
74 const SolverPackageSet
* fPackagesRemovedByUser
;
78 #endif // PROBLEM_WINDOW_H