Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
08a8ca10
Commit
08a8ca10
authored
May 31, 2008
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put PackageUpdateList into its own file
parent
e809c95a
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
427 additions
and
362 deletions
+427
-362
src/data/installer.cpp
src/data/installer.cpp
+4
-4
src/data/installer.hpp
src/data/installer.hpp
+11
-3
src/gui/package_update_list.cpp
src/gui/package_update_list.cpp
+298
-0
src/gui/package_update_list.hpp
src/gui/package_update_list.hpp
+80
-0
src/gui/packages_window.cpp
src/gui/packages_window.cpp
+3
-340
src/gui/packages_window.hpp
src/gui/packages_window.hpp
+7
-1
src/mse.vcproj
src/mse.vcproj
+22
-12
src/util/io/package_manager.cpp
src/util/io/package_manager.cpp
+2
-2
No files found.
src/data/installer.cpp
View file @
08a8ca10
...
@@ -254,9 +254,9 @@ DownloadableInstaller::~DownloadableInstaller() {
...
@@ -254,9 +254,9 @@ DownloadableInstaller::~DownloadableInstaller() {
// ----------------------------------------------------------------------------- : Installable package
// ----------------------------------------------------------------------------- : Installable package
InstallablePackage
::
InstallablePackage
(
const
Package
VersionP
&
installed
,
const
PackageDescriptionP
&
description
)
InstallablePackage
::
InstallablePackage
(
const
Package
DescriptionP
&
description
,
const
PackageVersionP
&
installed
)
:
installed
(
installed
)
:
description
(
description
)
,
description
(
description
)
,
installed
(
installed
)
,
status
(
PACKAGE_INSTALLED
)
,
status
(
PACKAGE_INSTALLED
)
,
action
(
PACKAGE_NOTHING
)
,
action
(
PACKAGE_NOTHING
)
{}
{}
...
@@ -586,5 +586,5 @@ InstallablePackageP mse_installable_package() {
...
@@ -586,5 +586,5 @@ InstallablePackageP mse_installable_package() {
mse_description
->
position_hint
=
-
100
;
mse_description
->
position_hint
=
-
100
;
mse_description
->
icon
=
load_resource_image
(
_
(
"installer_program"
));
mse_description
->
icon
=
load_resource_image
(
_
(
"installer_program"
));
//mse_description->description = _LABEL_("magic set editor package");
//mse_description->description = _LABEL_("magic set editor package");
return
new_intrusive2
<
InstallablePackage
>
(
mse_
version
,
mse_descript
ion
);
return
new_intrusive2
<
InstallablePackage
>
(
mse_
description
,
mse_vers
ion
);
}
}
src/data/installer.hpp
View file @
08a8ca10
...
@@ -18,6 +18,13 @@ DECLARE_POINTER_TYPE(PackageDescription);
...
@@ -18,6 +18,13 @@ DECLARE_POINTER_TYPE(PackageDescription);
DECLARE_POINTER_TYPE
(
DownloadableInstaller
);
DECLARE_POINTER_TYPE
(
DownloadableInstaller
);
DECLARE_POINTER_TYPE
(
InstallablePackage
);
DECLARE_POINTER_TYPE
(
InstallablePackage
);
// The installer system consists of several layers:
// - Installer = an actual package available in memory, containing packages to be installed
// - DownloadableInstaller = an installar (possibly) not yet available, i.e. just its URL
// - PackageDescription = description of a package version
// - InstallablePackage = the complete status of a package, both local and remote
// ----------------------------------------------------------------------------- : Installer
// ----------------------------------------------------------------------------- : Installer
/// A package that contains other packages that can be installed
/// A package that contains other packages that can be installed
...
@@ -125,12 +132,13 @@ inline bool flag(int flags, int flag) { return (flags & flag) == flag; }
...
@@ -125,12 +132,13 @@ inline bool flag(int flags, int flag) { return (flags & flag) == flag; }
/// A package that can be installed, or is already installed
/// A package that can be installed, or is already installed
class
InstallablePackage
:
public
IntrusivePtrVirtualBase
{
class
InstallablePackage
:
public
IntrusivePtrVirtualBase
{
public:
public:
//
InstallablePackage();
//
/ A new package
InstallablePackage
(
const
PackageDescriptionP
&
,
const
DownloadableInstallerP
&
);
InstallablePackage
(
const
PackageDescriptionP
&
,
const
DownloadableInstallerP
&
);
InstallablePackage
(
const
PackageVersionP
&
,
const
PackageDescriptionP
&
);
/// An installed package
InstallablePackage
(
const
PackageDescriptionP
&
,
const
PackageVersionP
&
);
PackageVersionP
installed
;
///< The information of the installed package (if installed)
PackageDescriptionP
description
;
///< The details of the package. Either from the installed package or from an installer
PackageDescriptionP
description
;
///< The details of the package. Either from the installed package or from an installer
PackageVersionP
installed
;
///< The information of the installed package (if installed)
DownloadableInstallerP
installer
;
///< The installer to install from (if updates are available)
DownloadableInstallerP
installer
;
///< The installer to install from (if updates are available)
PackageStatus
status
;
///< Status of installation
PackageStatus
status
;
///< Status of installation
PackageAction
action
;
///< What to do with this package?
PackageAction
action
;
///< What to do with this package?
...
...
src/gui/package_update_list.cpp
0 → 100644
View file @
08a8ca10
This diff is collapsed.
Click to expand it.
src/gui/package_update_list.hpp
0 → 100644
View file @
08a8ca10
//+----------------------------------------------------------------------------+
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
//| Copyright: (C) 2001 - 2008 Twan van Laarhoven and "coppro" |
//| License: GNU General Public License 2 or later (see file COPYING) |
//+----------------------------------------------------------------------------+
#ifndef HEADER_GUI_PACKAGE_UPDATE_LIST
#define HEADER_GUI_PACKAGE_UPDATE_LIST
// ----------------------------------------------------------------------------- : Includes
#include <util/prec.hpp>
#include <gui/control/tree_list.hpp>
#include <data/installer.hpp>
// ----------------------------------------------------------------------------- : PackageUpdateList
/// A list of installed and downloadable packages
class
PackageUpdateList
:
public
TreeList
{
public:
PackageUpdateList
(
Window
*
parent
,
const
InstallablePackages
&
packages
,
int
id
=
wxID_ANY
);
~
PackageUpdateList
();
inline
InstallablePackageP
getSelection
()
const
{
return
selection
==
NOTHING
?
InstallablePackageP
()
:
get
(
selection
);
}
inline
InstallablePackageP
get
(
size_t
item
)
const
{
return
static_pointer_cast
<
TreeItem
>
(
items
[
item
])
->
package
;
}
protected:
// overridden methods from TreeList
virtual
void
initItems
();
virtual
void
drawItem
(
DC
&
dc
,
size_t
index
,
size_t
column
,
int
x
,
int
y
,
bool
selected
)
const
;
virtual
size_t
columnCount
()
const
{
return
3
;
}
virtual
String
columnText
(
size_t
column
)
const
;
virtual
int
columnWidth
(
size_t
column
)
const
;
private:
const
InstallablePackages
&
packages
;
class
TreeItem
;
public:
typedef
intrusive_ptr
<
TreeItem
>
TreeItemP
;
private:
class
TreeItem
:
public
Item
{
public:
TreeItem
()
:
position_type
(
TYPE_OTHER
),
position_hint
(
1000000
)
{}
String
label
;
vector
<
TreeItemP
>
children
;
InstallablePackageP
package
;
Bitmap
icon
,
icon_grey
;
// positioning
enum
PackageType
{
TYPE_PROG
,
TYPE_LOCALE
,
TYPE_GAME
,
TYPE_STYLESHEET
,
TYPE_EXPORT_TEMPLATE
,
TYPE_SYMBOL_FONT
,
TYPE_INCLUDE
,
TYPE_FONT
,
TYPE_OTHER
,
}
position_type
;
int
position_hint
;
void
add
(
const
InstallablePackageP
&
package
,
const
String
&
path
,
int
level
=
-
1
);
void
toItems
(
vector
<
TreeList
::
ItemP
>&
items
);
void
setIcon
(
const
Image
&
image
);
bool
highlight
()
const
;
static
PackageType
package_type
(
const
PackageDescription
&
desc
);
};
friend
class
PackageIconRequest
;
};
// ----------------------------------------------------------------------------- : EOF
#endif
src/gui/packages_window.cpp
View file @
08a8ca10
This diff is collapsed.
Click to expand it.
src/gui/packages_window.hpp
View file @
08a8ca10
...
@@ -20,9 +20,13 @@ class PackageInfoPanel;
...
@@ -20,9 +20,13 @@ class PackageInfoPanel;
/// A window that displays the installed packages and updates to them
/// A window that displays the installed packages and updates to them
class
PackagesWindow
:
public
wxDialog
{
class
PackagesWindow
:
public
wxDialog
{
public:
public:
/// Show the packages window, optionally downloading the package database from the website
PackagesWindow
(
Window
*
parent
,
bool
download_package_list
=
true
);
PackagesWindow
(
Window
*
parent
,
bool
download_package_list
=
true
);
/// Show the packages window for an installer
PackagesWindow
(
Window
*
parent
,
const
InstallerP
&
installer
);
~
PackagesWindow
();
~
PackagesWindow
();
/// List of the packages shown in this window
InstallablePackages
installable_packages
;
InstallablePackages
installable_packages
;
private:
private:
...
@@ -42,6 +46,8 @@ class PackagesWindow : public wxDialog {
...
@@ -42,6 +46,8 @@ class PackagesWindow : public wxDialog {
void
onUpdateUI
(
wxUpdateUIEvent
&
);
void
onUpdateUI
(
wxUpdateUIEvent
&
);
void
onIdle
(
wxIdleEvent
&
);
void
onIdle
(
wxIdleEvent
&
);
/// Check whether we have downloaded the list of installers
/** If the download is (partially) complete, update the installable_packages list */
bool
checkInstallerList
(
bool
refresh
=
true
);
bool
checkInstallerList
(
bool
refresh
=
true
);
};
};
...
...
src/mse.vcproj
View file @
08a8ca10
...
@@ -1000,12 +1000,6 @@
...
@@ -1000,12 +1000,6 @@
<File
<File
RelativePath=
".\gui\new_window.hpp"
>
RelativePath=
".\gui\new_window.hpp"
>
</File>
</File>
<File
RelativePath=
".\gui\packages_window.cpp"
>
</File>
<File
RelativePath=
".\gui\packages_window.hpp"
>
</File>
<File
<File
RelativePath=
".\gui\preferences_window.cpp"
>
RelativePath=
".\gui\preferences_window.cpp"
>
</File>
</File>
...
@@ -1024,18 +1018,34 @@
...
@@ -1024,18 +1018,34 @@
<File
<File
RelativePath=
".\gui\thumbnail_thread.hpp"
>
RelativePath=
".\gui\thumbnail_thread.hpp"
>
</File>
</File>
<File
RelativePath=
".\gui\update_checker.cpp"
>
</File>
<File
RelativePath=
".\gui\update_checker.hpp"
>
</File>
<File
<File
RelativePath=
".\gui\welcome_window.cpp"
>
RelativePath=
".\gui\welcome_window.cpp"
>
</File>
</File>
<File
<File
RelativePath=
".\gui\welcome_window.hpp"
>
RelativePath=
".\gui\welcome_window.hpp"
>
</File>
</File>
<Filter
Name=
"package"
Filter=
""
>
<File
RelativePath=
".\gui\package_update_list.cpp"
>
</File>
<File
RelativePath=
".\gui\package_update_list.hpp"
>
</File>
<File
RelativePath=
".\gui\packages_window.cpp"
>
</File>
<File
RelativePath=
".\gui\packages_window.hpp"
>
</File>
<File
RelativePath=
".\gui\update_checker.cpp"
>
</File>
<File
RelativePath=
".\gui\update_checker.hpp"
>
</File>
</Filter>
</Filter>
</Filter>
<Filter
<Filter
Name=
"value"
Name=
"value"
...
...
src/util/io/package_manager.cpp
View file @
08a8ca10
...
@@ -234,7 +234,7 @@ void PackageDirectory::installedPackages(vector<InstallablePackageP>& packages_o
...
@@ -234,7 +234,7 @@ void PackageDirectory::installedPackages(vector<InstallablePackageP>& packages_o
PackageVersionP
ver
(
new
PackageVersion
(
PackageVersionP
ver
(
new
PackageVersion
(
is_local
?
PackageVersion
::
STATUS_LOCAL
:
PackageVersion
::
STATUS_GLOBAL
));
is_local
?
PackageVersion
::
STATUS_LOCAL
:
PackageVersion
::
STATUS_GLOBAL
));
ver
->
check_status
(
*
pack
);
ver
->
check_status
(
*
pack
);
packages_out
.
push_back
(
new_intrusive2
<
InstallablePackage
>
(
ver
,
new_intrusive1
<
PackageDescription
>
(
*
pack
)
));
packages_out
.
push_back
(
new_intrusive2
<
InstallablePackage
>
(
new_intrusive1
<
PackageDescription
>
(
*
pack
),
ver
));
}
catch
(
const
Error
&
)
{}
}
catch
(
const
Error
&
)
{}
++
it2
;
++
it2
;
}
else
if
((
*
it1
)
->
name
<
*
it2
)
{
}
else
if
((
*
it1
)
->
name
<
*
it2
)
{
...
@@ -246,7 +246,7 @@ void PackageDirectory::installedPackages(vector<InstallablePackageP>& packages_o
...
@@ -246,7 +246,7 @@ void PackageDirectory::installedPackages(vector<InstallablePackageP>& packages_o
try
{
try
{
PackagedP
pack
=
::
packages
.
openAny
(
*
it2
,
true
);
PackagedP
pack
=
::
packages
.
openAny
(
*
it2
,
true
);
(
*
it1
)
->
check_status
(
*
pack
);
(
*
it1
)
->
check_status
(
*
pack
);
packages_out
.
push_back
(
new_intrusive2
<
InstallablePackage
>
(
*
it1
,
new_intrusive1
<
PackageDescription
>
(
*
pack
)
));
packages_out
.
push_back
(
new_intrusive2
<
InstallablePackage
>
(
new_intrusive1
<
PackageDescription
>
(
*
pack
),
*
it1
));
}
catch
(
const
Error
&
)
{
db_changed
=
true
;
}
}
catch
(
const
Error
&
)
{
db_changed
=
true
;
}
++
it1
,
++
it2
;
++
it1
,
++
it2
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment