Ejemplo n.º 1
0
    void LoginPage::init()
    {
        QMap<QString, QString> countryCodes = Utils::GetCountryCodes();
        combobox_->setEditBoxClass("CountrySearchEdit");
        combobox_->setComboboxViewClass("CountrySearchView");
        combobox_->setClass("CountySearchWidgetInternal");
        combobox_->setPlaceholder(QT_TRANSLATE_NOOP("login_page","Type country or code"));
        country_search_widget_->layout()->addWidget(combobox_);
        combobox_->setSources(countryCodes);

        connect(combobox_, SIGNAL(selected(QString)), this, SLOT(countrySelected(QString)), Qt::QueuedConnection);
        connect(this, SIGNAL(country(QString)), this, SLOT(redrawCountryCode()), Qt::QueuedConnection);
        connect(next_page_link_, SIGNAL(clicked()), this, SLOT(nextPage()), Qt::QueuedConnection);
        connect(prev_page_link_, SIGNAL(clicked()), this, SLOT(prevPage()), Qt::QueuedConnection);
        connect(edit_phone_button_, SIGNAL(clicked()), this, SLOT(prevPage()), Qt::QueuedConnection);
        connect(edit_phone_button_, SIGNAL(clicked()), this, SLOT(stats_edit_phone()), Qt::QueuedConnection);
        connect(switch_login_link_, SIGNAL(clicked()), this, SLOT(switchLoginType()), Qt::QueuedConnection);
        connect(resend_button_, SIGNAL(clicked()), this, SLOT(sendCode()), Qt::QueuedConnection);
        connect(resend_button_, SIGNAL(clicked()), this, SLOT(stats_resend_sms()), Qt::QueuedConnection);
        connect(timer_, SIGNAL(timeout()), this, SLOT(updateTimer()), Qt::QueuedConnection);

        connect(proxy_settings_link_, SIGNAL(clicked()), this, SLOT(openProxySettings()), Qt::QueuedConnection);

        country_code_->setProperty("CountryCodeEdit", true);
        phone_->setProperty("PhoneNumberEdit", true);
        phone_->setAttribute(Qt::WA_MacShowFocusRect, false);
        phone_->setPlaceholderText(QT_TRANSLATE_NOOP("login_page","your phone number"));
        phone_widget_->layout()->addWidget(country_code_);
        phone_widget_->layout()->addWidget(phone_);
        Testing::setAccessibleName(phone_, "StartWindowPhoneNumberField");

        connect(country_code_, SIGNAL(focusIn()), this, SLOT(setPhoneFocusIn()), Qt::QueuedConnection);
        connect(country_code_, SIGNAL(focusOut()), this, SLOT(setPhoneFocusOut()), Qt::QueuedConnection);
        connect(phone_, SIGNAL(focusIn()), this, SLOT(setPhoneFocusIn()), Qt::QueuedConnection);
        connect(phone_, SIGNAL(focusOut()), this, SLOT(setPhoneFocusOut()), Qt::QueuedConnection);

        connect(uin_login_edit_, SIGNAL(textChanged(QString)), this, SLOT(clearErrors()), Qt::QueuedConnection);
        connect(uin_password_edit_, SIGNAL(textEdited(QString)), this, SLOT(clearErrors()), Qt::QueuedConnection);
        connect(code_edit_, SIGNAL(textChanged(QString)), this, SLOT(clearErrors()), Qt::QueuedConnection);
        connect(code_edit_, SIGNAL(textChanged(QString)), this, SLOT(codeEditChanged(QString)), Qt::QueuedConnection);
        connect(country_code_, SIGNAL(textChanged(QString)), this, SLOT(clearErrors()), Qt::QueuedConnection);
        connect(country_code_, SIGNAL(textEdited(QString)), this, SLOT(countryCodeChanged(QString)), Qt::QueuedConnection);
        connect(phone_, SIGNAL(textChanged(QString)), this, SLOT(clearErrors()), Qt::QueuedConnection);
        connect(phone_, SIGNAL(emptyTextBackspace()), this, SLOT(emptyPhoneRemove()), Qt::QueuedConnection);

        QObject::connect(Ui::GetDispatcher(), SIGNAL(getSmsResult(int64_t, int, int)), this, SLOT(getSmsResult(int64_t, int, int)), Qt::DirectConnection);
        QObject::connect(Ui::GetDispatcher(), SIGNAL(loginResult(int64_t, int)), this, SLOT(loginResult(int64_t, int)), Qt::DirectConnection);
        QObject::connect(Ui::GetDispatcher(), SIGNAL(loginResultAttachUin(int64_t, int)), this, SLOT(loginResultAttachUin(int64_t, int)), Qt::DirectConnection);
        QObject::connect(Ui::GetDispatcher(), SIGNAL(loginResultAttachPhone(int64_t, int)), this, SLOT(loginResultAttachPhone(int64_t, int)), Qt::DirectConnection);

        country_code_->setValidator(new QRegExpValidator(QRegExp("[\\+\\d]\\d*")));
        phone_->setValidator(new QRegExpValidator(QRegExp("\\d*")));
        code_edit_->setValidator(new QRegExpValidator(QRegExp("\\d*")));

        combobox_->selectItem(Utils::GetTranslator()->getCurrentPhoneCode());
        error_label_->hide();
        phone_->setFocus();
        country_code_->setFocusPolicy(Qt::ClickFocus);
        initLoginSubPage(SUBPAGE_PHONE_LOGIN_INDEX);
    }
Ejemplo n.º 2
0
void CommentWindow::BuildComment()
{
	QVBoxLayout *commentLayout = new QVBoxLayout();
	int count = m_mvModel.m_vComments.size() - MAXPERPAGE*(m_iCurrPage) < MAXPERPAGE
		? m_mvModel.m_vComments.size() - MAXPERPAGE*(m_iCurrPage) : MAXPERPAGE;
	for (int i = 0; i < count; i++)
	{
		BuildSingle(i + MAXPERPAGE*(m_iCurrPage));
		commentLayout->addWidget(m_qwSingleComment);
	}
	commentLayout->addStretch();
	m_qpbPrev = new QPushButton("Prev", m_qwComment);
	m_qpbPrev->setObjectName("detail");
	m_qpbPrev->setFixedSize(DETAIL_W*xscale, DETAIL_H*yscale);
	m_qpbNext = new QPushButton("Next", m_qwComment);
	m_qpbNext->setObjectName("detail");
	m_qpbNext->setFixedSize(DETAIL_W*xscale, DETAIL_H*yscale);
	connect(m_qpbPrev, SIGNAL(clicked()), this, SLOT(prevPage()));
	connect(m_qpbNext, SIGNAL(clicked()), this, SLOT(nextPage()));
	QHBoxLayout *buttonLayout = new QHBoxLayout();
	buttonLayout->addStretch();
	buttonLayout->addWidget(m_qpbPrev);
	buttonLayout->addWidget(m_qpbNext);
	buttonLayout->addSpacing(SPACE);
	commentLayout->addLayout(buttonLayout);
	m_qwComment->setLayout(commentLayout);
	m_qsaArea->setWidget(m_qwComment);
}
Ejemplo n.º 3
0
            //--------------------------------------------------------------
            void Gui::keyPressed(int key) {
                if(!pages.size()) return;

                if(doDefaultKeys) {
                    if(key == ' ') {
                        toggleDraw();
                    } else if(key>='1' && key<='9') {
                        setPage((int)(key - '1')+1);
                        setDraw(true);
                    } else if(doDraw) {
                        switch(key) {
                            case '[': prevPage(); break;
                            case ']': nextPage(); break;
                        }
                    }
                }
                
                if(!doDraw) return;
                ofKeyEventArgs e;
                e.key = key;

                if(!getActiveControls().empty()) {
                    getActiveControls()[0]->_keyPressed(e);
                } else {
                    getCurrentPage().keyPressed(key);
                    Container::keyPressed(key);
                }
            }
