Implemented a version checker that can automatically or manually check if there are any updates to Aegisub, and a few other tweaks.

Originally committed to SVN as r736.
This commit is contained in:
Rodrigo Braz Monteiro 2007-01-07 22:54:04 +00:00
parent a6773bf842
commit 43841c24b8
11 changed files with 73 additions and 18 deletions

View file

@ -64,6 +64,7 @@ aegisub_SOURCES = \
dialog_timing_processor.cpp \
dialog_tip.cpp \
dialog_translation.cpp \
dialog_version_check.cpp
drop.cpp \
export_clean_info.cpp \
export_fixstyle.cpp \

View file

@ -79,6 +79,7 @@ Please visit http://aegisub.net to download latest version
- Added options to toggle the display of the audio timeline and of the time over the mouse cursor. (AMZ)
- Destination of screenshots can now be set in the options dialog. (AMZ)
- Moved karaoke syllable text in audio display to the top instead of bottom, since it often covers important information in spectrum mode (jfs)
- Implemented a version checker that can automatically or manually check if there are any updates to Aegisub. (AMZ)
= 1.10 beta - 2006.08.07 ===========================

View file

@ -67,6 +67,7 @@
#include "text_file_reader.h"
#include "text_file_writer.h"
#include "auto4_base.h"
#include "dialog_version_check.h"
/////////////////////////
@ -135,6 +136,17 @@ FrameMain::FrameMain (wxArrayString args)
// Parse arguments
LoadSubtitles(_T(""));
LoadList(args);
// Version checker
int option = Options.AsInt(_T("Auto check for updates"));
if (option == -1) {
int result = wxMessageBox(_("Do you want Aegisub to check for updates whenever it starts? You can still do it manually via the Help menu."),_("Check for updates?"),wxYES_NO);
option = 0;
if (result == wxYES) option = 1;
Options.SetInt(_T("Auto check for updates"),option);
Options.Save();
}
if (option == 1) DialogVersionCheck *checker = new DialogVersionCheck (this,true);
}
@ -206,7 +218,9 @@ void FrameMain::InitToolbar () {
#endif
Toolbar->AddSeparator();
// Misc
// Options
Toolbar->AddTool(Menu_Tools_Options,_("Options"),wxBITMAP(options_button),_("Configure Aegisub"));
Toolbar->AddTool(Menu_Tools_Hotkeys,_("Hotkeys"),wxBITMAP(hotkeys_button),_("Remap hotkeys"));
Toolbar->AddTool(Grid_Toggle_Tags,_("Cycle Tag Hidding Mode"),wxBITMAP(toggle_tag_hiding),_("Cycle through tag-hiding modes"));
// Update
@ -399,6 +413,7 @@ void FrameMain::InitMenu() {
AppendBitmapMenuItem(helpMenu,Menu_Help_BugTracker, _("&Bug tracker..."), _("Visit Aegisub's bug tracker"),wxBITMAP(bugtracker_button));
AppendBitmapMenuItem (helpMenu,Menu_Help_IRCChannel, _("&IRC channel..."), _("Visit Aegisub's official IRC channel"), wxBITMAP(irc_button));
helpMenu->AppendSeparator();
AppendBitmapMenuItem(helpMenu,Menu_Help_Check_Updates, _("&Check for Updates..."), _("Check to see if there is a new version of Aegisub available"),wxBITMAP(blank_button));
AppendBitmapMenuItem(helpMenu,Menu_Help_About, _("&About..."), _("About Aegisub"),wxBITMAP(about_button));
MenuBar->Append(helpMenu, _("&Help"));

View file

@ -141,6 +141,7 @@ private:
void OnMenuOpen (wxMenuEvent &event);
void OnExit(wxCommandEvent &WXUNUSED(event));
void OnAbout (wxCommandEvent &event);
void OnCheckUpdates (wxCommandEvent &event);
void OnContents (wxCommandEvent &event);
void OnWebsite (wxCommandEvent &event);
void OnForums (wxCommandEvent &event);

View file

@ -83,6 +83,7 @@
#include "utils.h"
#include "auto4_base.h"
#include "dialog_automation.h"
#include "dialog_version_check.h"
////////////////////
@ -198,6 +199,7 @@ BEGIN_EVENT_TABLE(FrameMain, wxFrame)
EVT_MENU(Menu_Help_Forums, FrameMain::OnForums)
EVT_MENU(Menu_Help_BugTracker, FrameMain::OnBugTracker)
EVT_MENU(Menu_Help_IRCChannel, FrameMain::OnIRCChannel)
EVT_MENU(Menu_Help_Check_Updates, FrameMain::OnCheckUpdates)
EVT_MENU(Menu_Help_About, FrameMain::OnAbout)
EVT_MENU(Menu_View_Language, FrameMain::OnChooseLanguage)
@ -585,6 +587,13 @@ void FrameMain::OnAbout(wxCommandEvent &event) {
}
//////////////////////
// Open check updates
void FrameMain::OnCheckUpdates(wxCommandEvent &event) {
DialogVersionCheck *check = new DialogVersionCheck(this,false);
}
////////////////////
// Open help topics
void FrameMain::OnContents(wxCommandEvent& WXUNUSED(event)) {
@ -606,33 +615,21 @@ void FrameMain::OnWebsite(wxCommandEvent& WXUNUSED(event)) {
///////////////
// Open forums
void FrameMain::OnForums(wxCommandEvent& WXUNUSED(event)) {
wxFileType *type = wxTheMimeTypesManager->GetFileTypeFromExtension(_T("html"));
if (type) {
wxString command = type->GetOpenCommand(_T("http://www.malakith.net/aegisub/"));
if (!command.empty()) wxExecute(command);
}
AegisubApp::OpenURL(_T("http://www.malakith.net/aegisub/"));
}
///////////////////
// Open bugtracker
void FrameMain::OnBugTracker(wxCommandEvent& WXUNUSED(event)) {
wxFileType *type = wxTheMimeTypesManager->GetFileTypeFromExtension(_T("html"));
if (type) {
wxString command = type->GetOpenCommand(_T("http://www.malakith.net/aegibug/"));
if (!command.empty()) wxExecute(command);
}
AegisubApp::OpenURL(_T("http://www.malakith.net/aegibug/"));
}
////////////////////
// Open IRC channel
void FrameMain::OnIRCChannel(wxCommandEvent& WXUNUSED(event)) {
wxFileType *type = wxTheMimeTypesManager->GetFileTypeFromExtension(_T("html"));
if (type) {
wxString command = type->GetOpenCommand(_T("irc://irc.chatsociety.net/aegisub"));
if (!command.empty()) wxExecute(command);
}
AegisubApp::OpenURL(_T("irc://irc.chatsociety.net/aegisub"));
}

View file

@ -40,6 +40,7 @@
#include <wx/config.h>
#include <wx/filename.h>
#include <wx/msgdlg.h>
#include <wx/mimetype.h>
#include "main.h"
#include "frame_main.h"
#include "options.h"
@ -344,6 +345,18 @@ void AegisubApp::GetFolderName () {
folderName += _T("/");
}
////////////
// Open URL
void AegisubApp::OpenURL(wxString url) {
wxFileType *type = wxTheMimeTypesManager->GetFileTypeFromExtension(_T("html"));
if (type) {
wxString command = type->GetOpenCommand(url);
if (!command.empty()) wxExecute(command);
}
}
////////////////
// Apple events
#ifdef __WXMAC__
@ -391,4 +404,3 @@ void AegisubApp::OnKey(wxKeyEvent &event) {
event.Skip();
}
}

View file

@ -66,6 +66,8 @@ public:
static wxString fullPath;
static wxString folderName;
static AegisubApp* Get() { return (AegisubApp*) wxTheApp; }
static void OpenURL(wxString url);
void GetFullPath(wxString arg);
void GetFolderName();

View file

@ -81,6 +81,7 @@ void OptionsManager::LoadDefaults() {
SetInt(_T("Recent aud max"),16);
SetInt(_T("Recent find max"),16);
SetInt(_T("Recent replace max"),16);
SetInt(_T("Auto Check for Updates"),-1);
// File Save/Load
SetModificationType(MOD_RESTART);

View file

@ -127,3 +127,15 @@ wxString GetAegisubBuildTime() {
wxString GetAegisubBuildCredit() {
return versioninfo.BuildCredit;
}
bool GetIsOfficialRelease() {
return versioninfo.IsRelease;
}
wxString GetVersionNumber() {
return versioninfo.VersionNumber;
}
int GetSVNRevision() {
return versioninfo.SvnRev;
}

View file

@ -43,3 +43,9 @@ wxString GetAegisubShortVersionString();
wxString GetAegisubBuildTime();
// Name of who built the binary
wxString GetAegisubBuildCredit();
// Is release?
bool GetIsOfficialRelease();
// Version number
wxString GetVersionNumber();
// Get SVN revision
int GetSVNRevision();

View file

@ -397,12 +397,17 @@ void VideoDisplay::OnMouseEvent(wxMouseEvent& event) {
}
// Hover
bool hasOverlay = false;
if (x != mouse_x || y != mouse_y) {
// Set coords
mouse_x = x;
mouse_y = y;
hasOverlay = true;
}
// Create backbuffer
// Has something to draw
if (hasOverlay) {
// Create backbuffer if needed
bool needCreate = false;
if (!backbuffer) needCreate = true;
else if (backbuffer->GetWidth() != w || backbuffer->GetHeight() != h) {
@ -417,9 +422,11 @@ void VideoDisplay::OnMouseEvent(wxMouseEvent& event) {
// Draw frame
dc.DrawBitmap(GetFrame(frame_n),0,0);
// Draw the control points for FexTracker
DrawTrackingOverlay( dc );
// Prepare grid
dc.SetPen(wxPen(wxColour(255,255,255),1));
dc.SetLogicalFunction(wxINVERT);