1101-1109

1101

1.上传ppa
2.解决 install问题和初始化的问题

上次解决的 usr/localshare的路径

-set(CALENDER_DATA_DIR “/usr/include/glib-2.0/”)
-set(CALENDER2_DATA_DIR “/usr/lib/x86_64-linux-gnu/glib-2.0/include/”)

-pkg_check_modules(CALENDAR_DEPS REQUIRED glib-2.0)
-include_directories(${CALENDAR_DEPS_INCLUDE_DIRS})
+include_directories(/usr/include/glib-2.0/ /usr/lib/x86_64-linux-gnu/glib-2.0/include/)

1102:

翻译文件最大的问题
set(PROG_SHARE_DIR ${CMAKE_INSTALL_FULL_DATAROOTDIR}/ukui/${PROGRAM})
set(UKUI_TRANSLATIONS_DIR “${CMAKE_INSTALL_FULL_DATAROOTDIR}/ukui/translations/”)

set(PLUGIN_DESKTOPS_DIR “${CMAKE_INSTALL_FULL_DATAROOTDIR}/ukui/${PROJECT}”)
归根结底的问题是
#install(DIRECTORY /usr/local/share/ukui/translations/ukui-panel
# DESTINATION /usr/local/share/lxqt/translations)

UKUI_TRANSLATIONS_DIR /usr/local/share/ukui/translations/


/usr/bin/ukui/ukui-panel/start-menu

 

 

 

1104:

急需完成;
修改固定到任务栏接口的书写,增加计数操作
增加从任务栏取消固定的接口
修改翻译文件
梳理托盘栏的代码
解决显示桌面图标无法显示图标的问题


1104总结:
完成了qdbus-server布置到源码中的任务,后续进行细节完善即可
系统图标主题的设置未成功,在ukui-panel.cpp中有关于背景颜色,字体颜色,是否锁定任务栏等设置
想要实现系统图标主题的设置也要在此处进行定义

 

 

 

 

 

1105

1.开始菜单添加函数的重写,移除函数的实现
2.翻译文件的实现
3.自适应系统图标的主题
4.关于indicators

 

 

 

1106:

开机自启动主目录文件夹
tray
图标大小的传参位置
void TrayIcon::setIconSize(QSize iconSize)


关于
bool QAbstractNativeEventFilter::nativeEventFilter(const QByteArray &eventType, void *message, long *result)
This method is called for every native event.

Note: The filter function here receives native messages, for example, MSG or XCB event structs.

It is called by the QPA platform plugin. On Windows, it is called by the event dispatcher.

The type of event eventType is specific to the platform plugin chosen at run-time, and can be used to cast message to the right type.

On X11, eventType is set to “xcb_generic_event_t”, and the message can be casted to a xcb_generic_event_t pointer.

On Windows, eventType is set to “windows_generic_MSG” for messages sent to toplevel windows, and “windows_dispatcher_MSG” for system-wide messages such as messages from a registered hot key. In both cases, the message can be casted to a MSG pointer. The result pointer is only used on Windows, and corresponds to the LRESULT pointer.

On macOS, eventType is set to “mac_generic_NSEvent”, and the message can be casted to an NSEvent pointer.

In your reimplementation of this function, if you want to filter the message out, i.e. stop it being handled further, return true; otherwise return false.

Linux example

class MyXcbEventFilter : public QAbstractNativeEventFilter
{
public:
bool nativeEventFilter(const QByteArray &eventType, void *message, long *) override
{
if (eventType == “xcb_generic_event_t”) {
xcb_generic_event_t* ev = static_cast<xcb_generic_event_t *>(message);
// …
}
return false;
}
};

 

 

 

 

 

1108:

QString filename=”firefox”;
QString exec=”firefox”;
QString iconpath=”/usr/share/icons/hicolor/128×128/apps/chromium-browser.png”;
AddToTaskbar(&filename,&exec,&iconpath);

