FileSelectScreen::FileSelectScreen(const FileSelectScreenOptions &options) : options_(options) { currentDirectory_ = g_Config.currentDirectory; #ifdef _WIN32 // HACK // currentDirectory_ = "E:/PSP ISO/"; #endif updateListing(); }
void MainWindow::parse() { QString code = ui->textEdit->toPlainText(); // QMessageBox::information(this, tr("Parse()"), tr("Beginning parse")); int index = 0; while (index < code.length()) { // QMessageBox::information(this, tr("Parse()"), tr("In the loop")); QString word; (extractWord(code, index, word)); // QMessageBox::information(this, tr("Parse() got the word"), tr("%1").arg(word)); if(word.length() == 2) { while (!(code.at(index).isLetterOrNumber() || (code.at(index) == ';'))) { index++; if(index == code.length()) break; } continue; } else index += word.length() - 1; QString type = " "; if(word.at(1) == ';') type = "comment"; else if(instructions.contains(word, Qt::CaseInsensitive)) { type.append(tr("instruction with arity %1").arg(arity(word))); interpret(word, index); updateListing(); } else if(registers.contains(word, Qt::CaseInsensitive)) { type = "register"; } else if(word.at(word.length() - 2) == 'H' || word.at(word.length() - 1) == 'H') type = "number"; else if(word.at(word.length() - 2) == ':' || labels.contains(word)) { if(!labels.contains(word)) labels.append(tr("%1").arg(word.left(word.length() - 2))); type = "label"; } else type = "unknown"; // QMessageBox::information(this, tr("Word found"), tr("\"%1\"\n%2").arg(word).arg(type)); } ui->statusBar->showMessage(tr("Labels: %1").arg(labels)); }
void RenameImagesWidget::slotOptionsChanged() { ui->m_formatDateCheck->setEnabled(ui->m_addFileDateCheck->isChecked()); ui->m_useExtraSymbolsCheck->setEnabled(ui->m_addFileDateCheck->isChecked()); ui->m_formatDateEdit->setEnabled(ui->m_formatDateCheck->isEnabled() && ui->m_formatDateCheck->isChecked()); updateListing(); }
void FileSelectScreen::render() { FileListAdapter adapter(options_, &listing_); UIShader_Prepare(); UIBegin(); DrawBackground(1.0f); if (list_.Do(GEN_ID, 10, BUTTON_HEIGHT + 20, dp_xres-20, dp_yres - BUTTON_HEIGHT - 30, &adapter)) { if (listing_[list_.selected].isDirectory) { currentDirectory_ = listing_[list_.selected].fullName; ILOG("%s", currentDirectory_.c_str()); updateListing(); list_.selected = -1; } else { std::string boot_filename = listing_[list_.selected].fullName; ILOG("Selected: %i : %s", list_.selected, boot_filename.c_str()); list_.selected = -1; g_Config.Save(); screenManager()->switchScreen(new EmuScreen(boot_filename)); } } ui_draw2d.DrawImageStretch(I_BUTTON, 0, 0, dp_xres, 70); if (UIButton(GEN_ID, Pos(10,10), SMALL_BUTTON_WIDTH, "Up", ALIGN_TOPLEFT)) { currentDirectory_ = getDir(currentDirectory_); updateListing(); } ui_draw2d.DrawTextShadow(UBUNTU24, currentDirectory_.c_str(), 20 + SMALL_BUTTON_WIDTH, 10 + 25, 0xFFFFFFFF, ALIGN_LEFT | ALIGN_VCENTER); /* if (UIButton(GEN_ID, Pos(dp_xres - 10, 10), SMALL_BUTTON_WIDTH, "Back", ALIGN_RIGHT)) { g_Config.Save(); screenManager()->switchScreen(new MenuScreen()); }*/ UIEnd(); glsl_bind(UIShader_Get()); ui_draw2d.Flush(UIShader_Get()); }
void RenameImagesWidget::slotRemoveImage() { if (ui->m_listView->selectedItems().isEmpty()) return; BatchProcessImagesItem* item = static_cast<BatchProcessImagesItem*>(ui->m_listView->selectedItems().first()); delete item; ui->m_pixLabel->clear(); updateListing(); }
void BrowserDialog::open() { // Call super implementation Dialog::open(); if (ConfMan.hasKey("browser_lastpath")) _node = Common::FSNode(ConfMan.get("browser_lastpath")); if (!_node.isDirectory()) _node = Common::FSNode("."); // Alway refresh file list updateListing(); }
void RenameImagesWidget::reverseList() { if (ui->m_listView->topLevelItemCount() < 2) return; QList<QTreeWidgetItem*> lst; while (ui->m_listView->topLevelItemCount() > 0) { lst.prepend(ui->m_listView->takeTopLevelItem(0)); } ui->m_listView->addTopLevelItems(lst); updateListing(); }
ThemeManagerWidget::ThemeManagerWidget(QWidget *parent) : QDialog(parent), ui(new Ui::ThemeManagerWidget) { ui->setupUi(this); connect(ui->getListingButton, SIGNAL(clicked()), SLOT(updateListing())); connect(&manager, SIGNAL(finished(QNetworkReply*)), SLOT(downloadFinished(QNetworkReply*))); setWindowTitle("Theme Manager"); }
void RemoteBrowserDialog::handleTickle() { if (_updateList) { updateListing(); _updateList = false; } if (_showError) { _showError = false; MessageDialog alert(_("ScummVM could not access the directory!")); alert.runModal(); } Dialog::handleTickle(); }
void RenameImagesWidget::moveCurrentItemDown() { QTreeWidgetItem* currentItem = ui->m_listView->currentItem(); if (!currentItem) return; int index = ui->m_listView->indexOfTopLevelItem(currentItem); if (index == ui->m_listView->topLevelItemCount() - 1) { return; } ui->m_listView->takeTopLevelItem(index); ui->m_listView->insertTopLevelItem(index + 1, currentItem); ui->m_listView->setCurrentItem(currentItem); updateListing(); }
void RenameImagesWidget::slotAddImages() { KUrl::List urls = KIPIPlugins::KPImageDialog::getImageUrls(this); for (KUrl::List::iterator it = urls.begin(); it != urls.end(); ++it) { if (m_urlList.contains(*it)) continue; new BatchProcessImagesItem(ui->m_listView, (*it).path().section('/', 0, -1), (*it).fileName(), QString(), QString()); m_urlList.append(*it); } updateListing(); }
void RemoteBrowserDialog::listDirectory(Cloud::StorageFile node) { if (_navigationLocked || _workingRequest) return; if (_rememberedNodeContents.contains(node.path())) { _nodeContent = _rememberedNodeContents[node.path()]; } else { _navigationLocked = true; _workingRequest = CloudMan.listDirectory( node.path(), new Common::Callback<RemoteBrowserDialog, Cloud::Storage::ListDirectoryResponse>(this, &RemoteBrowserDialog::directoryListedCallback), new Common::Callback<RemoteBrowserDialog, Networking::ErrorResponse>(this, &RemoteBrowserDialog::directoryListedErrorCallback), false ); } _backupNode = _node; _node = node; updateListing(); }
bool ZmdUpdaterCore::qt_emit( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->signalOffset() ) { case 0: userListing((QValueList<Identity>)(*((QValueList<Identity>*)static_QUType_ptr.get(_o+1)))); break; case 1: serviceListing((QValueList<Service>)(*((QValueList<Service>*)static_QUType_ptr.get(_o+1)))); break; case 2: catalogListing((QValueList<Catalog>)(*((QValueList<Catalog>*)static_QUType_ptr.get(_o+1)))); break; case 3: patchListing((QValueList<Patch>)(*((QValueList<Patch>*)static_QUType_ptr.get(_o+1)))); break; case 4: updateListing((QValueList<Package>)(*((QValueList<Package>*)static_QUType_ptr.get(_o+1)))); break; case 5: lockListing((QValueList<PackageLock>)(*((QValueList<PackageLock>*)static_QUType_ptr.get(_o+1)))); break; case 6: packageInfo((Package)(*((Package*)static_QUType_ptr.get(_o+1)))); break; case 7: packageDetails((PackageDetails)(*((PackageDetails*)static_QUType_ptr.get(_o+1)))); break; case 8: realPackages((QValueList<Package>)(*((QValueList<Package>*)static_QUType_ptr.get(_o+1))),(QValueList<Package>)(*((QValueList<Package>*)static_QUType_ptr.get(_o+2))),(QValueList<Package>)(*((QValueList<Package>*)static_QUType_ptr.get(_o+3)))); break; case 9: transactionFinished((int)static_QUType_int.get(_o+1),(QString)static_QUType_QString.get(_o+2)); break; case 10: serviceAdded((QString)static_QUType_QString.get(_o+1),(int)static_QUType_int.get(_o+2),(QString)static_QUType_QString.get(_o+3)); break; case 11: generalFault((QString)static_QUType_QString.get(_o+1),(int)static_QUType_int.get(_o+2)); break; case 12: progress((Progress)(*((Progress*)static_QUType_ptr.get(_o+1)))); break; case 13: downloadProgress((Progress)(*((Progress*)static_QUType_ptr.get(_o+1)))); break; default: return QObject::qt_emit(_id,_o); } return TRUE; }
FileSelectScreen::FileSelectScreen(const FileSelectScreenOptions &options) : options_(options) { currentDirectory_ = g_Config.currentDirectory; updateListing(); }
void BrowserDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { switch (cmd) { case kChooseCmd: if (_isDirBrowser) { // If nothing is selected in the list widget, choose the current dir. // Else, choose the dir that is selected. int selection = _fileList->getSelected(); if (selection >= 0) _choice = _nodeContent[selection]; else _choice = _node; setResult(1); close(); } else { int selection = _fileList->getSelected(); if (selection < 0) break; if (_nodeContent[selection].isDirectory()) { _node = _nodeContent[selection]; updateListing(); } else { _choice = _nodeContent[selection]; setResult(1); close(); } } break; case kGoUpCmd: _node = _node.getParent(); updateListing(); break; case kListItemActivatedCmd: case kListItemDoubleClickedCmd: if (_nodeContent[data].isDirectory()) { _node = _nodeContent[data]; updateListing(); } else if (!_isDirBrowser) { _choice = _nodeContent[data]; setResult(1); close(); } break; case kListSelectionChangedCmd: // We do not allow selecting directories in directory // browser mode, thus we will invalidate the selection // when the user selects an directory over here. if (data != (uint32)-1 && _isDirBrowser && !_nodeContent[data].isDirectory()) _fileList->setSelected(-1); break; case kHiddenCmd: // Update whether the user wants hidden files to be shown _showHidden = _showHiddenWidget->getState(); // We save the state in the application domain to avoid cluttering and // to prevent odd behavior. ConfMan.setBool("gui_browser_show_hidden", _showHidden, Common::ConfigManager::kApplicationDomain); // Update the file listing updateListing(); break; default: Dialog::handleCommand(sender, cmd, data); } }
void FileBrowserDialog::open() { // Call super implementation Dialog::open(); updateListing(); }