When using "/list" or "/list <params" to open Channel List dialog,
automatically request the channel list. This mimics the behavior
before the UI interception and minimizes effort needed to use the
dialog.
*
* @see Client::showChannelList()
*
*
* @see Client::showChannelList()
*
- * @param networkId Network ID for associated network
- * @param channelFilters Partial channel name to search for, or empty to show all
+ * @param networkId Network ID for associated network
+ * @param channelFilters Partial channel name to search for, or empty to show all
+ * @param listImmediately If true, immediately list channels, otherwise just show dialog
- void displayChannelList(NetworkId networkId, const QString &channelFilters = {})
+ void displayChannelList(NetworkId networkId, const QString &channelFilters = {},
+ bool listImmediately = false)
- emit showChannelList(networkId, channelFilters);
+ emit showChannelList(networkId, channelFilters, listImmediately);
*
* @see MainWin::showChannelList()
*
*
* @see MainWin::showChannelList()
*
- * @param networkId Network ID for associated network
- * @param channelFilters Partial channel name to search for, or empty to show all
+ * @param networkId Network ID for associated network
+ * @param channelFilters Partial channel name to search for, or empty to show all
+ * @param listImmediately If true, immediately list channels, otherwise just show dialog
- void showChannelList(NetworkId networkId, const QString &channelFilters = {});
+ void showChannelList(NetworkId networkId, const QString &channelFilters = {},
+ bool listImmediately = false);
+
void showIgnoreList(QString ignoreRule);
void connected();
void showIgnoreList(QString ignoreRule);
void connected();
void ClientUserInputHandler::handleList(const BufferInfo &bufferInfo, const QString &text)
{
void ClientUserInputHandler::handleList(const BufferInfo &bufferInfo, const QString &text)
{
- // Pass along any potential search parameters
- Client::instance()->displayChannelList(bufferInfo.networkId(), text);
+ // Pass along any potential search parameters, list channels immediately
+ Client::instance()->displayChannelList(bufferInfo.networkId(), text, true);
void ChannelListDlg::requestSearch()
{
void ChannelListDlg::requestSearch()
{
+ if (!_netId.isValid()) {
+ // No valid network set yet
+ return;
+ }
+
_listFinished = false;
enableQuery(false);
showErrors(false);
_listFinished = false;
enableQuery(false);
showErrors(false);
*/
void setChannelFilters(const QString &channelFilters);
*/
void setChannelFilters(const QString &channelFilters);
+public slots:
+ /**
+ * Request a channel listing using any parameters set in the UI
+ */
void receiveChannelList(const NetworkId &netId, const QStringList &channelFilters, const QList<IrcListHelper::ChannelDescription> &channelList);
void reportFinishedList();
void joinChannel(const QModelIndex &);
void receiveChannelList(const NetworkId &netId, const QStringList &channelFilters, const QList<IrcListHelper::ChannelDescription> &channelList);
void reportFinishedList();
void joinChannel(const QModelIndex &);
connect(Client::messageModel(), SIGNAL(rowsInserted(const QModelIndex &, int, int)),
SLOT(messagesInserted(const QModelIndex &, int, int)));
connect(GraphicalUi::contextMenuActionProvider(),
connect(Client::messageModel(), SIGNAL(rowsInserted(const QModelIndex &, int, int)),
SLOT(messagesInserted(const QModelIndex &, int, int)));
connect(GraphicalUi::contextMenuActionProvider(),
- SIGNAL(showChannelList(NetworkId, const QString &)),
- SLOT(showChannelList(NetworkId, const QString &)));
+ SIGNAL(showChannelList(NetworkId,QString,bool)),
+ SLOT(showChannelList(NetworkId,QString,bool)));
connect(Client::instance(),
connect(Client::instance(),
- SIGNAL(showChannelList(NetworkId, const QString &)),
- SLOT(showChannelList(NetworkId, const QString &)));
+ SIGNAL(showChannelList(NetworkId,QString,bool)),
+ SLOT(showChannelList(NetworkId,QString,bool)));
connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showNetworkConfig(NetworkId)), SLOT(showNetworkConfig(NetworkId)));
connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showIgnoreList(QString)), SLOT(showIgnoreList(QString)));
connect(Client::instance(), SIGNAL(showIgnoreList(QString)), SLOT(showIgnoreList(QString)));
connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showNetworkConfig(NetworkId)), SLOT(showNetworkConfig(NetworkId)));
connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showIgnoreList(QString)), SLOT(showIgnoreList(QString)));
connect(Client::instance(), SIGNAL(showIgnoreList(QString)), SLOT(showIgnoreList(QString)));
-void MainWin::showChannelList(NetworkId netId, const QString &channelFilters)
+void MainWin::showChannelList(NetworkId netId, const QString &channelFilters, bool listImmediately)
{
ChannelListDlg *channelListDlg = new ChannelListDlg();
{
ChannelListDlg *channelListDlg = new ChannelListDlg();
if (!channelFilters.isEmpty()) {
channelListDlg->setChannelFilters(channelFilters);
}
if (!channelFilters.isEmpty()) {
channelListDlg->setChannelFilters(channelFilters);
}
+ if (listImmediately) {
+ channelListDlg->requestSearch();
+ }
channelListDlg->show();
}
channelListDlg->show();
}
/**
* Show the channel list dialog for the network, optionally searching by channel name
*
/**
* Show the channel list dialog for the network, optionally searching by channel name
*
- * @param networkId Network ID for associated network
- * @param channelFilters Partial channel name to search for, or empty to show all
+ * @param networkId Network ID for associated network
+ * @param channelFilters Partial channel name to search for, or empty to show all
+ * @param listImmediately If true, immediately list channels, otherwise just show dialog
- void showChannelList(NetworkId netId = {}, const QString &channelFilters = {});
+ void showChannelList(NetworkId netId = {}, const QString &channelFilters = {},
+ bool listImmediately = false);
+
void showNetworkConfig(NetworkId netId = NetworkId());
void showCoreConnectionDlg();
void showCoreConfigWizard(const QVariantList &, const QVariantList &);
void showNetworkConfig(NetworkId netId = NetworkId());
void showCoreConnectionDlg();
void showCoreConfigWizard(const QVariantList &, const QVariantList &);
break;
}
case ShowChannelList:
break;
}
case ShowChannelList:
- if (networkId.isValid())
- emit showChannelList(networkId, {});
+ if (networkId.isValid()) {
+ // Don't immediately list channels, allowing customization of filter first
+ emit showChannelList(networkId, {}, false);
+ }
break;
case ShowNetworkConfig:
if (networkId.isValid())
break;
case ShowNetworkConfig:
if (networkId.isValid())
*
* @see MainWin::showChannelList()
*
*
* @see MainWin::showChannelList()
*
- * @param networkId Network ID for associated network
- * @param channelFilters Partial channel name to search for, or empty to show all
+ * @param networkId Network ID for associated network
+ * @param channelFilters Partial channel name to search for, or empty to show all
+ * @param listImmediately If true, immediately list channels, otherwise just show dialog
- void showChannelList(NetworkId, const QString &);
+ void showChannelList(NetworkId, const QString &, bool);
void showNetworkConfig(NetworkId);
void showIgnoreList(QString);
void showNetworkConfig(NetworkId);
void showIgnoreList(QString);