]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/mainframe.cpp
supports XDG_CONFIG_HOME on Linux
[xonotic/netradiant.git] / radiant / mainframe.cpp
index 0e430f11c634a87b6298e64edb86cd72c4e97e37..53ef24a60f3d2371f37c0cc811c2eb4d7271d056 100644 (file)
 #include "renderstate.h"
 #include "feedback.h"
 #include "referencecache.h"
-
+#include "texwindow.h"
 
 
 struct layout_globals_t
@@ -146,22 +146,42 @@ glwindow_globals_t g_glwindow_globals;
 
 
 // VFS
+
+bool g_vfsInitialized = false;
+
+void VFS_Init(){
+       if ( g_vfsInitialized ) return;
+       QE_InitVFS();
+       GlobalFileSystem().initialise();
+       g_vfsInitialized = true;
+}
+void VFS_Shutdown(){
+       if ( !g_vfsInitialized ) return;
+       GlobalFileSystem().shutdown();
+       g_vfsInitialized = false;
+}
+void VFS_Refresh(){
+       if ( !g_vfsInitialized ) return;
+       GlobalFileSystem().clear();
+       QE_InitVFS();
+       GlobalFileSystem().refresh();
+       g_vfsInitialized = true;
+       // also refresh texture browser
+       TextureBrowser_RefreshShaders();
+}
+void VFS_Restart(){
+       VFS_Shutdown();
+       VFS_Init();
+}
+
 class VFSModuleObserver : public ModuleObserver
 {
-std::size_t m_unrealised;
 public:
-VFSModuleObserver() : m_unrealised( 1 ){
-}
 void realise(){
-       if ( --m_unrealised == 0 ) {
-               QE_InitVFS();
-               GlobalFileSystem().initialise();
-       }
+       VFS_Init();
 }
 void unrealise(){
-       if ( ++m_unrealised == 1 ) {
-               GlobalFileSystem().shutdown();
-       }
+       VFS_Shutdown();
 }
 };
 
@@ -513,6 +533,7 @@ void gamemode_set( const char* gamemode ){
        }
 }
 
+
 #include "os/dir.h"
 
 class CLoadModule
@@ -943,32 +964,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" );
 }
 
 
@@ -1823,7 +1824,7 @@ GtkMenuItem* create_file_menu(){
        create_menu_item_with_mnemonic( menu, "_Import...", "ImportMap" );
        create_menu_item_with_mnemonic( menu, "_Save", "SaveMap" );
        create_menu_item_with_mnemonic( menu, "Save _as...", "SaveMapAs" );
-       create_menu_item_with_mnemonic( menu, "Save s_elected...", "SaveSelected" );
+       create_menu_item_with_mnemonic( menu, "_Export selected...", "ExportSelected" );
        menu_separator( menu );
        create_menu_item_with_mnemonic( menu, "Save re_gion...", "SaveRegion" );
        menu_separator( menu );
@@ -1835,7 +1836,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;
@@ -3191,11 +3191,10 @@ void MainFrame_Construct(){
        GlobalCommands_insert( "ImportMap", FreeCaller<ImportMap>() );
        GlobalCommands_insert( "SaveMap", FreeCaller<SaveMap>(), Accelerator( 'S', (GdkModifierType)GDK_CONTROL_MASK ) );
        GlobalCommands_insert( "SaveMapAs", FreeCaller<SaveMapAs>() );
-       GlobalCommands_insert( "SaveSelected", FreeCaller<ExportMap>() );
+       GlobalCommands_insert( "ExportSelected", FreeCaller<ExportMap>() );
        GlobalCommands_insert( "SaveRegion", FreeCaller<SaveRegion>() );
        GlobalCommands_insert( "RefreshReferences", FreeCaller<RefreshReferences>() );
        GlobalCommands_insert( "ProjectSettings", FreeCaller<DoProjectSettings>() );
-       GlobalCommands_insert( "CheckForUpdate", FreeCaller<OpenUpdateURL>() );
        GlobalCommands_insert( "Exit", FreeCaller<Exit>() );
 
        GlobalCommands_insert( "Undo", FreeCaller<Undo>(), Accelerator( 'Z', (GdkModifierType)GDK_CONTROL_MASK ) );