public SolutionExplorerTool() { InitializeComponent(); this.Title = "Solution Explorer"; // Set the image list. this.m_LinuxImageList = Associations.ImageList as LinuxImageList; // Set the solution model. m_Log.Debug("Setting solution model to tool window."); this.c_TreeView.HeaderHidden = true; this.m_CurrentModel = new SolutionModel(this); LinuxNativePool.Instance.Retain(this.m_CurrentModel); this.c_TreeView.SetModel(this.m_CurrentModel); m_Log.Debug("Solution model has been initialized."); }
public override QVariant Data(QModelIndex index, int role) { string start = "Data of " + this.SerializeModelIndex(index) + " requested with role " + role; if (!index.IsValid()) { m_Log.Debug(start + " (answer: empty)."); return(new QVariant()); } if (role != (int)ItemDataRole.DisplayRole && role != (int)ItemDataRole.DecorationRole) { m_Log.Debug(start + " (answer: empty)."); return(new QVariant()); } if (index.Column() == 0) { if (role == (int)ItemDataRole.DisplayRole) { m_Log.Debug(start + " (answer: \"" + (index.InternalPointer() as SolutionItem).Text + "\")."); return((index.InternalPointer() as SolutionItem).Text); } else if (role == (int)ItemDataRole.DecorationRole) { string key = (index.InternalPointer() as SolutionItem).ImageKey; System.Drawing.Image image = this.m_ExplorerTool.m_LinuxImageList[key]; if (image == null) { m_Log.Error("No association icon found for image key '" + key + "'."); } else { m_Log.Debug(start + " (answer: <qicon>)."); return(LinuxImageList.ConvertToQIcon(image)); } } } m_Log.Debug(start + " (answer: empty)."); return(new QVariant()); }
public void Resync() { if (this.Target == null) { return; } Moai.Platform.Menus.Action.ActionSyncData data = this.Target.GetSyncData() as Moai.Platform.Menus.Action.ActionSyncData; this.Text = data.Text; //this.ReleaseShortcut((int)data.UserData.Object); //data.UserData.Object = this.GrabShortcut(KeyUtil.FromPlatform(data.Shortcut)); this.Enabled = data.Enabled && data.Implemented; if (data.ItemIcon != null) { this.icon = LinuxImageList.ConvertToQIcon(data.ItemIcon); this.IconVisibleInMenu = true; } else { this.IconVisibleInMenu = false; } }
public LinuxIDE() { InitializeComponent(); this.WindowTitle = "Moai IDE (" + Versioning.Version.GetVersionString() + ")"; this.WindowIcon = LinuxImageList.ConvertToQIcon(Properties.Resources.MoaiIcon); }