Commit graph

112 commits

Author SHA1 Message Date
Thomas Goyne
1e0f08c0ed Mostly purge wxWidgets from non-UI stuff
Use boost::filesystem::path for all paths, and std::string for all other
strings, converting to/from wxString as close to the actual uses of wx
as possible.

Where possible, replace the uses of non-UI wxWidgets functionality with
the additions to the standard library in C++11, or the equivalents in
boost.

Move the path token management logic to libaegisub (and rewrite it in
the process).

Add a basic thread pool based on asio and std::thread to libaegisub.

This touches nearly every file in the project and a nontrivial amount of
code had to be rewritten entirely, so there's probably a lot of broken
stuff.
2013-02-06 13:22:15 -08:00
Thomas Goyne
a99428c49d Extract options and MRU stuff from main.h
Nearly all of the files including main.h are doing so only for OPT_GET
and friends, which are rather unrelated to the main things that main.h
declares.
2013-01-09 16:48:31 -08:00
Thomas Goyne
bd9a81372d Cut down on the ifdefs in main.cpp
Shuffle some stuff around to reduces the number of ifdefs and always
define MacOpenFile since there's no reason not to.
2013-01-09 16:48:31 -08:00
Thomas Goyne
9b24ab38a4 Don't write the crash xml file
Nothing uses it and it's not even valid xml.
2013-01-09 16:48:31 -08:00
Thomas Goyne
3e5ba4fd98 Catch wxStrings in OnInit as there's still a few things that throw them 2012-12-31 07:49:57 -08:00
Thomas Goyne
426e4593c7 Fix a bunch of incorrect implicit wxString <-> std::string conversions
The implicit conversion assumes that std::string is encoded in the local
charset, while it's always actually UTF-8.
2012-12-31 07:09:31 -08:00
Thomas Goyne
d0f4d9df99 Replace all uses of lagi_wxString with to_wx 2012-12-22 15:18:38 -08:00
Thomas Goyne
009518271a Document a few things and kill all remaining placeholders 2012-12-02 13:08:42 -08:00
Thomas Goyne
96cf5ea7ed Kill the #ifndef AGI_PRE guards
They don't actually improve compilation performance and make it more
annoying to modify what things are in the precompiled header.
2012-12-02 06:33:29 -08:00
Thomas Goyne
947dc537d1 Add a generic function for invoking functions on the GUI thread 2012-11-26 07:11:30 -08:00
Thomas Goyne
06aaaff16b NULL -> nullptr 2012-11-13 08:51:01 -08:00
Thomas Goyne
59a165f022 Change the crash recovery naming scheme to be like the autosave files 2012-11-12 18:35:26 -08:00
Thomas Goyne
67df64e879 Use range-based for loops in a bunch of places 2012-11-12 18:35:25 -08:00
Thomas Goyne
f35e10c76a Decode the autosave path when cleaning up old files 2012-10-27 19:26:45 -07:00
Thomas Goyne
e44c47c863 Remove $Id$ markers since git doesn't support them 2012-10-25 17:39:49 -07:00
Thomas Goyne
df60c2e7a4 Factor out a bunch of duplicated code for clipboard stuff 2012-10-25 17:39:49 -07:00
Thomas Goyne
78b70e987e Disable Ubuntu's global menu bar for Aegisub
wxWidgets currently doesn't generate menu open or update events for the
Ubuntu menubar (since GTK doesn't send the relevant signals to the
application), which we rely on.

Updates #1531.
2012-10-25 17:39:49 -07:00
Thomas Goyne
67c01d11f6 Delete unfinished and unused stuff from libaegisub 2012-10-25 17:39:49 -07:00
Thomas Goyne
56ced22c63 Mark autosave files with the current date and time
This makes it so that autosave files are (almost) never overwritten, so
that opening an old version of the file won't result in the autosaves
from a newer version being replaced.

Clean up old autosave files on startup to limit the total to 100
files/100 MB. Maybe make this configurable in the future?

Closes #1155.
2012-10-25 07:50:31 -07:00
Thomas Goyne
863e041d4d Honor the configured MRU limits
Actually use the limits set in the preferences dialog rather than always
limiting the MRU lists to 16.

Currently only the Find and Replace limits can be set to above 16 due to
how the open recent items commands are implemented.

Closes #1528.
2012-10-11 10:19:49 -07:00
Thomas Goyne
40f97dbfea Redesign AegisubLocale
Use wxTranslations directly rather than going through wxLocale. This
significantly simplifies the code, eliminates the hardcoded list of
languages for non-windows, and makes it possible to use mismatched
languages and locales.

Closes #1508.
2012-10-02 16:06:05 -07:00
Thomas Goyne
015d533556 Fix bad destruction order when exiting without closing the main window first
On OS X, when closing via Quit the document windows are not closed until
after OnExit is called, resulting the project context being destructed
after the global stuff, resulting in crashes on exit in some cases.

Originally committed to SVN as r6812.
2012-05-16 14:23:16 +00:00
Thomas Goyne
123f02f0fb Process hotkeys in wxEVT_CHAR_HOOK rather than wxEVT_KEY_DOWN
Char hook events propagate by default, removing the need for the event
filter to make key down events propagate, which was causing some funny
issues.

On Windows, the char hook handler runs before menu accelerators, fixing
a bug where Default context hotkeys would override more specific ones
when they appeared on a menu. Unfortunately, this is not the case on
GTK, so the dumb accelerator-disabling hack is still required.

