void SystemDataTab::setupSystemToolbar() { m_pToolbar = new Q3ToolBar( this, "System Data View Toolbar" ); RETURN_IF_NULL (m_pToolbar, this); m_pToolbar->setLabel ("System Data View Toolbar" ); m_pToolbar->setMovingEnabled (true); /* Expand / Collapse */ QIcon iconExpandCollapse(QPixmap((const char**)expandCollapseIcon)); m_pExpandCollapse = new QPushButton(iconExpandCollapse, "",m_pToolbar); m_pExpandCollapse->setMaximumHeight(20); m_pExpandCollapse->setMaximumWidth(20); m_pExpandCollapse->setToggleButton(true); connect(m_pExpandCollapse,SIGNAL(toggled(bool)), this,SLOT(onExpandCollapseToggled(bool))); QToolTip::add(m_pExpandCollapse,QString("Expand / Collapse")); /* 64-bit */ QIcon icon64(QPixmap((const char**)sixFourIcon)); m_p64 = new QPushButton(icon64, "",m_pToolbar); m_p64->setMaximumHeight(20); m_p64->setMaximumWidth(20); m_p64->setToggleButton(true); connect(m_p64,SIGNAL(toggled(bool)), this,SLOT(on64Toggled(bool))); QToolTip::add(m_p64,QString("Show 64-bit Column")); /* FIXME [3.1] * Hack for BUG279959:Modules shown as 64-bit on a 32-bit OS * The hack is to hide the "Show 64-bit Column" button on 32-bit OS * since this is not useful on the OS anyways. */ #if defined(__i386__) m_p64->hide(); #endif }
QAction *MainWindow::createAction(const QString icon, const QString toolTip, const QString statusTip, bool scripted) { QAction *ACTION = new QAction(QIcon("icons/" + getSettingsGeneralIconTheme() + "/" + icon + ".png"), toolTip, this); //TODO: Qt4.7 wont load icons without an extension... ACTION->setStatusTip(statusTip); ACTION->setObjectName(icon); // TODO: Set What's This Context Help to statusTip for now so there is some infos there. // Make custom whats this context help popup with more descriptive help than just // the status bar/tip one liner(short but not real long) with a hyperlink in the custom popup // at the bottom to open full help file description. Ex: like wxPython AGW's SuperToolTip. ACTION->setWhatsThis(statusTip); // TODO: Finish All Commands ... <.< if (icon == "donothing") connect(ACTION, SIGNAL(triggered()), this, SLOT(doNothing())); else if(icon == "new") { ACTION->setShortcut(QKeySequence::New); connect(ACTION, SIGNAL(triggered()), this, SLOT(newFile())); } else if(icon == "open") { ACTION->setShortcut(QKeySequence::Open); connect(ACTION, SIGNAL(triggered()), this, SLOT(openFile())); } else if(icon == "save") { ACTION->setShortcut(QKeySequence::Save); connect(ACTION, SIGNAL(triggered()), this, SLOT(savefile())); } else if(icon == "saveas") { ACTION->setShortcut(QKeySequence::SaveAs); connect(ACTION, SIGNAL(triggered()), this, SLOT(saveasfile())); } else if(icon == "print") { ACTION->setShortcut(QKeySequence::Print); connect(ACTION, SIGNAL(triggered()), this, SLOT(print())); } else if(icon == "designdetails") { ACTION->setShortcut(QKeySequence("Ctrl+D")); connect(ACTION, SIGNAL(triggered()), this, SLOT(designDetails())); } else if(icon == "exit") { ACTION->setShortcut(QKeySequence("Ctrl+Q")); connect(ACTION, SIGNAL(triggered()), this, SLOT(exit())); } else if(icon == "cut") { ACTION->setShortcut(QKeySequence::Cut); connect(ACTION, SIGNAL(triggered()), this, SLOT(cut())); } else if(icon == "copy") { ACTION->setShortcut(QKeySequence::Copy); connect(ACTION, SIGNAL(triggered()), this, SLOT(copy())); } else if(icon == "paste") { ACTION->setShortcut(QKeySequence::Paste); connect(ACTION, SIGNAL(triggered()), this, SLOT(paste())); } else if(icon == "windowcascade") connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(cascade())); else if(icon == "windowtile") connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(tile())); else if(icon == "windowclose") { ACTION->setShortcut(QKeySequence::Close); connect(ACTION, SIGNAL(triggered()), this, SLOT(onCloseWindow())); } else if(icon == "windowcloseall") connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(closeAllSubWindows())); else if(icon == "windownext") { ACTION->setShortcut(QKeySequence::NextChild); connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(activateNextSubWindow())); } else if(icon == "windowprevious") { ACTION->setShortcut(QKeySequence::PreviousChild); connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(activatePreviousSubWindow())); } else if(icon == "help") connect(ACTION, SIGNAL(triggered()), this, SLOT(help())); else if(icon == "changelog") connect(ACTION, SIGNAL(triggered()), this, SLOT(changelog())); else if(icon == "tipoftheday") connect(ACTION, SIGNAL(triggered()), this, SLOT(tipOfTheDay())); else if(icon == "about") connect(ACTION, SIGNAL(triggered()), this, SLOT(about())); else if(icon == "whatsthis") connect(ACTION, SIGNAL(triggered()), this, SLOT(whatsThisContextHelp())); else if(icon == "icon16") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon16())); else if(icon == "icon24") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon24())); else if(icon == "icon32") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon32())); else if(icon == "icon48") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon48())); else if(icon == "icon64") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon64())); else if(icon == "icon128") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon128())); else if(icon == "settingsdialog") connect(ACTION, SIGNAL(triggered()), this, SLOT(settingsDialog())); else if(icon == "undo") connect(ACTION, SIGNAL(triggered()), this, SLOT(undo())); else if(icon == "redo") connect(ACTION, SIGNAL(triggered()), this, SLOT(redo())); else if(icon == "makelayercurrent") connect(ACTION, SIGNAL(triggered()), this, SLOT(makeLayerActive())); else if(icon == "layers") connect(ACTION, SIGNAL(triggered()), this, SLOT(layerManager())); else if(icon == "layerprevious") connect(ACTION, SIGNAL(triggered()), this, SLOT(layerPrevious())); else if(icon == "textbold") { ACTION->setCheckable(true); connect(ACTION, SIGNAL(toggled(bool)), this, SLOT(setTextBold(bool))); }
QAction *MainWindow::createAction(const QString icon, const QString toolTip, const QString statusTip, bool scripted) { QAction *ACTION = new QAction(QIcon("icons/" + getSettingsGeneralIconTheme() + "/" + icon + ".png"), toolTip, this); //TODO: Qt4.7 wont load icons without an extension... ACTION->setStatusTip(statusTip); ACTION->setObjectName(icon); // TODO: Finish All Commands ... <.< if (icon == "donothing") connect(ACTION, SIGNAL(triggered()), this, SLOT(doNothing())); else if(icon == "new") { ACTION->setShortcut(QKeySequence::New); connect(ACTION, SIGNAL(triggered()), this, SLOT(newfile())); } else if(icon == "open") { ACTION->setShortcut(QKeySequence::Open); connect(ACTION, SIGNAL(triggered()), this, SLOT(openfile())); } else if(icon == "save") { ACTION->setShortcut(QKeySequence::Save); connect(ACTION, SIGNAL(triggered()), this, SLOT(savefile())); } else if(icon == "saveas") { ACTION->setShortcut(QKeySequence::SaveAs); connect(ACTION, SIGNAL(triggered()), this, SLOT(saveasfile())); } else if(icon == "print") { ACTION->setShortcut(QKeySequence::Print); connect(ACTION, SIGNAL(triggered()), this, SLOT(print())); } else if(icon == "close") { ACTION->setShortcut(QKeySequence::Close); connect(ACTION, SIGNAL(triggered()), this, SLOT(onCloseWindow())); } else if(icon == "designdetails") { ACTION->setShortcut(QKeySequence("Ctrl+D")); connect(ACTION, SIGNAL(triggered()), this, SLOT(designDetails())); } else if(icon == "exit") { ACTION->setShortcut(QKeySequence("Ctrl+Q")); connect(ACTION, SIGNAL(triggered()), this, SLOT(exit())); } else if(icon == "cut") { ACTION->setShortcut(QKeySequence::Cut); connect(ACTION, SIGNAL(triggered()), this, SLOT(cut())); } else if(icon == "copy") { ACTION->setShortcut(QKeySequence::Copy); connect(ACTION, SIGNAL(triggered()), this, SLOT(copy())); } else if(icon == "paste") { ACTION->setShortcut(QKeySequence::Paste); connect(ACTION, SIGNAL(triggered()), this, SLOT(paste())); } else if(icon == "windowcascade") connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(cascade())); else if(icon == "windowtile") connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(tile())); else if(icon == "windowcloseall") connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(closeAllSubWindows())); else if(icon == "windownext") { ACTION->setShortcut(QKeySequence::NextChild); connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(activateNextSubWindow())); } else if(icon == "windowprevious") { ACTION->setShortcut(QKeySequence::PreviousChild); connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(activatePreviousSubWindow())); } else if(icon == "help") connect(ACTION, SIGNAL(triggered()), this, SLOT(help())); else if(icon == "changelog") connect(ACTION, SIGNAL(triggered()), this, SLOT(changelog())); else if(icon == "tipoftheday") connect(ACTION, SIGNAL(triggered()), this, SLOT(tipOfTheDay())); else if(icon == "about") connect(ACTION, SIGNAL(triggered()), this, SLOT(about())); else if(icon == "aboutQt") connect(ACTION, SIGNAL(triggered()), qApp, SLOT(aboutQt())); else if(icon == "icon16") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon16())); else if(icon == "icon24") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon24())); else if(icon == "icon32") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon32())); else if(icon == "icon48") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon48())); else if(icon == "icon64") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon64())); else if(icon == "icon128") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon128())); else if(icon == "settingsdialog") connect(ACTION, SIGNAL(triggered()), this, SLOT(settingsDialog())); else if(icon == "undo") connect(ACTION, SIGNAL(triggered()), this, SLOT(undo())); else if(icon == "redo") connect(ACTION, SIGNAL(triggered()), this, SLOT(redo())); else if(icon == "makelayercurrent") connect(ACTION, SIGNAL(triggered()), this, SLOT(makeLayerActive())); else if(icon == "layers") connect(ACTION, SIGNAL(triggered()), this, SLOT(layerManager())); else if(icon == "layerprevious") connect(ACTION, SIGNAL(triggered()), this, SLOT(layerPrevious())); else if(icon == "textbold") { ACTION->setCheckable(true); connect(ACTION, SIGNAL(toggled(bool)), this, SLOT(setTextBold(bool))); }