[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    branches/KDE/4.8/kdesdk/lokalize/src/project
From:       Nick Shaforostoff <shafff () ukr ! net>
Date:       2012-02-22 17:02:19
Message-ID: 20120222170219.21970AC895 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1281800 by shaforo:

Add welcome widget, that is shown on Lokalize first startup (when no project is \
loaded). So we're now a bit more friendly to newbies.

CCMAIL:kde-i18n-doc@kde.org
Note to translators: It uses strings that are already translated either in Lokalize \
or in kdelibs, so be careful to use translation memory to avoid doing same work \
twice. (actually it is possible that lokalize.po won't change at all, we'll see)



 M  +61 -1     projecttab.cpp  
 M  +4 -0      projecttab.h  


--- branches/KDE/4.8/kdesdk/lokalize/src/project/projecttab.cpp #1281799:1281800
@@ -25,6 +25,7 @@
 #include "project.h"
 #include "projectwidget.h"
 #include "tmscanapi.h"
+#include "prefs.h"
 
 #include <klocale.h>
 #include <kaction.h>
@@ -42,6 +43,9 @@
 #include <QShortcut>
 #include <QSortFilterProxyModel>
 #include <QProgressBar>
+#include <QStackedLayout>
+#include <QLabel>
+#include <QPushButton>
 
 ProjectTab::ProjectTab(QWidget *parent)
     : LokalizeSubwindowBase2(parent)
@@ -52,7 +56,58 @@
 
 {
     setWindowTitle(i18nc("@title:window","Project \
Overview"));//setCaption(i18nc("@title:window","Project"),false); +//BEGIN setup \
welcome widget +    QWidget* welcomeWidget=new QWidget(this);
+    QVBoxLayout* wl=new QVBoxLayout(welcomeWidget);
+    QLabel* about = new QLabel(i18n("<html>" //copied from kaboutkdedialog_p.cpp
+        "You do not have to be a software developer to be a member of the "
+        "KDE team. You can join the national teams that translate "
+        "program interfaces. You can provide graphics, themes, sounds, and "
+        "improved documentation. You decide!"
+        "<br /><br />"
+        "Visit "
+        "<a href=\"%1\">%1</a> "
+        "for information on some projects in which you can participate."
+        "<br /><br />"
+        "If you need more information or documentation, then a visit to "
+        "<a href=\"%2\">%2</a> "
+        "will provide you with what you need.</html>",
+        QLatin1String("http://community.kde.org/Getinvolved"),
+        QLatin1String("http://techbase.kde.org/")), welcomeWidget);
+    about->setAlignment(Qt::AlignCenter);
+    about->setWordWrap(true);
+    about->setOpenExternalLinks(true);
+    about->setTextInteractionFlags(Qt::TextBrowserInteraction);
+    about->setTextFormat(Qt::RichText);
+
+    QPushButton* conf = new QPushButton(i18n("&Configure %1...", "Lokalize"), \
welcomeWidget); +    QPushButton* createProject = new \
QPushButton(i18nc("@action:inmenu","Create new project"), welcomeWidget); +    \
QPushButton* openProject = new QPushButton(i18nc("@action:inmenu","Open project"), \
welcomeWidget); +    connect(conf, SIGNAL(clicked(bool)), \
SettingsController::instance(),SLOT(showSettingsDialog())); +    connect(openProject, \
SIGNAL(clicked(bool)), this, SIGNAL(projectOpenRequested())); +    \
connect(createProject, SIGNAL(clicked(bool)), SettingsController::instance(), \
SLOT(projectCreate())); +    QHBoxLayout* wbtnl=new QHBoxLayout();
+    wbtnl->addStretch(1);
+    wbtnl->addWidget(conf);
+    wbtnl->addWidget(createProject);
+    wbtnl->addWidget(openProject);
+    wbtnl->addStretch(1);
+
+    wl->addStretch(1);
+    wl->addWidget(about);
+    wl->addStretch(1);
+    wl->addLayout(wbtnl);
+    wl->addStretch(1);
+
+
+//END setup welcome widget
+    QWidget* baseWidget=new QWidget(this);
+    m_stackedLayout = new QStackedLayout(baseWidget);
     QWidget* w=new QWidget(this);
+    m_stackedLayout->addWidget(welcomeWidget);
+    m_stackedLayout->addWidget(w);
+    connect(Project::instance(), SIGNAL(loaded()), this, \
SLOT(showRealProjectOverview())); +
     QVBoxLayout* l=new QVBoxLayout(w);
 
     
@@ -69,7 +124,7 @@
             this, SLOT(updateStatusBar(int,int,int,bool)));
     connect(Project::instance()->model(),SIGNAL(loading()),this,SLOT(initStatusBarProgress()));
  
-    setCentralWidget(w);
+    setCentralWidget(baseWidget);
 
     KHBox *progressBox = new KHBox();
     KStatusBar* statusBar = \
static_cast<LokalizeSubwindowBase2*>(parent)->statusBar(); @@ -142,6 +197,11 @@
     //kWarning()<<"destroyed";
 }
 
+void ProjectTab::showRealProjectOverview()
+{
+    m_stackedLayout->setCurrentIndex(1);
+}
+
 KUrl ProjectTab::currentUrl()
 {
     return KUrl::fromLocalFile(Project::instance()->projectDir());
--- branches/KDE/4.8/kdesdk/lokalize/src/project/projecttab.h #1281799:1281800
@@ -31,6 +31,7 @@
 
 #include <KXMLGUIClient>
 
+class QStackedLayout;
 class ProjectWidget;
 class KLineEdit;
 class QContextMenuEvent;
@@ -74,6 +75,7 @@
     ///@returns list of selected files recursively
     Q_SCRIPTABLE QStringList selectedItems() const;
     Q_SCRIPTABLE bool currentItemIsTranslationFile() const;
+    void showRealProjectOverview();
 
     //Q_SCRIPTABLE bool isShown() const;
 
@@ -105,6 +107,8 @@
     KLineEdit* m_filterEdit;
     QProgressBar* m_progressBar;
 
+    QStackedLayout *m_stackedLayout;
+
     int m_legacyUnitsCount, m_currentUnitsCount;
 };
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic