pax_global_header 0000666 0000000 0000000 00000000064 12255747052 0014523 g ustar 00root root 0000000 0000000 52 comment=350ebc1817ceaff21aeb7b170d5240cd48590e45
fcitx-qimpanel-configtool-fcitx-qimpanel-configtool-0.1.5/ 0000775 0000000 0000000 00000000000 12255747052 0023670 5 ustar 00root root 0000000 0000000 fcitx-qimpanel-configtool-fcitx-qimpanel-configtool-0.1.5/.gitignore 0000664 0000000 0000000 00000000216 12255747052 0025657 0 ustar 00root root 0000000 0000000 *~
build*/
.*
!.git*
.git/
*.tar.*
*.kdev4
*.kate-swp
*.orig
tags
Makefile
fcitx-qimpanel-configtool
*.o
astyle.sh
cscope.*
*.part
*.pro.user
fcitx-qimpanel-configtool-fcitx-qimpanel-configtool-0.1.5/LICENSE 0000664 0000000 0000000 00000000000 12255747052 0024663 0 ustar 00root root 0000000 0000000 fcitx-qimpanel-configtool-fcitx-qimpanel-configtool-0.1.5/README.md 0000664 0000000 0000000 00000000606 12255747052 0025151 0 ustar 00root root 0000000 0000000 fcitx-qimpanel-configtool
INSTALL
cd fcitx-qimpanel-configtool
sudo apt-get install build-essential
sudo apt-get install fcitx-libs-dev
sudo apt-get install libqt4-declarative libqt4-dev libqt4-dev-bin qt4-default qt4-dev-tools qt4-qmake
qmake
make
sudo make install
========================
A qt4.8 based configurae tool for fcitx-qimpanel.
This is a qt-creator project.
fcitx-qimpanel-configtool-fcitx-qimpanel-configtool-0.1.5/TODO 0000664 0000000 0000000 00000000050 12255747052 0024353 0 ustar 00root root 0000000 0000000 1,横排竖排
2,当前使用皮肤
fcitx-qimpanel-configtool-fcitx-qimpanel-configtool-0.1.5/candidate_word.cpp 0000664 0000000 0000000 00000002171 12255747052 0027344 0 ustar 00root root 0000000 0000000 /*
* Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd.
*
* Authors:
* lenky gao lenky0401@gmail.com/gaoqunkai@ubuntukylin.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "candidate_word.h"
#include
void CandidateWord::setCddLabel(const QString label) {
mCddLabel = label;
emit cddLabelChanged();
}
void CandidateWord::setCddText(const QString text) {
mCddText = text;
emit cddTextChanged();
}
QString CandidateWord::cddLabel() const {
return mCddLabel;
}
QString CandidateWord::cddText() const {
return mCddText;
}
fcitx-qimpanel-configtool-fcitx-qimpanel-configtool-0.1.5/candidate_word.h 0000664 0000000 0000000 00000003120 12255747052 0027004 0 ustar 00root root 0000000 0000000 /*
* Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd.
*
* Authors:
* lenky gao lenky0401@gmail.com/gaoqunkai@ubuntukylin.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef __CANDIDATE_WORD_H__
#define __CANDIDATE_WORD_H__
#include
#include
#include
class CandidateWord : public QObject
{
Q_OBJECT
Q_PROPERTY(QString cddLabel READ cddLabel WRITE setCddLabel
NOTIFY cddLabelChanged)
Q_PROPERTY(QString cddText READ cddText WRITE setCddText
NOTIFY cddTextChanged)
public:
void setCddLabel(const QString label);
QString cddLabel() const;
void setCddText(const QString text);
QString cddText() const;
signals:
void cddLabelChanged();
void cddTextChanged();
private:
QString mCddLabel; //存放标号字符串,比如“1.”,“2.”,“3.”,“4.”,“5.”
QString mCddText; //存放候选词字符串,比如“啊”,“阿”,“吖”,“呵”,“腌”
};
#endif // __CANDIDATE_WORD_H__
fcitx-qimpanel-configtool-fcitx-qimpanel-configtool-0.1.5/editingskindialog.cpp 0000664 0000000 0000000 00000032376 12255747052 0030077 0 ustar 00root root 0000000 0000000 #include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "editingskindialog.h"
#include "ui_editingskindialog.h"
#define FCITXSKINSYSTEM_PATH "/usr/share/fcitx-qimpanel/skin/"
EditingSkinDialog::EditingSkinDialog(bool pHorizontal,QListWidgetItem *item,
QWidget *parent) :
QDialog(parent),
ui(new Ui::EditingSkinDialog)
{
ui->setupUi(this);
localPath = qgetenv("HOME") + "/.config/fcitx-qimpanel/skin/";
ui->EditingSkinTabWidget->setCurrentIndex(0);
mItem = item;
mHorizontal = pHorizontal;
ui->lineEditSkinAuthor->setEnabled(false);
ui->lineEditSkinVersion->setEnabled(false);
this->setWindowTitle("skin/"+mItem->text()+"/fcitx_skin.conf");
if(mItem->text().indexOf("(local)")==-1)
{
mSettings = new QSettings(FCITXSKINSYSTEM_PATH + mItem->text() + "/fcitx_skin.conf",QSettings::IniFormat);
mSettings->setIniCodec("UTF-8");
}
else
{
mSettings = new QSettings(localPath + mItem->text().mid(0,mItem->text().indexOf("(local)")) + "/fcitx_skin.conf",QSettings::IniFormat);
mSettings->setIniCodec("UTF-8");
}
loadMainConf();
}
EditingSkinDialog::~EditingSkinDialog()
{
mSettings->sync();
delete mSettings;
delete mSkinFcitx;
delete ui;
}
void EditingSkinDialog::loadMainConf()
{
mSettings->beginGroup("SkinInfo");
QString skinAuthor = mSettings->value("Author").toString();
QString skinVersion = mSettings->value("Version").toString();
ui->lineEditSkinAuthor->setText(skinAuthor);
ui->lineEditSkinVersion->setText(skinVersion);
mSettings->endGroup();
mSettings->beginGroup("SkinFont");
int fontSize = mSettings->value("FontSize").toInt();
int candFontSize = mSettings->value("CandFontSize").toInt();
QString inputColor = mSettings->value("InputColor").toString();
QString indexColor = mSettings->value("IndexColor").toString();
QString firstCandColor = mSettings->value("FirstCandColor").toString();
QString otherColor = mSettings->value("OtherColor").toString();
inputColorConf = inputColor;
indexColorConf = indexColor;
firstCandColorConf = firstCandColor;
otherColorConf = otherColor;
ui->spinBoxInputFontSize->setValue(fontSize);
ui->spinBoxCandFontSize->setValue(candFontSize);
ui->pushButtonInputColor->setStyleSheet("QPushButton { background-color: " + colorToRGB(value2color(inputColor)) +";border: none;" +"}");
ui->pushButtonIndexColor->setStyleSheet("QPushButton { background-color: " + colorToRGB(value2color(indexColor)) +";border: none;" +"}");
ui->pushButtonFirstCandColor->setStyleSheet("QPushButton { background-color: " + colorToRGB(value2color(firstCandColor)) +";border: none;" +"}");
ui->pushButtonOtherCandColor->setStyleSheet("QPushButton { background-color: " + colorToRGB(value2color(otherColor)) +";border: none;" +"}");
mSettings->endGroup();
mSettings->beginGroup("SkinInputBar");
QString backImg = mSettings->value("BackImg").toString();
QString tipsImg = mSettings->value("TipsImg").toString();
int marginLeft = mSettings->value("MarginLeft").toInt();
int marginRight = mSettings->value("MarginRight").toInt();
int marginTop = mSettings->value("MarginTop").toInt();
int marginBottom = mSettings->value("MarginBottom").toInt();
int inputStringPosX = mSettings->value("InputStringPosX").toInt();
int inputStringPosY = mSettings->value("InputStringPosY").toInt();
int outputCandPosX = mSettings->value("OutputCandPosX").toInt();
int outputCandPosY = mSettings->value("OutputCandPosY").toInt();
QString backArrow = mSettings->value("BackArrow").toString();
int backArrowX = mSettings->value("BackArrowX").toInt();
int backArrowY = mSettings->value("BackArrowY").toInt();
QString forwardArrow = mSettings->value("ForwardArrow").toString();
int forwardArrowX = mSettings->value("ForwardArrowX").toInt();
int forwardArrowY = mSettings->value("ForwardArrowY").toInt();
int adjustWidth = mSettings->value("AdjustWidth").toInt();
int adjustHeight = mSettings->value("AdjustHeight").toInt();
mSettings->endGroup();
mSettings->beginGroup("SkinInputBarVertical");
int adjustWidth_v = mSettings->value("AdjustWidth").toInt();
int adjustHeight_v = mSettings->value("AdjustHeight").toInt();
QString backImg_v = mSettings->value("BackImg").toString();
int marginTop_v = mSettings->value("MarginTop").toInt();
int marginBottom_v = mSettings->value("MarginBottom").toInt();
mSettings->endGroup();
ui->lineEdit_iTipsImg->setText(tipsImg);
ui->spinBox_iLeftMargin->setValue(marginLeft);
ui->spinBox_iRightMargin->setValue(marginRight);
ui->spinBox_iInputStringPosX->setValue(inputStringPosX);
ui->spinBox_iInputStringPosY->setValue(inputStringPosY);
ui->spinBox_iOutputCandPosX->setValue(outputCandPosX);
ui->spinBox_iOutputCandPosY->setValue(outputCandPosY);
ui->lineEdit_iBackArrow->setText(backArrow);
ui->spinBox_iBackArrowX->setValue(backArrowX);
ui->spinBox_iBackArrowY->setValue(backArrowY);
ui->lineEdit_iForwardArrow->setText(forwardArrow);
ui->spinBox_iForwardArrowX->setValue(forwardArrowX);
ui->spinBox_iForwardArrowY->setValue(forwardArrowY);
if(mHorizontal == true)
{
ui->spinBox_iAdjustHeight->setValue(adjustHeight);
ui->spinBox_iAdjustWidth->setValue(adjustWidth);
ui->lineEdit_iBackImg->setText(backImg);
ui->spinBox_iTopMargin->setValue(marginTop);
ui->spinBox_iBottomMargin->setValue(marginBottom);
}
else
{
ui->spinBox_iAdjustHeight->setValue(adjustHeight_v);
ui->spinBox_iAdjustWidth->setValue(adjustWidth_v);
ui->lineEdit_iBackImg->setText(backImg_v);
ui->spinBox_iTopMargin->setValue(marginTop_v);
ui->spinBox_iBottomMargin->setValue(marginBottom_v);
}
}
void EditingSkinDialog::saveMainConf()
{
QDir *temp = new QDir;
if(false == temp->exists(localPath + mItem->text().mid(0,mItem->text().indexOf("(local)"))))
{
QString cmd = "cp -R /usr/share/fcitx-qimpanel/skin/" + mItem->text() +" "+ localPath ;
qDebug()<text().mid(0,mItem->text().indexOf("(local)")) + "/fcitx_skin.conf",QSettings::IniFormat);
mSettings->setIniCodec("UTF-8");
mSettings->beginGroup("SkinFont");
int fontSize = ui->spinBoxInputFontSize->value();
int candFontSize = ui->spinBoxCandFontSize->value();
mSettings->setValue("FontSize",fontSize);
mSettings->setValue("CandFontSize",candFontSize);
mSettings->setValue("InputColor",inputColorConf);
mSettings->setValue("IndexColor",indexColorConf);
mSettings->setValue("FirstCandColor",firstCandColorConf);
mSettings->setValue("OtherColor",otherColorConf);
mSettings->endGroup();
mSettings->beginGroup("SkinInputBar");
QString tipsImg = ui->lineEdit_iTipsImg->text();
int marginLeft = ui->spinBox_iLeftMargin->value();
int marginRight = ui->spinBox_iRightMargin->value();
int inputStringPosX = ui->spinBox_iInputStringPosX->value();
int inputStringPosY = ui->spinBox_iInputStringPosY->value();
int outputCandPosX = ui->spinBox_iOutputCandPosX->value();
int outputCandPosY = ui->spinBox_iOutputCandPosY->value();
QString backArrow = ui->lineEdit_iBackArrow->text();
int backArrowX = ui->spinBox_iBackArrowX->value();
int backArrowY = ui->spinBox_iBackArrowY->value();
QString forwardArrow = ui->lineEdit_iForwardArrow->text();
int forwardArrowX = ui->spinBox_iForwardArrowX->value();
int forwardArrowY = ui->spinBox_iForwardArrowY->value();
int marginTop = ui->spinBox_iTopMargin->value();
int marginBottom = ui->spinBox_iBottomMargin->value();
QString backImg = ui->lineEdit_iBackImg->text();
int adjustWidth = ui->spinBox_iAdjustWidth->value();
int adjustHeight = ui->spinBox_iAdjustHeight->value();
mSettings->setValue("TipsImg",tipsImg);
mSettings->setValue("MarginLeft",marginLeft);
mSettings->setValue("MarginRight",marginRight);
mSettings->setValue("InputStringPosX",inputStringPosX);
mSettings->setValue("InputStringPosY",inputStringPosY);
mSettings->setValue("OutputCandPosX",outputCandPosX);
mSettings->setValue("OutputCandPosY",outputCandPosY);
mSettings->setValue("BackArrow",backArrow);
mSettings->setValue("BackArrowX",backArrowX);
mSettings->setValue("BackArrowY",backArrowY);
mSettings->setValue("ForwardArrow",forwardArrow);
mSettings->setValue("ForwardArrowX",forwardArrowX);
mSettings->setValue("ForwardArrowY",forwardArrowY);
if(mHorizontal == true)
{
mSettings->setValue("MarginTop",marginTop);
mSettings->setValue("MarginBottom",marginBottom);
mSettings->setValue("BackImg",backImg);
mSettings->setValue("AdjustWidth",adjustWidth);
mSettings->setValue("AdjustHeight",adjustHeight);
}
mSettings->endGroup();
mSettings->beginGroup("SkinInputBarVertical");
int marginTop_v = ui->spinBox_iTopMargin->value();
int marginBottom_v = ui->spinBox_iBottomMargin->value();
QString backImg_v = ui->lineEdit_iBackImg->text();
int adjustWidth_v = ui->spinBox_iAdjustWidth->value();
int adjustHeight_v = ui->spinBox_iAdjustHeight->value();
if(mHorizontal == false)
{
mSettings->setValue("MarginTop",marginTop_v);
mSettings->setValue("MarginBottom",marginBottom_v);
mSettings->setValue("BackImg",backImg_v);
mSettings->setValue("AdjustWidth",adjustWidth_v);
mSettings->setValue("AdjustHeight",adjustHeight_v);
}
mSettings->endGroup();
mSettings->sync();
}
void EditingSkinDialog::on_pushButton_ok_released()
{
if(mItem->text().indexOf("(local)")==-1)
{
QString cmd = "cp -R /usr/share/fcitx-qimpanel/skin/" + mItem->text() +" "+ localPath ;
qDebug()<accept();
}
void EditingSkinDialog::on_pushButton_cannel_released()
{
this->close();
}
void EditingSkinDialog::on_pushButton_refresh_released()
{
if(mItem->text().indexOf("(local)")!=-1)
{
QString cmd = "rm -rf " + localPath + mItem->text().mid(0,mItem->text().indexOf("(local)"));
qDebug()<pushButtonInputColor->setStyleSheet("QPushButton { background-color: " + str +";border: none;" +"}");
}
}
void EditingSkinDialog::on_pushButtonIndexColor_released()
{
QColorDialog::setCustomColor(0,QRgb(0x0000FF));
QColor color = QColorDialog::getColor(QColor(0,0,255));
QString str;
if(color.isValid()){
str.sprintf("rgb(%d,%d,%d)",color.red(), color.green(), color.blue());
indexColorConf.sprintf("%d %d %d",color.red(),color.green(),color.blue());
ui->pushButtonIndexColor->setStyleSheet("QPushButton { background-color: " + str +";border: none;" +"}");
}
}
void EditingSkinDialog::on_pushButtonFirstCandColor_released()
{
QColorDialog::setCustomColor(0,QRgb(0x0000FF));
QColor color = QColorDialog::getColor(QColor(0,0,255));
QString str;
if(color.isValid()){
str.sprintf("rgb(%d,%d,%d)",color.red(), color.green(), color.blue());
firstCandColorConf.sprintf("%d %d %d",color.red(),color.green(),color.blue());
ui->pushButtonFirstCandColor->setStyleSheet("QPushButton { background-color: " + str +";border: none;" +"}");
}
}
void EditingSkinDialog::on_pushButtonOtherCandColor_released()
{
QColorDialog::setCustomColor(0,QRgb(0x0000FF));
QColor color = QColorDialog::getColor(QColor(0,0,255));
QString str;
if(color.isValid()){
str.sprintf("rgb(%d,%d,%d)",color.red(), color.green(), color.blue());
otherColorConf.sprintf("%d %d %d",color.red(),color.green(),color.blue());
ui->pushButtonOtherCandColor->setStyleSheet("QPushButton { background-color: " + str +";border: none;" +"}");
}
}
QString EditingSkinDialog::colorToRGB(QColor color)
{
QString str;
str.sprintf("rgb(%d,%d,%d)",color.red(), color.green(), color.blue());
return str;
}
QColor EditingSkinDialog::value2color(const QString& value)
{
QStringList list = value.split(' ');
if(list.size() < 3) {
return Qt::color0;
}
int r = list.at(0).toInt();
int g = list.at(1).toInt();
int b = list.at(2).toInt();
return QColor(r, g, b);
}
fcitx-qimpanel-configtool-fcitx-qimpanel-configtool-0.1.5/editingskindialog.h 0000664 0000000 0000000 00000002421 12255747052 0027530 0 ustar 00root root 0000000 0000000 #ifndef EDITINGSKINDIALOG_H
#define EDITINGSKINDIALOG_H
#include
#include
#include
#include
namespace Ui {
class EditingSkinDialog;
}
class EditingSkinDialog : public QDialog
{
Q_OBJECT
public:
explicit EditingSkinDialog(bool pHorizontal,QListWidgetItem *item
,QWidget *parent = 0);
~EditingSkinDialog();
private slots:
void on_pushButtonInputColor_released();
void on_pushButton_ok_released();
void on_pushButton_refresh_released();
void on_pushButton_cannel_released();
void on_pushButtonIndexColor_released();
void on_pushButtonFirstCandColor_released();
void on_pushButtonOtherCandColor_released();
private:
Ui::EditingSkinDialog *ui;
QSettings *mSettings;
SkinFcitx *mSkinFcitx;
QListWidgetItem *mItem;
int horizontalTileModeIndex;
int verticalTileModeIndex;
QString inputColorConf;
QString indexColorConf;
QString firstCandColorConf;
QString otherColorConf;
QString localPath;
bool mHorizontal;
private:
void loadMainConf();
void saveMainConf();
QString colorToRGB(QColor color);
QColor value2color(const QString& value);
void copySkinConf();
};
#endif // EDITINGSKINDIALOG_H
fcitx-qimpanel-configtool-fcitx-qimpanel-configtool-0.1.5/editingskindialog.ui 0000664 0000000 0000000 00000071743 12255747052 0027733 0 ustar 00root root 0000000 0000000
EditingSkinDialog
0
0
615
470
Dialog
-
true
480
360
2
false
SkinInfo
-
-
-
0
0
Version
-
-
-
Author
-
-
Qt::Vertical
20
288
SkinFont
-
-
-
170
0
170
16777215
FontSize
-
-
-
170
0
170
16777215
CandFontSize
-
-
-
170
0
170
16777215
InputColor
-
-
-
170
0
170
16777215
IndexColor
-
-
-
170
0
170
16777215
FirstCandColor
-
-
-
170
0
170
16777215
OtherColor
-
-
Qt::Vertical
20
148
SkinInputBar
-
true
0
0
557
660
-
-
-
170
0
170
16777215
BackImg
-
-
-
170
0
170
16777215
TipsImg
-
-
-
170
0
170
16777215
MarginLeft
-
-
-
170
0
170
16777215
MarginRight
-
-
-
170
0
170
16777215
MarginTop
-
-
-
170
0
170
16777215
MarginBottom
-
-
-
170
0
170
16777215
InputStringPosX
-
-
-
170
0
170
16777215
InputStringPosY
-
-
-
170
0
170
16777215
OutputCandPosX
-
-
-
170
0
170
16777215
OutputCandPosY
-
-
-
170
0
170
16777215
BackArrow
-
-
-
170
0
170
16777215
BackArrowX
-
-
-
170
0
170
16777215
BackArrowY
-
-
-
170
0
170
16777215
ForwardArrow
-
-
-
170
0
170
16777215
ForwardArrowX
-
-
-
170
0
170
16777215
ForwardArrowY
-
-
-
170
0
170
16777215
AdjustWidth
-
-99
-
-
170
0
170
16777215
AdjustHeight
-
-99
-
-
100
27
100
27
&Refresh
-
Qt::Horizontal
178
20
-
-
100
16777215
&Ok
-
100
16777215
0
0
&Cannel
fcitx-qimpanel-configtool-fcitx-qimpanel-configtool-0.1.5/fcitx-qimpanel-configtool.desktop 0000664 0000000 0000000 00000000465 12255747052 0032352 0 ustar 00root root 0000000 0000000 [Desktop Entry]
Name=fcitx-qimpanel-configtool
Name[zh_CN]=小企鹅皮肤配置向导
Comment=fcitx皮肤配置向导-UbuntuKylin
Exec=/usr/bin/fcitx-qimpanel-configtool
Icon=fcitx_ubuntukylin.png
StartupNotify=true
Terminal=false
Type=Application
Categories=GNOME;GTK;RasterGraphics;Viewer;Utility;Network;
fcitx-qimpanel-configtool-fcitx-qimpanel-configtool-0.1.5/fcitx-qimpanel-configtool.pro 0000664 0000000 0000000 00000002066 12255747052 0031500 0 ustar 00root root 0000000 0000000 #-------------------------------------------------
#
# Project created by QtCreator 2013-10-10T11:17:48
#
#-------------------------------------------------
ARCH = x86
inst1.files += fcitx_ubuntukylin.png
inst1.path = /usr/share/pixmaps
inst2.files += fcitx-qimpanel-configtool.desktop
inst2.path = /usr/share/applications
inst3.files += po/fcitx_skin_zh_CN.qm
inst3.path = /usr/share/fcitx-qimpanel
target.source += $$TARGET
target.path = /usr/bin
INSTALLS += inst1 \
inst2 \
inst3 \
target
QT += core gui declarative dbus
TARGET = fcitx-qimpanel-configtool
LIBS += -lfcitx-qt -lfcitx-config -lfcitx-utils -lQtDBus
CONFIG +=
SOURCES += main.cpp \
mainwindow.cpp \
main_model.cpp \
skin/skinbase.cpp \
skin/skinfcitx.cpp \
candidate_word.cpp \
editingskindialog.cpp
HEADERS += mainwindow.h \
main_model.h \
skin/skinbase.h \
kimpanelagenttype.h \
candidate_word.h \
editingskindialog.h \
skin/skinfcitx.h
FORMS += mainwindow.ui \
editingskindialog.ui
RESOURCES += \
main.qrc
OTHER_FILES +=
fcitx-qimpanel-configtool-fcitx-qimpanel-configtool-0.1.5/fcitx_ubuntukylin.png 0000664 0000000 0000000 00000004406 12255747052 0030170 0 ustar 00root root 0000000 0000000 PNG
IHDR / / B4m tEXtSoftware Adobe ImageReadyqe<