From 05502e8fc767b1aeba8ea46869ef59675cec67de Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Tue, 6 Mar 2012 15:10:11 +0100 Subject: [PATCH] filter names can be defined like a:filtname to control the display order --- src/qtgui/rclmain_w.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/qtgui/rclmain_w.cpp b/src/qtgui/rclmain_w.cpp index 95e9be00..9ee89e05 100644 --- a/src/qtgui/rclmain_w.cpp +++ b/src/qtgui/rclmain_w.cpp @@ -185,7 +185,15 @@ void RclMain::init() QRadioButton *but = new QRadioButton(catgBGRP); QString catgnm = QString::fromUtf8(it->c_str(), it->length()); m_catgbutvec.push_back(*it); - but->setText(tr(catgnm.toUtf8())); + // We strip text before the first colon before setting the button name. + // This is so that the user can decide the order of buttons by naming + // the filter,ie, a:media b:messages etc. + QString but_txt = catgnm; + int colon = catgnm.indexOf(':'); + if (colon != -1) { + but_txt = catgnm.right(catgnm.size()-(colon+1)); + } + but->setText(tr(but_txt.toUtf8())); if (prefs.catgToolBar && catgCMB) catgCMB->addItem(tr(catgnm.toUtf8())); bgrphbox->addWidget(but);