Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Aug 13, 2015
2 parents c16ea77 + efa62ec commit 6621171
Show file tree
Hide file tree
Showing 46 changed files with 16,735 additions and 20 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ Source code is published under GPL v3, license is available [here](https://githu

###Supported systems

* Windows XP - Windows 8.1 (**not** RT)
* Windows XP - Windows 10 (**not** RT)
* Mac OS X 10.8 - Mac OS X 10.10
* Mac OS X 10.6 - Mac OS X 10.7 (separate build)
* Ubuntu 12.04 - Ubuntu 14.04
* Fedora 22

###Third-party

Expand Down
42 changes: 24 additions & 18 deletions Telegram/SourceFiles/settingswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,9 @@ void SettingsInner::keyPressEvent(QKeyEvent *e) {
App::wnd()->showLayer(box);
from = size;
break;
} else if (qsl("debugmode").startsWith(str) || qsl("testmode").startsWith(str)) {
} else if (str == qstr("loadlang")) {
chooseCustomLang();
} else if (qsl("debugmode").startsWith(str) || qsl("testmode").startsWith(str) || qsl("loadlang").startsWith(str)) {
break;
}
++from;
Expand Down Expand Up @@ -1167,25 +1169,29 @@ void SettingsInner::onTelegramFAQ() {
QDesktopServices::openUrl(qsl("https://telegram.org/faq#general"));
}

void SettingsInner::chooseCustomLang() {
QString file;
QByteArray arr;
if (filedialogGetOpenFile(file, arr, qsl("Choose language .strings file"), qsl("Language files (*.strings)"))) {
_testlang = QFileInfo(file).absoluteFilePath();
LangLoaderPlain loader(_testlang, LangLoaderRequest(lng_sure_save_language, lng_cancel, lng_continue));
if (loader.errors().isEmpty()) {
LangLoaderResult result = loader.found();
QString text = result.value(lng_sure_save_language, langOriginal(lng_sure_save_language)),
save = result.value(lng_continue, langOriginal(lng_continue)),
cancel = result.value(lng_cancel, langOriginal(lng_cancel));
ConfirmBox *box = new ConfirmBox(text, save, cancel);
connect(box, SIGNAL(confirmed()), this, SLOT(onSaveTestLang()));
App::wnd()->showLayer(box);
} else {
App::wnd()->showLayer(new ConfirmBox("Custom lang failed :(\n\nError: " + loader.errors(), true, lang(lng_close)));
}
}
}

void SettingsInner::onChangeLanguage() {
if ((_changeLanguage.clickModifiers() & Qt::ShiftModifier) && (_changeLanguage.clickModifiers() & Qt::AltModifier)) {
QString file;
QByteArray arr;
if (filedialogGetOpenFile(file, arr, qsl("Choose language .strings file"), qsl("Language files (*.strings)"))) {
_testlang = QFileInfo(file).absoluteFilePath();
LangLoaderPlain loader(_testlang, LangLoaderRequest(lng_sure_save_language, lng_cancel, lng_continue));
if (loader.errors().isEmpty()) {
LangLoaderResult result = loader.found();
QString text = result.value(lng_sure_save_language, langOriginal(lng_sure_save_language)),
save = result.value(lng_continue, langOriginal(lng_continue)),
cancel = result.value(lng_cancel, langOriginal(lng_cancel));
ConfirmBox *box = new ConfirmBox(text, save, cancel);
connect(box, SIGNAL(confirmed()), this, SLOT(onSaveTestLang()));
App::wnd()->showLayer(box);
} else {
App::wnd()->showLayer(new ConfirmBox("Custom lang failed :(\n\nError: " + loader.errors(), true, lang(lng_close)));
}
}
chooseCustomLang();
} else {
App::wnd()->showLayer(new LanguageBox());
}
Expand Down
2 changes: 2 additions & 0 deletions Telegram/SourceFiles/settingswidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ class SettingsInner : public QWidget, public RPCSender, public Animated {

void showAll();

void chooseCustomLang();

void updateChatBackground();
void needBackgroundUpdate(bool tile);

Expand Down
2 changes: 2 additions & 0 deletions Telegram/SourceFiles/stdafx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,7 @@ Q_IMPORT_PLUGIN(QWbmpPlugin)
Q_IMPORT_PLUGIN(QWebpPlugin)
#elif defined Q_OS_LINUX
Q_IMPORT_PLUGIN(QComposePlatformInputContextPlugin)
Q_IMPORT_PLUGIN(QIbusPlatformInputContextPlugin)
Q_IMPORT_PLUGIN(QFcitxPlatformInputContextPlugin)
Q_IMPORT_PLUGIN(QWebpPlugin)
#endif
5 changes: 4 additions & 1 deletion Telegram/Telegram.pro
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,10 @@ INCLUDEPATH += "/usr/include/dee-1.0"
INCLUDEPATH += "/usr/include/libdbusmenu-glib-0.4"

LIBS += -lcrypto -lssl -lz -ldl -llzma -lexif -lopenal -lavformat -lavcodec -lswresample -lavutil -lopus
LIBS += ./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.a
LIBS += ./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.a \
./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libibusplatforminputcontextplugin.a \
./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.a
LIBS += /usr/local/lib/libxkbcommon.a

RESOURCES += \
./SourceFiles/telegram.qrc \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
TARGET = composeplatforminputcontextplugin

PLUGIN_TYPE = platforminputcontexts
PLUGIN_EXTENDS = -
PLUGIN_CLASS_NAME = QComposePlatformInputContextPlugin
load(qt_plugin)

QT += gui-private

DEFINES += X11_PREFIX='\\"$$QMAKE_X11_PREFIX\\"'

SOURCES += $$PWD/qcomposeplatforminputcontextmain.cpp \
$$PWD/qcomposeplatforminputcontext.cpp \
$$PWD/generator/qtablegenerator.cpp \

HEADERS += $$PWD/qcomposeplatforminputcontext.h \
$$PWD/generator/qtablegenerator.h \

# libxkbcommon
contains(QT_CONFIG, xkbcommon-qt): {
# dont't need x11 dependency for compose key plugin
QT_CONFIG -= use-xkbcommon-x11support
# include(../../../3rdparty/xkbcommon.pri)
} else {
# LIBS += $$QMAKE_LIBS_XKBCOMMON
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XKBCOMMON
}

OTHER_FILES += $$PWD/compose.json
Loading

0 comments on commit 6621171

Please sign in to comment.