Exemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     if (!isLocalPlayer)
     {
         return;
     }
     buttonSync = this.gameObject.GetComponent <ButtonSync>();
 }
Exemplo n.º 2
0
    void ShowIcons(ButtonSync bsync, Transform icons)
    {
        switch (bsync.lockCombination)
        {
        case 0:
        case 9:
            icons.GetChild(0).gameObject.SetActive(true);
            icons.GetChild(1).gameObject.SetActive(true);
            icons.GetChild(2).gameObject.SetActive(true);
            break;

        case 1:
            icons.GetChild(0).gameObject.SetActive(true);
            break;

        case 3:
            icons.GetChild(1).gameObject.SetActive(true);
            break;

        case 4:
            icons.GetChild(0).gameObject.SetActive(true);
            icons.GetChild(1).gameObject.SetActive(true);
            break;

        case 5:
            icons.GetChild(2).gameObject.SetActive(true);
            break;

        case 6:
            icons.GetChild(0).gameObject.SetActive(true);
            icons.GetChild(2).gameObject.SetActive(true);
            break;

        case 8:
            icons.GetChild(1).gameObject.SetActive(true);
            icons.GetChild(2).gameObject.SetActive(true);
            break;

        default:
            break;
        }
    }
Exemplo n.º 3
0
        public LibraryControl(WebLibraryDetail web_library_detail)
        {
            Theme.Initialize();

            Logging.Debug("+LibraryControl()");

            this.web_library_detail          = web_library_detail;
            dual_tab_drag_to_library_manager = new DragToLibraryManager(web_library_detail);

            InitializeComponent();

            ImageLibraryEmptyAddFiles.Source = Icons.GetAppIcon(Icons.LibraryEmptyAddFiles);
            RenderOptions.SetBitmapScalingMode(ImageLibraryEmptyAddFiles, BitmapScalingMode.HighQuality);
            ImageLibraryMissingBibTeX.Source = Icons.GetAppIcon(Icons.BibTexSniffer);
            RenderOptions.SetBitmapScalingMode(ImageLibraryMissingBibTeX, BitmapScalingMode.HighQuality);

            bool ADVANCED_MENUS = ConfigurationManager.Instance.ConfigurationRecord.GUI_AdvancedMenus;

            // Connect the dropdowns
            ButtonAddPDF.AttachPopup(ButtonAddPDFPopup);
            ButtonAddPDF.Icon = Icons.GetAppIcon(Icons.DocumentsAddToLibrary);
            if (!ADVANCED_MENUS)
            {
                ButtonAddPDF.Caption = LocalisationManager.Get("LIBRARY/CAP/POPUP_ADD_DOCUMENTS");
            }
            ButtonAddPDF.ToolTip = LocalisationManager.Get("LIBRARY/TIP/POPUP_ADD_DOCUMENTS");

            ButtonSync.AttachPopup(ButtonSyncPopup);
            ButtonSync.Icon = Icons.GetAppIcon(Icons.SyncWithCloud);
            if (!ADVANCED_MENUS)
            {
                ButtonSync.Caption = LocalisationManager.Get("LIBRARY/CAP/POPUP_SYNC");
            }
            ButtonSync.ToolTip = LocalisationManager.Get("LIBRARY/TIP/POPUP_SYNC");

            // Then the menus
            ButtonAddVanillaReference.Icon    = Icons.GetAppIcon(Icons.New);
            ButtonAddVanillaReference.Caption = LocalisationManager.Get("LIBRARY/CAP/ADD_REFERENCE");
            ButtonAddVanillaReference.ToolTip = LocalisationManager.Get("LIBRARY/TIP/ADD_REFERENCE");
            ButtonAddVanillaReference.Click  += ButtonAddVanillaReference_Click;

            ButtonSyncMetadaWithCloud.Icon    = Icons.GetAppIcon(Icons.SyncWithCloud);
            ButtonSyncMetadaWithCloud.Caption = LocalisationManager.Get("LIBRARY/CAP/PARTIAL_SYNC");
            ButtonSyncMetadaWithCloud.ToolTip = LocalisationManager.Get("LIBRARY/TIP/PARTIAL_SYNC");
            ButtonSyncMetadaWithCloud.Click  += ButtonSyncMetadaWithCloud_Click;

            ButtonSyncAllPDFsWithCloud.Icon    = Icons.GetAppIcon(Icons.SyncPDFsWithCloud);
            ButtonSyncAllPDFsWithCloud.Caption = LocalisationManager.Get("LIBRARY/CAP/FULL_SYNC");
            ButtonSyncAllPDFsWithCloud.ToolTip = LocalisationManager.Get("LIBRARY/TIP/FULL_SYNC");
            ButtonSyncAllPDFsWithCloud.Click  += ButtonSyncPDFsWithCloud_Click;

            ButtonSyncDetails.Icon    = Icons.GetAppIcon(Icons.SyncDetails);
            ButtonSyncDetails.Caption = LocalisationManager.Get("LIBRARY/CAP/SYNC_DETAILS");
            ButtonSyncDetails.ToolTip = LocalisationManager.Get("LIBRARY/TIP/SYNC_DETAILS");
            ButtonSyncDetails.Click  += ButtonSyncDetails_Click;

            ButtonEdit.Icon    = Icons.GetAppIcon(Icons.Open);
            ButtonEdit.Caption = LocalisationManager.Get("LIBRARY/CAP/EDIT");
            ButtonEdit.ToolTip = LocalisationManager.Get("LIBRARY/TIP/EDIT");
            ButtonEdit.Click  += ButtonEdit_Click;

            ButtonDelete.Icon    = Icons.GetAppIcon(Icons.Open);
            ButtonDelete.Caption = LocalisationManager.Get("LIBRARY/CAP/DELETE");
            ButtonDelete.ToolTip = LocalisationManager.Get("LIBRARY/TIP/DELETE");
            ButtonDelete.Click  += ButtonDelete_Click;

            ButtonAnnotationsReport.Icon = Icons.GetAppIcon(Icons.LibraryAnnotationsReport);
            if (!ADVANCED_MENUS)
            {
                ButtonAnnotationsReport.Caption = LocalisationManager.Get("LIBRARY/CAP/ANNOTATION_REPORT");
            }
            ButtonAnnotationsReport.ToolTip = LocalisationManager.Get("LIBRARY/TIP/ANNOTATION_REPORT");
            ButtonAnnotationsReport.Click  += ButtonAnnotationsReport_Click;
            WizardDPs.SetPointOfInterest(ButtonAnnotationsReport, "LibraryAnnotationReportButton");

            ButtonGenerateReferences.Visibility = ConfigurationManager.Instance.NoviceVisibility;
            ButtonGenerateReferences.Icon       = Icons.GetAppIcon(Icons.LibraryGenerateReferences);
            if (!ADVANCED_MENUS)
            {
                ButtonGenerateReferences.Caption = LocalisationManager.Get("LIBRARY/CAP/FIND_REFERENCES");
            }
            ButtonGenerateReferences.ToolTip = LocalisationManager.Get("LIBRARY/TIP/FIND_REFERENCES");
            ButtonGenerateReferences.Click  += ButtonGenerateReferences_Click;

            ButtonFindDuplicates.Visibility = ConfigurationManager.Instance.NoviceVisibility;
            ButtonFindDuplicates.Icon       = Icons.GetAppIcon(Icons.LibraryFindDuplicates);
            if (!ADVANCED_MENUS)
            {
                ButtonFindDuplicates.Caption = LocalisationManager.Get("LIBRARY/CAP/FIND_DUPLICATES");
            }
            ButtonFindDuplicates.ToolTip = LocalisationManager.Get("LIBRARY/TIP/FIND_DUPLICATES");
            ButtonFindDuplicates.Click  += ButtonFindDuplicates_Click;

            ButtonBibTexSniffer.Icon = Icons.GetAppIcon(Icons.BibTexSniffer);
            if (!ADVANCED_MENUS)
            {
                ButtonBibTexSniffer.Caption = LocalisationManager.Get("LIBRARY/CAP/BIBTEX_SNIFFER");
            }
            ButtonBibTexSniffer.ToolTip = LocalisationManager.Get("LIBRARY/TIP/BIBTEX_SNIFFER");
            ButtonBibTexSniffer.Click  += ButtonBibTexSniffer_Click;

            ButtonExplore.AttachPopup(ButtonExplorePopup);
            ButtonExplore.Icon = Icons.GetAppIcon(Icons.Explore);
            if (!ADVANCED_MENUS)
            {
                ButtonExplore.Caption = LocalisationManager.Get("LIBRARY/CAP/EXPLORE");
            }
            ButtonExplore.ToolTip    = LocalisationManager.Get("LIBRARY/TIP/EXPLORE");
            ButtonExplore.Visibility = ConfigurationManager.Instance.NoviceVisibility;

            ButtonExpedition.Icon    = Icons.GetAppIcon(Icons.ModuleExpedition);
            ButtonExpedition.Caption = LocalisationManager.Get("LIBRARY/TIP/EXPEDITION");
            ButtonExpedition.Click  += ButtonExpedition_Click;

            ButtonExploreInBrainstorm.Icon    = Icons.GetAppIcon(Icons.ModuleBrainstorm);
            ButtonExploreInBrainstorm.Caption = LocalisationManager.Get("LIBRARY/TIP/BRAINSTORM");
            ButtonExploreInBrainstorm.Click  += ButtonExploreInBrainstorm_Click;

            ButtonExploreInPivot.Icon    = Icons.GetAppIcon(Icons.LibraryPivot);
            ButtonExploreInPivot.Caption = LocalisationManager.Get("LIBRARY/TIP/PIVOT");
            ButtonExploreInPivot.Click  += ButtonExploreInPivot_Click;

            ButtonExport.AttachPopup(ButtonExportPopup);
            ButtonExport.Icon = Icons.GetAppIcon(Icons.LibraryExport);
            if (!ADVANCED_MENUS)
            {
                ButtonExport.Caption = LocalisationManager.Get("LIBRARY/CAP/POPUP_EXPORT");
            }
            ButtonExport.ToolTip    = LocalisationManager.Get("LIBRARY/TIP/POPUP_EXPORT");
            ButtonExport.Visibility = ConfigurationManager.Instance.NoviceVisibility;

            ButtonExportLibrary.Icon    = Icons.GetAppIcon(Icons.LibraryExport);
            ButtonExportLibrary.Caption = LocalisationManager.Get("LIBRARY/CAP/EXPORT_LIBRARY");
            ButtonExportLibrary.ToolTip = LocalisationManager.Get("LIBRARY/TIP/EXPORT_LIBRARY");
            ButtonExportLibrary.Click  += ButtonExportLibrary_Click;

            ButtonExportBibTex.Icon    = Icons.GetAppIcon(Icons.ExportBibTex);
            ButtonExportBibTex.Caption = LocalisationManager.Get("LIBRARY/CAP/EXPORT_BIBTEX");
            ButtonExportBibTex.ToolTip = LocalisationManager.Get("LIBRARY/TIP/EXPORT_BIBTEX");
            ButtonExportBibTex.Click  += ButtonExportBibTex_Click;

            ButtonExportWord2007.Icon    = Icons.GetAppIcon(Icons.ExportWord2007);
            ButtonExportWord2007.Caption = LocalisationManager.Get("LIBRARY/CAP/EXPORT_WORD");
            ButtonExportWord2007.ToolTip = LocalisationManager.Get("LIBRARY/TIP/EXPORT_WORD");
            ButtonExportWord2007.Click  += ButtonExportWord2007_Click;

            ButtonExportCitationMatrix.Icon    = Icons.GetAppIcon(Icons.ExportCitationMatrix);
            ButtonExportCitationMatrix.Caption = LocalisationManager.Get("LIBRARY/CAP/EXPORT_CITATION_MATRIX");
            ButtonExportCitationMatrix.ToolTip = LocalisationManager.Get("LIBRARY/TIP/EXPORT_CITATION_MATRIX");
            ButtonExportCitationMatrix.Click  += ButtonExportCitationMatrix_Click;

            ButtonExportLinkedDocs.Icon    = Icons.GetAppIcon(Icons.ExportCitationMatrix);
            ButtonExportLinkedDocs.Caption = LocalisationManager.Get("LIBRARY/CAP/EXPORT_LINKED_DOCS");
            ButtonExportLinkedDocs.ToolTip = LocalisationManager.Get("LIBRARY/TIP/EXPORT_LINKED_DOCS");
            ButtonExportLinkedDocs.Click  += ButtonExportLinkedDocs_Click;

            ButtonBuildBundleLibrary.Icon    = Icons.GetAppIcon(Icons.BuildBundleLibrary);
            ButtonBuildBundleLibrary.Caption = LocalisationManager.Get("LIBRARY/CAP/BUILD_BUNDLE_LIBRARY");
            ButtonBuildBundleLibrary.ToolTip = LocalisationManager.Get("LIBRARY/TIP/BUILD_BUNDLE_LIBRARY");
            ButtonBuildBundleLibrary.Click  += ButtonBuildBundleLibrary_Click;

            ButtonExportAnnotationsCode.Icon    = Icons.GetAppIcon(Icons.ExportBibTex);
            ButtonExportAnnotationsCode.Caption = LocalisationManager.Get("LIBRARY/CAP/EXPORT_ANNOTATIONS_CODE");
            ButtonExportAnnotationsCode.ToolTip = LocalisationManager.Get("LIBRARY/TIP/EXPORT_ANNOTATIONS_CODE");
            ButtonExportAnnotationsCode.Click  += ButtonExportAnnotationsCode_Click;

            ButtonAddDocuments.Icon    = Icons.GetAppIcon(Icons.DocumentsAddToLibrary);
            ButtonAddDocuments.Caption = LocalisationManager.Get("LIBRARY/CAP/ADD_DOCUMENTS");
            ButtonAddDocuments.ToolTip = LocalisationManager.Get("LIBRARY/TIP/ADD_DOCUMENTS");
            ButtonAddDocuments.Click  += ButtonAddDocuments_Click;

            ButtonAddDocumentsFromFolder.Icon    = Icons.GetAppIcon(Icons.DocumentsAddToLibraryFromFolder);
            ButtonAddDocumentsFromFolder.Caption = LocalisationManager.Get("LIBRARY/CAP/ADD_FOLDER");
            ButtonAddDocumentsFromFolder.ToolTip = LocalisationManager.Get("LIBRARY/TIP/ADD_FOLDER");
            ButtonAddDocumentsFromFolder.Click  += ButtonAddDocumentsFromFolder_Click;

            ButtonAddDocumentsFromLibrary.Icon    = Icons.GetAppIcon(Icons.DocumentsAddToLibraryFromLibrary);
            ButtonAddDocumentsFromLibrary.Caption = LocalisationManager.Get("LIBRARY/CAP/ADD_LIBRARY");
            ButtonAddDocumentsFromLibrary.ToolTip = LocalisationManager.Get("LIBRARY/TIP/ADD_LIBRARY");
            ButtonAddDocumentsFromLibrary.Click  += ButtonAddDocumentsFromLibrary_Click;

            ButtonWatchFolder.Icon    = Icons.GetAppIcon(Icons.DocumentsWatchFolder);
            ButtonWatchFolder.Caption = LocalisationManager.Get("LIBRARY/CAP/WATCH_FOLDER");
            ButtonWatchFolder.ToolTip = LocalisationManager.Get("LIBRARY/TIP/WATCH_FOLDER");
            ButtonWatchFolder.Click  += ButtonWatchFolder_Click;

            ButtonImportFromThirdParty.Icon    = Icons.GetAppIcon(Icons.DocumentsImportFromThirdParty);
            ButtonImportFromThirdParty.Caption = LocalisationManager.Get("LIBRARY/CAP/ADD_IMPORT");
            ButtonImportFromThirdParty.ToolTip = LocalisationManager.Get("LIBRARY/TIP/ADD_IMPORT");
            ButtonImportFromThirdParty.Click  += ButtonImportFromThirdParty_Click;

            ButtonAddMissingDocumentsFromSelf.Icon    = Icons.GetAppIcon(Icons.DocumentsAddMissingFromSelf);
            ButtonAddMissingDocumentsFromSelf.Caption = "Recover unregistered PDFs in this library";
            ButtonAddMissingDocumentsFromSelf.ToolTip = "This is a live library recovery/restoration operation: inspect the current library's storage and re-register all PDFs in there, which have not been registered in the library already.";
            ButtonAddMissingDocumentsFromSelf.Click  += ButtonAddMissingDocumentsFromSelf_Click;

            ObjLibraryEmptyDescriptionText.Background = ThemeColours.Background_Brush_Blue_LightToDark;

            // Tie all our GUI objects together
            ObjLibraryFilterControl.library_filter_control_search = ObjLibraryFilterControl_Search;
            ObjLibraryFilterControl_Search.library_filter_control = ObjLibraryFilterControl;

            ObjLibraryFilterControl.OnFilterChanged += ObjLibraryFilterControl_OnFilterChanged;
            ObjLibraryFilterControl.OnFilterChanged += ObjLibraryFilterOverviewControl.OnFilterChanged;
            ObjLibraryFilterControl.OnFilterChanged += ObjLibraryCatalogControl.OnFilterChanged;

            ObjLibraryFilterControl.LibraryRef = web_library_detail;
            ObjLibraryFilterControl.ResetFilters(true);

            ObjLibraryCatalogControl.LibraryRef = web_library_detail;

            // Catch some keyboard commands
            KeyDown += LibraryControl_KeyDown;

            if (!ADVANCED_MENUS)
            {
                ButtonWebcast.Caption = "Tutorial\n";
            }
            Webcasts.FormatWebcastButton(ButtonWebcast, Webcasts.LIBRARY);

            // IF the library is read-only?
            ReflectReadOnlyStatus();

            Logging.Debug("-LibraryControl()");
        }