示例#1
0
	SearchActivity::SearchActivity(SearchPlugin* sp,QWidget* parent)
		: Activity(i18nc("plugin name","Search"),"edit-find",10,parent),sp(sp)
	{
		setXMLGUIFile("ktsearchpluginui.rc");
		setupActions();
		toolbar = new SearchToolBar(part()->actionCollection(),sp->getSearchEngineList(),this);
		connect(toolbar,SIGNAL(search( const QString&, int, bool )),
				sp,SLOT(search( const QString&, int, bool )));
		
		QVBoxLayout* layout = new QVBoxLayout(this);
		layout->setSpacing(0);
		layout->setMargin(0);
		tabs = new KTabWidget(this);
		tabs->setMovable(true);
		layout->addWidget(tabs);
		connect(tabs,SIGNAL(currentChanged(int)),this,SLOT(currentTabChanged(int)));
		
		QToolButton* lc = new QToolButton(tabs);
		tabs->setCornerWidget(lc,Qt::TopLeftCorner);
		QToolButton* rc = new QToolButton(tabs);
		tabs->setCornerWidget(rc,Qt::TopRightCorner);
		lc->setIcon(KIcon("tab-new"));
		connect(lc,SIGNAL(clicked()),this,SLOT(openTab()));
		rc->setIcon(KIcon("tab-close"));
		connect(rc,SIGNAL(clicked()),this,SLOT(closeTab()));
	}
