GuiSpectrumAnalyser::GuiSpectrumAnalyser()
  : WaWidget(_WA_MAPPING_ANALYSER)
{
    connect(WaSkinModel::instance(), SIGNAL(skinChanged()), this, SLOT(pixmapChange()));

    contextMenu = new QPopupMenu(this);
    visualizationMenu = new QPopupMenu();
    analyserMenu = new QPopupMenu();

    contextMenu->insertItem(i18n("Visualization Mode"), visualizationMenu);
    contextMenu->insertItem(i18n("Analyzer Mode"), analyserMenu);

    visualizationMenu->insertItem(i18n("Analyzer"), (int)MODE_ANALYSER);
    visualizationMenu->insertItem(i18n("Disabled"), (int)MODE_DISABLED);
    visualizationMenu->setCheckable(true);
    connect(visualizationMenu, SIGNAL(activated(int)), this, SLOT(setVisualizationMode(int)));

    analyserMenu->insertItem(i18n("Normal"), (int)MODE_NORMAL);
    analyserMenu->insertItem(i18n("Fire"), (int)MODE_FIRE);
    analyserMenu->insertItem(i18n("Vertical Lines"), (int)MODE_VERTICAL_LINES);
    analyserMenu->setCheckable(true);
    connect(analyserMenu, SIGNAL(activated(int)), this, SLOT(setAnalyserMode(int)));

    analyserCache = NULL;
    winSkinVis = NULL;

    KConfig *config = KGlobal::config();
    config->setGroup("Winskin");

    setVisualizationMode(config->readNumEntry("visualizationMode", MODE_ANALYSER));
    setAnalyserMode(config->readNumEntry("analyserMode", MODE_NORMAL));
}
示例#2
0
PlaylistControl::PlaylistControl(QWidget* parent) : PixmapWidget(parent)
{
	m_skin = Skin::instance();
    setPixmap(m_skin->getPlPart(Skin::PL_CONTROL));
    m_ratio = m_skin->ratio();
    connect(m_skin, SIGNAL(skinChanged()), SLOT(updateSkin()));
}
示例#3
0
EqTitleBar::EqTitleBar(QWidget *parent)
        : PixmapWidget(parent)
{
    m_volumeBar = 0;
    m_balanceBar = 0;
    m_shade2 = 0;
    m_left = 0;
    m_right = 0;
    m_shaded = false;
    m_align = false;
    m_skin = Skin::instance();
    m_eq = parentWidget();
    m_mw = qobject_cast<MainWindow*>(m_eq->parent());
    m_close = new Button(this, Skin::EQ_BT_CLOSE_N, Skin::EQ_BT_CLOSE_P, Skin::CUR_EQCLOSE);
    connect(m_close, SIGNAL(clicked()),m_eq, SIGNAL(closed()));
    m_shade = new Button(this, Skin::EQ_BT_SHADE1_N, Skin::EQ_BT_SHADE1_P, Skin::CUR_EQNORMAL);
    connect(m_shade, SIGNAL(clicked()), SLOT(shade()));
    QSettings settings(Qmmp::configFile(), QSettings::IniFormat);
    if (settings.value("Skinned/eq_shaded", false).toBool())
        shade();
    m_align = true;
    setActive(false);
    setCursor(m_skin->getCursor(Skin::CUR_EQTITLE));
    connect(m_skin, SIGNAL(skinChanged()), SLOT(updateSkin()));
    updatePositions();
}
WidgetChatCenter::WidgetChatCenter(QWidget* parent) :
	QMainWindow(parent),
	ui(new Ui::WidgetChatCenter)
{
	ui->setupUi(this);
	quazaaIrc = new QuazaaIRC();
	if(quazaaSettings.Chat.ConnectOnStartup)
	{
		quazaaIrc->startIrc(quazaaSettings.Chat.IrcUseSSL, quazaaSettings.Profile.IrcNickname, quazaaSettings.Profile.IrcUserName, quazaaSettings.Chat.IrcServerName, quazaaSettings.Chat.IrcServerPort);
		ui->actionConnect->setEnabled(false);
		ui->actionDisconnect->setEnabled(true);
		qDebug() << "Trying to connect to IRC";
	}
	else
	{
		ui->actionConnect->setEnabled(true);
		ui->actionDisconnect->setEnabled(false);
	}
	restoreState(quazaaSettings.WinMain.ChatToolbars);
	connect(&skinSettings, SIGNAL(skinChanged()), this, SLOT(skinChangeEvent()));
	connect(quazaaIrc, SIGNAL(appendMessage(Irc::Buffer*, QString, QString, QuazaaIRC::Event)), this, SLOT(appendMessage(Irc::Buffer*, QString, QString, QuazaaIRC::Event)));
	connect(quazaaIrc, SIGNAL(channelNames(QStringList)), this, SLOT(channelNames(QStringList)));
	connect(quazaaIrc, SIGNAL(bufferAdded(QString)), this, SLOT(addBuffer(QString)));
	connect(quazaaIrc, SIGNAL(setPrefixes(QString, QString)), this, SLOT(setPrefixes(QString, QString)));
	//connect(quazaaIrc, SIGNAL(joined(QString)), this, SLOT(joined(QString)));

	WidgetChatTab* wct = new WidgetChatTab(quazaaIrc, this);
	ui->tabWidget->addTab(wct, "Status");
	wct->setName("*status"); // * is not allowed by RFC (IIRC)
	skinChangeEvent();
}
示例#5
0
void Doom3GroupNode::refreshModel() {
	// Simulate a "model" key change
	m_contained.modelChanged(_entity.getKeyValue("model"));

	// Trigger a skin change
	skinChanged(_entity.getKeyValue("skin"));
}
示例#6
0
DialogDownloadMonitor::DialogDownloadMonitor(QWidget *parent) :
	QDialog(parent),
	m_ui(new Ui::DialogDownloadMonitor)
{
	m_ui->setupUi(this);
	connect(&skinSettings, SIGNAL(skinChanged()), this, SLOT(skinChangeEvent()));
	skinChangeEvent();
}
DialogCloseType::DialogCloseType(QWidget* parent) :
	QDialog(parent),
	m_ui(new Ui::DialogCloseType)
{
	m_ui->setupUi(this);
	connect(&skinSettings, SIGNAL(skinChanged()), this, SLOT(skinChangeEvent()));
	skinChangeEvent();
}
示例#8
0
DialogLibrarySearch::DialogLibrarySearch(QWidget *parent) :
	QDialog(parent),
	ui(new Ui::DialogLibrarySearch)
{
	ui->setupUi(this);
	connect(&skinSettings, SIGNAL(skinChanged()), this, SLOT(skinChangeEvent()));
	skinChangeEvent();
}
DialogSecuritySubscriptions::DialogSecuritySubscriptions(QWidget *parent) :
	QDialog(parent),
	m_ui(new Ui::DialogSecuritySubscriptions)
{
	m_ui->setupUi(this);
	connect(&skinSettings, SIGNAL(skinChanged()), this, SLOT(skinChangeEvent()));
	skinChangeEvent();
}
DialogTransferProgressTooltip::DialogTransferProgressTooltip(QWidget *parent) :
	QDialog(parent),
	m_ui(new Ui::DialogTransferProgressTooltip)
{
	m_ui->setupUi(this);
	connect(&skinSettings, SIGNAL(skinChanged()), this, SLOT(skinChangeEvent()));
	skinChangeEvent();
}
WidgetSearchMonitor::WidgetSearchMonitor(QWidget* parent) :
	QMainWindow(parent),
	ui(new Ui::WidgetSearchMonitor)
{
	ui->setupUi(this);
	restoreState(quazaaSettings.WinMain.SearchMonitorToolbar);
	connect(&skinSettings, SIGNAL(skinChanged()), this, SLOT(skinChangeEvent()));
	skinChangeEvent();
}
示例#12
0
WidgetDownloads::WidgetDownloads(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::WidgetDownloads)
{
    ui->setupUi(this);
	restoreState(quazaaSettings.WinMain.DownloadsToolbar);
	connect(&skinSettings, SIGNAL(skinChanged()), this, SLOT(skinChangeEvent()));
	skinChangeEvent();
}
DialogCreateTorrent::DialogCreateTorrent(QWidget* parent) :
	QDialog(parent),
	m_ui(new Ui::DialogCreateTorrent)
{
	m_ui->setupUi(this);
	m_ui->comboBoxSeedDHT->setView(new QListView());
	connect(&skinSettings, SIGNAL(skinChanged()), this, SLOT(skinChangeEvent()));
	skinChangeEvent();
}
示例#14
0
DialogEditShares::DialogEditShares(QWidget *parent) :
	QDialog(parent),
	m_ui(new Ui::DialogEditShares)
{
	m_ui->setupUi(this);
	m_ui->listWidgetShares->addItems(quazaaSettings.Library.Shares);
	m_ui->pushButtonOk->setEnabled(false);
	connect(&skinSettings, SIGNAL(skinChanged()), this, SLOT(skinChangeEvent()));
	skinChangeEvent();
}
示例#15
0
WidgetHostCache::WidgetHostCache(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::WidgetHostCache)
{
    ui->setupUi(this);
	restoreState(quazaaSettings.WinMain.HostCacheToolbar);
	connect(&skinSettings, SIGNAL(skinChanged()), this, SLOT(skinChangeEvent()));
	skinChangeEvent();
	ui->splitterHostCache->restoreState(quazaaSettings.WinMain.HostCacheSplitter);
}
示例#16
0
WidgetGraph::WidgetGraph(QWidget* parent) :
	QMainWindow(parent),
	ui(new Ui::WidgetGraph)
{
	ui->setupUi(this);
	restoreState(quazaaSettings.WinMain.GraphToolbar);
	connect(&skinSettings, SIGNAL(skinChanged()), this, SLOT(skinChangeEvent()));
	skinChangeEvent();
	ui->splitterGraph->restoreState(quazaaSettings.WinMain.GraphSplitter);
}
示例#17
0
HorizontalSlider::HorizontalSlider(QWidget *parent)
        : QWidget(parent)
{
    m_skin = Skin::instance();
    m_min = 0;
    m_max = 100;
    m_value = 0;
    connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin()));
    updateSkin();
}
示例#18
0
// greebo: Construct a new RenderablePicoModel instance, we re-use the surfaces only
PicoModelNode::PicoModelNode(const RenderablePicoModelPtr& picoModel) :
    _picoModel(new RenderablePicoModel(*picoModel)),
    _name(picoModel->getFilename()),
    _lightList(GlobalRenderSystem().attachLitObject(*this))
{
    Node::setTransformChangedCallback(boost::bind(&PicoModelNode::lightsChanged, this));

    // Update the skin
    skinChanged("");
}
示例#19
0
WidgetLibrary::WidgetLibrary(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::WidgetLibrary)
{
    ui->setupUi(this);
	connect(&skinSettings, SIGNAL(skinChanged()), this, SLOT(skinChangeEvent()));
	skinChangeEvent();
	ui->tabWidgetLibraryNavigator->setCurrentIndex(quazaaSettings.WinMain.LibraryNavigatorTab);
	ui->splitterLibrary->restoreState(quazaaSettings.WinMain.LibrarySplitter);
    panelLibraryView = new WidgetLibraryView();
    ui->verticalLayoutLibraryView->addWidget(panelLibraryView);
}
WidgetTransfers::WidgetTransfers(QWidget* parent) :
	QWidget(parent),
	ui(new Ui::WidgetTransfers)
{
	ui->setupUi(this);
	connect(&skinSettings, SIGNAL(skinChanged()), this, SLOT(skinChangeEvent()));
	skinChangeEvent();
	ui->splitterTransfers->restoreState(quazaaSettings.WinMain.TransfersSplitter);
	panelDownloads = new WidgetDownloads();
	ui->verticalLayoutDownloads->addWidget(panelDownloads);
	panelUploads = new WidgetUploads();
	ui->verticalLayoutUploads->addWidget(panelUploads);
}
示例#21
0
void SkeletonAnimationFbo::setSkin(const QString & value)
{
    if (mSkin == value)
        return;
    mSkin = value;
    Q_EMIT skinChanged();

    if (isSkeletonValid()){
        const bool res = spSkeleton_setSkinByName(mspSkeleton, mSkin.toStdString().c_str());
        if (!res)
            qDebug()<<"SkeletonAnimation::setSkin Error: Invalid skin:"<<mSkin;
    }
}
示例#22
0
WidgetHome::WidgetHome(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::WidgetHome)
{
    ui->setupUi(this);
	connect(&skinSettings, SIGNAL(skinChanged()), this, SLOT(skinChangeEvent()));
	connect(ui->labelLibraryTaskLink, SIGNAL(linkActivated(QString)), this, SIGNAL(triggerLibrary()));
	connect(ui->labelWelcomeSecurityLink, SIGNAL(linkActivated(QString)), this, SIGNAL(triggerSecurity()));
	connect(ui->labelTransfersTaskLink, SIGNAL(linkActivated(QString)), this, SIGNAL(triggerTransfers()));
	skinChangeEvent();
	ui->splitterHome->restoreState(quazaaSettings.WinMain.HomeSplitter);
	ui->lineEditWelcomeSearch->setText(quazaaSettings.WinMain.HomeSearchString);
	ui->toolButtonHomeConnectionTaskHeader->setChecked(quazaaSettings.WinMain.HomeConnectionTaskVisible);
	ui->toolButtonHomeTransfersTaskDownloadsHeader->setChecked(quazaaSettings.WinMain.HomeDownloadsTaskVisible);
	ui->toolButtonHomeLibraryTaskHeader->setChecked(quazaaSettings.WinMain.HomeLibraryTaskVisible);
	ui->lineEditWelcomeSearch->setText(quazaaSettings.WinMain.HomeSearchString);
	ui->toolButtonHomeTorrentsTaskHeader->setChecked(quazaaSettings.WinMain.HomeTorrentsTaskVisible);
	ui->toolButtonHomeTransfersTaskUploadsHeader->setChecked(quazaaSettings.WinMain.HomeUploadsTaskVisible);
}
示例#23
0
WidgetSearchResults::WidgetSearchResults(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::WidgetSearchResults)
{
	ui->setupUi(this);
	labelFilter = new QLabel();
	labelFilter->setText("Filter: ");
	lineEditFilter = new QLineEdit();
	lineEditFilter->setMaximumWidth(150);
	ui->toolBarFilter->insertWidget(ui->actionFilterMore, labelFilter);
	ui->toolBarFilter->insertWidget(ui->actionFilterMore, lineEditFilter);
	restoreState(quazaaSettings.WinMain.SearchToolbar);
	connect(&skinSettings, SIGNAL(skinChanged()), this, SLOT(skinChangeEvent()));
	skinChangeEvent();
	WidgetSearchTemplate *tabNewSearch = new WidgetSearchTemplate();
	ui->tabWidgetSearch->addTab(tabNewSearch, QIcon(":/Resource/Generic/Search.png"), tr("Search"));
	ui->tabWidgetSearch->setCurrentIndex(0);
	connect(tabNewSearch, SIGNAL(statsUpdated(WidgetSearchTemplate*)), this, SLOT(onStatsUpdated(WidgetSearchTemplate*)));
	ui->splitterSearchDetails->restoreState(quazaaSettings.WinMain.SearchDetailsSplitter);
}
示例#24
0
QSkinDialog::QSkinDialog(bool sizable, bool closable, bool mainDialog, bool preview, QWidget* parent) :
	QDialog(parent),
	ui(new Ui::QSkinDialog)
{
	ui->setupUi(this);
	maximized = false;
	minimized = false;
	movable = false;
	moving = false;
	dialogSizable = sizable;
	dialogClosable = closable;
	dialogPreview = preview;
	isMainDialog = mainDialog;
	sizableTopLeft = false;
	sizableLeft = false;
	sizableBottomLeft = false;
	sizableBottom = false;
	sizableTopRight = false;
	sizableRight = false;
	sizableBottomRight = false;

	systemMenu = new QMenu(this);
	systemRestoreAction = new QAction(tr("Restore"), this);
	systemRestoreAction->setIcon(style()->standardIcon(QStyle::SP_TitleBarNormalButton));
	systemRestoreAction->setEnabled(false);
	systemMenu->addAction(systemRestoreAction);
	systemMinimizeAction = new QAction(tr("Minimize"), this);
	systemMinimizeAction->setIcon(style()->standardIcon(QStyle::SP_TitleBarMinButton));
	systemMenu->addAction(systemMinimizeAction);
	systemMinimizeAction->setEnabled(dialogSizable);
	systemMaximizeAction = new QAction(tr("Maximize"), this);
	systemMaximizeAction->setIcon(style()->standardIcon(QStyle::SP_TitleBarMaxButton));
	systemMenu->addAction(systemMaximizeAction);
	systemMaximizeAction->setEnabled(dialogSizable);
	systemMenu->addSeparator();
	systemCloseAction = new QAction(tr("Close"), this);
	systemCloseAction->setIcon(style()->standardIcon(QStyle::SP_TitleBarCloseButton));
	systemCloseAction->setShortcut(QKeySequence::Close);
	systemCloseAction->setEnabled(dialogClosable);
	systemMenu->addAction(systemCloseAction);

	// We are using our own frame of course instead of the system frame
	if(!parent == 0)
	{
		this->setWindowFlags(Qt::FramelessWindowHint | Qt::Window);
	}
	else
	{
		this->setWindowFlags(Qt::FramelessWindowHint);
	}
	// To enable alpha blending and transparency in the frame
	setAttribute(Qt::WA_TranslucentBackground);
	setAttribute(Qt::WA_StaticContents);

	this->setMaximumSize(QApplication::desktop()->availableGeometry(this).width(), QApplication::desktop()->availableGeometry(this).height());

	ui->minimizeButton->setEnabled(dialogSizable);
	ui->maximizeButton->setEnabled(dialogSizable);
	ui->closeButton->setEnabled(dialogClosable);
	if(!dialogSizable)
	{
		ui->windowFrameTopLeft->setCursor(QCursor(Qt::ArrowCursor));
		ui->windowFrameLeft->setCursor(QCursor(Qt::ArrowCursor));
		ui->windowFrameBottomLeft->setCursor(QCursor(Qt::ArrowCursor));
		ui->windowFrameTop->setCursor(QCursor(Qt::ArrowCursor));
		ui->windowFrameBottom->setCursor(QCursor(Qt::ArrowCursor));
		ui->windowFrameTopRight->setCursor(QCursor(Qt::ArrowCursor));
		ui->windowFrameRight->setCursor(QCursor(Qt::ArrowCursor));
		ui->windowFrameBottomRight->setCursor(QCursor(Qt::ArrowCursor));
	}

	connect(systemRestoreAction, SIGNAL(triggered()), this, SLOT(onMaximize()));
	connect(systemMaximizeAction, SIGNAL(triggered()), this, SLOT(onMaximize()));
	connect(systemMinimizeAction, SIGNAL(triggered()), this, SLOT(onMinimize()));
	connect(systemCloseAction, SIGNAL(triggered()), this, SLOT(onClose()));
	connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(onClose()));
	connect(ui->minimizeButton, SIGNAL(clicked()), this, SLOT(onMinimize()));
	connect(ui->maximizeButton, SIGNAL(clicked()), this, SLOT(onMaximize()));
	connect(&skinSettings, SIGNAL(skinChanged()), this, SLOT(skinChangeEvent()));

	if(quazaaSettings.Skin.File.isEmpty())
	{
		quazaaSettings.loadSkinSettings();
	}

	skinSettings.loadSkin(quazaaSettings.Skin.File);
	quazaaSettings.saveSkinSettings();

	// Load the previously set skin

	if(!dialogPreview)
	{
		if(isMainDialog)
		{
			ui->windowFrameTopLeft->setStyleSheet(skinSettings.windowFrameTopLeftStyleSheet);
			ui->windowFrameLeft->setStyleSheet(skinSettings.windowFrameLeftStyleSheet);
			ui->windowFrameBottomLeft->setStyleSheet(skinSettings.windowFrameBottomLeftStyleSheet);
			ui->windowFrameTop->setStyleSheet(skinSettings.windowFrameTopStyleSheet);
			ui->windowFrameBottom->setStyleSheet(skinSettings.windowFrameBottomStyleSheet);
			ui->windowFrameTopRight->setStyleSheet(skinSettings.windowFrameTopRightStyleSheet);
			ui->windowFrameRight->setStyleSheet(skinSettings.windowFrameRightStyleSheet);
			ui->windowFrameBottomRight->setStyleSheet(skinSettings.windowFrameBottomRightStyleSheet);
			ui->titlebarButtonsFrame->setStyleSheet(skinSettings.titlebarButtonsFrameStyleSheet);
			ui->minimizeButton->setStyleSheet(skinSettings.minimizeButtonStyleSheet);
			ui->maximizeButton->setStyleSheet(skinSettings.maximizeButtonStyleSheet);
			ui->closeButton->setStyleSheet(skinSettings.closeButtonStyleSheet);
			ui->windowFrameTopSpacer->setStyleSheet(skinSettings.windowFrameTopSpacerStyleSheet);
			ui->windowText->setStyleSheet(skinSettings.windowTextStyleSheet);
			ui->windowIconFrame->setStyleSheet(skinSettings.windowIconFrameStyleSheet);
			ui->windowIcon->setVisible(skinSettings.windowIconVisible);
			quazaaSettings.loadSkinWindowSettings(this);
		}
		else
		{
			ui->windowFrameTopLeft->setStyleSheet(skinSettings.childWindowFrameTopLeftStyleSheet);
			ui->windowFrameLeft->setStyleSheet(skinSettings.childWindowFrameLeftStyleSheet);
			ui->windowFrameBottomLeft->setStyleSheet(skinSettings.childWindowFrameBottomLeftStyleSheet);
			ui->windowFrameTop->setStyleSheet(skinSettings.childWindowFrameTopStyleSheet);
			ui->windowFrameBottom->setStyleSheet(skinSettings.childWindowFrameBottomStyleSheet);
			ui->windowFrameTopRight->setStyleSheet(skinSettings.childWindowFrameTopRightStyleSheet);
			ui->windowFrameRight->setStyleSheet(skinSettings.childWindowFrameRightStyleSheet);
			ui->windowFrameBottomRight->setStyleSheet(skinSettings.childWindowFrameBottomRightStyleSheet);
			ui->titlebarButtonsFrame->setStyleSheet(skinSettings.childTitlebarButtonsFrameStyleSheet);
			ui->minimizeButton->setStyleSheet(skinSettings.childMinimizeButtonStyleSheet);
			ui->maximizeButton->setStyleSheet(skinSettings.childMaximizeButtonStyleSheet);
			ui->closeButton->setStyleSheet(skinSettings.childCloseButtonStyleSheet);
			ui->windowFrameTopSpacer->setStyleSheet(skinSettings.childWindowFrameTopSpacerStyleSheet);
			ui->windowText->setStyleSheet(skinSettings.childWindowTextStyleSheet);
			ui->windowIconFrame->setStyleSheet(skinSettings.childWindowIconFrameStyleSheet);
			ui->windowIcon->setVisible(skinSettings.childWindowIconVisible);
		}
	}
}
XYVirtualKeyboard::XYVirtualKeyboard(QWidget *parent)
    : QWidget(parent), triangleBtnPressed(false), resizeType(No)
{
    this->setWindowFlags(Qt::FramelessWindowHint
                         | Qt::WindowStaysOnTopHint
                         | Qt::Tool);
#if QT_VERSION >= 0x050000
    this->setWindowFlags(this->windowFlags() | Qt::WindowDoesNotAcceptFocus);
#endif

    connect(this, SIGNAL(triangleBtnClicked()), this, SLOT(triangleBtnClickedOP()));
    letterWidget = new QWidget;
    numberWidget = new QWidget;
    letterLabel = new XYMovableLabel;
    letterLabel->setMinimumWidth(30);
    QFont font = letterLabel->font();
    font.setPixelSize(20);
    font.setUnderline(true);
    letterLabel->setFont(font);
    translateHView = new XYHDragableTranslateView;
    connect(translateHView, SIGNAL(clicked(QString,int)),
            this, SLOT(userSelectChinese(QString,int)));
    translateHDragableWidget = new XYDragableWidget(translateHView,
                                                    XYDragableWidget::HORIZONTAL);
    translateHDragableWidget->setMinimumHeight(30);
    translateHDragableWidget->setMouseSensitivity(5);

    translateVView = new XYVDragableTranslateView;
    translateVView->setUnitMinWidth(50);
    translateVView->setUnitMinHeight(40);
    connect(translateVView, SIGNAL(clicked(QString,int)),
            this, SLOT(userSelectChinese(QString,int)));
    connect(translateVView, SIGNAL(stringPressed(QString,QPoint)),
            this, SLOT(showTempWindow(QString,QPoint)));
    translateVDragableWidget = new XYDragableWidget(translateVView,
                                                    XYDragableWidget::VERTICAL);
    translateVDragableWidget->setMouseSensitivity(5);
    translateVDragableWidget->setHidden(true);

    symbolView = new XYVDragableTranslateView;
    symbolView->setUnitMinWidth(50);
    symbolView->setUnitMinHeight(40);
    symbolView->dataStrings = loadSymbols(":/symbol.txt");
    connect(symbolView, SIGNAL(clicked(QString,int)),
            this, SLOT(symbolSeleted(QString,int)));
    connect(symbolView, SIGNAL(stringPressed(QString,QPoint)),
            this, SLOT(showTempWindow(QString,QPoint)));
    symbolDragableWidget = new XYDragableWidget(symbolView,
                                                XYDragableWidget::VERTICAL);
    symbolDragableWidget->setMouseSensitivity(15);

    funcHView = new XYHDragableTranslateView;
    funcHView->setUnitMinWidth(50);
    funcHView->setUnitMinHeight(40);
#if QT_VERSION < 0x050000
    funcHView->dataStrings << QString::fromUtf8("换肤")
                           << QString::fromUtf8("表情")
                           << QString::fromUtf8("设置")
                           << QString::fromUtf8("功能")
                           << QString::fromUtf8("手势")
                           << QString::fromUtf8("搜索")
                           << QString::fromUtf8("更多");
#else
    funcHView->dataStrings << QStringLiteral("换肤")
                           << QStringLiteral("表情")
                           << QStringLiteral("设置")
                           << QStringLiteral("功能")
                           << QStringLiteral("手势")
                           << QStringLiteral("搜索")
                           << QStringLiteral("更多");
#endif
    connect(funcHView, SIGNAL(clicked(QString,int)),
            this, SLOT(funcClicked(QString,int)));
    funcDragableWidget = new XYDragableWidget(funcHView,
                                              XYDragableWidget::HORIZONTAL);
    funcDragableWidget->setMinimumHeight(30);
    funcDragableWidget->setMouseSensitivity(5);

    QGridLayout *letter_layout = new QGridLayout(letterWidget);
    letter_layout->setContentsMargins(3, 0, 3, 0);
    letter_layout->setHorizontalSpacing(5);
    letter_layout->setVerticalSpacing(5);
    int row = 0;
    int column = 0;
    // 字母控件
    XYPushButton *main_letterQ = new XYPushButton("Q", Qt::Key_Q);
    XYPushButton *main_letterW = new XYPushButton("W", Qt::Key_W);
    XYPushButton *main_letterE = new XYPushButton("E", Qt::Key_E);
    XYPushButton *main_letterR = new XYPushButton("R", Qt::Key_R);
    XYPushButton *main_letterT = new XYPushButton("T", Qt::Key_T);
    XYPushButton *main_letterY = new XYPushButton("Y", Qt::Key_Y);
    XYPushButton *main_letterU = new XYPushButton("U", Qt::Key_U);
    XYPushButton *main_letterI = new XYPushButton("I", Qt::Key_I);
    XYPushButton *main_letterO = new XYPushButton("O", Qt::Key_O);
    XYPushButton *main_letterP = new XYPushButton("P", Qt::Key_P);

    row = 0;
    column = 0;
    letter_layout->addWidget(main_letterQ, row, column++);
    letter_layout->addWidget(main_letterW, row, column++);
    letter_layout->addWidget(main_letterE, row, column++);
    letter_layout->addWidget(main_letterR, row, column++);
    letter_layout->addWidget(main_letterT, row, column++);
    letter_layout->addWidget(main_letterY, row, column++);
    letter_layout->addWidget(main_letterU, row, column++);
    letter_layout->addWidget(main_letterI, row, column++);
    letter_layout->addWidget(main_letterO, row, column++);
    letter_layout->addWidget(main_letterP, row, column++);

    XYPushButton *main_tab = new XYPushButton("Tab", Qt::Key_Tab);
    XYPushButton *main_letterA = new XYPushButton("A", Qt::Key_A);
    XYPushButton *main_letterS = new XYPushButton("S", Qt::Key_S);
    XYPushButton *main_letterD = new XYPushButton("D", Qt::Key_D);
    XYPushButton *main_letterF = new XYPushButton("F", Qt::Key_F);
    XYPushButton *main_letterG = new XYPushButton("G", Qt::Key_G);
    XYPushButton *main_letterH = new XYPushButton("H", Qt::Key_H);
    XYPushButton *main_letterJ = new XYPushButton("J", Qt::Key_J);
    XYPushButton *main_letterK = new XYPushButton("K", Qt::Key_K);
    XYPushButton *main_letterL = new XYPushButton("L", Qt::Key_L);

    row = 1;
    column = 0;
    letter_layout->addWidget(main_tab, row, column++);
    letter_layout->addWidget(main_letterA, row, column++);
    letter_layout->addWidget(main_letterS, row, column++);
    letter_layout->addWidget(main_letterD, row, column++);
    letter_layout->addWidget(main_letterF, row, column++);
    letter_layout->addWidget(main_letterG, row, column++);
    letter_layout->addWidget(main_letterH, row, column++);
    letter_layout->addWidget(main_letterJ, row, column++);
    letter_layout->addWidget(main_letterK, row, column++);
    letter_layout->addWidget(main_letterL, row, column++);

    XYPushButton *main_shift = new XYPushButton("Shift", Qt::Key_Shift);
    main_shift->setCheckable(true);
    connect(main_shift, SIGNAL(checkedChanged(bool)), this, SLOT(caseChanged(bool)));
    XYPushButton *main_letterZ = new XYPushButton("Z", Qt::Key_Z);
    XYPushButton *main_letterX = new XYPushButton("X", Qt::Key_X);
    XYPushButton *main_letterC = new XYPushButton("C", Qt::Key_C);
    XYPushButton *main_letterV = new XYPushButton("V", Qt::Key_V);
    XYPushButton *main_letterB = new XYPushButton("B", Qt::Key_B);
    XYPushButton *main_letterN = new XYPushButton("N", Qt::Key_N);
    XYPushButton *main_letterM = new XYPushButton("M", Qt::Key_M);
    XYPushButton *main_Exclam = new XYPushButton("!", Qt::Key_Exclam);
    XYPushButton *main_backspace = new XYPushButton("", Qt::Key_Backspace);

    row = 2;
    column = 0;
    letter_layout->addWidget(main_shift, row, column++);
    letter_layout->addWidget(main_Exclam, row, column++);
    letter_layout->addWidget(main_letterZ, row, column++);
    letter_layout->addWidget(main_letterX, row, column++);
    letter_layout->addWidget(main_letterC, row, column++);
    letter_layout->addWidget(main_letterV, row, column++);
    letter_layout->addWidget(main_letterB, row, column++);
    letter_layout->addWidget(main_letterN, row, column++);
    letter_layout->addWidget(main_letterM, row, column++);
    letter_layout->addWidget(main_backspace, row, column++);

    XYPushButton *main_ctrl = new XYPushButton("Ctrl", Qt::Key_Control);
    main_ctrl->setCheckable(true);
    XYPushButton *main_alt = new XYPushButton("Alt", Qt::Key_Alt);
    main_alt->setCheckable(true);
    XYPushButton *main_symbol = new XYPushButton("#+-=", Qt::Key_Meta);
    connect(main_symbol, SIGNAL(clicked()), this, SLOT(showSymbols()));
    XYPushButton *main_angleComma = new XYPushButton(",", Qt::Key_Comma);
    XYPushButton *main_space = new XYPushButton(" ", Qt::Key_Space);
    XYPushButton *main_anglePeriod = new XYPushButton(".", Qt::Key_Period);
    XYPushButton *showNumBtn = new XYPushButton("123", Qt::Key_Meta);
    connect(showNumBtn, SIGNAL(clicked()), this, SLOT(showNumberWidget()));
    switchLanguageBtn = new XYPushButton("", Qt::Key_Menu);
    connect(switchLanguageBtn, SIGNAL(clicked()), this, SLOT(languageChanged()));
    XYPushButton *main_Return = new XYPushButton("", Qt::Key_Return);

    row = 3;
    column = 0;
    letter_layout->addWidget(showNumBtn, row, column++);
    letter_layout->addWidget(main_ctrl, row, column++);
    letter_layout->addWidget(main_alt, row, column++);
    letter_layout->addWidget(main_symbol, row, column++);
    letter_layout->addWidget(main_space, row, column++, 1, 2);
    column++;
    letter_layout->addWidget(main_anglePeriod, row, column++);
    letter_layout->addWidget(main_angleComma, row, column++);
    letter_layout->addWidget(switchLanguageBtn, row, column++);
    letter_layout->addWidget(main_Return, row, column++);

    // 装入shift需要改变内容的控件
    allShiftChangeKeys.append(main_letterA);
    allShiftChangeKeys.append(main_letterB);
    allShiftChangeKeys.append(main_letterC);
    allShiftChangeKeys.append(main_letterD);
    allShiftChangeKeys.append(main_letterE);
    allShiftChangeKeys.append(main_letterF);
    allShiftChangeKeys.append(main_letterG);
    allShiftChangeKeys.append(main_letterH);
    allShiftChangeKeys.append(main_letterI);
    allShiftChangeKeys.append(main_letterJ);
    allShiftChangeKeys.append(main_letterK);
    allShiftChangeKeys.append(main_letterL);
    allShiftChangeKeys.append(main_letterM);
    allShiftChangeKeys.append(main_letterN);
    allShiftChangeKeys.append(main_letterO);
    allShiftChangeKeys.append(main_letterP);
    allShiftChangeKeys.append(main_letterQ);
    allShiftChangeKeys.append(main_letterR);
    allShiftChangeKeys.append(main_letterS);
    allShiftChangeKeys.append(main_letterT);
    allShiftChangeKeys.append(main_letterU);
    allShiftChangeKeys.append(main_letterV);
    allShiftChangeKeys.append(main_letterW);
    allShiftChangeKeys.append(main_letterX);
    allShiftChangeKeys.append(main_letterY);
    allShiftChangeKeys.append(main_letterZ);

    QGridLayout *numbers_layout = new QGridLayout(numberWidget);
    numbers_layout->setContentsMargins(3, 0, 3, 0);
    numbers_layout->setHorizontalSpacing(5);
    numbers_layout->setVerticalSpacing(5);
    // 数字控件
    XYPushButton *main_Underscore = new XYPushButton("_", Qt::Key_Underscore);
    XYPushButton *main_AsciiTilde = new XYPushButton("~", Qt::Key_AsciiTilde);
    XYPushButton *main_Percent = new XYPushButton("%", Qt::Key_Percent);
    XYPushButton *main_Asterisk = new XYPushButton("*", Qt::Key_Asterisk);
    XYPushButton *main_number1 = new XYPushButton("1", Qt::Key_1);
    XYPushButton *main_number2 = new XYPushButton("2", Qt::Key_2);
    XYPushButton *main_number3 = new XYPushButton("3", Qt::Key_3);
    XYPushButton *main_Question = new XYPushButton("?", Qt::Key_Question);
    XYPushButton *main_At = new XYPushButton("@", Qt::Key_At);
    XYPushButton *main_ParenLeft = new XYPushButton("(", Qt::Key_ParenLeft);
    XYPushButton *main_backspace1 = new XYPushButton("", Qt::Key_Backspace);

    row = 0;
    column = 0;
    numbers_layout->addWidget(main_Underscore, row, column++);
    numbers_layout->addWidget(main_AsciiTilde, row, column++);
    numbers_layout->addWidget(main_Percent, row, column++);
    numbers_layout->addWidget(main_Asterisk, row, column++);
    numbers_layout->addWidget(main_number1, row, column++);
    numbers_layout->addWidget(main_number2, row, column++);
    numbers_layout->addWidget(main_number3, row, column++);
    numbers_layout->addWidget(main_Question, row, column++);
    numbers_layout->addWidget(main_At, row, column++);
    numbers_layout->addWidget(main_ParenLeft, row, column++);
    numbers_layout->addWidget(main_backspace1, row, column++);

    XYPushButton *main_QuoteDbl = new XYPushButton("\"", Qt::Key_QuoteDbl);
    XYPushButton *main_Exclam1 = new XYPushButton("!", Qt::Key_Exclam);
    XYPushButton *main_Bar = new XYPushButton("|", Qt::Key_Bar);
    XYPushButton *main_Minus = new XYPushButton("-", Qt::Key_Minus);
    XYPushButton *main_number4 = new XYPushButton("4", Qt::Key_4);
    XYPushButton *main_number5 = new XYPushButton("5", Qt::Key_5);
    XYPushButton *main_number6 = new XYPushButton("6", Qt::Key_6);
    XYPushButton *main_BracketLeft = new XYPushButton("[", Qt::Key_BracketLeft);
    XYPushButton *main_NumberSign = new XYPushButton("#", Qt::Key_NumberSign);
    XYPushButton *main_ParenRight = new XYPushButton(")", Qt::Key_ParenRight);
    XYPushButton *main_Dollar = new XYPushButton("$", Qt::Key_Dollar);

    row = 1;
    column = 0;
    numbers_layout->addWidget(main_QuoteDbl, row, column++);
    numbers_layout->addWidget(main_Exclam1, row, column++);
    numbers_layout->addWidget(main_Bar, row, column++);
    numbers_layout->addWidget(main_Minus, row, column++);
    numbers_layout->addWidget(main_number4, row, column++);
    numbers_layout->addWidget(main_number5, row, column++);
    numbers_layout->addWidget(main_number6, row, column++);
    numbers_layout->addWidget(main_BracketLeft, row, column++);
    numbers_layout->addWidget(main_NumberSign, row, column++);
    numbers_layout->addWidget(main_ParenRight, row, column++);
    numbers_layout->addWidget(main_Dollar, row, column++);

    XYPushButton *main_QuoteLeft = new XYPushButton("`", Qt::Key_QuoteLeft);
    XYPushButton *main_Ampersand = new XYPushButton("&",  Qt::Key_Ampersand);
    XYPushButton *main_Less = new XYPushButton("<", Qt::Key_Less);
    XYPushButton *main_Plus = new XYPushButton("+", Qt::Key_Plus);
    XYPushButton *main_number7 = new XYPushButton("7", Qt::Key_7);
    XYPushButton *main_number8 = new XYPushButton("8", Qt::Key_8);
    XYPushButton *main_number9 = new XYPushButton("9", Qt::Key_9);
    XYPushButton *main_BracketRight = new XYPushButton("]", Qt::Key_BracketRight);
    XYPushButton *main_AsciiCircum = new XYPushButton("^", Qt::Key_AsciiCircum);
    XYPushButton *main_BraceLeft = new XYPushButton("{", Qt::Key_BraceLeft);
    XYPushButton *main_Comma = new XYPushButton(",", Qt::Key_Comma);

    row = 2;
    column = 0;
    numbers_layout->addWidget(main_QuoteLeft, row, column++);
    numbers_layout->addWidget(main_Ampersand, row, column++);
    numbers_layout->addWidget(main_Less, row, column++);
    numbers_layout->addWidget(main_Plus, row, column++);
    numbers_layout->addWidget(main_number7, row, column++);
    numbers_layout->addWidget(main_number8, row, column++);
    numbers_layout->addWidget(main_number9, row, column++);
    numbers_layout->addWidget(main_BracketRight, row, column++);
    numbers_layout->addWidget(main_AsciiCircum, row, column++);
    numbers_layout->addWidget(main_BraceLeft, row, column++);
    numbers_layout->addWidget(main_Comma, row, column++);

    XYPushButton *showLetterBtn = new XYPushButton("ABC", Qt::Key_Meta);
    connect(showLetterBtn, SIGNAL(clicked()), this, SLOT(showLetterWidget()));
    XYPushButton *main_Backslash = new XYPushButton("\\", Qt::Key_Backslash);
    XYPushButton *main_Greater = new XYPushButton(">", Qt::Key_Greater);
    XYPushButton *main_Slash = new XYPushButton("/", Qt::Key_Slash);
    XYPushButton *main_Period = new XYPushButton(".", Qt::Key_Period);
    XYPushButton *main_number0 = new XYPushButton("0", Qt::Key_0);
    XYPushButton *main_Equal = new XYPushButton("=", Qt::Key_Equal);
    XYPushButton *main_Colon = new XYPushButton(":", Qt::Key_Colon);
    XYPushButton *main_Semicolon = new XYPushButton(";", Qt::Key_Semicolon);
    XYPushButton *main_BraceRight = new XYPushButton("}", Qt::Key_BraceRight);
    XYPushButton *main_enter = new XYPushButton("", Qt::Key_Enter);

    row = 3;
    column = 0;
    numbers_layout->addWidget(showLetterBtn, row, column++);
    numbers_layout->addWidget(main_Backslash, row, column++);
    numbers_layout->addWidget(main_Greater, row, column++);
    numbers_layout->addWidget(main_Slash, row, column++);
    numbers_layout->addWidget(main_Period, row, column++);
    numbers_layout->addWidget(main_number0, row, column++);
    numbers_layout->addWidget(main_Equal, row, column++);
    numbers_layout->addWidget(main_Colon, row, column++);
    numbers_layout->addWidget(main_Semicolon, row, column++);
    numbers_layout->addWidget(main_BraceRight, row, column++);
    numbers_layout->addWidget(main_enter, row, column++);

    stackedWidget = new QStackedWidget;
    stackedWidget->addWidget(letterWidget);
    stackedWidget->addWidget(numberWidget);
    stackedWidget->addWidget(translateVDragableWidget);
    stackedWidget->addWidget(symbolDragableWidget);
    stackedWidget->setCurrentWidget(letterWidget);

    QHBoxLayout *top_layout = new QHBoxLayout;
    top_layout->setContentsMargins(10, 2, 60, 2);
    top_layout->addWidget(letterLabel);
    top_layout->addSpacing(10);
    top_layout->addWidget(translateHDragableWidget, 1);
    top_layout->addWidget(funcDragableWidget, 1);

    QVBoxLayout *main_layout = new QVBoxLayout(this);
    main_layout->setContentsMargins(5, 2, 5, 8);
    main_layout->addLayout(top_layout);
    main_layout->addSpacing(4);
    main_layout->addWidget(stackedWidget);

    // 关联按键信号
    for (int i = 0; i < XYPushButton::allKeyBtns.size(); ++i)
    {
        XYPushButton::allKeyBtns.at(i)->installEventFilter(this);
        connect(XYPushButton::allKeyBtns.at(i),
                SIGNAL(clicked(int,int,Qt::KeyboardModifiers,bool)),
                this,
                SLOT(keyClicked(int,int,Qt::KeyboardModifiers,bool)));

        connect(XYPushButton::allKeyBtns.at(i),
                SIGNAL(mousePressed(XYPushButton*)),
                this,
                SLOT(keyPressed(XYPushButton*)));

        connect(XYPushButton::allKeyBtns.at(i),
                SIGNAL(mouseReleaseed(XYPushButton*)),
                this,
                SLOT(keyReleaseed(XYPushButton*)));
    }

    connect(XYSKIN, SIGNAL(skinChanged()), this, SLOT(skinChanged()));
    caseChanged(false);
    skinChanged();
    initPinyinDictionary();
}
示例#26
0
DialogLanguage::DialogLanguage(QWidget *parent) :
	QDialog(parent),
	m_ui(new Ui::DialogLanguage)
{
	m_ui->setupUi(this);
	connect(&skinSettings, SIGNAL(skinChanged()), this, SLOT(skinChangeEvent()));
	skinChangeEvent();
	//Set the list selection according to which language file is selected
	//English
	if (quazaaSettings.Language.File == ("quazaa_default_en"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(0);
	}
	//Afrikanns
	if (quazaaSettings.Language.File == ("quazaa_af"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(1);
	}
	//Arabic
	if (quazaaSettings.Language.File == ("quazaa_ar"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(2);
	}
	//Català
	if (quazaaSettings.Language.File == ("quazaa_ca"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(3);
	}
	//Chinese
	if (quazaaSettings.Language.File == ("quazaa_chs"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(4);
	}
	//Ceština
	if (quazaaSettings.Language.File == ("quazaa_cz"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(5);
	}
	//Deutsch
	if (quazaaSettings.Language.File == ("quazaa_de"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(6);
	}
	//Eesti
	if (quazaaSettings.Language.File == ("quazaa_ee"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(7);
	}
	//Español
	if (quazaaSettings.Language.File == ("quazaa_es"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(8);
	}
	//Suomi
	if (quazaaSettings.Language.File == ("quazaa_fi"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(9);
	}
	//Français
	if (quazaaSettings.Language.File == ("quazaa_fr"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(10);
	}
	//Greek
	if (quazaaSettings.Language.File == ("quazaa_gr"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(11);
	}
	//Hebrew
	if (quazaaSettings.Language.File == ("quazaa_heb"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(12);
	}
	//Hrvatski
	if (quazaaSettings.Language.File == ("quazaa_hr"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(13);
	}
	//Magyar
	if (quazaaSettings.Language.File == ("quazaa_hu"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(14);
	}
	//Italian
	if (quazaaSettings.Language.File == ("quazaa_it"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(15);
	}
	//Japanese
	if (quazaaSettings.Language.File == ("quazaa_ja"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(16);
	}
	//Lietuviu
	if (quazaaSettings.Language.File == ("quazaa_lt"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(17);
	}
	//Nederlands
	if (quazaaSettings.Language.File == ("quazaa_nl"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(18);
	}
	//Norsk
	if (quazaaSettings.Language.File == ("quazaa_no"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(19);
	}
	//Polski
	if (quazaaSettings.Language.File == ("quazaa_pl"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(20);
	}
	//Português Brasileiro
	if (quazaaSettings.Language.File == ("quazaa_pt-br"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(21);
	}
	//Russian
	if (quazaaSettings.Language.File == ("quazaa_ru"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(22);
	}
	//Slovenšcina
	if (quazaaSettings.Language.File == ("quazaa_sl-si"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(23);
	}
	//Shqip
	if (quazaaSettings.Language.File == ("quazaa_sq"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(24);
	}
	//Srpski
	if (quazaaSettings.Language.File == ("quazaa_sr"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(25);
	}
	//Svenska
	if (quazaaSettings.Language.File == ("quazaa_sv"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(26);
	}
	//Türkçe
	if (quazaaSettings.Language.File == ("quazaa_tr"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(27);
	}
	//Thai
	if (quazaaSettings.Language.File == ("quazaa_tw"))
	{
		m_ui->listWidgetLanguages->setCurrentRow(28);
	}
}
示例#27
0
WaWidget::WaWidget(int _mapping) : QWidget(WaSkin::instance()) {
    mapping = _mapping;
    setBackgroundMode(NoBackground);
    connect (WaSkinModel::instance(), SIGNAL(skinChanged()), this, SLOT(skinChanged()));
}