示例#1
0
bool MainWindow::loadDiagram(const QString& filename)
{
    newCanvasTab();

    bool successful = canvas()->loadDiagram(filename);

    QSettings settings;
    QStringList files = settings.value("recentFileList").toStringList();
    files.removeAll(filename);
    files.prepend(filename);
    while (files.size() > MAX_RECENT_FILES)
    {
        files.removeLast();
    }
    settings.setValue("recentFileList", files);
    updateRecentFileActions();

    QFileInfo fileinfo(filename);
    canvasFileInfoChanged(fileinfo);

    view()->postDiagramLoad();

    // Cause widget settings values to notice updated preferences
    // from the loaded diagram.
    m_tab_widget->currentChanged(m_tab_widget->currentIndex());

    return successful;
}
示例#2
0
bool MainWindow::loadDiagram(const QString& filename)
{
    newCanvasTab();

    bool successful = canvas()->loadDiagram(filename);

    addRecentFile(filename);

    QFileInfo fileinfo(filename);
    canvasFileInfoChanged(fileinfo);

    view()->postDiagramLoad();

    // Cause widget settings values to notice updated preferences
    // from the loaded diagram.
    m_tab_widget->currentChanged(m_tab_widget->currentIndex());

    return successful;
}
示例#3
0
void MainWindow::documentNew(void)
{
    newCanvasTab();
    view()->postDiagramLoad();
}