QString filename=”baidinetdisk”;
QString exec=”baidinetdisk”;
QString iconpath=”/usr/share/icons/hicolor/128×128/apps/baidinetdisk.png”;
AddToTaskbar(&filename,&exec,&iconpath);


QString filename=”fcitx”;
QString exec=”fcitx”;
QString iconpath=”/usr/share/icons/hicolor/128×128/apps/fcitx.png”;
AddToTaskbar(&filename,&exec,&iconpath);


void UKUIQuickLaunch::addButton(QuickLaunchAction* action,QString *filename)
{

mLayout->setEnabled(false);
QuickLaunchButton* btn = new QuickLaunchButton(action, mPlugin, this);
mLayout->addWidget(btn);
mbtnmap.insert(*filename,btn);


connect(btn, SIGNAL(switchButtons(QuickLaunchButton*,QuickLaunchButton*)), this, SLOT(switchButtons(QuickLaunchButton*,QuickLaunchButton*)));
connect(btn, SIGNAL(buttonDeleted()), this, SLOT(buttonDeleted()));
connect(btn, SIGNAL(movedLeft()), this, SLOT(buttonMoveLeft()));
connect(btn, SIGNAL(movedRight()), this, SLOT(buttonMoveRight()));

mLayout->removeWidget(mPlaceHolder);
delete mPlaceHolder;
mPlaceHolder = 0;
mLayout->setEnabled(true);
realign();
}

void UKUIQuickLaunch::removeButton(QString *filename)
{
QuickLaunchButton* btn=mbtnmap.value(*filename);
int i = 0;
QLayoutItem *child;
while ((child = mLayout->layout()->itemAt(i))) {
if (child->widget() == btn) {
qDebug()<<“child >>>”<<child;
mLayout->removeItem(child);
} else {
++i;
}
}
btn->deleteLater();
saveSettings();
}

1.qt 的qmap介绍:
Map是一个很有用的数据结构。
它以“键-值”的形式保存数据。在使用的时候,通过提供字符标示(键)即可得到想要的数据。
这个“数据”即可以是一个字符串,也可以是任意对象,
当然也包括自己定义的类对象。
说明:map是以值传递的形式保存数据的。

定义:QMap<int,QString> m_map;

m_map.insert(1,”firefox”);
m_map.insert(2,”baidunetdisk”);


遍历:

2.qobject_cast 很有用的强制转换方式


3.一定要记得在类里面定义成员变量的时候不要轻易定义指针,定义了指针之后用这个类定义的对象取不到这个成员变量的值,只能取到指针

4.完成开始菜单三个接口的书写:AddToTaskbar RemoveFromTaskbar CheckIfExist
目前是通过void UKUIQuickLaunch::AddToTaskbar(QString *filename, QString *exec, QString *iconpath)
void UKUIQuickLaunch::CheckIfExist(QString *filename)
void UKUIQuickLaunch::RemoveFromTaskbar(QString *filename)
后续要将文件名重新写成desktop文件

遍历的

 

 

 

1109

1.startmenu plugin interface
2.startmenu ‘s turn pluigin (by *.so )
3.leave a space for switch
4.translations
5.showdesktop trans a icon ,not words;
6.calendar


1.TRANSLATIONS += zh_CN.ts
2.lupdate
3.lingust
2.QString locale = QLocale::system().name();
QTranslator translator;

// QString qmFile = QString(TRANSLATIONS_DIR”/%1.qm”).arg(locale);
// if (locale == “zh_CN”) {
if (translator.load(“:/zh_CN.qm”)) {
a.installTranslator(&translator);
// }
// else {
qDebug() << “Load translations file” << locale << “failed!”;
// }
}

set(UKUI_TRANSLATIONS_DIR “${CMAKE_INSTALL_FULL_DATAROOTDIR}/ukui/translations/”)

总结:解决翻译文件在打包时候的翻译问题
2.开始菜单的三个接口

发表评论

电子邮件地址不会被公开。 必填项已用*标注