Ejemplo n.º 4
0
void pageNumberEdit::wantPrev() { 
  int cur = getCurrentPageNum();
  if ( getCurrentPageNum() > 1 ) {
       setPageNumber( cur-1 );
       emit prevPage();
  }
}
Ejemplo n.º 5
0
void kdvi::makeToolBar2(QWidget *parent)
{
    QPixmap pm;

    toolBar2 = new QFrame( parent );

    QBoxLayout * gl = new QBoxLayout( toolBar2, QBoxLayout::Down );

    sbox = new ScrollBox( toolBar2 );
    connect( sbox, SIGNAL(valueChanged(QPoint)),
             dviwin, SLOT(scroll(QPoint)) );
    connect( sbox, SIGNAL(button3Pressed()), dviwin, SLOT(nextPage()) );
    connect( sbox, SIGNAL(button2Pressed()), dviwin, SLOT(prevPage()) );
    connect( dviwin, SIGNAL(pageSizeChanged( QSize )),
             sbox, SLOT(setPageSize( QSize )) );
    connect( dviwin, SIGNAL(viewSizeChanged( QSize )),
             sbox, SLOT(setViewSize( QSize )) );
    connect( dviwin, SIGNAL(currentPosChanged( QPoint )),
             sbox, SLOT(setViewPos( QPoint )) );
    QToolTip::add( sbox, 0, tipgroup, i18n("Scroll window and switch the page") );
    sbox->setFixedSize(70,80);
    gl->addWidget( sbox );

    // Create a MarkList

    marklist = new MarkList( toolBar2 );
    connect( marklist, SIGNAL(selected(const char *)),
             SLOT(pageActivated(const char *)) );
    QToolTip::add( marklist, 0, tipgroup, i18n("Select page and mark pages for printing") );

    gl->addWidget( marklist );
    gl->activate();

    sbox->setPageSize( dviwin->pageSize() );
}
Ejemplo n.º 6
0
 void BookWindow::onMouseWheel(MyGUI::Widget *_sender, int _rel)
 {
     if (_rel < 0)
         nextPage();
     else
         prevPage();
 }
Ejemplo n.º 7
0
KexiReportView::KexiReportView(QWidget *parent)
        : KexiView(parent)
{
    m_preRenderer = 0;
    setObjectName("KexiReportDesigner_DataView");
    m_scrollArea = new QScrollArea(this);
    m_scrollArea->setBackgroundRole(QPalette::Dark);
    m_scrollArea->viewport()->setAutoFillBackground(true);

    m_pageSelector = new KexiRecordNavigator(this, 0);
    layout()->addWidget(m_scrollArea);
    layout()->addWidget(m_pageSelector);

    m_pageSelector->setRecordCount(0);
    m_pageSelector->setInsertingButtonVisible(false);
    m_pageSelector->setLabelText(i18n("Page"));


    // -- setup local actions
    QList<QAction*> viewActions;
    QAction* a;
    viewActions << (a = new KAction(KIcon("printer"), i18n("Print"), this));
    a->setObjectName("pgzkexirpt_print_report");
    a->setToolTip(i18n("Print Report"));
    a->setWhatsThis(i18n("Prints the current report."));
    connect(a, SIGNAL(triggered()), this, SLOT(slotPrintReport()));

    viewActions << (a = new KAction(KIcon("kword"), i18n("Open in KWord"), this));
    a->setObjectName("pgzkexirpt_open_kword");
    a->setToolTip(i18n("Open the report in KWord"));
    a->setWhatsThis(i18n("Opens the current report in KWord."));
    a->setEnabled(false);
//! @todo connect(a, SIGNAL(triggered()), this, SLOT(slotRenderKWord()));

#ifdef HAVE_KSPREAD
    viewActions << (a = new KAction(KIcon("kspread"), i18n("Open in KSpread"), this));
    a->setObjectName("pgzkexirpt_open_kspread");
    a->setToolTip(i18n("Open the report in KSpread"));
    a->setWhatsThis(i18n("Opens the current report in KSpread."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotRenderKSpread()));
#endif

    viewActions << (a = new KAction(KIcon("text-html"), i18n("Export to HTML"), this));
    a->setObjectName("pgzkexirpt_export_html");
    a->setToolTip(i18n("Export the report to HTML"));
    a->setWhatsThis(i18n("Exports the report to a HTML file."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotExportHTML()));

    setViewActions(viewActions);


    connect(m_pageSelector, SIGNAL(nextButtonClicked()), this, SLOT(nextPage()));
    connect(m_pageSelector, SIGNAL(prevButtonClicked()), this, SLOT(prevPage()));
    connect(m_pageSelector, SIGNAL(firstButtonClicked()), this, SLOT(firstPage()));
    connect(m_pageSelector, SIGNAL(lastButtonClicked()), this, SLOT(lastPage()));

}
Ejemplo n.º 8
0
KexiReportView::KexiReportView(QWidget *parent)
        : KexiView(parent), m_preRenderer(0), m_reportDocument(0), m_kexi(0), m_functions(0)
{   
    setObjectName("KexiReportDesigner_DataView");
    m_scrollArea = new QScrollArea(this);
    m_scrollArea->setBackgroundRole(QPalette::Dark);
    m_scrollArea->viewport()->setAutoFillBackground(true);

    layout()->addWidget(m_scrollArea);
    
#ifndef KEXI_MOBILE
    m_pageSelector = new KexiRecordNavigator(this, 0);
    layout()->addWidget(m_pageSelector);
    m_pageSelector->setRecordCount(0);
    m_pageSelector->setInsertingButtonVisible(false);
    m_pageSelector->setLabelText(i18n("Page"));
#endif
    
    // -- setup local actions
    QList<QAction*> viewActions;
    QAction* a;
    viewActions << (a = new KAction(KIcon("printer"), i18n("Print"), this));
    a->setObjectName("print_report");
    a->setToolTip(i18n("Print Report"));
    a->setWhatsThis(i18n("Prints the current report."));
    connect(a, SIGNAL(triggered()), this, SLOT(slotPrintReport()));

    viewActions << (a = new KAction(KIcon("kword"), i18n("Save to KWord"), this));
    a->setObjectName("save_to_kword");
    a->setToolTip(i18n("Save the report to a KWord document"));
    a->setWhatsThis(i18n("Save the report to a KWord document"));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotRenderODT()));

    viewActions << (a = new KAction(KIcon("kspread"), i18n("Save to KSpread"), this));
    a->setObjectName("save_to_kspread");
    a->setToolTip(i18n("Save the report to a KSpread document"));
    a->setWhatsThis(i18n("Saves the current report to a KSpread document."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotRenderKSpread()));

    viewActions << (a = new KAction(KIcon("text-html"), i18n("Export as Web Page"), this));
    a->setObjectName("export_as_web_page");
    a->setToolTip(i18n("Export the report as web page"));
    a->setWhatsThis(i18n("Exports the report to a web page file."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotExportHTML()));

    setViewActions(viewActions);