Originally committed to SVN as r6724.
2012-04-27 19:07:49 +00:00
Thomas Goyne
84e378148e Add platform-specific default configuration files
Default to VSFilter on Windows as libass is still somewhat unstable.

Set the default audio player via the platform config file rather than
not doing anything with it.

Originally committed to SVN as r6664.
2012-04-06 01:55:22 +00:00
Thomas Goyne
566f08f308 Clean up old log files rather than just letting them accumulate forever
Originally committed to SVN as r6654.
2012-04-03 22:44:47 +00:00
Thomas Goyne
c4a1a93b97 Center most of the message boxes over their parent windows
Originally committed to SVN as r6629.
2012-03-28 23:59:19 +00:00
Thomas Goyne
b32515da80 Strip trailing whitespace from all cpp and h files
Originally committed to SVN as r6600.
2012-03-25 04:05:06 +00:00
Thomas Goyne
9f43f9f041 Rewrite the Clean Script Info export filter in lua
This makes it easy to make it a macro in addition to an export filter,
and simplifies the implementation.

Originally committed to SVN as r6586.
2012-03-12 23:35:56 +00:00
Thomas Goyne
e9dcbf66f3 Fix compilation errors when wxUSE_ON_FATAL_EXCEPTION is not enabled. Updates #1423.
Originally committed to SVN as r6359.
2012-01-25 19:07:07 +00:00
Thomas Goyne
7dd6cfe37d Derive agi::acs exceptions from agi::FileSystemError and friends rather than having two sets of errors for the same thing
Originally committed to SVN as r6278.
2012-01-12 22:31:54 +00:00
Thomas Goyne
518f93f18f Create the json log writer after checking for local config so it goes to the right place
Originally committed to SVN as r6249.
2012-01-08 01:36:35 +00:00
Thomas Goyne
e2d31b708e Split the json log writing into a seperate class from LogSink
Originally committed to SVN as r6248.
2012-01-08 01:36:23 +00:00
Thomas Goyne
d148bbbf2a Make agi::log::LogSink take ownership of the emitters passed to it
Originally committed to SVN as r6246.
2012-01-08 01:36:09 +00:00
Thomas Goyne
ba1a1dc737 Load configuration before initializing commands, hotkeys and icons, as hotkeys uses ?user which may be changed by configuration loading
Originally committed to SVN as r6245.
2012-01-08 01:36:03 +00:00
Thomas Goyne
d2d28401bd Change how local config mode works
Rather than loading both the local and user config files and saving to
the local directory if an option is set, simply try to load the local
config file, and if it exists switch to local mode and never even touch
the user file.

Originally committed to SVN as r6244.
2012-01-08 01:35:56 +00:00
Thomas Goyne
ae62cb75b4 Add missing uses of STD_STR when converting from wxString to std::string
Originally committed to SVN as r6243.
2012-01-08 01:35:49 +00:00
Thomas Goyne
1285584e89 Add ?local for the user's local config dir; use it for FFMS2 indexes
Originally committed to SVN as r6235.
2012-01-08 01:34:57 +00:00
Thomas Goyne
dc58b3db40 Clean up SetThreadName a little
Originally committed to SVN as r6217.
2012-01-08 01:05:51 +00:00
Thomas Goyne
71968aa4f3 Fix wxString::Format assertion failures in the stack walker
Originally committed to SVN as r6203.
2012-01-08 01:04:16 +00:00
Thomas Goyne
e34b401201 Return -1 from AegisubApp::FilterEvent rather than wxEventFilter::Event_Skip, as the enum was added in wx 2.9.4
Originally committed to SVN as r6188.
2011-12-30 15:51:58 +00:00
Thomas Goyne
84d1315736 Write the config and MRU files to ?data in portable mode rather than ?user
Originally committed to SVN as r6187.
2011-12-30 01:21:03 +00:00
Thomas Goyne
d192f1c332 Fix bad format string that made stack trace writing fail after one stack frame
Originally committed to SVN as r6184.
2011-12-29 05:36:49 +00:00
Thomas Goyne
e36759a3b2 Remove the undocumented milisecond precision option
Originally committed to SVN as r6121.
2011-12-22 21:28:32 +00:00
Thomas Goyne
ec63fad7c5 Make help buttons fall back to the docs wiki if the scraped html files aren't available locally
Originally committed to SVN as r6084.
2011-12-22 21:22:31 +00:00
Thomas Goyne
cd3b9bfa37 Enable propagation of key events so that hotkeys work regardless of what's focused
Originally committed to SVN as r6054.
2011-12-22 21:17:58 +00:00
Thomas Goyne
59273bac4a Reenable the assertion failure handler
Originally committed to SVN as r6053.
2011-12-22 21:17:49 +00:00
Thomas Goyne
f1ff18545a Make more of AegisubApp's methods private
Originally committed to SVN as r6049.
2011-12-22 21:17:12 +00:00
Thomas Goyne
2ec3ff157b Kill AegisubApp::OpenURL. It makes no sense for the top level application object to be doing this and it doesn't even save any code.
Originally committed to SVN as r6048.
2011-12-22 21:17:02 +00:00
Thomas Goyne
2439381c33 Fix misspelled word in the crash log
Originally committed to SVN as r6002.
2011-12-22 21:09:51 +00:00
Thomas Goyne
95a329a1e2 Flush the clipboard on exit so that it isn't cleared
Originally committed to SVN as r5957.
2011-12-02 04:35:59 +00:00