Mailinglist Archive: yast-commit (883 mails)

< Previous Next >
[yast-commit] r57948 - in /trunk/control-center/src: main.cpp main_window.cpp main_window.h yqmodulesmodel.cpp yqmodulesmodel.h
  • From: kmachalkova@xxxxxxxxxxxxxxxx
  • Date: Wed, 08 Jul 2009 15:05:00 -0000
  • Message-id: <E1MOYhg-0005cU-IO@xxxxxxxxxxxxxxxx>
Author: kmachalkova
Date: Wed Jul 8 17:05:00 2009
New Revision: 57948

URL: http://svn.opensuse.org/viewcvs/yast?rev=57948&view=rev
Log:
Show the warning (user is not root) at startup

Modified:
trunk/control-center/src/main.cpp
trunk/control-center/src/main_window.cpp
trunk/control-center/src/main_window.h
trunk/control-center/src/yqmodulesmodel.cpp
trunk/control-center/src/yqmodulesmodel.h

Modified: trunk/control-center/src/main.cpp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/control-center/src/main.cpp?rev=57948&r1=57947&r2=57948&view=diff
==============================================================================
--- trunk/control-center/src/main.cpp (original)
+++ trunk/control-center/src/main.cpp Wed Jul 8 17:05:00 2009
@@ -1,4 +1,5 @@
#include <QApplication>
+#include <QTimer>

#include "main_window.h"

@@ -10,6 +11,9 @@
MainWindow mainWin;

mainWin.show();
+
+QTimer::singleShot(60, &mainWin, SLOT( initialMsg() ));
+
return app.exec();

}

Modified: trunk/control-center/src/main_window.cpp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/control-center/src/main_window.cpp?rev=57948&r1=57947&r2=57948&view=diff
==============================================================================
--- trunk/control-center/src/main_window.cpp (original)
+++ trunk/control-center/src/main_window.cpp Wed Jul 8 17:05:00 2009
@@ -27,6 +27,7 @@
#include <QQueue>
#include <QSettings>
#include <QStatusBar>
+#include <QMessageBox>

#include "kcategorizedsortfilterproxymodel.h"
#include "kcategorizedview.h"
@@ -235,6 +236,14 @@
d->gcsfpm->setFilterRegExp ( gr_filter );
}

+void MainWindow::initialMsg()
+{
+ if ( !d->modmodel->isRoot() )
+ QMessageBox::information(this, _("YaST2 Control Center"),
+ _("YaST2 Control Center is not running as root.\n"
+ "You will only see modules which do not require root privileges."));
+}
+
void MainWindow::readSettings()
{
QSettings settings(ORG_NAME, APP_NAME);

Modified: trunk/control-center/src/main_window.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/control-center/src/main_window.h?rev=57948&r1=57947&r2=57948&view=diff
==============================================================================
--- trunk/control-center/src/main_window.h (original)
+++ trunk/control-center/src/main_window.h Wed Jul 8 17:05:00 2009
@@ -39,6 +39,8 @@
void slotModulePressed( const QModelIndex &index );
void slotLaunchModule( const QModelIndex &index );
void slotFilterChanged();
+ void initialMsg();
+
protected:
void initActions();
void closeEvent( QCloseEvent *event);

Modified: trunk/control-center/src/yqmodulesmodel.cpp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/control-center/src/yqmodulesmodel.cpp?rev=57948&r1=57947&r2=57948&view=diff
==============================================================================
--- trunk/control-center/src/yqmodulesmodel.cpp (original)
+++ trunk/control-center/src/yqmodulesmodel.cpp Wed Jul 8 17:05:00 2009
@@ -178,6 +178,11 @@
}
}

+bool YQModulesModel::isRoot()
+{
+ return priv->userIsRoot;
+}
+
void YQModulesModel::removeEmptyGroups()
{
QStringList groups;

Modified: trunk/control-center/src/yqmodulesmodel.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/control-center/src/yqmodulesmodel.h?rev=57948&r1=57947&r2=57948&view=diff
==============================================================================
--- trunk/control-center/src/yqmodulesmodel.h (original)
+++ trunk/control-center/src/yqmodulesmodel.h Wed Jul 8 17:05:00 2009
@@ -69,6 +69,8 @@
*/
YQModuleGroupsModel * groupsModel() const;

+ bool isRoot();
+
private:
class Private;
Private *const priv;

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages