summaryrefslogtreecommitdiff
path: root/muse2/muse/widgets/shortcutconfig.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'muse2/muse/widgets/shortcutconfig.cpp')
-rw-r--r--muse2/muse/widgets/shortcutconfig.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/muse2/muse/widgets/shortcutconfig.cpp b/muse2/muse/widgets/shortcutconfig.cpp
index b3288e6d..b41250e1 100644
--- a/muse2/muse/widgets/shortcutconfig.cpp
+++ b/muse2/muse/widgets/shortcutconfig.cpp
@@ -9,27 +9,28 @@
// Copyright: Mathias Lundgren (lunar_shuttle@users.sourceforge.net) (C) 2003
//
//
-#include <qpushbutton.h>
-#include <qkeysequence.h>
-//Added by qt3to4:
#include <QCloseEvent>
+#include <QKeySequence>
+
#include "shortcutconfig.h"
#include "shortcutcapturedialog.h"
#include "shortcuts.h"
-ShortcutConfig::ShortcutConfig(QWidget* parent, const char* name)
- : ShortcutConfigBase(parent, name, true)
+ShortcutConfig::ShortcutConfig(QWidget* parent)
+ : QDialog(parent)
{
- connect(cgListView, SIGNAL(selectionChanged(Q3ListViewItem* )),
- this, SLOT(categorySelChanged(Q3ListViewItem*)));
- connect(scListView, SIGNAL(selectionChanged(Q3ListViewItem* )),
- this, SLOT(shortcutSelChanged(Q3ListViewItem*)));
+ setupUi(this);
+ connect(cgListView, SIGNAL(itemActivated(QTreeWidgetItem*, int )),
+ this, SLOT(categorySelChanged(QTreeWidgetItem*, int)));
+ connect(scListView, SIGNAL(itemActivated(QTreeWidgetItem*, int )),
+ this, SLOT(shortcutSelChanged(QTreeWidgetItem*, int)));
+
connect(defineButton, SIGNAL(pressed()), this, SLOT(assignShortcut()));
connect(clearButton, SIGNAL(pressed()), this, SLOT(clearShortcut()));
connect(applyButton, SIGNAL(pressed()), this, SLOT(assignAll()));
current_category = ALL_SHRT;
- cgListView->setSorting(SHRT_CATEGORY_COL, -1);
+ cgListView->sortItems(SHRT_CATEGORY_COL, Qt::AscendingOrder);
_config_changed = false;
//Fill up category listview:
@@ -37,7 +38,6 @@ ShortcutConfig::ShortcutConfig(QWidget* parent, const char* name)
for (int i=0; i < SHRT_NUM_OF_CATEGORIES; i++) {
newItem = new SCListViewItem(cgListView, i);
newItem->setText(SHRT_CATEGORY_COL, shortcut_category[i].name);
- cgListView->insertItem(newItem);
}
updateSCListView();
}
@@ -58,9 +58,9 @@ void ShortcutConfig::updateSCListView(int category)
void ShortcutConfig::assignShortcut()
{
- SCListViewItem* active = (SCListViewItem*) scListView->selectedItem();
+ SCListViewItem* active = (SCListViewItem*) scListView->selectedItems()[0];
int shortcutindex = active->getIndex();
- ShortcutCaptureDialog* sc = new ShortcutCaptureDialog(this, "sccapture", shortcutindex);
+ ShortcutCaptureDialog* sc = new ShortcutCaptureDialog(this, shortcutindex);
int key = sc->exec();
delete(sc);
if (key != Rejected) {
@@ -75,7 +75,7 @@ void ShortcutConfig::assignShortcut()
void ShortcutConfig::clearShortcut()
{
- SCListViewItem* active = (SCListViewItem*) scListView->selectedItem();
+ SCListViewItem* active = (SCListViewItem*) scListView->selectedItems()[0];
int shortcutindex = active->getIndex();
shortcuts[shortcutindex].key = 0; //Cleared
active->setText(SHRT_SHRTCUT_COL,"");
@@ -84,14 +84,14 @@ void ShortcutConfig::clearShortcut()
_config_changed = true;
}
-void ShortcutConfig::categorySelChanged(Q3ListViewItem* i)
+void ShortcutConfig::categorySelChanged(QTreeWidgetItem* i, int /*column*/)
{
SCListViewItem* item = (SCListViewItem*) i;
current_category = shortcut_category[item->getIndex()].id_flag;
updateSCListView(current_category);
}
-void ShortcutConfig::shortcutSelChanged(Q3ListViewItem* in_item)
+void ShortcutConfig::shortcutSelChanged(QTreeWidgetItem* in_item, int /*column*/)
{
defineButton->setEnabled(true);
SCListViewItem* active = (SCListViewItem*) in_item;