simple_mtglife

changeset 1:d76fb2ffe7f5

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 25 Jan 2015 12:04:45 +0200
parents 6321cfa2ad62
children b01c1fd6f38c
files android/AndroidManifest.xml android/res/drawable-hdpi/icon.png android/res/drawable-ldpi/icon.png android/res/drawable-mdpi/icon.png data/icon-36px.png data/icon-48px.png data/icon-72px.png data/icon-96px.png mainwin.cc mainwin.h mainwin.ui resources.qrc simple_mtglife.pro
diffstat 13 files changed, 153 insertions(+), 15 deletions(-) [+]
line diff
     1.1 --- a/android/AndroidManifest.xml	Fri Jan 23 15:24:27 2015 +0200
     1.2 +++ b/android/AndroidManifest.xml	Sun Jan 25 12:04:45 2015 +0200
     1.3 @@ -1,6 +1,6 @@
     1.4  <?xml version="1.0"?>
     1.5  <manifest package="com.mutantstargoat.simple_mtglife" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto">
     1.6 -	<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --">
     1.7 +	<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --" android:icon="@drawable/icon">
     1.8  		<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="-- %%INSERT_APP_NAME%% --" android:screenOrientation="sensorLandscape" android:launchMode="singleTop">
     1.9  			<intent-filter>
    1.10  				<action android:name="android.intent.action.MAIN"/>
     2.1 Binary file android/res/drawable-hdpi/icon.png has changed
     3.1 Binary file android/res/drawable-ldpi/icon.png has changed
     4.1 Binary file android/res/drawable-mdpi/icon.png has changed
     5.1 Binary file data/icon-36px.png has changed
     6.1 Binary file data/icon-48px.png has changed
     7.1 Binary file data/icon-72px.png has changed
     8.1 Binary file data/icon-96px.png has changed
     9.1 --- a/mainwin.cc	Fri Jan 23 15:24:27 2015 +0200
     9.2 +++ b/mainwin.cc	Sun Jan 25 12:04:45 2015 +0200
     9.3 @@ -1,3 +1,4 @@
     9.4 +#include <QMessageBox>
     9.5  #include "mainwin.h"
     9.6  #include "ui_mainwin.h"
     9.7  
     9.8 @@ -42,3 +43,29 @@
     9.9  {
    9.10  	ui->spin_p2_life->setValue(ui->spin_p2_life->value() - 10);
    9.11  }
    9.12 +
    9.13 +void MainWin::on_action_reset_triggered()
    9.14 +{
    9.15 +   on_bn_p1_reset_clicked();
    9.16 +   on_bn_p2_reset_clicked();
    9.17 +}
    9.18 +
    9.19 +void MainWin::on_action_quit_triggered()
    9.20 +{
    9.21 +    QApplication::quit();
    9.22 +}
    9.23 +
    9.24 +void MainWin::on_action_about_triggered()
    9.25 +{
    9.26 +    static const char *about_text =
    9.27 +            "simple_mtglife is an extremely simple and lightweight life counter "
    9.28 +            "for magic: the gathering.\n"
    9.29 +            "\n"
    9.30 +            "Copyright (C) 2015 John Tsiombikas <nuclear@member.fsf.org>\n"
    9.31 +            "http://nuclear.mutantstargoat.com\n"
    9.32 +            "\n"
    9.33 +            "This program is free software. Feel free to copy, modify, and "
    9.34 +            "distribute copies of this application, under the terms of the "
    9.35 +            "GNU General Public License version 3 (or any later version).";
    9.36 +    QMessageBox::about(this, "About simple_mtglife", about_text);
    9.37 +}
    10.1 --- a/mainwin.h	Fri Jan 23 15:24:27 2015 +0200
    10.2 +++ b/mainwin.h	Sun Jan 25 12:04:45 2015 +0200
    10.3 @@ -28,6 +28,12 @@
    10.4  
    10.5  	void on_bn_p2_dec10_clicked();
    10.6  
    10.7 +    void on_action_reset_triggered();
    10.8 +
    10.9 +    void on_action_quit_triggered();
   10.10 +
   10.11 +    void on_action_about_triggered();
   10.12 +
   10.13  private:
   10.14  	Ui::MainWin *ui;
   10.15  };
    11.1 --- a/mainwin.ui	Fri Jan 23 15:24:27 2015 +0200
    11.2 +++ b/mainwin.ui	Sun Jan 25 12:04:45 2015 +0200
    11.3 @@ -13,6 +13,10 @@
    11.4    <property name="windowTitle">
    11.5     <string>MainWin</string>
    11.6    </property>
    11.7 +  <property name="windowIcon">
    11.8 +   <iconset resource="resources.qrc">
    11.9 +    <normaloff>:/data/icon-96px.png</normaloff>:/data/icon-96px.png</iconset>
   11.10 +  </property>
   11.11    <widget class="QWidget" name="centralWidget">
   11.12     <layout class="QHBoxLayout" name="horizontalLayout_3">
   11.13      <item>
   11.14 @@ -44,6 +48,14 @@
   11.15               <verstretch>0</verstretch>
   11.16              </sizepolicy>
   11.17             </property>
   11.18 +           <property name="font">
   11.19 +            <font>
   11.20 +             <pointsize>20</pointsize>
   11.21 +            </font>
   11.22 +           </property>
   11.23 +           <property name="focusPolicy">
   11.24 +            <enum>Qt::NoFocus</enum>
   11.25 +           </property>
   11.26             <property name="text">
   11.27              <string>Reset</string>
   11.28             </property>
   11.29 @@ -83,9 +95,12 @@
   11.30            <widget class="QPushButton" name="bn_p1_inc10">
   11.31             <property name="font">
   11.32              <font>
   11.33 -             <pointsize>24</pointsize>
   11.34 +             <pointsize>20</pointsize>
   11.35              </font>
   11.36             </property>
   11.37 +           <property name="focusPolicy">
   11.38 +            <enum>Qt::NoFocus</enum>
   11.39 +           </property>
   11.40             <property name="text">
   11.41              <string>+10</string>
   11.42             </property>
   11.43 @@ -101,9 +116,12 @@
   11.44             </property>
   11.45             <property name="font">
   11.46              <font>
   11.47 -             <pointsize>24</pointsize>
   11.48 +             <pointsize>20</pointsize>
   11.49              </font>
   11.50             </property>
   11.51 +           <property name="focusPolicy">
   11.52 +            <enum>Qt::NoFocus</enum>
   11.53 +           </property>
   11.54             <property name="text">
   11.55              <string>+1</string>
   11.56             </property>
   11.57 @@ -119,9 +137,12 @@
   11.58             </property>
   11.59             <property name="font">
   11.60              <font>
   11.61 -             <pointsize>50</pointsize>
   11.62 +             <pointsize>40</pointsize>
   11.63              </font>
   11.64             </property>
   11.65 +           <property name="focusPolicy">
   11.66 +            <enum>Qt::NoFocus</enum>
   11.67 +           </property>
   11.68             <property name="frame">
   11.69              <bool>true</bool>
   11.70             </property>
   11.71 @@ -152,9 +173,12 @@
   11.72             </property>
   11.73             <property name="font">
   11.74              <font>
   11.75 -             <pointsize>24</pointsize>
   11.76 +             <pointsize>20</pointsize>
   11.77              </font>
   11.78             </property>
   11.79 +           <property name="focusPolicy">
   11.80 +            <enum>Qt::NoFocus</enum>
   11.81 +           </property>
   11.82             <property name="text">
   11.83              <string>-1</string>
   11.84             </property>
   11.85 @@ -164,9 +188,12 @@
   11.86            <widget class="QPushButton" name="bn_p1_dec10">
   11.87             <property name="font">
   11.88              <font>
   11.89 -             <pointsize>24</pointsize>
   11.90 +             <pointsize>20</pointsize>
   11.91              </font>
   11.92             </property>
   11.93 +           <property name="focusPolicy">
   11.94 +            <enum>Qt::NoFocus</enum>
   11.95 +           </property>
   11.96             <property name="text">
   11.97              <string>-10</string>
   11.98             </property>
   11.99 @@ -206,6 +233,14 @@
  11.100               <verstretch>0</verstretch>
  11.101              </sizepolicy>
  11.102             </property>
  11.103 +           <property name="font">
  11.104 +            <font>
  11.105 +             <pointsize>20</pointsize>
  11.106 +            </font>
  11.107 +           </property>
  11.108 +           <property name="focusPolicy">
  11.109 +            <enum>Qt::NoFocus</enum>
  11.110 +           </property>
  11.111             <property name="text">
  11.112              <string>Reset</string>
  11.113             </property>
  11.114 @@ -245,9 +280,12 @@
  11.115            <widget class="QPushButton" name="bn_p2_inc10">
  11.116             <property name="font">
  11.117              <font>
  11.118 -             <pointsize>24</pointsize>
  11.119 +             <pointsize>20</pointsize>
  11.120              </font>
  11.121             </property>
  11.122 +           <property name="focusPolicy">
  11.123 +            <enum>Qt::NoFocus</enum>
  11.124 +           </property>
  11.125             <property name="text">
  11.126              <string>+10</string>
  11.127             </property>
  11.128 @@ -263,9 +301,12 @@
  11.129             </property>
  11.130             <property name="font">
  11.131              <font>
  11.132 -             <pointsize>24</pointsize>
  11.133 +             <pointsize>20</pointsize>
  11.134              </font>
  11.135             </property>
  11.136 +           <property name="focusPolicy">
  11.137 +            <enum>Qt::NoFocus</enum>
  11.138 +           </property>
  11.139             <property name="text">
  11.140              <string>+1</string>
  11.141             </property>
  11.142 @@ -281,9 +322,12 @@
  11.143             </property>
  11.144             <property name="font">
  11.145              <font>
  11.146 -             <pointsize>50</pointsize>
  11.147 +             <pointsize>40</pointsize>
  11.148              </font>
  11.149             </property>
  11.150 +           <property name="focusPolicy">
  11.151 +            <enum>Qt::NoFocus</enum>
  11.152 +           </property>
  11.153             <property name="frame">
  11.154              <bool>true</bool>
  11.155             </property>
  11.156 @@ -314,9 +358,12 @@
  11.157             </property>
  11.158             <property name="font">
  11.159              <font>
  11.160 -             <pointsize>24</pointsize>
  11.161 +             <pointsize>20</pointsize>
  11.162              </font>
  11.163             </property>
  11.164 +           <property name="focusPolicy">
  11.165 +            <enum>Qt::NoFocus</enum>
  11.166 +           </property>
  11.167             <property name="text">
  11.168              <string>-1</string>
  11.169             </property>
  11.170 @@ -326,9 +373,12 @@
  11.171            <widget class="QPushButton" name="bn_p2_dec10">
  11.172             <property name="font">
  11.173              <font>
  11.174 -             <pointsize>24</pointsize>
  11.175 +             <pointsize>20</pointsize>
  11.176              </font>
  11.177             </property>
  11.178 +           <property name="focusPolicy">
  11.179 +            <enum>Qt::NoFocus</enum>
  11.180 +           </property>
  11.181             <property name="text">
  11.182              <string>-10</string>
  11.183             </property>
  11.184 @@ -341,9 +391,52 @@
  11.185      </item>
  11.186     </layout>
  11.187    </widget>
  11.188 +  <widget class="QMenuBar" name="menuBar">
  11.189 +   <property name="geometry">
  11.190 +    <rect>
  11.191 +     <x>0</x>
  11.192 +     <y>0</y>
  11.193 +     <width>623</width>
  11.194 +     <height>20</height>
  11.195 +    </rect>
  11.196 +   </property>
  11.197 +   <widget class="QMenu" name="menu_file">
  11.198 +    <property name="title">
  11.199 +     <string>&amp;File</string>
  11.200 +    </property>
  11.201 +    <addaction name="action_reset"/>
  11.202 +    <addaction name="separator"/>
  11.203 +    <addaction name="action_quit"/>
  11.204 +   </widget>
  11.205 +   <widget class="QMenu" name="menu_Help">
  11.206 +    <property name="title">
  11.207 +     <string>&amp;Help</string>
  11.208 +    </property>
  11.209 +    <addaction name="action_about"/>
  11.210 +   </widget>
  11.211 +   <addaction name="menu_file"/>
  11.212 +   <addaction name="menu_Help"/>
  11.213 +  </widget>
  11.214 +  <action name="action_reset">
  11.215 +   <property name="text">
  11.216 +    <string>&amp;Reset</string>
  11.217 +   </property>
  11.218 +  </action>
  11.219 +  <action name="action_quit">
  11.220 +   <property name="text">
  11.221 +    <string>&amp;Quit</string>
  11.222 +   </property>
  11.223 +  </action>
  11.224 +  <action name="action_about">
  11.225 +   <property name="text">
  11.226 +    <string>&amp;About</string>
  11.227 +   </property>
  11.228 +  </action>
  11.229   </widget>
  11.230   <layoutdefault spacing="6" margin="11"/>
  11.231 - <resources/>
  11.232 + <resources>
  11.233 +  <include location="resources.qrc"/>
  11.234 + </resources>
  11.235   <connections>
  11.236    <connection>
  11.237     <sender>bn_p1_dec</sender>
  11.238 @@ -384,8 +477,8 @@
  11.239     <slot>stepDown()</slot>
  11.240     <hints>
  11.241      <hint type="sourcelabel">
  11.242 -     <x>536</x>
  11.243 -     <y>252</y>
  11.244 +     <x>600</x>
  11.245 +     <y>304</y>
  11.246      </hint>
  11.247      <hint type="destinationlabel">
  11.248       <x>540</x>
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/resources.qrc	Sun Jan 25 12:04:45 2015 +0200
    12.3 @@ -0,0 +1,5 @@
    12.4 +<RCC>
    12.5 +    <qresource prefix="/">
    12.6 +        <file>data/icon-96px.png</file>
    12.7 +    </qresource>
    12.8 +</RCC>
    13.1 --- a/simple_mtglife.pro	Fri Jan 23 15:24:27 2015 +0200
    13.2 +++ b/simple_mtglife.pro	Sun Jan 25 12:04:45 2015 +0200
    13.3 @@ -29,7 +29,14 @@
    13.4      android/build.gradle \
    13.5      android/gradle/wrapper/gradle-wrapper.properties \
    13.6      android/gradlew \
    13.7 -    android/gradlew.bat
    13.8 +    android/gradlew.bat \
    13.9 +    data/icon-36px.png \
   13.10 +    data/icon-48px.png \
   13.11 +    data/icon-72px.png \
   13.12 +    data/icon-96px.png
   13.13  
   13.14  ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
   13.15  
   13.16 +RESOURCES += \
   13.17 +    resources.qrc
   13.18 +