[PC-BSD Commits] r15837 - in pcbsd-projects/EasyPBI: . icons

svn at pcbsd.org svn at pcbsd.org
Mon Mar 19 09:01:22 PDT 2012


Author: kenmoore
Date: 2012-03-19 16:01:22 +0000 (Mon, 19 Mar 2012)
New Revision: 15837

Added:
   pcbsd-projects/EasyPBI/icons/
   pcbsd-projects/EasyPBI/icons/add.png
   pcbsd-projects/EasyPBI/icons/arrow-down.png
   pcbsd-projects/EasyPBI/icons/arrow-up.png
   pcbsd-projects/EasyPBI/icons/configure.png
   pcbsd-projects/EasyPBI/icons/refresh.png
   pcbsd-projects/EasyPBI/icons/remove.png
   pcbsd-projects/EasyPBI/icons/save.png
Modified:
   pcbsd-projects/EasyPBI/EasyPBI.pro
   pcbsd-projects/EasyPBI/EasyPBI.qrc
   pcbsd-projects/EasyPBI/Makefile
   pcbsd-projects/EasyPBI/main.cpp
   pcbsd-projects/EasyPBI/mainwindow.cpp
   pcbsd-projects/EasyPBI/mainwindow.h
   pcbsd-projects/EasyPBI/mainwindow.ui
Log:
Add icons to the EasyPBI GUI, make it run in single-instance mode



Modified: pcbsd-projects/EasyPBI/EasyPBI.pro
===================================================================
--- pcbsd-projects/EasyPBI/EasyPBI.pro	2012-03-19 10:34:54 UTC (rev 15836)
+++ pcbsd-projects/EasyPBI/EasyPBI.pro	2012-03-19 16:01:22 UTC (rev 15837)
@@ -22,3 +22,5 @@
 FORMS    += mainwindow.ui
 
 RESOURCES+= EasyPBI.qrc
+
+LIBS     += -lQtSolutions_SingleApplication-head
\ No newline at end of file

Modified: pcbsd-projects/EasyPBI/EasyPBI.qrc
===================================================================
--- pcbsd-projects/EasyPBI/EasyPBI.qrc	2012-03-19 10:34:54 UTC (rev 15836)
+++ pcbsd-projects/EasyPBI/EasyPBI.qrc	2012-03-19 16:01:22 UTC (rev 15837)
@@ -1,5 +1,12 @@
 <RCC>
   <qresource prefix="png">
+    <file>icons/save.png</file>
+    <file>icons/refresh.png</file>
+    <file>icons/add.png</file>
+    <file>icons/arrow-down.png</file>
+    <file>icons/arrow-up.png</file>
+    <file>icons/configure.png</file>
+    <file>icons/remove.png</file>
     <file>EasyPBIicon.png</file>
     <file>defaulticon.png</file>
   </qresource>

Modified: pcbsd-projects/EasyPBI/Makefile
===================================================================
--- pcbsd-projects/EasyPBI/Makefile	2012-03-19 10:34:54 UTC (rev 15836)
+++ pcbsd-projects/EasyPBI/Makefile	2012-03-19 16:01:22 UTC (rev 15837)
@@ -1,6 +1,6 @@
 #############################################################################
 # Makefile for building: EasyPBI
-# Generated by qmake (2.01a) (Qt 4.7.4) on: Thu Mar 8 14:06:57 2012
+# Generated by qmake (2.01a) (Qt 4.7.4) on: Mon Mar 19 11:54:13 2012
 # Project:  EasyPBI.pro
 # Template: app
 # Command: /usr/local/bin/qmake-qt4 -o Makefile EasyPBI.pro
@@ -16,7 +16,7 @@
 INCPATH       = -I/usr/local/share/qt4/mkspecs/freebsd-g++ -I. -I/usr/local/include/qt4/QtCore -I/usr/local/include/qt4/QtNetwork -I/usr/local/include/qt4/QtGui -I/usr/local/include/qt4 -I. -I. -I/usr/local/include/qt4 -I/usr/local/include
 LINK          = g++
 LFLAGS        = -Wl,-O1 -pthread -Wl,-rpath,/usr/local/lib/qt4
-LIBS          = $(SUBLIBS)  -L/usr/local/lib/qt4 -L/usr/local/lib -lQtGui -L/usr/local/lib/qt4 -L/usr/local/lib -lQtNetwork -lQtCore 
+LIBS          = $(SUBLIBS)  -L/usr/local/lib/qt4 -L/usr/local/lib -lQtSolutions_SingleApplication-head -lQtGui -L/usr/local/lib/qt4 -L/usr/local/lib -lQtNetwork -lQtCore 
 AR            = ar cqs
 RANLIB        = 
 QMAKE         = /usr/local/bin/qmake-qt4
@@ -191,7 +191,14 @@
 	-$(DEL_FILE) qrc_EasyPBI.cpp
 qrc_EasyPBI.cpp: EasyPBI.qrc \
 		defaulticon.png \
-		EasyPBIicon.png
+		EasyPBIicon.png \
+		icons/arrow-down.png \
+		icons/add.png \
+		icons/arrow-up.png \
+		icons/configure.png \
+		icons/save.png \
+		icons/remove.png \
+		icons/refresh.png
 	/usr/local/bin/rcc -name EasyPBI EasyPBI.qrc -o qrc_EasyPBI.cpp
 
 compiler_image_collection_make_all: qmake_image_collection.cpp
@@ -221,7 +228,8 @@
 
 mainwindow.o: mainwindow.cpp mainwindow.h \
 		pbi.h \
-		ui_mainwindow.h
+		ui_mainwindow.h \
+		modBuild.h
 	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o mainwindow.cpp
 
 pbi.o: pbi.cpp pbi.h

Index: pcbsd-projects/EasyPBI/icons/add.png
===================================================================
--- pcbsd-projects/EasyPBI/icons/add.png	2012-03-19 10:34:54 UTC (rev 15836)
+++ pcbsd-projects/EasyPBI/icons/add.png	2012-03-19 16:01:22 UTC (rev 15837)

Property changes on: pcbsd-projects/EasyPBI/icons/add.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
Index: pcbsd-projects/EasyPBI/icons/arrow-down.png
===================================================================
--- pcbsd-projects/EasyPBI/icons/arrow-down.png	2012-03-19 10:34:54 UTC (rev 15836)
+++ pcbsd-projects/EasyPBI/icons/arrow-down.png	2012-03-19 16:01:22 UTC (rev 15837)

Property changes on: pcbsd-projects/EasyPBI/icons/arrow-down.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
Index: pcbsd-projects/EasyPBI/icons/arrow-up.png
===================================================================
--- pcbsd-projects/EasyPBI/icons/arrow-up.png	2012-03-19 10:34:54 UTC (rev 15836)
+++ pcbsd-projects/EasyPBI/icons/arrow-up.png	2012-03-19 16:01:22 UTC (rev 15837)

Property changes on: pcbsd-projects/EasyPBI/icons/arrow-up.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
Index: pcbsd-projects/EasyPBI/icons/configure.png
===================================================================
--- pcbsd-projects/EasyPBI/icons/configure.png	2012-03-19 10:34:54 UTC (rev 15836)
+++ pcbsd-projects/EasyPBI/icons/configure.png	2012-03-19 16:01:22 UTC (rev 15837)

Property changes on: pcbsd-projects/EasyPBI/icons/configure.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
Index: pcbsd-projects/EasyPBI/icons/refresh.png
===================================================================
--- pcbsd-projects/EasyPBI/icons/refresh.png	2012-03-19 10:34:54 UTC (rev 15836)
+++ pcbsd-projects/EasyPBI/icons/refresh.png	2012-03-19 16:01:22 UTC (rev 15837)

Property changes on: pcbsd-projects/EasyPBI/icons/refresh.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
Index: pcbsd-projects/EasyPBI/icons/remove.png
===================================================================
--- pcbsd-projects/EasyPBI/icons/remove.png	2012-03-19 10:34:54 UTC (rev 15836)
+++ pcbsd-projects/EasyPBI/icons/remove.png	2012-03-19 16:01:22 UTC (rev 15837)

Property changes on: pcbsd-projects/EasyPBI/icons/remove.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
Index: pcbsd-projects/EasyPBI/icons/save.png
===================================================================
--- pcbsd-projects/EasyPBI/icons/save.png	2012-03-19 10:34:54 UTC (rev 15836)
+++ pcbsd-projects/EasyPBI/icons/save.png	2012-03-19 16:01:22 UTC (rev 15837)

