void ApplyMeasureNowDialog::requestReload()
{
  // todo: do this in memory without reloading from disk
  OS_ASSERT(m_reloadPath);
  QString fileToLoad = toQString(*m_reloadPath);
  emit reloadFile(fileToLoad, true, true);

  // close the dialog
  close();
}
Example #2
0
void MainWindow::loadFile(const QString &fileName)
{
    logFile  = new QFile(fileName);
#ifndef QT_NO_CURSOR
    QApplication::setOverrideCursor(Qt::WaitCursor);
#endif
#ifndef QT_NO_CURSOR
    QApplication::restoreOverrideCursor();
#endif

    setCurrentFile(fileName);
    statusBar()->showMessage(tr("File loaded"), 2000);
    reloadFile();
}
Example #3
0
MainWindow::MainWindow(QWidget* parent)
	: QMainWindow(parent)
	, ui_()
	, images_()
	, timer_()
{
	ui_.setupUi(this);
	setWindowTitle(QApplication::applicationName());
	setWindowState(Qt::WindowMaximized);

	//set reload action group
	QActionGroup* group = new QActionGroup(this);
	group->addAction(ui_.actionReloadAsk);
	group->addAction(ui_.actionReloadNo);
	group->addAction(ui_.actionReloadAuto);
	ui_.actionReloadAuto->setChecked(true);

	//init file watcher
	watcher_.setDelayInSeconds(0.001);
	connect(&watcher_, SIGNAL(fileChanged()), this, SLOT(reloadFile()));

	//start timer for image size update
	connect(&timer_, SIGNAL(timeout()), this, SLOT(updateImageSize()));
	timer_.start(250);

	//init images
	QStringList args = QApplication::arguments();
	if (args.count()>1 && QFile::exists(args[1]))
	{
		QFileInfo file_info(args[1]);
		updateImageList(file_info.canonicalPath(), file_info.fileName());
	}
	else
	{
		updateImageList(Settings::path("folder"));
	}
}
Example #4
0
void Disassembler::handleFileChanged(int id) {
	m_currentFile = file->itemData(id).toString();
	reloadFile();
}
Example #5
0
Planar::Planar(string configFile, Shader *shader) : Geometry(shader), mesh(WHITE) {
	Geometry::masterReset(false);
	reloadFile(configFile);
}
Example #6
0
UIImageOverview::UIImageOverview(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::UIImageOverview)
{
    QClipboard *clipboard = QApplication::clipboard();

    requestHandler = new RequestHandler(this);
    iParser = 0;
    oParser = 0;
    _cachedResult = false;

    pendingThumbnails.clear();

    ui->setupUi(this);

#ifndef __DEBUG__
    ui->btnDebug->hide();
#endif

    timer = new QTimer(this);
    settings = new QSettings("settings.ini", QSettings::IniFormat);

    thumbnailsizeLocked = false;
    closeWhenFinished = false;
    downloading = false;

    deleteFileAction = new QAction(QString("Delete File"), this);
    deleteFileAction->setIcon(QIcon(":/icons/resources/remove.png"));
    reloadFileAction = new QAction("Reload File", this);
    reloadFileAction->setIcon(QIcon(":/icons/resources/reload.png"));
    openFileAction = new QAction("Open File", this);
    openFileAction->setIcon(QIcon(":/icons/resources/open.png"));

    ui->progressBar->setMinimum(1);
    ui->progressBar->setMaximum(-1);
    ui->progressBar->setValue(0);
    ui->progressBar->setEnabled(true);
    ui->progressBar->setVisible(false);
    ui->progressBar->setFormat("%p%");

    if (QUrl(clipboard->text()).isValid() && pluginManager->isSupported(clipboard->text())) {
        ui->leURI->setText(clipboard->text());
    }

    connect(requestHandler, SIGNAL(responseError(QUrl, int)), this, SLOT(errorHandler(QUrl, int)));
    connect(requestHandler, SIGNAL(response(QUrl, QByteArray, bool)), this, SLOT(processRequestResponse(QUrl, QByteArray, bool)));

    connect(ui->leSavepath, SIGNAL(textChanged(QString)), this, SIGNAL(directoryChanged(QString)));
    connect(ui->listWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(openFile()));

    connect(deleteFileAction, SIGNAL(triggered()), this, SLOT(deleteFile()));
    connect(reloadFileAction, SIGNAL(triggered()), this, SLOT(reloadFile()));
    connect(openFileAction, SIGNAL(triggered()), this, SLOT(openFile()));

    connect(timer, SIGNAL(timeout()), this, SLOT(triggerRescan()));
    connect(folderShortcuts, SIGNAL(shortcutsChanged()), this, SLOT(fillShortcutComboBox()));
    connect(ui->cbFolderShortcuts, SIGNAL(currentIndexChanged(QString)), this, SLOT(selectShortcut(QString)));
    connect(ui->leSavepath, SIGNAL(textChanged(QString)), this, SLOT(checkForFolderShortcut(QString)));
    connect(ui->btnAddShortcut, SIGNAL(clicked()), this, SLOT(addShortcut()));

    // Connections for key bindings
    connect(ui->listWidget, SIGNAL(openItem()), this, SLOT(openFile()));
    connect(ui->listWidget, SIGNAL(deleteItem()), this, SLOT(deleteFile()));
    connect(ui->listWidget, SIGNAL(reloadItem()), this, SLOT(reloadFile()));

    connect(tnt, SIGNAL(thumbnailAvailable(QString,QString)), this, SLOT(addThumbnail(QString,QString)));

    setTabTitle("idle");

    loadSettings();
    fillShortcutComboBox();
    expectedThumbnailCount = 0;
    thumbnailCount = 0;
}