Make Quassel work with Qt 4.5 again
[quassel.git] / src / qtui / mainwin.cpp
index 7d38930..b35cad8 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-09 by the Quassel Project                          *
+ *   Copyright (C) 2005-2010 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -313,8 +313,9 @@ void MainWin::setupActions() {
                                           this, SLOT(showCoreInfoDlg())));
   coll->addAction("ConfigureNetworks", new Action(SmallIcon("configure"), tr("Configure &Networks..."), coll,
                                               this, SLOT(on_actionConfigureNetworks_triggered())));
+  // FIXME: use QKeySequence::Quit once we depend on Qt 4.6
   coll->addAction("Quit", new Action(SmallIcon("application-exit"), tr("&Quit"), coll,
-                                      this, SLOT(quit()), tr("Ctrl+Q")));
+                                     this, SLOT(quit()), Qt::CTRL + Qt::Key_Q));
 
   // View
   coll->addAction("ConfigureBufferViews", new Action(tr("&Configure Chat Lists..."), coll,
@@ -329,14 +330,14 @@ void MainWin::setupActions() {
   coll->addAction("ShowAwayLog", new Action(tr("Show Away Log"), coll,
                                             this, SLOT(showAwayLog())));
   coll->addAction("ToggleMenuBar", new Action(SmallIcon("show-menu"), tr("Show &Menubar"), coll,
-                                                0, 0, tr("Ctrl+M")))->setCheckable(true);
+                                                0, 0, QKeySequence(Qt::CTRL + Qt::Key_M)))->setCheckable(true);
 
   coll->addAction("ToggleStatusBar", new Action(tr("Show Status &Bar"), coll,
                                                 0, 0))->setCheckable(true);
 
   // Settings
   coll->addAction("ConfigureQuassel", new Action(SmallIcon("configure"), tr("&Configure Quassel..."), coll,
-                                                  this, SLOT(showSettingsDlg()), tr("F7")));
+                                                  this, SLOT(showSettingsDlg()), QKeySequence(Qt::Key_F7)));
 
   // Help
   coll->addAction("AboutQuassel", new Action(SmallIcon("quassel"), tr("&About Quassel"), coll,
@@ -767,9 +768,9 @@ void MainWin::loadLayout() {
   int accountId = Client::currentCoreAccount().accountId().toInt();
   QByteArray state = s.value(QString("MainWinState-%1").arg(accountId)).toByteArray();
   if(state.isEmpty()) {
-    // Make sure that the default bufferview is shown
-    if(_bufferViews.count())
-      _bufferViews.at(0)->show();
+    foreach(BufferViewDock *view, _bufferViews)
+      view->show();
+    _layoutLoaded = true;
     return;
   }