void MainTab::createPolicyST(){ NewPolicyDialog dialog(this); dialog.exec(); QString file = dialog.policyFile; if (!file.isEmpty()){ openEditor(file + ".if"); openEditor(file + ".fc"); openEditor(file + ".te"); } }
PhraseWidget::PhraseWidget(Phrase* phrase,QWidget *parent) : QWidget(parent) { m_phrase = phrase; m_phraseEditor = new PhraseEditor(m_phrase); m_refreshButton = new QToolButton(this); m_name = new QLabel(m_phrase->name(),this); m_scrollArea = new QScrollArea(this); m_pixmap = new QLabel(); m_refreshButton->setIcon(QIcon::fromTheme("accessories-text-editor")); m_name->setFixedWidth(100); m_scrollArea->setWidget(m_pixmap); m_scrollArea->setWidgetResizable(true); m_scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); m_scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); if(m_phrase->image()) m_pixmap->setPixmap(QPixmap::fromImage(*m_phrase->image())); QHBoxLayout* layout = new QHBoxLayout(this); layout->addWidget(m_name); layout->addWidget(m_refreshButton); layout->addWidget(m_scrollArea); connect(m_phrase,SIGNAL(previewChanged()),this,SLOT(updatePixmap())); connect(m_refreshButton,SIGNAL(clicked()),this,SLOT(openEditor())); }
void CodeLineEdit::mouseDoubleClickEvent(QMouseEvent *event) { if(mMultiline) emit openEditor(); QLineEdit::mouseDoubleClickEvent(event); }
void MainTab::loadEditors(){ QSettings settings; QStringList files; files = settings.value("OpenedFiles", QStringList()).toStringList(); QString file_name; QStringListIterator iter(files); while (iter.hasNext()){ file_name = iter.next(); openEditor(file_name); } }
void MainWindow::openMain(){ scene->deleteLater(); scene = new Menu; connect(scene, SIGNAL(signalGame()), this, SLOT(openGame())); connect(scene, SIGNAL(signalEditor()), this, SLOT(openEditor())); connect(scene, SIGNAL(signalMusic()), this, SLOT(slotMusic())); connect(scene, SIGNAL(signalExit()), this, SLOT(exit())); setupView(); }
void VariableArrayElementEditor::sltItemActivated( QTreeWidgetItem * item, int column ) { UNUSED(column); STD_GLOBAL_EXCEPTION_HANDLER_START if( item != NULL ) { int index = m_TreeView-> indexOfTopLevelItem( item ); if( index >= 0 ) { openEditor( (MetaClass*)m_Property->getElementClassProperty()->getDefaultPropertyEditor(), index ); } } STD_GLOBAL_EXCEPTION_HANDLER_END }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), scene(new Menu), view (new QGraphicsView) { music = Phonon::createPlayer(Phonon::MusicCategory, Phonon::MediaSource(":/music/Fly12.mp3")); music->play(); connect(music, SIGNAL(aboutToFinish()), this , SLOT(slotRepeat())); connect(scene, SIGNAL(signalGame()), this, SLOT(openGame())); connect(scene, SIGNAL(signalEditor()), this, SLOT(openEditor())); connect(scene, SIGNAL(signalExit()), this, SLOT(exit())); connect(scene, SIGNAL(signalMusic()), this, SLOT(slotMusic())); setupView(); }
// GUI editor visibility state. void qtractorDssiPlugin::setEditorVisible ( bool bVisible ) { #ifdef CONFIG_LIBLO // Check if still here... if (m_pDssiEditor == NULL) { if (bVisible) openEditor(NULL); return; } // Do our deeds... if (bVisible) osc_send_show(m_pDssiEditor); else osc_send_hide(m_pDssiEditor); #endif m_bEditorVisible = bVisible; toggleFormEditor(bVisible); }
void BaseFileFind::runNewSearch(const QString &txt, Core::FindFlags findFlags, SearchResultWindow::SearchMode searchMode) { d->m_currentFindSupport = 0; if (d->m_filterCombo) updateComboEntries(d->m_filterCombo, true); SearchResult *search = Core::SearchResultWindow::instance()->startNewSearch(label(), toolTip().arg(Core::IFindFilter::descriptionForFindFlags(findFlags)), txt, searchMode, QString::fromLatin1("TextEditor")); search->setTextToReplace(txt); search->setSearchAgainSupported(true); FileFindParameters parameters; parameters.text = txt; parameters.flags = findFlags; parameters.nameFilters = fileNameFilters(); parameters.additionalParameters = additionalParameters(); search->setUserData(qVariantFromValue(parameters)); connect(search, SIGNAL(activated(Core::SearchResultItem)), this, SLOT(openEditor(Core::SearchResultItem))); if (searchMode == SearchResultWindow::SearchAndReplace) { connect(search, SIGNAL(replaceButtonClicked(QString,QList<Core::SearchResultItem>,bool)), this, SLOT(doReplace(QString,QList<Core::SearchResultItem>,bool))); }
FileSystemWidget::FileSystemWidget(LiteApi::IApplication *app, QWidget *parent) : QWidget(parent), m_liteApp(app) { m_tree = new SymbolTreeView; m_tree->setHeaderHidden(true); #if QT_VERSION >= 0x050000 m_tree->header()->setSectionResizeMode(QHeaderView::ResizeToContents); #else m_tree->header()->setResizeMode(QHeaderView::ResizeToContents); #endif m_tree->header()->setStretchLastSection(false); m_model = new FileSystemModel(this); QDir::Filters filters = QDir::AllDirs | QDir::Files | QDir::Drives | QDir::Readable| QDir::Writable | QDir::Executable/* | QDir::Hidden*/ | QDir::NoDotAndDotDot; #ifdef Q_OS_WIN // Symlinked directories can cause file watcher warnings on Win32. filters |= QDir::NoSymLinks; #endif m_model->setFilter(filters); m_tree->setContextMenuPolicy(Qt::CustomContextMenu); m_tree->setModel(m_model); QVBoxLayout *layout = new QVBoxLayout; layout->setMargin(0); layout->addWidget(m_tree); this->setLayout(layout); connect(m_tree,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(openPathIndex(QModelIndex))); connect(m_liteApp->editorManager(),SIGNAL(currentEditorChanged(LiteApi::IEditor*)),this,SLOT(currentEditorChanged(LiteApi::IEditor*))); m_fileMenu = new QMenu(this); m_folderMenu = new QMenu(this); m_rootMenu = new QMenu(this); m_openEditorAct = new QAction(tr("Open File"),this); m_newFileAct = new QAction(tr("New File..."),this); m_newFileWizardAct = new QAction(tr("New File Wizard..."),this); m_renameFileAct = new QAction(tr("Rename File..."),this); m_removeFileAct = new QAction(tr("Delete File"),this); m_newFolderAct = new QAction(tr("New Folder..."),this); m_renameFolderAct = new QAction(tr("Rename Folder..."),this); m_removeFolderAct = new QAction(tr("Delete Folder"),this); m_openShellAct = new QAction(tr("Open Terminal Here"),this); m_openExplorerAct = new QAction(tr("Open Explorer Here"),this); m_viewGodocAct = new QAction(tr("View Godoc Here"),this); m_addFolderAct = new QAction(tr("Add Folder..."),this); m_closeFolerAct = new QAction(tr("Close Folder"),this); m_closeAllFoldersAct = new QAction(tr("Close All Folders"),this); m_fileMenu->addAction(m_openEditorAct); m_fileMenu->addSeparator(); m_fileMenu->addAction(m_newFileAct); m_fileMenu->addAction(m_newFileWizardAct); m_fileMenu->addAction(m_renameFileAct); m_fileMenu->addAction(m_removeFileAct); m_fileMenu->addSeparator(); m_fileMenu->addAction(m_viewGodocAct); m_fileMenu->addSeparator(); m_fileMenu->addAction(m_openShellAct); m_fileMenu->addAction(m_openExplorerAct); m_folderMenu->addAction(m_newFileAct); m_folderMenu->addAction(m_newFileWizardAct); m_folderMenu->addAction(m_newFolderAct); m_folderMenu->addAction(m_renameFolderAct); m_folderMenu->addAction(m_removeFolderAct); m_folderMenu->addSeparator(); m_folderMenu->addAction(m_closeFolerAct); m_folderMenu->addSeparator(); m_folderMenu->addAction(m_viewGodocAct); m_folderMenu->addSeparator(); m_folderMenu->addAction(m_openShellAct); m_folderMenu->addAction(m_openExplorerAct); m_rootMenu->addAction(m_addFolderAct); m_rootMenu->addSeparator(); //m_rootMenu->addAction(m_closeAllFoldersAct); connect(m_model->fileWatcher(),SIGNAL(directoryChanged(QString)),this,SLOT(directoryChanged(QString))); connect(m_openEditorAct,SIGNAL(triggered()),this,SLOT(openEditor())); connect(m_newFileAct,SIGNAL(triggered()),this,SLOT(newFile())); connect(m_newFileWizardAct,SIGNAL(triggered()),this,SLOT(newFileWizard())); connect(m_renameFileAct,SIGNAL(triggered()),this,SLOT(renameFile())); connect(m_removeFileAct,SIGNAL(triggered()),this,SLOT(removeFile())); connect(m_newFolderAct,SIGNAL(triggered()),this,SLOT(newFolder())); connect(m_renameFolderAct,SIGNAL(triggered()),this,SLOT(renameFolder())); connect(m_removeFolderAct,SIGNAL(triggered()),this,SLOT(removeFolder())); connect(m_openShellAct,SIGNAL(triggered()),this,SLOT(openShell())); connect(m_openExplorerAct,SIGNAL(triggered()),this,SLOT(openExplorer())); connect(m_viewGodocAct,SIGNAL(triggered()),this,SLOT(viewGodoc())); connect(m_addFolderAct,SIGNAL(triggered()),this,SLOT(addFolder())); connect(m_closeFolerAct,SIGNAL(triggered()),this,SLOT(closeFolder())); connect(m_closeAllFoldersAct,SIGNAL(triggered()),this,SLOT(closeAllFolders())); connect(m_tree,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(treeViewContextMenuRequested(QPoint))); }
SalesOrderManager::SalesOrderManager(QWidget* parent) : QSplitter(parent) { model = new SalesOrderModel(this); proxyModel = new SalesOrderProxyModel(this); proxyModel->setSourceModel(model); QWidget* container = new QWidget(this); QBoxLayout* containerLayout = new QVBoxLayout(container); containerLayout->setMargin(0); QString actionTooltip("%1<br><b>%2</b>"); QToolBar* toolBar = new QToolBar(container); toolBar->setIconSize(QSize(16, 16)); QAction* refreshAction = toolBar->addAction(QIcon(":/resources/icons/refresh.png"), "&Muat Ulang", this, SLOT(refresh())); refreshAction->setShortcut(QKeySequence("F5")); refreshAction->setToolTip(actionTooltip.arg("Muat ulang daftar pesanan").arg(refreshAction->shortcut().toString())); QAction* newAction = toolBar->addAction(QIcon(":/resources/icons/plus.png"), "&Baru", this, SLOT(openEditor())); newAction->setShortcut(QKeySequence("Ctrl+N")); newAction->setToolTip(actionTooltip.arg("Pesanan baru").arg(newAction->shortcut().toString())); QAction* closeTabAction = new QAction(this); closeTabAction->setShortcuts(QList<QKeySequence>({QKeySequence("Esc"), QKeySequence("Ctrl+W")})); addAction(closeTabAction); QAction* closeAllTabsAction = new QAction(this); closeAllTabsAction->setShortcut(QKeySequence("Ctrl+Shift+W")); addAction(closeAllTabsAction); containerLayout->addWidget(toolBar); QLabel* spacer = new QLabel(toolBar); spacer->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); toolBar->addWidget(spacer); stateComboBox = new QComboBox(toolBar); stateComboBox->setToolTip("Saring daftar pesanan berdasarkan status"); stateComboBox->addItem("Semua"); stateComboBox->addItem("Aktif"); stateComboBox->addItem("Selesai"); stateComboBox->addItem("Dibatalkan"); stateComboBox->setCurrentIndex(1); toolBar->addWidget(stateComboBox); searchEdit = new QLineEdit(toolBar); searchEdit->setToolTip("Cari di daftar pesanan"); searchEdit->setPlaceholderText("Cari"); searchEdit->setClearButtonEnabled(true); searchEdit->setMaxLength(100); searchEdit->setMaximumWidth(150); toolBar->addWidget(searchEdit); view = new QTableView(container); view->setToolTip("Klik ganda atau ketuk Enter untuk membuka pesanan"); view->setModel(proxyModel); view->setAlternatingRowColors(true); view->setSortingEnabled(true); view->setSelectionMode(QAbstractItemView::SingleSelection); view->setSelectionBehavior(QAbstractItemView::SelectRows); view->setTabKeyNavigation(false); QHeaderView* header = view->verticalHeader(); header->setVisible(false); header->setMinimumSectionSize(20); header->setMaximumSectionSize(20); header->setDefaultSectionSize(20); header = view->horizontalHeader(); header->setToolTip("Klik pada header kolom untuk mengurutkan"); header->setHighlightSections(false); containerLayout->addWidget(view); infoLabel = new QLabel(container); infoLabel->setStyleSheet("font-style:italic;padding-bottom:1px;"); infoLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); containerLayout->addWidget(infoLabel); tabWidget = new QTabWidget(this); tabWidget->setDocumentMode(true); tabWidget->setTabsClosable(true); tabWidget->setMovable(true); tabWidget->hide(); setCollapsible(0, false); setCollapsible(1, false); connect(closeTabAction, SIGNAL(triggered(bool)), SLOT(closeCurrentTab())); connect(closeAllTabsAction, SIGNAL(triggered(bool)), SLOT(closeAllTabs())); connect(tabWidget, SIGNAL(tabCloseRequested(int)), SLOT(closeTab(int))); connect(stateComboBox, SIGNAL(currentIndexChanged(int)), SLOT(refresh())); connect(searchEdit, SIGNAL(textChanged(QString)), SLOT(applyFilter())); connect(view, SIGNAL(activated(QModelIndex)), SLOT(edit())); QTimer::singleShot(0, this, SLOT(init())); }
void SalesOrderManager::edit() { openEditor(view->selectionModel()->selectedRows(SalesOrderModel::IdColumn).first().data(Qt::EditRole).toLongLong()); }
int main(int argc, char *argv[]) { OSStatus err = noErr; // Set up signaling stuff first signal(SIGHUP, &quit); signal(SIGINT, &quit); signal(SIGILL, &quit); signal(SIGTRAP, &quit); signal(SIGABRT, &quit); signal(SIGEMT, &quit); signal(SIGFPE, &quit); signal(SIGBUS, &quit); signal(SIGSEGV, &quit); signal(SIGPIPE, &quit); signal(SIGALRM, &quit); signal(SIGTERM, &quit); signal(SIGURG, &quit); char path[MAX_PATH], tmp[MAX_PATH]; if(getPluginBundleDir(DEF_BUNDLE_STRING, tmp)) { snprintf(path, MAX_PATH, "%s%c%s%c%s%s", tmp, DEF_DELIMITER, DEF_RESOURCE_PATH, DEF_DELIMITER, DEF_PRODUCT, DEF_EXTENSION); } #if USE_PC_MIDI /* MIDIClientRef mc; if(MIDIClientCreate(CFSTR(DEF_PRODUCT), NULL, NULL, &mc) != noErr) { printf("Could not initialize MIDI subsystem\n"); } printf("%d extern devices, %d devs\n", MIDIGetNumberOfDevices()); for(int i = 0; i < MIDIGetNumberOfDevices(); ++i) { MIDIDeviceRef dev = MIDIGetDevice(i); printf("Device %d has %d entities\n", i, MIDIDeviceGetNumberOfEntities(dev)); for(int j = 0; j < MIDIDeviceGetNumberOfEntities(dev); ++j) { MIDIEntityRef entity = MIDIDeviceGetEntity(dev, j); CFPropertyListRef props; MIDIObjectGetProperties(entity, &props, true); printf("Entity has %d prop keys\n", CFDictionaryGetCount((CFDictionaryRef)props)); int size = CFDictionaryGetCount((CFDictionaryRef)props); const void **keys = (const void **)malloc (sizeof(void *) * size); const void **vals = (const void **)malloc (sizeof(void *) * size); CFDictionaryGetKeysAndValues((CFDictionaryRef)props, keys, vals); for(int k = 0; k < size; ++k) { printf("KEY: %s' - VAL: %s\n", CFStringGetCStringPtr((CFStringRef)keys[i], 0), "hi"); } free(keys); free(vals); } } MIDIClientDispose(mc); */ #endif vstLoader *plug = new vstLoader(); if(!plug->setPath(path)) { return 1; } else { plug->setName(); } if(!plug->loadPlugin()) { delete plug; return 1; } if(!plug->initialize()) { delete plug; return 1; } // Set up time info for the plug _TIME.samplePos = 0; _TIME.sampleRate = DEF_SAMPLE_RATE; _TIME.nanoSeconds = 0; _TIME.ppqPos = 0; _TIME.tempo = DEF_TEMPO; _TIME.barStartPos = 0; _TIME.cycleStartPos = 0; _TIME.cycleEndPos = 0; _TIME.timeSigNumerator = DEF_TIMESIG_NUMER; _TIME.timeSigDenominator = DEF_TIMESIG_DENOM; _TIME.smpteOffset = 0; _TIME.smpteFrameRate = 0; _TIME.samplesToNextClock = 0; _TIME.flags = 0; // Set other plugin environment variables if(!plug->setSampleRate(DEF_SAMPLE_RATE)) { return 1; } if(!plug->setBlocksize(DEF_BLOCKSIZE)) { return 1; } // Initialize midi stuff MIDIClientRef mc; if(MIDIClientCreate(CFSTR(DEF_PRODUCT), NULL, NULL, &mc) != noErr) { debug(LOG_ERROR, "Could not initialize MIDI subsystem"); } MIDIPortRef port; err = MIDIInputPortCreate(mc, CFSTR(DEF_PRODUCT), processMidi, plug, &port); MIDIEndpointRef endpoint = MIDIGetSource(0); err = MIDIPortConnectSource(port, endpoint, NULL); int result = 0; pthread_t run_thread; result = pthread_create(&run_thread, NULL, runPluginLoop, (void*)plug); openEditor(plug->getPluginPtr()); pthread_kill(run_thread, SIGINT); MIDIPortDisconnectSource(port, endpoint); MIDIClientDispose(mc); delete plug; return 0; }
FileBrowser::FileBrowser(LiteApi::IApplication *app, QObject *parent) : QObject(parent), m_liteApp(app) { m_widget = new QWidget; QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->setMargin(0); mainLayout->setSpacing(0); m_fileModel = new QFileSystemModel(this); m_fileModel->setFilter(QDir::AllEntries | QDir::NoDotAndDotDot); m_proxyModel = new QSortFileSystemProxyModel(this); m_proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive); m_proxyModel->setDynamicSortFilter(true); m_proxyModel->setSourceModel(m_fileModel); m_proxyModel->sort(0); //create filter toolbar m_filterToolBar = new QToolBar(m_widget); m_filterToolBar->setIconSize(QSize(16,16)); m_syncAct = new QAction(QIcon("icon:filebrowser/images/sync.png"),tr("Synchronize with editor"),this); m_syncAct->setCheckable(true); m_filterCombo = new QComboBox; m_filterCombo->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred); m_filterCombo->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength); m_filterCombo->setEditable(true); m_filterCombo->addItem("*"); m_filterCombo->addItem("Makefile;*.go;*.cgo;*.s;*.goc;*.y;*.e64;*.pro"); m_filterCombo->addItem("*.sh;Makefile;*.go;*.cgo;*.s;*.goc;*.y;*.*.c;*.cpp;*.h;*.hpp;*.e64;*.pro"); m_filterToolBar->addAction(m_syncAct); m_filterToolBar->addSeparator(); m_filterToolBar->addWidget(m_filterCombo); //create root toolbar m_rootToolBar = new QToolBar(m_widget); m_rootToolBar->setIconSize(QSize(16,16)); m_cdupAct = new QAction(QIcon("icon:filebrowser/images/cdup.png"),tr("Open to Parent"),this); m_rootCombo = new QComboBox; m_rootCombo->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred); m_rootCombo->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength); m_rootCombo->setEditable(false); m_rootCombo->addItem(m_fileModel->myComputer().toString()); m_rootToolBar->addAction(m_cdupAct); m_rootToolBar->addSeparator(); m_rootToolBar->addWidget(m_rootCombo); //create treeview m_treeView = new QTreeView; m_treeView->setContextMenuPolicy(Qt::CustomContextMenu); m_treeView->setModel(m_proxyModel); m_treeView->setRootIsDecorated(true); m_treeView->setUniformRowHeights(true); m_treeView->setTextElideMode(Qt::ElideNone); m_treeView->setAttribute(Qt::WA_MacShowFocusRect, false); m_treeView->setHeaderHidden(true); m_treeView->setEditTriggers(QAbstractItemView::NoEditTriggers); // show horizontal scrollbar m_treeView->header()->setResizeMode(QHeaderView::ResizeToContents); m_treeView->header()->setStretchLastSection(false); //hide int count = m_treeView->header()->count(); for (int i = 1; i < count; i++) { m_treeView->setColumnHidden(i,true); } mainLayout->addWidget(m_filterToolBar); mainLayout->addWidget(m_rootToolBar); mainLayout->addWidget(m_treeView); m_widget->setLayout(mainLayout); //create menu m_fileMenu = new QMenu; m_folderMenu = new QMenu; m_rootMenu = new QMenu; m_openFileAct = new QAction(tr("Open File"),this); m_openEditorAct = new QAction(tr("Open Editor"),this); m_newFileAct = new QAction(tr("New File"),this); m_newFileWizardAct = new QAction(tr("New File Wizard"),this); m_renameFileAct = new QAction(tr("Rename File"),this); m_removeFileAct = new QAction(tr("Remove File"),this); m_setRootAct = new QAction(tr("Set Folder To Root"),this); m_newFolderAct = new QAction(tr("New Folder"),this); m_renameFolderAct = new QAction(tr("Rename Folder"),this); m_removeFolderAct = new QAction(tr("Remove Folder"),this); m_openShellAct = new QAction(tr("Open Terminal Here"),this); m_openExplorerAct = new QAction(tr("Open Explorer Here"),this); m_viewGodocAct = new QAction(tr("View Godoc Here"),this); m_loadFolderAct = new QAction(tr("Load Folder Project"),this); m_fileMenu->addAction(m_openFileAct); m_fileMenu->addAction(m_openEditorAct); m_fileMenu->addSeparator(); m_fileMenu->addAction(m_newFileAct); m_fileMenu->addAction(m_newFileWizardAct); m_fileMenu->addAction(m_renameFileAct); m_fileMenu->addAction(m_removeFileAct); m_fileMenu->addSeparator(); m_fileMenu->addAction(m_loadFolderAct); m_fileMenu->addAction(m_viewGodocAct); m_fileMenu->addSeparator(); m_fileMenu->addAction(m_openShellAct); m_fileMenu->addAction(m_openExplorerAct); m_folderMenu->addAction(m_setRootAct); m_folderMenu->addSeparator(); m_folderMenu->addAction(m_newFileAct); m_folderMenu->addAction(m_newFileWizardAct); m_folderMenu->addAction(m_newFolderAct); m_folderMenu->addAction(m_renameFolderAct); m_folderMenu->addAction(m_removeFolderAct); m_folderMenu->addSeparator(); m_folderMenu->addAction(m_loadFolderAct); m_folderMenu->addAction(m_viewGodocAct); m_folderMenu->addSeparator(); m_folderMenu->addAction(m_openShellAct); m_folderMenu->addAction(m_openExplorerAct); m_rootMenu->addAction(m_cdupAct); m_rootMenu->addSeparator(); m_rootMenu->addAction(m_newFileAct); m_rootMenu->addAction(m_newFileWizardAct); m_rootMenu->addAction(m_newFolderAct); m_rootMenu->addSeparator(); m_rootMenu->addAction(m_loadFolderAct); m_rootMenu->addSeparator(); m_rootMenu->addAction(m_openShellAct); m_rootMenu->addAction(m_openExplorerAct); connect(m_openFileAct,SIGNAL(triggered()),this,SLOT(openFile())); connect(m_openEditorAct,SIGNAL(triggered()),this,SLOT(openEditor())); connect(m_newFileAct,SIGNAL(triggered()),this,SLOT(newFile())); connect(m_newFileWizardAct,SIGNAL(triggered()),this,SLOT(newFileWizard())); connect(m_renameFileAct,SIGNAL(triggered()),this,SLOT(renameFile())); connect(m_removeFileAct,SIGNAL(triggered()),this,SLOT(removeFile())); connect(m_newFolderAct,SIGNAL(triggered()),this,SLOT(newFolder())); connect(m_renameFolderAct,SIGNAL(triggered()),this,SLOT(renameFolder())); connect(m_removeFolderAct,SIGNAL(triggered()),this,SLOT(removeFolder())); connect(m_openShellAct,SIGNAL(triggered()),this,SLOT(openShell())); connect(m_setRootAct,SIGNAL(triggered()),this,SLOT(setFolderToRoot())); connect(m_cdupAct,SIGNAL(triggered()),this,SLOT(cdUp())); connect(m_openExplorerAct,SIGNAL(triggered()),this,SLOT(openExplorer())); connect(m_viewGodocAct,SIGNAL(triggered()),this,SLOT(viewGodoc())); connect(m_loadFolderAct,SIGNAL(triggered()),this,SLOT(loadFolderProject())); //QDockWidget *dock = m_liteApp->dockManager()->addDock(m_widget,tr("File Browser")); //connect(dock,SIGNAL(visibilityChanged(bool)),this,SLOT(visibilityChanged(bool))); m_toolWindowAct = m_liteApp->toolWindowManager()->addToolWindow(Qt::LeftDockWidgetArea,m_widget,"filesystem",tr("File System"),true); connect(m_toolWindowAct,SIGNAL(toggled(bool)),this,SLOT(visibilityChanged(bool))); connect(m_treeView,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(doubleClickedTreeView(QModelIndex))); connect(m_filterCombo,SIGNAL(activated(QString)),this,SLOT(activatedFilter(QString))); connect(m_rootCombo,SIGNAL(activated(QString)),this,SLOT(activatedRoot(QString))); connect(m_syncAct,SIGNAL(triggered(bool)),this,SLOT(syncFileModel(bool))); connect(m_liteApp->editorManager(),SIGNAL(currentEditorChanged(LiteApi::IEditor*)),this,SLOT(currentEditorChanged(LiteApi::IEditor*))); connect(m_treeView,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(treeViewContextMenuRequested(QPoint))); QString root = m_liteApp->settings()->value("FileBrowser/root",m_fileModel->myComputer().toString()).toString(); addFolderToRoot(root); bool b = m_liteApp->settings()->value("FileBrowser/synceditor",true).toBool(); if (b) { m_syncAct->setChecked(true); } }
GopathBrowser::GopathBrowser(LiteApi::IApplication *app, QObject *parent) : QObject(parent), m_liteApp(app) { m_widget = new QWidget; m_toolBar = new QToolBar; m_toolBar->setIconSize(QSize(16,16)); m_syncEditor = new QAction(QIcon(":/images/synceditor.png"),tr("Sync Editor"),this); m_syncEditor->setCheckable(true); m_syncProject = new QAction(QIcon(":/images/syncproject.png"),tr("Sync Project"),this); m_syncProject->setCheckable(true); m_startPathLabel = new QLabel; m_toolBar->addAction(m_syncEditor); m_toolBar->addAction(m_syncProject); m_toolBar->addSeparator(); m_toolBar->addWidget(m_startPathLabel); m_pathTree = new QTreeView; m_pathTree->setHeaderHidden(true); m_model = new GopathModel(this); m_pathTree->setContextMenuPolicy(Qt::CustomContextMenu); m_pathTree->setModel(m_model); QVBoxLayout *layout = new QVBoxLayout; layout->setMargin(0); layout->addWidget(m_toolBar); layout->addWidget(m_pathTree); m_widget->setLayout(layout); m_pathList = m_liteApp->settings()->value("golangtool/gopath").toStringList(); //connect(m_pathTree->selectionModel(),SIGNAL(currentChanged(QModelIndex,QModelIndex)),this,SLOT(pathIndexChanged(QModelIndex))); connect(m_pathTree,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(openPathIndex(QModelIndex))); LiteApi::IEnvManager* envManager = LiteApi::findExtensionObject<LiteApi::IEnvManager*>(m_liteApp,"LiteApi.IEnvManager"); connect(envManager,SIGNAL(currentEnvChanged(LiteApi::IEnv*)),this,SLOT(reloadEnv())); connect(m_liteApp->editorManager(),SIGNAL(currentEditorChanged(LiteApi::IEditor*)),this,SLOT(currentEditorChanged(LiteApi::IEditor*))); m_fileMenu = new QMenu(m_widget); m_folderMenu = new QMenu(m_widget); m_setStartAct = new QAction(tr("Set Activate Project"),this); m_openEditorAct = new QAction(tr("Open Editor"),this); m_newFileAct = new QAction(tr("New File"),this); m_newFileWizardAct = new QAction(tr("New File Wizard"),this); m_renameFileAct = new QAction(tr("Rename File"),this); m_removeFileAct = new QAction(tr("Remove File"),this); m_newFolderAct = new QAction(tr("New Folder"),this); m_renameFolderAct = new QAction(tr("Rename Folder"),this); m_removeFolderAct = new QAction(tr("Remove Folder"),this); m_openShellAct = new QAction(tr("Open Terminal Here"),this); m_openExplorerAct = new QAction(tr("Open Explorer Here"),this); m_fileMenu->addAction(m_openEditorAct); m_fileMenu->addSeparator(); m_fileMenu->addAction(m_newFileAct); m_fileMenu->addAction(m_newFileWizardAct); m_fileMenu->addAction(m_renameFileAct); m_fileMenu->addAction(m_removeFileAct); m_fileMenu->addSeparator(); m_fileMenu->addAction(m_openShellAct); m_fileMenu->addAction(m_openExplorerAct); m_folderMenu->addAction(m_setStartAct); m_folderMenu->addSeparator(); m_folderMenu->addAction(m_newFileAct); m_folderMenu->addAction(m_newFileWizardAct); m_folderMenu->addAction(m_newFolderAct); m_folderMenu->addAction(m_renameFolderAct); m_folderMenu->addAction(m_removeFolderAct); m_folderMenu->addSeparator(); m_folderMenu->addAction(m_openShellAct); m_folderMenu->addAction(m_openExplorerAct); connect(m_startPathLabel,SIGNAL(linkActivated(QString)),this,SLOT(expandStartPath(QString))); connect(m_syncEditor,SIGNAL(triggered(bool)),this,SLOT(syncEditor(bool))); connect(m_syncProject,SIGNAL(triggered(bool)),this,SLOT(syncProject(bool))); connect(m_setStartAct,SIGNAL(triggered()),this,SLOT(setActivate())); connect(m_openEditorAct,SIGNAL(triggered()),this,SLOT(openEditor())); connect(m_newFileAct,SIGNAL(triggered()),this,SLOT(newFile())); connect(m_newFileWizardAct,SIGNAL(triggered()),this,SLOT(newFileWizard())); connect(m_renameFileAct,SIGNAL(triggered()),this,SLOT(renameFile())); connect(m_removeFileAct,SIGNAL(triggered()),this,SLOT(removeFile())); connect(m_newFolderAct,SIGNAL(triggered()),this,SLOT(newFolder())); connect(m_renameFolderAct,SIGNAL(triggered()),this,SLOT(renameFolder())); connect(m_removeFolderAct,SIGNAL(triggered()),this,SLOT(removeFolder())); connect(m_openShellAct,SIGNAL(triggered()),this,SLOT(openShell())); connect(m_openExplorerAct,SIGNAL(triggered()),this,SLOT(openExplorer())); connect(m_pathTree,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(treeViewContextMenuRequested(QPoint))); bool b = m_liteApp->settings()->value("GolangTool/synceditor",true).toBool(); if (b) { m_syncEditor->toggle(); } b = m_liteApp->settings()->value("GolangTool/syncproject",false).toBool(); if (b) { m_syncProject->toggle(); } m_startPathLabel->setText("null project"); }
VSTSettingsPage::VSTSettingsPage(VSTProcessor *processor_, QWidget *parent) : QWidget(parent), processor(processor_), addPluginDialog(this) { int i; QString defaultSearchPath; #if defined(Q_WS_MAC) defaultSearchPath = "~/Library/Audio/Plug-Ins/VST;/Library/Audio/Plug-Ins/VST"; #elif defined(Q_WS_WIN) if (sizeof(void*) == 4) { defaultSearchPath = QSettings("HKEY_LOCAL_MACHINE\\Software\\Wow6432Node\\VST", QSettings::NativeFormat).value("VSTPluginsPath").toString(); } if (defaultSearchPath.isEmpty()) { defaultSearchPath = QSettings("HKEY_LOCAL_MACHINE\\Software\\VST", QSettings::NativeFormat).value("VSTPluginsPath").toString(); } #endif addPluginDialog.setSearchPath(settings->value("vst/searchPath", defaultSearchPath).toString()); addPluginDialog.setPlugins(settings->value("vst/plugins").toStringList()); QVBoxLayout *vBoxLayout = new QVBoxLayout; QHBoxLayout *hBoxLayout = new QHBoxLayout; pluginList = new QListWidget; connect(pluginList, SIGNAL(itemSelectionChanged()), this, SLOT(itemSelectionChanged())); for (i = 0; i < processor->numPlugins(); i++) { pluginList->addItem(processor->getPlugin(i)->getName()); } hBoxLayout->addWidget(pluginList); QVBoxLayout *buttonLayout = new QVBoxLayout; QPushButton *addButton = new QPushButton(QIcon::fromTheme("list-add"), tr("Add")); connect(addButton, SIGNAL(clicked()), this, SLOT(addPlugin())); buttonLayout->addWidget(addButton); removeButton = new QPushButton(QIcon::fromTheme("list-remove"), tr("Remove")); connect(removeButton, SIGNAL(clicked()), this, SLOT(removePlugin())); buttonLayout->addWidget(removeButton); upButton = new QPushButton(QIcon::fromTheme("go-up"), tr("Up")); connect(upButton, SIGNAL(clicked()), this, SLOT(movePluginUp())); buttonLayout->addWidget(upButton); downButton = new QPushButton(QIcon::fromTheme("go-down"), tr("Down")); connect(downButton, SIGNAL(clicked()), this, SLOT(movePluginDown())); buttonLayout->addWidget(downButton); editButton = new QPushButton(tr("Edit...")); connect(editButton, SIGNAL(clicked()), this, SLOT(openEditor())); buttonLayout->addWidget(editButton); hBoxLayout->addLayout(buttonLayout); vBoxLayout->addLayout(hBoxLayout); setLayout(vBoxLayout); itemSelectionChanged(); }
TimeWidget::TimeWidget(JointModel *model, QWidget *parent) : QWidget(parent), ui(new Ui::TimeWidget), m_model(model), m_delegate(new JointDelegate(this)), m_leftProxy(new JointProxyModel(model, this)), m_rightProxy(new JointProxyModel(model, this)) { ui->setupUi(this); QTreeView *namesView = ui->namesView; QTreeView *timeLineView = ui->timeLineView; // Sync views connect(namesView->verticalScrollBar(), SIGNAL(valueChanged(int)), timeLineView->verticalScrollBar(), SLOT(setValue(int))); connect(timeLineView->verticalScrollBar(), SIGNAL(valueChanged(int)), namesView->verticalScrollBar(), SLOT(setValue(int))); connect(namesView, SIGNAL(expanded(QModelIndex)), SLOT(onExpanded(QModelIndex))); connect(namesView, SIGNAL(collapsed(QModelIndex)), SLOT(onCollapsed(QModelIndex))); // Configure names view m_leftProxy->showAnims(false); namesView->setModel(m_leftProxy); // namesView->setModel(model); namesView->setItemDelegate(m_delegate); namesView->setHeader(new JointHeaderView(false)); namesView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); namesView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn); // Configure time line view JointHeaderView *header = new JointHeaderView(true); m_rightProxy->showVisibleColumn(false); m_rightProxy->showAnim(0); timeLineView->setModel(m_rightProxy); timeLineView->setItemDelegate(m_delegate); timeLineView->setHeader(header); timeLineView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn); timeLineView->hideColumn(JointModel::NameColumn); timeLineView->setAutoScroll(false); timeLineView->setMouseTracking(true); timeLineView->setItemsExpandable(false); connect(timeLineView, SIGNAL(entered(QModelIndex)), SLOT(openEditor(QModelIndex))); connect(model->animModel(), SIGNAL(rowsInserted(QModelIndex, int, int)), SLOT(resetEditor())); connect(model->animModel(), SIGNAL(rowsRemoved(QModelIndex, int, int)), SLOT(resetEditor())); connect(model->animModel(), SIGNAL(dataChanged(QModelIndex,QModelIndex)), SLOT(resetEditor())); connect(m_delegate, SIGNAL(currentFrameChanged(int)), header, SLOT(setCurrentFrame(int))); connect(header, SIGNAL(currentFrameChanged(int)), m_delegate, SLOT(setCurrentFrame(int))); connect(header, SIGNAL(currentFrameChanged(int)), timeLineView->viewport(), SLOT(update())); connect(header, SIGNAL(currentFrameChanged(int)), SIGNAL(currentFrameChanged(int))); // Configure push buttons connect(ui->frameCount, SIGNAL(pressed()), SLOT(showFrameCountDialog())); connect(ui->fps, SIGNAL(pressed()), SLOT(showFpsDialog())); // Initialize setCurrentAnim(-1); }
void TimeWidget::resetEditor() { openEditor(ui->timeLineView->currentIndex()); }
FileSystemWidget::FileSystemWidget(LiteApi::IApplication *app, QWidget *parent) : QWidget(parent), m_liteApp(app) { m_tree = new SymbolTreeView; m_tree->setHeaderHidden(true); m_model = new FileSystemModel(this); m_tree->setContextMenuPolicy(Qt::CustomContextMenu); m_tree->setModel(m_model); QVBoxLayout *layout = new QVBoxLayout; layout->setMargin(0); layout->addWidget(m_tree); this->setLayout(layout); connect(m_tree,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(openPathIndex(QModelIndex))); connect(m_liteApp->editorManager(),SIGNAL(currentEditorChanged(LiteApi::IEditor*)),this,SLOT(currentEditorChanged(LiteApi::IEditor*))); m_fileMenu = new QMenu(this); m_folderMenu = new QMenu(this); m_openEditorAct = new QAction(tr("Open Editor"),this); m_newFileAct = new QAction(tr("New File"),this); m_newFileWizardAct = new QAction(tr("New File Wizard"),this); m_renameFileAct = new QAction(tr("Rename File"),this); m_removeFileAct = new QAction(tr("Remove File"),this); m_newFolderAct = new QAction(tr("New Folder"),this); m_renameFolderAct = new QAction(tr("Rename Folder"),this); m_removeFolderAct = new QAction(tr("Remove Folder"),this); m_openShellAct = new QAction(tr("Open Terminal Here"),this); m_openExplorerAct = new QAction(tr("Open Explorer Here"),this); m_fileMenu->addAction(m_openEditorAct); m_fileMenu->addSeparator(); m_fileMenu->addAction(m_newFileAct); m_fileMenu->addAction(m_newFileWizardAct); m_fileMenu->addAction(m_renameFileAct); m_fileMenu->addAction(m_removeFileAct); m_fileMenu->addSeparator(); m_fileMenu->addAction(m_openShellAct); m_fileMenu->addAction(m_openExplorerAct); m_folderMenu->addAction(m_newFileAct); m_folderMenu->addAction(m_newFileWizardAct); m_folderMenu->addAction(m_newFolderAct); m_folderMenu->addAction(m_renameFolderAct); m_folderMenu->addAction(m_removeFolderAct); m_folderMenu->addSeparator(); m_folderMenu->addAction(m_openShellAct); m_folderMenu->addAction(m_openExplorerAct); connect(m_model->fileWatcher(),SIGNAL(directoryChanged(QString)),this,SLOT(directoryChanged(QString))); connect(m_openEditorAct,SIGNAL(triggered()),this,SLOT(openEditor())); connect(m_newFileAct,SIGNAL(triggered()),this,SLOT(newFile())); connect(m_newFileWizardAct,SIGNAL(triggered()),this,SLOT(newFileWizard())); connect(m_renameFileAct,SIGNAL(triggered()),this,SLOT(renameFile())); connect(m_removeFileAct,SIGNAL(triggered()),this,SLOT(removeFile())); connect(m_newFolderAct,SIGNAL(triggered()),this,SLOT(newFolder())); connect(m_renameFolderAct,SIGNAL(triggered()),this,SLOT(renameFolder())); connect(m_removeFolderAct,SIGNAL(triggered()),this,SLOT(removeFolder())); connect(m_openShellAct,SIGNAL(triggered()),this,SLOT(openShell())); connect(m_openExplorerAct,SIGNAL(triggered()),this,SLOT(openExplorer())); connect(m_tree,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(treeViewContextMenuRequested(QPoint))); }
void MainTab::openFileST(){ QString file_name = QFileDialog::getOpenFileName(this, tr("Open file"), GlobalSettings::instance()->lastOpenedFileDir(), tr("All files (*)")); if (file_name.isEmpty()) return; openEditor(file_name); }
bool ScriptableProxyHelper::browserOpenEditor(const QByteArray &arg1, bool changeClipboard) { BROWSER_INVOKE(openEditor(arg1, changeClipboard), false); }
int main(int argc, char **argv) { int c, i; struct panelw *actw; MEVENT event; const char *cb; args.address = 0x20; args.bus = 0x02; args.columns = 16; args.rows = 2; do { i = 0; c = getopt_long(argc, argv, "abc::r::h", options, &i); switch(c) { case 'a': if (optarg) { args.address = strtoul(optarg, NULL, 0); if (args.address == 0x00) help(argv, "Address of a chip must be a number!"); } break; case 'b': if (optarg) { args.bus = strtoul(optarg, NULL, 0); if (args.bus == 0x00) help(argv, "Bus number must be a number!"); } break; case 'c': if (optarg) { args.columns = strtoul(optarg, NULL, 0); if (args.columns == 0x00) help(argv, "The display is not in the list below:"); } break; case 'r': if (optarg) { args.rows = strtoul(optarg, NULL, 0); if (args.rows == 0x00) help(argv, "The display is not in the list below:"); } break; case 'f': if (optarg) strncpy(args.headername, optarg, 32); else strncpy(args.headername, "./gcbitmap.h", 32); break; case 'h': help(argv, ""); case -1: break; case '?': help(argv, "Unknown option"); break; default: help(argv, "No options given"); break; } }while(c != -1); initscr(); refresh(); keypad(stdscr, TRUE); nonl(); cbreak(); noecho(); curs_set(1); if (has_colors()) { start_color(); init_pair(1, COLOR_BLACK, COLOR_GREEN); init_pair(2, COLOR_WHITE, COLOR_BLACK); init_pair(3, COLOR_WHITE, COLOR_BLUE); init_pair(4, COLOR_GREEN, COLOR_BLACK); wattron(stdscr, COLOR_PAIR(4)); wbkgd(stdscr, COLOR_PAIR(4)); } openEditor(&args, &ed); actw = ed._actw; for(i=0; i < 8; i++) lcdSetGC(&ed.lcd, i, gcbitmap[i]); setWindowState(actw, 1); gcActivateHandler(actw->next); while(((c = wgetch(actw->win)) != KEY_F(10))) { // switch(c) { case KEY_F(5): ed.brght -= ed.brght > 0 ? 1 : 0; lcdSetBacklight(&ed.lcd, ed.brght); mvwprintw(ed.potss->win, 1, 1, "Brightness:\t0x%02X", ed.brght); update_panels(); doupdate(); refresh(); continue; case KEY_F(6): ed.brght += ed.brght < 0x3f ? 1 : 0; lcdSetBacklight(&ed.lcd, ed.brght); mvwprintw(ed.potss->win, 1, 1, "Brightness:\t0x%02X", ed.brght); update_panels(); doupdate(); refresh(); continue; case KEY_F(4): ed.contr -= ed.contr > 0 ? 1 : 0; lcdSetContrast(&ed.lcd, ed.contr); mvwprintw(ed.potss->win, 2, 1, "Contrast:\t0x%02X", ed.contr); update_panels(); doupdate(); refresh(); continue; case KEY_F(3): ed.contr += ed.contr < 0x3f ? 1 : 0; lcdSetContrast(&ed.lcd, ed.contr); mvwprintw(ed.potss->win, 2, 1, "Contrast:\t0x%02X", ed.contr); update_panels(); doupdate(); refresh(); continue; case 9: setWindowState(actw, 0); actw = returnNextWindow(&ed); setWindowState(actw, 1); continue; case KEY_MOUSE: if(getmouse(&event) == OK) { printf("%d %d\n", event.x, event.y); } continue; default: if(actw->handler) actw->handler(actw, c); continue; } } closeEditor(&ed); clear(); endwin(); return 0; }