Commit a99ccb53 authored by scuq's avatar scuq

temp roster hide/show toggle with Ctrl+Right on roster window

parent 20a31f04
Pipeline #395 passed with stage
in 6 minutes and 22 seconds
......@@ -34,6 +34,7 @@ qmMainWindow::qmMainWindow(QWidget *parent) :
this->restoreWindowPositionState();
this->createActions();
this->initShortcuts();
......@@ -89,6 +90,13 @@ void qmMainWindow::createActions()
}
void qmMainWindow::initShortcuts()
{
m_rosterToggle = new QShortcut(this);
m_rosterToggle->setKey(QKeySequence(Qt::CTRL + Qt::Key_Right));
connect(m_rosterToggle, SIGNAL(activated()), this, SLOT(slRosterDisplayToggle()));
}
void qmMainWindow::loadConfig()
{
QSettings settings(company, appname);
......@@ -581,6 +589,42 @@ void qmMainWindow::slOnConnected()
this->setNetworkConnection(true);
}
void qmMainWindow::slRosterDisplayToggle()
{
qDebug() << "slRosterDisplayToggle";
switch( m_currentRosterDisplayToggleMode )
{
case rosterDisplayToggleMode::showofflineshowmuc:
this->m_mp->setRosterHideMuc(false);
this->m_mp->setRosterHideOffline(false);
this->m_currentRosterDisplayToggleMode = rosterDisplayToggleMode::showofflinehidemuc;
break ;
case rosterDisplayToggleMode::showofflinehidemuc:
this->m_mp->setRosterHideMuc(true);
this->m_mp->setRosterHideOffline(false);
this->m_currentRosterDisplayToggleMode = rosterDisplayToggleMode::hideofflineshowmuc;
break ;
case rosterDisplayToggleMode::hideofflineshowmuc:
this->m_mp->setRosterHideMuc(false);
this->m_mp->setRosterHideOffline(true);
this->m_currentRosterDisplayToggleMode = rosterDisplayToggleMode::hideofflinehidemuc;
break ;
case rosterDisplayToggleMode::hideofflinehidemuc:
this->m_mp->setRosterHideMuc(true);
this->m_mp->setRosterHideOffline(true);
this->m_currentRosterDisplayToggleMode = rosterDisplayToggleMode::showofflineshowmuc;
break ;
}
this->m_mp->apply();
}
void qmMainWindow::slExit()
{
this->disconnectSessions();
......@@ -711,3 +755,4 @@ void qmMainWindow::slOnLoggedOut(QString accountname)
}
}
......@@ -10,6 +10,7 @@
#include <QDesktopServices>
#include <QHBoxLayout>
#include <QLabel>
#include <QShortcut>
#include <QPainter>
#include <QPixmap>
#include <QPushButton>
......@@ -47,9 +48,19 @@ public:
void setNetworkConnection(bool value);
private:
enum class rosterDisplayToggleMode {
showofflineshowmuc = 1,
showofflinehidemuc = 2,
hideofflineshowmuc = 3,
hideofflinehidemuc = 4
};
rosterDisplayToggleMode m_currentRosterDisplayToggleMode;
void printDebugSslLib();
void setupDialogs();
void createActions();
void initShortcuts();
void loadConfig();
void loadTheme(QString theme);
void setupTableViews();
......@@ -78,6 +89,7 @@ private:
QMap<QString, dialogChat*> chatDialogs;
updateCheck *uc;
QMap<QString, QVariant> m_chatSettings;
QShortcut *m_rosterToggle;
bool updateQuestionShown;
bool closeToTray;
bool networkConnection;
......@@ -118,6 +130,8 @@ private slots:
void slOnDisconnected();
void slOnConnected();
void slRosterDisplayToggle();
void slExit();
void slShow();
void slUnreadsPending();
......@@ -139,6 +153,7 @@ private slots:
void slOnLoggedOut(QString accountname);
private:
Ui::qmMainWindow *ui;
qreal dotsPerInch;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment