20272 Commits

Author SHA1 Message Date
Ignacio R. Morelle
1b936b436c addon/mg: Update dependency prompt list format to match the Add-ons Manager 2012-05-21 00:57:43 +00:00
Ignacio R. Morelle
ee5501ee34 Add utils::ellipsis_truncate() function 2012-05-21 00:48:07 +00:00
J. Tyne
597fcf49d7 Stop sending invalid actions between the redo and undo stacks.
If an action could not be undone, it makes no sense to "redo" it, and
vice-versa.

(In particular, certain movement undos produce a message stating
"Possible abuse of [allow_undo]" without crashing, but then redoing
that move caused an assertion failure before this change.)
2012-05-20 21:56:37 +00:00
Ignacio R. Morelle
28b20f8aaf addon/mg: New add-on installation prompt for add-ons with VCS/.pbl files
Until now there was only a single, verbose prompt for the .pbl case.
Since people may use a VCS to contribute to an add-on without having a
.pbl file, that case is also now covered by this commit.

There's a single prompt with a list of sensible content that might be
"permanently lost" on installation. The list may contain VCS or .pbl
files for now, but perhaps at some point in the future someone might
want to make it into a full list of extra files or something.
2012-05-20 21:37:17 +00:00
Ignacio R. Morelle
e0e55682c0 addon/mg: Consider local untracked add-ons as installed for the main list...
...and elaborate on their state in gui2::taddon_description instead

This means they get both the "Installed" (or "Published") line, and the
green highlight. gui2::taddon_description displays their detailed status
as "not tracking local version". This approach seems sensible since we
have limited space for the status line in the GUI1 Add-ons Manager
dialog.

As a side effect there's a hypothetical "Unknown" status line that's
only there to keep gcc 4.7 happy.
2012-05-20 20:42:55 +00:00
Ignacio R. Morelle
2b85532aef addon/mg: Greatly simplify describe_addon_status() 2012-05-20 20:42:31 +00:00
Mark de Wever
3912e88b54 Remove some unneeded headers. 2012-05-20 19:19:32 +00:00
Mark de Wever
6eb1781c80 Remove some unneeded headers. 2012-05-20 19:19:29 +00:00
Ignacio R. Morelle
109b644f5b addon/mg: Merge get_addon_status_gui1_color_markup()...
...into describe_addon_status()

Also moved describe_addon_status() around so it can be used for the
dependency prompt dialog later as well.
2012-05-20 18:38:18 +00:00
Anonymissimus
6b56c96ab0 mute MSVC warnings C4099 and disable them globally
according to mordante's suggestion
2012-05-20 16:30:10 +00:00
Mark de Wever
202e833210 Replace tconst_duplicator with tconst_clone.
Both did about the same, so removed one of them.
2012-05-20 14:00:17 +00:00
Mark de Wever
cbc0cf5827 Move the enumerate file to utils.
Seems to fit better in that directory.
Also set the properties of the new file.
2012-05-20 13:50:25 +00:00
Mark de Wever
50bc28dedb Add some logging when a WML child is not found.
This happens rather often in valid code as well, so make it debug
messages. But at least in debug mode it's possible to get more
information regarding the missing child.
2012-05-20 09:56:20 +00:00
Mark de Wever
eb165d1885 Allow better error messages for missing children.
The caller's code still need to be changed but at least gives the option
to create better error messages.
2012-05-20 09:56:17 +00:00
Mark de Wever
9ebb260d01 Add config::has_child().
This allows to easily query whether a certain child exists.
2012-05-20 09:56:13 +00:00
Mark de Wever
018ff27c62 Fixes a GCC warning in a better way.
It replaces 2012-05-19T21:30:22Z!shadowm@wesnoth.org. It also adds a generic warning for unreachable code.
2012-05-20 09:56:10 +00:00
Mark de Wever
0ef2b762ef Add clang 3.0 compiler fixes.
The clang compiler was not happy with the uages of the enumerate stream
operator macros. This minor change makes clang happy again.
2012-05-20 09:56:07 +00:00
Mark de Wever
cefb8ee330 Add hint for the compiler that FAIL is a failure.
In some contexts the compiler may warn since the wml_exception has no
attribute indicating it will never return. The answer is throwing a
dummy exception.
2012-05-20 09:56:05 +00:00
Mark de Wever
4ed714ea78 Move tconst_clone to its own file.
This allows code outside of the gui code to use it as well.
2012-05-20 09:26:19 +00:00
Ignacio R. Morelle
f4e5f7b1da addon/mg: Improve display of long add-on titles and authors in the main list
* Long titles now can get word-wrapped up to a limit of two lines (after
   which they are truncated). This allows to display "Invasion from the
   Unknown" at 800x480 without truncating it at "Un" (20 characters).
   The horizontal limit for word-wrapping is 150 pixels.

 * Author names are now truncated at 14 characters instead of 16, adding
   an ellipsis if necessary to suggest the possibility of reading the
   full name elsewhere (in this case, in the Description window).
2012-05-19 23:03:49 +00:00
Ignacio R. Morelle
c5b9288dda addon/mg: Include add-on status lines below their titles in the add-ons list
This replaces the previous color-keyed items approach with color-keyed
status lines, as well.

Additionally, tweaked the color-keying logic.
2012-05-19 21:30:59 +00:00
Ignacio R. Morelle
c5c5993e1f gui2: Prevent "control reaches end of non-void function" warning on gcc 4.7
This is a quick fix and mordante should review it later.

gcc 4.7 doesn't seem to be happy with gui2::tplacer_::build()'s switch
statement and appears to expect more cases despite
gui2::tplacer_::tgrow_direction doesn't have more members. The warning
in question:

  src/gui/auxiliary/placer.cpp:43:1: error: control reaches end of non-void function [-Werror=return-type]
2012-05-19 21:30:22 +00:00
Ignacio R. Morelle
e7756f5766 gui2/taddon_description: "Outdated in the server" -> "Outdated on server" 2012-05-19 20:33:42 +00:00
Ignacio R. Morelle
eff649a7cf gui2/taddon_description: Tweak status lines for Published add-ons
Instead of displaying just "Published" for a published add-on regardless
of whether it is installed or not, display "Published, not installed"
when it isn't. This is a rarer situation than a published add-on being
installed, hence we don't need a "Published, installed" status line.
2012-05-19 20:33:22 +00:00
Mark de Wever
72126809c1 Use the new tplacer_ class in the pane.
Used for both placement and size. The value is hard-coded at the moment,
but other settings have been tested.

The code is used to experiment with a different approach of the
implementation of a listbox.
2012-05-19 20:33:10 +00:00
Mark de Wever
3c66f576d4 Adds helper code to assist in widget placement.
The code is used to experiment with a different approach of the
implementation of a listbox.
2012-05-19 20:06:35 +00:00
Mark de Wever
2d9f94398d Adds code for writing enumerate stream operators.
The code has been copy-pasted from another project I've been working on, with
some minor adaptions to compile with Wesnoth:

- Removed dependency on C++11 and use the support in boost instead.

- Changed the error reporting to use the Wesnoth code.
2012-05-19 20:02:59 +00:00
Ignacio R. Morelle
4282b64c43 Remove declaration of an external that isn't defined anywhere 2012-05-19 20:01:40 +00:00
Mark de Wever
cd5bc7f11a Added FAIL and FAIL_WITH_DEV_MESSAGE macros.
These macros allow to throw an wml_exception without any condition. This
can be used when a code path is reached that should be unreachable with
valid WML.
2012-05-19 19:35:44 +00:00
Fabian Müller
050cff18a7 patch #3270 Fix for bug #19120 2012-05-19 15:57:33 +00:00
Silas Brill
653fa89d7a Made unit_mover and animation_unit_placer inherit from boost::noncopyable 2012-05-19 10:50:42 +00:00
Ignacio R. Morelle
36e9fd78cc addon/mg: Horrible, horrible hack to ensure the add-ons list (GUI1)...
...is naturally sorted by titles rather than case-sensitive ids

This is quite a hack and it's only here in case I don't figure out a
better solution later before 1.11.0 (or get hit by a truck). It works
and that's all that matters here nowadays, anyway.

The problem this solves is basically the following:

 * The internal add-ons list is sorted by id (case-sensitively)

 * The add-ons list in GUI1 is unsorted by default, following the row
   insertion order

 * The row insertion order is that of the internal add-ons list iterator order

 * Sorting rows by title isn't possible because of the Publish/Delete entries

 * Many add-ons have titles that don't reflect their ids at all, not to
   mention that users obviously would prefer case-insensitive sorting.

A quite better solution would be to have the add-ons list take care of
all this by itself, but I haven't figured out a way yet short of
implementing a whole custom class for it (which could actually turn out
to be more efficient by getting rid of the id duplication) with
specialized iterators.
2012-05-19 10:44:14 +00:00
Ignacio R. Morelle
feceecb5e2 addon/client: Mark addons_client class as noncopyable 2012-05-19 09:13:41 +00:00
Ignacio R. Morelle
64a34fb5b7 addon/info: Remove trivial copy constructor, make remaining single-argument constructor explicit 2012-05-19 09:13:28 +00:00
Mark de Wever
283653b31b Fix a bug in the new tcontrol constructor.
The constructor called a virtual function in it's constructor, which is
not a good idea, even worse it was pure virtual in the control class.
2012-05-19 08:46:20 +00:00
Mark de Wever
77e6286c0a Let the tcontrol use the new twidget constructor. 2012-05-19 08:46:17 +00:00
Mark de Wever
ff08f9dd5b Add a second constructor for twidget.
This constructor takes a builder object to do its building.
2012-05-19 08:46:15 +00:00
Mark de Wever
b734f7bf0e Made the id for a tooltip and helptip mandatory.
The change was already planned for 1.9.7.
2012-05-19 08:46:12 +00:00
Mark de Wever
8814152e92 Move the widget fields to the widget class.
Some fields of the tbuilder_control are actually part of the twidget
class. These are now moved to the tbuilder_widget.

Some of these fields were also used in the tbuilder_grid and are moved
likewise. This means the tbuilder_grid now has some extra fields for
debugging. (`Inherited' from the tbuilder_control.)
2012-05-19 08:46:07 +00:00
Mark de Wever
b5abdaf520 Remove the unused tbuilder_gridcell class. 2012-05-19 07:17:14 +00:00
Alexander van Gessel
4d0e232a03 Revert "Made turn refresh (healing, poison, etc.) occur...
...on first turn of game"

This reverts commit 2012-04-24T02:55:45Z!brilliand@gmail.com.
2012-05-18 22:45:50 +01:00
Ignacio R. Morelle
bdbd6150c2 gui1, gui2: Rename "Reselect difficulty" option to "Change difficulty"
This affects both internal ids and symbols and translatable strings.
2012-05-18 20:11:11 +00:00
Anonymissimus
e3249b12ef let play_controller::player_number_ have the last side's side_number
after the loop over the sides' turns. (fix for bug #19735)
2012-05-17 20:07:06 +00:00
Anonymissimus
ffbac7f0c8 add an assert (bug #19735)
to ensure we notice out-of-bounds access
2012-05-17 20:06:54 +00:00
Mark de Wever
3abebe12f3 Add a second constructor to tcontrol.
This constructor sets its state based on the structure send to it
instead of using a second call that sets the fields later.

The code is used to experiment with a different approach of the
implementation of a listbox.
2012-05-17 16:22:00 +00:00
Mark de Wever
75757e52e1 Add an ifdef to tcontrol::init().
It is only used in GUI2_EXPERIMENTAL_LISTBOX context and will probably
be replaced with another way to initialise objects. So comment it out
for now.
2012-05-17 16:21:56 +00:00
Mark de Wever
994453967e Made load_config a non virtual function.
It was defined virtual in twidget but only overriden in tcontrol. So
added it there as a non-virtual function.

Also made it private since most code doesn't really use the function and
that part of the code is a bit more tricky as it should.
2012-05-17 16:21:53 +00:00
Mark de Wever
1887fbed7e Remove tcontrol's unneeded virtual destructor.
The base class already has a virtual destructor so no need to add it
in this class.
2012-05-17 16:21:50 +00:00
Mark de Wever
6e6d7c74ae Move the definition to the tcontrol class.
The widget class itself doesn use it, so no need to keep it there.
2012-05-17 16:21:47 +00:00
Mark de Wever
4677d5f33e Fixes has_widget for grids.
This reapplies 2012-05-13T13:33:33Z!koraq@xs4all.nl and resolves the issue found in 
2012-05-13T18:03:56Z!koraq@xs4all.nl.
2012-05-15 18:24:50 +00:00