|
From: <sv...@va...> - 2011-06-28 15:35:56
|
Author: cerion
Date: 2011-06-28 16:31:04 +0100 (Tue, 28 Jun 2011)
New Revision: 537
Log:
improved layout a little
got icons working again
some vkPrintErr instead of cerr
Modified:
trunk/src/mainwindow.cpp
trunk/src/mainwindow.h
trunk/src/objects/valkyrie_object.cpp
trunk/src/options/helgrind_options_page.h
trunk/src/options/memcheck_options_page.h
trunk/src/options/vk_options_page.h
trunk/src/toolview/helgrindview.cpp
trunk/src/toolview/memcheckview.cpp
Modified: trunk/src/mainwindow.cpp
===================================================================
--- trunk/src/mainwindow.cpp 2011-06-28 11:45:42 UTC (rev 536)
+++ trunk/src/mainwindow.cpp 2011-06-28 15:31:04 UTC (rev 537)
@@ -77,7 +77,7 @@
lastPalette = qApp->palette();
QIcon icon_vk;
- icon_vk.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/valkyrie.xpm" ) ), QIcon::Normal, QIcon::Off );
+ icon_vk.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/valkyrie.xpm" ) ) );
setWindowIcon( icon_vk );
// handbook: init before menubar / toolbar
@@ -89,7 +89,6 @@
setupMenus();
setupToolBars();
setupStatusBar();
- setStatus( "Status message goes here..." );
// functions for dealing with config updates
VkOption* opt = valkyrie->getOption( VALKYRIE::ICONTXT );
@@ -128,8 +127,6 @@
*/
MainWindow::~MainWindow()
{
- // cerr << "MainWindow::~MainWindow()" << endl;
-
// cleanup toolviews
delete toolViewStack;
@@ -196,9 +193,9 @@
actFile_NewProj->setText( tr( "&New Project..." ) );
actFile_NewProj->setToolTip( tr( "Create a project to save your configuration" ) );
QIcon icon_newproj;
- icon_newproj.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/filenew.png" ) ),
- QIcon::Normal, QIcon::Off );
+ icon_newproj.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/filenew.png" ) ) );
actFile_NewProj->setIcon( icon_newproj );
+ actFile_NewProj->setIconVisibleInMenu( true );
connect( actFile_NewProj, SIGNAL( triggered() ), this, SLOT( createNewProject() ) );
actFile_OpenProj = new QAction( this );
@@ -206,9 +203,9 @@
actFile_OpenProj->setText( tr( "&Open Project..." ) );
actFile_OpenProj->setToolTip( tr( "Open an existing project to load a saved configuration" ) );
QIcon icon_openproj;
- icon_openproj.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/folder_blue.png" ) ),
- QIcon::Normal, QIcon::Off );
+ icon_openproj.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/folder_blue.png" ) ) );
actFile_OpenProj->setIcon( icon_openproj );
+ actFile_OpenProj->setIconVisibleInMenu( true );
connect( actFile_OpenProj, SIGNAL( triggered() ), this, SLOT( openProject() ) );
for (int i = 0; i < MaxRecentProjs; ++i) {
@@ -222,9 +219,9 @@
actFile_SaveAs->setText( tr( "Save &As..." ) );
actFile_SaveAs->setToolTip( tr( "Save current configuration to a new project" ) );
QIcon icon_saveas;
- icon_saveas.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/filesaveas.png" ) ),
- QIcon::Normal, QIcon::Off );
+ icon_saveas.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/filesaveas.png" ) ) );
actFile_SaveAs->setIcon( icon_saveas );
+ actFile_SaveAs->setIconVisibleInMenu( true );
connect( actFile_SaveAs, SIGNAL( triggered() ), this, SLOT( saveAsProject() ) );
actFile_Close = new QAction( this );
@@ -238,9 +235,9 @@
actFile_Exit->setText( tr( "E&xit" ) );
actFile_Exit->setToolTip( tr( "Exit Valkyrie" ) );
QIcon icon_exit;
- icon_exit.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/exit.png" ) ),
- QIcon::Normal, QIcon::Off );
+ icon_exit.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/exit.png" ) ) );
actFile_Exit->setIcon( icon_exit );
+ actFile_Exit->setIconVisibleInMenu( true );
connect( actFile_Exit, SIGNAL( triggered() ), qApp, SLOT( closeAllWindows() ) );
actEdit_Options = new QAction( this );
@@ -248,9 +245,9 @@
actEdit_Options->setText( tr( "O&ptions" ) );
actEdit_Options->setToolTip( tr( "Open the options-editing window" ) );
QIcon icon_options;
- icon_options.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/gear.png" ) ),
- QIcon::Normal, QIcon::Off );
+ icon_options.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/gear.png" ) ) );
actEdit_Options->setIcon( icon_options );
+ actEdit_Options->setIconVisibleInMenu( true );
connect( actEdit_Options, SIGNAL( triggered() ), this, SLOT( openOptions() ) );
actProcess_Run = new QAction( this );
@@ -259,8 +256,7 @@
actProcess_Run->setToolTip( tr( "Run Valgrind with the currently active tool" ) );
actProcess_Run->setShortcut( QString::fromUtf8( "Ctrl+R" ) );
QIcon icon_run;
- icon_run.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/valgrind_run.png" ) ),
- QIcon::Normal, QIcon::Off );
+ icon_run.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/valgrind_run.png" ) ) );
actProcess_Run->setIcon( icon_run );
actProcess_Run->setIconVisibleInMenu( true );
connect( actProcess_Run, SIGNAL( triggered() ), this, SLOT( runValgrind() ) );
@@ -270,9 +266,9 @@
actProcess_Stop->setText( tr( "S&top" ) );
actProcess_Stop->setToolTip( tr( "Stop Valgrind" ) );
QIcon icon_stop;
- icon_stop.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/valgrind_stop.png" ) ),
- QIcon::Normal, QIcon::Off );
+ icon_stop.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/valgrind_stop.png" ) ) );
actProcess_Stop->setIcon( icon_stop );
+ actProcess_Stop->setIconVisibleInMenu( true );
connect( actProcess_Stop, SIGNAL( triggered() ), this, SLOT( stopTool() ) );
actHelp_Handbook = new QAction( this );
@@ -281,8 +277,9 @@
actHelp_Handbook->setToolTip( tr( "Open the Valkyrie Handbook" ) );
actHelp_Handbook->setShortcut( QString::fromUtf8( "F1" ) );
QIcon icon_handbook;
- icon_handbook.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/tb_handbook_help.xpm" ) ), QIcon::Normal, QIcon::Off );
+ icon_handbook.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/tb_handbook_help.xpm" ) ) );
actHelp_Handbook->setIcon( icon_handbook );
+ actHelp_Handbook->setIconVisibleInMenu( true );
connect( actHelp_Handbook, SIGNAL( triggered() ), this, SLOT( openHandBook() ) );
actHelp_About_Valkyrie = new QAction( this );
@@ -317,8 +314,7 @@
this, SLOT( toolGroupTriggered( QAction* ) ) );
QIcon icon_bullet;
- icon_bullet.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/tb_mainwin_blackbullet.xpm" ) ),
- QIcon::Normal, QIcon::Off );
+ icon_bullet.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/tb_mainwin_blackbullet.xpm" ) ) );
ToolObjList tools = valkyrie->valgrind()->getToolObjList();
vk_assert( tools.size() > 0 );
@@ -463,7 +459,6 @@
statusLabel = new QLabel( mainStatusBar );
statusLabel->setObjectName( QString::fromUtf8( "statusLabel " ) );
- mainStatusBar->addWidget( new QLabel(" "), 0); // spacing
mainStatusBar->addWidget( statusLabel, 1 );
// mainStatusBar->addPermanentWidget( permanentLabel, 0 );
}
@@ -531,7 +526,7 @@
connect( nextTool, SIGNAL( running( bool ) ),
this, SLOT( updateVgButtons( bool ) ) );
connect( nextTool, SIGNAL( message( QString ) ),
- this, SLOT( setStatus( QString ) ) );
+ statusLabel, SLOT( setText( QString ) ) );
// Set a vg logfile. Loading done by tool_object
connect( nextView, SIGNAL( logFileChosen( QString ) ),
@@ -926,8 +921,7 @@
int numRecentProjs = qMin(files.size(), (int)MaxRecentProjs);
for (int i = 0; i < numRecentProjs; ++i) {
- QString text = tr("&%1 %2").arg( i+1 )
- .arg( QFileInfo( files[i] ).fileName() );
+ QString text = QFileInfo( files[i] ).fileName();
actFile_RecentProjs[i]->setText(text);
actFile_RecentProjs[i]->setData(files[i]);
actFile_RecentProjs[i]->setVisible(true);
@@ -950,16 +944,16 @@
// if there ain't no toolview, we cain't do much
if ( tv == 0 ) {
- cerr << "MainWindow::closeToolView(): No toolview!" << endl;
+ vkPrintErr( "MainWindow::closeToolView(): No toolview. "
+ "This shouldn't happen!" );
return;
}
- cerr << "MainWindow::closeToolView(): " <<
- tv->objectName().toLatin1().data() << endl;
+ vkDebug( "MainWindow::closeToolView(): %s", qPrintable( tv->objectName() ) );
// last process might not be done ...
if ( !valkyrie->queryToolDone( toolViewStack->currentToolId() ) ) {
- cerr << "Warning: Last process not finished" << endl;
+ vkPrintErr( "Warning: Last process not finished" );
return;
}
@@ -970,17 +964,7 @@
}
-/*!
- Set the status message for the main status bar
-*/
-void MainWindow::setStatus( QString msg )
-{
- statusLabel->setText( "Vk: " + msg );
-}
-
-
-
/*!
Calls showToolView() for a chosen valgrind tool.
@@ -993,9 +977,6 @@
void MainWindow::toolGroupTriggered( QAction* action )
{
VGTOOL::ToolID toolId = ( VGTOOL::ToolID )action->property( "toolId" ).toInt();
-
- // cerr << "MainWindow::toolGroupTriggered() for toolview " << toolId << endl;
-
showToolView( toolId );
}
@@ -1031,15 +1012,14 @@
void MainWindow::runTool( VGTOOL::ToolProcessId procId )
{
VGTOOL::ToolID tId = toolViewStack->currentToolId();
- cerr << "MainWindow::runTool( tool: " << tId
- << ", proc: " << procId << " )" << endl;
-
+
vk_assert( procId > VGTOOL::PROC_NONE );
-
+
// don't come in here if there's no current view
if ( !toolViewStack->isVisible() ) {
//This should never happen... assert?
- cerr << "Error: No toolview visible!" << endl;
+ vkPrintErr( "Error: No toolview visible (procId=%d)."
+ "This shouldn't happen!", procId );
return;
}
@@ -1060,7 +1040,7 @@
// last process might not be done ...
if ( !valkyrie->queryToolDone( tId ) ) {
- cerr << "Warning: Last process not finished" << endl;
+ vkPrintErr( "Warning: Last process not finished" );
return;
}
Modified: trunk/src/mainwindow.h
===================================================================
--- trunk/src/mainwindow.h 2011-06-28 11:45:42 UTC (rev 536)
+++ trunk/src/mainwindow.h 2011-06-28 15:31:04 UTC (rev 537)
@@ -54,7 +54,6 @@
}
public slots:
- void setStatus( QString msg );
void showToolView( VGTOOL::ToolID toolId );
void runTool( VGTOOL::ToolProcessId procId );
void openOptions();
Modified: trunk/src/objects/valkyrie_object.cpp
===================================================================
--- trunk/src/objects/valkyrie_object.cpp 2011-06-28 11:45:42 UTC (rev 536)
+++ trunk/src/objects/valkyrie_object.cpp 2011-06-28 15:31:04 UTC (rev 537)
@@ -699,8 +699,6 @@
*/
bool Valkyrie::runTool( VGTOOL::ToolID tId, VGTOOL::ToolProcessId procId )
{
- cerr << "Valkyrie::runTool( " << tId << ", " << procId << ")" << endl;
-
vk_assert( tId != VGTOOL::ID_NULL );
ToolObject* activeTool = valgrind()->getToolObj( tId );
vk_assert( activeTool != 0 );
Modified: trunk/src/options/helgrind_options_page.h
===================================================================
--- trunk/src/options/helgrind_options_page.h 2011-06-28 11:45:42 UTC (rev 536)
+++ trunk/src/options/helgrind_options_page.h 2011-06-28 15:31:04 UTC (rev 537)
@@ -18,7 +18,6 @@
**
****************************************************************************/
-
#ifndef __HELGRIND_OPTIONS_PAGE_H
#define __HELGRIND_OPTIONS_PAGE_H
Modified: trunk/src/options/memcheck_options_page.h
===================================================================
--- trunk/src/options/memcheck_options_page.h 2011-06-28 11:45:42 UTC (rev 536)
+++ trunk/src/options/memcheck_options_page.h 2011-06-28 15:31:04 UTC (rev 537)
@@ -18,7 +18,6 @@
**
****************************************************************************/
-
#ifndef __MEMCHECK_OPTIONS_PAGE_H
#define __MEMCHECK_OPTIONS_PAGE_H
Modified: trunk/src/options/vk_options_page.h
===================================================================
--- trunk/src/options/vk_options_page.h 2011-06-28 11:45:42 UTC (rev 536)
+++ trunk/src/options/vk_options_page.h 2011-06-28 15:31:04 UTC (rev 537)
@@ -1,7 +1,7 @@
/****************************************************************************
** VkOptionsPage definition
** - Each vkObject has different options | flags | prefs, and
-** creates its own 'page', which is inherited from this base class. *
+** creates its own 'page', which is inherited from this base class.
** - The 'page' is contained within the top-level Options Window.
** --------------------------------------------------------------------------
**
@@ -20,19 +20,6 @@
**
****************************************************************************/
-/* ----------------------------------------------------------------------
- * Definition of class VkOptionsPage options_page.h
- *
- * Each vkObject has different options | flags | prefs, and
- * creates its own 'page', which is inherited from this base class.
- * The 'page' is contained within the top-level Options Window.
- * ----------------------------------------------------------------------
- * This file is part of Valkyrie, a front-end for Valgrind
- * Copyright (C) 2000-2008, OpenWorks LLP <in...@op...>
- * This program is released under the terms of the GNU GPL v.2
- * See the file COPYING for the full license details.
- */
-
#ifndef __VK_OPTIONS_PAGE_H
#define __VK_OPTIONS_PAGE_H
Modified: trunk/src/toolview/helgrindview.cpp
===================================================================
--- trunk/src/toolview/helgrindview.cpp 2011-06-28 11:45:42 UTC (rev 536)
+++ trunk/src/toolview/helgrindview.cpp 2011-06-28 15:31:04 UTC (rev 537)
@@ -127,7 +127,7 @@
*/
void HelgrindView::openLogFile()
{
-// cerr << "HelgrindView::openLogFile()" << endl;
+ //vkDebug( "HelgrindView::openLogFile()\n" );
QString last_file = vkCfgProj->value( "valkyrie/view-log" ).toString();
if ( last_file.isEmpty() ) last_file = "./";
@@ -155,7 +155,8 @@
void HelgrindView::setupLayout()
{
QVBoxLayout* vLayout = new QVBoxLayout( this );
-
+ vLayout->setMargin(0);
+
treeView = new QTreeWidget( this );
treeView->setObjectName( QString::fromUtf8( "treeview_Helgrind" ) );
treeView->setHeaderHidden( true );
@@ -174,43 +175,43 @@
act_OpenClose_item = new QAction( this );
act_OpenClose_item->setObjectName( QString::fromUtf8( "act_OpenClose_item" ) );
QIcon icon_opencloseitem;
- icon_opencloseitem.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/item_open.png" ) ),
- QIcon::Normal, QIcon::Off );
+ icon_opencloseitem.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/item_open.png" ) ) );
act_OpenClose_item->setIcon( icon_opencloseitem );
+ act_OpenClose_item->setIconVisibleInMenu( true );
connect( act_OpenClose_item, SIGNAL( triggered() ),
this, SLOT( opencloseOneItem() ) );
act_OpenClose_all = new QAction( this );
act_OpenClose_all->setObjectName( QString::fromUtf8( "act_OpenClose_all" ) );
QIcon icon_opencloseall;
- icon_opencloseall.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/tree_open.png" ) ),
- QIcon::Normal, QIcon::Off );
+ icon_opencloseall.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/tree_open.png" ) ) );
act_OpenClose_all->setIcon( icon_opencloseall );
+ act_OpenClose_all->setIconVisibleInMenu( true );
connect( act_OpenClose_all, SIGNAL( triggered() ),
this, SLOT( opencloseAllItems() ) );
act_ShowSrcPaths = new QAction( this );
act_ShowSrcPaths->setObjectName( QString::fromUtf8( "act_ShowSrcPaths" ) );
QIcon icon_showsrcpaths;
- icon_showsrcpaths.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/text_more.png" ) ),
- QIcon::Normal, QIcon::Off );
+ icon_showsrcpaths.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/text_more.png" ) ) );
act_ShowSrcPaths->setIcon( icon_showsrcpaths );
+ act_ShowSrcPaths->setIconVisibleInMenu( true );
connect( act_ShowSrcPaths, SIGNAL( triggered() ), this, SLOT( showSrcPath() ) );
act_OpenLog = new QAction( this );
act_OpenLog->setObjectName( QString::fromUtf8( "act_OpenLog" ) );
QIcon icon_openlog;
- icon_openlog.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/folder_green.png" ) ),
- QIcon::Normal, QIcon::Off );
+ icon_openlog.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/folder_green.png" ) ) );
act_OpenLog->setIcon( icon_openlog );
+ act_OpenLog->setIconVisibleInMenu( true );
connect( act_OpenLog, SIGNAL( triggered() ), this, SLOT( openLogFile() ) );
act_SaveLog = new QAction( this );
act_SaveLog->setObjectName( QString::fromUtf8( "act_SaveLog" ) );
QIcon icon_savelog;
- icon_savelog.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/filesaveas.png" ) ),
- QIcon::Normal, QIcon::Off );
+ icon_savelog.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/filesaveas.png" ) ) );
act_SaveLog->setIcon( icon_savelog );
+ act_SaveLog->setIconVisibleInMenu( true );
connect( act_SaveLog, SIGNAL( triggered() ), this, SIGNAL( saveLogFile() ) );
// ------------------------------------------------------------
@@ -305,7 +306,7 @@
*/
void HelgrindView::launchEditor( QTreeWidgetItem* item )
{
-// cerr << "HelgrindView::launchEditor(): " << qPrintable( item->text( 0 ) ) << endl;
+ //vkDebug( "HelgrindView::launchEditor( %s )", qPrintable( item->text( 0 ) ) );
VgOutputItem* vgItemCurr = (VgOutputItem*)item;
if ( !vgItemCurr ||
@@ -389,7 +390,7 @@
*/
void HelgrindView::showSrcPath()
{
-// cerr << "HelgrindView::showSrcPath()" << endl;
+ //vkDebug( "HelgrindView::showSrcPath()" );
if ( treeView->topLevelItemCount() == 0 ) {
return;
@@ -440,7 +441,7 @@
*/
void HelgrindView::opencloseAllItems()
{
-// cerr << "HelgrindView::opencloseAllItems()" << endl;
+ //vkDebug( "HelgrindView::opencloseAllItems()" );
if ( treeView->topLevelItemCount() == 0 ) {
// empty tree.
@@ -449,7 +450,7 @@
VgOutputItem* vgItemTop = (VgOutputItem*)treeView->topLevelItem( 0 );
if ( !vgItemTop || vgItemTop->childCount() == 0 ) {
- cerr << "Error: listview not populated as expected" << endl;
+ vkPrintErr( "Error: listview not populated. This shouldn't happen!" );
return;
}
@@ -479,9 +480,8 @@
}
}
if ( idxItemERR == -1 ) {
- // first ERROR element not found :-(
- cerr << "Error: listview not populated as expected "
- << "(no VG_ELEM::ERROR found)" << endl;
+ // first ERROR element not found - perhaps there were no errors!
+ vkDebug( "No VG_ELEM::ERROR found." );
return;
}
@@ -516,6 +516,8 @@
*/
void HelgrindView::opencloseOneItem()
{
+ //vkDebug( "HelgrindView::opencloseOneItem():" );
+
QTreeWidgetItem* item = treeView->currentItem();
if ( item == 0 )
return;
@@ -536,7 +538,7 @@
*/
void HelgrindView::itemExpanded( QTreeWidgetItem* item )
{
-// cerr << "HelgrindView::itemExpanded(): " << endl;
+ //vkDebug( "HelgrindView::itemExpanded():" );
((VgOutputItem*)item)->openChildren();
}
@@ -546,7 +548,7 @@
*/
void HelgrindView::itemCollapsed( QTreeWidgetItem* item )
{
-// cerr << "HelgrindView::itemCollapsed(): " << endl;
+ //vkDebug( "HelgrindView::itemCollapsed():" );
if ( item != treeView->currentItem() ) {
// this should be a slot. grr!
@@ -560,7 +562,7 @@
*/
void HelgrindView::updateItemActions()
{
-// cerr << "HelgrindView::updateItemActions(): " << endl;
+ //vkDebug( "HelgrindView::updateItemActions():" );
QTreeWidgetItem* item = treeView->currentItem();
if ( !item ) {
Modified: trunk/src/toolview/memcheckview.cpp
===================================================================
--- trunk/src/toolview/memcheckview.cpp 2011-06-28 11:45:42 UTC (rev 536)
+++ trunk/src/toolview/memcheckview.cpp 2011-06-28 15:31:04 UTC (rev 537)
@@ -3,7 +3,7 @@
** - memcheck's personal window
** --------------------------------------------------------------------------
**
-** Copyright (C) 2000-2009, OpenWorks LLP. All rights reserved.
+** Copyright (C) 2000-2011, OpenWorks LLP. All rights reserved.
** <in...@op...>
**
** This file is part of Valkyrie, a front-end for Valgrind.
@@ -133,7 +133,7 @@
*/
void MemcheckView::openLogFile()
{
-// cerr << "MemcheckView::openLogFile()" << endl;
+ //vkDebug( "MemcheckView::openLogFile()" );
QString last_file = vkCfgProj->value( "valkyrie/view-log" ).toString();
if ( last_file.isEmpty() ) last_file = "./";
@@ -161,6 +161,7 @@
void MemcheckView::setupLayout()
{
QVBoxLayout* vLayout = new QVBoxLayout( this );
+ vLayout->setMargin(0);
treeView = new QTreeWidget( this );
treeView->setObjectName( QString::fromUtf8( "treeview_Memcheck" ) );
@@ -185,43 +186,43 @@
act_OpenClose_item = new QAction( this );
act_OpenClose_item->setObjectName( QString::fromUtf8( "act_OpenClose_item" ) );
QIcon icon_opencloseitem;
- icon_opencloseitem.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/item_open.png" ) ),
- QIcon::Normal, QIcon::Off );
+ icon_opencloseitem.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/item_open.png" ) ) );
act_OpenClose_item->setIcon( icon_opencloseitem );
+ act_OpenClose_item->setIconVisibleInMenu( true );
connect( act_OpenClose_item, SIGNAL( triggered() ),
this, SLOT( opencloseOneItem() ) );
act_OpenClose_all = new QAction( this );
act_OpenClose_all->setObjectName( QString::fromUtf8( "act_OpenClose_all" ) );
QIcon icon_opencloseall;
- icon_opencloseall.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/tree_open.png" ) ),
- QIcon::Normal, QIcon::Off );
+ icon_opencloseall.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/tree_open.png" ) ) );
act_OpenClose_all->setIcon( icon_opencloseall );
+ act_OpenClose_all->setIconVisibleInMenu( true );
connect( act_OpenClose_all, SIGNAL( triggered() ),
this, SLOT( opencloseAllItems() ) );
act_ShowSrcPaths = new QAction( this );
act_ShowSrcPaths->setObjectName( QString::fromUtf8( "act_ShowSrcPaths" ) );
QIcon icon_showsrcpaths;
- icon_showsrcpaths.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/text_more.png" ) ),
- QIcon::Normal, QIcon::Off );
+ icon_showsrcpaths.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/text_more.png" ) ) );
act_ShowSrcPaths->setIcon( icon_showsrcpaths );
+ act_ShowSrcPaths->setIconVisibleInMenu( true );
connect( act_ShowSrcPaths, SIGNAL( triggered() ), this, SLOT( showSrcPath() ) );
act_OpenLog = new QAction( this );
act_OpenLog->setObjectName( QString::fromUtf8( "act_OpenLog" ) );
QIcon icon_openlog;
- icon_openlog.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/folder_green.png" ) ),
- QIcon::Normal, QIcon::Off );
+ icon_openlog.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/folder_green.png" ) ) );
act_OpenLog->setIcon( icon_openlog );
+ act_OpenLog->setIconVisibleInMenu( true );
connect( act_OpenLog, SIGNAL( triggered() ), this, SLOT( openLogFile() ) );
act_SaveLog = new QAction( this );
act_SaveLog->setObjectName( QString::fromUtf8( "act_SaveLog" ) );
QIcon icon_savelog;
- icon_savelog.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/filesaveas.png" ) ),
- QIcon::Normal, QIcon::Off );
+ icon_savelog.addPixmap( QPixmap( QString::fromUtf8( ":/vk_icons/icons/filesaveas.png" ) ) );
act_SaveLog->setIcon( icon_savelog );
+ act_SaveLog->setIconVisibleInMenu( true );
connect( act_SaveLog, SIGNAL( triggered() ), this, SIGNAL( saveLogFile() ) );
// ------------------------------------------------------------
@@ -279,6 +280,8 @@
*/
void MemcheckView::setState( bool run )
{
+ //vkDebug( "MemcheckView::setState( %d )", run );
+
act_OpenLog->setEnabled( !run ); // just turn off while running
if ( run ) {
@@ -316,7 +319,7 @@
*/
void MemcheckView::launchEditor( QTreeWidgetItem* item )
{
-// cerr << "MemcheckView::launchEditor(): " << qPrintable( item->text( 0 ) ) << endl;
+ vkDebug( "MemcheckView::launchEditor( %s )", qPrintable( item->text( 0 ) ) );
VgOutputItem* vgItemCurr = (VgOutputItem*)item;
if ( !vgItemCurr ||
@@ -397,6 +400,7 @@
void MemcheckView::popupMenu( const QPoint& pos )
{
+ //vkDebug( "MemcheckView::popupMenu()" );
VgOutputItem* item = (VgOutputItem*)treeView->itemAt( pos );
if ( !item ) return;
@@ -469,7 +473,7 @@
*/
void MemcheckView::showSrcPath()
{
-// cerr << "MemcheckView::showSrcPath()" << endl;
+ //vkDebug( "MemcheckView::showSrcPath()" );
if ( treeView->topLevelItemCount() == 0 ) {
return;
@@ -520,7 +524,7 @@
*/
void MemcheckView::opencloseAllItems()
{
-// cerr << "MemcheckView::opencloseAllItems()" << endl;
+ //vkDebug( "MemcheckView::opencloseAllItems()" );
if ( treeView->topLevelItemCount() == 0 ) {
// empty tree.
@@ -529,7 +533,7 @@
VgOutputItem* vgItemTop = (VgOutputItem*)treeView->topLevelItem( 0 );
if ( !vgItemTop || vgItemTop->childCount() == 0 ) {
- cerr << "Error: listview not populated as expected" << endl;
+ vkPrintErr( "Error: listview not populated. This shouldn't happen!" );
return;
}
@@ -560,8 +564,7 @@
}
if ( idxItemERR == -1 ) {
// first ERROR element not found :-(
- cerr << "Error: listview not populated as expected "
- << "(no VG_ELEM::ERROR found)" << endl;
+ vkDebug( "No VG_ELEM::ERROR found." );
return;
}
@@ -596,6 +599,7 @@
*/
void MemcheckView::opencloseOneItem()
{
+ //vkDebug( "MemcheckView::opencloseOneItem():" );
QTreeWidgetItem* item = treeView->currentItem();
if ( item == 0 )
return;
@@ -616,7 +620,7 @@
*/
void MemcheckView::itemExpanded( QTreeWidgetItem* item )
{
-// cerr << "MemcheckView::itemExpanded(): " << endl;
+ //vkDebug( "MemcheckView::itemExpanded():" );
((VgOutputItem*)item)->openChildren();
}
@@ -626,7 +630,7 @@
*/
void MemcheckView::itemCollapsed( QTreeWidgetItem* item )
{
-// cerr << "MemcheckView::itemCollapsed(): " << endl;
+ //vkDebug( "MemcheckView::itemCollapsed():" );
if ( item != treeView->currentItem() ) {
// this should be a slot. grr!
@@ -640,7 +644,7 @@
*/
void MemcheckView::updateItemActions()
{
-// cerr << "MemcheckView::updateItemActions(): " << endl;
+ //vkDebug( "MemcheckView::updateItemActions():" );
QTreeWidgetItem* item = treeView->currentItem();
if ( !item ) {
|