DownloadButton::DownloadButton(QWidget * parent)
        : QToolButton(parent)
{
    m_count++;
    if(m_count == 1)
    {
        m_tab = new DownloadTab();
    }

    setAutoRaise(true);
    setIcon(QIcon::fromTheme("download", QIcon(":/download.png")));
    setToolTip(trUtf8("Downloads"));
    setShortcut(Qt::CTRL + Qt::Key_D);

    connect(this, SIGNAL(clicked()), this, SLOT(openTab()));
    connect(DownloadManager::downloadManager(), SIGNAL(itemsChanged()), this, SLOT(openTab()));
}
示例#3
0
void WindowsManager::open(const QUrl &url, OpenHints hints)
{
	Window *window = m_mainWindow->getWorkspace()->getActiveWindow();

	if (hints == NewTabOpen && !url.isEmpty() && window && Utils::isUrlEmpty(window->getUrl()))
	{
		hints = CurrentTabOpen;
	}

	if (hints == DefaultOpen && url.scheme() == QLatin1String("about") && !url.path().isEmpty() && url.path() != QLatin1String("blank") && url.path() != QLatin1String("start") && (!window || !Utils::isUrlEmpty(window->getUrl())))
	{
		hints = NewTabOpen;
	}

	if (hints == DefaultOpen && url.scheme() != QLatin1String("javascript") && ((window && Utils::isUrlEmpty(window->getUrl())) || SettingsManager::getValue(QLatin1String("Browser/ReuseCurrentTab")).toBool()))
	{
		hints = CurrentTabOpen;
	}

	if (m_isPrivate)
	{
		hints |= PrivateOpen;
	}

	if (hints.testFlag(NewWindowOpen))
	{
		emit requestedNewWindow(hints.testFlag(PrivateOpen), hints.testFlag(BackgroundOpen), url);
	}
	else if (hints.testFlag(CurrentTabOpen) && window && window->getType() == QLatin1String("web"))
	{
		if (window->isPrivate() == hints.testFlag(PrivateOpen))
		{
			window->getContentsWidget()->setHistory(WindowHistoryInformation());
			window->setUrl(url, false);
		}
		else
		{
			close(m_mainWindow->getTabBar()->currentIndex());
			openTab(url, hints);
		}
	}
	else
	{
		openTab(url, hints);
	}
}
示例#4
0
LPTabData FAR PASCAL _EXPORT initTabs(HWND hwnd, int nFrame, int nTabCount,
				      LPTabDescription lpTabDescription, int nInitialTab)
{
#if defined(_WIN32)
    HMODULE hInstance=InstanceFromWindow(hwnd);
#else
    HINSTANCE hInstance=InstanceFromWindow(hwnd);
#endif
    LPTabData lpTabData=gmallocz(sizeof(TabData));
    int nTab;

    if (!lpTabData)
	return(NULL);

    lpTabData->hwndTab=GetDlgItem(hwnd, nFrame);
    lpTabData->nIndex= -1;
    lpTabData->nFrame=nFrame;
    lpTabData->lpTabList=gcallocz((WORD) sizeof(TabItem), (WORD) nTabCount);

    if (!lpTabData->lpTabList) 
	{
		gfree(lpTabData);	lpTabData = NULL;
		return(NULL);
    }

    for (nTab=0; nTab<nTabCount; nTab++) {
	TC_ITEM tie;
	LPDLGTEMPLATE lpDlgTemplate=lockDlgRes(hInstance, lpTabDescription[nTab].lpszTemplate);

	if (!lpDlgTemplate) 
	{
	    gfree(lpTabData->lpTabList);	lpTabData->lpTabList = NULL;
	    gfree(lpTabData);				lpTabData = NULL;
	    return(NULL);
	}

	tie.mask=TCIF_TEXT;
	tie.pszText=lpTabDescription[nTab].lpszTag;
	TabCtrl_InsertItem(lpTabData->hwndTab, nTab, &tie);
	lpTabData->lpTabList[nTab].lpDlgTemplate=lpDlgTemplate;
	lpTabData->lpTabList[nTab].fpDlgProc=lpTabDescription[nTab].fpDlgProc;
    }

    SetWindowFont(lpTabData->hwndTab, lpGlobals->hfNormal, FALSE);
    TabCtrl_SetCurSel(lpTabData->hwndTab, nInitialTab);
    openTab(hwnd, lpTabData);
    return(lpTabData);
}
示例#5
0
int webPage::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: loading((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 1: isLoading((*reinterpret_cast< QPixmap(*)>(_a[1]))); break;
        case 2: titleChanged((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 3: pageChanged((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break;
        case 4: showSources((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 5: speedDial(); break;
        case 6: needPrint((*reinterpret_cast< QPrinter*(*)>(_a[1]))); break;
        case 7: openTab((*reinterpret_cast< webPage*(*)>(_a[1]))); break;
        case 8: setFullScreen((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 9: startLoading(); break;
        case 10: finishLoading((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 11: changeTitle((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 12: changeUrl((*reinterpret_cast< QUrl(*)>(_a[1]))); break;
        case 13: goToHome(); break;
        case 14: loadUrl(); break;
        case 15: loadUrl((*reinterpret_cast< QUrl(*)>(_a[1]))); break;
        case 16: loadUrl((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 17: addToBookMark(); break;
        case 18: downloadFile((*reinterpret_cast< const QNetworkRequest(*)>(_a[1]))); break;
        case 19: downloadFile((*reinterpret_cast< QNetworkReply*(*)>(_a[1]))); break;
        case 20: loadBookMark(); break;
        case 21: showBookMark(); break;
        case 22: sources(); break;
        case 23: defineHome(); break;
        case 24: findNext(); break;
        case 25: findPrevious(); break;
        case 26: print(); break;
        case 27: createNewPage((*reinterpret_cast< WebView*(*)>(_a[1]))); break;
        case 28: createNewPage(); break;
        case 29: updateIcon(); break;
        case 30: copy(); break;
        case 31: authentification((*reinterpret_cast< QNetworkReply*(*)>(_a[1])),(*reinterpret_cast< QAuthenticator*(*)>(_a[2]))); break;
        case 32: inspectPage(); break;
        case 33: goToDial(); break;
        case 34: updateUrlIcon((*reinterpret_cast< QPixmap(*)>(_a[1]))); break;
        case 35: updateBookMark(); break;
        case 36: updateOptions(); break;
        case 37: showBar(); break;
        case 38: showPage(); break;
        case 39: showDial(); break;
        case 40: inCache(); break;
        case 41: showConsole(); break;
        case 42: zoomIn(); break;
        case 43: zoomOut(); break;
        case 44: restoreZoom(); break;
        case 45: savePage(); break;
        case 46: back(); break;
        case 47: forward(); break;
        default: ;
        }
        _id -= 48;
    }
    return _id;
}
示例#6
0
文件: optionsdlg.cpp 项目: Vitozz/psi
OptionsDlg::OptionsDlg(PsiCon *psi, QWidget *parent) :
	OptionsDlgBase(psi, parent)
{
	setWindowTitle(CAP(windowTitle()));
	setWindowIcon(IconsetFactory::icon("psi/options").icon());

	QList<OptionsTab*> tabs;

	// tabs - base
	/*tabs.append( new OptionsTabGeneral(this) );
	//tabs.append( new OptionsTabBase(this, "general",  "", "psi/logo_16",	tr("General"),		tr("General preferences list")) );
	tabs.append( new OptionsTabEvents(this) );
	//tabs.append( new OptionsTabBase(this, "events",   "", "psi/system",	tr("Events"),		tr("Change the events behaviour")) );
	tabs.append( new OptionsTabPresence(this) );
	//tabs.append( new OptionsTabBase(this, "presence", "", "status/online",	tr("Presence"),		tr("Presence configuration")) );
	tabs.append( new OptionsTabLookFeel(this) );
	tabs.append( new OptionsTabIconset(this) );
	//tabs.append( new OptionsTabBase(this, "lookfeel", "", "psi/smile",	tr("Look and Feel"),	tr("Change the Psi's Look and Feel")) );
	tabs.append( new OptionsTabSound(this) );
	//tabs.append( new OptionsTabBase(this, "sound",    "", "psi/playSounds",	tr("Sound"),		tr("Configure how Psi sounds")) );
	*/

	OptionsTabApplication* applicationTab = new OptionsTabApplication(this);
	applicationTab->setHaveAutoUpdater(psi->haveAutoUpdater());
	tabs.append( applicationTab );
	tabs.append( new OptionsTabRoster(this) );
	tabs.append( new OptionsTabChat(this) );
	tabs.append( new OptionsTabEvents(this) );
	tabs.append( new OptionsTabPopups(this) );
	tabs.append( new OptionsTabStatus(this) );
	tabs.append( new OptionsTabAppearance(this) );
	//tabs.append( new OptionsTabIconsetSystem(this) );
	//tabs.append( new OptionsTabIconsetRoster(this) );
	//tabs.append( new OptionsTabIconsetEmoticons(this) );
	tabs.append( new OptionsTabGroupchat(this) );
	tabs.append( new OptionsTabSound(this) );
	if(AvCallManager::isSupported())
		tabs.append( new OptionsTabAvCall(this) );
	tabs.append( new OptionsTabToolbars(this) );
#ifdef PSI_PLUGINS
	tabs.append( new OptionsTabPlugins(this) );
#endif
	tabs.append( new OptionsTabShortcuts(this) );
	tabs.append( new OptionsTabAdvanced(this) );
	tabs.append( new OptionsTabTree(this) );

	// tabs - general
	/*tabs.append( new OptionsTabGeneralRoster(this) );
	tabs.append( new OptionsTabGeneralDocking(this) );
	tabs.append( new OptionsTabGeneralNotifications(this) );
	tabs.append( new OptionsTabGeneralGroupchat(this) );
	tabs.append( new OptionsTabGeneralMisc(this) );*/

	// tabs - events
	/*tabs.append( new OptionsTabEventsReceive(this) );
	tabs.append( new OptionsTabEventsMisc(this) );*/

	// tabs - presence
	/*tabs.append( new OptionsTabPresenceAuto(this) );
	tabs.append( new OptionsTabPresencePresets(this) );
	tabs.append( new OptionsTabPresenceMisc(this) );*/

	// tabs - look and feel
	/*tabs.append( new OptionsTabLookFeelColors(this) );
	tabs.append( new OptionsTabLookFeelFonts(this) );
	tabs.append( new OptionsTabIconsetSystem(this) );
	tabs.append( new OptionsTabIconsetEmoticons(this) );
	tabs.append( new OptionsTabIconsetRoster(this) );
	tabs.append( new OptionsTabLookFeelToolbars(this) );
	tabs.append( new OptionsTabLookFeelMisc(this) );*/

	// tabs - sound
	/*tabs.append( new OptionsTabSoundPrefs(this) );
	tabs.append( new OptionsTabSoundEvents(this) );*/

	setTabs(tabs);

	psi->dialogRegister(this);
	resize(640, 480);

	openTab( "application" );
}