异度部落格

学习是一种生活态度。

0%

这三种输入法是Linux平台下,相当知名的的输入法,本人也都用过,这里就用过后的一点经验分享下…….

一般默认都是安装scim,scim就像MS的智能ABC一样,够用而不好用…我是一上来都把它给删了,不然貌似其他输入法很难启动了。不过scim跟程序的兼容性是最好的。

  • ibus给人的感觉跟scim很像,但是强大很多….ibus在iphone也有使用,而且现在一直在开发,感觉还是蛮有前途的,可是还是有bug,到现在还没修好阿,ibus在对Qt程序的支持还有很大的问题阿,像Linux Fetion连中文也不能输入了,太尴尬了,估计对其他的Qt程序应该也很有问题。

  • fcitx是我认为三个里面用起来最顺手的一个,它的反应速度明显比前面的两个快很多,对Gtk和Qt程序支持也没什么问题,唯一的遗憾就是他的开发貌似停了,应该说原作者不搞了(听说的),遗憾阿。

** 性能对比:**

  • 反应速度:fcitx > ibus > scim

  • 词库:ibus > fctix > scim

  • 兼容性:scim > fcitx > ibus

上面的观点是本人的个人见解阿,大牛们不要鄙视阿………….

操作系统:Ubuntu 9.04

sudo gedit ~/.wine/system.reg

