Skip to content
This repository has been archived by the owner on Dec 17, 2017. It is now read-only.

Commit

Permalink
Translation support for lightdm greeter
Browse files Browse the repository at this point in the history
  • Loading branch information
amoskvin committed Oct 25, 2012
1 parent 2476f68 commit c0b6b46
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 19 deletions.
27 changes: 23 additions & 4 deletions razorqt-lightdm-greeter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ OPTION(ENABLE_LIGHTDM_GREETER "Build lightdm greeter" ON)
if (ENABLE_LIGHTDM_GREETER)

set(PROJECT razor-lightdm-greeter)
project($PROJECT)
project(${PROJECT})


# This HACK is here to allow greeter to be built as a standalone binary...
Expand Down Expand Up @@ -84,13 +84,16 @@ else()
)
QT4_WRAP_UI(UIS ${razor-lightdm-greeter_UIS})

set ( razor-lightdm-greeter_RSCS )
QT4_ADD_RESOURCES(RSCS ${razor-lightdm-greeter_RSCS})
set ( razor-lightdm-greeter_HDRS
mainwindow.h
loginform.h
)

set ( razor-lightdm-greeter_MOCS
mainwindow.h
loginform.h
)

QT4_WRAP_CPP(MOCS ${razor-lightdm-greeter_MOCS})

if(CMAKE_BUILD_TYPE MATCHES [Dd]ebug)
Expand All @@ -99,8 +102,24 @@ else()
configure_file(test/lightdm.conf test/lightdm.conf)
endif()

# Translations **********************************
include(RazorTranslate)
razor_translate_ts( QM_FILES
SOURCES
${razor-lightdm-greeter_HDRS}
${razor-lightdm-greeter_SRCS}
${razor-lightdm-greeter_UIS}
)
#************************************************

link_directories( ${LIGHTDM_QT_LIBRARY_DIRS} )
add_executable ( razor-lightdm-greeter ${razor-lightdm-greeter_SRCS} ${UIS} ${RSCS} ${TRS} ${MOCS} )
add_executable ( razor-lightdm-greeter
${razor-lightdm-greeter_SRCS}
${razor-lightdm-greeter_HDRS}
${razor-lightdm-greeter_UIS}
${QM_FILES}
${MOCS}
)
target_link_libraries ( razor-lightdm-greeter razorqt ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTDBUS_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${LIGHTDM_QT_LIBRARIES} )

file(GLOB DESKTOP_FILES resources/*.desktop)
Expand Down
17 changes: 7 additions & 10 deletions razorqt-lightdm-greeter/loginform.ui
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</font>
</property>
<property name="windowTitle">
<string>Dialog</string>
<string notr="true">Dialog</string>
</property>
<property name="windowOpacity">
<double>0.200000000000000</double>
Expand Down Expand Up @@ -51,7 +51,7 @@
<string notr="true"/>
</property>
<property name="text">
<string>chr-pc</string>
<string notr="true">chr-pc</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
Expand Down Expand Up @@ -102,7 +102,7 @@
<enum>QLineEdit::Password</enum>
</property>
<property name="placeholderText">
<string comment="hejsa" extracomment="Password her">password</string>
<string>password</string>
</property>
</widget>
<widget class="QPushButton" name="loginButton">
Expand Down Expand Up @@ -166,7 +166,7 @@
</rect>
</property>
<property name="text">
<string>Razor Icon</string>
<string notr="true">Razor Icon</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
Expand Down Expand Up @@ -197,17 +197,17 @@
</property>
<item>
<property name="text">
<string>Razor</string>
<string notr="true">Razor</string>
</property>
</item>
<item>
<property name="text">
<string>Gnome</string>
<string notr="true">Gnome</string>
</property>
</item>
<item>
<property name="text">
<string>Kde</string>
<string notr="true">Kde</string>
</property>
</item>
</widget>
Expand All @@ -220,9 +220,6 @@
<height>40</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
</widget>
<resources/>
Expand Down
2 changes: 2 additions & 0 deletions razorqt-lightdm-greeter/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@
#include <QtGui/QApplication>
#include <QtGui/QDesktopWidget>
#include "mainwindow.h"
#include "razortranslate.h"


int main(int argc, char *argv[])
{
QApplication a(argc, argv);
TRANSLATE_APP;

MainWindow *focusWindow = 0;
for (int i = 0; i < QApplication::desktop()->screenCount(); ++i)
Expand Down
5 changes: 0 additions & 5 deletions razorqt-power/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ set(APP_SHARE_DIR ${RAZOR_SHARE_DIR}/${PROJECT})

#************************************************

if (RUNNER_MATH)
add_definitions(-DMATH_ENABLED)
endif (RUNNER_MATH)


qt4_wrap_cpp(MOC_SOURCES ${MOC_FILES})
qt4_wrap_ui(UI_HEADERS ${UI_FILES})
qt4_add_resources(QRC_SOURCES ${QRC_FILES})
Expand Down

0 comments on commit c0b6b46

Please sign in to comment.