not1mm 24.10.27.2__py3-none-any.whl → 24.11.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
not1mm/data/main.ui CHANGED
@@ -9,8 +9,8 @@
9
9
  <rect>
10
10
  <x>0</x>
11
11
  <y>0</y>
12
- <width>785</width>
13
- <height>268</height>
12
+ <width>855</width>
13
+ <height>641</height>
14
14
  </rect>
15
15
  </property>
16
16
  <property name="sizePolicy">
@@ -59,7 +59,7 @@
59
59
  <number>0</number>
60
60
  </property>
61
61
  <item row="1" column="0">
62
- <layout class="QVBoxLayout" name="verticalLayout" stretch="1,0,0">
62
+ <layout class="QVBoxLayout" name="verticalLayout" stretch="1,0,0,0">
63
63
  <item>
64
64
  <layout class="QHBoxLayout" name="mainsection">
65
65
  <item>
@@ -1302,7 +1302,7 @@
1302
1302
  <enum>Qt::FocusPolicy::NoFocus</enum>
1303
1303
  </property>
1304
1304
  <property name="text">
1305
- <string>Edit</string>
1305
+ <string>---</string>
1306
1306
  </property>
1307
1307
  </widget>
1308
1308
  </item>
@@ -1322,7 +1322,7 @@
1322
1322
  <enum>Qt::FocusPolicy::NoFocus</enum>
1323
1323
  </property>
1324
1324
  <property name="text">
1325
- <string>Store</string>
1325
+ <string>---</string>
1326
1326
  </property>
1327
1327
  </widget>
1328
1328
  </item>
@@ -1342,7 +1342,7 @@
1342
1342
  <enum>Qt::FocusPolicy::NoFocus</enum>
1343
1343
  </property>
1344
1344
  <property name="text">
1345
- <string>QRZ</string>
1345
+ <string>---</string>
1346
1346
  </property>
1347
1347
  </widget>
1348
1348
  </item>
@@ -1367,6 +1367,13 @@
1367
1367
  </item>
1368
1368
  </layout>
1369
1369
  </item>
1370
+ <item>
1371
+ <widget class="QLabel" name="history_info">
1372
+ <property name="text">
1373
+ <string/>
1374
+ </property>
1375
+ </widget>
1376
+ </item>
1370
1377
  <item>
1371
1378
  <layout class="QHBoxLayout" name="StatusLine">
1372
1379
  <property name="sizeConstraint">
@@ -1443,7 +1450,7 @@
1443
1450
  <rect>
1444
1451
  <x>0</x>
1445
1452
  <y>0</y>
1446
- <width>878</width>
1453
+ <width>855</width>
1447
1454
  <height>25</height>
1448
1455
  </rect>
1449
1456
  </property>
@@ -1476,6 +1483,7 @@
1476
1483
  <addaction name="separator"/>
1477
1484
  <addaction name="actionEdit_Macros"/>
1478
1485
  <addaction name="separator"/>
1486
+ <addaction name="actionLoad_Call_History_File"/>
1479
1487
  <addaction name="actionUpdate_CTY"/>
1480
1488
  <addaction name="actionUpdate_MASTER_SCP"/>
1481
1489
  <addaction name="separator"/>
@@ -1496,6 +1504,7 @@
1496
1504
  </property>
1497
1505
  <addaction name="actionCW_Macros"/>
1498
1506
  <addaction name="actionDark_Mode_2"/>
1507
+ <addaction name="actionCommand_Buttons_2"/>
1499
1508
  </widget>
1500
1509
  <widget class="QMenu" name="menuWindow">
1501
1510
  <property name="title">
@@ -1978,6 +1987,24 @@
1978
1987
  </font>
1979
1988
  </property>
1980
1989
  </action>
1990
+ <action name="actionLoad_Call_History_File">
1991
+ <property name="text">
1992
+ <string>Load Call History File</string>
1993
+ </property>
1994
+ </action>
1995
+ <action name="actionShow_Command_Buttons">
1996
+ <property name="text">
1997
+ <string>Command Buttons</string>
1998
+ </property>
1999
+ </action>
2000
+ <action name="actionCommand_Buttons_2">
2001
+ <property name="checkable">
2002
+ <bool>true</bool>
2003
+ </property>
2004
+ <property name="text">
2005
+ <string>Command Buttons</string>
2006
+ </property>
2007
+ </action>
1981
2008
  </widget>
1982
2009
  <resources/>
1983
2010
  <connections/>
@@ -367,6 +367,11 @@
367
367
  <string>PHONE WEEKLY TEST</string>
368
368
  </property>
369
369
  </item>
370
+ <item>
371
+ <property name="text">
372
+ <string>RAEM</string>
373
+ </property>
374
+ </item>
370
375
  <item>
371
376
  <property name="text">
372
377
  <string>REF CW</string>
not1mm/lib/database.py CHANGED
@@ -78,6 +78,7 @@ class DataBase:
78
78
  self.create_contest_table()
79
79
  self.create_contest_instance_table()
80
80
  self.create_station_table()
81
+ self.create_callhistory_table()
81
82
 
82
83
  @staticmethod
83
84
  def row_factory(cursor, row):
@@ -152,6 +153,36 @@ class DataBase:
152
153
  except sqlite3.OperationalError as exception:
153
154
  logger.debug("%s", exception)
154
155
 
156
+ def create_callhistory_table(self) -> None:
157
+ """creates the callhistory table"""
158
+ logger.debug("Creating DXLOG Table")
159
+ try:
160
+ with sqlite3.connect(self.database) as conn:
161
+ cursor = conn.cursor()
162
+ sql_command = (
163
+ "CREATE TABLE IF NOT EXISTS CALLHISTORY ("
164
+ "Call VARCHAR(15) NOT NULL, "
165
+ "Name VARCHAR(20), "
166
+ "Loc1 VARCHAR(6) DEFAULT '', "
167
+ "Loc2 VARCHAR(6) DEFAULT '', "
168
+ "Sect VARCHAR(8) DEFAULT '', "
169
+ "State VARCHAR(8) DEFAULT '', "
170
+ "CK TINYINT DEFAULT 0, "
171
+ "BirthDate DATE, "
172
+ "Exch1 VARCHAR(12) DEFAULT '', "
173
+ "Misc VARCHAR(15) DEFAULT '', "
174
+ "Power VARCHAR(8) DEFAULT '', "
175
+ "CqZone TINYINT DEFAULT 0, "
176
+ "ITUZone TINYINT DEFAULT 0, "
177
+ "UserText VARCHAR(60) DEFAULT '', "
178
+ "LastUpdateNote VARCHAR(20) DEFAULT '' "
179
+ ");"
180
+ )
181
+ cursor.execute(sql_command)
182
+ conn.commit()
183
+ except sqlite3.OperationalError as exception:
184
+ logger.debug("%s", exception)
185
+
155
186
  def update_dxlog_table(self) -> None:
156
187
  """update missing columns"""
157
188
  logger.debug("Updating DXLOG Table")
@@ -356,6 +387,49 @@ class DataBase:
356
387
  logger.debug("%s", exception)
357
388
  return {}
358
389
 
390
+ def add_callhistory_item(self, history: dict) -> None:
391
+ """Add an item to the call history db"""
392
+ pre = "INSERT INTO CALLHISTORY("
393
+ values = []
394
+ columns = ""
395
+ placeholders = ""
396
+ for key in history.keys():
397
+ columns += f"{key},"
398
+ values.append(history[key])
399
+ placeholders += "?,"
400
+ post = f") VALUES({placeholders[:-1]});"
401
+ sql = f"{pre}{columns[:-1]}{post}"
402
+
403
+ try:
404
+ with sqlite3.connect(self.database) as conn:
405
+ cur = conn.cursor()
406
+ cur.execute(sql, tuple(values))
407
+ conn.commit()
408
+ except sqlite3.Error as exception:
409
+ logger.info("%s", exception)
410
+
411
+ def add_callhistory_items(self, history_list: list) -> None:
412
+ """Add a list of items to the call history db"""
413
+ try:
414
+ with sqlite3.connect(self.database) as conn:
415
+ for history in history_list:
416
+ pre = "INSERT INTO CALLHISTORY("
417
+ values = []
418
+ columns = ""
419
+ placeholders = ""
420
+ for key in history.keys():
421
+ columns += f"{key},"
422
+ values.append(history[key])
423
+ placeholders += "?,"
424
+ post = f") VALUES({placeholders[:-1]});"
425
+ sql = f"{pre}{columns[:-1]}{post}"
426
+ cur = conn.cursor()
427
+ cur.execute(sql, tuple(values))
428
+ conn.commit()
429
+ except sqlite3.Error as exception:
430
+ print(exception)
431
+ logger.info("%s", exception)
432
+
359
433
  def add_contest(self, contest: dict) -> None:
360
434
  """Add Contest"""
361
435
 
@@ -465,6 +539,29 @@ class DataBase:
465
539
  except sqlite3.Error as exception:
466
540
  logger.info("DataBase delete_contact: %s", exception)
467
541
 
542
+ def delete_callhistory(self) -> None:
543
+ """Deletes all info from callhistory table."""
544
+ try:
545
+ with sqlite3.connect(self.database) as conn:
546
+ sql = "delete from CALLHISTORY;"
547
+ cur = conn.cursor()
548
+ cur.execute(sql)
549
+ conn.commit()
550
+ except sqlite3.Error as exception:
551
+ logger.info("%s", exception)
552
+
553
+ def fetch_call_history(self, call: str):
554
+ """"""
555
+ try:
556
+ with sqlite3.connect(self.database) as conn:
557
+ conn.row_factory = self.row_factory
558
+ cursor = conn.cursor()
559
+ cursor.execute(f"select * from CALLHISTORY where call='{call}';")
560
+ return cursor.fetchone()
561
+ except sqlite3.OperationalError as exception:
562
+ logger.debug("%s", exception)
563
+ return {}
564
+
468
565
  def fetch_all_contacts_asc(self) -> list:
469
566
  """returns a list of dicts with contacts in the database."""
470
567
  try:
not1mm/lib/settings.py CHANGED
@@ -19,6 +19,8 @@ class Settings(QtWidgets.QDialog):
19
19
  super().__init__(parent)
20
20
  self.logger = logging.getLogger("settings")
21
21
  uic.loadUi(app_data_path / "configuration.ui", self)
22
+ self.tabWidget.setTabVisible(5, False)
23
+ # self.group_tab.hide()
22
24
  self.buttonBox.accepted.connect(self.save_changes)
23
25
  self.usecwdaemon_radioButton.clicked.connect(self.set_cwdaemon_port_hint)
24
26
  self.usepywinkeyer_radioButton.clicked.connect(self.set_winkeyer_port_hint)
@@ -39,7 +41,11 @@ class Settings(QtWidgets.QDialog):
39
41
  def setup(self):
40
42
  """setup dialog"""
41
43
 
42
- self.use_esm.setChecked(bool(self.preference.get("use_esm")))
44
+ self.use_call_history.setChecked(
45
+ bool(self.preference.get("use_call_history", False))
46
+ )
47
+
48
+ self.use_esm.setChecked(bool(self.preference.get("use_esm", False)))
43
49
 
44
50
  value = self.preference.get("esm_agn", "DISABLED")
45
51
  index = self.esm_agn.findText(value)
@@ -188,6 +194,7 @@ class Settings(QtWidgets.QDialog):
188
194
  """
189
195
  Write preferences to json file.
190
196
  """
197
+ self.preference["use_call_history"] = self.use_call_history.isChecked()
191
198
  self.preference["use_esm"] = self.use_esm.isChecked()
192
199
  self.preference["esm_cq"] = self.esm_cq.currentText()
193
200
  self.preference["esm_agn"] = self.esm_agn.currentText()
not1mm/lib/version.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """It's the version"""
2
2
 
3
- __version__ = "24.10.27.2"
3
+ __version__ = "24.11.3"
@@ -134,6 +134,16 @@ def prefill(self):
134
134
  field.setText(serial_nr)
135
135
 
136
136
 
137
+ def check_call_history(self):
138
+ """"""
139
+ result = self.database.fetch_call_history(self.callsign.text())
140
+ print(f"{result=}")
141
+ if result:
142
+ self.history_info.setText(f"{result.get('UserText','')}")
143
+ if self.other_2.text() == "":
144
+ self.other_2.setText(f" {result.get('CK','')}{result.get('Sect', '')}")
145
+
146
+
137
147
  def points(self):
138
148
  """Calc point"""
139
149
  return 2