代码拉取完成,页面将自动刷新
同步操作将从 羽云工作室/WingGifEditor 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include "Dialog/mainwindow.h"
#include <DApplication>
#include <DApplicationSettings>
#include <DLog>
#include <DMessageBox>
#include <DTitlebar>
#include <DWidgetUtil>
#include <QCommandLineParser>
#include <QFileInfo>
#include <QTranslator>
DWIDGET_USE_NAMESPACE
DCORE_USE_NAMESPACE
int main(int argc, char *argv[]) {
//解决 root/ubuntu 主题样式走形
qputenv("XDG_CURRENT_DESKTOP", "Deepin");
QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
// 程序内强制添加 -platformtheme
// deepin 参数喂给 Qt 让 Qt 正确使用 Deepin 主题修复各种奇怪样式问题
QVector<char *> fakeArgs(argc + 2);
char fa1[] = "-platformtheme";
char fa2[] = "deepin";
fakeArgs[0] = argv[0];
fakeArgs[1] = fa1;
fakeArgs[2] = fa2;
for (int i = 1; i < argc; i++)
fakeArgs[i + 2] = argv[i];
int fakeArgc = argc + 2;
DApplication a(fakeArgc, fakeArgs.data());
QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
auto s = a.applicationDirPath() + "/lang/default.qm";
QTranslator translator;
if (!translator.load(s)) {
DMessageBox::critical(nullptr, "Error", "Error Loading Translation File!",
DMessageBox::Ok);
return -1;
}
a.installTranslator(&translator);
a.setOrganizationName("WingCloud");
a.setApplicationName("WingGifEditor");
a.setApplicationVersion("1.1.2");
a.setProductIcon(QIcon(":/images/icon.png"));
a.setProductName(QObject::tr("WingGifEditor"));
a.setApplicationDescription(
QObject::tr("A tiny easy2use gif editor for Deepin"));
a.loadTranslator();
a.setApplicationDisplayName(QObject::tr("WingGifEditor"));
QCommandLineParser parser;
parser.process(a);
QStringList arguments = parser.positionalArguments();
QString filename;
if (arguments.count() > 0)
filename = QFileInfo(arguments.first()).absoluteFilePath();
// 保存程序的窗口主题设置
DApplicationSettings as;
Q_UNUSED(as)
DLogManager::registerFileAppender();
DLogManager::registerConsoleAppender();
MainWindow w;
if (filename.length() && w.checkIsGif(filename))
w.openGif(filename);
w.show();
Dtk::Widget::moveToCenter(&w);
return a.exec();
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。