diff options
author | Orcan Ogetbil <oget.fedora@gmail.com> | 2010-11-19 09:21:24 +0000 |
---|---|---|
committer | Orcan Ogetbil <oget.fedora@gmail.com> | 2010-11-19 09:21:24 +0000 |
commit | 3b63d9a339d8e850ba6d8e4ae979fa60eef2dc4d (patch) | |
tree | 0e65608c4d744dae5cb2a823a0c5288ceafdebc2 | |
parent | 9f4fe43ebc85153566661f6cd38fdb0b29f60e04 (diff) |
Move filedialog's .xpm files to the right place. Convert commentbase to Qt4
-rw-r--r-- | muse2/ChangeLog | 3 | ||||
-rw-r--r-- | muse2/muse/CMakeLists.txt | 1 | ||||
-rw-r--r-- | muse2/muse/icons.cpp | 18 | ||||
-rw-r--r-- | muse2/muse/icons.h | 4 | ||||
-rw-r--r-- | muse2/muse/icons.qrc | 7 | ||||
-rw-r--r-- | muse2/muse/widgets/CMakeLists.txt | 2 | ||||
-rw-r--r-- | muse2/muse/widgets/comment.cpp | 15 | ||||
-rw-r--r-- | muse2/muse/widgets/comment.h | 23 | ||||
-rw-r--r-- | muse2/muse/widgets/commentbase.ui | 207 | ||||
-rw-r--r-- | muse2/muse/widgets/filedialog.cpp | 7 | ||||
-rw-r--r-- | muse2/xpm/global.xpm (renamed from muse2/muse/global.xpm) | 2 | ||||
-rw-r--r-- | muse2/xpm/project.xpm (renamed from muse2/muse/project.xpm) | 2 | ||||
-rw-r--r-- | muse2/xpm/user.xpm (renamed from muse2/muse/user.xpm) | 2 |
13 files changed, 147 insertions, 146 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog index c4e749b8..cb453a5a 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -1,6 +1,9 @@ 19.11.2010 - Started some conversions of midieditor, pianoroll, drumedit, incl. their QGridLayouts. (Tim) - More icon conversion work (Orcan) + - Move global, user, project .xpm files into the xpm/ directory. Handle them the same way in + filedialog.cpp as we handle other pixmaps elsewhere. (Orcan) + - Ported the following .ui widgets to Qt4: commentbase (Orcan) 18.11.2010 - Updated build part README file - read it! Tell user to specify Release build type. (Tim) - Added printout of build type in top level cmake. (Tim) diff --git a/muse2/muse/CMakeLists.txt b/muse2/muse/CMakeLists.txt index 8e1a8767..14c96a7a 100644 --- a/muse2/muse/CMakeLists.txt +++ b/muse2/muse/CMakeLists.txt @@ -117,7 +117,6 @@ QT4_WRAP_CPP ( muse_moc_headers QT4_ADD_RESOURCES (muse_qrc_files muse.qrc - icons.qrc ) add_executable ( muse diff --git a/muse2/muse/icons.cpp b/muse2/muse/icons.cpp index efe70801..c949b4d3 100644 --- a/muse2/muse/icons.cpp +++ b/muse2/muse/icons.cpp @@ -209,6 +209,10 @@ #include "xpm/stereo.xpm" #include "xpm/muse_icon.xpm" +#include "xpm/global.xpm" +#include "xpm/project.xpm" +#include "xpm/user.xpm" + #if QT_VERSION >= 0x040600 #define MPIXMAP(a,b) QPixmap(QIcon::fromTheme(b, QIcon(QPixmap(a))).pixmap(QPixmap(a).width(),QPixmap(a).height())) #define MICON(a,b) QIcon(QIcon::fromTheme(b, QIcon(QPixmap(a)))) @@ -420,6 +424,10 @@ QPixmap* monoIcon; QPixmap* stereoIcon; QPixmap* museIcon; +QIcon* globalIcon; +QIcon* projectIcon; +QIcon* userIcon; + //--------------------------------------------------------- // initIcons //--------------------------------------------------------- @@ -622,9 +630,13 @@ void initIcons() view_mixerIcon = new MPIXMAP(view_mixer_xpm, NULL); view_transport_windowIcon = new MPIXMAP(view_transport_window_xpm, NULL); - monoIcon = new MPIXMAP(mono_xpm, NULL); - stereoIcon = new MPIXMAP(stereo_xpm, NULL); + monoIcon = new MPIXMAP(mono_xpm, NULL); + stereoIcon = new MPIXMAP(stereo_xpm, NULL); + + museIcon = new MPIXMAP(muse_icon_xpm, NULL); - museIcon = new MPIXMAP(muse_icon_xpm, NULL); + globalIcon = new MICON(global_xpm, "folder"); + userIcon = new MICON(user_xpm, "user-home"); + projectIcon = new MICON(project_xpm, "folder-sound"); } diff --git a/muse2/muse/icons.h b/muse2/muse/icons.h index ba069fbb..7592fb40 100644 --- a/muse2/muse/icons.h +++ b/muse2/muse/icons.h @@ -216,5 +216,9 @@ extern QPixmap* stereoIcon; extern QPixmap* museIcon; +extern QIcon* globalIcon; +extern QIcon* projectIcon; +extern QIcon* userIcon; + #endif diff --git a/muse2/muse/icons.qrc b/muse2/muse/icons.qrc deleted file mode 100644 index c5c52bef..00000000 --- a/muse2/muse/icons.qrc +++ /dev/null @@ -1,7 +0,0 @@ -<RCC version="1.0"> - <qresource prefix="/icons"> - <file>global.xpm</file> - <file>user.xpm</file> - <file>project.xpm</file> - </qresource> -</RCC> diff --git a/muse2/muse/widgets/CMakeLists.txt b/muse2/muse/widgets/CMakeLists.txt index 209371e2..f8056dad 100644 --- a/muse2/muse/widgets/CMakeLists.txt +++ b/muse2/muse/widgets/CMakeLists.txt @@ -132,6 +132,7 @@ QT4_WRAP_CPP (widget_mocs ) QT4_WRAP_UI (UIC + commentbase.ui fdialogbuttons.ui itransformbase.ui mittransposebase.ui @@ -148,7 +149,6 @@ QT4_WRAP_UI3 (widget_ui_headers mixdowndialogbase.ui transposebase.ui appearancebase.ui - commentbase.ui synthconfigbase.ui gatetimebase.ui metronomebase.ui diff --git a/muse2/muse/widgets/comment.cpp b/muse2/muse/widgets/comment.cpp index ef727859..4a091ddb 100644 --- a/muse2/muse/widgets/comment.cpp +++ b/muse2/muse/widgets/comment.cpp @@ -8,15 +8,15 @@ #include "comment.h" #include "song.h" #include "track.h" -#include <q3multilineedit.h> -#include <qlabel.h> + +#include <QWidget> //--------------------------------------------------------- // Comment //--------------------------------------------------------- -Comment::Comment(QWidget* parent, const char* name) - : CommentBase(parent, name) +Comment::Comment(QWidget* parent) + : CommentBaseWidget(parent) { } @@ -33,13 +33,14 @@ void Comment::textChanged() // TrackComment //--------------------------------------------------------- -TrackComment::TrackComment(Track* t, QWidget* parent, const char* name) - : Comment(parent, name) +TrackComment::TrackComment(Track* t, QWidget* parent) + : Comment(parent) { setCaption(tr("MusE: Track Comment")); track = t; connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); textentry->setText(track->comment()); + textentry->moveCursor(QTextCursor::End); connect(textentry, SIGNAL(textChanged()), SLOT(textChanged())); label1->setText(tr("Track Comment:")); label2->setText(track->name()); @@ -69,7 +70,7 @@ void TrackComment::songChanged(int flags) if (track->comment() != textentry->text()) { disconnect(textentry, SIGNAL(textChanged()), this, SLOT(textChanged())); textentry->setText(track->comment()); - textentry->setCursorPosition(1000, 1000); + textentry->moveCursor(QTextCursor::End); connect(textentry, SIGNAL(textChanged()), this, SLOT(textChanged())); } } diff --git a/muse2/muse/widgets/comment.h b/muse2/muse/widgets/comment.h index f3fbd547..f2dfbccc 100644 --- a/muse2/muse/widgets/comment.h +++ b/muse2/muse/widgets/comment.h @@ -8,17 +8,30 @@ #ifndef __COMMENT_H__ #define __COMMENT_H__ -#include <qwidget.h> -#include "commentbase.h" +#include "ui_commentbase.h" class Xml; class Track; +class QWidget; + +//--------------------------------------------------------- +// CommentBaseWidget +// Wrapper around Ui::CommentBase +//--------------------------------------------------------- + +class CommentBaseWidget : public QWidget, public Ui::CommentBase +{ + Q_OBJECT + + public: + CommentBaseWidget(QWidget *parent = 0) : QWidget(parent) { setupUi(this); } +}; //--------------------------------------------------------- // Comment //--------------------------------------------------------- -class Comment : public CommentBase { +class Comment : public CommentBaseWidget { Q_OBJECT private: @@ -28,7 +41,7 @@ class Comment : public CommentBase { void textChanged(); public: - Comment(QWidget* parent, const char* name = 0); + Comment(QWidget* parent); }; //--------------------------------------------------------- @@ -46,7 +59,7 @@ class TrackComment : public Comment { void songChanged(int); public: - TrackComment(Track*, QWidget*, const char* name = 0); + TrackComment(Track*, QWidget*); }; #endif diff --git a/muse2/muse/widgets/commentbase.ui b/muse2/muse/widgets/commentbase.ui index a4bed010..05f3087d 100644 --- a/muse2/muse/widgets/commentbase.ui +++ b/muse2/muse/widgets/commentbase.ui @@ -1,116 +1,91 @@ -<!DOCTYPE UI><UI> -<class>CommentBase</class> -<widget> - <class>QWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>CommentBase</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>0</x> - <y>0</y> - <width>387</width> - <height>205</height> - </rect> - </property> - <property stdset="1"> - <name>caption</name> - <string>Form1</string> - </property> - <vbox> - <property stdset="1"> - <name>margin</name> - <number>11</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget> - <class>QLayoutWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>Layout1</cstring> - </property> - <hbox> - <property stdset="1"> - <name>margin</name> - <number>0</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget> - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>label1</cstring> - </property> - <property stdset="1"> - <name>sizePolicy</name> - <sizepolicy> - <hsizetype>4</hsizetype> - <vsizetype>1</vsizetype> - </sizepolicy> - </property> - <property stdset="1"> - <name>text</name> - <string>Track Comment</string> - </property> - </widget> - <widget> - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>label2</cstring> - </property> - <property stdset="1"> - <name>font</name> - <font> - <pointsize>12</pointsize> - <bold>1</bold> - </font> - </property> - <property stdset="1"> - <name>frameShape</name> - <enum>Box</enum> - </property> - <property stdset="1"> - <name>frameShadow</name> - <enum>Sunken</enum> - </property> - <property stdset="1"> - <name>midLineWidth</name> - <number>1</number> - </property> - <property stdset="1"> - <name>text</name> - <string>Track 1</string> - </property> - </widget> - </hbox> - </widget> - <widget> - <class>QMultiLineEdit</class> - <property stdset="1"> - <name>name</name> - <cstring>textentry</cstring> - </property> - <property stdset="1"> - <name>font</name> - <font> - <pointsize>12</pointsize> - <bold>1</bold> - </font> - </property> - <property stdset="1"> - <name>frameShape</name> - <enum>WinPanel</enum> - </property> - </widget> - </vbox> -</widget> -</UI> +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>CommentBase</class> + <widget class="QWidget" name="CommentBase"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>387</width> + <height>205</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form1</string> + </property> + <layout class="QVBoxLayout"> + <property name="spacing"> + <number>6</number> + </property> + <property name="margin"> + <number>11</number> + </property> + <item> + <layout class="QHBoxLayout" name="hbox"> + <property name="spacing"> + <number>6</number> + </property> + <property name="margin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="label1"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Track Comment</string> + </property> + <property name="wordWrap"> + <bool>false</bool> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label2"> + <property name="font"> + <font> + <pointsize>12</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="frameShape"> + <enum>QFrame::Box</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Sunken</enum> + </property> + <property name="midLineWidth"> + <number>1</number> + </property> + <property name="text"> + <string>Track 1</string> + </property> + <property name="wordWrap"> + <bool>false</bool> + </property> + </widget> + </item> + </layout> + </item> + <item> + <widget class="QTextEdit" name="textentry" native="true"> + <property name="font"> + <font> + <pointsize>12</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + </widget> + </item> + </layout> + </widget> + <pixmapfunction>qPixmapFromMimeSource</pixmapfunction> + <resources/> + <connections/> +</ui> diff --git a/muse2/muse/widgets/filedialog.cpp b/muse2/muse/widgets/filedialog.cpp index cd4fff91..00cc136f 100644 --- a/muse2/muse/widgets/filedialog.cpp +++ b/muse2/muse/widgets/filedialog.cpp @@ -13,6 +13,7 @@ #include <QSplitter> #include <QStringList> +#include "icons.h" #include "filedialog.h" #include "../globals.h" @@ -172,9 +173,9 @@ MFileDialog::MFileDialog(const QString& dir, // Qt >= 4.6 allows us to select icons from the theme #if QT_VERSION >= 0x040600 - buttons.globalButton->setIcon(QIcon::fromTheme("folder", style()->standardIcon(QStyle::SP_DirIcon))); - buttons.userButton->setIcon(QIcon::fromTheme("user-home", style()->standardIcon(QStyle::SP_DirHomeIcon))); - buttons.projectButton->setIcon(QIcon::fromTheme("folder-sound", style()->standardIcon(QStyle::SP_DirOpenIcon))); + buttons.globalButton->setIcon(*globalIcon); + buttons.userButton->setIcon(*userIcon); + buttons.projectButton->setIcon(*projectIcon); #else buttons.globalButton->setIcon(style()->standardIcon(QStyle::SP_DirIcon)); buttons.userButton->setIcon(style()->standardIcon(QStyle::SP_DirHomeIcon)); diff --git a/muse2/muse/global.xpm b/muse2/xpm/global.xpm index 5175c03f..43fbeb44 100644 --- a/muse2/muse/global.xpm +++ b/muse2/xpm/global.xpm @@ -1,5 +1,5 @@ /* XPM */ -static const char* const image0_data[] = { +static const char* const global_xpm[] = { "34 34 176 2", "Qt c None", ".# c #000000", diff --git a/muse2/muse/project.xpm b/muse2/xpm/project.xpm index b373e62e..d4477a4f 100644 --- a/muse2/muse/project.xpm +++ b/muse2/xpm/project.xpm @@ -1,5 +1,5 @@ /* XPM */ -static const char* const image2_data[] = { +static const char* const project_xpm[] = { "34 34 352 2", ".a c None", ".# c None", diff --git a/muse2/muse/user.xpm b/muse2/xpm/user.xpm index 49dfa00e..6b5fa6ea 100644 --- a/muse2/muse/user.xpm +++ b/muse2/xpm/user.xpm @@ -1,5 +1,5 @@ /* XPM */ -static const char* const image1_data[] = { +static const char* const user_xpm[] = { "34 34 296 2", ".a c None", ".# c None", |