From 58dac2dedc606c97abd37688bdba92b0243eb494 Mon Sep 17 00:00:00 2001 From: Johann Latocha Date: Wed, 2 Mar 2011 17:27:07 +0100 Subject: window manager intergration removed --- default.desktop | 2 +- src/command_line_options.cpp | 4 ---- src/dialog.cpp | 22 ++-------------------- src/dialog.h | 3 +-- src/main.cpp | 10 +--------- 5 files changed, 5 insertions(+), 36 deletions(-) diff --git a/default.desktop b/default.desktop index 5fc208e..ab2c948 100644 --- a/default.desktop +++ b/default.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Name=RZ VMChooser Comment=This session logs you into VMChooser -Exec=vmchooser --windowmgr openbox +Exec=vmchooser TryExec=vmchooser Icon= Type=Applicatio \ No newline at end of file diff --git a/src/command_line_options.cpp b/src/command_line_options.cpp index 532612d..2127c4f 100644 --- a/src/command_line_options.cpp +++ b/src/command_line_options.cpp @@ -12,7 +12,6 @@ CommandLineOptions::CommandLineOptions(int argc, char * const argv[]) { {"xpath", required_argument, NULL, 'x'}, {"size", required_argument, NULL, 's'}, {"version", no_argument, NULL, 'v'}, - {"windowmgr", required_argument, NULL, 'w' }, {"help", no_argument, NULL, 'h'}, {0, 0, 0, 0} }; @@ -42,9 +41,6 @@ CommandLineOptions::CommandLineOptions(int argc, char * const argv[]) { case 'v': options.insert("version", "version"); break; - case 'w': - options.insert("windowmgr", optarg); - break; case 'h': options.insert("usage", "usage"); break; diff --git a/src/dialog.cpp b/src/dialog.cpp index f2765ac..6100d8c 100644 --- a/src/dialog.cpp +++ b/src/dialog.cpp @@ -6,21 +6,11 @@ #include "save_restore_session.h" #include "sessiontreeitem.h" -Dialog::Dialog(QString windowmgr, QWidget *parent) +Dialog::Dialog(QWidget *parent) : QDialog(parent), ui(new Ui::Dialog) { model_ = new SessionTreeModel(parent); ui->setupUi(this); - windowmgr_ = new QProcess(this); - // start window manager - if (windowmgr != "") { - windowmgr_->start(windowmgr); - windowmgr_->waitForStarted(3000); - if (windowmgr_->error() == QProcess::FailedToStart) - QMessageBox::warning(this, tr("Warning"), - tr("Window manager '") + windowmgr + tr("' couldn't be started!")); - } - QDBusConnection dbus = QDBusConnection::sessionBus(); ifaceDBus_ = new OrgOpenslxPvsInterface("org.openslx.pvs", "/", dbus, this); @@ -43,8 +33,6 @@ Dialog::~Dialog() { delete ui; delete model_; delete ifaceDBus_; - windowmgr_->terminate(); - windowmgr_->waitForFinished(3000); } void Dialog::changeEvent(QEvent *e) { @@ -70,18 +58,12 @@ void Dialog::on_treeView_activated(QModelIndex index) { return; } - setVisible(false); - if (s->type() == Session::XSESSION) { - windowmgr_->terminate(); - windowmgr_->waitForFinished(3000); - windowmgr_->kill(); - } - if (s->run()) { if (ifaceDBus_->isValid()) { writePVSSettings(); } writeSessionName(s->shortDescription()); + setVisible(false); } else { QMessageBox::warning( diff --git a/src/dialog.h b/src/dialog.h index ed1b49c..1b2e7c9 100644 --- a/src/dialog.h +++ b/src/dialog.h @@ -15,7 +15,7 @@ namespace Ui { class Dialog : public QDialog { Q_OBJECT public: - explicit Dialog(QString windowmgr = "", QWidget *parent = 0); + explicit Dialog(QWidget *parent = 0); ~Dialog(); void addItems(const QList&, const QString& section); void selectSession(const QString& name); @@ -28,7 +28,6 @@ class Dialog : public QDialog { Ui::Dialog *ui; SessionTreeModel *model_; OrgOpenslxPvsInterface *ifaceDBus_; - QProcess *windowmgr_; void readPVSSettings(); void writePVSSettings(); diff --git a/src/main.cpp b/src/main.cpp index 83525a6..6264923 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -38,7 +38,6 @@ int main(int argc, char *argv[]) { " -p, --path path to vmware .xml files\n" " -x, --xpath path of X Session .desktop files\n" " -s, --size window size x\n" - " -w, --windowmgr use window manager\n" " -v, --version print version and exit\n" " -h, --help print usage information and exit\n" "\nFILE can be a vmware .xml or an X .desktop file\n") @@ -92,13 +91,6 @@ int main(int argc, char *argv[]) { } } - // TODO: parse args => command_line_options.cpp - QString windowmgr; - if (cmdOptions.contains("windowmgr")) { - windowmgr = cmdOptions.value("windowmgr"); - } - - // read configuration file: // file supplied as command line option or // user vmchooser.conf or @@ -171,7 +163,7 @@ int main(int argc, char *argv[]) { QList xsessions(XSession::readSessions(xSessionPath)); QList vsessions(VSession::readXmlDir(vSessionPath)); - Dialog w(windowmgr); + Dialog w; w.resize(width, height); if (xsessions.empty() && vsessions.empty()) { std::cerr << a.translate( -- cgit v1.2.3-55-g7522