Permalink
Browse files

Attempting to fix 10.6 support

  • Loading branch information...
1 parent ad017aa commit f55756017107bbf754ed70ac0649473310eb32df @bmcdorman bmcdorman committed Jan 8, 2013
@@ -4,6 +4,7 @@ PROJECT(${PLUGIN_NAME})
cmake_minimum_required(VERSION 2.6.0)
IF(APPLE)
+SET(CMAKE_OSX_SYSROOT "${OSX_DEVELOPER_ROOT}/SDKs/MacOSX10.6.sdk")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch x86_64 -g")
ENDIF(APPLE)
@@ -4,6 +4,7 @@ PROJECT(${PLUGIN_NAME})
cmake_minimum_required(VERSION 2.6.0)
IF(APPLE)
+SET(CMAKE_OSX_SYSROOT "${OSX_DEVELOPER_ROOT}/SDKs/MacOSX10.6.sdk")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch x86_64 -g")
ENDIF(APPLE)
@@ -15,7 +15,6 @@ Target::Target(Interface* interface, const QString& name)
Target::~Target()
{
-
}
Interface *Target::interface() const
View
@@ -71,8 +71,8 @@ MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent),
m_currentTab(0),
m_templateManager(new Template::Manager),
- m_mainResponder(new Target::MainResponder(this)),
- m_commProgress(new CommunicationProgressBar(&Target::CommunicationManager::ref(), this))
+ m_commProgress(new CommunicationProgressBar(&Target::CommunicationManager::ref(), this)),
+ m_mainResponder(new Target::MainResponder(this))
{
QNetworkProxyFactory::setUseSystemConfiguration(true);
View
@@ -638,8 +638,10 @@ void SourceFile::print()
void SourceFile::convertToProject()
{
+ if(!save()) return;
Project::ProjectPtr project = mainWindow()->newProject();
fileSaveAs(project->location() + "/" + file().fileName());
+ project->setTarget(target());
setProject(project);
}
@@ -653,6 +655,8 @@ const bool SourceFile::changeTarget()
// This hooks up all important callbacks
target()->setResponder(mainWindow()->mainResponder());
+ updateTitle();
+
return true;
}
@@ -6,11 +6,26 @@
#include "template_pack.hpp"
#include <QItemSelection>
+#include <QItemDelegate>
#include <QDebug>
using namespace Kiss;
using namespace Kiss::Dialog;
+class ItemDelegate : public QItemDelegate
+{
+public:
+ ItemDelegate(QObject *parent = 0)
+ : QItemDelegate(parent)
+ {
+ }
+
+ QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
+ {
+ return QSize(100, 22);
+ }
+};
+
Dialog::Template::Template(Kiss::Template::Manager *manager, QWidget *parent)
: QDialog(parent),
m_manager(manager),
@@ -21,11 +36,13 @@ Dialog::Template::Template(Kiss::Template::Manager *manager, QWidget *parent)
m_model = new Kiss::Template::Model(m_manager, ui->templates);
m_model->setReadOnly(true);
ui->templates->setModel(m_model);
+ ui->templates->setItemDelegate(new ItemDelegate(this));
ui->removePack->setEnabled(false);
connect(ui->templates->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
this, SLOT(selectionChanged(QItemSelection)));
connect(ui->removePack, SIGNAL(clicked()), this, SLOT(removeSelectedPack()));
m_helpText = ui->description->toPlainText();
+ ui->templates->expandAll();
}
Dialog::Template::~Template()
@@ -54,6 +71,7 @@ void Dialog::Template::selectionChanged(const QItemSelection& selection)
Kiss::Template::Pack *pack = m_model->indexToPack(index);
ui->removePack->setEnabled(m_model->isIndexPack(index));
+ ui->buttons->button(QDialogButtonBox::Ok)->setEnabled(!m_model->isIndexPack(index));
if(!pack) {
ui->description->setPlainText(m_helpText);
@@ -6,10 +6,28 @@
<rect>
<x>0</x>
<y>0</y>
- <width>500</width>
- <height>115</height>
+ <width>450</width>
+ <height>145</height>
</rect>
</property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>400</width>
+ <height>145</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>1000</width>
+ <height>145</height>
+ </size>
+ </property>
<property name="windowTitle">
<string>New Project Wizard</string>
</property>
@@ -61,6 +79,18 @@
</item>
<item>
<widget class="QLineEdit" name="ui_saveLocation">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>22</height>
+ </size>
+ </property>
<property name="readOnly">
<bool>true</bool>
</property>
@@ -82,6 +112,19 @@
</layout>
</item>
<item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
View
@@ -1,116 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>TemplateDialog</class>
- <widget class="QDialog" name="TemplateDialog">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>666</width>
- <height>406</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Templates</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout" stretch="0,0">
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout" stretch="1,3">
- <item>
- <widget class="QListWidget" name="ui_types"/>
- </item>
- <item>
- <widget class="QTreeWidget" name="ui_templates">
- <property name="iconSize">
- <size>
- <width>32</width>
- <height>32</height>
- </size>
- </property>
- <attribute name="headerVisible">
- <bool>false</bool>
- </attribute>
- <column>
- <property name="text">
- <string notr="true">1</string>
- </property>
- </column>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
- <widget class="QPushButton" name="ui_install">
- <property name="text">
- <string>Install Template Pack...</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="ui_remove">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>Remove</string>
- </property>
- <property name="default">
- <bool>false</bool>
- </property>
- <property name="flat">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QDialogButtonBox" name="ui_buttons">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections>
- <connection>
- <sender>ui_buttons</sender>
- <signal>accepted()</signal>
- <receiver>TemplateDialog</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>248</x>
- <y>254</y>
- </hint>
- <hint type="destinationlabel">
- <x>157</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>ui_buttons</sender>
- <signal>rejected()</signal>
- <receiver>TemplateDialog</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>316</x>
- <y>260</y>
- </hint>
- <hint type="destinationlabel">
- <x>286</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>

0 comments on commit f557560

Please sign in to comment.