Ejemplo n.º 1
0
void KHelpMain::createToolbar()
{
	QPixmap pixmap;
	QString pmpath;

	KToolBar *tb = new KToolBar( this );


	pixmap = kapp->getIconLoader()->loadIcon( "back.xpm" );
	tb->insertButton(pixmap, 0, SIGNAL( clicked() ),
		    helpwin, SLOT( slotBack() ),
		    FALSE, klocale->translate("Previous Document"));

	pixmap = kapp->getIconLoader()->loadIcon( "forward.xpm" );
	tb->insertButton(pixmap, 1, SIGNAL( clicked() ),
		    helpwin, SLOT( slotForward() ),
		    FALSE, klocale->translate("Next Document"));

	tb->insertSeparator();

	pixmap = kapp->getIconLoader()->loadIcon( "prev.xpm" );
	tb->insertButton(pixmap, 2, SIGNAL( clicked() ),
		    helpwin, SLOT( slotPrev() ),
		    FALSE, klocale->translate("Previous Node"));

	pixmap = kapp->getIconLoader()->loadIcon( "next.xpm" );
	tb->insertButton(pixmap, 3, SIGNAL( clicked() ),
		    helpwin, SLOT( slotNext() ),
		    FALSE, klocale->translate("Next Node"));

	pixmap = kapp->getIconLoader()->loadIcon( "up.xpm" );
	tb->insertButton(pixmap, 4, SIGNAL( clicked() ),
		    helpwin, SLOT( slotUp() ),
		    FALSE,klocale->translate( "Up one Node"));

	pixmap = kapp->getIconLoader()->loadIcon( "top.xpm" );
	tb->insertButton(pixmap, 5, SIGNAL( clicked() ),
		    helpwin, SLOT( slotTop() ),
		    FALSE, klocale->translate("Top Node"));

	tb->insertSeparator();

	pixmap = kapp->getIconLoader()->loadIcon( "contents.xpm" );
	tb->insertButton(pixmap, 6, SIGNAL( clicked() ),
		    helpwin, SLOT( slotDir() ),
		    FALSE, klocale->translate("Help Contents"));

	pixmap = kapp->getIconLoader()->loadIcon( "reload.xpm" );
	tb->insertButton(pixmap, 7, SIGNAL( clicked() ),
		helpwin, SLOT( slotReload() ),
		TRUE, klocale->translate( "Reload current document" ) );

	pixmap = kapp->getIconLoader()->loadIcon( "stop.xpm" );
	tb->insertButton(pixmap, 8, SIGNAL( clicked() ),
		    helpwin, SLOT( slotStopProcessing() ),
		    FALSE, klocale->translate("Stop"));

	tb->setBarPos( KToolBar::Top );
	toolbar = tb;
}
Ejemplo n.º 2
0
void DlgTrackInfo::init() {
    setupUi(this);

    cueTable->hideColumn(0);
    coverBox->insertWidget(1, m_pWCoverArtLabel);

    // It is essential to make the QPlainTextEdit transparent.
    // Without this, the background is always solid (white by default).
    txtLocation->viewport()->setAutoFillBackground(false);

    connect(btnNext, SIGNAL(clicked()),
            this, SLOT(slotNext()));
    connect(btnPrev, SIGNAL(clicked()),
            this, SLOT(slotPrev()));
    connect(btnApply, SIGNAL(clicked()),
            this, SLOT(apply()));
    connect(btnOK, SIGNAL(clicked()),
            this, SLOT(OK()));
    connect(btnCancel, SIGNAL(clicked()),
            this, SLOT(cancel()));

    connect(btnFetchTag, SIGNAL(clicked()),
            this, SLOT(fetchTag()));

    connect(bpmDouble, SIGNAL(clicked()),
            this, SLOT(slotBpmDouble()));
    connect(bpmHalve, SIGNAL(clicked()),
            this, SLOT(slotBpmHalve()));
    connect(bpmTwoThirds, SIGNAL(clicked()),
            this, SLOT(slotBpmTwoThirds()));
    connect(bpmThreeFourth, SIGNAL(clicked()),
            this, SLOT(slotBpmThreeFourth()));

    connect(btnCueActivate, SIGNAL(clicked()),
            this, SLOT(cueActivate()));
    connect(btnCueDelete, SIGNAL(clicked()),
            this, SLOT(cueDelete()));
    connect(bpmTap, SIGNAL(pressed()),
            this, SLOT(slotBpmTap()));
    connect(btnReloadFromFile, SIGNAL(clicked()),
            this, SLOT(reloadTrackMetadata()));
    connect(btnOpenFileBrowser, SIGNAL(clicked()),
            this, SLOT(slotOpenInFileBrowser()));
    m_bpmTapTimer.start();
    for (int i = 0; i < kFilterLength; ++i) {
        m_bpmTapFilter[i] = 0.0f;
    }

    CoverArtCache* pCache = CoverArtCache::instance();
    if (pCache != NULL) {
        connect(pCache, SIGNAL(coverFound(const QObject*, const int, const CoverInfo&, QPixmap, bool)),
                this, SLOT(slotCoverFound(const QObject*, const int, const CoverInfo&, QPixmap, bool)));
    }
Ejemplo n.º 3
0
Dialog::Dialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Dialog),
    index(0)
{
    ui->setupUi(this);

    text = new QTextEdit;
    readMyXML();
    text->append("<b>Id: </b>" + data[0].id);
    text->append("<b>Student Card: </b>" + data[0].card1);
    text->append("<b>Name: </b>" + data[0].name);
    text->append("<b>Year of Birth: </b>" + data[0].year);
    text->append("<b>Specialization: </b>" + data[0].spec);
    text->append("<b>Average Grade: </b>" + data[0].avgrade);
    text->setReadOnly(true);

    label = new QLabel;
    for (int i = 0; i < N; i++)
        img_list.append(QImage(":/new/prefix1/student" + QString::number(i) +
                          ".jpg"));
    img_cur = img_list[index].scaled(150, 200);
    label->setPixmap(QPixmap::fromImage(img_cur));

    next = new QPushButton("Next");
    prev = new QPushButton("Previous");


    hlay = new QHBoxLayout;
    vlay = new QVBoxLayout;

    hlay->addWidget(text);
    hlay->addLayout(vlay);

    vlay->addWidget(label);

    vlay->addWidget(next);
    vlay->addWidget(prev);

    setLayout(hlay);

    connect(next, SIGNAL(clicked()), this, SLOT(slotNext()));
    connect(prev, SIGNAL(clicked()), this, SLOT(slotPrev()));
}
Ejemplo n.º 4
0
void DlgTrackInfo::init(){
    setupUi(this);

    cueTable->hideColumn(0);

    connect(btnNext, SIGNAL(clicked()),
            this, SLOT(slotNext()));
    connect(btnPrev, SIGNAL(clicked()),
            this, SLOT(slotPrev()));
    connect(btnApply, SIGNAL(clicked()),
            this, SLOT(apply()));
    connect(btnOK, SIGNAL(clicked()),
            this, SLOT(OK()));
    connect(btnCancel, SIGNAL(clicked()),
            this, SLOT(cancel()));

    connect(btnFetchTag, SIGNAL(clicked()),
            this, SLOT(fetchTag()));

    connect(bpmDouble, SIGNAL(clicked()),
            this, SLOT(slotBpmDouble()));
    connect(bpmHalve, SIGNAL(clicked()),
            this, SLOT(slotBpmHalve()));
    connect(bpmTwoThirds, SIGNAL(clicked()),
            this, SLOT(slotBpmTwoThirds()));
    connect(bpmThreeFourth, SIGNAL(clicked()),
            this, SLOT(slotBpmThreeFourth()));

    connect(btnCueActivate, SIGNAL(clicked()),
            this, SLOT(cueActivate()));
    connect(btnCueDelete, SIGNAL(clicked()),
            this, SLOT(cueDelete()));
    connect(bpmTap, SIGNAL(pressed()),
            this, SLOT(slotBpmTap()));
    connect(btnReloadFromFile, SIGNAL(clicked()),
            this, SLOT(reloadTrackMetadata()));
    m_bpmTapTimer.start();
    for (int i = 0; i < kFilterLength; ++i) {
        m_bpmTapFilter[i] = 0.0f;
    }
}
Ejemplo n.º 5
0
ProjectDialog::ProjectDialog( QWidget * parent )
: QDialog( parent )
{
	setupUi( this );
	mDueDate->setDate( QDate::currentDate() );
	mStartDate->setDate( QDate::currentDate() );

	mTemplatesCombo->setAssetType( AssetType::recordByName( "Project" ) );

	QStringList hosts = Host::select().names();
	hosts.sort();
	refreshClientList();
	
	mCompOutputCombo->addItems( Config::recordByName( "compOutputDrives" ).value().split(',') );
	mRenderOutputCombo->addItems( Config::recordByName( "renderOutputDrives" ).value().split(',') );
	mWIPCombo->addItems( Config::recordByName( "wipOutputDrives" ).value().split(',') );
	
	connect( mNewClientButton, SIGNAL( clicked() ), SLOT( slotNewClient() ) );
	connect( mNextButton, SIGNAL( clicked() ), SLOT( slotNext() ) );
	connect( mPrevButton, SIGNAL( clicked() ), SLOT( slotPrev() ) );
	mOKButton->hide();
	mPrevButton->hide();
	connect( mEditTemplatesButton, SIGNAL( clicked() ), DialogFactory::instance(), SLOT( editAssetTemplates() ) );
}
Ejemplo n.º 6
0
PlaybackWidget::PlaybackWidget(QWidget* parent, KUrl::List &urls, SharedContainer* sharedData)
              : QWidget(parent)
{
    setupUi(this);

    m_sharedData = sharedData;
    m_currIndex  = 0;
    m_urlList    = urls;
    m_stopCalled = false;
    m_canHide    = true;

    m_soundLabel->setPixmap(KIcon("speaker").pixmap(64, 64));

    m_prevButton->setText("");
    m_nextButton->setText("");
    m_playButton->setText("");
    m_stopButton->setText("");

    m_prevButton->setIcon(KIcon("media-skip-backward"));
    m_nextButton->setIcon(KIcon("media-skip-forward"));
    m_playButton->setIcon(KIcon("media-playback-start"));
    m_stopButton->setIcon(KIcon("media-playback-stop"));

    connect(m_prevButton, SIGNAL(clicked()),
            this, SLOT(slotPrev()));

    connect(m_nextButton, SIGNAL(clicked()),
            this, SLOT(slotNext()));

    connect(m_playButton, SIGNAL(clicked()),
            this, SLOT(slotPlay()));

    connect(m_stopButton, SIGNAL(clicked()),
            this, SLOT(slotStop()));

    if (m_urlList.empty())
    {
        setEnabled(false);
        return;
    }

    // Waiting for files to be enqueued.
    m_playButton->setEnabled(false);

    m_prevButton->setEnabled(false);

    // Phonon
    m_mediaObject = new Phonon::MediaObject(this);

    m_mediaObject->setTransitionTime(1000);

    m_mediaObject->setTickInterval(500);

    connect(m_mediaObject, SIGNAL(stateChanged(Phonon::State,Phonon::State)),
            this, SLOT(slotMediaStateChanged(Phonon::State,Phonon::State)));

    connect(m_mediaObject, SIGNAL(finished()),
            this, SLOT(slotSongFinished()));

    connect(m_mediaObject, SIGNAL(tick(qint64)),
            this, SLOT(slotTimeUpdaterTimeout()));

    m_audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);

    Phonon::createPath(m_mediaObject, m_audioOutput);

    m_volumeSlider->setAudioOutput(m_audioOutput);

    m_volumeSlider->setOrientation(Qt::Horizontal);

    setZeroTime();

    // Loading first song
    m_mediaObject->setCurrentSource(static_cast<QUrl>(m_urlList[m_currIndex]));
}
Ejemplo n.º 7
0
void DlgTrackInfo::init() {
    setupUi(this);

    cueTable->hideColumn(0);
    coverBox->insertWidget(1, m_pWCoverArtLabel);

    connect(btnNext, SIGNAL(clicked()),
            this, SLOT(slotNext()));
    connect(btnPrev, SIGNAL(clicked()),
            this, SLOT(slotPrev()));
    connect(btnApply, SIGNAL(clicked()),
            this, SLOT(apply()));
    connect(btnOK, SIGNAL(clicked()),
            this, SLOT(OK()));
    connect(btnCancel, SIGNAL(clicked()),
            this, SLOT(cancel()));

    connect(bpmDouble, SIGNAL(clicked()),
            this, SLOT(slotBpmDouble()));
    connect(bpmHalve, SIGNAL(clicked()),
            this, SLOT(slotBpmHalve()));
    connect(bpmTwoThirds, SIGNAL(clicked()),
            this, SLOT(slotBpmTwoThirds()));
    connect(bpmThreeFourth, SIGNAL(clicked()),
            this, SLOT(slotBpmThreeFourth()));
    connect(bpmFourThirds, SIGNAL(clicked()),
            this, SLOT(slotBpmFourThirds()));
    connect(bpmThreeHalves, SIGNAL(clicked()),
            this, SLOT(slotBpmThreeHalves()));
    connect(bpmClear, SIGNAL(clicked()),
            this, SLOT(slotBpmClear()));

    connect(bpmConst, SIGNAL(stateChanged(int)),
            this, SLOT(slotBpmConstChanged(int)));

    connect(spinBpm, SIGNAL(valueChanged(double)),
            this, SLOT(slotSpinBpmValueChanged(double)));

    connect(txtKey, SIGNAL(editingFinished()),
            this, SLOT(slotKeyTextChanged()));

    connect(btnCueActivate, SIGNAL(clicked()),
            this, SLOT(cueActivate()));
    connect(btnCueDelete, SIGNAL(clicked()),
            this, SLOT(cueDelete()));
    connect(bpmTap, SIGNAL(pressed()),
            m_pTapFilter.data(), SLOT(tap()));
    connect(m_pTapFilter.data(), SIGNAL(tapped(double, int)),
            this, SLOT(slotBpmTap(double, int)));

    connect(btnImportMetadataFromFile, SIGNAL(clicked()),
            this, SLOT(slotImportMetadataFromFile()));
    connect(btnImportMetadataFromMusicBrainz, SIGNAL(clicked()),
            this, SLOT(slotImportMetadataFromMusicBrainz()));
    connect(btnOpenFileBrowser, SIGNAL(clicked()),
            this, SLOT(slotOpenInFileBrowser()));

    CoverArtCache* pCache = CoverArtCache::instance();
    if (pCache != NULL) {
        connect(pCache, SIGNAL(coverFound(const QObject*, const CoverInfoRelative&, QPixmap, bool)),
                this, SLOT(slotCoverFound(const QObject*, const CoverInfoRelative&, QPixmap, bool)));
    }
Ejemplo n.º 8
0
OutputPaneManager::OutputPaneManager(QWidget *parent) :
    QWidget(parent),
    m_titleLabel(new QLabel),
    m_manageButton(new OutputPaneManageButton),
    m_closeButton(new QToolButton),
    m_minMaxAction(0),
    m_minMaxButton(new QToolButton),
    m_nextAction(0),
    m_prevAction(0),
    m_outputWidgetPane(new QStackedWidget),
    m_opToolBarWidgets(new QStackedWidget),
    m_minimizeIcon(QLatin1String(":/core/images/arrowdown.png")),
    m_maximizeIcon(QLatin1String(":/core/images/arrowup.png")),
    m_maximised(false),
    m_outputPaneHeight(0)
{
    setWindowTitle(tr("Output"));

    m_titleLabel->setContentsMargins(5, 0, 5, 0);

    m_clearAction = new QAction(this);
    m_clearAction->setIcon(QIcon(QLatin1String(Constants::ICON_CLEAN_PANE)));
    m_clearAction->setText(tr("Clear"));
    connect(m_clearAction, SIGNAL(triggered()), this, SLOT(clearPage()));

    m_nextAction = new QAction(this);
    m_nextAction->setIcon(QIcon(QLatin1String(Constants::ICON_NEXT)));
    m_nextAction->setText(tr("Next Item"));
    connect(m_nextAction, SIGNAL(triggered()), this, SLOT(slotNext()));

    m_prevAction = new QAction(this);
    m_prevAction->setIcon(QIcon(QLatin1String(Constants::ICON_PREV)));
    m_prevAction->setText(tr("Previous Item"));
    connect(m_prevAction, SIGNAL(triggered()), this, SLOT(slotPrev()));

    m_minMaxAction = new QAction(this);
    m_minMaxAction->setIcon(m_maximizeIcon);
    m_minMaxAction->setText(tr("Maximize Output Pane"));

    m_closeButton->setIcon(QIcon(QLatin1String(Constants::ICON_CLOSE_DOCUMENT)));
    connect(m_closeButton, SIGNAL(clicked()), this, SLOT(slotHide()));

    connect(ICore::instance(), SIGNAL(saveSettingsRequested()), this, SLOT(saveSettings()));

    QVBoxLayout *mainlayout = new QVBoxLayout;
    mainlayout->setSpacing(0);
    mainlayout->setMargin(0);
    m_toolBar = new Utils::StyledBar;
    QHBoxLayout *toolLayout = new QHBoxLayout(m_toolBar);
    toolLayout->setMargin(0);
    toolLayout->setSpacing(0);
    toolLayout->addWidget(m_titleLabel);
    toolLayout->addWidget(new Utils::StyledSeparator);
    m_clearButton = new QToolButton;
    toolLayout->addWidget(m_clearButton);
    m_prevToolButton = new QToolButton;
    toolLayout->addWidget(m_prevToolButton);
    m_nextToolButton = new QToolButton;
    toolLayout->addWidget(m_nextToolButton);
    toolLayout->addWidget(m_opToolBarWidgets);
    toolLayout->addWidget(m_minMaxButton);
    toolLayout->addWidget(m_closeButton);
    mainlayout->addWidget(m_toolBar);
    mainlayout->addWidget(m_outputWidgetPane, 10);
    mainlayout->addWidget(new Core::FindToolBarPlaceHolder(this));
    setLayout(mainlayout);

    m_buttonsWidget = new QWidget;
    m_buttonsWidget->setLayout(new QHBoxLayout);
    m_buttonsWidget->layout()->setContentsMargins(5,0,0,0);
    m_buttonsWidget->layout()->setSpacing(4);
}
Ejemplo n.º 9
0
KMWizard::KMWizard(TQWidget *parent, const char *name)
: TQDialog(parent,name,true)
{
	m_start = KMWizard::Start;
	m_end = KMWizard::End;
	m_inclusive = true;
	m_printer = new KMPrinter();

	m_pagepool.setAutoDelete(false);

	m_stack = new TQWidgetStack(this);
	m_next = new KPushButton(i18n("&Next >"), this);
	m_next->setDefault(true);
	m_prev = new KPushButton(i18n("< &Back"), this);
	TQPushButton	*m_cancel = new KPushButton(KStdGuiItem::cancel(), this);
	m_title = new TQLabel(this);
	TQFont	f(m_title->font());
	f.setBold(true);
	m_title->setFont(f);
	KSeparator* sep = new KSeparator( KSeparator::HLine, this);
	sep->setFixedHeight(5);
	KSeparator* sep2 = new KSeparator( KSeparator::HLine, this);
	TQPushButton	*m_help = new KPushButton(KStdGuiItem::help(), this);

	connect(m_cancel,TQT_SIGNAL(clicked()),TQT_SLOT(reject()));
	connect(m_next,TQT_SIGNAL(clicked()),TQT_SLOT(slotNext()));
	connect(m_prev,TQT_SIGNAL(clicked()),TQT_SLOT(slotPrev()));
	connect(m_help, TQT_SIGNAL(clicked()), TQT_SLOT(slotHelp()));

	m_side = new SidePixmap(this);
	if (!m_side->isValid())
	{
		delete m_side;
		m_side = 0;
	}

	// layout
	TQVBoxLayout *main0_ = new TQVBoxLayout(this, 10, 10);
	TQVBoxLayout	*main_ = new TQVBoxLayout(0, 0, 0);
	TQHBoxLayout *main1_ = new TQHBoxLayout(0, 0, 10);
	TQHBoxLayout	*btn_ = new TQHBoxLayout(0, 0, 10);
	main0_->addLayout(main1_);
	if (m_side)
		main1_->addWidget(m_side);
	main1_->addLayout(main_);
	main_->addWidget(m_title);
	main_->addWidget(sep);
	main_->addSpacing(10);
	main_->addWidget(m_stack,1);
	main0_->addWidget(sep2);
	main0_->addLayout(btn_);
	btn_->addWidget(m_help);
	btn_->addStretch(1);
	btn_->addWidget(m_prev);
	btn_->addWidget(m_next);
	btn_->addWidget(m_cancel);

	// create standard pages
	addPage(new KMWInfoPage(this));
	m_backend = new KMWBackend(this);
	addPage(m_backend);
	addPage(new KMWPassword(this));
	addPage(new KMWSocket(this));
	addPage(new KMWDriver(this));
	addPage(new KMWDriverSelect(this));
	addPage(new KMWDriverTest(this));
	addPage(new KMWName(this));
	addPage(new KMWEnd(this));
	addPage(new KMWClass(this));
	addPage(new KMWLpd(this));
	addPage(new KMWFile(this));
	addPage(new KMWSmb(this));
	addPage(new KMWLocal(this));

	// add other pages
	KMFactory::self()->uiManager()->setupWizard(this);

	setCurrentPage(m_start,false);
	setCaption(i18n("Add Printer Wizard"));
	resize(400,350);
}
Ejemplo n.º 10
0
void KHelpMain::createMenu()
{
    KStdAccel stdAccel;
	fileMenu = new QPopupMenu;
	CHECK_PTR( fileMenu );
	fileMenu->insertItem( klocale->translate("&New Help Window"), this,
                        SLOT( slotCloneWindow() ), stdAccel.openNew() );
	fileMenu->insertSeparator();
	fileMenu->insertItem( klocale->translate("&Open File..."), helpwin,
                        SLOT(slotOpenFile()), stdAccel.open() );
//	fileMenu->insertItem( klocale->translate("Open UR&L..."), helpwin,
//                        SLOT(slotOpenURL()) );
	fileMenu->insertItem( klocale->translate("&Reload"), helpwin,
                        SLOT(slotReload()) );
	fileMenu->insertSeparator();
	fileMenu->insertItem( klocale->translate("&Search"), helpwin,
                        SLOT(slotSearch()) );
	fileMenu->insertSeparator();
	fileMenu->insertItem( klocale->translate("&Print..."), helpwin,
                        SLOT(slotPrint()), stdAccel.print() );
	fileMenu->insertSeparator();
	idClose = fileMenu->insertItem(klocale->translate("&Close"),this,
                        SLOT(slotClose()), stdAccel.close()); // CC :!!!!!
	fileMenu->insertItem( klocale->translate("&Quit"), this,
                        SLOT(slotQuit()), stdAccel.quit() );

	editMenu = new QPopupMenu;
	CHECK_PTR( editMenu );
	idCopy = editMenu->insertItem(klocale->translate("&Copy"), helpwin,
                        SLOT(slotCopy()), stdAccel.copy() );
	editMenu->insertItem(klocale->translate("&Find..."), helpwin,
                        SLOT(slotFind()), stdAccel.find() );
	editMenu->insertItem(klocale->translate("Find &next"), helpwin,
                        SLOT(slotFindNext()), Key_F3 );

	gotoMenu = new QPopupMenu;
	CHECK_PTR( gotoMenu );
	idBack = gotoMenu->insertItem( klocale->translate("&Back"), helpwin,
                        SLOT(slotBack()) );
	idForward = gotoMenu->insertItem( klocale->translate("&Forward"), helpwin,
                        SLOT(slotForward()) );
	gotoMenu->insertSeparator();
	idDir = gotoMenu->insertItem( klocale->translate("&Contents"), helpwin,
                        SLOT(slotDir()) );
	idTop = gotoMenu->insertItem( klocale->translate("&Top"), helpwin,
                        SLOT(slotTop()) );
	idUp = gotoMenu->insertItem( klocale->translate("&Up"), helpwin,
                        SLOT(slotUp()) );
	idPrev = gotoMenu->insertItem( klocale->translate("&Previous"), helpwin,
                        SLOT(slotPrev()) );
	idNext = gotoMenu->insertItem( klocale->translate("&Next"), helpwin,
                        SLOT(slotNext()) );

	bookmarkMenu = new QPopupMenu;
	CHECK_PTR( bookmarkMenu );
	connect( bookmarkMenu, SIGNAL( activated( int ) ),
			helpwin, SLOT( slotBookmarkSelected( int ) ) );
	connect( bookmarkMenu, SIGNAL( highlighted( int ) ),
			helpwin, SLOT( slotBookmarkHighlighted( int ) ) );

	optionsMenu = new QPopupMenu;
	CHECK_PTR( optionsMenu );
	optionsMenu->setCheckable( true );
	optionsMenu->insertItem( klocale->translate("&General Preferences..."), this,
			SLOT(slotOptionsGeneral()) );
	optionsMenu->insertSeparator();
	optionsMenu->insertItem(klocale->translate( "Show &Toolbar"), this,
                        SLOT(slotOptionsToolbar()));

	optionsMenu->insertItem( klocale->translate("Show &Location"), this,
                        SLOT(slotOptionsLocation()) );
	optionsMenu->insertItem( klocale->translate("Show Status&bar"), this,
		SLOT(slotOptionsStatusbar()) );
	optionsMenu->insertSeparator();
	optionsMenu->insertItem( klocale->translate("&Save Options"), this,
                        SLOT(slotOptionsSave()) );

	QString at = klocale->translate("KDE Help System\n");
	at+= klocale->translate("Version ");
	at+= KDEHELP_VERSION;
	at+=klocale->translate("\n\nCopyright (c) 1997 Martin Jones <*****@*****.**>"\
	"\n\nThis program is licensed under the GNU General Public License (GPL)."\
	"\nKDEHelp comes with ABSOLUTELY NO WARRANY to the extent permitted by applicable law.");

	QPopupMenu *helpMenu = kapp->getHelpMenu( true, at );
/*
	QPopupMenu *helpMenu = new QPopupMenu;
	CHECK_PTR( helpMenu );
	helpMenu->insertItem( klocale->translate("&Using KDE Help"), this,
                        SLOT(slotUsingHelp()) ); 
	helpMenu->insertSeparator();
	helpMenu->insertItem( klocale->translate("&About"), this, SLOT(slotAbout()) );
*/
	menu = new KMenuBar( this );
	CHECK_PTR( menu );
	menu->insertItem( klocale->translate("&File"), fileMenu );
	menu->insertItem( klocale->translate("&Edit"), editMenu );
	menu->insertItem( klocale->translate("&Goto"), gotoMenu );
	menu->insertItem( klocale->translate("&Bookmarks"), bookmarkMenu );
	menu->insertItem( klocale->translate("&Options"), optionsMenu );
	menu->insertSeparator();
	menu->insertItem( klocale->translate("&Help"), helpMenu );
}
Ejemplo n.º 11
0
OutputPaneManager::OutputPaneManager(QWidget *parent) :
    QWidget(parent),
    m_widgetComboBox(new QComboBox),
    m_closeButton(new QToolButton),
    m_minMaxAction(0),
    m_minMaxButton(new QToolButton),
    m_nextAction(0),
    m_prevAction(0),
    m_lastIndex(-1),
    m_outputWidgetPane(new QStackedWidget),
    m_opToolBarWidgets(new QStackedWidget),
    m_minimizeIcon(":/core/images/arrowdown.png"),
    m_maximizeIcon(":/core/images/arrowup.png"),
    m_maximised(false)
{
    setWindowTitle(tr("Output"));
    connect(m_widgetComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(changePage()));

    m_clearAction = new QAction(this);
    m_clearAction->setIcon(QIcon(QLatin1String(Constants::ICON_CLEAN_PANE)));
    m_clearAction->setText(tr("Clear"));
    connect(m_clearAction, SIGNAL(triggered()), this, SLOT(clearPage()));

    m_nextAction = new QAction(this);
    m_nextAction->setIcon(QIcon(QLatin1String(Constants::ICON_NEXT)));
    m_nextAction->setText(tr("Next Item"));
    connect(m_nextAction, SIGNAL(triggered()), this, SLOT(slotNext()));

    m_prevAction = new QAction(this);
    m_prevAction->setIcon(QIcon(QLatin1String(Constants::ICON_PREV)));
    m_prevAction->setText(tr("Previous Item"));
    connect(m_prevAction, SIGNAL(triggered()), this, SLOT(slotPrev()));

    m_minMaxAction = new QAction(this);
    m_minMaxAction->setIcon(m_maximizeIcon);
    m_minMaxAction->setText(tr("Maximize Output Pane"));

    m_closeButton->setIcon(QIcon(QLatin1String(Constants::ICON_CLOSE)));
    connect(m_closeButton, SIGNAL(clicked()), this, SLOT(slotHide()));

    QVBoxLayout *mainlayout = new QVBoxLayout;
    mainlayout->setSpacing(0);
    mainlayout->setMargin(0);
    m_toolBar = new Utils::StyledBar;
    QHBoxLayout *toolLayout = new QHBoxLayout(m_toolBar);
    toolLayout->setMargin(0);
    toolLayout->setSpacing(0);
    toolLayout->addWidget(m_widgetComboBox);
    m_clearButton = new QToolButton;
    toolLayout->addWidget(m_clearButton);
    m_prevToolButton = new QToolButton;
    toolLayout->addWidget(m_prevToolButton);
    m_nextToolButton = new QToolButton;
    toolLayout->addWidget(m_nextToolButton);
    toolLayout->addWidget(m_opToolBarWidgets);
    toolLayout->addWidget(m_minMaxButton);
    toolLayout->addWidget(m_closeButton);
    mainlayout->addWidget(m_toolBar);
    mainlayout->addWidget(m_outputWidgetPane, 10);
    mainlayout->addWidget(new Core::FindToolBarPlaceHolder(this));
    setLayout(mainlayout);

    m_buttonsWidget = new QWidget;
    m_buttonsWidget->setLayout(new QHBoxLayout);
    m_buttonsWidget->layout()->setContentsMargins(5,0,0,0);
    m_buttonsWidget->layout()->setSpacing(4);

}
Ejemplo n.º 12
0
void NCPreview::initTools()
{
	/////////////////
	// ACTIONS
	/////////////////
	actionPrint = new QAction( this );
	actionPrint->setText( tr("Print...") );
	actionPrint->setIcon( iconFactory->findIcon("print") );
	actionPrint->setToolTip( tr("Print") );
	connect( actionPrint, SIGNAL( triggered() ), this, SLOT( slotPrint() ) );
	actionPrint->setEnabled( false );	// alapetelmezetten kikapcsolva

	actionZP = new QAction( this );
	actionZP->setText( tr("Zoom") );
	actionZP->setIcon( iconFactory->findIcon("zoom_plus")  );
	actionZP->setToolTip( tr("Zoom page") );
	actionZP->setShortcut( Qt::Key_Plus );
	connect( actionZP, SIGNAL( triggered() ), this, SLOT( zoomPlus() ) );

	actionZM = new QAction( this );
	actionZM->setText( tr("Unzoom") );
	actionZM->setIcon( iconFactory->findIcon("zoom_minus") );
	actionZM->setToolTip( tr("Unzoom page") );
	actionZM->setShortcut( Qt::Key_Minus );
	connect( actionZM, SIGNAL( triggered() ), this, SLOT( zoomMinus() ) );

	actionFrst = new QAction( this );
	actionFrst->setText( tr("First page") );
	actionFrst->setIcon( iconFactory->findIcon("firstpage") );
	actionFrst->setToolTip( tr("Go to first page") );
	actionFrst->setShortcut( Qt::CTRL+Qt::Key_Home );
	connect( actionFrst, SIGNAL( triggered() ), this, SLOT( slotFirst() ) );

	actionPrev = new QAction( this );
	actionPrev->setText( tr("Previous page") );
	actionPrev->setIcon( iconFactory->findIcon("prevpage") );
	actionPrev->setToolTip( tr("Go to previous page") );
	actionPrev->setShortcut( Qt::CTRL+Qt::Key_Left );
	connect( actionPrev, SIGNAL( triggered() ), this, SLOT( slotPrev() ) );

	actionNext = new QAction( this );
	actionNext->setText( tr("Next page") );
	actionNext->setIcon( iconFactory->findIcon("nextpage") );
	actionNext->setToolTip( tr("Go to next page") );
	actionNext->setShortcut( Qt::CTRL+Qt::Key_Right );
	connect( actionNext, SIGNAL( triggered() ), this, SLOT( slotNext() ) );

	actionLast = new QAction( this );
	actionLast->setText( tr("Last page") );
	actionLast->setIcon( iconFactory->findIcon("lastpage") );
	actionLast->setToolTip( tr("Go to final page") );
	actionLast->setShortcut( Qt::CTRL+Qt::Key_End );
	connect( actionLast, SIGNAL( triggered() ), this, SLOT( slotLast() ) );

	actionGo = new QAction( this );
	actionGo->setText( tr("Go to page...") );
	actionGo->setIcon( iconFactory->findIcon("gotopage") );
	actionGo->setToolTip( tr("Go to specified page") );
	actionGo->setShortcut( Qt::CTRL+Qt::Key_G );
	connect( actionGo, SIGNAL( triggered() ), this, SLOT( slotGoTo() ) );

	actionExit = new QAction( this );
	actionExit->setText( tr("Exit") );
	actionExit->setIcon( iconFactory->findIcon("exit") );
	actionExit->setToolTip( tr("Exit preview") );
	actionExit->setShortcut( Qt::Key_Escape );
	connect( actionExit, SIGNAL( triggered() ), this, SLOT( close() ) );

	/////////////////
	// MENUS
	/////////////////
	//QAction *actionPrint, *actionFrst, *actionNext, *actionPrev, *actionLast;
	//QAction *actionGo, *actionExit, *actionZP, *actionZM;

	mnFile = menuBar()->addMenu(tr("&File"));
	mnFile->addAction(actionPrint);
	mnFile->addAction(actionZP);
	mnFile->addAction(actionZM);
	mnFile->addSeparator();
	mnFile->addAction(actionExit);
	
	mnNav = menuBar()->addMenu(tr("&Navigate"));
	mnNav->addAction(actionFrst);
	mnNav->addAction(actionPrev);
	mnNav->addAction(actionNext);
	mnNav->addAction(actionLast);
	mnNav->addSeparator();
	mnNav->addAction(actionGo);	
	
	/////////////////
	// TOOLBAR
	/////////////////
	toolbar = addToolBar( tr("Tools") );
	//********************************************* combo
	cbZoom =  new QComboBox( toolbar );
	cbZoom->addItem( tr( " 10 %" ));
	cbZoom->addItem( tr( " 20 %" ));
	cbZoom->addItem( tr( " 50 %" ));
	cbZoom->addItem( tr( " 75 %" ));
	cbZoom->addItem( tr( "100 %" ));
	cbZoom->addItem( tr( "120 %" ));
	cbZoom->addItem( tr( "150 %" ));
	cbZoom->addItem( tr( "200 %" ));
	cbZoom->addItem( tr( "300 %" ));
	cbZoom->addItem( tr( "400 %" ));
	cbZoom->addItem( tr( "500 %" ));
	cbZoom->setFocusPolicy( Qt::NoFocus );
	cbZoom->setCurrentIndex( 4 );
	connect( cbZoom, SIGNAL(activated(const QString &) ), SLOT( slotZoom(const QString &) ) );
	
	toolbar->addAction(actionPrint);
	toolbar->addSeparator();
	toolbar->addAction(actionZP);
	toolbar->addAction(actionZM);
	toolbar->addSeparator();
	toolbar->addWidget(cbZoom);	
	toolbar->addSeparator();
	toolbar->addAction(actionFrst);
	toolbar->addAction(actionPrev);
	toolbar->addAction(actionNext);
	toolbar->addAction(actionLast);

	toolbar->setIconSize(QSize(16,16));
	statusBar();
	//statusBar()->showMessage(tr("Ready"));	
}