Property changes on: pcbsd-projects/EasyPBI/icons/save.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
Modified: pcbsd-projects/EasyPBI/main.cpp
===================================================================
--- pcbsd-projects/EasyPBI/main.cpp	2012-03-19 10:34:54 UTC (rev 15836)
+++ pcbsd-projects/EasyPBI/main.cpp	2012-03-19 16:01:22 UTC (rev 15837)
@@ -1,10 +1,29 @@
+#include <QTranslator>
+#include <qtsingleapplication.h>
 #include <QtGui/QApplication>
+#include <QDebug>
 #include "mainwindow.h"
+#define PREFIX QString("/usr/local")
+//#include "../config.h"
 
-int main(int argc, char *argv[])
+int main(int argc, char ** argv)
 {
-    QApplication a(argc, argv);
+    QtSingleApplication a(argc, argv);
+    if( a.isRunning() )
+      return !(a.sendMessage("show"));
+
+    QTranslator translator;
+    QLocale mylocale;
+    QString langCode = mylocale.name();
+    
+    if ( ! QFile::exists(PREFIX + "/share/pcbsd/i18n/pc-bluetoothmanager_" + langCode + ".qm" ) )  langCode.truncate(langCode.indexOf("_"));
+    translator.load( QString("pc-bluetoothmanager_") + langCode, PREFIX + "/share/pcbsd/i18n/" );
+    a.installTranslator( &translator );
+    qDebug() << "Locale:" << langCode;
+
+
     MainWindow w;
+    QObject::connect(&a, SIGNAL(messageReceived(const QString&)), &w, SLOT(slotSingleInstance()) );
     w.show();
 
     return a.exec();

Modified: pcbsd-projects/EasyPBI/mainwindow.cpp
===================================================================
--- pcbsd-projects/EasyPBI/mainwindow.cpp	2012-03-19 10:34:54 UTC (rev 15836)
+++ pcbsd-projects/EasyPBI/mainwindow.cpp	2012-03-19 16:01:22 UTC (rev 15837)
@@ -42,6 +42,12 @@
     //delete ui;
 }
 
+void MainWindow::slotSingleInstance(){
+  this->showNormal();
+  this->activateWindow();
+  this->raise();
+}
+
 void MainWindow::on_actionExit_triggered()
 {
     close();

Modified: pcbsd-projects/EasyPBI/mainwindow.h
===================================================================
--- pcbsd-projects/EasyPBI/mainwindow.h	2012-03-19 10:34:54 UTC (rev 15836)
+++ pcbsd-projects/EasyPBI/mainwindow.h	2012-03-19 16:01:22 UTC (rev 15837)
@@ -89,6 +89,7 @@
     void on_pushAddLinkType_clicked();
     void on_pushRemoveLink_clicked();
     void on_listLinkBins_currentIndexChanged(int);
+    void slotSingleInstance();
 
 private:
     Ui::MainWindow *ui;

Modified: pcbsd-projects/EasyPBI/mainwindow.ui
===================================================================
--- pcbsd-projects/EasyPBI/mainwindow.ui	2012-03-19 10:34:54 UTC (rev 15836)
+++ pcbsd-projects/EasyPBI/mainwindow.ui	2012-03-19 16:01:22 UTC (rev 15837)
@@ -175,6 +175,10 @@
             <property name="text">
              <string>Create Module</string>
             </property>
+            <property name="icon">
+             <iconset resource="EasyPBI.qrc">
+              <normaloff>:/png/icons/configure.png</normaloff>:/png/icons/configure.png</iconset>
+            </property>
            </widget>
           </item>
           <item row="0" column="0">
@@ -315,6 +319,10 @@
             <property name="text">
              <string>Save Settings As Defaults</string>
             </property>
+            <property name="icon">
+             <iconset resource="EasyPBI.qrc">
+              <normaloff>:/png/icons/save.png</normaloff>:/png/icons/save.png</iconset>
+            </property>
            </widget>
           </item>
           <item row="2" column="2">
@@ -383,6 +391,10 @@
             <property name="text">
              <string>Build PBI</string>
             </property>
+            <property name="icon">
+             <iconset resource="EasyPBI.qrc">
+              <normaloff>:/png/icons/configure.png</normaloff>:/png/icons/configure.png</iconset>
+            </property>
            </widget>
           </item>
          </layout>
@@ -410,6 +422,10 @@
               <property name="text">
                <string>Stop Build</string>
               </property>
+              <property name="icon">
+               <iconset resource="EasyPBI.qrc">
+                <normaloff>:/png/icons/remove.png</normaloff>:/png/icons/remove.png</iconset>
+              </property>
              </widget>
             </item>
             <item>
@@ -417,6 +433,10 @@
               <property name="text">
                <string>Save Build Log</string>
               </property>
+              <property name="icon">
+               <iconset resource="EasyPBI.qrc">
+                <normaloff>:/png/icons/save.png</normaloff>:/png/icons/save.png</iconset>
+              </property>
              </widget>
             </item>
             <item>
@@ -494,6 +514,10 @@
             <property name="text">
              <string>Package Module</string>
             </property>
+            <property name="icon">
+             <iconset resource="EasyPBI.qrc">
+              <normaloff>:/png/icons/configure.png</normaloff>:/png/icons/configure.png</iconset>
+            </property>
            </widget>
           </item>
           <item>
@@ -711,6 +735,10 @@
                 <property name="text">
                  <string>Add Port</string>
                 </property>
+                <property name="icon">
+                 <iconset resource="EasyPBI.qrc">
+                  <normaloff>:/png/icons/add.png</normaloff>:/png/icons/add.png</iconset>
+                </property>
                </widget>
               </item>
               <item>
@@ -718,6 +746,10 @@
                 <property name="text">
                  <string>Remove Port</string>
                 </property>
+                <property name="icon">
+                 <iconset resource="EasyPBI.qrc">
+                  <normaloff>:/png/icons/remove.png</normaloff>:/png/icons/remove.png</iconset>
+                </property>
                </widget>
               </item>
              </layout>
@@ -729,6 +761,10 @@
                 <property name="text">
                  <string>Add Port</string>
                 </property>
+                <property name="icon">
+                 <iconset resource="EasyPBI.qrc">
+                  <normaloff>:/png/icons/add.png</normaloff>:/png/icons/add.png</iconset>
+                </property>
                </widget>
               </item>
               <item>
@@ -736,6 +772,10 @@
                 <property name="text">
                  <string>Remove Port</string>
                 </property>
+                <property name="icon">
+                 <iconset resource="EasyPBI.qrc">
+                  <normaloff>:/png/icons/remove.png</normaloff>:/png/icons/remove.png</iconset>
+                </property>
                </widget>
               </item>
              </layout>
@@ -747,6 +787,10 @@
                 <property name="text">
                  <string>Save </string>
                 </property>
+                <property name="icon">
+                 <iconset resource="EasyPBI.qrc">
+                  <normaloff>:/png/icons/save.png</normaloff>:/png/icons/save.png</iconset>
+                </property>
                </widget>
               </item>
               <item>
@@ -754,6 +798,10 @@
                 <property name="text">
                  <string>Reset</string>
                 </property>
+                <property name="icon">
+                 <iconset resource="EasyPBI.qrc">
+                  <normaloff>:/png/icons/refresh.png</normaloff>:/png/icons/refresh.png</iconset>
+                </property>
                </widget>
               </item>
              </layout>
@@ -775,6 +823,10 @@
                 <property name="text">
                  <string>Add Resource</string>
                 </property>
+                <property name="icon">
+                 <iconset resource="EasyPBI.qrc">
+                  <normaloff>:/png/icons/add.png</normaloff>:/png/icons/add.png</iconset>
+                </property>
                </widget>
               </item>
               <item>
@@ -782,6 +834,10 @@
                 <property name="text">
                  <string>Remove Resource</string>
                 </property>
+                <property name="icon">
+                 <iconset resource="EasyPBI.qrc">
+                  <normaloff>:/png/icons/remove.png</normaloff>:/png/icons/remove.png</iconset>
+                </property>
                </widget>
               </item>
               <item>
@@ -802,6 +858,10 @@
                 <property name="text">
                  <string>Refresh</string>
                 </property>
+                <property name="icon">
+                 <iconset resource="EasyPBI.qrc">
+                  <normaloff>:/png/icons/refresh.png</normaloff>:/png/icons/refresh.png</iconset>
+                </property>
                </widget>
               </item>
              </layout>
@@ -873,6 +933,10 @@
                   <property name="text">
                    <string>Remove Desktop Entry</string>
                   </property>
+                  <property name="icon">
+                   <iconset resource="EasyPBI.qrc">
+                    <normaloff>:/png/icons/remove.png</normaloff>:/png/icons/remove.png</iconset>
+                  </property>
                  </widget>
                 </item>
                 <item>
@@ -910,6 +974,10 @@
                   <property name="text">
                    <string>Remove Menu Entry</string>
                   </property>
+                  <property name="icon">
+                   <iconset resource="EasyPBI.qrc">
+                    <normaloff>:/png/icons/remove.png</normaloff>:/png/icons/remove.png</iconset>
+                  </property>
                  </widget>
                 </item>
                 <item>
@@ -943,6 +1011,10 @@
                 <property name="text">
                  <string>Add Desktop Entry</string>
                 </property>
+                <property name="icon">
+                 <iconset resource="EasyPBI.qrc">
+                  <normaloff>:/png/icons/add.png</normaloff>:/png/icons/add.png</iconset>
+                </property>
                </widget>
               </item>
               <item row="1" column="1">
@@ -999,6 +1071,10 @@
                 <property name="text">
                  <string>Add Menu Entry</string>
                 </property>
+                <property name="icon">
+                 <iconset resource="EasyPBI.qrc">
+                  <normaloff>:/png/icons/add.png</normaloff>:/png/icons/add.png</iconset>
+                </property>
                </widget>
               </item>
               <item row="2" column="0">
@@ -1044,6 +1120,10 @@
                   <property name="text">
                    <string>Remove Link</string>
                   </property>
+                  <property name="icon">
+                   <iconset resource="EasyPBI.qrc">
+                    <normaloff>:/png/icons/remove.png</normaloff>:/png/icons/remove.png</iconset>
+                  </property>
                  </widget>
                 </item>
                 <item>
@@ -1051,6 +1131,10 @@
                   <property name="text">
                    <string>Refresh List</string>
                   </property>
+                  <property name="icon">
+                   <iconset resource="EasyPBI.qrc">
+                    <normaloff>:/png/icons/refresh.png</normaloff>:/png/icons/refresh.png</iconset>
+                  </property>
                  </widget>
                 </item>
                </layout>
@@ -1078,6 +1162,15 @@
               </item>
               <item row="4" column="0" colspan="3">
                <widget class="Line" name="line_6">
+                <property name="font">
+                 <font>
+                  <weight>50</weight>
+                  <bold>false</bold>
+                 </font>
+                </property>
+                <property name="lineWidth">
+                 <number>2</number>
+                </property>
                 <property name="orientation">
                  <enum>Qt::Horizontal</enum>
                 </property>
@@ -1088,6 +1181,10 @@
                 <property name="text">
                  <string>Clear Changes</string>
                 </property>
+                <property name="icon">
+                 <iconset resource="EasyPBI.qrc">
+                  <normaloff>:/png/icons/refresh.png</normaloff>:/png/icons/refresh.png</iconset>
+                </property>
                </widget>
               </item>
               <item row="6" column="0">
@@ -1095,6 +1192,10 @@
                 <property name="text">
                  <string>Add Link</string>
                 </property>
+                <property name="icon">
+                 <iconset resource="EasyPBI.qrc">
+                  <normaloff>:/png/icons/add.png</normaloff>:/png/icons/add.png</iconset>
+                </property>
                </widget>
               </item>
               <item row="3" column="0">
@@ -1123,6 +1224,10 @@
                   <property name="text">
                    <string>Add</string>
                   </property>
+                  <property name="icon">
+                   <iconset resource="EasyPBI.qrc">
+                    <normaloff>:/png/icons/arrow-up.png</normaloff>:/png/icons/arrow-up.png</iconset>
+                  </property>
                  </widget>
                 </item>
                </layout>



More information about the Commits mailing list