/***************************************************************************
- * Copyright (C) 2005-2013 by the Quassel Project *
+ * Copyright (C) 2005-2014 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#include "clientbufferviewconfig.h"
#include "clientbufferviewmanager.h"
#include "clientignorelistmanager.h"
+#include "clienttransfer.h"
+#include "clienttransfermanager.h"
#include "coreconfigwizard.h"
#include "coreconnectdlg.h"
#include "coreconnection.h"
#include "qtuimessageprocessor.h"
#include "qtuisettings.h"
#include "qtuistyle.h"
+#include "receivefiledlg.h"
#include "settingsdlg.h"
#include "settingspagedlg.h"
#include "statusnotifieritem.h"
# ifdef HAVE_PHONON
# include "phononnotificationbackend.h"
# endif
+# ifdef HAVE_LIBSNORE
+# include "snorenotificationbackend.h"
+# endif
# include "systraynotificationbackend.h"
# include "taskbarnotificationbackend.h"
#else /* HAVE_KDE */
# ifdef HAVE_PHONON
QtUi::registerNotificationBackend(new PhononNotificationBackend(this));
# endif
-# ifndef QT_NO_SYSTEMTRAYICON
+# ifdef HAVE_LIBSNORE
+ QtUi::registerNotificationBackend(new SnoreNotificationBackend(this));
+# elif !defined(QT_NO_SYSTEMTRAYICON)
QtUi::registerNotificationBackend(new SystrayNotificationBackend(this));
# endif
0, 0))->setCheckable(true);
#ifdef HAVE_KDE
- QAction *fullScreenAct = KStandardAction::fullScreen(this, SLOT(toggleFullscreen()), this, coll);
+ QAction *fullScreenAct = KStandardAction::fullScreen(this, SLOT(onFullScreenToggled()), this, coll);
#else
QAction *fullScreenAct = new Action(SmallIcon("view-fullscreen"), tr("&Full Screen Mode"), coll,
- this, SLOT(toggleFullscreen()), QKeySequence(Qt::Key_F11));
+ this, SLOT(onFullScreenToggled()), QKeySequence(Qt::Key_F11));
fullScreenAct->setCheckable(true);
#endif
- coll->addAction("ToggleFullscreen", fullScreenAct);
+ coll->addAction("ToggleFullScreen", fullScreenAct);
// Settings
QAction *configureShortcutsAct = new Action(SmallIcon("configure-shortcuts"), tr("Configure &Shortcuts..."), coll,
void MainWin::bufferViewToggled(bool enabled)
{
- if (!enabled && !isVisible()) {
+ if (!enabled && !isMinimized()) {
// hiding the mainwindow triggers a toggle of the bufferview (which pretty much sucks big time)
// since this isn't our fault and we can't do anything about it, we suppress the resulting calls
return;
void MainWin::setupViewMenuTail()
{
_viewMenu->addSeparator();
- _viewMenu->addAction(QtUi::actionCollection("General")->action("ToggleFullscreen"));
+ _viewMenu->addAction(QtUi::actionCollection("General")->action("ToggleFullScreen"));
}
connect(Client::bufferViewManager(), SIGNAL(bufferViewConfigDeleted(int)), this, SLOT(removeBufferView(int)));
connect(Client::bufferViewManager(), SIGNAL(initDone()), this, SLOT(loadLayout()));
+ connect(Client::transferManager(), SIGNAL(transferAdded(const ClientTransfer*)), SLOT(showNewTransferDlg(const ClientTransfer*)));
+
setConnectedState();
}
}
-void MainWin::toggleFullscreen()
+void MainWin::showNewTransferDlg(const ClientTransfer *transfer)
+{
+ ReceiveFileDlg *dlg = new ReceiveFileDlg(transfer, this);
+ dlg->show();
+}
+
+
+void MainWin::onFullScreenToggled()
{
- if (isFullScreen())
- showNormal();
+ // Relying on QWidget::isFullScreen is discouraged, see the KToggleFullScreenAction docs
+ // Also, one should not use showFullScreen() or showNormal(), as those reset all other window flags
+
+ QAction *action = QtUi::actionCollection("General")->action("ToggleFullScreen");
+ if (!action)
+ return;
+
+#ifdef HAVE_KDE
+ KToggleFullScreenAction *kAct = static_cast<KToggleFullScreenAction *>(action);
+ kAct->setFullScreen(this, kAct->isChecked());
+#else
+ if (action->isChecked())
+ setWindowState(windowState() | Qt::WindowFullScreen);
else
- showFullScreen();
+ setWindowState(windowState() & ~Qt::WindowFullScreen);
+#endif
}