Changeset 12841 in vbox
- Timestamp:
- Sep 30, 2008 11:54:56 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 37211
- Location:
- trunk/src/VBox/Debugger
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Debugger/VBoxDbgStatsQt4.cpp
r12840 r12841 35 35 #include <QHBoxLayout> 36 36 #include <QVBoxLayout> 37 #include <QKeySequence> 38 #include <QAction> 39 #include <QContextMenuEvent> 37 40 38 41 #include <VBox/err.h> … … 217 220 * @returns true if we reset the model and it's necessary to set the root index. 218 221 * @param a_rPatStr The selection pattern. 219 */ 220 virtual bool updateStats(const QString &a_rPatStr) = 0; 222 * 223 * @remarks The default implementation is an empty stub. 224 */ 225 virtual bool updateStatsByPattern(const QString &a_rPatStr); 226 227 /** 228 * Similar to updateStatsByPattern, except that it only works on a sub-tree and 229 * will not remove anything that's outside that tree. 230 * 231 * @param a_rIndex The sub-tree root. Invalid index means root. 232 * 233 * @todo Create a default implementation using updateStatsByPattern. 234 */ 235 virtual void updateStatsByIndex(QModelIndex const &a_rIndex); 236 237 /** 238 * Reset the stats matching the specified pattern. 239 * 240 * @param a_rPatStr The selection pattern. 241 * 242 * @remarks The default implementation is an empty stub. 243 */ 244 virtual void resetStatsByPattern(QString const &a_rPatStr); 245 246 /** 247 * Reset the stats of a sub-tree. 248 * 249 * @param a_rIndex The sub-tree root. Invalid index means root. 250 * @param a_fSubTree Whether to reset the sub-tree as well. Default is true. 251 * 252 * @remarks The default implementation makes use of resetStatsByPattern 253 */ 254 virtual void resetStatsByIndex(QModelIndex const &a_rIndex, bool a_fSubTree = true); 221 255 222 256 /** … … 226 260 */ 227 261 QModelIndex getRootIndex(void) const; 262 228 263 229 264 protected: … … 266 301 267 302 /** 268 * Called by updateStats (), makes the necessary preparations.303 * Called by updateStatsByPattern(), makes the necessary preparations. 269 304 * 270 305 * @returns Success indicator. … … 273 308 274 309 /** 275 * Called by updateStats (), finalizes the update.276 * 277 * @return See updateStats ().310 * Called by updateStatsByPattern(), finalizes the update. 311 * 312 * @return See updateStatsByPattern(). 278 313 * 279 314 * @param a_fSuccess Whether the update was successful or not. … … 307 342 void updateCallbackAdvance(PDBGGUISTATSNODE pNode); 308 343 309 /** Callback used by updateStats() to feed changes. 344 /** Callback used by updateStatsByPattern() and updateStatsByIndex() to feed 345 * changes. 310 346 * @copydoc FNSTAMR3ENUM */ 311 347 static DECLCALLBACK(int) updateCallback(const char *pszName, STAMTYPE enmType, void *pvSample, STAMUNIT enmUnit, … … 524 560 virtual ~VBoxDbgStatsModelVM(); 525 561 526 virtual bool updateStats(const QString &a_rPatStr); 562 virtual bool updateStatsByPattern(const QString &a_rPatStr); 563 virtual void resetStatsByPattern(const QString &a_rPatStr); 527 564 528 565 protected: … … 1839 1876 1840 1877 1878 bool 1879 VBoxDbgStatsModel::updateStatsByPattern(const QString &a_rPatStr) 1880 { 1881 /* stub */ 1882 NOREF(a_rPatStr); 1883 return false; 1884 } 1885 1886 1887 void 1888 VBoxDbgStatsModel::updateStatsByIndex(QModelIndex const &a_rIndex) 1889 { 1890 /** @todo implement this based on updateStatsByPattern. */ 1891 NOREF(a_rIndex); 1892 } 1893 1894 1895 void 1896 VBoxDbgStatsModel::resetStatsByPattern(QString const &a_rPatStr) 1897 { 1898 /* stub */ 1899 NOREF(a_rPatStr); 1900 } 1901 1902 1903 void 1904 VBoxDbgStatsModel::resetStatsByIndex(QModelIndex const &a_rIndex, bool fSubTree /*= true*/) 1905 { 1906 PCDBGGUISTATSNODE pNode = nodeFromIndex(a_rIndex); 1907 if (pNode == m_pRoot || !a_rIndex.isValid()) 1908 { 1909 if (fSubTree) 1910 { 1911 /* everything from the root down. */ 1912 resetStatsByPattern(QString()); 1913 } 1914 } 1915 else if (pNode) 1916 { 1917 /* the node pattern. */ 1918 char szPat[1024+1024+4]; 1919 int32_t cch = getNodePath(pNode, szPat, 1024); 1920 AssertReturnVoid(cch >= 0); 1921 1922 /* the sub-tree pattern. */ 1923 if (fSubTree && pNode->cChildren) 1924 { 1925 char *psz = &szPat[cch]; 1926 *psz++ = '|'; 1927 memcpy(psz, szPat, cch); 1928 psz += cch; 1929 *psz++ = '/'; 1930 *psz++ = '*'; 1931 *psz++ = '\0'; 1932 } 1933 1934 resetStatsByPattern(szPat); 1935 } 1936 } 1937 1841 1938 1842 1939 QModelIndex … … 1863 1960 { 1864 1961 Qt::ItemFlags fFlags = QAbstractItemModel::flags(a_rIndex); 1865 #if 01866 PDBGGUISTATSNODE pNode = nodeFromIndex(a_rIndex);1867 if (pNode)1868 {1869 }1870 #endif1871 1962 return fFlags; 1872 1963 } … … 1885 1976 { 1886 1977 PDBGGUISTATSNODE pParent = nodeFromIndex(a_rParent); 1887 return pParent ->cChildren;1978 return pParent ? pParent->cChildren : 0; 1888 1979 } 1889 1980 … … 1904 1995 if (!pParent) 1905 1996 { 1906 printf("index: iRow=%d iColumn=%d invalid parent\n", iRow, iColumn);1997 Log(("index: iRow=%d iColumn=%d invalid parent\n", iRow, iColumn)); 1907 1998 return QModelIndex(); /* bug? */ 1908 1999 } 1909 2000 if ((unsigned)iRow >= pParent->cChildren) 1910 2001 { 1911 printf("index: iRow=%d >= cChildren=%u (iColumn=%d)\n", iRow, (unsigned)pParent->cChildren, iColumn);2002 Log(("index: iRow=%d >= cChildren=%u (iColumn=%d)\n", iRow, (unsigned)pParent->cChildren, iColumn)); 1912 2003 return QModelIndex(); /* bug? */ 1913 2004 } 1914 2005 if ((unsigned)iColumn >= DBGGUI_STATS_COLUMNS) 1915 2006 { 1916 printf("index: iColumn=%d (iRow=%d)\n", iColumn, iRow);2007 Log(("index: iColumn=%d (iRow=%d)\n", iColumn, iRow)); 1917 2008 return QModelIndex(); /* bug? */ 1918 2009 } 1919 2010 PDBGGUISTATSNODE pChild = pParent->papChildren[iRow]; 1920 1921 //printf("index: iRow=%d iColumn=%d %p %s/%s\n", iRow, iColumn, pChild, pParent->pszName, pChild->pszName);1922 2011 return createIndex(iRow, iColumn, pChild); 1923 2012 } … … 1930 2019 if (!pChild) 1931 2020 { 1932 printf("parent: invalid child\n");2021 Log(("parent: invalid child\n")); 1933 2022 return QModelIndex(); /* bug */ 1934 2023 } 1935 2024 PDBGGUISTATSNODE pParent = pChild->pParent; 1936 2025 if (!pParent) 1937 {1938 // printf("parent: root\n");1939 2026 return QModelIndex(); /* we're root */ 1940 } 1941 1942 #if 0 /* this triggers qWarning("Can't select indexes from different model or with different parents") in QItemSelection::select(). */ 1943 //printf("parent: iSelf=%d iColumn=%d %p %s(/%s)\n", pParent->iSelf, a_rChild.column(), pParent, pParent->pszName, pChild->pszName); 1944 return createIndex(pParent->iSelf, a_rChild.column(), pParent); 1945 #else 1946 //printf("parent: iSelf=%d iColumn=%d %p %s(/%s)\n", pParent->iSelf, 0, pParent, pParent->pszName, pChild->pszName); 2027 1947 2028 return createIndex(pParent->iSelf, 0, pParent); 1948 #endif1949 2029 } 1950 2030 … … 2288 2368 2289 2369 bool 2290 VBoxDbgStatsModelVM::updateStats (const QString &a_rPatStr)2370 VBoxDbgStatsModelVM::updateStatsByPattern(const QString &a_rPatStr) 2291 2371 { 2292 2372 /** @todo the way we update this stuff is independent of the source (XML, file, STAM), our only … … 2300 2380 } 2301 2381 return fRc; 2382 } 2383 2384 2385 void 2386 VBoxDbgStatsModelVM::resetStatsByPattern(QString const &a_rPatStr) 2387 { 2388 stamReset(a_rPatStr); 2302 2389 } 2303 2390 … … 2698 2785 2699 2786 VBoxDbgStatsView::VBoxDbgStatsView(PVM a_pVM, VBoxDbgStatsModel *a_pModel, VBoxDbgStats *a_pParent/* = NULL*/) 2700 : QTreeView(a_pParent), VBoxDbgBase(a_pVM), m_pModel(a_pModel), m_ pParent(a_pParent),2701 m_pLeafMenu(NULL), m_pBranchMenu(NULL), m_pViewMenu(NULL), m_pC ontextNode(NULL)2787 : QTreeView(a_pParent), VBoxDbgBase(a_pVM), m_pModel(a_pModel), m_PatStr(), m_pParent(a_pParent), 2788 m_pLeafMenu(NULL), m_pBranchMenu(NULL), m_pViewMenu(NULL), m_pCurMenu(NULL), m_CurIndex() 2702 2789 2703 2790 { … … 2707 2794 setModel(m_pModel); 2708 2795 setRootIndex(m_pModel->getRootIndex()); 2709 //setRootIsDecorated(true);2796 setRootIsDecorated(true); 2710 2797 setItemsExpandable(true); 2711 setSortingEnabled(true); 2712 2713 /* 2714 * We've got three menus to populate and link up. 2715 */ 2716 #ifdef VBOXDBG_USE_QT4 2717 /** @todo */ 2718 2719 #else /* QT3 */ 2720 m_pLeafMenu = new QPopupMenu(this); 2721 m_pLeafMenu->insertItem("Rese&t", eReset); 2722 m_pLeafMenu->insertItem("&Refresh", eRefresh); 2723 m_pLeafMenu->insertItem("&Copy", eCopy); 2724 m_pLeafMenu->insertItem("To &Log", eLog); 2725 m_pLeafMenu->insertItem("T&o Release Log", eLogRel); 2726 connect(m_pLeafMenu, SIGNAL(activated(int)), this, SLOT(leafMenuActivated(int))); 2727 2728 m_pBranchMenu = new QPopupMenu(this); 2729 m_pBranchMenu->insertItem("&Expand Tree", eExpand); 2730 m_pBranchMenu->insertItem("&Collaps Tree", eCollaps); 2731 m_pBranchMenu->insertItem("&Refresh", eRefresh); 2732 m_pBranchMenu->insertItem("Rese&t", eReset); 2733 m_pBranchMenu->insertItem("&Copy", eCopy); 2734 m_pBranchMenu->insertItem("To &Log", eLog); 2735 m_pBranchMenu->insertItem("T&o Release Log", eLogRel); 2736 connect(m_pBranchMenu, SIGNAL(activated(int)), this, SLOT(branchMenuActivated(int))); 2737 2738 m_pViewMenu = new QPopupMenu(this); 2739 m_pViewMenu->insertItem("&Expand All", eExpand); 2740 m_pViewMenu->insertItem("&Collaps All", eCollaps); 2741 m_pViewMenu->insertItem("&Refresh", eRefresh); 2742 m_pViewMenu->insertItem("Rese&t", eReset); 2743 m_pViewMenu->insertItem("&Copy", eCopy); 2744 m_pViewMenu->insertItem("To &Log", eLog); 2745 m_pViewMenu->insertItem("T&o Release Log", eLogRel); 2746 connect(m_pViewMenu, SIGNAL(activated(int)), this, SLOT(viewMenuActivated(int))); 2747 2748 connect(this, SIGNAL(contextMenuRequested(QListViewItem *, const QPoint &, int)), this, 2749 SLOT(contextMenuReq(QListViewItem *, const QPoint &, int))); 2750 #endif /* QT3 */ 2798 setSelectionBehavior(SelectRows); 2799 setSelectionMode(SingleSelection); 2800 /// @todo sorting setSortingEnabled(true); 2801 2802 /* 2803 * Create and setup the actions. 2804 */ 2805 m_pExpandAct = new QAction("Expand Tree", this); 2806 m_pCollapseAct = new QAction("Collapse Tree", this); 2807 m_pRefreshAct = new QAction("&Refresh", this); 2808 m_pResetAct = new QAction("Rese&t", this); 2809 m_pCopyAct = new QAction("&Copy", this); 2810 m_pToLogAct = new QAction("To &Log", this); 2811 m_pToRelLogAct = new QAction("T&o Release Log", this); 2812 2813 m_pCopyAct->setShortcut(QKeySequence::Copy); 2814 m_pExpandAct->setShortcut(QKeySequence("Ctrl+E")); 2815 m_pRefreshAct->setShortcut(QKeySequence("Ctrl+R")); 2816 m_pToLogAct->setShortcut(QKeySequence("Ctrl+L")); 2817 m_pToRelLogAct->setShortcut(QKeySequence("Alt+L")); 2818 2819 connect(m_pExpandAct, SIGNAL(triggered(bool)), this, SLOT(actExpand())); 2820 connect(m_pCollapseAct, SIGNAL(triggered(bool)), this, SLOT(actCollapse())); 2821 connect(m_pRefreshAct, SIGNAL(triggered(bool)), this, SLOT(actRefresh())); 2822 connect(m_pResetAct, SIGNAL(triggered(bool)), this, SLOT(actReset())); 2823 connect(m_pCopyAct, SIGNAL(triggered(bool)), this, SLOT(actCopy())); 2824 connect(m_pToLogAct, SIGNAL(triggered(bool)), this, SLOT(actToLog())); 2825 connect(m_pToRelLogAct, SIGNAL(triggered(bool)), this, SLOT(actToRelLog())); 2826 2827 addAction(m_pExpandAct); /// testing 2828 addAction(m_pCopyAct); /// testing 2829 2830 2831 /* 2832 * Create the menus and populate them. 2833 */ 2834 setContextMenuPolicy(Qt::DefaultContextMenu); 2835 2836 m_pLeafMenu = new QMenu(); 2837 m_pLeafMenu->addAction(m_pCopyAct); 2838 m_pLeafMenu->addAction(m_pRefreshAct); 2839 m_pLeafMenu->addAction(m_pResetAct); 2840 m_pLeafMenu->addAction(m_pToLogAct); 2841 m_pLeafMenu->addAction(m_pToRelLogAct); 2842 2843 m_pBranchMenu = new QMenu(this); 2844 m_pBranchMenu->addAction(m_pCopyAct); 2845 m_pBranchMenu->addAction(m_pRefreshAct); 2846 m_pBranchMenu->addAction(m_pResetAct); 2847 m_pBranchMenu->addAction(m_pToLogAct); 2848 m_pBranchMenu->addAction(m_pToRelLogAct); 2849 m_pBranchMenu->addSeparator(); 2850 m_pBranchMenu->addAction(m_pExpandAct); 2851 m_pBranchMenu->addAction(m_pCollapseAct); 2852 2853 m_pViewMenu = new QMenu(); 2854 m_pBranchMenu->addAction(m_pCopyAct); 2855 m_pBranchMenu->addAction(m_pRefreshAct); 2856 m_pBranchMenu->addAction(m_pResetAct); 2857 m_pBranchMenu->addAction(m_pToLogAct); 2858 m_pBranchMenu->addAction(m_pToRelLogAct); 2859 m_pBranchMenu->addSeparator(); 2860 m_pBranchMenu->addAction(m_pExpandAct); 2861 m_pBranchMenu->addAction(m_pCollapseAct); 2862 m_pBranchMenu->addSeparator(); 2751 2863 } 2752 2864 … … 2762 2874 2763 2875 2764 #if 0 2765 /** 2766 * Hides all parent branches which doesn't have any visible leafs. 2767 */ 2768 static void hideParentBranches(VBoxDbgStatsLeafItem *pItem) 2769 { 2770 #ifdef VBOXDBG_USE_QT4 2771 /// @todo 2772 NOREF(pItem); 2773 #else 2774 for (VBoxDbgStatsItem *pParent = pItem->getParent(); pParent; pParent = pParent->getParent()) 2775 { 2776 QListViewItem *pChild = pParent->firstChild(); 2777 while (pChild && !pChild->isVisible()) 2778 pChild = pChild->nextSibling(); 2779 if (pChild) 2780 return; 2781 pParent->setVisible(false); 2782 } 2783 #endif 2784 } 2785 2786 /** 2787 * Shows all parent branches 2788 */ 2789 static void showParentBranches(VBoxDbgStatsLeafItem *pItem) 2790 { 2791 for (VBoxDbgStatsItem *pParent = pItem->getParent(); pParent; pParent = pParent->getParent()) 2792 pParent->setVisible(true); 2793 } 2794 #endif 2795 2796 2797 void VBoxDbgStatsView::updateStats(const QString &rPatStr) 2798 { 2799 if (m_pModel->updateStats(rPatStr)) 2876 void 2877 VBoxDbgStatsView::updateStats(const QString &rPatStr) 2878 { 2879 m_PatStr = rPatStr; 2880 if (m_pModel->updateStatsByPattern(rPatStr)) 2800 2881 setRootIndex(m_pModel->getRootIndex()); /// @todo this is a hack? 2801 2802 #if 0 /* later */ 2803 m_pCur = m_pHead; 2804 m_PatStr = rPatStr; 2805 int rc = stamEnum(m_PatStr, updateCallback, this); 2806 if (VBOX_SUCCESS(rc)) 2807 { 2808 /* hide what's left */ 2809 for (VBoxDbgStatsLeafItem *pCur = m_pCur; pCur; pCur = pCur->m_pNext) 2810 if (pCur->isVisible()) 2811 { 2812 pCur->setVisible(false); 2813 hideParentBranches(pCur); 2814 } 2815 } 2816 m_pCur = NULL; 2817 #endif 2818 NOREF(rPatStr); 2819 } 2820 2821 void VBoxDbgStatsView::resetStats(const QString &rPatStr) 2822 { 2823 stamReset(rPatStr); 2824 } 2825 2826 2827 #if 0 /* later */ 2882 } 2883 2884 2885 void 2886 VBoxDbgStatsView::contextMenuEvent(QContextMenuEvent *a_pEvt) 2887 { 2888 /* 2889 * Get the selected item. 2890 * If it's a mouse event select the item under the cursor (if any). 2891 */ 2892 QModelIndex Idx; 2893 if (a_pEvt->reason() == QContextMenuEvent::Mouse) 2894 { 2895 Idx = indexAt(a_pEvt->pos()); 2896 if (Idx.isValid()) 2897 setCurrentIndex(Idx); 2898 } 2899 else 2900 { 2901 QModelIndexList SelIdx = selectedIndexes(); 2902 if (!SelIdx.isEmpty()) 2903 Idx = SelIdx.at(0); 2904 } 2905 2906 /* 2907 * Popup the corresponding menu. 2908 */ 2909 QMenu *pMenu; 2910 if (!Idx.isValid()) 2911 pMenu = m_pViewMenu; 2912 else if (m_pModel->hasChildren(Idx)) 2913 pMenu = m_pBranchMenu; 2914 else 2915 pMenu = m_pLeafMenu; 2916 if (pMenu) 2917 { 2918 m_pRefreshAct->setEnabled(!Idx.isValid() || Idx == m_pModel->getRootIndex()); 2919 m_CurIndex = Idx; 2920 m_pCurMenu = pMenu; 2921 2922 pMenu->exec(a_pEvt->globalPos()); 2923 2924 m_pCurMenu = NULL; 2925 m_CurIndex = QModelIndex(); 2926 m_pRefreshAct->setEnabled(true); 2927 } 2928 a_pEvt->accept(); 2929 } 2930 2931 2932 void 2933 VBoxDbgStatsView::actExpand() 2934 { 2935 QModelIndex Idx = m_pCurMenu ? m_CurIndex : currentIndex(); 2936 if (Idx.isValid()) 2937 expand(Idx); 2938 } 2939 2940 2941 void 2942 VBoxDbgStatsView::actCollapse() 2943 { 2944 QModelIndex Idx = m_pCurMenu ? m_CurIndex : currentIndex(); 2945 if (Idx.isValid()) 2946 collapse(Idx); 2947 } 2948 2949 2950 void 2951 VBoxDbgStatsView::actRefresh() 2952 { 2953 QModelIndex Idx = m_pCurMenu ? m_CurIndex : currentIndex(); 2954 if (!Idx.isValid() || Idx == m_pModel->getRootIndex()) 2955 m_pModel->updateStatsByPattern(m_PatStr); 2956 else 2957 m_pModel->updateStatsByIndex(Idx); 2958 } 2959 2960 2961 void 2962 VBoxDbgStatsView::actReset() 2963 { 2964 QModelIndex Idx = m_pCurMenu ? m_CurIndex : currentIndex(); 2965 if (!Idx.isValid() || Idx == m_pModel->getRootIndex()) 2966 m_pModel->resetStatsByPattern(m_PatStr); 2967 else 2968 m_pModel->resetStatsByIndex(Idx); 2969 } 2970 2971 2972 void 2973 VBoxDbgStatsView::actCopy() 2974 { 2975 QModelIndex Idx = m_pCurMenu ? m_CurIndex : currentIndex(); 2976 m_pModel->copyTreeToClipboard(Idx); 2977 } 2978 2979 2980 void 2981 VBoxDbgStatsView::actToLog() 2982 { 2983 QModelIndex Idx = m_pCurMenu ? m_CurIndex : currentIndex(); 2984 m_pModel->logTree(Idx, false /* a_fReleaseLog */); 2985 } 2986 2987 2988 void 2989 VBoxDbgStatsView::actToRelLog() 2990 { 2991 QModelIndex Idx = m_pCurMenu ? m_CurIndex : currentIndex(); 2992 m_pModel->logTree(Idx, true /* a_fReleaseLog */); 2993 } 2994 2995 2996 2997 2998 2999 3000 #if 0 /* later? */ 2828 3001 2829 3002 static void setOpenTree(QListViewItem *pItem, bool f) … … 2840 3013 #endif 2841 3014 } 2842 2843 #ifndef VBOXDBG_USE_QT42844 void VBoxDbgStatsView::expandAll()2845 {2846 setOpenTree(m_pRoot, true);2847 }2848 2849 void VBoxDbgStatsView::collapsAll()2850 {2851 setOpenTree(m_pRoot, false);2852 }2853 #endif /* QT3 */2854 3015 2855 3016 … … 3235 3396 connect(pSB, SIGNAL(valueChanged(int)), this, SLOT(setRefresh(int))); 3236 3397 3237 3238 3398 /* 3239 3399 * Create the tree view and setup the layout. … … 3250 3410 this->setLayout(pVLayout); 3251 3411 3252 #if 0 //fixme 3253 /* 3254 * Perform the first refresh to get a good window size. 3255 * We do this with sorting disabled because it's horribly slow otherwise. 3256 */ 3257 //later: int iColumn = m_pView->sortColumn(); 3258 m_pView->setUpdatesEnabled(false); 3259 m_pView->setSortingEnabled(false); 3260 refresh(); 3261 //later: m_pView->sortItems(iColumn, Qt::AscendingOrder); 3262 // QTreeView::expandAll 3263 #endif 3412 /* 3413 * Expand all and resize columns... 3414 */ 3264 3415 m_pView->expandAll(); 3265 3416 for (int i = 0; i <= 8; i++) 3266 {3267 printf("%#x: %d", i, m_pView->columnWidth(i));3268 3417 m_pView->resizeColumnToContents(i); 3269 printf(" -> %d\n", m_pView->columnWidth(i));3270 }3271 3418 3272 3419 /* -
trunk/src/VBox/Debugger/VBoxDbgStatsQt4.h
r12819 r12841 79 79 80 80 protected slots: 81 //later: /** Context menu. */ 82 //later: void contextMenuReq(QListViewItem *pItem, const QPoint &rPoint, int iColumn); 83 //later: /** Leaf context. */ 84 //later: void leafMenuActivated(int iId); 85 //later: /** Branch context. */ 86 //later: void branchMenuActivated(int iId); 87 //later: /** View context. */ 88 //later: void viewMenuActivated(int iId); 81 /** @name Action signal slots. 82 * @{ */ 83 void actExpand(); 84 void actCollapse(); 85 void actRefresh(); 86 void actReset(); 87 void actCopy(); 88 void actToLog(); 89 void actToRelLog(); 90 /** @} */ 91 92 protected: 93 /** 94 * Popup context menu. 95 * 96 * @param a_pEvt The event. 97 */ 98 virtual void contextMenuEvent(QContextMenuEvent *a_pEvt); 89 99 90 100 protected: … … 98 108 /** The parent widget. */ 99 109 VBoxDbgStats *m_pParent; 110 100 111 /** Leaf item menu. */ 101 112 QMenu *m_pLeafMenu; … … 104 115 /** View menu. */ 105 116 QMenu *m_pViewMenu; 106 /** The pointer to the node which is the current focus of a context menu. */ 107 PDBGGUISTATSNODE m_pContextNode; 117 118 /** The menu that's currently being executed. */ 119 QMenu *m_pCurMenu; 120 /** The current index relating to the context menu. 121 * Considered invalid if m_pCurMenu is NULL. */ 122 QModelIndex m_CurIndex; 123 124 /** Expand Tree action. */ 125 QAction *m_pExpandAct; 126 /** Collapse Tree action. */ 127 QAction *m_pCollapseAct; 128 /** Refresh Tree action. */ 129 QAction *m_pRefreshAct; 130 /** Reset Tree action. */ 131 QAction *m_pResetAct; 132 /** Copy (to clipboard) action. */ 133 QAction *m_pCopyAct; 134 /** To Log action. */ 135 QAction *m_pToLogAct; 136 /** To Release Log action. */ 137 QAction *m_pToRelLogAct; 138 #if 0 139 /** Save Tree (to file) action. */ 140 QAction *m_SaveFileAct; 141 /** Load Tree (from file) action. */ 142 QAction *m_LoadFileAct; 143 /** Take Snapshot action. */ 144 QAction *m_TakeSnapshotAct; 145 /** Load Snapshot action. */ 146 QAction *m_LoadSnapshotAct; 147 /** Diff With Snapshot action. */ 148 QAction *m_DiffSnapshotAct; 149 #endif 108 150 }; 109 151 -
trunk/src/VBox/Debugger/testcase/tstVBoxDbg.cpp
r12478 r12841 62 62 if (RT_SUCCESS(rc)) 63 63 { 64 RTPrintf(TESTCASE ": calling pfnShowCommandLine...\n"); 65 rc = pGuiVT->pfnShowCommandLine(pGui); 66 if (RT_FAILURE(rc)) 64 if (argc <= 1 || argc == 2) 67 65 { 68 RTPrintf(TESTCASE ": error: pfnShowCommandLine failed! rc=%Rrc\n", rc); 69 cErrors++; 66 RTPrintf(TESTCASE ": calling pfnShowCommandLine...\n"); 67 rc = pGuiVT->pfnShowCommandLine(pGui); 68 if (RT_FAILURE(rc)) 69 { 70 RTPrintf(TESTCASE ": error: pfnShowCommandLine failed! rc=%Rrc\n", rc); 71 cErrors++; 72 } 70 73 } 71 74 72 #if 1 73 RTPrintf(TESTCASE ": calling pfnShowStatistics...\n"); 74 pGuiVT->pfnShowStatistics(pGui); 75 if (RT_FAILURE(rc)) 75 if (argc <= 1 || argc == 3) 76 76 { 77 RTPrintf(TESTCASE ": error: pfnShowStatistics failed! rc=%Rrc\n", rc); 78 cErrors++; 77 RTPrintf(TESTCASE ": calling pfnShowStatistics...\n"); 78 pGuiVT->pfnShowStatistics(pGui); 79 if (RT_FAILURE(rc)) 80 { 81 RTPrintf(TESTCASE ": error: pfnShowStatistics failed! rc=%Rrc\n", rc); 82 cErrors++; 83 } 79 84 } 80 #endif81 85 82 pGuiVT->pfnAdjustRelativePos(pGui, 64, 64, 128, 64);86 pGuiVT->pfnAdjustRelativePos(pGui, 0, 0, 640, 480); 83 87 RTPrintf(TESTCASE ": calling App.exec()...\n"); 84 88 App.exec();
Note:
See TracChangeset
for help on using the changeset viewer.