TIA::TIA(QWidget *parent) : QMainWindow(parent), ui(new Ui::TIA) { ui->setupUi(this); this->showMaximized(); setDockNestingEnabled(true); m_TIAPtr = this; m_StatusBar = this->statusBar(); m_Style = new HStyle; createModels(); createWidgets(); createViews(); createActions(); createConnections(); createDialogs(); m_VLog->start(); }
TeamBuilder::TeamBuilder(ClientPluginManager *p, TeamHolder *team, bool load) : m_team(team), teamMenu(nullptr) { // QStringList undone; // for (int i = 1;i <= 718; i++) { // if (!PokemonInfo::Exists(i, 6)) // undone.push_back(PokemonInfo::Name(i)); // } ui = new _ui(); ui->stack = new QStackedWidget(); setCentralWidget(ui->stack); setDockNestingEnabled(true); setWindowFlags(Qt::Widget); setWindowTitle(tr("Teambuilder")); ui->stack->addWidget(trainer = new TrainerMenu(team)); trainer->setMainWindow(this); pokemonModel = new PokeTableModel(team->team().gen(), this); if (load) { loadSettings(this, defaultSize()); } connect(trainer, SIGNAL(teamChanged()), SLOT(markTeamUpdated())); connect(trainer, SIGNAL(done()), SIGNAL(done())); connect(trainer, SIGNAL(openBoxes()), SLOT(openBoxes())); connect(trainer, SIGNAL(editPoke(int)), SLOT(editPoke(int))); p->launchTeambuilder(this); pluginManager = p; }
/** Create an APrivateWindow object \param appName The name of the application \param orgName The organisation name \param domainName The domain of the organisation \param version The version of the application \param parent The parent of the main window ( usually 0 ) */ APrivateWindow::APrivateWindow(QIcon icon, QString appName, bool userPluginInterface, bool needsCreateMenu, QString orgName, QString domainName, QString version, QWidget *parent ) : QMainWindow( parent ), _document( appName, orgName, domainName, version ), _plugins( new APrivatePluginDialog( this, userPluginInterface ) ), ui(new Ui::appBase), _log( 0 ), _centralDock( 0 ), _currentContextDock( 0 ), _sdk( this ) { // setup global application data QCoreApplication::setApplicationName( appName ); QCoreApplication::setOrganizationName( orgName ); QCoreApplication::setOrganizationDomain( domainName ); QCoreApplication::setApplicationVersion( version ); // icon QApplication::setWindowIcon( icon ); // setup form based UI ui->setupUi(this); if( !needsCreateMenu ) { delete ui->menuCreate; ui->menuCreate = 0; } // setup the workspace manager _workspace = new APrivateWorkspaceDialog( this ); // we like dock nesting setDockNestingEnabled( TRUE ); // our basic log _log = new APrivateLogDock; addDockedItem( "Log", _log ); // setup plugins _plugins->ensureLoaded(); // developing code #if 0 QByteArray state( _plugins->saveState() ); _plugins->restoreState( state ); #endif // connect UI to this class connect( ui->actionNew, SIGNAL( triggered() ), this, SLOT( fileNew() ) ); connect( ui->actionOpen, SIGNAL( triggered() ), this, SLOT( fileOpen() ) ); connect( ui->actionSave, SIGNAL( triggered() ), this, SLOT( fileSave() ) ); connect( ui->actionSave_As, SIGNAL( triggered() ), this, SLOT( fileSaveAs() ) ); connect( ui->actionExit, SIGNAL( triggered() ), this, SLOT( close() ) ); connect( ui->menuFile, SIGNAL( aboutToShow() ), this, SLOT( rebuildFileMenu() ) ); connect( ui->menuWindow, SIGNAL( aboutToShow() ), this, SLOT( rebuildWindowMenu() ) ); connect( ui->menuWindow, SIGNAL( triggered( QAction * ) ), this, SLOT( pollWindowMenuStates( QAction * ) ) ); connect( ui->menuRecent_Files, SIGNAL(triggered(QAction*)), this, SLOT(openRecent(QAction*)) ); if( ui->menuCreate ) { connect( ui->menuCreate, SIGNAL( triggered( QAction * ) ), this, SLOT( createTriggered( QAction * ) ) ); connect( ui->menuCreate, SIGNAL( aboutToShow() ), this, SLOT( rebuildCreateMenu() ) ); }
GWorkBench::GWorkBench(QWidget *parent) : QMainWindow(parent) // 2012-01-10 to have a separate entry in the task bar { InitBench(); setStatusBar(0); // test for nested docks setDockNestingEnabled(true); }
int QMainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 4) qt_static_metacall(this, _c, _id, _a); _id -= 4; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QSize*>(_v) = iconSize(); break; case 1: *reinterpret_cast< Qt::ToolButtonStyle*>(_v) = toolButtonStyle(); break; case 2: *reinterpret_cast< bool*>(_v) = isAnimated(); break; case 3: *reinterpret_cast< bool*>(_v) = documentMode(); break; case 4: *reinterpret_cast< QTabWidget::TabShape*>(_v) = tabShape(); break; case 5: *reinterpret_cast< bool*>(_v) = isDockNestingEnabled(); break; case 6: *reinterpret_cast<int*>(_v) = QFlag(dockOptions()); break; case 7: *reinterpret_cast< bool*>(_v) = unifiedTitleAndToolBarOnMac(); break; } _id -= 8; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setIconSize(*reinterpret_cast< QSize*>(_v)); break; case 1: setToolButtonStyle(*reinterpret_cast< Qt::ToolButtonStyle*>(_v)); break; case 2: setAnimated(*reinterpret_cast< bool*>(_v)); break; case 3: setDocumentMode(*reinterpret_cast< bool*>(_v)); break; case 4: setTabShape(*reinterpret_cast< QTabWidget::TabShape*>(_v)); break; case 5: setDockNestingEnabled(*reinterpret_cast< bool*>(_v)); break; case 6: setDockOptions(QFlag(*reinterpret_cast<int*>(_v))); break; case 7: setUnifiedTitleAndToolBarOnMac(*reinterpret_cast< bool*>(_v)); break; } _id -= 8; } else if (_c == QMetaObject::ResetProperty) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 8; } #endif // QT_NO_PROPERTIES return _id; }
MainWindow::MainWindow() { createActions(); createMenus(); createToolBars(); createDockWindows(); createStatusBar(); setWindowTitle(tr("Movie Player")); setUnifiedTitleAndToolBarOnMac(true); setAnimated(true); setDockNestingEnabled (true); runTestCuda(); resize(300, 400); }
MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags) : QMainWindow(parent, flags) { setMinimumSize(QSize(300, 200)); setWindowTitle(TITLE); setDockNestingEnabled(true); resize(850, 650); // Set QMainWindow in the center of desktop QRect rect = geometry(); rect.moveCenter(QApplication::desktop()->availableGeometry().center()); setGeometry(rect); _mainDescTextBox = new QspTextBox(this); setCentralWidget(_mainDescTextBox); CreateDockWindows(); CreateMenuBar(); LoadSettings(); }
DGLMainWindow::DGLMainWindow(QWidget *_parent, Qt::WindowFlags flags) : QMainWindow(_parent, flags), m_BusyDialog(this), m_ProjectSaved(false) { #pragma warning(push) #pragma warning(disable : 4127) // conditional expression is constant Q_INIT_RESOURCE(dglmainwindow); #pragma warning(pop) boost::shared_ptr<OsIcon> icon(Os::createIcon()); #ifdef _WIN32 setWindowIcon(QIcon(HICON_TO_QPIXMAP((HICON)icon->get()))); #endif // load designer UI m_ui.setupUi(this); setDockNestingEnabled(true); // create all widgets, actions iteractions etc... createActions(); createMenus(); createToolBars(); createStatusBar(); createDockWindows(); createInteractions(); // read QSettings readSettings(); showConfig(); if (QCoreApplication::arguments().size() == 2) { openProjectFromFile(QCoreApplication::arguments()[1]); } }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , timer_(new QTimer(this)) { setDockNestingEnabled( true ); setCorner( Qt::BottomLeftCorner, Qt::LeftDockWidgetArea ); setCorner( Qt::BottomRightCorner, Qt::BottomDockWidgetArea ); statusBar()->setProperty( "p_styled", true ); statusBar()->addWidget( new QLabel ); if ( auto p = statusBar()->findChild<QLabel *>() ) { p->setText( "STATUS:" ); } setupFileActions(); setupEditActions(); { QMenu *helpMenu = new QMenu(tr("Help"), this); menuBar()->addMenu(helpMenu); helpMenu->addAction(tr("About"), this, SLOT(about())); helpMenu->addAction(tr("About &Qt"), qApp, SLOT(aboutQt())); } #if defined USING_CHARTS auto widget = new ChartView( this ); #else auto widget = new WaveformView( this ); #endif setCentralWidget( widget ); grabGesture( Qt::PanGesture ); grabGesture( Qt::PinchGesture ); connect( document::instance(), &document::updateData, this, &MainWindow::handleUpdateData ); createDockWidgets(); }
void MainWin::init() { connect(Client::instance(), SIGNAL(networkCreated(NetworkId)), SLOT(clientNetworkCreated(NetworkId))); connect(Client::instance(), SIGNAL(networkRemoved(NetworkId)), SLOT(clientNetworkRemoved(NetworkId))); connect(Client::messageModel(), SIGNAL(rowsInserted(const QModelIndex &, int, int)), SLOT(messagesInserted(const QModelIndex &, int, int))); connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showChannelList(NetworkId)), SLOT(showChannelList(NetworkId))); connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showIgnoreList(QString)), SLOT(showIgnoreList(QString))); connect(Client::coreConnection(), SIGNAL(startCoreSetup(QVariantList)), SLOT(showCoreConfigWizard(QVariantList))); connect(Client::coreConnection(), SIGNAL(connectionErrorPopup(QString)), SLOT(handleCoreConnectionError(QString))); connect(Client::coreConnection(), SIGNAL(userAuthenticationRequired(CoreAccount *, bool *, QString)), SLOT(userAuthenticationRequired(CoreAccount *, bool *, QString))); connect(Client::coreConnection(), SIGNAL(handleNoSslInClient(bool*)), SLOT(handleNoSslInClient(bool *))); connect(Client::coreConnection(), SIGNAL(handleNoSslInCore(bool*)), SLOT(handleNoSslInCore(bool *))); #ifdef HAVE_SSL connect(Client::coreConnection(), SIGNAL(handleSslErrors(const QSslSocket *, bool *, bool *)), SLOT(handleSslErrors(const QSslSocket *, bool *, bool *))); #endif // Setup Dock Areas setDockNestingEnabled(true); setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea); setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea); setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea); // Order is sometimes important setupActions(); setupBufferWidget(); setupMenus(); setupTopicWidget(); setupNickWidget(); setupInputWidget(); setupChatMonitor(); setupStatusBar(); setupToolBars(); setupSystray(); setupTitleSetter(); setupHotList(); #ifndef HAVE_KDE # ifdef HAVE_PHONON QtUi::registerNotificationBackend(new PhononNotificationBackend(this)); # endif # ifndef QT_NO_SYSTEMTRAYICON QtUi::registerNotificationBackend(new SystrayNotificationBackend(this)); # endif QtUi::registerNotificationBackend(new TaskbarNotificationBackend(this)); #else /* HAVE_KDE */ QtUi::registerNotificationBackend(new KNotificationBackend(this)); #endif /* HAVE_KDE */ #ifdef HAVE_INDICATEQT QtUi::registerNotificationBackend(new IndicatorNotificationBackend(this)); #endif // we assume that at this point, all configurable actions are defined! QtUi::loadShortcuts(); connect(bufferWidget(), SIGNAL(currentChanged(BufferId)), SLOT(currentBufferChanged(BufferId))); setDisconnectedState(); // Disable menus and stuff #ifdef HAVE_KDE setAutoSaveSettings(); #endif // restore mainwin state QtUiSettings s; restoreStateFromSettings(s); // restore locked state of docks QtUi::actionCollection("General")->action("LockLayout")->setChecked(s.value("LockLayout", false).toBool()); CoreConnection *conn = Client::coreConnection(); if(!conn->connectToCore()) { // No autoconnect selected (or no accounts) showCoreConnectionDlg(); } }
MapEditor::MapEditor(QWidget* par, const QString& map, const QString& ressourceList):QMainWindow(par) { m_mapWidget = NULL; m_currentItemIndex=0; pgrdia=new QProgressDialog(tr("Chargement en cours..."), tr("Veuillez patienter.."), 0, 100, this); pgrdia->setWindowModality(Qt::WindowModal); pgrdia->setMinimumDuration(100); pgrdia->hide(); setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::North); setDockNestingEnabled(true); m_rsRegExp.setPatternSyntax(QRegExp::Wildcard); setWindowTitle(tr("Éditeur de carte")); { ///MAP PROPERTIES DOCK QDockWidget* dw_mapProperties = new QDockWidget(tr("Propriétés de la carte"), this); dw_mapProperties->setWhatsThis(tr("Un dock regroupant quelques propriétés de la carte")); dw_mapProperties->setFeatures(QDockWidget::NoDockWidgetFeatures); dw_mapProperties->setFeatures(QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable); QWidget *w_mapProperties = new QWidget(dw_mapProperties); dw_mapProperties->setWidget(w_mapProperties); addDockWidget(Qt::TopDockWidgetArea, dw_mapProperties); QVBoxLayout *l_mapProperties = new QVBoxLayout(w_mapProperties); w_mapProperties->setLayout(l_mapProperties); { QHBoxLayout *lay=new QHBoxLayout(); l_mapProperties->addLayout(lay); m_mapSizeX = new QSpinBox(this); m_mapSizeX->setRange(0,MAP_MAX_SIZE); m_mapSizeX->setEnabled(false); lay->addWidget(m_mapSizeX); m_mapSizeY = new QSpinBox(this); m_mapSizeY->setRange(0,MAP_MAX_SIZE); m_mapSizeY->setEnabled(false); lay->addWidget(m_mapSizeY); } { m_mapNameLabel=new QLabel(this); l_mapProperties->addWidget(m_mapNameLabel); m_sendingBtn=new QPushButton(tr("(MJ) Envoyer la carte au serveur"), this); l_mapProperties->addWidget(m_sendingBtn); setSendingButtonEnabled(false); connect(m_sendingBtn, SIGNAL(pressed()), this, SLOT(btnMapSend())); } } { ///CASE PROPERTIES DOCK QDockWidget* dw_caseProperties = new QDockWidget(tr("Propriétés de la case"), this); dw_caseProperties->setWhatsThis(tr("Un dock regroupant quelques propriétés de la case sélectionnée")); dw_caseProperties->setFeatures(QDockWidget::NoDockWidgetFeatures); dw_caseProperties->setFeatures(QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable); QWidget *w_caseProperties = new QWidget(dw_caseProperties); dw_caseProperties->setWidget(w_caseProperties); addDockWidget(Qt::RightDockWidgetArea, dw_caseProperties); QVBoxLayout *l_caseProperties = new QVBoxLayout(w_caseProperties); w_caseProperties->setLayout(l_caseProperties); { m_selectedCaseLabel = new QLabel(this); l_caseProperties->addWidget(m_selectedCaseLabel); m_selectedCaseRSID = new QSpinBox(this); m_selectedCaseRSID->setRange(0,MAX_LOADED_RESSOURCES); m_selectedCaseRSID->setEnabled(false); l_caseProperties->addWidget(m_selectedCaseRSID); connect(m_selectedCaseRSID, SIGNAL(valueChanged(int)), this, SLOT(changeCurrentCaseRSID(int))); { QGroupBox* gb = new QGroupBox(tr("Objets sur la case :"), this); m_mapCaseItemList = new QListWidget(this); connect(m_mapCaseItemList, SIGNAL(clicked(const QModelIndex&)), this, SLOT(selectMapItem(const QModelIndex&))); m_addItem = new QPushButton(tr("Ajouter un objet"), this); m_addItem->setEnabled(false); connect(m_addItem, SIGNAL(pressed()), this, SLOT(addMapObject())); QVBoxLayout* lyt = new QVBoxLayout(); gb->setLayout(lyt); lyt->addWidget(m_mapCaseItemList); lyt->addWidget(m_addItem); l_caseProperties->addWidget(gb); } } } { ///MAPITEMS DOCK QDockWidget* dw_mapItems = new QDockWidget(tr("Objets de la carte"), this); dw_mapItems->setWhatsThis(tr("Un dock permettant la gestion des objets de la carte")); dw_mapItems->setFeatures(QDockWidget::NoDockWidgetFeatures); dw_mapItems->setFeatures(QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable); QWidget *w_mapItems = new QWidget(dw_mapItems); dw_mapItems->setWidget(w_mapItems); addDockWidget(Qt::RightDockWidgetArea, dw_mapItems); QVBoxLayout *l_mapItems = new QVBoxLayout(w_mapItems); w_mapItems->setLayout(l_mapItems); { m_mapItemList = new QListWidget(this); connect(m_mapItemList, SIGNAL(clicked(const QModelIndex&)), this, SLOT(selectMapItem(const QModelIndex&))); l_mapItems->addWidget(m_mapItemList); m_mapItemName = new QLabel(this); l_mapItems->addWidget(m_mapItemName); m_mapItemRSID = new QSpinBox(this); m_mapItemRSID->setRange(0,MAX_LOADED_RESSOURCES); m_mapItemRSID->setPrefix(tr("RSID : ")); m_mapItemRSID->setEnabled(false); l_mapItems->addWidget(m_mapItemRSID); m_mapItemPos = new QLabel(this); l_mapItems->addWidget(m_mapItemPos); l_mapItems->addWidget(new QLabel(tr("Teinte :"), this)); m_mapItemColorViewer = new QColorViewer(this); l_mapItems->addWidget(m_mapItemColorViewer); m_removeItem = new QPushButton(tr("Supprimer l'objet"), this); l_mapItems->addWidget(m_removeItem); connect(m_removeItem, SIGNAL(pressed()), this, SLOT(removeMapObject())); } } { ///RSSMNGR PROPERTIES DOCK QDockWidget* dw_rssMngrProperties = new QDockWidget(tr("Gestionnaire de ressources"), this); dw_rssMngrProperties->setWhatsThis(tr("Un dock regroupant les différentes ressources chargées dans l'éditeur")); dw_rssMngrProperties->setFeatures(QDockWidget::NoDockWidgetFeatures); dw_rssMngrProperties->setFeatures(QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable); QWidget *w_rssMngrProperties = new QWidget(dw_rssMngrProperties); dw_rssMngrProperties->setWidget(w_rssMngrProperties); addDockWidget(Qt::RightDockWidgetArea, dw_rssMngrProperties); QVBoxLayout *l_rssMngrProperties = new QVBoxLayout(w_rssMngrProperties); w_rssMngrProperties->setLayout(l_rssMngrProperties); { m_rsMngrFilter = new QLineEdit(this); m_rsMngrFilter->setPlaceholderText(tr("Filtre...")); connect(m_rsMngrFilter, SIGNAL(textEdited(const QString&)),this, SLOT(changeRsMngrFilter(const QString&))); l_rssMngrProperties->addWidget(m_rsMngrFilter); m_rsMngrWidget = new QTableWidget(0,2, this); m_rsMngrWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); m_rsMngrWidget->setSelectionMode(QAbstractItemView::SingleSelection); m_rsMngrWidget->setSelectionBehavior(QAbstractItemView::SelectRows); m_rsMngrWidget->setSortingEnabled(true); m_rsMngrWidget->verticalHeader()->hide(); l_rssMngrProperties->addWidget(m_rsMngrWidget); m_rsMngrEdit = new QPushButton(tr("Modifier..."), this); m_rsMngrEdit->setEnabled(false); l_rssMngrProperties->addWidget(m_rsMngrEdit); connect(m_rsMngrEdit, SIGNAL(pressed()), this, SLOT(modifyRssMngr())); m_rsMngrAdd = new QPushButton(tr("Ajouter..."), this); m_rsMngrAdd->setEnabled(false); l_rssMngrProperties->addWidget(m_rsMngrAdd); connect(m_rsMngrAdd, SIGNAL(pressed()), this, SLOT(addRssMngr())); } } QMenu *fileMenu = menuBar()->addMenu(tr("&Fichier")); QAction *ac_new= fileMenu->addAction(tr("&Nouvelle carte...")); connect(ac_new, SIGNAL(triggered()), this, SLOT(newMap())); QAction *ac_open= fileMenu->addAction(tr("&Charger une carte...")); connect(ac_open, SIGNAL(triggered()), this, SLOT(loadMap())); QAction *ac_save = fileMenu->addAction(tr("Sauvegarder &la carte...")); connect(ac_save, SIGNAL(triggered()), this, SLOT(saveMap())); QAction *ac_saveAs = fileMenu->addAction(tr("Sa&uvegarder la carte sous...")); connect(ac_saveAs, SIGNAL(triggered()), this, SLOT(saveMapAs())); QAction *ac_quit = fileMenu->addAction(tr("&Quitter...")); connect(ac_quit, SIGNAL(triggered()), this, SLOT(close())); QMenu *toolMenu = menuBar()->addMenu(tr("&Outils")); QAction *ac_replace= toolMenu->addAction(tr("&Remplacer...")); connect(ac_replace, SIGNAL(triggered()), this, SLOT(replaceRSID())); QAction *ac_copy= toolMenu->addAction(tr("Copier...")); ac_copy->setShortcut(QKeySequence::Copy); connect(ac_copy, SIGNAL(triggered()), this, SLOT(copy())); QAction *ac_paste= toolMenu->addAction(tr("Coller...")); ac_paste->setShortcut(QKeySequence::Paste); connect(ac_paste, SIGNAL(triggered()), this, SLOT(paste())); QMenu *exportMenu = menuBar()->addMenu(tr("&Export")); QAction *ac_ex_rss= exportMenu->addAction(tr("... la liste de ressources")); connect(ac_ex_rss,SIGNAL(triggered()),this,SLOT(exportRss())); QAction *ac_ex_map= exportMenu->addAction(tr("... la matrice de la carte")); connect(ac_ex_map,SIGNAL(triggered()),this,SLOT(exportMap())); m_hoveredCaseLabel = new QLabel(this); statusBar()->addWidget(m_hoveredCaseLabel); m_mapName=map; m_ressourcePackName=ressourceList; if(!map.isEmpty()) { loadMap(map,m_ressourcePackName); } enableMapSystem(false); }
DebuggerMainWnd::DebuggerMainWnd() : KXmlGuiWindow(), m_debugger(0), #ifdef GDB_TRANSCRIPT m_transcriptFile(GDB_TRANSCRIPT), #endif m_outputTermCmdStr(defaultTermCmdStr), m_outputTermProc(new QProcess), m_ttyLevel(-1), /* no tty yet */ m_popForeground(false), m_backTimeout(1000), m_tabWidth(0), m_sourceFilter(defaultSourceFilter), m_headerFilter(defaultHeaderFilter), m_animation(0), m_statusActive(i18n("active")) { setDockNestingEnabled(true); m_filesWindow = new WinStack(this); setCentralWidget(m_filesWindow); QDockWidget* dw1 = createDockWidget("Stack", i18n("Stack")); m_btWindow = new QListWidget(dw1); dw1->setWidget(m_btWindow); QDockWidget* dw2 = createDockWidget("Locals", i18n("Locals")); m_localVariables = new ExprWnd(dw2, i18n("Variable")); dw2->setWidget(m_localVariables); QDockWidget* dw3 = createDockWidget("Watches", i18n("Watches")); m_watches = new WatchWindow(dw3); dw3->setWidget(m_watches); QDockWidget* dw4 = createDockWidget("Registers", i18n("Registers")); m_registers = new RegisterView(dw4); dw4->setWidget(m_registers); QDockWidget* dw5 = createDockWidget("Breakpoints", i18n("Breakpoints")); m_bpTable = new BreakpointTable(dw5); dw5->setWidget(m_bpTable); QDockWidget* dw6 = createDockWidget("Output", i18n("Output")); m_ttyWindow = new TTYWindow(dw6); dw6->setWidget(m_ttyWindow); QDockWidget* dw7 = createDockWidget("Threads", i18n("Threads")); m_threads = new ThreadList(dw7); dw7->setWidget(m_threads); QDockWidget* dw8 = createDockWidget("Memory", i18n("Memory")); m_memoryWindow = new MemoryWindow(dw8); dw8->setWidget(m_memoryWindow); m_debugger = new KDebugger(this, m_localVariables, m_watches->watchVariables(), m_btWindow); connect(m_debugger, SIGNAL(updateStatusMessage()), SLOT(slotNewStatusMsg())); connect(m_debugger, SIGNAL(updateUI()), SLOT(updateUI())); connect(m_debugger, SIGNAL(breakpointsChanged()), SLOT(updateLineItems())); connect(m_debugger, SIGNAL(debuggerStarting()), SLOT(slotDebuggerStarting())); m_bpTable->setDebugger(m_debugger); m_memoryWindow->setDebugger(m_debugger); setStandardToolBarMenuEnabled(true); initKAction(); initStatusBar(); connect(m_watches, SIGNAL(addWatch()), SLOT(slotAddWatch())); connect(m_watches, SIGNAL(deleteWatch()), m_debugger, SLOT(slotDeleteWatch())); connect(m_watches, SIGNAL(textDropped(const QString&)), SLOT(slotAddWatch(const QString&))); connect(&m_filesWindow->m_findDlg, SIGNAL(closed()), SLOT(updateUI())); connect(m_filesWindow, SIGNAL(newFileLoaded()), SLOT(slotNewFileLoaded())); connect(m_filesWindow, SIGNAL(toggleBreak(const QString&,int,const DbgAddr&,bool)), this, SLOT(slotToggleBreak(const QString&,int,const DbgAddr&,bool))); connect(m_filesWindow, SIGNAL(enadisBreak(const QString&,int,const DbgAddr&)), this, SLOT(slotEnaDisBreak(const QString&,int,const DbgAddr&))); connect(m_debugger, SIGNAL(activateFileLine(const QString&,int,const DbgAddr&)), m_filesWindow, SLOT(activate(const QString&,int,const DbgAddr&))); connect(m_debugger, SIGNAL(executableUpdated()), m_filesWindow, SLOT(reloadAllFiles())); connect(m_debugger, SIGNAL(updatePC(const QString&,int,const DbgAddr&,int)), m_filesWindow, SLOT(updatePC(const QString&,int,const DbgAddr&,int))); // value popup communication connect(m_filesWindow, SIGNAL(initiateValuePopup(const QString&)), m_debugger, SLOT(slotValuePopup(const QString&))); connect(m_debugger, SIGNAL(valuePopup(const QString&)), m_filesWindow, SLOT(slotShowValueTip(const QString&))); // disassembling connect(m_filesWindow, SIGNAL(disassemble(const QString&, int)), m_debugger, SLOT(slotDisassemble(const QString&, int))); connect(m_debugger, SIGNAL(disassembled(const QString&,int,const std::list<DisassembledCode>&)), m_filesWindow, SLOT(slotDisassembled(const QString&,int,const std::list<DisassembledCode>&))); connect(m_filesWindow, SIGNAL(moveProgramCounter(const QString&,int,const DbgAddr&)), m_debugger, SLOT(setProgramCounter(const QString&,int,const DbgAddr&))); // program stopped connect(m_debugger, SIGNAL(programStopped()), SLOT(slotProgramStopped())); connect(&m_backTimer, SIGNAL(timeout()), SLOT(slotBackTimer())); // tab width connect(this, SIGNAL(setTabWidth(int)), m_filesWindow, SIGNAL(setTabWidth(int))); // connect breakpoint table connect(m_bpTable, SIGNAL(activateFileLine(const QString&,int,const DbgAddr&)), m_filesWindow, SLOT(activate(const QString&,int,const DbgAddr&))); connect(m_debugger, SIGNAL(updateUI()), m_bpTable, SLOT(updateUI())); connect(m_debugger, SIGNAL(breakpointsChanged()), m_bpTable, SLOT(updateBreakList())); connect(m_debugger, SIGNAL(breakpointsChanged()), m_bpTable, SLOT(updateUI())); connect(m_debugger, SIGNAL(registersChanged(const std::list<RegisterInfo>&)), m_registers, SLOT(updateRegisters(const std::list<RegisterInfo>&))); connect(m_debugger, SIGNAL(memoryDumpChanged(const QString&, const std::list<MemoryDump>&)), m_memoryWindow, SLOT(slotNewMemoryDump(const QString&, const std::list<MemoryDump>&))); connect(m_debugger, SIGNAL(saveProgramSpecific(KConfigBase*)), m_memoryWindow, SLOT(saveProgramSpecific(KConfigBase*))); connect(m_debugger, SIGNAL(restoreProgramSpecific(KConfigBase*)), m_memoryWindow, SLOT(restoreProgramSpecific(KConfigBase*))); // thread window connect(m_debugger, SIGNAL(threadsChanged(const std::list<ThreadInfo>&)), m_threads, SLOT(updateThreads(const std::list<ThreadInfo>&))); connect(m_threads, SIGNAL(setThread(int)), m_debugger, SLOT(setThread(int))); // popup menu of the local variables window m_localVariables->setContextMenuPolicy(Qt::CustomContextMenu); connect(m_localVariables, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(slotLocalsPopup(const QPoint&))); makeDefaultLayout(); setupGUI(KXmlGuiWindow::Default, "kdbgui.rc"); restoreSettings(KGlobal::config()); // The animation button is not part of the restored window state. // We must create it after the toolbar was loaded. initAnimation(); updateUI(); m_bpTable->updateUI(); }
MainWindow::MainWindow() : QMainWindow(0) , ui(new Ui::MainWindow) , m_isKKeyPressed(false) { // Create the UI. ui->setupUi(this); #ifndef Q_WS_X11 ui->mainToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); #endif setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea); setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea); setDockNestingEnabled(true); // These use the icon theme on Linux, with fallbacks to the icons specified in QtDesigner for other platforms. ui->actionOpen->setIcon(QIcon::fromTheme("document-open", ui->actionOpen->icon())); ui->actionSave->setIcon(QIcon::fromTheme("document-save", ui->actionSave->icon())); ui->actionEncode->setIcon(QIcon::fromTheme("media-record", ui->actionEncode->icon())); // Connect UI signals. connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(openVideo())); connect(ui->actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt())); // Accept drag-n-drop of files. this->setAcceptDrops(true); // Add the player widget. QLayout* layout = new QVBoxLayout(ui->playerPage); layout->setObjectName("centralWidgetLayout"); layout->setMargin(0); m_player = new Player(this); layout->addWidget(m_player); connect(this, SIGNAL(producerOpened()), m_player, SLOT(onProducerOpened())); connect(m_player, SIGNAL(showStatusMessage(QString)), this, SLOT(showStatusMessage(QString))); connect(m_player, SIGNAL(inChanged(int)), this, SLOT(onCutModified())); connect(m_player, SIGNAL(outChanged(int)), this, SLOT(onCutModified())); // Add the docks. m_propertiesDock = new QDockWidget(tr("Properties")); m_propertiesDock->hide(); m_propertiesDock->setObjectName("propertiesDock"); m_propertiesDock->setWindowIcon(QIcon((":/icons/icons/view-form.png"))); m_propertiesDock->toggleViewAction()->setIcon(QIcon::fromTheme("view-form", m_propertiesDock->windowIcon())); addDockWidget(Qt::LeftDockWidgetArea, m_propertiesDock); ui->menuView->addAction(m_propertiesDock->toggleViewAction()); ui->mainToolBar->addAction(m_propertiesDock->toggleViewAction()); connect(m_propertiesDock->toggleViewAction(), SIGNAL(triggered(bool)), this, SLOT(onPropertiesDockTriggered(bool))); m_recentDock = new RecentDock(this); m_recentDock->hide(); addDockWidget(Qt::LeftDockWidgetArea, m_recentDock); ui->menuView->addAction(m_recentDock->toggleViewAction()); ui->mainToolBar->addAction(m_recentDock->toggleViewAction()); connect(m_recentDock, SIGNAL(itemActivated(QString)), this, SLOT(open(QString))); connect(m_recentDock->toggleViewAction(), SIGNAL(triggered(bool)), this, SLOT(onRecentDockTriggered(bool))); m_playlistDock = new PlaylistDock(this); m_playlistDock->hide(); addDockWidget(Qt::LeftDockWidgetArea, m_playlistDock); ui->menuView->addAction(m_playlistDock->toggleViewAction()); ui->mainToolBar->addAction(m_playlistDock->toggleViewAction()); connect(m_playlistDock->toggleViewAction(), SIGNAL(triggered(bool)), this, SLOT(onPlaylistDockTriggered(bool))); connect(m_playlistDock, SIGNAL(clipOpened(void*,int,int)), this, SLOT(openCut(void*, int, int))); connect(m_playlistDock, SIGNAL(itemActivated(int)), this, SLOT(seekPlaylist(int))); connect(m_playlistDock, SIGNAL(showStatusMessage(QString)), this, SLOT(showStatusMessage(QString))); connect(m_playlistDock->model(), SIGNAL(created()), this, SLOT(onPlaylistCreated())); connect(m_playlistDock->model(), SIGNAL(cleared()), this, SLOT(onPlaylistCleared())); connect(m_playlistDock->model(), SIGNAL(closed()), this, SLOT(onPlaylistClosed())); connect(m_playlistDock->model(), SIGNAL(modified()), this, SLOT(onPlaylistModified())); connect(m_playlistDock->model(), SIGNAL(loaded()), this, SLOT(updateMarkers())); connect(m_playlistDock->model(), SIGNAL(modified()), this, SLOT(updateMarkers())); tabifyDockWidget(m_recentDock, m_propertiesDock); tabifyDockWidget(m_propertiesDock, m_playlistDock); m_recentDock->raise(); m_encodeDock = new EncodeDock(this); m_encodeDock->hide(); addDockWidget(Qt::RightDockWidgetArea, m_encodeDock); ui->menuView->addAction(m_encodeDock->toggleViewAction()); ui->mainToolBar->addAction(ui->actionEncode); connect(this, SIGNAL(producerOpened()), m_encodeDock, SLOT(onProducerOpened())); connect(m_encodeDock, SIGNAL(visibilityChanged(bool)), ui->actionEncode, SLOT(setChecked(bool))); connect(m_encodeDock, SIGNAL(captureStateChanged(bool)), m_player, SLOT(onCaptureStateChanged(bool))); connect(m_encodeDock, SIGNAL(captureStateChanged(bool)), m_propertiesDock, SLOT(setDisabled(bool))); connect(m_encodeDock, SIGNAL(captureStateChanged(bool)), m_recentDock, SLOT(setDisabled(bool))); connect(m_encodeDock, SIGNAL(captureStateChanged(bool)), ui->actionOpen, SLOT(setDisabled(bool))); connect(m_encodeDock, SIGNAL(captureStateChanged(bool)), ui->actionOpenOther, SLOT(setDisabled(bool))); connect(m_encodeDock, SIGNAL(captureStateChanged(bool)), ui->actionExit, SLOT(setDisabled(bool))); connect(m_encodeDock, SIGNAL(captureStateChanged(bool)), this, SLOT(onCaptureStateChanged(bool))); m_jobsDock = new JobsDock(this); m_jobsDock->hide(); addDockWidget(Qt::RightDockWidgetArea, m_jobsDock); tabifyDockWidget(m_encodeDock, m_jobsDock); ui->menuView->addAction(m_jobsDock->toggleViewAction()); connect(&JOBS, SIGNAL(jobAdded()), m_jobsDock, SLOT(show())); connect(&JOBS, SIGNAL(jobAdded()), m_jobsDock, SLOT(raise())); connect(m_jobsDock, SIGNAL(visibilityChanged(bool)), this, SLOT(onJobsVisibilityChanged(bool))); // Connect signals. connect(this, SIGNAL(producerOpened()), this, SLOT(onProducerOpened())); // connect video widget signals #if defined(Q_WS_MAC) || defined(Q_WS_WIN) Mlt::GLWidget* videoWidget = (Mlt::GLWidget*) &(MLT); connect(videoWidget, SIGNAL(dragStarted()), m_playlistDock, SLOT(onPlayerDragStarted())); connect(videoWidget, SIGNAL(seekTo(int)), m_player, SLOT(seek(int))); #else if (m_settings.value("player/opengl", true).toBool()) { Mlt::GLWidget* videoWidget = (Mlt::GLWidget*) &(MLT); connect(videoWidget, SIGNAL(dragStarted()), m_playlistDock, SLOT(onPlayerDragStarted())); connect(videoWidget, SIGNAL(seekTo(int)), m_player, SLOT(seek(int))); } else { Mlt::SDLWidget* videoWidget = (Mlt::SDLWidget*) &(MLT); connect(videoWidget, SIGNAL(dragStarted()), m_playlistDock, SLOT(onPlayerDragStarted())); connect(videoWidget, SIGNAL(seekTo(int)), m_player, SLOT(seek(int))); } #endif readSettings(); setFocus(); setCurrentFile(""); }
void MainWin::init() { connect(Client::instance(), SIGNAL(networkCreated(NetworkId)), SLOT(clientNetworkCreated(NetworkId))); connect(Client::instance(), SIGNAL(networkRemoved(NetworkId)), SLOT(clientNetworkRemoved(NetworkId))); connect(Client::messageModel(), SIGNAL(rowsInserted(const QModelIndex &, int, int)), SLOT(messagesInserted(const QModelIndex &, int, int))); connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showChannelList(NetworkId)), SLOT(showChannelList(NetworkId))); // Setup Dock Areas setDockNestingEnabled(true); setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea); setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea); setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea); // Order is sometimes important setupActions(); setupBufferWidget(); setupMenus(); setupTopicWidget(); setupChatMonitor(); setupNickWidget(); setupInputWidget(); setupStatusBar(); setupToolBars(); setupSystray(); setupTitleSetter(); setupHotList(); #ifndef HAVE_KDE QtUi::registerNotificationBackend(new TaskbarNotificationBackend(this)); QtUi::registerNotificationBackend(new SystrayNotificationBackend(this)); # ifdef HAVE_PHONON QtUi::registerNotificationBackend(new PhononNotificationBackend(this)); # endif # ifdef HAVE_DBUS QtUi::registerNotificationBackend(new DesktopNotificationBackend(this)); # endif #else /* HAVE_KDE */ QtUi::registerNotificationBackend(new KNotificationBackend(this)); #endif /* HAVE_KDE */ setDisconnectedState(); // Disable menus and stuff #ifdef HAVE_KDE setAutoSaveSettings(); #endif // restore mainwin state QtUiSettings s; restoreStateFromSettings(s); // restore locked state of docks QtUi::actionCollection("General")->action("LockLayout")->setChecked(s.value("LockLayout", false).toBool()); if(Quassel::runMode() != Quassel::Monolithic) { showCoreConnectionDlg(true); // autoconnect if appropriate } else { startInternalCore(); } }