#ifndef KEXI_MOBILE
    connect(m_pageSelector, SIGNAL(nextButtonClicked()), this, SLOT(nextPage()));
    connect(m_pageSelector, SIGNAL(prevButtonClicked()), this, SLOT(prevPage()));
    connect(m_pageSelector, SIGNAL(firstButtonClicked()), this, SLOT(firstPage()));
    connect(m_pageSelector, SIGNAL(lastButtonClicked()), this, SLOT(lastPage()));
#endif
}
Ejemplo n.º 9
0
void ofxSimpleGuiToo::keyPressed(ofKeyEventArgs &e) {
	//ofLog(OF_LOG_VERBOSE, ofToString(e.key));
	
	if(doDefaultKeys && keyboardShortcutsEnabled) {
		if(e.key == ' ') {
			toggleDraw();
			/* disabled for keyboard editing
			 } else if(e.key>='0' && e.key<='9') {
			 setPage((int)(e.key - '0'));
			 setDraw(true);
			 */
		} else if(doDraw) {
			switch(e.key) {
				case '[': prevPage(); break;
				case ']': nextPage(); break;
					//case 'p': focusPrev(); break;
					//case 'l': focusNext(); break;
				case 'g': 
					setPage(1); 
					setDraw(true);
					break;
				case 'G': gui.setAlignRight(!gui.getAlignRight()); break;
				case OF_KEY_UP:
					gui.currentPage().onKeyUp();
					break;
				case OF_KEY_DOWN:
					//focusNext();
					gui.currentPage().onKeyDown();
					break;
				case OF_KEY_LEFT:
					gui.currentPage().onKeyLeft();
					break;
				case OF_KEY_RIGHT:
					gui.currentPage().onKeyRight();
					break;
				case OF_KEY_RETURN:
					gui.currentPage().onKeyEnter();
					break;
			}
		}
	}
	
	// check and trigger keyboard shortcuts
	if(keyboardShortcutsEnabled){
		map<int,ofxSimpleGuiEventTrigger*>::iterator it = keyboardShortcuts.find(e.key);
		if(it != keyboardShortcuts.end()){ //< if already exists
			it->second->trigger();
		}
	}
	
	if(doDraw) {
		headerPage->keyPressed(e);
		pages[currentPageIndex]->keyPressed(e);
	}
	
}
Ejemplo n.º 10
0
bool PageCurl::qt_emit( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->signalOffset() ) {
    case 0: prevPage(); break;
    case 1: nextPage(); break;
    default:
	return QWidget::qt_emit(_id,_o);
    }
    return TRUE;
}
Ejemplo n.º 11
0
QScrollBar *ZLQtViewWidget::addScrollBar(QGridLayout *layout, Qt::Orientation orientation, int x, int y) {
	QScrollBar *scrollBar = new QScrollBar(orientation, myFrame);
	layout->addWidget(scrollBar, x, y);
	scrollBar->hide();
	if (orientation == Qt::Vertical) {
		connect(scrollBar, SIGNAL(sliderMoved(int)), this, SLOT(onVerticalSliderMoved(int)));
		connect(scrollBar, SIGNAL(nextLine()), this, SLOT(onVerticalSliderStepNext()));
		connect(scrollBar, SIGNAL(nextPage()), this, SLOT(onVerticalSliderPageNext()));
		connect(scrollBar, SIGNAL(prevLine()), this, SLOT(onVerticalSliderStepPrevious()));
		connect(scrollBar, SIGNAL(prevPage()), this, SLOT(onVerticalSliderPagePrevious()));
	} else {
Ejemplo n.º 12
0
QDesignerQ3WidgetStack::QDesignerQ3WidgetStack(QWidget *parent) : 
    Q3WidgetStack(parent), 
    m_prev(createToolButton(this, Qt::LeftArrow,  QLatin1String("__qt__passive_prev"))),
    m_next(createToolButton(this, Qt::RightArrow, QLatin1String("__qt__passive_next")))
{
    connect(m_prev, SIGNAL(clicked()), this, SLOT(prevPage()));
    connect(m_next, SIGNAL(clicked()), this, SLOT(nextPage()));
    updateButtons();

    connect(this, SIGNAL(currentChanged(int)), this, SLOT(slotCurrentChanged(int)));
}
Ejemplo n.º 13
0
void EigenGraspDlg::setSlaveLayout( int nGrasps )
{
	mainLayout = new QVBoxLayout(mSlave, 5);

	QLabel *valueLabel = new QLabel(QString("Value:"), mSlave);
	QLabel *amplLabel = new QLabel(QString("Amplitude:"), mSlave);
	QLabel *fixedLabel = new QLabel(QString("Fixed"), mSlave);

	QHBoxLayout *fakeRow = new QHBoxLayout(mainLayout,-1);
	fakeRow->addSpacing(400);

	QHBoxLayout *labelRow = new QHBoxLayout(mainLayout,-1);
	labelRow->addSpacing(5);
	labelRow->addWidget(valueLabel,0);
	labelRow->addWidget(amplLabel,1,Qt::AlignHCenter);
	labelRow->addWidget(fixedLabel,0);
	labelRow->addSpacing(5);
	mainLayout->addLayout(labelRow);

	for (int i=0; i<nGrasps; i++) {
		QHBoxLayout *graspRow = new QHBoxLayout(mainLayout,10);
	
		QLabel *eigenValue = new QLabel(QString("0.0"), mSlave);
		QScrollBar *bar = new QScrollBar(Qt::Horizontal, mSlave);
		bar->setRange( -SLIDER_STEPS, SLIDER_STEPS );
		bar->setPageStep(5000);
		bar->setLineStep(1000);
		bar->setValue(0);
		QCheckBox *box = new QCheckBox(mSlave);

		graspRow->addSpacing(15);
		graspRow->addWidget(eigenValue,0);
		graspRow->addWidget(bar,1);
		graspRow->addWidget(box,0);
		graspRow->addSpacing(15);

		mValueList.push_back(eigenValue);
		mBarList.push_back(bar);
		mCheckList.push_back(box);

		connect(bar,SIGNAL(sliderMoved(int)), this, SLOT(eigenGraspChanged()) );
		//comment this one out
		//connect(bar,SIGNAL(valueChanged(int)), this, SLOT(eigenGraspChanged()) );
		connect(bar,SIGNAL(nextLine()), this, SLOT(eigenGraspChanged()) );
		connect(bar,SIGNAL(prevLine()), this, SLOT(eigenGraspChanged()) );
		connect(bar,SIGNAL(nextPage()), this, SLOT(eigenGraspChanged()) );
		connect(bar,SIGNAL(prevPage()), this, SLOT(eigenGraspChanged()) );
		connect(bar,SIGNAL(sliderReleased()), this, SLOT(eigenGraspChanged()) );
		connect(box,SIGNAL(clicked()), this, SLOT(fixBoxChanged()) );
	}	
	mainLayout->addSpacing(20);
}
Ejemplo n.º 14
0
MiniBar::MiniBar( QWidget * parent, KPDFDocument * document )
    : QFrame( parent, "miniBar" ), m_document( document ),
    m_currentPage( -1 )
{
    // left spacer
    QHBoxLayout * horLayout = new QHBoxLayout( this );
    QSpacerItem * spacerL = new QSpacerItem( 20, 10, QSizePolicy::Expanding );
    horLayout->addItem( spacerL );

    // central 2r by 3c grid layout that contains all components
    QGridLayout * gridLayout = new QGridLayout( 0, 3,5, 2,1 );
     // top spacer 6x6 px
//     QSpacerItem * spacerTop = new QSpacerItem( 6, 6, QSizePolicy::Fixed, QSizePolicy::Fixed );
//     gridLayout->addMultiCell( spacerTop, 0, 0, 0, 4 );
     // center progress widget
     m_progressWidget = new ProgressWidget( this );
     gridLayout->addMultiCellWidget( m_progressWidget, 0, 0, 0, 4 );
     // bottom: left prev_page button
     m_prevButton = new HoverButton( this );
     m_prevButton->setIconSet( SmallIconSet( QApplication::reverseLayout() ? "1rightarrow" : "1leftarrow" ) );
     gridLayout->addWidget( m_prevButton, 1, 0 );
     // bottom: left lineEdit (current page box)
     m_pagesEdit = new PagesEdit( this );
     gridLayout->addWidget( m_pagesEdit, 1, 1 );
     // bottom: central '/' label
     gridLayout->addWidget( new QLabel( "/", this ), 1, 2 );
     // bottom: right button
     m_pagesButton = new HoverButton( this );
     gridLayout->addWidget( m_pagesButton, 1, 3 );
     // bottom: right next_page button
     m_nextButton = new HoverButton( this );
     m_nextButton->setIconSet( SmallIconSet( QApplication::reverseLayout() ? "1leftarrow" : "1rightarrow" ) );
     gridLayout->addWidget( m_nextButton, 1, 4 );
    horLayout->addLayout( gridLayout );

    // right spacer
    QSpacerItem * spacerR = new QSpacerItem( 20, 10, QSizePolicy::Expanding );
    horLayout->addItem( spacerR );

    // customize own look
    setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );

    // connect signals from child widgets to internal handlers / signals bouncers
    connect( m_pagesEdit, SIGNAL( returnPressed() ), this, SLOT( slotChangePage() ) );
    connect( m_pagesButton, SIGNAL( clicked() ), this, SIGNAL( gotoPage() ) );
    connect( m_prevButton, SIGNAL( clicked() ), this, SIGNAL( prevPage() ) );
    connect( m_nextButton, SIGNAL( clicked() ), this, SIGNAL( nextPage() ) );

    // widget starts hidden (will be shown after opening a document)
    parent->hide();
}
Ejemplo n.º 15
0
// ---------------  QStackedWidgetPreviewEventFilter
QStackedWidgetPreviewEventFilter::QStackedWidgetPreviewEventFilter(QStackedWidget *parent) :
    QObject(parent),
    m_buttonToolTipEnabled(false), // Not on preview
    m_stackedWidget(parent),
    m_prev(createToolButton(m_stackedWidget, Qt::LeftArrow,  QLatin1String("__qt__passive_prev"))),
    m_next(createToolButton(m_stackedWidget, Qt::RightArrow, QLatin1String("__qt__passive_next")))
{
    connect(m_prev, SIGNAL(clicked()), this, SLOT(prevPage()));
    connect(m_next, SIGNAL(clicked()), this, SLOT(nextPage()));

    updateButtons();
    m_stackedWidget->installEventFilter(this);
    m_prev->installEventFilter(this);
    m_next->installEventFilter(this);
}
ArchiveDlg::ArchiveDlg(const XMPP::Jid &jid, PsiAccount *pa)
{
	max = 30;
	page_ = 0;
	setupUi(this);
	tw_log->setColumnCount(3);
	QStringList headers;
	headers << tr("Time") << tr("") << tr("Message");
	tw_log->setHeaderLabels(headers);
	setAttribute(Qt::WA_DeleteOnClose);
	setWindowTitle(tr("Archive for ") + jid.full());
#ifndef Q_WS_MAC
	setWindowIcon(IconsetFactory::icon("psi/history").icon());
#endif

	gct_ = NULL;

	pa_ = pa;
	jid_ = jid;

	last_ =  QDateTime::currentDateTime();

	connect(pb_close, SIGNAL(clicked()), this, SLOT(hide()));

	connect(calendar, SIGNAL(selectionChanged()), this, SLOT(dateSelected()));
	connect(calendar, SIGNAL(currentPageChanged(int, int)), this, SLOT(dateChanged(int, int)));

	connect(lw_conversations, SIGNAL(itemSelectionChanged()), this, SLOT(collectionSelected()));
	connect(lw_conversations, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(doCollectionContextMenu(const QPoint&)));
	lw_conversations->

	connect(tb_prevPage, SIGNAL(clicked()), this, SLOT(prevPage()));	connect(tb_nextPage, SIGNAL(clicked()), this, SLOT(nextPage()));

	gclt_ = new GetCollectionListTask(pa->client()->rootTask());
	connect(gclt_, SIGNAL(busy()), this, SLOT(busy()));
	connect(gclt_, SIGNAL(done()), this, SLOT(collectionListRetrieved()));
	connect(gclt_, SIGNAL(error()), this, SLOT(error()));

	gct_ = new GetCollectionTask(pa_->client()->rootTask());
	connect(gct_, SIGNAL(busy()), this, SLOT(busy()));
	connect(gct_, SIGNAL(done(int)), this, SLOT(collectionRetrieved(int)));
	connect(gct_, SIGNAL(msg(int, bool, const QString&)), this, SLOT(collectionMsg(int, bool, const QString&)));
	connect(gct_, SIGNAL(error()), this, SLOT(error()));
	
	QDate m(last_.date().year(), last_.date().month(), 1);
	gclt_->get(jid, m, 50);
//	X11WM_CLASS("history");
}
Ejemplo n.º 17
0
//keyboard events
void KviIrcView::keyPressEvent(QKeyEvent *e)
{
	switch(e->key())
	{
		case Qt::Key_PageUp:
			prevPage();
			e->accept();
			break;
		case Qt::Key_PageDown:
			nextPage();
			e->accept();
			break;
		default:
			e->ignore();
	}
}
Ejemplo n.º 18
0
void PreparingPage::setupUi()
{
    qDeleteAll(this->children());
    delete this->layout();

    QWidget * scroledFrame = new QWidget;

    QVBoxLayout * mainLayout = new QVBoxLayout; {
        mainLayout->setSizeConstraint(QLayout::SetMinimumSize);
        if(m_ufc) {
            for(int i = 0; i < m_ufc->coefficients().count(); ++i) {
                CoefficientWidget * cw = new CoefficientWidget(m_ufc->coefficients().at(i));
                mainLayout->addWidget(cw);
            }
        }

        QHBoxLayout * buttonLayout = new QHBoxLayout; {

            QPushButton * nextButton = new QPushButton("Далее"); {
                connect(nextButton, SIGNAL(clicked()), this, SIGNAL(nextPage()) );
            }

            QPushButton * backButton = new QPushButton("Назад"); {
                connect(backButton, SIGNAL(clicked()), this, SIGNAL(prevPage()) );
            }

            buttonLayout->addWidget(backButton);
            buttonLayout->addWidget(nextButton);
        }

        mainLayout->addLayout(buttonLayout);
    }

    scroledFrame->setLayout(mainLayout);

    QVBoxLayout * wraperLayout = new QVBoxLayout; {
        QScrollArea * sa = new QScrollArea; {
            sa->setWidget(scroledFrame);
        }

        wraperLayout->addWidget(sa);
    }

    this->setLayout(wraperLayout);
}
void
ActivitiesWidget::
createConnections()
{
    // activities
    connect(ui->activitiesTableWidget, SIGNAL(clicked(QModelIndex)), this, SLOT(showActivity(QModelIndex)));

    connect(ui->pageNavigatorWidget,    SIGNAL(prevPageToggled()), this, SLOT(prevPage()));
    connect(ui->pageNavigatorWidget,    SIGNAL(nextPageToggled()), this, SLOT(nextPage()));
    connect(ui->activitiesFindButton,   SIGNAL(clicked()), this, SLOT(findActivities()));
    connect(ui->activitiesFindLineEdit, SIGNAL(returnPressed()), this, SLOT(findActivities()));

    // comments
    connect(ui->activitiesShowCommentsButton, SIGNAL(clicked()), this, SLOT(showComments()));

    // by activity
    connect( ui->showPeopleByActivityButton, SIGNAL(clicked()), this, SLOT(findPeopleByActivity()));
}
Ejemplo n.º 20
0
// ---------------  QStackedWidgetEventFilter
QStackedWidgetEventFilter::QStackedWidgetEventFilter(QStackedWidget *parent) :
    QStackedWidgetPreviewEventFilter(parent),
    m_actionPreviousPage(new QAction(tr("Previous Page"), this)),
    m_actionNextPage(new QAction(tr("Next Page"), this)),
    m_actionDeletePage(new QAction(tr("Delete"), this)),
    m_actionInsertPage(new QAction(tr("Before Current Page"), this)),
    m_actionInsertPageAfter(new QAction(tr("After Current Page"), this)),
    m_actionChangePageOrder(new QAction(tr("Change Page Order..."), this)),
    m_pagePromotionTaskMenu(new qdesigner_internal::PromotionTaskMenu(0, qdesigner_internal::PromotionTaskMenu::ModeSingleWidget, this))
{
    setButtonToolTipEnabled(true);
    connect(m_actionPreviousPage, SIGNAL(triggered()), this, SLOT(prevPage()));
    connect(m_actionNextPage, SIGNAL(triggered()), this, SLOT(nextPage()));
    connect(m_actionDeletePage, SIGNAL(triggered()), this, SLOT(removeCurrentPage()));
    connect(m_actionInsertPage, SIGNAL(triggered()), this, SLOT(addPage()));
    connect(m_actionInsertPageAfter, SIGNAL(triggered()), this, SLOT(addPageAfter()));
    connect(m_actionChangePageOrder, SIGNAL(triggered()), this, SLOT(changeOrder()));
}
Ejemplo n.º 21
0
void TopLevel::setupMenuBar()
{
  // File menu
  KStdAction::open( this, SLOT( faxOpen() ), actionCollection() );
  actRecent =  KStdAction::openRecent( this, SLOT( faxOpen( const KURL & ) ),
          actionCollection() );
  actSave = KStdAction::save( this, SLOT( faxSave() ), actionCollection() );
  actSaveAs = KStdAction::saveAs( this, SLOT( faxSaveAs() ),
          actionCollection() );
  actPrint = KStdAction::print( this, SLOT( print() ), actionCollection() );
  KStdAction::quit( this, SLOT( close() ), actionCollection() );
  actAdd = new KAction( i18n( "A&dd..." ), "filenew", KShortcut(), this,
      SLOT( faxAdd() ), actionCollection(), "file_add_fax" );

  actRecent->setMaxItems( 5 );

  // View Menu
  actSize = KStdAction::actualSize( this, SLOT( actualSize() ),
      actionCollection() );
  actZoomIn = KStdAction::zoomIn( this, SLOT( zoomin() ), actionCollection() );
  actZoomOut = KStdAction::zoomOut( this, SLOT( zoomout() ),
      actionCollection() );

  actRotate = new KAction( i18n( "&Rotate Page" ), "rotate", KShortcut(), this,
      SLOT( rotatePage() ), actionCollection(), "view_rotate" );
  actMirror = new KAction( i18n( "Mirror Page" ), KShortcut(), this,
      SLOT( mirrorPage() ), actionCollection(), "view_mirror" );
  actFlip = new KAction( i18n( "&Flip Page" ), KShortcut(), this,
      SLOT( flipPage() ), actionCollection(), "view_flip" );

  // Go menu
  actNext = KStdAction::next( this, SLOT( nextPage() ), actionCollection() );
  actPrev = KStdAction::prior( this, SLOT( prevPage() ), actionCollection() );
  actFirst = KStdAction::firstPage( this, SLOT( firstPage() ),
      actionCollection() );
  actLast = KStdAction::lastPage( this, SLOT( lastPage() ),
      actionCollection() );

  // Settings menu
  KStdAction::preferences( this, SLOT( faxoptions() ), actionCollection() );
}
Ejemplo n.º 22
0
void ofxSimpleGuiToo::keyPressed(ofKeyEventArgs &e) {
	if(doDefaultKeys) {
		if(e.key == ' ') {
			toggleDraw();
		} else if(e.key>='0' && e.key<='9') {
			setPage((int)(e.key - '0'));
			setDraw(true);
		} else if(doDraw) {
			switch(e.key) {
				case '[': prevPage(); break;
				case ']': nextPage(); break;
			}
		}
	}
	
	if(doDraw) {
		headerPage->keyPressed(e);
		pages[currentPageIndex]->keyPressed(e);
	}
	
}
Ejemplo n.º 23
0
RankingDialog::RankingDialog(const QStringList &tiers)
{
    QVBoxLayout *mainLayout = new QVBoxLayout(this);
    QHBoxLayout *row1 = new QHBoxLayout();
    mainLayout->addLayout(row1);

    QPushButton *search;
    row1->addWidget(name = new QLineEdit());
    row1->addWidget(search = new QPushButton(tr("&Search")));
    row1->addWidget(tierSelection = new QComboBox());
    tierSelection->addItems(tiers);

    players = new QCompactTable(0,3);
    players->setAlternatingRowColors(true);
    players->setHorizontalHeaderLabels(QStringList() << tr("Rank") << tr("Player Name") << tr("Points"));
    players->horizontalHeader()->setStretchLastSection(true);
    mainLayout->addWidget(players);

    QHBoxLayout *row3 = new QHBoxLayout();
    mainLayout->addLayout(row3);

    QPushButton *prev, *next;
    row3->addWidget(prev = new QPushButton("<<"));
    row3->addWidget(next = new QPushButton(">>"));
    row3->addWidget(page = new QLineEdit(), 0, Qt::AlignRight);
    row3->addWidget(totalPages = new QLabel("/ ---"), 0, Qt::AlignLeft);

    resize(400,500);
    page->setMaximumWidth(40);
    setAttribute(Qt::WA_DeleteOnClose, true);

    connect(next, SIGNAL(clicked()), SLOT(nextPage()));
    connect(prev, SIGNAL(clicked()), SLOT(prevPage()));
    connect(tierSelection, SIGNAL(activated(int)), SLOT(searchByName()));
    connect(name, SIGNAL(returnPressed()), SLOT(searchByName()));
    connect(search, SIGNAL(clicked()), SLOT(searchByName()));
    connect(this->page, SIGNAL(returnPressed()), SLOT(changePage()));
}
Ejemplo n.º 24
0
void kdvi::makeMenuBar()
{
    if (menuBar) delete menuBar;
    menuBar = new KMenuBar( this );
    CHECK_PTR( menuBar );

    QPopupMenu *p = new QPopupMenu;
    CHECK_PTR( p );

    m_fn = p->insertItem( i18n("&New"),	this, SLOT(fileNew()) );
    m_fo = p->insertItem( i18n("&Open ..."),	this, SLOT(fileOpen()) );

    recentmenu = new QPopupMenu;
    CHECK_PTR( recentmenu );

    connect( recentmenu, SIGNAL(activated(int)), SLOT(openRecent(int)) );

    m_fr = p->insertItem( i18n("Open &recent"),	recentmenu );

    m_fp = p->insertItem( i18n("&Print ..."),	this, SLOT(filePrint()));
    m_fx = p->insertItem( i18n("E&xit"), this, SLOT(fileExit()));

    m_f = p;
    menuBar->insertItem( i18n("&File"), p, -2 );

    p = new QPopupMenu;
    CHECK_PTR( p );
    m_vi = p->insertItem( i18n("Zoom &in"),	dviwin, SLOT(prevShrink()) );
    m_vo = p->insertItem( i18n("Zoom &out"),	dviwin, SLOT(nextShrink()) );
    m_vf = p->insertItem( i18n("&Fit to page"),	this, SLOT(viewFitPage()) );
    m_vw = p->insertItem( i18n("Fit to page &width"),	this, SLOT(viewFitPageWidth()));
    p->insertSeparator();
    m_vr = p->insertItem( i18n("&Redraw page"),	dviwin, SLOT(drawPage()) );

    m_v = p;
    menuBar->insertItem( i18n("&View"), p, -2 );

    p = new QPopupMenu;
    CHECK_PTR( p );
    m_pp = p->insertItem( i18n("&Previous"),	dviwin, SLOT(prevPage()) );
    m_pn = p->insertItem( i18n("&Next"),		dviwin, SLOT(nextPage()) );
    m_pf = p->insertItem( i18n("&First"),	dviwin, SLOT(firstPage()) );
    m_pl = p->insertItem( i18n("&Last"),		dviwin, SLOT(lastPage()) );
    m_pg = p->insertItem( i18n("&Go to ..."),	this,   SLOT(pageGoto()) );

    m_p = p;
    menuBar->insertItem( i18n("&Page"), p, -2 );

    p = new QPopupMenu;
    CHECK_PTR( p );
    p->setCheckable( TRUE );
    m_op = p->insertItem( i18n("&Preferences ..."), this, SLOT(optionsPreferences()));
    m_ok = p->insertItem( i18n("&Keys ..."), this, SLOT(configKeys()));
    p->insertSeparator();
    m_of = p->insertItem( i18n("Make PK-&fonts"), this, SLOT(toggleMakePK()) );
    p->setItemChecked( m_of, makepk );
    m_o0 = p->insertItem( i18n("Show PS"), this, SLOT(toggleShowPS()));
    p->setItemChecked( m_o0, showPS );
    m_om = p->insertItem( i18n("Show &Menubar"), this, SLOT(toggleShowMenubar()) );
    p->setItemChecked( m_om, !hideMenubar );
    m_ob = p->insertItem( i18n("Show &Buttons"), this, SLOT(toggleShowButtons()) );
    p->setItemChecked( m_ob, !hideButtons );
    m_ot = p->insertItem( i18n("Show Page Lis&t"), this, SLOT(toggleVertToolbar()) );
    p->setItemChecked( m_ol, vertToolbar );
    m_os = p->insertItem( i18n("Show &Statusbar"), this, SLOT(toggleShowStatusbar()) );
    p->setItemChecked( m_os, !hideStatusbar );
    m_ol = p->insertItem( i18n("Show Scro&llbars"), this, SLOT(toggleShowScrollbars()) );
    p->setItemChecked( m_ol, !hideScrollbars );

    m_o = p;
    menuBar->insertItem( i18n("&Options"), p, -2 );
    optionsmenu = p;

    menuBar->insertSeparator();

    QPopupMenu *help = kapp->getHelpMenu(true, QString(i18n("DVI Viewer"))
                                         + " " + KDVI_VERSION
                                         + i18n("\n\nby Markku Hihnala")
                                         + " ([email protected])");

    m_h = p;
    menuBar->insertItem( i18n("&Help"), help );
    if ( hideMenubar )	menuBar->hide();
    setMenu( menuBar );
}
Ejemplo n.º 25
0
 void BookWindow::onPrevPageButtonClicked (MyGUI::Widget* sender)
 {
     prevPage();
 }
Ejemplo n.º 26
0
void MainWindow::createToolBars()
{
    QAction *act = 0;

    m_pm_zoom = new QMenu(tr("Zoom"));
    act = m_pm_zoom->addAction(tr("Fit to width"));
    act->setData(QVariant(1));
    act = m_pm_zoom->addAction(tr("Fit to page"));
    act->setData(QVariant(2));
    m_pm_zoom->addSeparator();
    act = m_pm_zoom->addAction(tr("50%"));
    act->setData(QVariant(50));
    act = m_pm_zoom->addAction(tr("75%"));
    act->setData(QVariant(75));
    act = m_pm_zoom->addAction(tr("100%"));
    act->setData(QVariant(100));
    act = m_pm_zoom->addAction(tr("125%"));
    act->setData(QVariant(125));
    act = m_pm_zoom->addAction(tr("150%"));
    act->setData(QVariant(150));
    act = m_pm_zoom->addAction(tr("200%"));
    act->setData(QVariant(200));
    connect(m_pm_zoom, SIGNAL(triggered(QAction*)),
            this, SLOT(setZoom(QAction*)));

    m_tb_menu = addToolBar(tr("menu"));
    m_tb_menu->addAction(tr("Zoom"))->setMenu(m_pm_zoom);
    m_tb_menu->setMovable(false);

    m_tb_tool = addToolBar(tr("tool"));
    m_tb_tool->setMovable(false);
    m_tb_tool->addAction(QIcon(tr(":/fileopen")), tr("Open..."),
                         this, SLOT(openFile()));
    m_tb_tool->addSeparator();
    m_to_find = m_tb_tool->addAction(QIcon(tr(":/find")), tr("Find..."),
                                     this, SLOT(toggleFindBar()));
    m_to_find->setCheckable(true);
    m_tb_tool->addSeparator();
    m_to_full = m_tb_tool->addAction(QIcon(tr(":/fullscreen")),
                                     tr("Fullscreen"), this,
                                     SLOT(toggleFullscreen()));
    m_to_full->setCheckable(true);
    m_tb_tool->addSeparator();
    m_tb_tool->addAction(QIcon(tr(":/fastback")), tr("First page"),
                         this, SLOT(firstPage()));
    m_tb_tool->addAction(QIcon(tr(":/back")), tr("Previous page"),
                         this, SLOT(prevPage()));
    m_tb_tool->addAction(QIcon(tr(":/down")), tr("Goto Page..."),
                         this, SLOT(gotoPageDialog()));
    m_tb_tool->addAction(QIcon(tr(":/forward")), tr("Next page"),
                         this, SLOT(nextPage()));
    m_tb_tool->addAction(QIcon(tr(":/fastforward")), tr("Last page"),
                         this, SLOT(lastPage()));

    addToolBarBreak();
    m_tb_find = addToolBar(tr("search"));
    m_tb_find->setMovable(false);
    m_tb_find->hide();

    m_findedit = new QLineEdit();
    m_tb_find->addWidget(m_findedit);
    m_tb_find->addAction(QIcon(tr(":/find")), tr("Find..."),
                         this, SLOT(findText()));
    m_tb_find->addAction(QIcon(tr(":/next")), tr("Next"),
                         this, SLOT(findText()));

}
Ejemplo n.º 27
0
KexiReportView::KexiReportView(QWidget *parent)
        : KexiView(parent), m_preRenderer(0), m_reportDocument(0) //! @todo KEXI3, m_kexi(0), m_functions(0)
{
    setObjectName("KexiReportDesigner_DataView");

    m_reportView = new KReportView(this);
    layout()->addWidget(m_reportView);

#ifndef KEXI_MOBILE
    m_pageSelector = new KexiRecordNavigator(*m_reportView->scrollArea(), m_reportView);
    m_pageSelector->setInsertingButtonVisible(false);
    m_pageSelector->setInsertingEnabled(false);
    m_pageSelector->setLabelText(xi18nc("Page selector label", "Page:"));
    m_pageSelector->setButtonToolTipText(KexiRecordNavigator::ButtonFirst, xi18n("Go to first page"));
    m_pageSelector->setButtonWhatsThisText(KexiRecordNavigator::ButtonFirst, xi18n("Goes to first page"));
    m_pageSelector->setButtonToolTipText(KexiRecordNavigator::ButtonPrevious, xi18n("Go to previous page"));
    m_pageSelector->setButtonWhatsThisText(KexiRecordNavigator::ButtonPrevious, xi18n("Goes to previous page"));
    m_pageSelector->setButtonToolTipText(KexiRecordNavigator::ButtonNext, xi18n("Go to next page"));
    m_pageSelector->setButtonWhatsThisText(KexiRecordNavigator::ButtonNext, xi18n("Goes to next page"));
    m_pageSelector->setButtonToolTipText(KexiRecordNavigator::ButtonLast, xi18n("Go to last page"));
    m_pageSelector->setButtonWhatsThisText(KexiRecordNavigator::ButtonLast, xi18n("Goes to last page"));
    m_pageSelector->setNumberFieldToolTips(xi18n("Current page number"), xi18n("Number of pages"));
    m_pageSelector->setRecordHandler(this);
#endif

    // -- setup local actions
    QList<QAction*> viewActions;
    QAction* a;

#ifndef KEXI_MOBILE
    viewActions << (a = new QAction(koIcon("document-print"), xi18n("Print"), this));
    a->setObjectName("print_report");
    a->setToolTip(xi18n("Print report"));
    a->setWhatsThis(xi18n("Prints the current report."));
    connect(a, SIGNAL(triggered()), this, SLOT(slotPrintReport()));

    KActionMenu *exportMenu = new KActionMenu(koIcon("document-export"), xi18nc("@title:menu","E&xport As"), this);
    exportMenu->setObjectName("report_export_as");
    exportMenu->setDelayed(false);
#endif

#ifdef KEXI_MOBILE
    viewActions << (a = new QAction(xi18n("Export:"), this));
    a->setEnabled(false); //!TODO this is a bit of a dirty way to add what looks like a label to the toolbar!
    // " ", not "", is said to be needed in maemo, the icon didn't display properly without it
    viewActions << (a = new QAction(koIcon("application-vnd.oasis.opendocument.text"), QLatin1String(" "), this));
#else
    exportMenu->addAction(a = new QAction(koIcon("application-vnd.oasis.opendocument.text"),
                                          xi18nc("open dialog to export as text document", "Text Document..."), this));
#endif
    a->setObjectName("export_as_text_document");
    a->setToolTip(xi18n("Export the report as a text document (in OpenDocument Text format)"));
    a->setWhatsThis(xi18n("Exports the report as a text document (in OpenDocument Text format)."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotExportAsTextDocument()));

#ifdef KEXI_MOBILE
    viewActions << (a = new QAction(koIcon("application-pdf"), QLatin1String(" "), this));
#else
    exportMenu->addAction(a = new QAction(koIcon("application-pdf"),
                                          xi18nc("Portable Document Format...", "PDF..."), this));
#endif
    a->setObjectName("export_as_pdf");
    a->setToolTip(xi18n("Export as PDF"));
    a->setWhatsThis(xi18n("Exports the current report as PDF."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotExportAsPdf()));

#ifdef KEXI_MOBILE
    viewActions << (a = new QAction(koIcon("application-vnd.oasis.opendocument.spreadsheet"), QLatin1String(" "), this));
#else
    exportMenu->addAction(a = new QAction(koIcon("application-vnd.oasis.opendocument.spreadsheet"),
                                          xi18nc("open dialog to export as spreadsheet", "Spreadsheet..."), this));
#endif
    a->setObjectName("export_as_spreadsheet");
    a->setToolTip(xi18n("Export the report as a spreadsheet (in OpenDocument Spreadsheet format)"));
    a->setWhatsThis(xi18n("Exports the report as a spreadsheet (in OpenDocument Spreadsheet format)."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotExportAsSpreadsheet()));

#ifdef KEXI_MOBILE
    viewActions << (a = new QAction(koIcon("text-html"), QLatin1String(" "), this));
#else
    exportMenu->addAction(a = new QAction(koIcon("text-html"),
                                          xi18nc("open dialog to export as web page", "Web Page..."), this));
#endif
    a->setObjectName("export_as_web_page");
    a->setToolTip(xi18n("Export the report as a web page (in HTML format)"));
    a->setWhatsThis(xi18n("Exports the report as a web page (in HTML format)."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotExportAsWebPage()));

    setViewActions(viewActions);

#ifndef KEXI_MOBILE
    // setup main menu actions
    QList<QAction*> mainMenuActions;

    mainMenuActions << exportMenu;

    setMainMenuActions(mainMenuActions);

    connect(m_pageSelector, SIGNAL(nextButtonClicked()), this, SLOT(nextPage()));
    connect(m_pageSelector, SIGNAL(prevButtonClicked()), this, SLOT(prevPage()));
    connect(m_pageSelector, SIGNAL(firstButtonClicked()), this, SLOT(firstPage()));
    connect(m_pageSelector, SIGNAL(lastButtonClicked()), this, SLOT(lastPage()));
#endif
}
Ejemplo n.º 28
0
void MiniBar::slotEmitPrevPage()
{
    // emit signal
    prevPage();
}
Ejemplo n.º 29
0
int main(int argc, char **argv) { 
  QApplication app( argc, argv );

  if ( argc < 2 ) {
    qDebug() << "Usage: " << argv[0] << " pdf-file ";
    return -1;
  }
    
  QString fileName( argv[1] );
  QFile fl( fileName );

  if ( ! fl.exists() ) { 
    qDebug() << "File not found: " << fileName;
    return -1;
  }

  pdfBoard canvas( fileName );

  QAction *quitAct = new QAction( &canvas );
  QAction *nextAct = new QAction( &canvas );
  QAction *prevAct = new QAction( &canvas );

  QAction *zoomInAct = new QAction( &canvas );
  QAction *zoomOutAct = new QAction( &canvas );

  QAction *leftAct = new QAction( &canvas );
  QAction *rightAct = new QAction( &canvas );
  QAction *upAct = new QAction( &canvas );
  QAction *downAct = new QAction( &canvas );

  quitAct->setShortcut((QString) "Ctrl+Q");
  nextAct->setShortcut((QString) "Ctrl+N");
  prevAct->setShortcut((QString) "Ctrl+P");

  zoomInAct->setShortcut((QString) "Ctrl++");
  zoomOutAct->setShortcut((QString) "Ctrl+-");
  
  leftAct->setShortcut((QString) "Left");
  rightAct->setShortcut((QString) "Right");
  upAct->setShortcut((QString) "Up");
  downAct->setShortcut((QString) "Down");


  canvas.addAction(quitAct);
  canvas.addAction(nextAct);
  canvas.addAction(prevAct);

  canvas.addAction(zoomInAct);
  canvas.addAction(zoomOutAct);

  canvas.addAction(leftAct);
  canvas.addAction(rightAct);
  canvas.addAction(upAct);
  canvas.addAction(downAct);


  QObject::connect( quitAct, SIGNAL( triggered() ), &app, SLOT( quit() ) );
  QObject::connect( nextAct, SIGNAL( triggered() ), &canvas, SLOT( nextPage() ) );
  QObject::connect( prevAct, SIGNAL( triggered() ), &canvas, SLOT( prevPage() ) );

  QObject::connect( zoomInAct, SIGNAL( triggered() ), &canvas, SLOT( zoomIN() ) );
  QObject::connect( zoomOutAct, SIGNAL( triggered() ), &canvas, SLOT( zoomOUT() ) );

  QObject::connect( leftAct, SIGNAL( triggered() ), &canvas, SLOT( left() ) );
  QObject::connect( rightAct, SIGNAL( triggered() ), &canvas, SLOT( right() ) );
  QObject::connect( upAct, SIGNAL( triggered() ), &canvas, SLOT( up() ) );
  QObject::connect( downAct, SIGNAL( triggered() ), &canvas, SLOT( down() ) );

  app.exec();

  return 0;
}
Ejemplo n.º 30
0
Archivo: MPF.cpp Proyecto: aaly/MPF
MPF::MPF(QWidget *parent) :
		QMainWindow(parent,0)
{

    if (getuid() != 0)
    {
        //QMessageBox::critical(this, tr("Need Root privilages"), tr("The installer must be ran by the root user"));
        //exit(1);
    }

    setupUi(this);

    showFullScreen();

	currentGroup = -1;
	selectedGroup = 0;
    helpMaximized = false;
    nextAlreadyEnabled = false;

    messageIconWidth = 16;
    messageIconHeight = 16;

    helpTextEdit->hide();
    fullHelpPushButton->hide();

	
	previousPushButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon	);
	nextPushButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon	);
	exitPushButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon	);
	
	
	//previousPushButton->setAlignment(Qt::AlignLeft);
    helpPushButton->setIcon(QIcon(getApplicationFile("/Icons/help.png")).pixmap(messageIconWidth, messageIconHeight));
    nextButtonIcon->setIcon(QIcon(getApplicationFile("/Icons/next.png")).pixmap(messageIconWidth, messageIconHeight));
    prevButtonIcon->setIcon(QIcon(getApplicationFile("/Icons/prev.png")).pixmap(messageIconWidth, messageIconHeight));
    exitButtonIcon->setIcon(QIcon(getApplicationFile("/Icons/exit.png")).pixmap(messageIconWidth, messageIconHeight));
    fullHelpPushButton->setIcon(QIcon(getApplicationFile("/Icons/maximize.png")).pixmap(messageIconWidth, messageIconHeight));


	//loadingpage = new loadingPage(this);
	//addPage(loadingpage);

	//loadingpage->setIcon("Icons/critical.png");
	//loadingpage->setIconEffect(FADEIN);
	//loadingpage->setMessageEffect(FADEIN);

	langspage = new languagesPage(this);
	langspage->pageName = tr("Language");
	langspage->pageHelpMessage = tr("Please choose your desired language");
	langspage->pageGroup = "Startup";
	langspage->pageIcon = getApplicationFile("/Icons/Languages.png");
	//addPage(langspage);
	languagesGroup = new pagesGroup(this);
    languagesGroup->addPage(langspage);
	addGroup(languagesGroup);



	prevButtonIcon->setFocusPolicy(Qt::NoFocus);
	nextButtonIcon->setFocusPolicy(Qt::NoFocus);
	exitButtonIcon->setFocusPolicy(Qt::NoFocus);
	
	connect(prevButtonIcon, SIGNAL(clicked()), this, SLOT(prevPage()));
    connect(nextButtonIcon, SIGNAL(clicked()), this, SLOT(nextPage()));
    connect(exitButtonIcon, SIGNAL(clicked()), this, SLOT(close()));
    
	//connect(prevButtonIcon, SIGNAL(clicked()), previousPushButton, SLOT(click()));
    //connect(nextButtonIcon, SIGNAL(clicked()), nextPushButton, SLOT(click()));
    //connect(exitButtonIcon, SIGNAL(clicked()), exitPushButton, SLOT(click()));
    
    
    //connect(nextPushButton, SIGNAL(clicked()), nextButtonIcon, SLOT(animateClick()));
    //connect(previousPushButton, SIGNAL(clicked()), prevButtonIcon, SLOT(animateClick()));
    //connect(exitPushButton, SIGNAL(clicked()), exitButtonIcon, SLOT(animateClick()));
    
    connect(helpPushButton, SIGNAL(clicked()), this, SLOT(showHelp()));
    connect(nextPushButton, SIGNAL(clicked()), this, SLOT(nextPage()));
    connect(previousPushButton, SIGNAL(clicked()), this, SLOT(prevPage()));
    connect(exitPushButton, SIGNAL(clicked()), this, SLOT(close()));
    connect(fullHelpPushButton, SIGNAL(clicked()), this, SLOT(showFullHelp()));
    //connect(loadingpage, SIGNAL(finished()), this, SLOT(changePage()));
	connect(langspage, SIGNAL(selectedLanguage(QString)), this, SLOT(updateLayout(QString)));

    /*setStyleSheet("  QPushButton { \
                  border: 2px solid #8f8f91; \
                  border-radius: 6px; \
                  background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, \
                                                    stop: 0 #f6f7fa, stop: 1 #dadbde); \
                  min-width: 80px; \
              } \
 ");*/

	//meskLogoLabel->setText("<img align=absmiddle width=180 src="+getApplicationFile("/Icons/mesklogo.png") + " >");
    meskLogoLabel->setAlignment(Qt::AlignHCenter);
	meskLogoLabel->setText(QString("<img hspace=\"5\" align=absmiddle width=186 src="+getApplicationFile("/Icons/mesklogo.png") + " >"));

    fullHelpPushButton->setEnabled(false);
	previousPushButton->setEnabled(false);
	prevButtonIcon->setEnabled(false);

	setGroup(languagesGroup);

	//QVBoxLayout* messagesVerticalLayout = new QVBoxLayout(this);
    //scrollArea_2->setWidget(messagesVerticalLayout);

}