Added CheckUpdates command.

This commit is contained in:
David Capello 2010-07-04 12:07:38 -03:00
parent b5944202f1
commit c400ea0cd0
4 changed files with 65 additions and 0 deletions

View File

@ -310,6 +310,7 @@
<item command="quick_reference" text="Quick &amp;Reference" />
<separator />
<item command="donate" text="&amp;Donate" />
<item command="check_updates" text="&amp;Check for New Version" />
<separator />
<item command="about" text="&amp;About" />
</menu>

View File

@ -22,6 +22,7 @@ COMMON_SOURCES = \
src/commands/cmd_cel_properties.cpp \
src/commands/cmd_change_color.cpp \
src/commands/cmd_change_image_type.cpp \
src/commands/cmd_check_updates.cpp \
src/commands/cmd_clear.cpp \
src/commands/cmd_close_file.cpp \
src/commands/cmd_configure_screen.cpp \

View File

@ -0,0 +1,62 @@
/* ASE - Allegro Sprite Editor
* Copyright (C) 2001-2010 David Capello
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include <allegro.h>
#include "commands/command.h"
#include "launcher.h"
//////////////////////////////////////////////////////////////////////
// about
class CheckUpdatesCommand : public Command
{
public:
CheckUpdatesCommand();
Command* clone() const { return new CheckUpdatesCommand(*this); }
protected:
void execute(Context* context);
};
CheckUpdatesCommand::CheckUpdatesCommand()
: Command("check_updates",
"Check for New Version",
CmdUIOnlyFlag)
{
}
void CheckUpdatesCommand::execute(Context* context)
{
std::string url;
url += WEBSITE;
url += "update/?v=";
url += VERSION; // ASE version
Launcher::openUrl(url);
}
//////////////////////////////////////////////////////////////////////
// CommandFactory
Command* CommandFactory::create_check_updates_command()
{
return new CheckUpdatesCommand;
}

View File

@ -24,6 +24,7 @@ FOR_EACH_COMMAND(canvas_size)
FOR_EACH_COMMAND(cel_properties)
FOR_EACH_COMMAND(change_color)
FOR_EACH_COMMAND(change_image_type)
FOR_EACH_COMMAND(check_updates)
FOR_EACH_COMMAND(clear)
FOR_EACH_COMMAND(close_all_files)
FOR_EACH_COMMAND(close_editor)