搜索: LogPixels
找到的行应该是:[System//CurrentControlSet//Hardware Profiles//Current//Software//Fonts]
将其中的:
"LogPixels"=dword:00000060
改为:
"LogPixels"=dword:00000070

搜索: FontSubstitutes
找到的行应该是:[Software//Microsoft//Windows NT//CurrentVersion//FontSubstitutes]
将其中的:
"MS Shell Dlg"="Tahoma"
"MS Shell Dlg 2″="Tahoma"
改为:
"MS Shell Dlg"="SimSun"
"MS Shell Dlg 2″="SimSun"

保存,退出。

好久没写,最近东搞搞西搞搞都没怎么看 Qt,惭愧......

这里主要练习 Qt 控件的布局问题,用了三种布局方式写了个 FindFile

操作系统:Ubuntu 9.04

Qt 版本:4.5

FindFile1

#ifndef FINDFILE_H
#define FINDFILE_H
#include <QtGui/QWidget>
class QCheckBox;
class QLabel;
class QLineEdit;
class QPushButton;
class QTableWidget;
namespace Ui
{
class findfile;
}
class findfile : public QWidget
{
Q_OBJECT
public:
findfile(QWidget *parent = 0);
~findfile();
private:
Ui::findfile *ui;
QLabel *namedLabel;
QLabel *lookInLabel;
QLineEdit *namedLineEdit;
QLineEdit *lookInLineEdit;
QCheckBox *subfoldersCheckBox;
QTableWidget *tableWidget;
QLabel *messageLabel;
QPushButton *findButton;
QPushButton *stopButton;
QPushButton *closeButton;
QPushButton *helpButton;
};
#endif // FINDFILE_H
#include <QtGui>
#include "findfile.h"
#include "ui_findfile.h"
findfile::findfile(QWidget *parent)
: QWidget(parent), ui(new Ui::findfile)
{
ui->setupUi(this);
namedLabel = new QLabel(tr("&amp;Named:"),this);
namedLineEdit = new QLineEdit(this);
namedLabel->setBuddy(namedLineEdit); //Buddy ֵ
lookInLabel = new QLabel(tr("&amp;Look in:"),this);
lookInLineEdit = new QLineEdit(this);
lookInLabel->setBuddy(lookInLineEdit);
subfoldersCheckBox = new QCheckBox(tr("Include subfolders"),this);
QStringList labels;
labels << tr("Name") <<tr("In Folder") <<tr("Size")
<< tr("Modified"); //QStringList add string
tableWidget = new QTableWidget(this);
tableWidget->setColumnCount(4);
tableWidget->setHorizontalHeaderLabels(labels); //ñֶ
messageLabel = new QLabel(tr("0 files found"),this);
messageLabel->setFrameShape(QLabel::Panel); //Panel
messageLabel->setFrameShadow(QLabel::Sunken); //Sunken
findButton = new QPushButton(tr("&amp;Find"),this);
stopButton = new QPushButton(tr("&amp;Stop"),this);
closeButton =new QPushButton(tr("&amp;Close"),this);
helpButton =new QPushButton(tr("&amp;Help"),this);
connect(closeButton,SIGNAL(clicked()),this,SLOT(close()));
//ؼ
/*
void setGeometry ( int x, int y, int w, int h )
void setGeometry ( const QRect &amp; )
*/
namedLabel->setGeometry(9, 9, 50, 25);
namedLineEdit->setGeometry(65, 9, 200, 25);
lookInLabel->setGeometry(9, 40, 50, 25);
lookInLineEdit->setGeometry(65, 40, 200, 25);
subfoldersCheckBox->setGeometry(9, 71, 256, 23);
tableWidget->setGeometry(9, 100, 256, 100);
messageLabel->setGeometry(9, 206, 256, 25);
findButton->setGeometry(271, 9, 85, 32);
stopButton->setGeometry(271, 47, 85, 32);
closeButton->setGeometry(271, 84, 85, 32);
helpButton->setGeometry(271, 199, 85, 32);
setWindowTitle(tr("Find files or folders"));
setFixedSize(365,240);
}
findfile::~findfile()
{
delete ui
}

FindFile2

#ifndef FINDFILEDIALOG_H
#define FINDFILEDIALOG_H
#include <QtGui/QDialog>
class QCheckBox;
class QLabel;
class QLineEdit;
class QPushButton;
class QTableWidget;
namespace Ui
{
class FindFileDialog;
}
class FindFileDialog : public QDialog
{
Q_OBJECT
public:
FindFileDialog(QWidget *parent = 0);
~FindFileDialog();
protected:
void resizeEvent(QResizeEvent *);
private:
Ui::FindFileDialog *ui;
QLabel *namedLabel;
QLabel *lookInLabel;
QLineEdit *lookInLineEdit;
QLineEdit *namedLineEdit;
QCheckBox *subfoldersCheckBox;
QTableWidget *tableWidget;
QLabel *messageLabel;
QPushButton *findButton;
QPushButton *stopButton;
QPushButton *closeButton;
QPushButton *helpButton;
};
#endif // FINDFILEDIALOG_H
#include<QtGui>
#include "findfiledialog.h"
#include "ui_findfiledialog.h"
FindFileDialog::FindFileDialog(QWidget *parent)
: QDialog(parent), ui(new Ui::FindFileDialog)
{
ui->setupUi(this);
namedLabel = new QLabel(tr("&amp;Named:"),this);
namedLineEdit = new QLineEdit(this);
namedLabel->setBuddy(namedLineEdit);
lookInLabel = new QLabel(tr("&amp;name"),this);
lookInLineEdit = new QLineEdit(this);
lookInLabel->setBuddy(lookInLineEdit);
subfoldersCheckBox = new QCheckBox(tr("Include subfolders"),this);
QStringList labels;
labels << tr("Name") << tr("In Folder") << tr("Size") <<tr("Modified");
tableWidget = new QTableWidget(this);
tableWidget->setColumnCount(4);
tableWidget->setHorizontalHeaderLabels(labels);
messageLabel = new QLabel(tr("0 files found"),this);
messageLabel->setFrameShape(QLabel::Panel);
messageLabel->setFrameShadow(QLabel::Sunken);
findButton = new QPushButton(tr("&amp;Find"),this);
stopButton = new QPushButton(tr("Stop"),this);
closeButton = new QPushButton(tr("Close"),this);
helpButton = new QPushButton(tr("Help"),this);
connect(closeButton,SIGNAL(clicked()),this,SLOT(close()));
setWindowTitle(tr("Find Files or Folders"));
setMinimumSize(265,190);
resize(365,240);
}
FindFileDialog::~FindFileDialog()
{
delete ui;
}
void FindFileDialog::resizeEvent(QResizeEvent *)
{
int extraWidth = width()- minimumWidth();
int extraHeight = height() - minimumHeight();
namedLabel->setGeometry(9,9,50,25);
namedLineEdit->setGeometry(65,9,100+extraWidth,25);
lookInLabel->setGeometry(9,40,50,25);
lookInLineEdit->setGeometry(65,40,100+extraWidth,25);
subfoldersCheckBox->setGeometry(9,71,156+extraWidth,23);
tableWidget->setGeometry(9,100,156 + extraWidth,50 + extraHeight);
messageLabel->setGeometry(9,156 + extraHeight,156 + extraWidth,25);
findButton->setGeometry(171 + extraWidth,9,85,32);
stopButton->setGeometry(171 + extraWidth,47,85,32);
closeButton->setGeometry(171 + extraWidth,84,85,32);
helpButton->setGeometry(171 + extraWidth,149 + extraHeight,85,32);
}

FindFile3

#ifndef FINDFILEDIALOG_H
#define FINDFILEDIALOG_H
#include <QtGui/QDialog>
class QCheckBox;
class QLabel;
class QLineEdit;
class QPushButton;
class QTableWidget;
namespace Ui
{
class FindFileDialog;
}
class FindFileDialog : public QDialog
{
Q_OBJECT
public:
FindFileDialog(QWidget *parent = 0);
~FindFileDialog();
private:
Ui::FindFileDialog *ui;
QLabel *namedLabel;
QLabel *lookInLabel;
QLineEdit *lookInLineEdit;
QLineEdit *namedLineEdit;
QCheckBox *subfoldersCheckBox;
QTableWidget *tableWidget;
QLabel *messageLabel;
QPushButton *findButton;
QPushButton *stopButton;
QPushButton *closeButton;
QPushButton *helpButton;
};
#endif // FINDFILEDIALOG_H
#include <QtGui>
#include "findfiledialog.h"
#include "ui_findfiledialog.h"
FindFileDialog::FindFileDialog(QWidget *parent)
: QDialog(parent), ui(new Ui::FindFileDialog)
{
ui->setupUi(this);
namedLabel = new QLabel(tr("&amp;Named:"));
namedLineEdit = new QLineEdit;
namedLabel->setBuddy(namedLineEdit);
lookInLabel = new QLabel(tr("&amp;Look in:"));
lookInLineEdit = new QLineEdit;
lookInLabel->setBuddy(lookInLineEdit);
subfoldersCheckBox = new QCheckBox(tr("Include subfolders"));
QStringList labels;
labels << tr("Name") << tr("In Folder") << tr("Size")
<< tr("Modified");
tableWidget = new QTableWidget;
tableWidget->setColumnCount(4);
tableWidget->setHorizontalHeaderLabels(labels);
messageLabel = new QLabel(tr("0 files found"));
messageLabel->setFrameShape(QLabel::Panel);
messageLabel->setFrameShadow(QLabel::Sunken);
findButton = new QPushButton(tr("&amp;Find"));
stopButton = new QPushButton(tr("Stop"));
closeButton = new QPushButton(tr("Close"));
helpButton = new QPushButton(tr("Help"));
connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
QGridLayout *leftLayout = new QGridLayout; //网格布局
leftLayout->addWidget(namedLabel,0,0);
leftLayout->addWidget(namedLineEdit,0,1);
leftLayout->addWidget(lookInLabel,1,0);
leftLayout->addWidget(lookInLineEdit,1,1);
leftLayout->addWidget(subfoldersCheckBox,2,0,1,2);
leftLayout->addWidget(tableWidget,3,0,1,2);
leftLayout->addWidget(messageLabel,4,0,1,2);
QVBoxLayout *rightLayout = new QVBoxLayout;
rightLayout->addWidget(findButton);
rightLayout->addWidget(stopButton);
rightLayout->addWidget(closeButton);
rightLayout->addStretch();
rightLayout->addWidget(helpButton);
QHBoxLayout *mainLayout = new QHBoxLayout;
mainLayout->addLayout(leftLayout);
mainLayout->addLayout(rightLayout);
setLayout(mainLayout); //设置主层
setWindowTitle(tr("Find Files or Folders"));
}
FindFileDialog::~FindFileDialog()
{
delete ui;
}

image

PS:个人感觉第三种比较和谐..........


一个控件写了三种,我果然很闲............

  1. 启动虚拟windows xp安装VirtualBox Guest Addition。在你点击了设备菜单下面的安装增强功能后进入虚拟机系统去把光驱里面的软件安装好吧。

  2. 点击设备菜单下面的分配数据空间,添加你需要共享的文件夹路径 .进入你的虚拟机系统,右击我的电脑-》映射网络驱动器。选择vitualbox shared folders 这里可能会有点慢,耐心..

1.添加 ibus 源

加入:deb http://ppa.launchpad.net/ibus-dev/ppa/ubuntu jaunty main  这个源即可

sudo apt-get update  更新一下。

然后安装 ibus

sudo apt-get install ibus ibus-table ibus-pinyin python-ibus ibus-qt4 ibus-gtk

把这些都装上,前面的三个是必须的,ibus-qt4,ibus-gtk    这两个包可以防止出现不能进行光标跟随的问题

安装之后,im-switch -s ibus 切换到 ibus,注销一下就可以使用了。

默认不能使用于 qt 程序中需要修改

sudo gedit /etc/X11/xinit/xinput.d/ibus

添加

XIM=ibus
XIM_PROGRAM=/usr/bin/ibus
XIM_ARGS=""
GTK_IM_MODULE=ibus
QT_IM_MODULE=xim
XMODIFIERS="@im=ibus"
DEPENDS="ibus"

PS:要是不能启动,先卸载 SCIM

安装

sudo apt-get install amarok

中文界面 如果安装的 Amarok 是显示英文菜单,需要安装 KDE 的中文包才能显示中文菜单。

sudo apt-get install language-pack-kde-zh language-pack-kde-zh-base
``` bash

系统:Ubuntu 9.04

Java 版本:java 6

安装 jre

sudo apt-get install sun-java6-jre

如果空间富裕,建议安装一个 JDK。

sudo apt-get install sun-java6-jdk

提示:安装过程中需要你回答是否同意使用协议(终端中红蓝色的提示界面),此时按 tab 键至 OK,再按回车即可正常安装。

设置当前默认的 java 解释器:

sudo update-alternatives --config java

配置 JAVA 环境变量:

sudo gedit /etc/environment

在其中添加如下两行:

CLASSPATH=.:/usr/lib/jvm/java-6-sun/lib
JAVA_HOME=/usr/lib/jvm/java-6-sun

Java 中文支持

进入 java 字体目录创建一个新目录

cd /usr/lib/jvm/java-6-sun/jre/lib/fonts
sudo mkdir fallback

复制字体

sudo cp /usr/share/fonts/truetype/arphic/* /usr/lib/jvm/java-6-sun/jre/lib/fonts/fallback

加入 Medibuntu 源

sudo wget  http://www.medibuntu.org/sources.list.d/jaunty.list  -O /etc/apt/sources.list.d/medibuntu.list
sudo apt-get update &amp;&amp; sudo apt-get install medibuntu-keyring &amp;&amp; sudo apt-get update

安装 Flash 插件

sudo apt-get install adobe-flashplugin

安装多媒体解码器

- Xine多媒体引擎解码器

sudo apt-get install libxine1-ffmpeg libxine1-all-plugins libxine1-plugins w32codecs libstdc++5

- Gstreamer多媒体引擎解码器

sudo apt-get install gstreamer0.10-ffmpeg gstreamer0.10-pitfdll gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse gstreamer0.10-esd

- DVD影碟功能支持

sudo apt-get install libdvdnav4 libdvdread4 sudo /usr/share/doc/libdvdread4/install-css.sh


把终端加到右键菜单:

sudo apt-get install nautilus-open-terminal

以root权限打开文件夹

sudo apt-get install nautilus-gksu