[Bug 261054] kleopatra displays an empty white screen after starting.

Tobias Koenig tokoe at kde.org
Thu Jan 13 11:41:44 GMT 2011


https://bugs.kde.org/show_bug.cgi?id=261054


Tobias Koenig <tokoe at kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED




--- Comment #3 from Tobias Koenig <tokoe kde org>  2011-01-13 12:41:33 ---
commit e7a57d6b9883b765cbde1ddc2949c7d15c371c22
branch master
Author: Tobias Koenig <tokoe at kde.org>
Date:   Thu Jan 13 12:28:52 2011 +0100

    Show a text if no certificates are loaded yet

    BUG: 261054

diff --git a/kleopatra/mainwindow_mobile.cpp b/kleopatra/mainwindow_mobile.cpp
index a44fe3e..e4cf2ab 100644
--- a/kleopatra/mainwindow_mobile.cpp
+++ b/kleopatra/mainwindow_mobile.cpp
@@ -308,6 +308,15 @@ void MainWindow::registerKeyTreeView( KeyTreeView * view )
{
     d->controller.setCurrentView( v );
     d->keyTreeView = view;
     d->tryToConnectSearchBarToKeyTreeView();
+
+    connect( v->model(), SIGNAL( rowsInserted( QModelIndex, int, int ) ),
+             SIGNAL( certificatesAvailabilityChanged() ) );
+    connect( v->model(), SIGNAL( rowsRemoved( QModelIndex, int, int ) ),
+             SIGNAL( certificatesAvailabilityChanged() ) );
+    connect( v->model(), SIGNAL( modelReset() ),
+             SIGNAL( certificatesAvailabilityChanged() ) );
+
+    emit certificatesAvailabilityChanged();
 }

 void MainWindow::registerSearchBar( SearchBar * bar ) {
@@ -382,5 +391,9 @@ void MainWindow::Private::slotSearchBarTextChanged( const
QString & text ) {
     }
 }

+bool MainWindow::certificatesAvailable() const {
+    return (d->keyTreeView && d->keyTreeView->view()->model()->rowCount());
+}
+
 #include "moc_mainwindow_mobile.cpp"
 #include "mainwindow_mobile.moc"
diff --git a/kleopatra/mainwindow_mobile.h b/kleopatra/mainwindow_mobile.h
index ecc895f..62b86f2 100644
--- a/kleopatra/mainwindow_mobile.h
+++ b/kleopatra/mainwindow_mobile.h
@@ -46,13 +46,19 @@ class QStringList;

 class MainWindow : public KDeclarativeFullScreenView {
     Q_OBJECT
+    Q_PROPERTY( bool certificatesAvailable READ certificatesAvailable NOTIFY
certificatesAvailabilityChanged )
 public:
     explicit MainWindow( QWidget * parent=0 );
     ~MainWindow();

+    bool certificatesAvailable() const;
+
 public Q_SLOTS:
     void importCertificatesFromFile( const QStringList & files );

+Q_SIGNALS:
+    void certificatesAvailabilityChanged();
+
 protected:
     /* reimp */ void doDelayedInit();
     /* reimp */ void closeEvent( QCloseEvent * );
diff --git a/kleopatra/qml/kleopatra-mobile.qml
b/kleopatra/qml/kleopatra-mobile.qml
index b5fc8e4..2417a93 100644
--- a/kleopatra/qml/kleopatra-mobile.qml
+++ b/kleopatra/qml/kleopatra-mobile.qml
@@ -63,6 +63,15 @@ KPIM.MainView {
       y       : height == 0 ? parent.height : parent.height - height
     }

+    QML.Rectangle {
+      anchors.fill : parent
+      visible : !application.certificatesAvailable
+
+      QML.Text {
+        text : KDE.i18n( "No certificates loaded yet." );
+        anchors.centerIn : parent
+      }
+    }
   }

   SlideoutPanelContainer {

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Kdepim-bugs mailing list