qnetdice

changeset 0:0e9c16d77e47

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 19 Dec 2013 13:34:40 +0200
parents
children 92377189a5c6
files .hgignore qnetdice.pro src/dicedialog.cc src/dicedialog.h src/main.cc src/mainwin.cc src/mainwin.h ui/dicedialog.ui ui/mainwin.ui
diffstat 9 files changed, 437 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/.hgignore	Thu Dec 19 13:34:40 2013 +0200
     1.3 @@ -0,0 +1,4 @@
     1.4 +\.o$
     1.5 +\.d$
     1.6 +\.swp$
     1.7 +^build-qnetdice-
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/qnetdice.pro	Thu Dec 19 13:34:40 2013 +0200
     2.3 @@ -0,0 +1,24 @@
     2.4 +#-------------------------------------------------
     2.5 +#
     2.6 +# Project created by QtCreator 2013-12-19T10:40:43
     2.7 +#
     2.8 +#-------------------------------------------------
     2.9 +
    2.10 +QT       += core gui
    2.11 +
    2.12 +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    2.13 +
    2.14 +TARGET = qnetdice
    2.15 +TEMPLATE = app
    2.16 +
    2.17 +
    2.18 +SOURCES +=\
    2.19 +	src/mainwin.cc \
    2.20 +    src/main.cc \
    2.21 +    src/dicedialog.cc
    2.22 +
    2.23 +HEADERS  += src/mainwin.h \
    2.24 +    src/dicedialog.h
    2.25 +
    2.26 +FORMS    += ui/mainwin.ui \
    2.27 +    ui/dicedialog.ui
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/src/dicedialog.cc	Thu Dec 19 13:34:40 2013 +0200
     3.3 @@ -0,0 +1,14 @@
     3.4 +#include "dicedialog.h"
     3.5 +#include "ui_dicedialog.h"
     3.6 +
     3.7 +DiceDialog::DiceDialog(QWidget *parent) :
     3.8 +    QDialog(parent),
     3.9 +    ui(new Ui::DiceDialog)
    3.10 +{
    3.11 +    ui->setupUi(this);
    3.12 +}
    3.13 +
    3.14 +DiceDialog::~DiceDialog()
    3.15 +{
    3.16 +    delete ui;
    3.17 +}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/src/dicedialog.h	Thu Dec 19 13:34:40 2013 +0200
     4.3 @@ -0,0 +1,22 @@
     4.4 +#ifndef DICEDIALOG_H
     4.5 +#define DICEDIALOG_H
     4.6 +
     4.7 +#include <QDialog>
     4.8 +
     4.9 +namespace Ui {
    4.10 +class DiceDialog;
    4.11 +}
    4.12 +
    4.13 +class DiceDialog : public QDialog
    4.14 +{
    4.15 +    Q_OBJECT
    4.16 +
    4.17 +public:
    4.18 +    explicit DiceDialog(QWidget *parent = 0);
    4.19 +    ~DiceDialog();
    4.20 +
    4.21 +private:
    4.22 +    Ui::DiceDialog *ui;
    4.23 +};
    4.24 +
    4.25 +#endif // DICEDIALOG_H
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/src/main.cc	Thu Dec 19 13:34:40 2013 +0200
     5.3 @@ -0,0 +1,11 @@
     5.4 +#include "mainwin.h"
     5.5 +#include <QApplication>
     5.6 +
     5.7 +int main(int argc, char *argv[])
     5.8 +{
     5.9 +    QApplication a(argc, argv);
    5.10 +    MainWindow w;
    5.11 +    w.show();
    5.12 +
    5.13 +    return a.exec();
    5.14 +}
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/src/mainwin.cc	Thu Dec 19 13:34:40 2013 +0200
     6.3 @@ -0,0 +1,14 @@
     6.4 +#include "mainwin.h"
     6.5 +#include "ui_mainwin.h"
     6.6 +
     6.7 +MainWindow::MainWindow(QWidget *parent) :
     6.8 +    QMainWindow(parent),
     6.9 +    ui(new Ui::MainWindow)
    6.10 +{
    6.11 +    ui->setupUi(this);
    6.12 +}
    6.13 +
    6.14 +MainWindow::~MainWindow()
    6.15 +{
    6.16 +    delete ui;
    6.17 +}
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/src/mainwin.h	Thu Dec 19 13:34:40 2013 +0200
     7.3 @@ -0,0 +1,22 @@
     7.4 +#ifndef MAINWIN_H
     7.5 +#define MAINWIN_H
     7.6 +
     7.7 +#include <QMainWindow>
     7.8 +
     7.9 +namespace Ui {
    7.10 +class MainWindow;
    7.11 +}
    7.12 +
    7.13 +class MainWindow : public QMainWindow
    7.14 +{
    7.15 +    Q_OBJECT
    7.16 +
    7.17 +public:
    7.18 +    explicit MainWindow(QWidget *parent = 0);
    7.19 +    ~MainWindow();
    7.20 +
    7.21 +private:
    7.22 +    Ui::MainWindow *ui;
    7.23 +};
    7.24 +
    7.25 +#endif // MAINWIN_H
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/ui/dicedialog.ui	Thu Dec 19 13:34:40 2013 +0200
     8.3 @@ -0,0 +1,212 @@
     8.4 +<?xml version="1.0" encoding="UTF-8"?>
     8.5 +<ui version="4.0">
     8.6 + <class>DiceDialog</class>
     8.7 + <widget class="QDialog" name="DiceDialog">
     8.8 +  <property name="geometry">
     8.9 +   <rect>
    8.10 +    <x>0</x>
    8.11 +    <y>0</y>
    8.12 +    <width>581</width>
    8.13 +    <height>384</height>
    8.14 +   </rect>
    8.15 +  </property>
    8.16 +  <property name="windowTitle">
    8.17 +   <string>Dialog</string>
    8.18 +  </property>
    8.19 +  <layout class="QVBoxLayout" name="verticalLayout">
    8.20 +   <item>
    8.21 +    <layout class="QHBoxLayout" name="horizontalLayout">
    8.22 +     <item>
    8.23 +      <spacer name="horizontalSpacer">
    8.24 +       <property name="orientation">
    8.25 +        <enum>Qt::Horizontal</enum>
    8.26 +       </property>
    8.27 +       <property name="sizeHint" stdset="0">
    8.28 +        <size>
    8.29 +         <width>40</width>
    8.30 +         <height>20</height>
    8.31 +        </size>
    8.32 +       </property>
    8.33 +      </spacer>
    8.34 +     </item>
    8.35 +     <item>
    8.36 +      <widget class="QSpinBox" name="spin_count">
    8.37 +       <property name="toolTip">
    8.38 +        <string>number of dice</string>
    8.39 +       </property>
    8.40 +       <property name="minimum">
    8.41 +        <number>1</number>
    8.42 +       </property>
    8.43 +       <property name="maximum">
    8.44 +        <number>100</number>
    8.45 +       </property>
    8.46 +      </widget>
    8.47 +     </item>
    8.48 +     <item>
    8.49 +      <widget class="QComboBox" name="combo_type">
    8.50 +       <property name="cursor">
    8.51 +        <cursorShape>ArrowCursor</cursorShape>
    8.52 +       </property>
    8.53 +       <property name="toolTip">
    8.54 +        <string>type of dice</string>
    8.55 +       </property>
    8.56 +       <property name="editable">
    8.57 +        <bool>true</bool>
    8.58 +       </property>
    8.59 +       <property name="currentIndex">
    8.60 +        <number>4</number>
    8.61 +       </property>
    8.62 +       <item>
    8.63 +        <property name="text">
    8.64 +         <string>d4</string>
    8.65 +        </property>
    8.66 +       </item>
    8.67 +       <item>
    8.68 +        <property name="text">
    8.69 +         <string>d6</string>
    8.70 +        </property>
    8.71 +       </item>
    8.72 +       <item>
    8.73 +        <property name="text">
    8.74 +         <string>d8</string>
    8.75 +        </property>
    8.76 +       </item>
    8.77 +       <item>
    8.78 +        <property name="text">
    8.79 +         <string>d12</string>
    8.80 +        </property>
    8.81 +       </item>
    8.82 +       <item>
    8.83 +        <property name="text">
    8.84 +         <string>d20</string>
    8.85 +        </property>
    8.86 +       </item>
    8.87 +       <item>
    8.88 +        <property name="text">
    8.89 +         <string>d100</string>
    8.90 +        </property>
    8.91 +       </item>
    8.92 +      </widget>
    8.93 +     </item>
    8.94 +     <item>
    8.95 +      <spacer name="horizontalSpacer_2">
    8.96 +       <property name="orientation">
    8.97 +        <enum>Qt::Horizontal</enum>
    8.98 +       </property>
    8.99 +       <property name="sizeHint" stdset="0">
   8.100 +        <size>
   8.101 +         <width>40</width>
   8.102 +         <height>20</height>
   8.103 +        </size>
   8.104 +       </property>
   8.105 +      </spacer>
   8.106 +     </item>
   8.107 +    </layout>
   8.108 +   </item>
   8.109 +   <item>
   8.110 +    <spacer name="verticalSpacer_2">
   8.111 +     <property name="orientation">
   8.112 +      <enum>Qt::Vertical</enum>
   8.113 +     </property>
   8.114 +     <property name="sizeHint" stdset="0">
   8.115 +      <size>
   8.116 +       <width>20</width>
   8.117 +       <height>106</height>
   8.118 +      </size>
   8.119 +     </property>
   8.120 +    </spacer>
   8.121 +   </item>
   8.122 +   <item>
   8.123 +    <layout class="QHBoxLayout" name="horizontalLayout_2">
   8.124 +     <item>
   8.125 +      <spacer name="horizontalSpacer_3">
   8.126 +       <property name="orientation">
   8.127 +        <enum>Qt::Horizontal</enum>
   8.128 +       </property>
   8.129 +       <property name="sizeHint" stdset="0">
   8.130 +        <size>
   8.131 +         <width>40</width>
   8.132 +         <height>20</height>
   8.133 +        </size>
   8.134 +       </property>
   8.135 +      </spacer>
   8.136 +     </item>
   8.137 +     <item>
   8.138 +      <widget class="QLineEdit" name="tx_dice"/>
   8.139 +     </item>
   8.140 +     <item>
   8.141 +      <spacer name="horizontalSpacer_4">
   8.142 +       <property name="orientation">
   8.143 +        <enum>Qt::Horizontal</enum>
   8.144 +       </property>
   8.145 +       <property name="sizeHint" stdset="0">
   8.146 +        <size>
   8.147 +         <width>40</width>
   8.148 +         <height>20</height>
   8.149 +        </size>
   8.150 +       </property>
   8.151 +      </spacer>
   8.152 +     </item>
   8.153 +    </layout>
   8.154 +   </item>
   8.155 +   <item>
   8.156 +    <spacer name="verticalSpacer">
   8.157 +     <property name="orientation">
   8.158 +      <enum>Qt::Vertical</enum>
   8.159 +     </property>
   8.160 +     <property name="sizeHint" stdset="0">
   8.161 +      <size>
   8.162 +       <width>20</width>
   8.163 +       <height>106</height>
   8.164 +      </size>
   8.165 +     </property>
   8.166 +    </spacer>
   8.167 +   </item>
   8.168 +   <item>
   8.169 +    <widget class="QDialogButtonBox" name="buttonBox">
   8.170 +     <property name="orientation">
   8.171 +      <enum>Qt::Horizontal</enum>
   8.172 +     </property>
   8.173 +     <property name="standardButtons">
   8.174 +      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
   8.175 +     </property>
   8.176 +    </widget>
   8.177 +   </item>
   8.178 +  </layout>
   8.179 + </widget>
   8.180 + <resources/>
   8.181 + <connections>
   8.182 +  <connection>
   8.183 +   <sender>buttonBox</sender>
   8.184 +   <signal>accepted()</signal>
   8.185 +   <receiver>DiceDialog</receiver>
   8.186 +   <slot>accept()</slot>
   8.187 +   <hints>
   8.188 +    <hint type="sourcelabel">
   8.189 +     <x>227</x>
   8.190 +     <y>335</y>
   8.191 +    </hint>
   8.192 +    <hint type="destinationlabel">
   8.193 +     <x>157</x>
   8.194 +     <y>224</y>
   8.195 +    </hint>
   8.196 +   </hints>
   8.197 +  </connection>
   8.198 +  <connection>
   8.199 +   <sender>buttonBox</sender>
   8.200 +   <signal>rejected()</signal>
   8.201 +   <receiver>DiceDialog</receiver>
   8.202 +   <slot>reject()</slot>
   8.203 +   <hints>
   8.204 +    <hint type="sourcelabel">
   8.205 +     <x>295</x>
   8.206 +     <y>335</y>
   8.207 +    </hint>
   8.208 +    <hint type="destinationlabel">
   8.209 +     <x>286</x>
   8.210 +     <y>224</y>
   8.211 +    </hint>
   8.212 +   </hints>
   8.213 +  </connection>
   8.214 + </connections>
   8.215 +</ui>
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/ui/mainwin.ui	Thu Dec 19 13:34:40 2013 +0200
     9.3 @@ -0,0 +1,114 @@
     9.4 +<?xml version="1.0" encoding="UTF-8"?>
     9.5 +<ui version="4.0">
     9.6 + <class>MainWindow</class>
     9.7 + <widget class="QMainWindow" name="MainWindow">
     9.8 +  <property name="geometry">
     9.9 +   <rect>
    9.10 +    <x>0</x>
    9.11 +    <y>0</y>
    9.12 +    <width>938</width>
    9.13 +    <height>727</height>
    9.14 +   </rect>
    9.15 +  </property>
    9.16 +  <property name="windowTitle">
    9.17 +   <string>MainWindow</string>
    9.18 +  </property>
    9.19 +  <widget class="QWidget" name="centralWidget">
    9.20 +   <layout class="QVBoxLayout" name="verticalLayout">
    9.21 +    <item>
    9.22 +     <widget class="QScrollArea" name="sarea_main">
    9.23 +      <property name="widgetResizable">
    9.24 +       <bool>true</bool>
    9.25 +      </property>
    9.26 +      <widget class="QWidget" name="sarea_main_cont">
    9.27 +       <property name="geometry">
    9.28 +        <rect>
    9.29 +         <x>0</x>
    9.30 +         <y>0</y>
    9.31 +         <width>918</width>
    9.32 +         <height>594</height>
    9.33 +        </rect>
    9.34 +       </property>
    9.35 +      </widget>
    9.36 +     </widget>
    9.37 +    </item>
    9.38 +   </layout>
    9.39 +  </widget>
    9.40 +  <widget class="QMenuBar" name="menubar">
    9.41 +   <property name="geometry">
    9.42 +    <rect>
    9.43 +     <x>0</x>
    9.44 +     <y>0</y>
    9.45 +     <width>938</width>
    9.46 +     <height>38</height>
    9.47 +    </rect>
    9.48 +   </property>
    9.49 +   <widget class="QMenu" name="menu_file">
    9.50 +    <property name="title">
    9.51 +     <string>&amp;File</string>
    9.52 +    </property>
    9.53 +    <addaction name="action_start_server"/>
    9.54 +    <addaction name="action_connect"/>
    9.55 +    <addaction name="separator"/>
    9.56 +    <addaction name="action_add_die"/>
    9.57 +    <addaction name="separator"/>
    9.58 +    <addaction name="action_quit"/>
    9.59 +    <addaction name="action_add_dice"/>
    9.60 +   </widget>
    9.61 +   <widget class="QMenu" name="menu_help">
    9.62 +    <property name="title">
    9.63 +     <string>&amp;Help</string>
    9.64 +    </property>
    9.65 +    <addaction name="action_about"/>
    9.66 +   </widget>
    9.67 +   <addaction name="menu_file"/>
    9.68 +   <addaction name="menu_help"/>
    9.69 +  </widget>
    9.70 +  <widget class="QToolBar" name="toolbar">
    9.71 +   <attribute name="toolBarArea">
    9.72 +    <enum>TopToolBarArea</enum>
    9.73 +   </attribute>
    9.74 +   <attribute name="toolBarBreak">
    9.75 +    <bool>false</bool>
    9.76 +   </attribute>
    9.77 +   <addaction name="action_start_server"/>
    9.78 +   <addaction name="action_connect"/>
    9.79 +   <addaction name="action_add_die"/>
    9.80 +   <addaction name="action_add_dice"/>
    9.81 +  </widget>
    9.82 +  <widget class="QStatusBar" name="stautsbar"/>
    9.83 +  <action name="action_start_server">
    9.84 +   <property name="text">
    9.85 +    <string>Start &amp;Server</string>
    9.86 +   </property>
    9.87 +  </action>
    9.88 +  <action name="action_connect">
    9.89 +   <property name="text">
    9.90 +    <string>&amp;Connect</string>
    9.91 +   </property>
    9.92 +  </action>
    9.93 +  <action name="action_quit">
    9.94 +   <property name="text">
    9.95 +    <string>&amp;Quit</string>
    9.96 +   </property>
    9.97 +  </action>
    9.98 +  <action name="action_about">
    9.99 +   <property name="text">
   9.100 +    <string>&amp;About</string>
   9.101 +   </property>
   9.102 +  </action>
   9.103 +  <action name="action_add_die">
   9.104 +   <property name="text">
   9.105 +    <string>&amp;Add die</string>
   9.106 +   </property>
   9.107 +  </action>
   9.108 +  <action name="action_add_dice">
   9.109 +   <property name="text">
   9.110 +    <string>Add &amp;dice ...</string>
   9.111 +   </property>
   9.112 +  </action>
   9.113 + </widget>
   9.114 + <layoutdefault spacing="6" margin="11"/>
   9.115 + <resources/>
   9.116 + <connections/>
   9.117 +</ui>