Ejemplo n.º 1
0
FindReplace::FindReplace( MainWindow &main_window )
    : QWidget( &main_window ),
      m_MainWindow( main_window ),
      m_RegexOptionDotAll( false ),
      m_RegexOptionMinimalMatch( false ),
      m_RegexOptionAutoTokenise( false ),
      m_SpellCheck(false),
      m_LookWhereCurrentFile(false)
{
    ui.setupUi( this );

    FindReplaceQLineEdit *q = new FindReplaceQLineEdit(this);
    ui.cbFind->setLineEdit(q);

    QCompleter *fqc = ui.cbFind->completer();
    fqc->setCaseSensitivity(Qt::CaseSensitive);
    ui.cbFind->setCompleter(fqc);

    QCompleter *rqc = ui.cbReplace->completer();
    rqc->setCaseSensitivity(Qt::CaseSensitive);
    ui.cbReplace->setCompleter(rqc);

    ExtendUI();
    ConnectSignalsToSlots();

    ReadSettings();
}
Ejemplo n.º 2
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 )
{
    ui.setupUi( this );
    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 ) );

    CreateTOCModel();

    // Set the initial display state
    if ( ui.cbTOCItemsOnly->checkState() == Qt::Checked ) 

        RemoveExcludedItems( m_TableOfContents.invisibleRootItem() );

    UpdateTreeViewDisplay();
    ReadSettings();
}
Ejemplo n.º 3
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();
}
Ejemplo n.º 4
0
XMLTab::XMLTab( XMLResource& resource, int line_to_scroll_to, QWidget *parent )
    :
    TextTab( resource, CodeViewEditor::Highlight_XHTML, line_to_scroll_to, parent ),
    m_XMLResource( resource ),
    m_WellFormedCheckComponent( *new WellFormedCheckComponent( *this ) )
{
    ConnectSignalsToSlots();
}
Ejemplo n.º 5
0
AVTab::AVTab(Resource &resource, QWidget *parent)
    : ContentTab(resource, parent),
      m_WebView(new QWebView(this))
{
    m_WebView->setContextMenuPolicy(Qt::NoContextMenu);
    m_WebView->setFocusPolicy(Qt::NoFocus);
    m_WebView->setAcceptDrops(false);
    m_Layout.addWidget(m_WebView);
    ConnectSignalsToSlots();
    RefreshContent();
}
Ejemplo n.º 6
0
ClipboardHistorySelector::ClipboardHistorySelector(QWidget *parent)
    : 
    QDialog(parent),
    m_ClipboardHistoryItems(new QStringList())
{
    ui.setupUi(this);
    ExtendUI();

    ReadSettings();

    ConnectSignalsToSlots();
} 
Ejemplo n.º 7
0
PreviewWindow::PreviewWindow(QWidget *parent)
    :
    QDockWidget(tr("Preview"), parent),
    m_MainWidget(*new QWidget(this)),
    m_Layout(*new QVBoxLayout(&m_MainWidget)),
    m_Preview(new BookViewPreview(this)),
    m_Inspector(new QWebInspector(this)),
    m_Splitter(new QSplitter(this)),
    m_StackedViews(new QStackedWidget(this))
{
    SetupView();
    LoadSettings();
    ConnectSignalsToSlots();
}
Ejemplo n.º 8
0
ImageTab::ImageTab( ImageResource& resource, QWidget *parent )
    :
    ContentTab( resource, parent ),
    m_WebView(*new QWebView(this))
{
    m_WebView.setContextMenuPolicy(Qt::NoContextMenu);
    m_WebView.setFocusPolicy(Qt::NoFocus);
    m_WebView.setAcceptDrops(false);

    m_Layout.addWidget( &m_WebView);

    // Set the Zoom factor but be sure no signals are set because of this.
    SettingsStore settings;
    m_CurrentZoomFactor = settings.zoomImage();
    Zoom();

    ConnectSignalsToSlots();

    RefreshContent();
}
Ejemplo n.º 9
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();
}
Ejemplo n.º 10
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();
}