Beispiel #1
0
BookViewPreview::BookViewPreview(QWidget *parent)
    : QWebView(parent),
      c_GetBlock(Utility::ReadUnicodeTextFile(":/javascript/get_block.js")),
      m_isLoadFinished(false),
      m_ContextMenu(new QMenu(this)),
      m_ViewWebPage(new ViewWebPage(this)),
      c_jQuery(Utility::ReadUnicodeTextFile(":/javascript/jquery-1.6.2.min.js")),
      c_jQueryScrollTo(Utility::ReadUnicodeTextFile(":/javascript/jquery.scrollTo-1.4.2-min.js")),
      c_jQueryWrapSelection(Utility::ReadUnicodeTextFile(":/javascript/jquery.wrapSelection.js")),
      c_GetCaretLocation(Utility::ReadUnicodeTextFile(":/javascript/book_view_current_location.js")),
      c_GetRange(Utility::ReadUnicodeTextFile(":/javascript/get_range.js")),
      c_NewSelection(Utility::ReadUnicodeTextFile(":/javascript/new_selection.js")),
      c_GetParentTags(Utility::ReadUnicodeTextFile(":/javascript/get_parent_tags.js")),
      m_CaretLocationUpdate(QString()),
      m_pendingLoadCount(0),
      m_pendingScrollToFragment(QString())
{
    setContextMenuPolicy(Qt::CustomContextMenu);
    // Set the Zoom factor but be sure no signals are set because of this.
    SettingsStore settings;
    SetCurrentZoomFactor(settings.zoomPreview());
    // use our web page that can be used for debugging javascript
    setPage(m_ViewWebPage);
    // Enable our link filter.
    page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
    page()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
    CreateContextMenuActions();
    ConnectSignalsToSlots();
}
Beispiel #2
0
CSSFilesWidget::CSSFilesWidget()
    :
    m_ItemModel(new QStandardItemModel),
    m_ContextMenu(new QMenu(this))
{
    ui.setupUi(this);
    ui.fileTree->setContextMenuPolicy(Qt::CustomContextMenu);
    CreateContextMenuActions();
    connectSignalsSlots();
}
Beispiel #3
0
ImageFilesWidget::ImageFilesWidget()
    :
    m_ItemModel(new QStandardItemModel),
    m_ThumbnailSize(THUMBNAIL_SIZE),
    m_ContextMenu(new QMenu(this)),
    m_LastDirSaved(QString()),
    m_LastFileSaved(QString())
{
    ui.setupUi(this);
    ui.fileTree->setContextMenuPolicy(Qt::CustomContextMenu);
    CreateContextMenuActions();
    connectSignalsSlots();
    ReadSettings();
}
Beispiel #4
0
EditTOC::EditTOC(QSharedPointer<Book> book, QList<Resource *> resources, QWidget *parent)
    :
    QDialog(parent),
    m_Book(book),
    m_Resources(resources),
    m_TableOfContents(new QStandardItemModel(this)),
    m_ContextMenu(new QMenu(this)),
    m_NCXModel(new NCXModel(this))
{
    ui.setupUi(this);
    ui.TOCTree->setContextMenuPolicy(Qt::CustomContextMenu);
    ui.TOCTree->installEventFilter(this);
    ui.TOCTree->setModel(m_TableOfContents);
    ui.TOCTree->setIndentation(COLUMN_INDENTATION);
    CreateContextMenuActions();
    ConnectSignalsToSlots();

    CreateTOCModel();
    UpdateTreeViewDisplay();
    ReadSettings();
}
Beispiel #5
0
// Constructor;
// the first parameter is the book whose TOC
// is being edited, the second is the dialog's parent
HeadingSelector::HeadingSelector(QSharedPointer<Book> book, QWidget *parent)
    :
    QDialog(parent),
    m_Book(book),
    m_ContextMenu(new QMenu(this)),
    m_book_changed(false)
{
    ui.setupUi(this);
    ui.tvTOCDisplay->setContextMenuPolicy(Qt::CustomContextMenu);
    ui.tvTOCDisplay->installEventFilter(this);
    CreateContextMenuActions();
    ConnectSignalsToSlots();
    ui.tvTOCDisplay->setModel(&m_TableOfContents);
    LockHTMLResources();
    QList<Headings::Heading> flat_headings = Headings::GetHeadingList(
                m_Book->GetFolderKeeper().GetResourceTypeList<HTMLResource>(true), true);
    m_Headings = Headings::MakeHeadingHeirarchy(flat_headings);
    PopulateSelectHeadingCombo(GetMaxHeadingLevel(flat_headings));
    RefreshTOCModelDisplay();
    ReadSettings();
}
Beispiel #6
0
SpellcheckEditor::SpellcheckEditor(QWidget *parent)
    :
    QDialog(parent),
    m_Book(NULL),
    m_SpellcheckEditorModel(new QStandardItemModel(this)),
    m_ContextMenu(new QMenu(this)),
    m_MultipleSelection(false),
    m_SelectRow(-1),
    m_FilterSC(new QShortcut(QKeySequence(tr("f", "Filter")), this)),
    m_ShowAllSC(new QShortcut(QKeySequence(tr("s", "ShowAllWords")), this)),
    m_NoCaseSC(new QShortcut(QKeySequence(tr("c", "Case-InsensitiveSort")), this)),
    m_RefreshSC(new QShortcut(QKeySequence(tr("r", "Refresh")), this))
{
    ui.setupUi(this);
    ui.FilterText->installEventFilter(this);

    SetupSpellcheckEditorTree();
    CreateContextMenuActions();
    ConnectSignalsSlots();
    UpdateDictionaries();
    ReadSettings();
}
void CExplorerView::SetProjectPath(const QString& a_sProjectPath)
{
    m_sRoot = QString(a_sProjectPath);
//    m_pFileModel = new CFileSystemModel(this);
    m_pFileModel->setFilter(QDir::NoDot | QDir::Files | QDir::Dirs);
    m_pFileModel->sort(1);
    setModel(m_pFileModel);
    m_pFileModel->setReadOnly(false);
    SetCurrentDir(a_sProjectPath);
    setCurrentIndex(rootIndex());
    setSelectionMode( QAbstractItemView::ExtendedSelection );
    CreateContextMenuActions();

    this->show();
    this->setEditTriggers(QAbstractItemView::EditKeyPressed | QAbstractItemView::SelectedClicked);
    this->setAcceptDrops(true);
    this->setDropIndicatorShown(true);
    this->setDragDropMode(QAbstractItemView::DragDrop);
    this->setDragDropOverwriteMode(true);
    this->setContextMenuPolicy(Qt::DefaultContextMenu);

    m_oTimer->setSingleShot(true);
    connect(m_oTimer, SIGNAL(timeout()), this, SLOT(dragIdle()));
}