From cfb6f6d2d233f77fc6bea846486b2ab54fc32e2d Mon Sep 17 00:00:00 2001 From: Orcan Ogetbil Date: Sun, 21 Nov 2010 21:20:13 +0000 Subject: ported .ui widgets to Qt4 --- muse2/ChangeLog | 1 + muse2/muse/app.cpp | 2 +- muse2/muse/transpose.cpp | 15 +- muse2/muse/transpose.h | 11 +- muse2/muse/widgets/CMakeLists.txt | 5 +- muse2/muse/widgets/didyouknow.h | 37 +++ muse2/muse/widgets/didyouknow.ui | 192 +++++++-------- muse2/muse/widgets/transposebase.ui | 473 +++++++++++++++++------------------- 8 files changed, 377 insertions(+), 359 deletions(-) create mode 100644 muse2/muse/widgets/didyouknow.h diff --git a/muse2/ChangeLog b/muse2/ChangeLog index 40292831..dbb8a4f9 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -1,6 +1,7 @@ 21.11.2010 - All menus now use QActions. Some shortcuts are left to be assigned correctly (Orcan) - Clean up: Remove submenu integer ids from the MusE class in favor of QActions (Orcan) + - Ported the following .ui widgets to Qt4: didyouknow, transposebase (Orcan) 20.11.2010 - Remove most wrapper classes around .ui widgets. I was wrapping them too much. Some widgets (e.g. songinfo) still need wrappers though. (Orcan) diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index 941d9e5d..d9beef13 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -3302,7 +3302,7 @@ void MusE::showDidYouKnowDialog() { if ((bool)config.showDidYouKnow == true) { printf("show did you know dialog!!!!\n"); - DidYouKnow dyk; + DidYouKnowWidget dyk; dyk.tipText->setText("To get started with MusE why don't you try some demo songs available at http://demos.muse-sequencer.org/"); dyk.show(); if( dyk.exec()) { diff --git a/muse2/muse/transpose.cpp b/muse2/muse/transpose.cpp index 3090b450..3462dfc4 100644 --- a/muse2/muse/transpose.cpp +++ b/muse2/muse/transpose.cpp @@ -2,7 +2,6 @@ #include #include #include -#include #include #include "transpose.h" #include "track.h" @@ -14,15 +13,23 @@ // Transpose //--------------------------------------------------------- -Transpose::Transpose(QWidget* parent, const char* name) - : TransposeDialogBase(parent, name) +Transpose::Transpose(QWidget* parent) + : QDialog(parent) { + setupUi(this); + buttonGroup1 = new QButtonGroup(this); + buttonGroup1->addButton(time_all); + buttonGroup1->addButton(time_selected); + buttonGroup2 = new QButtonGroup(this); + buttonGroup2->addButton(parts_all); + buttonGroup2->addButton(parts_selected); + if (song->lpos() != song->rpos()) { time_selected->setChecked(true); } else { // time_all->setChecked(true); - ButtonGroup1->setEnabled(false); + ButtonBox1->setEnabled(false); } // parts_all->setSelected(true); } diff --git a/muse2/muse/transpose.h b/muse2/muse/transpose.h index a5e004f8..a5d2a1bb 100644 --- a/muse2/muse/transpose.h +++ b/muse2/muse/transpose.h @@ -2,20 +2,25 @@ #ifndef __TRANSPOSE_H__ #define __TRANSPOSE_H__ -#include "transposebase.h" +#include "ui_transposebase.h" + +class QButtonGroup; //--------------------------------------------------------- // transpose widget //--------------------------------------------------------- -class Transpose : public TransposeDialogBase { +class Transpose : public QDialog, public Ui::TransposeDialogBase { Q_OBJECT + QButtonGroup* buttonGroup1; + QButtonGroup* buttonGroup2; + private slots: virtual void accept(); public: - Transpose(QWidget* parent=0, const char* name=0); + Transpose(QWidget* parent=0); }; #endif diff --git a/muse2/muse/widgets/CMakeLists.txt b/muse2/muse/widgets/CMakeLists.txt index b4b304f2..d91e362d 100644 --- a/muse2/muse/widgets/CMakeLists.txt +++ b/muse2/muse/widgets/CMakeLists.txt @@ -129,12 +129,14 @@ QT4_WRAP_CPP (widget_mocs vscale.h action.h songinfo.h + didyouknow.h ) QT4_WRAP_UI (UIC aboutbox.ui appearancebase.ui commentbase.ui + didyouknow.ui editnotedialogbase.ui editsysexdialogbase.ui fdialogbuttons.ui @@ -147,6 +149,7 @@ QT4_WRAP_UI (UIC shortcutconfigbase.ui songinfo.ui transformbase.ui + transposebase.ui velocitybase.ui ) @@ -155,14 +158,12 @@ QT4_WRAP_UI (UIC QT4_WRAP_UI3 (widget_ui_headers midisync.ui gensetbase.ui - transposebase.ui synthconfigbase.ui editctrl7dialogbase.ui editmetadialogbase.ui gatetimebase.ui wtrackinfobase.ui cliplisteditorbase.ui - didyouknow.ui configmidifilebase.ui ) diff --git a/muse2/muse/widgets/didyouknow.h b/muse2/muse/widgets/didyouknow.h new file mode 100644 index 00000000..7dbc03c5 --- /dev/null +++ b/muse2/muse/widgets/didyouknow.h @@ -0,0 +1,37 @@ +//============================================================================= +// MusE +// Linux Music Editor +// $Id: didyouknow.h,v 1.0.0.0 2010/11/21 01:01:01 ogetbilo Exp $ +// +// Copyright (C) 1999-2010 by Werner Schweer and others +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//============================================================================= + +#include "ui_didyouknow.h" + +class QDialog; + + +//--------------------------------------------------------- +// DidYouKnowWidget +// Wrapper around Ui::DidYouKnow +//--------------------------------------------------------- + +class DidYouKnowWidget : public QDialog, public Ui::DidYouKnow +{ + Q_OBJECT + + public: + DidYouKnowWidget(QDialog *parent = 0) : QDialog(parent) { setupUi(this); } +}; diff --git a/muse2/muse/widgets/didyouknow.ui b/muse2/muse/widgets/didyouknow.ui index 005fa7b6..ee7bab6a 100644 --- a/muse2/muse/widgets/didyouknow.ui +++ b/muse2/muse/widgets/didyouknow.ui @@ -1,102 +1,92 @@ - -DidYouKnow - - - DidYouKnow - - - - 0 - 0 - 494 - 249 - - - - Did you know? - - - - unnamed - - - - layout6 - - - - unnamed - - - - tipText - - - true - - - - - layout5 - - - - unnamed - - - - dontShowCheckBox - - - Don't show on startup - - - - - spacer7 - - - Horizontal - - - Expanding - - - - 121 - 31 - - - - - - nextButton - - - Next tip - - - - - closeButton - - - Close - - - - - + + + DidYouKnow + + + + 0 + 0 + 494 + 249 + + + + Did you know? + + + + + + + + true + + + + + + + + + Don't show on startup + - - - - - closeButton - clicked() - DidYouKnow - accept() - - - - + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 121 + 31 + + + + + + + + Next tip + + + + + + + Close + + + + + + + + + + + qPixmapFromMimeSource + + + + closeButton + clicked() + DidYouKnow + accept() + + + 20 + 20 + + + 20 + 20 + + + + + diff --git a/muse2/muse/widgets/transposebase.ui b/muse2/muse/widgets/transposebase.ui index caca7a35..bc570b0d 100644 --- a/muse2/muse/widgets/transposebase.ui +++ b/muse2/muse/widgets/transposebase.ui @@ -1,252 +1,229 @@ - -TransposeDialogBase - - - TransposeDialogBase - - - - 0 - 0 - 289 - 317 - - - - MusE: Midi Transpose - - - - unnamed + + + TransposeDialogBase + + + + 0 + 0 + 289 + 340 + + + + MusE: Midi Transpose + + + + 6 + + + 11 + + + + + Value + + + + 6 + + + 11 + + + + + 6 - 11 + 0 - - 6 + + + + + 0 + 0 + + + + -99 + + + + + + + + 0 + 0 + + + + halftones + + + false + + + + + + + + + + + + Time + + + + 6 + + + 11 + + + + + all + + + true + + + + + + + between markers + + + + + + + + + + Parts + + + + 6 + + + 11 + + + + + all + + + true + + + + + + + + + + all in selected tracks - - - GroupBox1 - - - Value - - - - unnamed - - - 11 - - - 6 - - - - Layout2 - - - - unnamed - - - 0 - - - 6 - - - - delta - - - - 5 - 0 - 0 - 0 - - - - -99 - - - - - TextLabel1 - - - - 3 - 1 - 0 - 0 - - - - halftones - - - - - - - - - ButtonGroup1 - - - Time - - - true - - - - unnamed - - - 11 - - - 6 - - - - time_all - - - all - - - true - - - - - time_selected - - - between markers - - - - - - - ButtonGroup2 - - - Parts - - - true - - - - unnamed - - - 11 - - - 6 - - - - parts_all - - - all - - - true - - - - - parts_selected - - - - - - all in selected tracks - - - - - - - Layout3 - - - - unnamed - - - 0 - - - 6 - - - - Spacer1 - - - Horizontal - - - Expanding - - - - 20 - 20 - - - - - - okButton - - - OK - - - false - - - true - - - - - cancelButton - - - Cancel - - - - - - - - - okButton - clicked() - TransposeDialogBase - accept() - - - cancelButton - clicked() - TransposeDialogBase - reject() - - - - + + + + + + + + + 6 + + + 0 + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 20 + 20 + + + + + + + + OK + + + false + + + true + + + + + + + Cancel + + + + + + + + + qPixmapFromMimeSource + + + + okButton + clicked() + TransposeDialogBase + accept() + + + 20 + 20 + + + 20 + 20 + + + + + cancelButton + clicked() + TransposeDialogBase + reject() + + + 20 + 20 + + + 20 + 20 + + + + + -- cgit v1.2.3