From: Mario Date: Tue, 11 Jul 2017 06:29:28 +0000 (+0000) Subject: Merge branch 'fixurl' into 'master' X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=commitdiff_plain;h=33c1fb60da3357af527a46ed06995e808853b9ff;hp=e0b3d0ac5abc0cde0a74fadbd2aa4739b43b24a3 Merge branch 'fixurl' into 'master' Fix menu and about url, remove “check for update” , use xdg-open, enable https Closes #28 and #87 See merge request !45 --- diff --git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp index daa0f31c..d0e735f8 100644 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@ -434,13 +434,19 @@ void DoSides( int type, int axis ){ void about_button_changelog( GtkWidget *widget, gpointer data ){ StringOutputStream log( 256 ); - log << AppPath_get() << "changelog.txt"; + log << "https://gitlab.com/xonotic/netradiant/commits/master"; OpenURL( log.c_str() ); } void about_button_credits( GtkWidget *widget, gpointer data ){ StringOutputStream cred( 256 ); - cred << AppPath_get() << "credits.html"; + cred << "https://gitlab.com/xonotic/netradiant/network/master"; + OpenURL( cred.c_str() ); +} + +void about_button_issues( GtkWidget *widget, gpointer data ){ + StringOutputStream cred( 256 ); + cred << "https://gitlab.com/xonotic/netradiant/issues"; OpenURL( cred.c_str() ); } @@ -476,12 +482,11 @@ void DoAbout(){ GtkLabel* label = GTK_LABEL( gtk_label_new( "NetRadiant " RADIANT_VERSION "\n" __DATE__ "\n\n" RADIANT_ABOUTMSG "\n\n" - "By alientrap.org\n\n" + "By xonotic.org\n\n" "This program is free software\n" "licensed under the GNU GPL.\n\n" "NetRadiant is unsupported, however\n" - "you may report your problems at\n" - "http://www.icculus.org/netradiant/" + "you may report your problems on issue tracker.\n" ) ); gtk_widget_show( GTK_WIDGET( label ) ); @@ -502,7 +507,11 @@ void DoAbout(){ gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); } { - GtkButton* button = create_dialog_button( "Changelog", G_CALLBACK( about_button_changelog ), 0 ); + GtkButton* button = create_dialog_button( "Changes", G_CALLBACK( about_button_changelog ), 0 ); + gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + } + { + GtkButton* button = create_dialog_button( "Issues", G_CALLBACK( about_button_issues ), 0 ); gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); } } diff --git a/radiant/help.cpp b/radiant/help.cpp index d5319f30..07b51603 100644 --- a/radiant/help.cpp +++ b/radiant/help.cpp @@ -75,7 +75,8 @@ void process_xlink( const char* filename, const char *menu_name, const char *bas xmlChar* prop = xmlGetProp( pNode, reinterpret_cast( "url" ) ); ASSERT_NOTNULL( prop ); - if ( strstr( reinterpret_cast( prop ), "http://" ) ) { + if ( strstr( reinterpret_cast( prop ), "http://" ) || + strstr( reinterpret_cast( prop ), "https://" ) ) { // complete URL url = reinterpret_cast( prop ); } diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 8989da30..8abd6e2a 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -955,32 +955,12 @@ void thunk_OnSleep(){ g_pParentWnd->OnSleep(); } -void OpenUpdateURL(){ - // build the URL - StringOutputStream URL( 256 ); - URL << "http://www.icculus.org/netradiant/?cmd=update&data=dlupdate&query_dlup=1"; -#ifdef WIN32 - URL << "&OS_dlup=1"; -#elif defined( __APPLE__ ) - URL << "&OS_dlup=2"; -#else - URL << "&OS_dlup=3"; -#endif - URL << "&Version_dlup=" RADIANT_VERSION; - g_GamesDialog.AddPacksURL( URL ); - OpenURL( URL.c_str() ); -} - -// open the Q3Rad manual void OpenHelpURL(){ - // at least on win32, AppPath + "docs/index.html" - StringOutputStream help( 256 ); - help << AppPath_get() << "docs/index.html"; - OpenURL( help.c_str() ); + OpenURL( "https://gitlab.com/xonotic/xonotic/wikis/Mapping" ); } void OpenBugReportURL(){ - OpenURL( "http://www.icculus.org/netradiant/?cmd=bugs" ); + OpenURL( "https://gitlab.com/xonotic/netradiant/issues" ); } @@ -1847,7 +1827,6 @@ GtkMenuItem* create_file_menu(){ menu_separator( menu ); MRU_constructMenu( menu ); menu_separator( menu ); - create_menu_item_with_mnemonic( menu, "Check for NetRadiant update (web)", "CheckForUpdate" ); // FIXME create_menu_item_with_mnemonic( menu, "E_xit", "Exit" ); return file_menu_item; @@ -3207,7 +3186,6 @@ void MainFrame_Construct(){ GlobalCommands_insert( "SaveRegion", FreeCaller() ); GlobalCommands_insert( "RefreshReferences", FreeCaller() ); GlobalCommands_insert( "ProjectSettings", FreeCaller() ); - GlobalCommands_insert( "CheckForUpdate", FreeCaller() ); GlobalCommands_insert( "Exit", FreeCaller() ); GlobalCommands_insert( "Undo", FreeCaller(), Accelerator( 'Z', (GdkModifierType)GDK_CONTROL_MASK ) ); diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index 4209fdb3..46d15c7a 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -484,15 +484,6 @@ inline const char* GameDescription_getIdentifier( const CGameDescription& gameDe return identifier; } -void CGameDialog::AddPacksURL( StringOutputStream &URL ){ - // add the URLs for the list of game packs installed - // FIXME: this is kinda hardcoded for now.. - std::list::iterator iGame; - for ( iGame = mGames.begin(); iGame != mGames.end(); ++iGame ) - { - URL << "&Games_dlup%5B%5D=" << GameDescription_getIdentifier( *( *iGame ) ); - } -} CGameDialog g_GamesDialog; diff --git a/radiant/preferences.h b/radiant/preferences.h index 8793d039..293541a5 100644 --- a/radiant/preferences.h +++ b/radiant/preferences.h @@ -250,8 +250,6 @@ CGameDialog() : } virtual ~CGameDialog(); -void AddPacksURL( StringOutputStream &s ); - /*! intialize the game dialog, called at CPrefsDlg::Init will scan for games, load prefs, and do game selection dialog if needed diff --git a/radiant/url.cpp b/radiant/url.cpp index e5abc077..b86702e7 100644 --- a/radiant/url.cpp +++ b/radiant/url.cpp @@ -35,10 +35,9 @@ bool open_url( const char* url ){ #if defined( __linux__ ) || defined( __FreeBSD__ ) #include bool open_url( const char* url ){ - // \todo FIXME: the way we open URLs on *nix should be improved. A script is good (see how I do on RTCW) char command[2 * PATH_MAX]; snprintf( command, sizeof( command ), - "firefox -remote \"openURL(%s,new-window)\" || firefox \"%s\" &", url, url ); + "xdg-open \"%s\" &", url, url ); return system( command ) == 0; } #endif diff --git a/setup/data/tools/global.xlink b/setup/data/tools/global.xlink index 3ca47f1a..4b6d0343 100644 --- a/setup/data/tools/global.xlink +++ b/setup/data/tools/global.xlink @@ -1,7 +1,7 @@ - - - + + +