diff -Nru fcitx-qimpanel-configtool-0.1.4/debian/changelog fcitx-qimpanel-configtool-0.1.5/debian/changelog --- fcitx-qimpanel-configtool-0.1.4/debian/changelog 2014-03-03 03:06:14.000000000 +0000 +++ fcitx-qimpanel-configtool-0.1.5/debian/changelog 2014-03-20 11:25:16.000000000 +0000 @@ -1,3 +1,9 @@ +fcitx-qimpanel-configtool (0.1.5-0ubuntu1) trusty; urgency=low + + * New upstream release. + + -- Aron Xu Thu, 20 Mar 2014 19:24:56 +0800 + fcitx-qimpanel-configtool (0.1.4-0ubuntu2) trusty; urgency=low * Correct dependency on fcitx-ui-qimpanel diff -Nru fcitx-qimpanel-configtool-0.1.4/fcitx-qimpanel-configtool.pro fcitx-qimpanel-configtool-0.1.5/fcitx-qimpanel-configtool.pro --- fcitx-qimpanel-configtool-0.1.4/fcitx-qimpanel-configtool.pro 2013-12-18 05:51:32.000000000 +0000 +++ fcitx-qimpanel-configtool-0.1.5/fcitx-qimpanel-configtool.pro 2013-12-23 05:46:18.000000000 +0000 @@ -20,11 +20,13 @@ inst3 \ target -QT += core gui declarative +QT += core gui declarative dbus TARGET = fcitx-qimpanel-configtool -LIBS += -lfcitx-qt -lfcitx-config -lfcitx-utils +LIBS += -lfcitx-qt -lfcitx-config -lfcitx-utils -lQtDBus + +CONFIG += SOURCES += main.cpp \ mainwindow.cpp \ diff -Nru fcitx-qimpanel-configtool-0.1.4/mainwindow.cpp fcitx-qimpanel-configtool-0.1.5/mainwindow.cpp --- fcitx-qimpanel-configtool-0.1.4/mainwindow.cpp 2013-12-18 05:51:32.000000000 +0000 +++ fcitx-qimpanel-configtool-0.1.5/mainwindow.cpp 2013-12-23 05:46:18.000000000 +0000 @@ -8,6 +8,14 @@ #include #include +#include +#include +#include +#include +#include +#include + + #include "mainwindow.h" #include "ui_mainwindow.h" @@ -43,6 +51,7 @@ connect(ui->listWidgetAllSkin, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(sltOnAllSkinItemClicked(QListWidgetItem *))); connect(ui->comboBoxSkinType,SIGNAL(currentIndexChanged(int)),this,SLOT(setListWidgetAllSkinIndex(int))); + linkQtDbusServer(); } MainWindow::~MainWindow() @@ -305,7 +314,6 @@ mMainModer->emitSigMainWindowSizeChanged(); } - void MainWindow::sltOnPushButtonApply() { saveMainConf(); @@ -317,15 +325,16 @@ if(((timeFlag - currentTime) > 1)||(flag == 0)) { flag ++; - qDebug()<<"MainWindow::sltOnPushButtonApply()->killall -HUP"; +// qDebug()<<"MainWindow::sltOnPushButtonApply()->killall -HUP"; timeFlag = QTime::currentTime().secsTo(QTime(1970,1,1)); - QString cmd2 = "killall -HUP fcitx-qimpanel"; - QByteArray ba2 = cmd2.toLatin1(); - const char * transpd2 = ba2.data(); - if(0!= system(transpd2)) - { - return ; - } +// QString cmd2 = "killall -HUP fcitx-qimpanel"; +// QByteArray ba2 = cmd2.toLatin1(); +// const char * transpd2 = ba2.data(); +// if(0!= system(transpd2)) +// { +// return ; +// } + emit sigRestartQimpanel(); } } @@ -392,3 +401,56 @@ { ui->listWidgetAllSkin->setCurrentRow(index); } + +void MainWindow::linkQtDbusServer() +{ + myInterface = new QDBusInterface("com.fcitx_qimpanel.hotel", + "/", + "com.fcitx_qimpanel.hotel", + QDBusConnection::sessionBus()); + if(!myInterface->isValid()) + { + qDebug()<< qPrintable(QDBusConnection::sessionBus().lastError().message()); + } + else{ + QObject::connect(this,SIGNAL(sigRestartQimpanel()),myInterface,SLOT(qtDbusSot_restartQimpanel())); + } + + // QDBusMessage m = QDBusMessage::createMethodCall("com.fcitx_qimpanel.hotel", + // "/", + // "com.fcitx_qimpanel.hotel", + // "selectCandidate"); + // m << 8; + // QDBusMessage response = QDBusConnection::sessionBus().call(m); + // // 判断Method是否被正确返回 + // if (response.type() == QDBusMessage::ReplyMessage) { + // // QDBusMessage的arguments不仅可以用来存储发送的参数,也用来存储返回值; + // // 这里取得checkIn的返回值 + // int num_room = response.arguments().takeFirst().toInt(); + // printf("Got %d %s\n", num_room, (num_room > 1) ? "rooms" : "room"); + // } else { + // fprintf(stderr, "Check In fail!\n"); + // } +} + + + + + + + + + + + + + + + + + + + + + + diff -Nru fcitx-qimpanel-configtool-0.1.4/mainwindow.h fcitx-qimpanel-configtool-0.1.5/mainwindow.h --- fcitx-qimpanel-configtool-0.1.4/mainwindow.h 2013-12-18 05:51:32.000000000 +0000 +++ fcitx-qimpanel-configtool-0.1.5/mainwindow.h 2013-12-23 05:46:18.000000000 +0000 @@ -12,6 +12,7 @@ #include "main_model.h" #include "candidate_word.h" #include "editingskindialog.h" +#include namespace Ui { class MainWindow; @@ -43,6 +44,7 @@ QStringList systemSkin_list; QStringList localSkin_list; int idx; + QDBusInterface * myInterface; private: void searchAndSetSystemSkin( ); void searchAndSetLocalSkin( ); @@ -54,6 +56,7 @@ void showListWidgetAllSkin(); void setListWidgetAllSkin(); void refreshListWidgetAllSkin(); + void linkQtDbusServer(); private slots: void sltOnPushButtonApply(); @@ -63,6 +66,9 @@ void sltOnCurrentChanged(QWidget *tab); void on_radioButtonHorizontal_toggled(bool checked); void setListWidgetAllSkinIndex(int index); + +signals: + void sigRestartQimpanel(); }; #endif // MAINWINDOW_H diff -Nru fcitx-qimpanel-configtool-0.1.4/README.md fcitx-qimpanel-configtool-0.1.5/README.md --- fcitx-qimpanel-configtool-0.1.4/README.md 2013-12-18 05:51:32.000000000 +0000 +++ fcitx-qimpanel-configtool-0.1.5/README.md 2013-12-23 05:46:18.000000000 +0000 @@ -2,11 +2,10 @@ INSTALL -cd fcitx-qimpanel-configtool + 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 + sudo apt-get install libqt4-declarative libqt4-dev libqt4-dev-bin qt4-default qt4-dev-tools qt4-qmake qmake make